collabmd 0.1.55 → 0.1.56

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 (503) hide show
  1. package/README.md +1 -1
  2. package/dist/client/assets/{CodeMirrorEditor-UCMRAMCV-cMeDxAEL.js → CodeMirrorEditor-UCMRAMCV-CW5HP9uy.js} +1 -1
  3. package/dist/client/assets/{Middleware-DUgFSleI.js → Middleware-DbxtuTyG.js} +1 -1
  4. package/dist/client/assets/{abnfDiagram-VCTEODGH-D2UdmYvj.js → abnfDiagram-VCTEODGH-DY5tILUg.js} +1 -1
  5. package/dist/client/assets/{abnfDiagram-YUKMZFIV-DbmU4Q-X.js → abnfDiagram-WEYOIA3C-BqtDVimc.js} +1 -1
  6. package/dist/client/assets/api-client-utils-DkW9xiiw.js +1 -0
  7. package/dist/client/assets/{ar-SA-5WIASEJP-Di7OimCN.js → ar-SA-5WIASEJP-DbGUC-Fx.js} +1 -1
  8. package/dist/client/assets/{arc-DgcGdgmL.js → arc-Y1ARJVZ4.js} +1 -1
  9. package/dist/client/assets/architecture-7GRP2DOG-DndzY1Hb.js +1 -0
  10. package/dist/client/assets/architecture-WOLXFQ4H-tER6YKVA.js +1 -0
  11. package/dist/client/assets/{architectureDiagram-5GKGNRK7-CSiUzzeN.js → architectureDiagram-5GKGNRK7-D_ZiDWLO.js} +2 -2
  12. package/dist/client/assets/{architectureDiagram-47P4ROYG-C7OjXK9S.js → architectureDiagram-ZHVYKT53-CCmYbVDm.js} +2 -2
  13. package/dist/client/assets/{az-AZ-V5EUQD6C-C19OGTT_.js → az-AZ-V5EUQD6C-qK0euR1T.js} +1 -1
  14. package/dist/client/assets/babel-BaOs8qJH.js +16 -0
  15. package/dist/client/assets/{bg-BG-EXASCMTR-BIt0xWyb.js → bg-BG-EXASCMTR-DHvN8nO_.js} +1 -1
  16. package/dist/client/assets/{blockDiagram-I7D4REHJ-sXfAgK2w.js → blockDiagram-I7D4REHJ-CeN7xDSG.js} +2 -2
  17. package/dist/client/assets/{blockDiagram-E7TT5TSB-DMG-YlZw.js → blockDiagram-RJAE7QA3-CsHpm8AL.js} +2 -2
  18. package/dist/client/assets/{bn-BD-U4SYNFCO-CdNaPy4Q.js → bn-BD-U4SYNFCO-BKKqqvJ1.js} +1 -1
  19. package/dist/client/assets/{bn-IN-HKDJIITE-CdNaPy4Q.js → bn-IN-HKDJIITE-BKKqqvJ1.js} +1 -1
  20. package/dist/client/assets/{browser-BKLM0ThC-BCLQGPD6-CcMAHZXi.js → browser-BKLM0ThC-BCLQGPD6-B6uxmOe1.js} +1 -1
  21. package/dist/client/assets/{c4Diagram-7LVT6UL2-C88V_K-8.js → c4Diagram-7LVT6UL2-Bezmsa8k.js} +1 -1
  22. package/dist/client/assets/{c4Diagram-CRA5TL53-D3F9ElJv.js → c4Diagram-XDPPPE54-COKPOr_O.js} +1 -1
  23. package/dist/client/assets/{ca-ES-2KGUU5XB-C9t-c0cH.js → ca-ES-2KGUU5XB-CYClUOgC.js} +1 -1
  24. package/dist/client/assets/canvasEditor-CWbY0cMf.js +1 -0
  25. package/dist/client/assets/channel-COwKkfba.js +1 -0
  26. package/dist/client/assets/{chunk-24IY7LWP-flnn6SWX.js → chunk-24IY7LWP-DUl0BbtV.js} +1 -1
  27. package/dist/client/assets/chunk-2E4U76K2-CPmbCsOa.js +1 -0
  28. package/dist/client/assets/{chunk-AW2ZBBNX-DL0KGAdi.js → chunk-2E7WHVMD-CnfGYKwC.js} +1 -1
  29. package/dist/client/assets/chunk-2ZTRR5NV-CowhtTwB.js +2 -0
  30. package/dist/client/assets/{chunk-3M4EKCLJ-D-sZGCtO.js → chunk-3M4EKCLJ-BeG5ZU4c.js} +1 -1
  31. package/dist/client/assets/{chunk-3Z5EZCMW-Yx4Q5AcN.js → chunk-3Z5EZCMW-DQ1fwqmG.js} +1 -1
  32. package/dist/client/assets/{chunk-HTAEGDNF-C0PA_N-c.js → chunk-4EMNKR2T-B97vb0rp.js} +1 -1
  33. package/dist/client/assets/{chunk-4HAMMTFA-CQy6Skzw.js → chunk-4HAMMTFA-B3s0XvP_.js} +1 -1
  34. package/dist/client/assets/{chunk-4S7OKTRW-BpUW13a3.js → chunk-4S7OKTRW-DIpJGzf1.js} +1 -1
  35. package/dist/client/assets/{chunk-53FOQ5SW-5lPdGYP4.js → chunk-53FOQ5SW-C3TQxbLr.js} +1 -1
  36. package/dist/client/assets/{chunk-7TKQ45FW-rA2u-WUl.js → chunk-55XCU76K-CZBj2eVM.js} +1 -1
  37. package/dist/client/assets/{chunk-5V3GS4D5-BR7kgIgJ.js → chunk-5V3GS4D5-CD51GF-u.js} +1 -1
  38. package/dist/client/assets/{chunk-6AZGARVD-CnZDr4Cj.js → chunk-6AZGARVD-BD9EvFmU.js} +1 -1
  39. package/dist/client/assets/{chunk-6EIED4P4-Bp8dpTvX.js → chunk-6EIED4P4-CZFyd-Ct.js} +1 -1
  40. package/dist/client/assets/{chunk-6K3QC6MW-DGVRzL6v.js → chunk-6K3QC6MW-BJWmnHdF.js} +1 -1
  41. package/dist/client/assets/{chunk-6TQVIW2G-DgBX-Pv0.js → chunk-6TQVIW2G-DaBcb454.js} +1 -1
  42. package/dist/client/assets/chunk-747NJXEK-D08Z0c6r.js +2 -0
  43. package/dist/client/assets/{chunk-75Z2AOVW-BRdhvVTZ.js → chunk-75Z2AOVW-DLVzmKuL.js} +1 -1
  44. package/dist/client/assets/{chunk-3YJQHVM4-Ctp__8EK.js → chunk-7S6XSTFO-CXBGoJ7Z.js} +1 -1
  45. package/dist/client/assets/{chunk-E2ZNV5FY-D_07zfWd.js → chunk-AQDTSKZB-BpOOnFv4.js} +1 -1
  46. package/dist/client/assets/chunk-BP2KR52E-yBDJ_0ib.js +2 -0
  47. package/dist/client/assets/{chunk-CLGD4ZFX-DJiSE0gD.js → chunk-CLGD4ZFX-BBNA_mHW.js} +1 -1
  48. package/dist/client/assets/{chunk-VPRB5NB3-BqaJfj_v.js → chunk-DSNLSHJZ-DkAaVKkN.js} +2 -2
  49. package/dist/client/assets/{chunk-DU6HZSFF-C-18UZkS.js → chunk-DU6HZSFF-Dz0Q7VKE.js} +2 -2
  50. package/dist/client/assets/{chunk-SVEVUXB4-BnM-LXop.js → chunk-EJLWFMJV-CxNRZ5Ez.js} +1 -1
  51. package/dist/client/assets/{chunk-F27PBJKO-_beIJos4.js → chunk-F27PBJKO-BziR3pku.js} +1 -1
  52. package/dist/client/assets/chunk-F6S3BTY2-Dw9FK6Vq.js +2 -0
  53. package/dist/client/assets/chunk-FBWCRPUE-PUG6Mjdg.js +12 -0
  54. package/dist/client/assets/{chunk-FOHPRMQF-DzxwRta7.js → chunk-FOHPRMQF-COOliuUh.js} +8 -8
  55. package/dist/client/assets/{chunk-GMAD6QVW-DnZH7DxV.js → chunk-GMAD6QVW-B6zS4VJx.js} +1 -1
  56. package/dist/client/assets/{chunk-GVQU2GXP-B0Vm415C.js → chunk-GVQU2GXP-BA8Vt-19.js} +1 -1
  57. package/dist/client/assets/chunk-HAGFOTED-miSk6HXc.js +62 -0
  58. package/dist/client/assets/chunk-HNE4Q36P-BTbX-t8_.js +1 -0
  59. package/dist/client/assets/{chunk-I5DQTOEV-B98XA8VK.js → chunk-I5DQTOEV-qgbr-MbI.js} +1 -1
  60. package/dist/client/assets/{chunk-ICYGCRZG-D97UeqJs.js → chunk-ICYGCRZG-Dv6Hl9ds.js} +1 -1
  61. package/dist/client/assets/{chunk-IH6LHLGP-CvXe34hB.js → chunk-IH6LHLGP-DCTJcBuf.js} +1 -1
  62. package/dist/client/assets/{chunk-IMKFNOWR-DoO8IHzF.js → chunk-IMKFNOWR-DN2Mwt1n.js} +1 -1
  63. package/dist/client/assets/{chunk-KI3K4JFJ-D5XCPRZv.js → chunk-KI3K4JFJ-Hb_e7W2X.js} +1 -1
  64. package/dist/client/assets/{chunk-KPI5JJXK-B2ld5-w4.js → chunk-KPI5JJXK-BoDlpdVM.js} +1 -1
  65. package/dist/client/assets/{chunk-L3NEJ4N5-CvHossEU.js → chunk-L3NEJ4N5-M6XySblQ.js} +1 -1
  66. package/dist/client/assets/{chunk-LNGE3PJU-5nWSl6jJ.js → chunk-LNGE3PJU-CxdyKuxt.js} +4 -4
  67. package/dist/client/assets/{chunk-LNGE3PJU-5-SxdO55.js → chunk-LNGE3PJU-DRjopGY8.js} +4 -4
  68. package/dist/client/assets/{chunk-NGNAAXSQ-DqoPQk1a.js → chunk-NGNAAXSQ-Bw6tHVuc.js} +6 -6
  69. package/dist/client/assets/{chunk-EU5HNXII-CETVNUXF.js → chunk-NQOKRVIF-B_sOt25u.js} +1 -1
  70. package/dist/client/assets/chunk-NZIJZ2A6-CmC5bqJr.js +42 -0
  71. package/dist/client/assets/{chunk-OD3NTWWA-Dz9nCUGX.js → chunk-OD3NTWWA-D7wmrqo1.js} +1 -1
  72. package/dist/client/assets/{chunk-OSK3NFVY-C3JOcBao.js → chunk-OSK3NFVY-DJyrXrea.js} +1 -1
  73. package/dist/client/assets/chunk-OUJLGHUK-DIWqBvm0.js +2 -0
  74. package/dist/client/assets/chunk-OYAV6JZA-kXOh375k.js +1 -0
  75. package/dist/client/assets/{chunk-P2QGCYS3-Bfo8qS8r.js → chunk-P2QGCYS3-DejntbnV.js} +1 -1
  76. package/dist/client/assets/{chunk-POPQ4Y6H-sv6rCftH.js → chunk-POPQ4Y6H-D3VayDzJ.js} +1 -1
  77. package/dist/client/assets/{chunk-PWAF6VOD-B-AT-L2H.js → chunk-PWAF6VOD-CmxcnYFJ.js} +1 -1
  78. package/dist/client/assets/{chunk-QNH66VMT-Cb9xxTwQ.js → chunk-QNH66VMT-De2vWRUE.js} +1 -1
  79. package/dist/client/assets/{chunk-SHT3W25Y-C1lu518T.js → chunk-SHT3W25Y-SAi_Zk5G.js} +1 -1
  80. package/dist/client/assets/{chunk-SRAX5OIU-KFQikY-4.js → chunk-SRAX5OIU-wzfotNc-.js} +1 -1
  81. package/dist/client/assets/{chunk-SVP7TREG-CKqt0syj.js → chunk-SVP7TREG-BtK2J628.js} +1 -1
  82. package/dist/client/assets/{chunk-TICWLB2K-D2ZnWAfF.js → chunk-TICWLB2K-wmAorf_a.js} +1 -1
  83. package/dist/client/assets/{chunk-TLUHSLCS-BMIhqv1X.js → chunk-TLUHSLCS-DA3Sq1kc.js} +1 -1
  84. package/dist/client/assets/{chunk-TPMEZKFX-DIPHIqGb.js → chunk-TPMEZKFX-CarinQak.js} +1 -1
  85. package/dist/client/assets/{chunk-4EA7E6EY-bU4wRJot.js → chunk-UHW7PFBP-ClLfHtva.js} +1 -1
  86. package/dist/client/assets/{chunk-UY3FDG6J-DqSM_0FB.js → chunk-UY3FDG6J-BT57Gakr.js} +1 -1
  87. package/dist/client/assets/{chunk-VPELOWWC-DXayM28-.js → chunk-VPELOWWC-Dk0xIrB-.js} +1 -1
  88. package/dist/client/assets/{chunk-KQW6MTUR-OQ4MyMr_.js → chunk-VQ5W62QI-CxUPWJRX.js} +1 -1
  89. package/dist/client/assets/{chunk-VTWWFHGB-SZnJiyWY.js → chunk-VTWWFHGB-BZsdnDPL.js} +1 -1
  90. package/dist/client/assets/{chunk-VZTHESGH-eHyXmK8W.js → chunk-VZTHESGH-D6CHzqGr.js} +1 -1
  91. package/dist/client/assets/chunk-WQQL4CDK-BiuwKtd-.js +10 -0
  92. package/dist/client/assets/{chunk-X3CZISLH-DwWpRaN8.js → chunk-X3CZISLH-Bwnh_YJ7.js} +1 -1
  93. package/dist/client/assets/{chunk-X3CZISLH-BixgQztF.js → chunk-X3CZISLH-DayjKu55.js} +1 -1
  94. package/dist/client/assets/{chunk-YK26KJH5-DVy3MGMd.js → chunk-XHIXRSVI-C0fC7dJN.js} +1 -1
  95. package/dist/client/assets/{chunk-XXDRQBXY-C7hQHDmQ.js → chunk-XXDRQBXY-BxVnmMBx.js} +1 -1
  96. package/dist/client/assets/{chunk-XXDRQBXY-CdRN9Akd.js → chunk-XXDRQBXY-DBb3y0NH.js} +1 -1
  97. package/dist/client/assets/{chunk-XHIXRSVI-BSN7JlfK.js → chunk-YK26KJH5-ywVSJDLS.js} +1 -1
  98. package/dist/client/assets/{chunk-HJ2JQQFS-DQX7RePR.js → chunk-YZO67HFG-Bg5cZX5R.js} +1 -1
  99. package/dist/client/assets/{chunk-Z5NKEFVG-q6fHH75m.js → chunk-Z5NKEFVG-BPqw37Lj.js} +3 -3
  100. package/dist/client/assets/{chunk-DBDB3WZW-CXleNlok.js → chunk-ZAUX2LTX-Yte1ozQc.js} +1 -1
  101. package/dist/client/assets/chunk-ZCHMQSOR-B3FSat8d.js +1 -0
  102. package/dist/client/assets/chunk-ZO67DCNQ-DnpDWW4I.js +2 -0
  103. package/dist/client/assets/classDiagram-ZZMXUADV-CLl-Ahxw.js +1 -0
  104. package/dist/client/assets/{classDiagram-v2-K4WV4PDN-eaadfJDB.js → classDiagram-v2-4MYWR3UA-rPd2Vhml.js} +1 -1
  105. package/dist/client/assets/classDiagram-v2-VYDZK3BY-CLl-Ahxw.js +1 -0
  106. package/dist/client/assets/{clike-D_6L3tnO.js → clike-xvONpD0Z.js} +1 -1
  107. package/dist/client/assets/{clone-C1hp9FUh.js → clone-BoYpPplK.js} +1 -1
  108. package/dist/client/assets/{comment-markdown-renderer-CpBKaj7H.js → comment-markdown-renderer-a1B3HT_T.js} +1 -1
  109. package/dist/client/assets/{comment-thread-store-DUQsWtnu.js → comment-thread-store-da3_1rfw.js} +1 -1
  110. package/dist/client/assets/{comment-threads-DnfkLVJA.js → comment-threads-mG1CkBKO.js} +1 -1
  111. package/dist/client/assets/{comment-ui-shared-D_pgPUti.js → comment-ui-shared-4bhpJQpv.js} +2 -2
  112. package/dist/client/assets/{cose-bilkent-JH36ORCC-Czr0rwGr.js → cose-bilkent-JH36ORCC-BMHIGaXC.js} +1 -1
  113. package/dist/client/assets/{cose-bilkent-JH36ORCC-DLmEf9HS.js → cose-bilkent-JH36ORCC-Chlyw-Nt.js} +1 -1
  114. package/dist/client/assets/crystal-Bl6YKCG_.js +1 -0
  115. package/dist/client/assets/{cs-CZ-VUCGPRML-BfCoYAgj.js → cs-CZ-VUCGPRML-KFMLw537.js} +1 -1
  116. package/dist/client/assets/cynefin-EF2NZ3EQ-CwzF3ccb.js +1 -0
  117. package/dist/client/assets/cynefin-OW5HDTMX-CeLVR4kL.js +1 -0
  118. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-D2rFQG67.js → cynefinDiagram-5FMLGOSQ-No5A0--Q.js} +1 -1
  119. package/dist/client/assets/{cynefinDiagram-3GCD6N5R-DjpAsBHC.js → cynefinDiagram-WF24UDRP-BvwG2vI4.js} +1 -1
  120. package/dist/client/assets/cytoscape-cose-bilkent-iiiP-uiT.js +1 -0
  121. package/dist/client/assets/cytoscape-fcose-CiCTciSr.js +1 -0
  122. package/dist/client/assets/cytoscape.esm-CCmQRb78.js +321 -0
  123. package/dist/client/assets/{da-DK-NNDP2IVP-DBw9ZNTR.js → da-DK-NNDP2IVP-BpM-jMGR.js} +1 -1
  124. package/dist/client/assets/dagre-D7JM2Yhv.js +1 -0
  125. package/dist/client/assets/dagre-GXQ25YYZ-B0VZWLr5.js +4 -0
  126. package/dist/client/assets/dagre-NK4GIZVX-DoXdmyVb.js +4 -0
  127. package/dist/client/assets/{de-DE-WBQ3DQLR-DYW18Vsr.js → de-CH-I7RAVIZN-BNkaUG5V.js} +1 -1
  128. package/dist/client/assets/{de-CH-I7RAVIZN-DYW18Vsr.js → de-DE-WBQ3DQLR-BNkaUG5V.js} +1 -1
  129. package/dist/client/assets/{diagram-OVF4WLC6-D8_escYE.js → diagram-CBK3MWTC-hfExzGJR.js} +1 -1
  130. package/dist/client/assets/{diagram-UMYRVEAY-Djf7WDjZ.js → diagram-I5XIIV2D-Diz84D6I.js} +1 -1
  131. package/dist/client/assets/{diagram-PFPMY2P6-B1izZfrN.js → diagram-ODIL2UCW-lVgTk1r8.js} +2 -2
  132. package/dist/client/assets/{diagram-ZIFT7M5P-BUUK0oNw.js → diagram-PFBEJUXE-Dm-wXUUU.js} +1 -1
  133. package/dist/client/assets/{diagram-YEKJPTXX-B40bP3Yr.js → diagram-RJA3I4VV-Bv4ZAy4v.js} +1 -1
  134. package/dist/client/assets/{diagram-S7CK7UJ4-BzicH2t-.js → diagram-S7CK7UJ4-ClAT_J6s.js} +2 -2
  135. package/dist/client/assets/diagram-TYUNFSNR-CN-Xc6z9.js +200 -0
  136. package/dist/client/assets/{diagram-UQ7AKVKN-DqX4zTtr.js → diagram-UQ7AKVKN-DJ6uTWCE.js} +1 -1
  137. package/dist/client/assets/{diagram-VSXAHHWV-DnVbfI4Y.js → diagram-VSXAHHWV-C2k4OYGw.js} +1 -1
  138. package/dist/client/assets/{diagram-VX7I27RA-D-Dj0TQC.js → diagram-VX7I27RA-CLX2KoMs.js} +1 -1
  139. package/dist/client/assets/{diagram-Z3DM3KII-_iT7Uz5p.js → diagram-Z3DM3KII-BZcZUF57.js} +1 -1
  140. package/dist/client/assets/{direct-engine-DVLMOJWp-DWtWIifK.js → direct-engine-DVLMOJWp-C_tInsJx.js} +1 -1
  141. package/dist/client/assets/dist-7kwQLW_E.js +1 -0
  142. package/dist/client/assets/dist-B-G-pifG.js +11 -0
  143. package/dist/client/assets/dist-B0vhBQTT.js +13 -0
  144. package/dist/client/assets/dist-BBVAlyPS.js +1 -0
  145. package/dist/client/assets/dist-BGDa8poZ.js +1 -0
  146. package/dist/client/assets/{dist-CqkAY6Ot.js → dist-BJ93nZVx.js} +2 -2
  147. package/dist/client/assets/dist-BS271jN_.js +1 -0
  148. package/dist/client/assets/{dist-DRYFMufe.js → dist-BUgvZKJ6.js} +13 -13
  149. package/dist/client/assets/{dist-CSHJthAI.js → dist-BXomWIuA.js} +1 -1
  150. package/dist/client/assets/dist-BbrmdpPb.js +1 -0
  151. package/dist/client/assets/dist-BfvzS-2t.js +1 -0
  152. package/dist/client/assets/dist-Bt7Xaqyp.js +1 -0
  153. package/dist/client/assets/dist-BtOSkvqt.js +1 -0
  154. package/dist/client/assets/{dist-CKxETpSC.js → dist-C150LLfi.js} +6 -6
  155. package/dist/client/assets/dist-C6YYSeP1.js +9 -0
  156. package/dist/client/assets/{dist-FUFeH5Cx.js → dist-CFzMlwAz.js} +1 -1
  157. package/dist/client/assets/dist-CH86sVcz.js +1 -0
  158. package/dist/client/assets/dist-CP97HJ4M.js +1 -0
  159. package/dist/client/assets/dist-CVDt4G0T.js +1 -0
  160. package/dist/client/assets/{dist-C2niyEh0.js → dist-CbwTIhZ4.js} +1 -1
  161. package/dist/client/assets/dist-CfwwN8_Y.js +1 -0
  162. package/dist/client/assets/{dist-B_J_HbC0.js → dist-CumnGVmJ.js} +1 -1
  163. package/dist/client/assets/dist-CvwwJhwr.js +1 -0
  164. package/dist/client/assets/{dist-It70ktCU.js → dist-D-detfUV.js} +1 -1
  165. package/dist/client/assets/dist-DCaysCNp.js +1 -0
  166. package/dist/client/assets/{dist-CHUI56fT.js → dist-DCgncsfc.js} +3 -3
  167. package/dist/client/assets/dist-DFWn8cbH.js +1 -0
  168. package/dist/client/assets/dist-DKBDZ7Fw.js +1 -0
  169. package/dist/client/assets/{dist-BXXPaoUV.js → dist-DUrzEppq.js} +1 -1
  170. package/dist/client/assets/dist-Db2OLA3a.js +1 -0
  171. package/dist/client/assets/dist-Dd0BffVR.js +1 -0
  172. package/dist/client/assets/dist-X-11q-Vc.js +1 -0
  173. package/dist/client/assets/dist-aNZ025fx.js +23 -0
  174. package/dist/client/assets/{dist-Amm5Pr1C.js → dist-ftwTHAfS.js} +1 -1
  175. package/dist/client/assets/{dist-Bl4yuUS9.js → dist-hiG7zUCa.js} +1 -1
  176. package/dist/client/assets/{document-formatter-DtXmKZcy.js → document-formatter-B_jrdFGJ.js} +1 -1
  177. package/dist/client/assets/{drawioEditor-DO6IOaJ1.js → drawioEditor-DhRXvyRT.js} +2 -2
  178. package/dist/client/assets/{duration-BiuFXtXd.js → duration-DPNtiFfE.js} +1 -1
  179. package/dist/client/assets/{dylan-BCDoL_-p.js → dylan-S7ucR4pR.js} +1 -1
  180. package/dist/client/assets/{ebnfDiagram-PWID7BFC-IemGPf9X.js → ebnfDiagram-PWID7BFC-B8zzvt1e.js} +1 -1
  181. package/dist/client/assets/{ebnfDiagram-VR2GEFS7-9fXqy1DI.js → ebnfDiagram-V4P3TTPT-PjRB23H_.js} +1 -1
  182. package/dist/client/assets/{editor-session-CPsqXY_A.js → editor-session-BnTvcvzz.js} +2 -2
  183. package/dist/client/assets/{el-GR-TYQHVGXW-Dx82YYAS.js → el-GR-TYQHVGXW-BHUJHVd3.js} +1 -1
  184. package/dist/client/assets/elk-QONTBCTQ-DknSb2FG.js +27 -0
  185. package/dist/client/assets/embedpdf-VVX-wFIh.js +1 -0
  186. package/dist/client/assets/{embedpdf-cl9qiF45-CLMxJTMP.js → embedpdf-cl9qiF45-Cv92w6Wn.js} +6 -6
  187. package/dist/client/assets/en-AUO4QW63-CgjNrgHv.js +1 -0
  188. package/dist/client/assets/{erDiagram-O2IAPWRE-Cdadm-HN.js → erDiagram-KYQIGQAA-BHguakEd.js} +1 -1
  189. package/dist/client/assets/{erDiagram-RLTQ6QDP-CGGmjm8t.js → erDiagram-RLTQ6QDP-YPD0-iRc.js} +1 -1
  190. package/dist/client/assets/{es-ES-JEUOREKJ-Rx0NUQDl.js → es-ES-JEUOREKJ-CeuoqqTN.js} +1 -1
  191. package/dist/client/assets/{esm-BzZ1JFVo.js → esm-nC3n5xMZ.js} +5 -5
  192. package/dist/client/assets/{estree-DGmLqopC.js → estree-Cw-tQG5d.js} +4 -4
  193. package/dist/client/assets/{eu-ES-SO5DEEAN-CDYm-BcK.js → eu-ES-SO5DEEAN-D_7bAcKh.js} +1 -1
  194. package/dist/client/assets/eventmodeling-K75KTNOO-BsPoof5R.js +1 -0
  195. package/dist/client/assets/eventmodeling-NTZA5JFV-Bwo1LIKP.js +1 -0
  196. package/dist/client/assets/{excalidraw-element-link-NQnskRkm.js → excalidraw-element-link-BduFAMXS.js} +1 -1
  197. package/dist/client/assets/{excalidraw-scene-DLlw4jyc.js → excalidraw-scene-DzfbvjqT.js} +1 -1
  198. package/dist/client/assets/excalidrawEditor-3jfVRVmE.js +9 -0
  199. package/dist/client/assets/export-page-BiB1AeMg.js +46 -0
  200. package/dist/client/assets/exportDocument-BwukVyB9.js +2 -0
  201. package/dist/client/assets/{fa-IR-I4JNTJHK-CFtHZqoT.js → fa-IR-I4JNTJHK-BeoSOVqB.js} +1 -1
  202. package/dist/client/assets/{fi-FI-REAEF6HQ-BIpjJqIb.js → fi-FI-REAEF6HQ-BqIp6GiK.js} +1 -1
  203. package/dist/client/assets/file-search-D2UfqaRv.js +1 -0
  204. package/dist/client/assets/flowDiagram-HODETNUW-CVKOAnD7.js +1 -0
  205. package/dist/client/assets/flowDiagram-IUGLLWBU-BjEyR0dW.js +1 -0
  206. package/dist/client/assets/{fr-FR-SUCL7J6B-DGAKE8jH.js → fr-FR-SUCL7J6B-Dl3EFjA3.js} +1 -1
  207. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-Duu4KnsU.js → ganttDiagram-EL5Y4UJY-CCUwTKb4.js} +1 -1
  208. package/dist/client/assets/{ganttDiagram-R7TSEDQI-BWy52pjn.js → ganttDiagram-R7GPNTJY-CXLqT-aU.js} +2 -2
  209. package/dist/client/assets/gitGraph-4MIJSDKK-CWZptYrG.js +1 -0
  210. package/dist/client/assets/gitGraph-VSP46ZUC-x2Q42NFN.js +1 -0
  211. package/dist/client/assets/{gitGraphDiagram-XJZIOB7I-DJwp9ilx.js → gitGraphDiagram-PDYL7XHY-BJ9CsrRo.js} +1 -1
  212. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-CaJ0vC1a.js → gitGraphDiagram-WWUBYQGX-OqdVjcEn.js} +1 -1
  213. package/dist/client/assets/{gl-ES-KHCSOGVH-DWKh0CMu.js → gl-ES-KHCSOGVH-DGHdzXnJ.js} +1 -1
  214. package/dist/client/assets/groovy-CUrWKPia.js +1 -0
  215. package/dist/client/assets/{he-IL-JYXVXV2Q-zqbcM-4g.js → he-IL-JYXVXV2Q-DP8F40TD.js} +1 -1
  216. package/dist/client/assets/{hi-IN-BU52H3BO-CY8v6eG9.js → hi-IN-BU52H3BO-B1huAT2Y.js} +1 -1
  217. package/dist/client/assets/{html-BryNQ_yx.js → html-Drt7kOJE.js} +2 -2
  218. package/dist/client/assets/{hu-HU-OWADXDQ3-CEl6Udfh.js → hu-HU-OWADXDQ3-87zhVnWy.js} +1 -1
  219. package/dist/client/assets/{id-ID-2WY7E4VX-CCAeQpPr.js → id-ID-2WY7E4VX-BdFs5w71.js} +1 -1
  220. package/dist/client/assets/image-V6E7PHAZ-DSZxKLH0.js +1 -0
  221. package/dist/client/assets/image-blob-reduce.esm-ZiL83eII.js +2 -0
  222. package/dist/client/assets/image-lightbox-controller-DH39QMBp.js +184 -0
  223. package/dist/client/assets/index-BebSD0ym.js +960 -0
  224. package/dist/client/assets/info-A6RAGUB7-D_xaPiSc.js +1 -0
  225. package/dist/client/assets/info-OHQRW6UA-CBi78irM.js +1 -0
  226. package/dist/client/assets/{infoDiagram-27XIBGKW-DBJh7QOu.js → infoDiagram-27XIBGKW-Ck9hyDJb.js} +1 -1
  227. package/dist/client/assets/{infoDiagram-5W2HQ5XZ-DmWsqJ0w.js → infoDiagram-MVDRKAX5-DcpftzUS.js} +1 -1
  228. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-CeEbSJem.js → ishikawaDiagram-5VMMS53U-CazBMMkQ.js} +2 -2
  229. package/dist/client/assets/{ishikawaDiagram-K3B6WC7H-DH1NI35G.js → ishikawaDiagram-HPEHV2GE-BG5PpI0A.js} +2 -2
  230. package/dist/client/assets/{it-IT-INVHSAJF-DytAgndh.js → it-IT-INVHSAJF-DnUnri32.js} +1 -1
  231. package/dist/client/assets/{ja-JP-JBNTKYP4-BflWlGhw.js → ja-JP-JBNTKYP4-DIs2dSob.js} +1 -1
  232. package/dist/client/assets/javascript-DZ4Qsoqy.js +1 -0
  233. package/dist/client/assets/javascript-lj9EKOz0.js +1 -0
  234. package/dist/client/assets/{journeyDiagram-3NMN7TZE-BoIEEr6U.js → journeyDiagram-3NMN7TZE-DJFGpA3F.js} +1 -1
  235. package/dist/client/assets/{journeyDiagram-COXZFDF6-CnHV2f9V.js → journeyDiagram-BOSHW7O7-CAdC3Sr9.js} +1 -1
  236. package/dist/client/assets/{jsx-runtime-DKj5X9O4.js → jsx-runtime-CldxteV5.js} +1 -1
  237. package/dist/client/assets/{kaa-TC3VIB7V-B-xtZfy0.js → kaa-TC3VIB7V-wP2hxPDI.js} +1 -1
  238. package/dist/client/assets/{kab-KAB-UOUDSQKM-BmO0O4Y4.js → kab-KAB-UOUDSQKM-CwUZUlMm.js} +1 -1
  239. package/dist/client/assets/{kanban-definition-P3RFRI5V-Cxvn5ZAG.js → kanban-definition-FNSA4HC5-DLzqpQsC.js} +1 -1
  240. package/dist/client/assets/{kanban-definition-UXKFOSKX-BY16Tgbr.js → kanban-definition-UXKFOSKX-R91H_Ua5.js} +1 -1
  241. package/dist/client/assets/katex-B_JcIwqj.js +257 -0
  242. package/dist/client/assets/{katex-ZlcWpGUi.js → katex-DJhrJSbw.js} +1 -1
  243. package/dist/client/assets/{kk-KZ-P5H2X7YS-CSQFB8IN.js → kk-KZ-P5H2X7YS-Q3XzFKqf.js} +1 -1
  244. package/dist/client/assets/{km-KH-IHMV2US7-BxrjuEzr.js → km-KH-IHMV2US7-CxtoNVOY.js} +1 -1
  245. package/dist/client/assets/{ko-KR-ZTMANIDF-BnNRXd5J.js → ko-KR-ZTMANIDF-CJeG69_5.js} +1 -1
  246. package/dist/client/assets/{ku-TR-GPJTRB5G-BZM7f2aT.js → ku-TR-GPJTRB5G-D4gY4ec8.js} +1 -1
  247. package/dist/client/assets/{line-DEbP8Ok6.js → line-CttJWsP1.js} +1 -1
  248. package/dist/client/assets/linear-DGppY5mt.js +1 -0
  249. package/dist/client/assets/{lobby-presence-DNNXcuwR.js → lobby-presence-DWGiwZgG.js} +1 -1
  250. package/dist/client/assets/{lt-LT-V3XDOK3P-MVQBOHmF.js → lt-LT-V3XDOK3P-DTiFqRKt.js} +1 -1
  251. package/dist/client/assets/{lv-LV-DVQ3FADO-CrenwAhS.js → lv-LV-DVQ3FADO-BDx0eM98.js} +1 -1
  252. package/dist/client/assets/{markdown-DU84620G.js → markdown-C7cnJl_Q.js} +11 -11
  253. package/dist/client/assets/markdown-headings-CHNl_tgP.js +41 -0
  254. package/dist/client/assets/markdown-it-DWMS_G3H.js +13 -0
  255. package/dist/client/assets/{markdown-math-B96cnrz1.js → markdown-math-CBhbNj1w.js} +8 -8
  256. package/dist/client/assets/{merge-CALoRt3l.js → merge-5Ig019a6.js} +1 -1
  257. package/dist/client/assets/{mermaid-parser.core-R-uwU5kf.js → mermaid-parser.core-B89UfKha.js} +1 -1
  258. package/dist/client/assets/{mermaid-parser.core-mE6t1qEO.js → mermaid-parser.core-Dns-W-xX.js} +1 -1
  259. package/dist/client/assets/{mermaid.core-D8Z6LN7O.js → mermaid.core-8OvaaBlM.js} +3 -3
  260. package/dist/client/assets/{mindmap-definition-LZFPQGKD-DVfFenfJ.js → mindmap-definition-6OY57UG3-0aQEcLTH.js} +11 -9
  261. package/dist/client/assets/{mindmap-definition-YA3MSWOX-DtiE80UJ.js → mindmap-definition-YA3MSWOX-CCSfi8SE.js} +1 -1
  262. package/dist/client/assets/{mr-IN-VZ6HH5FE-B-PHPglH.js → mr-IN-VZ6HH5FE-Cofn25fc.js} +1 -1
  263. package/dist/client/assets/{my-MM-XYKWHRK6-Be5sYp5q.js → my-MM-XYKWHRK6-lMTCoeax.js} +1 -1
  264. package/dist/client/assets/{nb-NO-UNO2GGZJ-BvSKGdja.js → nb-NO-UNO2GGZJ-CEFDplVi.js} +1 -1
  265. package/dist/client/assets/{nginx-8H7HVH4w.js → nginx-C-ORUuei.js} +1 -1
  266. package/dist/client/assets/{nl-NL-76EFHT4P-C2yNx1Cj.js → nl-NL-76EFHT4P-2WbCYdRT.js} +1 -1
  267. package/dist/client/assets/{nn-NO-CFKD7ABE-4NsqlDRP.js → nn-NO-CFKD7ABE-DfK-9yuu.js} +1 -1
  268. package/dist/client/assets/{ntriples-B9h1VB_g.js → ntriples-CzMBulkp.js} +1 -1
  269. package/dist/client/assets/{oc-FR-YBJTCJ3J-B4OTQsWW.js → oc-FR-YBJTCJ3J-BSWusGxV.js} +1 -1
  270. package/dist/client/assets/{pa-IN-SNOXSMRV-CKj_sOG7.js → pa-IN-SNOXSMRV-BYkNTWiO.js} +1 -1
  271. package/dist/client/assets/packet-AYTQ26CC-D6Y_lKZt.js +1 -0
  272. package/dist/client/assets/packet-JDAUHWVQ-DAR0r-Im.js +1 -0
  273. package/dist/client/assets/{pegDiagram-BGZESJAR-DxfvEcwv.js → pegDiagram-ECIUJNBX-VujrKWCK.js} +1 -1
  274. package/dist/client/assets/{pegDiagram-XKGWAZYB-CyozY-Kt.js → pegDiagram-XKGWAZYB-DTA3EjtF.js} +1 -1
  275. package/dist/client/assets/percentages-LWOC67ZH-BO-ZFv57.js +1 -0
  276. package/dist/client/assets/pica-CXv_OHDX.js +2 -0
  277. package/dist/client/assets/{pie-DzWLGKAD.js → pie-Ba_4rf3r.js} +1 -1
  278. package/dist/client/assets/pie-WAS4IAKB-DLhltotv.js +1 -0
  279. package/dist/client/assets/pie-XZMESJXO-5MOdYfI0.js +1 -0
  280. package/dist/client/assets/{pieDiagram-E7YTZNPT-BRdmTkDq.js → pieDiagram-E7YTZNPT-DBz-eVG3.js} +1 -1
  281. package/dist/client/assets/{pieDiagram-CAPJLFHJ-CRlMcrv3.js → pieDiagram-GNMPY74T-CjRzeDCN.js} +1 -1
  282. package/dist/client/assets/{pl-PL-BSY6YFZ3-CFuzA6L0.js → pl-PL-BSY6YFZ3-DQTYFenp.js} +1 -1
  283. package/dist/client/assets/{powershell-BcIto6Sf.js → powershell-D8WpQPaX.js} +1 -1
  284. package/dist/client/assets/preload-helper-khBccGFq.js +1 -0
  285. package/dist/client/assets/preview-diagram-utils-ByzpiwPu.js +3 -0
  286. package/dist/client/assets/preview-render-compiler-B_gyVIfk.js +3 -0
  287. package/dist/client/assets/preview-render-worker-DYGDgbKA.js +579 -0
  288. package/dist/client/assets/prod-BTPZlnru.js +1 -0
  289. package/dist/client/assets/prod-CUXkwl3E.js +144 -0
  290. package/dist/client/assets/{pt-BR-CZDV62R3-CkPMtyNx.js → pt-BR-CZDV62R3-qKOF4THL.js} +1 -1
  291. package/dist/client/assets/{pt-PT-JO57XJJW-CBSnfGtF.js → pt-PT-JO57XJJW-CVFFmqez.js} +1 -1
  292. package/dist/client/assets/pug-CGoiHVBP.js +1 -0
  293. package/dist/client/assets/purify.es-BP9p1Dbb.js +3 -0
  294. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-7QyPIXkF.js → quadrantDiagram-AXDQQJYC-DaTj4J-B.js} +1 -1
  295. package/dist/client/assets/{quadrantDiagram-GDMTTRAM-DE30uqTl.js → quadrantDiagram-D57K4MC3-Bvy8uMKb.js} +1 -1
  296. package/dist/client/assets/quick-switcher-controller-m2gikuD-.js +1 -0
  297. package/dist/client/assets/radar-ABXABTNO-hhs6i-b1.js +1 -0
  298. package/dist/client/assets/radar-RG4KPBEZ-B-2eETsZ.js +1 -0
  299. package/dist/client/assets/railroad-74A4TZTK-B18ef5-Z.js +1 -0
  300. package/dist/client/assets/railroad-I3PHUGI6-v8Mk380c.js +1 -0
  301. package/dist/client/assets/railroad-abnf-HS5TGJTU-CTQaqjqj.js +1 -0
  302. package/dist/client/assets/railroad-abnf-LNEFI6M7-C3t6jbSY.js +1 -0
  303. package/dist/client/assets/railroad-ebnf-DWYD2UWJ-BvF5fO2B.js +1 -0
  304. package/dist/client/assets/railroad-ebnf-LZEXJU2U-BU_P5mpS.js +1 -0
  305. package/dist/client/assets/railroad-peg-JR7BVNR7-B90veE1n.js +1 -0
  306. package/dist/client/assets/railroad-peg-WCYAUIDC-CQCPL33M.js +1 -0
  307. package/dist/client/assets/{railroadDiagram-O6MQD6OU-BPk3RS2D.js → railroadDiagram-O6MQD6OU-DJRswcTS.js} +1 -1
  308. package/dist/client/assets/{railroadDiagram-SM67HX2B-CZRXJ647.js → railroadDiagram-Y72NRBL7-BNjzJfAu.js} +1 -1
  309. package/dist/client/assets/{requirementDiagram-BXWQKSXE-BRwfym6z.js → requirementDiagram-BXWQKSXE-DsljP03a.js} +1 -1
  310. package/dist/client/assets/{requirementDiagram-X7JNWC4A-BofCuLJA.js → requirementDiagram-EQYSW5RA-BKm3hJ3g.js} +1 -1
  311. package/dist/client/assets/{ro-RO-UZ5ICYYN-BOuntc_r.js → ro-RO-UZ5ICYYN-BgFoGyRb.js} +1 -1
  312. package/dist/client/assets/rolldown-runtime-COiEfhsA.js +1 -0
  313. package/dist/client/assets/{ru-RU-AN7JPREC-D-ow3SNR.js → ru-RU-AN7JPREC-C1Q9hhMw.js} +1 -1
  314. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-D4LcrKpW.js → sankeyDiagram-P5KCCOFB-7e3snR42.js} +1 -1
  315. package/dist/client/assets/{sankeyDiagram-UM26HJRW-CLKMDbej.js → sankeyDiagram-SY24JHO5-X6282wPp.js} +1 -1
  316. package/dist/client/assets/{sequenceDiagram-ZO4K6R2Y-CDP_m6ma.js → sequenceDiagram-BLEHNHQU-BytEbBel.js} +4 -4
  317. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-DQjtv-Bs.js → sequenceDiagram-WJ2MYXX4-Fy1RHQht.js} +2 -2
  318. package/dist/client/assets/{si-LK-7CBLD6QQ-c91EepX0.js → si-LK-7CBLD6QQ-B0AJbYON.js} +1 -1
  319. package/dist/client/assets/{sk-SK-SWR6DKBI-D5vFMIL6.js → sk-SK-SWR6DKBI-BSd-r0Zi.js} +1 -1
  320. package/dist/client/assets/{sl-SI-QY5KCFGA-RZhwMpQL.js → sl-SI-QY5KCFGA-Dzrhm7-L.js} +1 -1
  321. package/dist/client/assets/src-C2pSFGeK.js +1 -0
  322. package/dist/client/assets/{src-D5mvpivG.js → src-GGgGZJfE.js} +2 -2
  323. package/dist/client/assets/{standalone-D_lg5NC9.js → standalone-YobQElH8.js} +3 -3
  324. package/dist/client/assets/{stateDiagram-D77RDMKH-DSMvV-kF.js → stateDiagram-D77RDMKH-CW2cSnDj.js} +1 -1
  325. package/dist/client/assets/{stateDiagram-v2-TBUQTH76-Dc5-FKzd.js → stateDiagram-v2-A6IESKWZ-DZU6pVog.js} +1 -1
  326. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-iqEUZMAD.js +1 -0
  327. package/dist/client/assets/subset-shared.chunk-CL3Oizwd.js +1 -0
  328. package/dist/client/assets/{subset-worker.chunk-CoaGye2U.js → subset-worker.chunk-BdPjfgp2.js} +1 -1
  329. package/dist/client/assets/{sv-SE-O3OFCY3J-DnS86_7q.js → sv-SE-O3OFCY3J-6NoVnLTE.js} +1 -1
  330. package/dist/client/assets/swimlanes-42K2YHIH-8FngRMNT.js +1 -0
  331. package/dist/client/assets/swimlanes-B3ENRKFQ-D6BYdY9J.js +1 -0
  332. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-hRw-7uL-.js +8 -0
  333. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DvDPHOsc.js +8 -0
  334. package/dist/client/assets/{ta-IN-V6NHHU6Z-D5jy7_AE.js → ta-IN-V6NHHU6Z-MAwuBBtS.js} +1 -1
  335. package/dist/client/assets/{th-TH-WLSZUSBX-DHehoYR2.js → th-TH-WLSZUSBX-D--o8vzw.js} +1 -1
  336. package/dist/client/assets/{tiki-AK6FwT8q.js → tiki-CvUEFusT.js} +1 -1
  337. package/dist/client/assets/{timeline-definition-24CTP7MA-BvqCvSjy.js → timeline-definition-24CTP7MA-C_Q-Br6X.js} +1 -1
  338. package/dist/client/assets/{timeline-definition-YOQAKGHF-D2XWPSLs.js → timeline-definition-JXYKGLGB-7HLQ94MK.js} +1 -1
  339. package/dist/client/assets/{tr-TR-GUFYG22B-ClVaf8h1.js → tr-TR-GUFYG22B-Bd-NNmz1.js} +1 -1
  340. package/dist/client/assets/treeView-D4JQ5SDB-BR1FV1TU.js +1 -0
  341. package/dist/client/assets/treeView-Q6P3EWNA-3N1U2hq1.js +1 -0
  342. package/dist/client/assets/treemap-SAJKECNS-yO7fe4dH.js +1 -0
  343. package/dist/client/assets/treemap-WGGIJYW6-BFO1obBW.js +1 -0
  344. package/dist/client/assets/{uk-UA-K6SV5NFQ-BLTTtyNB.js → uk-UA-K6SV5NFQ-_OJVmMT9.js} +1 -1
  345. package/dist/client/assets/{usecaseDiagram-VIAY4XPW-CDe-IMjS.js → usecaseDiagram-WPOLBNNX-uIlXI205.js} +6 -6
  346. package/dist/client/assets/{uz-UZ-TVKTZO2G-Bm02Eg3D.js → uz-UZ-TVKTZO2G-BPXzC1bJ.js} +1 -1
  347. package/dist/client/assets/{vault-api-client-DrRW0QwO.js → vault-api-client-DORNT49K.js} +24 -6
  348. package/dist/client/assets/{vault-paths-BT-6nztu.js → vault-paths-R2qcfmE0.js} +1 -1
  349. package/dist/client/assets/{venn.esm-C5rDfA9t.js → venn.esm-BxwF8YNp.js} +1 -1
  350. package/dist/client/assets/{vennDiagram-4TSXK5OY-BW6Qp12d.js → vennDiagram-4TSXK5OY-Cl6f16-U.js} +1 -1
  351. package/dist/client/assets/{vennDiagram-BLWOH2XV-KxIPKpHi.js → vennDiagram-Q3Y3IDCW-DZFF_ntk.js} +1 -1
  352. package/dist/client/assets/{vi-VN-7FKFXJNO-CL3WPhmG.js → vi-VN-7FKFXJNO-CjP0avHF.js} +1 -1
  353. package/dist/client/assets/wardley-7MLQ67FV-CCVlnR9Q.js +1 -0
  354. package/dist/client/assets/wardley-WFR3VGLG-BuSMKsul.js +1 -0
  355. package/dist/client/assets/{wardleyDiagram-YMQ3BMBF-BNYqEy7M.js → wardleyDiagram-IVAIDKWA-bwMSFCgK.js} +1 -1
  356. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-BoCETVsK.js → wardleyDiagram-VM6X3IG4-BbU7rAxb.js} +1 -1
  357. package/dist/client/assets/{worker-engine-BCCrxWYm-1fphds7O.js → worker-engine-BCCrxWYm-BU5lrbSm.js} +1 -1
  358. package/dist/client/assets/workspace-sync-client-B7dmdJGR.js +1 -0
  359. package/dist/client/assets/{xychartDiagram-TAQBALBS-Sv6aaptV.js → xychartDiagram-4URNHDU4-AjWzA402.js} +1 -1
  360. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-eB5Fu9P7.js → xychartDiagram-S5SC5T6Z-C5L6jReS.js} +1 -1
  361. package/dist/client/assets/{yaml-BcZaqAz8.js → yaml-Breo7DWT.js} +4 -4
  362. package/dist/client/assets/{yjs-Jd9fna_Y.js → yjs-ZDLwhBUu.js} +1 -1
  363. package/dist/client/assets/{yjs-provider-reset-guard-Cqu0Z6xH.js → yjs-provider-reset-guard-D5pm5yx8.js} +1 -1
  364. package/dist/client/assets/{zh-CN-AOKVLNNK-DGidDH2b.js → zh-CN-AOKVLNNK-CU0vKHKs.js} +1 -1
  365. package/dist/client/assets/{zh-HK-CDKPF5DC-CRcNR3rk.js → zh-HK-CDKPF5DC-BBhn88ei.js} +1 -1
  366. package/dist/client/assets/{zh-TW-ZVGYESGW-C7Qji1y6.js → zh-TW-ZVGYESGW-od6h3pTc.js} +1 -1
  367. package/dist/client/canvas-editor.html +1 -1
  368. package/dist/client/drawio-editor.html +4 -4
  369. package/dist/client/excalidraw-editor.html +37 -37
  370. package/dist/client/export-document.html +2 -2
  371. package/dist/client/index.html +1 -1
  372. package/package.json +22 -22
  373. package/src/client/application/diagram-preview-export.js +2 -1
  374. package/src/client/application/mermaid-preview-hydrator.js +2 -1
  375. package/src/client/domain/excalidraw-scene.js +13 -11
  376. package/src/client/domain/mermaid-source.js +44 -0
  377. package/src/client/export/export-pipeline.js +7 -6
  378. package/src/client/infrastructure/webmcp-tool-registry.js +5 -8
  379. package/src/client/presentation/git-diff-view-controller.js +3 -3
  380. package/src/domain/excalidraw-room-codec.js +11 -10
  381. package/src/server/domain/collaboration/collaboration-room.js +92 -61
  382. package/src/server/infrastructure/persistence/sidecar-store.js +5 -1
  383. package/dist/client/assets/api-client-utils-C5ESDKMG.js +0 -1
  384. package/dist/client/assets/architecture-7GRP2DOG-BBwRXFv3.js +0 -1
  385. package/dist/client/assets/architecture-WOLXFQ4H-C0NxYiG7.js +0 -1
  386. package/dist/client/assets/babel-Bi_28hhi.js +0 -16
  387. package/dist/client/assets/canvasEditor-sBK7KfrD.js +0 -1
  388. package/dist/client/assets/channel-CgcHBnmr.js +0 -1
  389. package/dist/client/assets/chunk-2BW5OAIV-CNFO1U_e.js +0 -10
  390. package/dist/client/assets/chunk-2E4U76K2-DEnS5IbF.js +0 -1
  391. package/dist/client/assets/chunk-2ZTRR5NV-CnDP55cn.js +0 -2
  392. package/dist/client/assets/chunk-747NJXEK-Cur1aosP.js +0 -2
  393. package/dist/client/assets/chunk-BP2KR52E-DAQ1pzDV.js +0 -2
  394. package/dist/client/assets/chunk-F6S3BTY2-DVWKCAHp.js +0 -2
  395. package/dist/client/assets/chunk-FLFP27SU-CydzbSsY.js +0 -12
  396. package/dist/client/assets/chunk-FVRAUYC3-C7b9SJ81.js +0 -1
  397. package/dist/client/assets/chunk-H5A3YXKD-ChP7mNJq.js +0 -41
  398. package/dist/client/assets/chunk-NTY3LDVX-CVWLK_fh.js +0 -1
  399. package/dist/client/assets/chunk-OUJLGHUK-DA95-S9B.js +0 -2
  400. package/dist/client/assets/chunk-XC4XBNZT-D9oehSn8.js +0 -62
  401. package/dist/client/assets/chunk-Z6ETV63D-DOcrnz-P.js +0 -1
  402. package/dist/client/assets/chunk-ZO67DCNQ-BAOMIkLF.js +0 -2
  403. package/dist/client/assets/classDiagram-ZZMXUADV-BmETdFmC.js +0 -1
  404. package/dist/client/assets/classDiagram-v2-VYDZK3BY-BmETdFmC.js +0 -1
  405. package/dist/client/assets/crystal-Bsdphhtm.js +0 -1
  406. package/dist/client/assets/cynefin-EF2NZ3EQ-DVkJeZ8i.js +0 -1
  407. package/dist/client/assets/cynefin-OW5HDTMX-CF3N9j1_.js +0 -1
  408. package/dist/client/assets/cytoscape-cose-bilkent-NdTYBUiT.js +0 -1
  409. package/dist/client/assets/cytoscape-fcose-DE9_QRG_.js +0 -1
  410. package/dist/client/assets/cytoscape.esm-EK2DW5Qr.js +0 -321
  411. package/dist/client/assets/dagre-C-rnJpZF.js +0 -1
  412. package/dist/client/assets/dagre-GXQ25YYZ-Cku9eia9.js +0 -4
  413. package/dist/client/assets/dagre-W4DXFKR2-DOMOIsPd.js +0 -4
  414. package/dist/client/assets/diagram-2UJZ2QOL-D8WvnEyx.js +0 -200
  415. package/dist/client/assets/dist-26Ce-5t4.js +0 -1
  416. package/dist/client/assets/dist-8MLNn-I6.js +0 -1
  417. package/dist/client/assets/dist-Bkb-_VdB.js +0 -1
  418. package/dist/client/assets/dist-C2CGvCPd.js +0 -1
  419. package/dist/client/assets/dist-CFCSUmJk.js +0 -1
  420. package/dist/client/assets/dist-CJh3Qrid.js +0 -13
  421. package/dist/client/assets/dist-CbKnZGN4.js +0 -1
  422. package/dist/client/assets/dist-Cik4RJXj.js +0 -1
  423. package/dist/client/assets/dist-D2ql2LCd.js +0 -1
  424. package/dist/client/assets/dist-D47MOYFN.js +0 -1
  425. package/dist/client/assets/dist-DBhUaexM.js +0 -1
  426. package/dist/client/assets/dist-DJux6Vc5.js +0 -1
  427. package/dist/client/assets/dist-DLNdMWPH.js +0 -1
  428. package/dist/client/assets/dist-DPJj-Y3l.js +0 -1
  429. package/dist/client/assets/dist-DTGcVSU8.js +0 -1
  430. package/dist/client/assets/dist-DlOxjzWi.js +0 -9
  431. package/dist/client/assets/dist-DogjjM_B.js +0 -1
  432. package/dist/client/assets/dist-Dyv_RvyB.js +0 -23
  433. package/dist/client/assets/dist-QMvcnJHf.js +0 -1
  434. package/dist/client/assets/dist-QN1K2czv.js +0 -11
  435. package/dist/client/assets/dist-W8ilOKl3.js +0 -1
  436. package/dist/client/assets/dist-_17-t9qP.js +0 -1
  437. package/dist/client/assets/dist-uE774WWs.js +0 -1
  438. package/dist/client/assets/elk-IJKZMXRS-DsbrbBYg.js +0 -27
  439. package/dist/client/assets/embedpdf-BfUI-3pv.js +0 -1
  440. package/dist/client/assets/en-7ZVUCEYH-C_VXKxxb.js +0 -1
  441. package/dist/client/assets/eventmodeling-K75KTNOO-BWBlZ5cR.js +0 -1
  442. package/dist/client/assets/eventmodeling-NTZA5JFV-CDy1bN6j.js +0 -1
  443. package/dist/client/assets/excalidrawEditor-W2lZ5Mej.js +0 -9
  444. package/dist/client/assets/export-page-Bomh9oEr.js +0 -46
  445. package/dist/client/assets/exportDocument-BFIOECJ3.js +0 -2
  446. package/dist/client/assets/file-search-Dk2O14Vw.js +0 -1
  447. package/dist/client/assets/flowDiagram-HODETNUW-DcVVYJUZ.js +0 -1
  448. package/dist/client/assets/flowDiagram-OXPTDLAJ-Dy6y46oF.js +0 -1
  449. package/dist/client/assets/gitGraph-4MIJSDKK-B-rpDYbz.js +0 -1
  450. package/dist/client/assets/gitGraph-VSP46ZUC-1499lQAI.js +0 -1
  451. package/dist/client/assets/groovy-CUpZ7dEl.js +0 -1
  452. package/dist/client/assets/image-6XY3GD3F-DCWbu6d4.js +0 -1
  453. package/dist/client/assets/image-blob-reduce.esm-BFq-Mx5V.js +0 -2
  454. package/dist/client/assets/image-lightbox-controller-DAcXEXxT.js +0 -184
  455. package/dist/client/assets/index-D3WGkxfI.js +0 -960
  456. package/dist/client/assets/info-A6RAGUB7-BlutK7BT.js +0 -1
  457. package/dist/client/assets/info-OHQRW6UA-BDFQOo4H.js +0 -1
  458. package/dist/client/assets/javascript-B9I2pbsP.js +0 -1
  459. package/dist/client/assets/javascript-DctB8BJo.js +0 -1
  460. package/dist/client/assets/katex-9NBMfU68.js +0 -257
  461. package/dist/client/assets/linear-DExL6ILt.js +0 -1
  462. package/dist/client/assets/markdown-headings-zYEUahfW.js +0 -41
  463. package/dist/client/assets/markdown-it-DpvIRaVq.js +0 -13
  464. package/dist/client/assets/packet-AYTQ26CC-DvbY8dI6.js +0 -1
  465. package/dist/client/assets/packet-JDAUHWVQ-DJ9K2MA4.js +0 -1
  466. package/dist/client/assets/percentages-LWOC67ZH-VhvllE7L.js +0 -1
  467. package/dist/client/assets/pica-BPrp-GK1.js +0 -2
  468. package/dist/client/assets/pie-WAS4IAKB-DWSm9SSD.js +0 -1
  469. package/dist/client/assets/pie-XZMESJXO-CQIQasY-.js +0 -1
  470. package/dist/client/assets/preload-helper-CYtfOYgs.js +0 -1
  471. package/dist/client/assets/preview-diagram-utils-txBCoW8d.js +0 -1
  472. package/dist/client/assets/preview-render-compiler-D_aJv7Ew.js +0 -3
  473. package/dist/client/assets/preview-render-worker-dFNyrVyB.js +0 -579
  474. package/dist/client/assets/prod-ItolaHmf.js +0 -145
  475. package/dist/client/assets/prod-rdly4JJQ.js +0 -1
  476. package/dist/client/assets/pug-CqqUmdG7.js +0 -1
  477. package/dist/client/assets/purify.es-go7v6Te-.js +0 -3
  478. package/dist/client/assets/quick-switcher-controller-DsK70I7K.js +0 -1
  479. package/dist/client/assets/radar-ABXABTNO-ByfpCXh9.js +0 -1
  480. package/dist/client/assets/radar-RG4KPBEZ-BfNQUEQy.js +0 -1
  481. package/dist/client/assets/railroad-74A4TZTK-BaQ6U6eJ.js +0 -1
  482. package/dist/client/assets/railroad-I3PHUGI6-CTUn9HhI.js +0 -1
  483. package/dist/client/assets/railroad-abnf-HS5TGJTU-BJ3KZw7J.js +0 -1
  484. package/dist/client/assets/railroad-abnf-LNEFI6M7-Ct-b-y0F.js +0 -1
  485. package/dist/client/assets/railroad-ebnf-DWYD2UWJ-BZMYMWOe.js +0 -1
  486. package/dist/client/assets/railroad-ebnf-LZEXJU2U-DA0sEq7w.js +0 -1
  487. package/dist/client/assets/railroad-peg-JR7BVNR7-Dj23PxYc.js +0 -1
  488. package/dist/client/assets/railroad-peg-WCYAUIDC-DCmlICzO.js +0 -1
  489. package/dist/client/assets/rolldown-runtime-Dd_uD5pT.js +0 -1
  490. package/dist/client/assets/src-XiVvaevx.js +0 -1
  491. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-ClmOOUsT.js +0 -1
  492. package/dist/client/assets/subset-shared.chunk-BXlA-9CO.js +0 -1
  493. package/dist/client/assets/swimlanes-42K2YHIH-BUz31lO3.js +0 -1
  494. package/dist/client/assets/swimlanes-N4OXWK64-Dd3dFdPD.js +0 -1
  495. package/dist/client/assets/swimlanesDiagram-K3J5GTZL-Bz9gFdls.js +0 -8
  496. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DoDs3zod.js +0 -8
  497. package/dist/client/assets/treeView-D4JQ5SDB-DcX7Bx0H.js +0 -1
  498. package/dist/client/assets/treeView-Q6P3EWNA-BvHOzbu9.js +0 -1
  499. package/dist/client/assets/treemap-SAJKECNS-BcCHmcAX.js +0 -1
  500. package/dist/client/assets/treemap-WGGIJYW6-oety7paS.js +0 -1
  501. package/dist/client/assets/wardley-7MLQ67FV-DOahSwbZ.js +0 -1
  502. package/dist/client/assets/wardley-WFR3VGLG-BdwDpX_I.js +0 -1
  503. package/dist/client/assets/workspace-sync-client-C_P9wtjf.js +0 -1
@@ -1,4 +1,4 @@
1
- import{p as e}from"./src-XiVvaevx.js";import{n as t}from"./chunk-Y2CYZVJY-BbRBGnmc.js";import{t as n}from"./chunk-X3CZISLH-DwWpRaN8.js";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-VPRB5NB3-BqaJfj_v.js";import"./chunk-HJ2JQQFS-DQX7RePR.js";import{_ as m}from"./chunk-3YJQHVM4-Ctp__8EK.js";import{i as h}from"./chunk-E2ZNV5FY-D_07zfWd.js";import"./chunk-4EA7E6EY-bU4wRJot.js";import{a as g,i as _,o as ee,r as v}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import"./chunk-XC4XBNZT-D9oehSn8.js";import"./chunk-DBDB3WZW-CXleNlok.js";import"./chunk-2BW5OAIV-CNFO1U_e.js";import{t as te}from"./chunk-XXDRQBXY-C7hQHDmQ.js";import{t as ne}from"./chunk-KQW6MTUR-OQ4MyMr_.js";import"./chunk-NTY3LDVX-CVWLK_fh.js";import{r as re,t as ie}from"./chunk-SVEVUXB4-BnM-LXop.js";function ae(e){console&&console.error&&console.error(`Error: ${e}`)}function y(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function oe(e){let t=new Date().getTime(),n=e();return{time:new Date().getTime()-t,value:n}}function se(e){function t(){}t.prototype=e;let n=new t;function r(){return typeof n.bar}return r(),r(),e}function ce(e){return le(e)?e.LABEL:e.name}function le(e){return typeof e.LABEL==`string`&&e.LABEL!==``}var b=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)})}},x=class extends b{constructor(e){super([]),this.idx=1,Object.assign(this,j(e))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},S=class extends b{constructor(e){super(e.definition),this.orgText=``,Object.assign(this,j(e))}},C=class extends b{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,j(e))}},w=class extends b{constructor(e){super(e.definition),this.idx=1,Object.assign(this,j(e))}},T=class extends b{constructor(e){super(e.definition),this.idx=1,Object.assign(this,j(e))}},E=class extends b{constructor(e){super(e.definition),this.idx=1,Object.assign(this,j(e))}},D=class extends b{constructor(e){super(e.definition),this.idx=1,Object.assign(this,j(e))}},O=class extends b{constructor(e){super(e.definition),this.idx=1,Object.assign(this,j(e))}},k=class extends b{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,j(e))}},A=class{constructor(e){this.idx=1,Object.assign(this,j(e))}accept(e){e.visit(this)}};function ue(e){return e.map(de)}function de(e){function t(e){return e.map(de)}if(e instanceof x){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return typeof e.label==`string`&&(t.label=e.label),t}if(e instanceof C)return{type:`Alternative`,definition:t(e.definition)};if(e instanceof w)return{type:`Option`,idx:e.idx,definition:t(e.definition)};if(e instanceof T)return{type:`RepetitionMandatory`,idx:e.idx,definition:t(e.definition)};if(e instanceof E)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:de(new A({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof O)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:de(new A({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof D)return{type:`Repetition`,idx:e.idx,definition:t(e.definition)};if(e instanceof k)return{type:`Alternation`,idx:e.idx,definition:t(e.definition)};if(e instanceof A){let t={type:`Terminal`,name:e.terminalType.name,label:ce(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 S)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error(`non exhaustive match`)}function j(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var fe=class{visit(e){let t=e;switch(t.constructor){case x:return this.visitNonTerminal(t);case C:return this.visitAlternative(t);case w:return this.visitOption(t);case T:return this.visitRepetitionMandatory(t);case E:return this.visitRepetitionMandatoryWithSeparator(t);case O:return this.visitRepetitionWithSeparator(t);case D:return this.visitRepetition(t);case k:return this.visitAlternation(t);case A:return this.visitTerminal(t);case S: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 pe(e){return e instanceof C||e instanceof w||e instanceof D||e instanceof T||e instanceof E||e instanceof O||e instanceof A||e instanceof S}function me(e,t=[]){return e instanceof w||e instanceof D||e instanceof O?!0:e instanceof k?e.definition.some(e=>me(e,t)):e instanceof x&&t.includes(e)?!1:e instanceof b&&(e instanceof x&&t.push(e),e.definition.every(e=>me(e,t)))}function he(e){return e instanceof k}function M(e){if(e instanceof x)return`SUBRULE`;if(e instanceof w)return`OPTION`;if(e instanceof k)return`OR`;if(e instanceof T)return`AT_LEAST_ONE`;if(e instanceof E)return`AT_LEAST_ONE_SEP`;if(e instanceof O)return`MANY_SEP`;if(e instanceof D)return`MANY`;if(e instanceof A)return`CONSUME`;throw Error(`non exhaustive match`)}var ge=class{walk(e,t=[]){e.definition.forEach((n,r)=>{let i=e.definition.slice(r+1);if(n instanceof x)this.walkProdRef(n,i,t);else if(n instanceof A)this.walkTerminal(n,i,t);else if(n instanceof C)this.walkFlat(n,i,t);else if(n instanceof w)this.walkOption(n,i,t);else if(n instanceof T)this.walkAtLeastOne(n,i,t);else if(n instanceof E)this.walkAtLeastOneSep(n,i,t);else if(n instanceof O)this.walkManySep(n,i,t);else if(n instanceof D)this.walkMany(n,i,t);else if(n instanceof k)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 w({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){let r=_e(e,t,n);this.walk(e,r)}walkMany(e,t,n){let r=[new w({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){let r=_e(e,t,n);this.walk(e,r)}walkOr(e,t,n){let r=t.concat(n);e.definition.forEach(e=>{let t=new C({definition:[e]});this.walk(t,r)})}};function _e(e,t,n){return[new w({definition:[new A({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function ve(e){if(e instanceof x)return ve(e.referencedRule);if(e instanceof A)return xe(e);if(pe(e))return ye(e);if(he(e))return be(e);throw Error(`non exhaustive match`)}function ye(e){let t=[],n=e.definition,r=0,i=n.length>r,a,o=!0;for(;i&&o;)a=n[r],o=me(a),t=t.concat(ve(a)),r+=1,i=n.length>r;return[...new Set(t)]}function be(e){let t=e.definition.map(e=>ve(e));return[...new Set(t.flat())]}function xe(e){return[e.terminalType]}var Se=`_~IN~_`,Ce=class extends ge{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=Te(e.referencedRule,e.idx)+this.topProd.name,i=ve(new C({definition:t.concat(n)}));this.follows[r]=i}};function we(e){let t={};return e.forEach(e=>{let n=new Ce(e).startWalking();Object.assign(t,n)}),t}function Te(e,t){return e.name+t+Se}function N(e){return e.charCodeAt(0)}function Ee(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function De(e,t){if(e[t]===!0)throw`duplicate flag `+t;e[t],e[t]=!0}function Oe(e){if(e===void 0)throw Error(`Internal Error - Should never get here!`);return!0}function ke(){throw Error(`Internal Error - Should never get here!`)}function Ae(e){return e.type===`Character`}var je=[];for(let e=N(`0`);e<=N(`9`);e++)je.push(e);var Me=[N(`_`)].concat(je);for(let e=N(`a`);e<=N(`z`);e++)Me.push(e);for(let e=N(`A`);e<=N(`Z`);e++)Me.push(e);var Ne=[N(` `),N(`\f`),N(`
1
+ import{p as e}from"./src-C2pSFGeK.js";import{n as t}from"./chunk-Y2CYZVJY-BbRBGnmc.js";import{t as n}from"./chunk-X3CZISLH-Bwnh_YJ7.js";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-DkAaVKkN.js";import"./chunk-YZO67HFG-Bg5cZX5R.js";import{_ as m}from"./chunk-7S6XSTFO-CXBGoJ7Z.js";import{i as h}from"./chunk-AQDTSKZB-BpOOnFv4.js";import"./chunk-UHW7PFBP-ClLfHtva.js";import{a as g,i as _,o as ee,r as v}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import"./chunk-HAGFOTED-miSk6HXc.js";import"./chunk-ZAUX2LTX-Yte1ozQc.js";import"./chunk-WQQL4CDK-BiuwKtd-.js";import{t as te}from"./chunk-XXDRQBXY-BxVnmMBx.js";import{t as ne}from"./chunk-VQ5W62QI-CxUPWJRX.js";import"./chunk-HNE4Q36P-BTbX-t8_.js";import{r as re,t as ie}from"./chunk-EJLWFMJV-CxNRZ5Ez.js";function ae(e){console&&console.error&&console.error(`Error: ${e}`)}function y(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function oe(e){let t=new Date().getTime(),n=e();return{time:new Date().getTime()-t,value:n}}function se(e){function t(){}t.prototype=e;let n=new t;function r(){return typeof n.bar}return r(),r(),e}function ce(e){return le(e)?e.LABEL:e.name}function le(e){return typeof e.LABEL==`string`&&e.LABEL!==``}var b=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)})}},x=class extends b{constructor(e){super([]),this.idx=1,Object.assign(this,j(e))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},S=class extends b{constructor(e){super(e.definition),this.orgText=``,Object.assign(this,j(e))}},C=class extends b{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,j(e))}},w=class extends b{constructor(e){super(e.definition),this.idx=1,Object.assign(this,j(e))}},T=class extends b{constructor(e){super(e.definition),this.idx=1,Object.assign(this,j(e))}},E=class extends b{constructor(e){super(e.definition),this.idx=1,Object.assign(this,j(e))}},D=class extends b{constructor(e){super(e.definition),this.idx=1,Object.assign(this,j(e))}},O=class extends b{constructor(e){super(e.definition),this.idx=1,Object.assign(this,j(e))}},k=class extends b{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,j(e))}},A=class{constructor(e){this.idx=1,Object.assign(this,j(e))}accept(e){e.visit(this)}};function ue(e){return e.map(de)}function de(e){function t(e){return e.map(de)}if(e instanceof x){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return typeof e.label==`string`&&(t.label=e.label),t}if(e instanceof C)return{type:`Alternative`,definition:t(e.definition)};if(e instanceof w)return{type:`Option`,idx:e.idx,definition:t(e.definition)};if(e instanceof T)return{type:`RepetitionMandatory`,idx:e.idx,definition:t(e.definition)};if(e instanceof E)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:de(new A({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof O)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:de(new A({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof D)return{type:`Repetition`,idx:e.idx,definition:t(e.definition)};if(e instanceof k)return{type:`Alternation`,idx:e.idx,definition:t(e.definition)};if(e instanceof A){let t={type:`Terminal`,name:e.terminalType.name,label:ce(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 S)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error(`non exhaustive match`)}function j(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var fe=class{visit(e){let t=e;switch(t.constructor){case x:return this.visitNonTerminal(t);case C:return this.visitAlternative(t);case w:return this.visitOption(t);case T:return this.visitRepetitionMandatory(t);case E:return this.visitRepetitionMandatoryWithSeparator(t);case O:return this.visitRepetitionWithSeparator(t);case D:return this.visitRepetition(t);case k:return this.visitAlternation(t);case A:return this.visitTerminal(t);case S: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 pe(e){return e instanceof C||e instanceof w||e instanceof D||e instanceof T||e instanceof E||e instanceof O||e instanceof A||e instanceof S}function me(e,t=[]){return e instanceof w||e instanceof D||e instanceof O?!0:e instanceof k?e.definition.some(e=>me(e,t)):e instanceof x&&t.includes(e)?!1:e instanceof b&&(e instanceof x&&t.push(e),e.definition.every(e=>me(e,t)))}function he(e){return e instanceof k}function M(e){if(e instanceof x)return`SUBRULE`;if(e instanceof w)return`OPTION`;if(e instanceof k)return`OR`;if(e instanceof T)return`AT_LEAST_ONE`;if(e instanceof E)return`AT_LEAST_ONE_SEP`;if(e instanceof O)return`MANY_SEP`;if(e instanceof D)return`MANY`;if(e instanceof A)return`CONSUME`;throw Error(`non exhaustive match`)}var ge=class{walk(e,t=[]){e.definition.forEach((n,r)=>{let i=e.definition.slice(r+1);if(n instanceof x)this.walkProdRef(n,i,t);else if(n instanceof A)this.walkTerminal(n,i,t);else if(n instanceof C)this.walkFlat(n,i,t);else if(n instanceof w)this.walkOption(n,i,t);else if(n instanceof T)this.walkAtLeastOne(n,i,t);else if(n instanceof E)this.walkAtLeastOneSep(n,i,t);else if(n instanceof O)this.walkManySep(n,i,t);else if(n instanceof D)this.walkMany(n,i,t);else if(n instanceof k)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 w({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){let r=_e(e,t,n);this.walk(e,r)}walkMany(e,t,n){let r=[new w({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){let r=_e(e,t,n);this.walk(e,r)}walkOr(e,t,n){let r=t.concat(n);e.definition.forEach(e=>{let t=new C({definition:[e]});this.walk(t,r)})}};function _e(e,t,n){return[new w({definition:[new A({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function ve(e){if(e instanceof x)return ve(e.referencedRule);if(e instanceof A)return xe(e);if(pe(e))return ye(e);if(he(e))return be(e);throw Error(`non exhaustive match`)}function ye(e){let t=[],n=e.definition,r=0,i=n.length>r,a,o=!0;for(;i&&o;)a=n[r],o=me(a),t=t.concat(ve(a)),r+=1,i=n.length>r;return[...new Set(t)]}function be(e){let t=e.definition.map(e=>ve(e));return[...new Set(t.flat())]}function xe(e){return[e.terminalType]}var Se=`_~IN~_`,Ce=class extends ge{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=Te(e.referencedRule,e.idx)+this.topProd.name,i=ve(new C({definition:t.concat(n)}));this.follows[r]=i}};function we(e){let t={};return e.forEach(e=>{let n=new Ce(e).startWalking();Object.assign(t,n)}),t}function Te(e,t){return e.name+t+Se}function N(e){return e.charCodeAt(0)}function Ee(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function De(e,t){if(e[t]===!0)throw`duplicate flag `+t;e[t],e[t]=!0}function Oe(e){if(e===void 0)throw Error(`Internal Error - Should never get here!`);return!0}function ke(){throw Error(`Internal Error - Should never get here!`)}function Ae(e){return e.type===`Character`}var je=[];for(let e=N(`0`);e<=N(`9`);e++)je.push(e);var Me=[N(`_`)].concat(je);for(let e=N(`a`);e<=N(`z`);e++)Me.push(e);for(let e=N(`A`);e<=N(`Z`);e++)Me.push(e);var Ne=[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(``)],Pe=/[0-9a-fA-F]/,Fe=/[0-9]/,Ie=/[1-9]/,Le=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`:De(n,`global`);break;case`i`:De(n,`ignoreCase`);break;case`m`:De(n,`multiLine`);break;case`u`:De(n,`unicode`);break;case`y`:De(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`}}Oe(t);let n=this.disjunction();return this.consumeChar(`)`),{type:t,value:n,loc:this.loc(e)}}return ke()}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;Oe(t)}if((e!==!0||t!==void 0)&&Oe(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()),Oe(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):ke()}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=je;break;case`D`:e=je,t=!0;break;case`s`:e=Ne;break;case`S`:e=Ne,t=!0;break;case`w`:e=Me;break;case`W`:e=Me,t=!0}return Oe(e)?{type:`Set`,value:e,complement:t}:ke()}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 Oe(e)?{type:`Character`,value:e}:ke()}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 @@ import{p as e}from"./src-XiVvaevx.js";import{n as t}from"./chunk-Y2CYZVJY-BbRBGn
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 lt(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 ut=/[^\\[][\^]|^\^/;function dt(e){class t extends Re{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return e.filter(e=>{let n=e.PATTERN;try{let e=Ve(n),r=new t;return r.visit(e),r.found}catch{return ut.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 ft(e){return e.filter(e=>{let t=e[$e];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 pt(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 mt(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 ht(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 gt(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&&vt(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&&_t(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 _t(e,t){if(t instanceof RegExp){if(yt(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 vt(e){return[`.`,`\\`,`[`,`]`,`|`,`^`,`$`,`(`,`)`,`?`,`*`,`+`,`{`].find(t=>e.source.indexOf(t)!==-1)===void 0}function yt(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(e.source)}function bt(e){let t=e.ignoreCase?`iy`:`y`;return RegExp(`${e.source}`,t)}function xt(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 ft(e){return e.filter(e=>{let t=e[$e];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 pt(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 mt(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 ht(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 gt(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&&vt(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&&_t(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 _t(e,t){if(t instanceof RegExp){if(yt(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 vt(e){return[`.`,`\\`,`[`,`]`,`|`,`^`,`$`,`(`,`)`,`?`,`*`,`+`,`{`].find(t=>e.source.indexOf(t)!==-1)===void 0}function yt(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(e.source)}function bt(e){let t=e.ignoreCase?`iy`:`y`;return RegExp(`${e.source}`,t)}function xt(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 ${et}: <${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[$e]!==I.NA),o=Ot(n);return t&&a.forEach(e=>{let t=Et(e,o);if(t!==!1){let n={message:Dt(e,t),type:t.issue,tokenType:e};r.push(n)}else Object.hasOwn(e,`LINE_BREAKS`)?e.LINE_BREAKS===!0&&(i=!0):Qe(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=M(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}};li.DEFER_DEFINITION_ERRORS_HANDLING=!1,oi(li,[Sr,Or,Ur,Wr,Kr,Gr,qr,ei,ai]);var ui=class extends li{constructor(e,t=B){let n=Object.assign({},t);n.outputCst=!0,super(e,n)}},di=t(e=>e!==void 0&&e>=0,`isKnownLocation`);function fi(e,t){let n=e.lexer.tokenize(t);if(n.errors.length>0){let r=n.errors[0],i=di(r.offset)?r.offset:t.length,a=i+(di(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)}t(fi,`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},pi=`LR`,mi=l.usecase,hi=t(()=>({actors:new Map,useCases:new Map,systemBoundaries:new Map,relationships:[],notes:new Map,jsonNodes:new Map,classDefs:new Map,symbols:new Map,direction:pi,relationshipCounter:0,noteCounter:0,accTitle:``,accDescription:``,ast:void 0,config:structuredClone(mi)}),`createModel`),gi=t(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=hi(),_i=t(()=>structuredClone(U.config),`getConfig`),vi=t(()=>U.ast,`getAST`),yi=t(e=>{let t=structuredClone(e);gi(t);let n=d(),r=o();try{a(t.accTitle),i(t.accDescription),U=t}catch(e){throw a(n),i(r),e}},`commit`),bi=t(()=>{U=hi(),s()},`clear`),xi=t(()=>U.actors,`getActors`),Si=t(e=>U.actors.get(e),`getActor`),Ci=t(()=>U.useCases,`getUseCases`),wi=t(e=>U.useCases.get(e),`getUseCase`),Ti=t(()=>U.systemBoundaries,`getSystemBoundaries`),Ei=t(e=>U.systemBoundaries.get(e),`getSystemBoundary`),Di=t(()=>U.relationships,`getRelationships`),Oi=t(()=>U.notes,`getNotes`),ki=t(e=>U.notes.get(e),`getNote`),Ai=t(()=>U.jsonNodes,`getJsonNodes`),ji=t(e=>U.jsonNodes.get(e),`getJsonNode`),Mi=t(()=>U.classDefs,`getClassDefs`),Ni=t(e=>U.classDefs.get(e),`getClassDef`),Pi=t(()=>U.direction,`getDirection`),Fi=t(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`),Ii=t(e=>e.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`),`escapeJsonPointerPart`),Li=t(e=>typeof e==`string`?e:e===null?`null`:String(e),`displayJsonScalar`),Ri=t((e,n,r=e=>e)=>{let i=[],a=t((e,t,n)=>{i.push({key:r(e),accessibleKey:r(t),value:r(n)})},`append`),o=t((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,Li(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}/${Ii(e)}`)}return}a(t,t,Li(e))},`visit`);return o(e,``,``),i},`flattenJsonRows`),zi=t(e=>{switch(e.type){case`hollow`:return`usecaseActorHollow`;case`awesome`:return`usecaseActorAwesome`;case`icon`:return`usecaseActorIcon`;case`normal`:return`usecaseActor`}},`actorShape`),Bi=t(e=>e.shape===`ellipse`?e.business?`usecaseBusiness`:`usecaseEllipse`:e.shape,`useCaseShape`),Vi=t(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`),Hi=t(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{...Vi(e.arrowType),pattern:`solid`,...e.label?{label:e.label}:{},...e.labelType?{labelType:e.labelType}:{}}}},`relationshipVisuals`),Ui=t(e=>e.animate||e.animation?[`edge-animation-${e.animation??`fast`}`]:[],`animationClasses`),Wi=t((...e)=>e.filter(e=>!!e).join(` `),`classNames`),Gi={getConfig:_i,createModel:hi,commit:yi,getAST:vi,clear:bi,setDiagramTitle:u,getDiagramTitle:r,setAccTitle:a,getAccTitle:d,setAccDescription:i,getAccDescription:o,getActors:xi,getActor:Si,getUseCases:Ci,getUseCase:wi,getSystemBoundaries:Ti,getSystemBoundary:Ei,getRelationships:Di,getNotes:Oi,getNote:ki,getJsonNodes:Ai,getJsonNode:ji,getClassDefs:Mi,getClassDef:Ni,getDirection:Pi,getData:t(()=>{let e=c(),n={...U.config,...e.usecase},r=t(t=>p(t,e),`sanitize`),i=t(e=>r(U.actors.get(e)?.label??U.useCases.get(e)?.label??U.jsonNodes.get(e)?.id??U.notes.get(e)?.label??e),`endpointLabel`),a=[],o=[],s=0,l=0;for(let t of U.actors.values())a.push({id:t.id,label:r(t.label),labelType:t.labelType,shape:zi(t),isGroup:!1,padding:10,look:e.look,colorIndex:s++,cssClasses:Wi(`default`,`usecase-actor`,`usecase-actor-${t.type}`,t.business&&`usecase-business`,...t.classes),cssStyles:[...t.styles],cssCompiledStyles:Fi(t.classes),actorType:t.type,business:t.business,...t.icon?{icon:t.icon}:{},...t.stereotype?{stereotype:r(t.stereotype)}:{},...t.parentId?{parentId:t.parentId}:{}});for(let t of U.useCases.values())a.push({id:t.id,label:r(t.label),labelType:t.labelType,shape:Bi(t),isGroup:!1,padding:t.shape===`ellipse`?20:10,look:e.look,colorIndex:s++,cssClasses:Wi(`default`,`usecase-element`,`usecase-${t.shape}`,t.business&&`usecase-business`,...t.classes),cssStyles:[...t.styles],cssCompiledStyles:Fi(t.classes),business:t.business,...t.stereotype?{stereotype:r(t.stereotype)}:{},...t.parentId?{parentId:t.parentId}:{}});for(let t of U.notes.values())a.push({id:t.id,label:r(t.label),labelType:t.labelType,shape:`note`,isGroup:!1,padding:10,look:e.look,cssClasses:`default usecase-note`,cssStyles:[],cssCompiledStyles:Fi([]),noteTarget:t.target,noteTargetLabel:r(U.actors.get(t.target)?.label??U.useCases.get(t.target)?.label??U.jsonNodes.get(t.target)?.id??t.target)});for(let t of U.jsonNodes.values())a.push({id:t.id,label:r(t.id),labelType:`text`,shape:`usecaseJsonTable`,isGroup:!1,padding:10,look:e.look,cssClasses:Wi(`default`,`usecase-json-table`,...t.classes),cssStyles:[...t.styles],cssCompiledStyles:Fi(t.classes),jsonRows:Ri(t.value,t.propertyOrder,r)});for(let t of U.systemBoundaries.values())a.push({id:t.id,label:r(t.label),labelType:t.labelType,shape:`usecaseSystemBoundary`,isGroup:!0,padding:20,look:e.look,colorIndex:l++,cssClasses:Wi(`default`,`system-boundary`,`system-boundary-${t.type}`,...t.classes),cssStyles:[...t.styles],cssCompiledStyles:Fi(t.classes),boundaryType:t.type});for(let t of U.relationships){let{label:n,...a}=Hi(t);o.push({id:t.id,start:t.source,end:t.target,source:t.source,target:t.target,sourceLabel:i(t.source),targetLabel:i(t.target),type:`edge`,relationshipType:t.type,internal:!1,...a,...n===void 0?{}:{label:r(n)},labelpos:`c`,classes:Wi(`default`,`relationship`,`relationship-${t.type}`,...t.classes,...Ui(t)),style:[...t.styles],cssCompiledStyles:Fi(t.classes),animate:t.animate,...t.animation?{animation:t.animation}:{},look:e.look,thickness:`normal`,minlen:t.minlen,isUserDefinedId:t.explicitId})}for(let t of U.notes.values())o.push({id:`${t.id}-edge`,start:t.id,end:t.target,source:t.id,target:t.target,type:`edge`,relationshipType:`note`,sourceLabel:i(t.id),targetLabel:i(t.target),internal:!0,pattern:`dotted`,arrowTypeStart:`none`,arrowTypeEnd:`none`,labelpos:`c`,classes:`default relationship relationship-note`,style:[],cssCompiledStyles:Fi([]),animate:!1,look:e.look,thickness:`normal`,minlen:1,isUserDefinedId:!1});for(let e of a)e.wrappingWidth??=n.wrappingWidth,!e.isGroup&&!e.shape.startsWith(`usecaseActor`)&&(e.minWidth??=n.minNodeWidth),(e.shape===`usecaseEllipse`||e.shape===`usecaseBusiness`)&&(e.spreadPorts=!0);return{nodes:a,edges:o,config:e,type:`usecase`,layoutAlgorithm:`dagre`,direction:Pi(),nodeSpacing:n.nodeSpacing,rankSpacing:n.rankSpacing,actorFontSize:n.actorFontSize,actorFontFamily:n.actorFontFamily,actorFontWeight:n.actorFontWeight,usecaseFontSize:n.usecaseFontSize,usecaseFontFamily:n.usecaseFontFamily,usecaseFontWeight:n.usecaseFontWeight,diagramPadding:n.diagramPadding,useMaxWidth:n.useMaxWidth,markers:[`point`,`circle`,`cross`,`extension`]}},`getData`)};function Ki(e,t,n){let r=[n];return r.index=t,r.input=e,r}t(Ki,`customMatch`);var qi=t((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 Ki(e,t,e.slice(t,n+2));return null},`matchMarkdownString`),Ji=t((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}};li.DEFER_DEFINITION_ERRORS_HANDLING=!1,oi(li,[Sr,Or,Ur,Wr,Kr,Gr,qr,ei,ai]);var ui=class extends li{constructor(e,t=B){let n=Object.assign({},t);n.outputCst=!0,super(e,n)}},di=t(e=>e!==void 0&&e>=0,`isKnownLocation`);function fi(e,t){let n=e.lexer.tokenize(t);if(n.errors.length>0){let r=n.errors[0],i=di(r.offset)?r.offset:t.length,a=i+(di(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)}t(fi,`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},pi=`LR`,mi=l.usecase,hi=t(()=>({actors:new Map,useCases:new Map,systemBoundaries:new Map,relationships:[],notes:new Map,jsonNodes:new Map,classDefs:new Map,symbols:new Map,direction:pi,relationshipCounter:0,noteCounter:0,accTitle:``,accDescription:``,ast:void 0,config:structuredClone(mi)}),`createModel`),gi=t(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=hi(),_i=t(()=>structuredClone(U.config),`getConfig`),vi=t(()=>U.ast,`getAST`),yi=t(e=>{let t=structuredClone(e);gi(t);let n=d(),r=o();try{a(t.accTitle),i(t.accDescription),U=t}catch(e){throw a(n),i(r),e}},`commit`),bi=t(()=>{U=hi(),s()},`clear`),xi=t(()=>U.actors,`getActors`),Si=t(e=>U.actors.get(e),`getActor`),Ci=t(()=>U.useCases,`getUseCases`),wi=t(e=>U.useCases.get(e),`getUseCase`),Ti=t(()=>U.systemBoundaries,`getSystemBoundaries`),Ei=t(e=>U.systemBoundaries.get(e),`getSystemBoundary`),Di=t(()=>U.relationships,`getRelationships`),Oi=t(()=>U.notes,`getNotes`),ki=t(e=>U.notes.get(e),`getNote`),Ai=t(()=>U.jsonNodes,`getJsonNodes`),ji=t(e=>U.jsonNodes.get(e),`getJsonNode`),Mi=t(()=>U.classDefs,`getClassDefs`),Ni=t(e=>U.classDefs.get(e),`getClassDef`),Pi=t(()=>U.direction,`getDirection`),Fi=t(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`),Ii=t(e=>e.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`),`escapeJsonPointerPart`),Li=t(e=>typeof e==`string`?e:e===null?`null`:String(e),`displayJsonScalar`),Ri=t((e,n,r=e=>e)=>{let i=[],a=t((e,t,n)=>{i.push({key:r(e),accessibleKey:r(t),value:r(n)})},`append`),o=t((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,Li(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}/${Ii(e)}`)}}else a(t,t,Li(e))},`visit`);return o(e,``,``),i},`flattenJsonRows`),zi=t(e=>{switch(e.type){case`hollow`:return`usecaseActorHollow`;case`awesome`:return`usecaseActorAwesome`;case`icon`:return`usecaseActorIcon`;case`normal`:return`usecaseActor`}},`actorShape`),Bi=t(e=>e.shape===`ellipse`?e.business?`usecaseBusiness`:`usecaseEllipse`:e.shape,`useCaseShape`),Vi=t(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`),Hi=t(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{...Vi(e.arrowType),pattern:`solid`,...e.label?{label:e.label}:{},...e.labelType?{labelType:e.labelType}:{}}}},`relationshipVisuals`),Ui=t(e=>e.animate||e.animation?[`edge-animation-${e.animation??`fast`}`]:[],`animationClasses`),Wi=t((...e)=>e.filter(e=>!!e).join(` `),`classNames`),Gi={getConfig:_i,createModel:hi,commit:yi,getAST:vi,clear:bi,setDiagramTitle:u,getDiagramTitle:r,setAccTitle:a,getAccTitle:d,setAccDescription:i,getAccDescription:o,getActors:xi,getActor:Si,getUseCases:Ci,getUseCase:wi,getSystemBoundaries:Ti,getSystemBoundary:Ei,getRelationships:Di,getNotes:Oi,getNote:ki,getJsonNodes:Ai,getJsonNode:ji,getClassDefs:Mi,getClassDef:Ni,getDirection:Pi,getData:t(()=>{let e=c(),n={...U.config,...e.usecase},r=t(t=>p(t,e),`sanitize`),i=t(e=>r(U.actors.get(e)?.label??U.useCases.get(e)?.label??U.jsonNodes.get(e)?.id??U.notes.get(e)?.label??e),`endpointLabel`),a=[],o=[],s=0,l=0;for(let t of U.actors.values())a.push({id:t.id,label:r(t.label),labelType:t.labelType,shape:zi(t),isGroup:!1,padding:10,look:e.look,colorIndex:s++,cssClasses:Wi(`default`,`usecase-actor`,`usecase-actor-${t.type}`,t.business&&`usecase-business`,...t.classes),cssStyles:[...t.styles],cssCompiledStyles:Fi(t.classes),actorType:t.type,business:t.business,...t.icon?{icon:t.icon}:{},...t.stereotype?{stereotype:r(t.stereotype)}:{},...t.parentId?{parentId:t.parentId}:{}});for(let t of U.useCases.values())a.push({id:t.id,label:r(t.label),labelType:t.labelType,shape:Bi(t),isGroup:!1,padding:t.shape===`ellipse`?20:10,look:e.look,colorIndex:s++,cssClasses:Wi(`default`,`usecase-element`,`usecase-${t.shape}`,t.business&&`usecase-business`,...t.classes),cssStyles:[...t.styles],cssCompiledStyles:Fi(t.classes),business:t.business,...t.stereotype?{stereotype:r(t.stereotype)}:{},...t.parentId?{parentId:t.parentId}:{}});for(let t of U.notes.values())a.push({id:t.id,label:r(t.label),labelType:t.labelType,shape:`note`,isGroup:!1,padding:10,look:e.look,cssClasses:`default usecase-note`,cssStyles:[],cssCompiledStyles:Fi([]),noteTarget:t.target,noteTargetLabel:r(U.actors.get(t.target)?.label??U.useCases.get(t.target)?.label??U.jsonNodes.get(t.target)?.id??t.target)});for(let t of U.jsonNodes.values())a.push({id:t.id,label:r(t.id),labelType:`text`,shape:`usecaseJsonTable`,isGroup:!1,padding:10,look:e.look,cssClasses:Wi(`default`,`usecase-json-table`,...t.classes),cssStyles:[...t.styles],cssCompiledStyles:Fi(t.classes),jsonRows:Ri(t.value,t.propertyOrder,r)});for(let t of U.systemBoundaries.values())a.push({id:t.id,label:r(t.label),labelType:t.labelType,shape:`usecaseSystemBoundary`,isGroup:!0,padding:20,look:e.look,colorIndex:l++,cssClasses:Wi(`default`,`system-boundary`,`system-boundary-${t.type}`,...t.classes),cssStyles:[...t.styles],cssCompiledStyles:Fi(t.classes),boundaryType:t.type});for(let t of U.relationships){let{label:n,...a}=Hi(t);o.push({id:t.id,start:t.source,end:t.target,source:t.source,target:t.target,sourceLabel:i(t.source),targetLabel:i(t.target),type:`edge`,relationshipType:t.type,internal:!1,...a,...n===void 0?{}:{label:r(n)},labelpos:`c`,classes:Wi(`default`,`relationship`,`relationship-${t.type}`,...t.classes,...Ui(t)),style:[...t.styles],cssCompiledStyles:Fi(t.classes),animate:t.animate,...t.animation?{animation:t.animation}:{},look:e.look,thickness:`normal`,minlen:t.minlen,isUserDefinedId:t.explicitId})}for(let t of U.notes.values())o.push({id:`${t.id}-edge`,start:t.id,end:t.target,source:t.id,target:t.target,type:`edge`,relationshipType:`note`,sourceLabel:i(t.id),targetLabel:i(t.target),internal:!0,pattern:`dotted`,arrowTypeStart:`none`,arrowTypeEnd:`none`,labelpos:`c`,classes:`default relationship relationship-note`,style:[],cssCompiledStyles:Fi([]),animate:!1,look:e.look,thickness:`normal`,minlen:1,isUserDefinedId:!1});for(let e of a)e.wrappingWidth??=n.wrappingWidth,!e.isGroup&&!e.shape.startsWith(`usecaseActor`)&&(e.minWidth??=n.minNodeWidth),(e.shape===`usecaseEllipse`||e.shape===`usecaseBusiness`)&&(e.spreadPorts=!0);return{nodes:a,edges:o,config:e,type:`usecase`,layoutAlgorithm:`dagre`,direction:Pi(),nodeSpacing:n.nodeSpacing,rankSpacing:n.rankSpacing,actorFontSize:n.actorFontSize,actorFontFamily:n.actorFontFamily,actorFontWeight:n.actorFontWeight,usecaseFontSize:n.usecaseFontSize,usecaseFontFamily:n.usecaseFontFamily,usecaseFontWeight:n.usecaseFontWeight,diagramPadding:n.diagramPadding,useMaxWidth:n.useMaxWidth,markers:[`point`,`circle`,`cross`,`extension`]}},`getData`)};function Ki(e,t,n){let r=[n];return r.index=t,r.input=e,r}t(Ki,`customMatch`);var qi=t((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 Ki(e,t,e.slice(t,n+2));return null},`matchMarkdownString`),Ji=t((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 Ki(e,t,e.slice(t,n))},`matchComment`),Yi=t((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`),Xi=t((e,t,n)=>{if(!Yi(e,t))return null;let r=n.exec(e.slice(t));return r?Ki(e,t,r[0]):null},`matchAccessibilityLine`),Zi=t((e,t)=>{if(!Yi(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:Ki(e,t,e.slice(t,r+1))},`matchAccDescrBlock`),Qi=t((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 Ki(e,t,e.slice(t,a+1))}return null},`matchJsonObject`),$i=t((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()?Ki(e,t,r):null},`matchStereotypeText`),W=L({name:`LABEL_TEXT`,pattern:I.NA}),ea=L({name:`WORD`,pattern:I.NA,categories:W}),ta=L({name:`NUMBER`,pattern:/(?:\d+\.\d+|\d+|\.\d+)(?:[A-Za-z]+)?/,categories:W}),G=L({name:`IDENTIFIER`,pattern:/\w+/,longer_alt:ta,categories:ea}),na=L({name:`HWS`,pattern:/[\t ]+/,group:I.SKIPPED}),K=L({name:`MARKDOWN_STRING`,pattern:qi,start_chars_hint:[`"`],line_breaks:!0}),ra=L({name:`UNCLOSED_MARKDOWN_STRING`,pattern:/"`[^]*/,line_breaks:!0}),ia=L({name:`COMMENT`,pattern:Ji,start_chars_hint:[`%`],line_breaks:!1}),q=L({name:`NEWLINE`,pattern:/\r\n|\n|\r/,line_breaks:!0}),aa=L({name:`ACC_DESCR_BLOCK`,pattern:Zi,start_chars_hint:[`a`],line_breaks:!0}),oa=/^accTitle[\t ]*:[^\n\r]*/,sa=/^accDescr[\t ]*:[^\n\r]*/,ca=L({name:`ACC_TITLE_LINE`,pattern:t((e,t)=>Xi(e,t,oa),`pattern`),start_chars_hint:[`a`],line_breaks:!1}),la=L({name:`ACC_DESCR_LINE`,pattern:t((e,t)=>Xi(e,t,sa),`pattern`),start_chars_hint:[`a`],line_breaks:!1}),ua=L({name:`JSON_DECLARATION_START`,pattern:/json[\t ]+\w+[\t ]*@[\t ]*(?={)/,push_mode:`jsonBody`}),da=L({name:`JSON_OBJECT_LITERAL`,pattern:Qi,start_chars_hint:[`{`],line_breaks:!0,pop_mode:!0}),fa=L({name:`UNCLOSED_JSON_OBJECT_LITERAL`,pattern:/{[^]*/,line_breaks:!0,pop_mode:!0}),J=t((e,t)=>L({name:e,pattern:t,longer_alt:G,categories:ea}),`keyword`),pa=J(`USECASE`,/usecase-beta/),ma=J(`ACTOR`,/actor/),ha=J(`SYSTEM_BOUNDARY`,/systemBoundary/),ga=J(`END`,/end/),_a=J(`DIRECTION`,/direction/),va=J(`TD`,/TD/),ya=J(`TB`,/TB/),ba=J(`BT`,/BT/),xa=J(`LR`,/LR/),Sa=J(`RL`,/RL/),Ca=J(`NOTE`,/note/),wa=J(`FOR`,/for/),Ta=J(`JSON`,/json/),Ea=J(`CLASS_DEF`,/classDef/),Da=J(`CLASS`,/class/),Oa=J(`STYLE`,/style/),ka=J(`INCLUDE`,/include/i),Aa=J(`EXTEND`,/extend/i),ja=J(`TRUE`,/true/),Ma=J(`FALSE`,/false/),Na=L({name:`GENERALIZATION`,pattern:/--\|>/}),Pa=L({name:`DEPENDENCY_ARROW`,pattern:/\.\.>/}),Fa=L({name:`STEREOTYPE_START`,pattern:/<</,push_mode:`stereotype`}),Ia=L({name:`STEREOTYPE_END`,pattern:/>>/,pop_mode:!0}),La=L({name:`STEREOTYPE_TEXT`,pattern:$i,line_breaks:!1}),Ra=L({name:`UNCLOSED_STEREOTYPE_TEXT`,pattern:/[^\n\r]+/,line_breaks:!1,pop_mode:!0}),za=L({name:`CLASS_SEPARATOR`,pattern:/:::/}),Ba=L({name:`FORWARD_SOLID`,pattern:/--+>/}),Va=L({name:`BACKWARD_SOLID`,pattern:/<--+/}),Ha=L({name:`FORWARD_CIRCLE`,pattern:/--o/}),Ua=L({name:`BACKWARD_CIRCLE`,pattern:/o--/}),Wa=L({name:`FORWARD_CROSS`,pattern:/--x/}),Ga=L({name:`BACKWARD_CROSS`,pattern:/x--/}),Y=L({name:`MARKERLESS_SOLID`,pattern:/--+/}),Ka=L({name:`METADATA_START`,pattern:/@{/}),qa=L({name:`AT`,pattern:/@/,categories:W}),Ja=L({name:`LBRACE`,pattern:/{/}),Ya=L({name:`RBRACE`,pattern:/}/}),Xa=L({name:`LBRACKET`,pattern:/\[/}),Za=L({name:`RBRACKET`,pattern:/]/}),Qa=L({name:`LPAREN`,pattern:/\(/}),$a=L({name:`RPAREN`,pattern:/\)/}),X=L({name:`COMMA`,pattern:/,/,categories:W}),eo=L({name:`COLON`,pattern:/:/,categories:W}),to=L({name:`HASH_COLOR`,pattern:/#[\dA-Fa-f]+/,categories:W}),Z=L({name:`PLAIN_STRING`,pattern:/"[^\n\r"]*"|'[^\n\r']*'/}),no=L({name:`CSS_IDENTIFIER`,pattern:/--[A-Z_a-z][\w-]*|[A-Z_a-z]\w*(?:-\w+)+/,categories:W}),ro=L({name:`CSS_ESCAPED_COMMA`,pattern:/\\,/,categories:W}),io=L({name:`DASH`,pattern:/-/,categories:W}),ao=L({name:`DOT`,pattern:/\./,categories:W}),oo=L({name:`PERCENT`,pattern:/%/,categories:W}),so=L({name:`CSS_PUNCTUATION`,pattern:/[!#$&*+/=?^_|~]/,categories:W}),co=[W,ea,na,K,ra,ia,q,aa,ca,la,ua,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,za,Ba,Va,Ha,Ua,Wa,Ga,Y,Ka,qa,Ja,Ya,Xa,Za,Qa,$a,X,eo,to,Z,no,G,ta,ro,io,ao,oo,so,L({name:`LABEL_PUNCTUATION`,pattern:/[;<>\\`]/,categories:W}),L({name:`LABEL_SYMBOL`,pattern:/[^\t\n\r !-~]+/,categories:W})],lo={defaultMode:`defaultMode`,modes:{defaultMode:[...co],jsonBody:[da,fa],stereotype:[Ia,La,Ra]}},uo=[...co,da,fa,Ia,La,Ra],fo=new I(lo),po=t(e=>ln(e,W)||e.tokenType===Z||e.tokenType===K,`isLabelToken`),mo={allowmixing:!0,newpage:!0,package:!0,rectangle:!0,skinparam:!0},ho=new class extends ui{static{t(this,`UsecaseParser`)}constructor(){super(uo,{nodeLocationTracking:`full`}),this.RULE(`start`,()=>{this.CONSUME(pa),this.SUBRULE(this.lineEnd),this.MANY(()=>this.SUBRULE(this.line))}),this.RULE(`line`,()=>{this.OR([{ALT:t(()=>this.SUBRULE(this.blankLine),`ALT`)},{ALT:t(()=>this.SUBRULE(this.commentLine),`ALT`)},{GATE:t(()=>this.isStatementStart(),`GATE`),ALT:t(()=>this.SUBRULE(this.statement),`ALT`)}])}),this.RULE(`statement`,()=>{this.OR([{ALT:t(()=>this.SUBRULE(this.accTitleStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.accDescrStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.directionStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.actorStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.systemBoundaryStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.noteStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.jsonStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.classDefStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.classStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.styleStatement),`ALT`)},{GATE:t(()=>this.isMetadataAssignment(),`GATE`),ALT:t(()=>this.SUBRULE(this.metadataAssignmentStatement),`ALT`)},{GATE:t(()=>!this.isForbiddenPlantUmlStatement(),`GATE`),ALT:t(()=>this.SUBRULE(this.entityStatement),`ALT`)}])}),this.RULE(`lineEnd`,()=>{this.OR([{ALT:t(()=>this.CONSUME(q),`ALT`)},{ALT:t(()=>this.CONSUME(R),`ALT`)}])}),this.RULE(`blankLine`,()=>{this.CONSUME(q)}),this.RULE(`commentLine`,()=>{this.CONSUME(ia),this.SUBRULE(this.lineEnd)}),this.RULE(`accTitleStatement`,()=>{this.CONSUME(ca),this.SUBRULE(this.lineEnd)}),this.RULE(`accDescrStatement`,()=>{this.OR([{ALT:t(()=>this.CONSUME(la),`ALT`)},{ALT:t(()=>this.CONSUME(aa),`ALT`)}]),this.SUBRULE(this.lineEnd)}),this.RULE(`actorStatement`,()=>{this.CONSUME(ma),this.SUBRULE(this.actorItem),this.OPTION(()=>{this.OR([{ALT:t(()=>this.AT_LEAST_ONE(()=>{this.CONSUME(X),this.SUBRULE2(this.actorItem)}),`ALT`)},{ALT:t(()=>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:t(()=>{this.CONSUME(G),this.OPTION(()=>{this.CONSUME(Qa),this.SUBRULE(this.nodeLabel),this.CONSUME($a)})},`ALT`)},{ALT:t(()=>this.CONSUME(Z),`ALT`)},{ALT:t(()=>this.CONSUME(K),`ALT`)}])}),this.RULE(`actorDeclarationOnly`,()=>{this.CONSUME(ma),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:t(()=>{this.CONSUME(G),this.OPTION(()=>{this.OR2([{ALT:t(()=>{this.CONSUME(Qa),this.SUBRULE(this.nodeLabel),this.CONSUME($a)},`ALT`)},{ALT:t(()=>{this.CONSUME(Xa),this.SUBRULE2(this.nodeLabel),this.CONSUME(Za)},`ALT`)}])})},`ALT`)},{ALT:t(()=>this.CONSUME(Z),`ALT`)},{ALT:t(()=>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:t(()=>this.CONSUME(Z),`ALT`)},{ALT:t(()=>this.CONSUME(K),`ALT`)},{ALT:t(()=>this.AT_LEAST_ONE(()=>this.CONSUME(W)),`ALT`)}])}),this.RULE(`useCaseMetadata`,()=>{this.SUBRULE(this.metadata)}),this.RULE(`relationTail`,()=>{this.OPTION({GATE:t(()=>this.LA(1).tokenType===G&&this.LA(2).tokenType===qa,`GATE`),DEF:t(()=>{this.CONSUME(G),this.CONSUME(qa)},`DEF`)}),this.SUBRULE(this.arrow),this.SUBRULE(this.entityName)}),this.RULE(`arrow`,()=>{this.OR([{ALT:t(()=>this.SUBRULE(this.semanticRelation),`ALT`)},{ALT:t(()=>this.SUBRULE(this.forwardSolidOperator),`ALT`)},{ALT:t(()=>this.SUBRULE(this.backwardSolidOperator),`ALT`)},{ALT:t(()=>this.SUBRULE(this.markerlessSolidOperator),`ALT`)},{ALT:t(()=>this.SUBRULE(this.forwardCircleOperator),`ALT`)},{ALT:t(()=>this.SUBRULE(this.backwardCircleOperator),`ALT`)},{ALT:t(()=>this.SUBRULE(this.forwardCrossOperator),`ALT`)},{ALT:t(()=>this.SUBRULE(this.backwardCrossOperator),`ALT`)}])}),this.RULE(`forwardSolidOperator`,()=>{this.CONSUME(Ba)}),this.RULE(`backwardSolidOperator`,()=>{this.CONSUME(Va),this.OPTION({GATE:t(()=>this.LA(0).image===`<--`&&this.hasLabeledRight([Y]),`GATE`),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(Y)},`DEF`)})}),this.RULE(`markerlessSolidOperator`,()=>{this.CONSUME(Y),this.OPTION({GATE:t(()=>this.LA(0).image===`--`&&this.hasLabeledRight([Ba,Y,Ha,Wa]),`GATE`),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.OR([{ALT:t(()=>this.CONSUME(Ba),`ALT`)},{ALT:t(()=>this.CONSUME2(Y),`ALT`)},{ALT:t(()=>this.CONSUME(Ha),`ALT`)},{ALT:t(()=>this.CONSUME(Wa),`ALT`)}])},`DEF`)})}),this.RULE(`forwardCircleOperator`,()=>{this.CONSUME(Ha)}),this.RULE(`backwardCircleOperator`,()=>{this.CONSUME(Ua),this.OPTION({GATE:t(()=>this.hasLabeledRight([Y]),`GATE`),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(Y)},`DEF`)})}),this.RULE(`forwardCrossOperator`,()=>{this.CONSUME(Wa)}),this.RULE(`backwardCrossOperator`,()=>{this.CONSUME(Ga),this.OPTION({GATE:t(()=>this.hasLabeledRight([Y]),`GATE`),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(Y)},`DEF`)})}),this.RULE(`edgeLabel`,()=>{this.OR([{ALT:t(()=>this.CONSUME(Z),`ALT`)},{ALT:t(()=>this.CONSUME(K),`ALT`)},{ALT:t(()=>this.AT_LEAST_ONE(()=>this.CONSUME(W)),`ALT`)}])}),this.RULE(`semanticRelation`,()=>{this.OR([{ALT:t(()=>{this.CONSUME(Pa),this.CONSUME(eo),this.OR2([{ALT:t(()=>this.CONSUME(ka),`ALT`)},{ALT:t(()=>this.CONSUME(Aa),`ALT`)}])},`ALT`)},{ALT:t(()=>this.CONSUME(Na),`ALT`)}])}),this.RULE(`metadata`,()=>{this.CONSUME(Ka),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(Ya)}),this.RULE(`metadataProperty`,()=>{this.OR([{ALT:t(()=>this.CONSUME(G),`ALT`)},{ALT:t(()=>this.CONSUME(Z),`ALT`)}]),this.CONSUME(eo),this.OR2([{ALT:t(()=>this.CONSUME2(G),`ALT`)},{ALT:t(()=>this.CONSUME2(Z),`ALT`)},{ALT:t(()=>this.CONSUME(ja),`ALT`)},{ALT:t(()=>this.CONSUME(Ma),`ALT`)}])}),this.RULE(`metadataSeparator`,()=>{this.OR([{ALT:t(()=>{this.CONSUME(X),this.MANY(()=>this.CONSUME(q))},`ALT`)},{ALT:t(()=>{this.AT_LEAST_ONE(()=>this.CONSUME2(q)),this.OPTION(()=>this.CONSUME2(X)),this.MANY2(()=>this.CONSUME3(q))},`ALT`)}])}),this.RULE(`systemBoundaryStatement`,()=>{this.CONSUME(ha),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(ga),this.SUBRULE2(this.lineEnd)}),this.RULE(`systemBoundaryName`,()=>{this.OR([{ALT:t(()=>{this.CONSUME(G),this.OPTION(()=>{this.OR2([{ALT:t(()=>{this.CONSUME(Qa),this.SUBRULE(this.nodeLabel),this.CONSUME($a)},`ALT`)},{ALT:t(()=>{this.CONSUME(Xa),this.SUBRULE2(this.nodeLabel),this.CONSUME(Za)},`ALT`)}])})},`ALT`)},{ALT:t(()=>this.CONSUME(Z),`ALT`)},{ALT:t(()=>this.CONSUME(K),`ALT`)}])}),this.RULE(`systemBoundaryContent`,()=>{this.MANY(()=>{this.OR([{ALT:t(()=>this.SUBRULE(this.blankLine),`ALT`)},{ALT:t(()=>this.SUBRULE(this.commentLine),`ALT`)},{ALT:t(()=>this.SUBRULE(this.boundaryElement),`ALT`)}])})}),this.RULE(`boundaryElement`,()=>{this.OR([{ALT:t(()=>this.SUBRULE(this.actorDeclarationOnly),`ALT`)},{ALT:t(()=>{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:t(()=>this.CONSUME(G),`ALT`)},{ALT:t(()=>this.CONSUME(Z),`ALT`)},{ALT:t(()=>this.CONSUME(K),`ALT`)}])}),this.RULE(`noteStatement`,()=>{this.CONSUME(Ca),this.CONSUME(wa),this.CONSUME(G),this.SUBRULE(this.nodeLabel),this.SUBRULE(this.lineEnd)}),this.RULE(`stereotype`,()=>{this.CONSUME(Fa),this.CONSUME(La),this.CONSUME(Ia)}),this.RULE(`classSuffix`,()=>{this.CONSUME(za),this.CONSUME(G),this.MANY(()=>{this.CONSUME(X),this.CONSUME2(G)})}),this.RULE(`jsonStatement`,()=>{this.CONSUME(ua),this.CONSUME(da),this.OPTION(()=>this.SUBRULE(this.classSuffix)),this.SUBRULE(this.lineEnd)}),this.RULE(`directionStatement`,()=>{this.CONSUME(_a),this.OR([{ALT:t(()=>this.CONSUME(va),`ALT`)},{ALT:t(()=>this.CONSUME(ya),`ALT`)},{ALT:t(()=>this.CONSUME(ba),`ALT`)},{ALT:t(()=>this.CONSUME(xa),`ALT`)},{ALT:t(()=>this.CONSUME(Sa),`ALT`)}]),this.SUBRULE(this.lineEnd)}),this.RULE(`classDefStatement`,()=>{this.CONSUME(Ea),this.CONSUME(G),this.MANY(()=>{this.CONSUME(X),this.CONSUME2(G)}),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE(`classStatement`,()=>{this.CONSUME(Da),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(Oa),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:t(()=>this.CONSUME(ea),`ALT`)},{ALT:t(()=>this.CONSUME(no),`ALT`)},{ALT:t(()=>{this.CONSUME(Y),this.CONSUME2(ea)},`ALT`)}]),this.CONSUME(eo),this.AT_LEAST_ONE(()=>this.SUBRULE(this.styleComponent))}),this.RULE(`styleComponent`,()=>{this.OR([{ALT:t(()=>this.CONSUME(ea),`ALT`)},{ALT:t(()=>this.CONSUME(Z),`ALT`)},{ALT:t(()=>this.CONSUME(ta),`ALT`)},{ALT:t(()=>this.CONSUME(to),`ALT`)},{ALT:t(()=>this.CONSUME(no),`ALT`)},{ALT:t(()=>this.CONSUME(ro),`ALT`)},{ALT:t(()=>this.CONSUME(io),`ALT`)},{ALT:t(()=>this.CONSUME(ao),`ALT`)},{ALT:t(()=>this.CONSUME(oo),`ALT`)},{ALT:t(()=>this.CONSUME(so),`ALT`)},{ALT:t(()=>this.CONSUME(eo),`ALT`)},{ALT:t(()=>this.CONSUME(Qa),`ALT`)},{ALT:t(()=>this.CONSUME($a),`ALT`)},{ALT:t(()=>this.CONSUME(Xa),`ALT`)},{ALT:t(()=>this.CONSUME(Za),`ALT`)},{ALT:t(()=>this.CONSUME(Ja),`ALT`)},{ALT:t(()=>this.CONSUME(Ya),`ALT`)},{ALT:t(()=>this.CONSUME(qa),`ALT`)},{ALT:t(()=>this.CONSUME(Y),`ALT`)}])}),this.performSelfAnalysis()}isMetadataAssignment(){let e=this.LA(1).tokenType;return(e===G||e===Z||e===K)&&this.LA(2).tokenType===Ka}isStatementStart(){let e=this.LA(1).tokenType;return e!==R&&e!==q&&e!==ia}isForbiddenPlantUmlStatement(){return this.LA(1).tokenType===G&&mo[this.LA(1).image.toLowerCase()]===!0}hasLabeledRight(e){if(!po(this.LA(1)))return!1;for(let t=2;;t++){let n=this.LA(t);if(e.includes(n.tokenType))return!0;if(!po(n))return!1}}},go=class extends Error{constructor(e,t,n){super(`${e} (line ${t}, column ${n})`),this.line=t,this.column=n,this.name=`UsecaseJsonError`}static{t(this,`UsecaseJsonError`)}},_o=t((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`),vo=t((e,t,n,r)=>{let i=/\bposition (\d+)\b/u.exec(e);if(i)return _o(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 _o(t,t.length,n,r)},`locationFromErrorMessage`),Q=class extends Error{constructor(e){super(`Invalid JSON token`),this.offset=e}static{t(this,`JsonWalkError`)}},yo=class{constructor(e){this.text=e,this.offset=0,this.propertyOrder={}}static{t(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`),Xi=t((e,t,n)=>{if(!Yi(e,t))return null;let r=n.exec(e.slice(t));return r?Ki(e,t,r[0]):null},`matchAccessibilityLine`),Zi=t((e,t)=>{if(!Yi(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:Ki(e,t,e.slice(t,r+1))},`matchAccDescrBlock`),Qi=t((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 Ki(e,t,e.slice(t,a+1))}return null},`matchJsonObject`),$i=t((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()?Ki(e,t,r):null},`matchStereotypeText`),W=L({name:`LABEL_TEXT`,pattern:I.NA}),ea=L({name:`WORD`,pattern:I.NA,categories:W}),ta=L({name:`NUMBER`,pattern:/(?:\d+\.\d+|\d+|\.\d+)(?:[A-Za-z]+)?/,categories:W}),G=L({name:`IDENTIFIER`,pattern:/\w+/,longer_alt:ta,categories:ea}),na=L({name:`HWS`,pattern:/[\t ]+/,group:I.SKIPPED}),K=L({name:`MARKDOWN_STRING`,pattern:qi,start_chars_hint:[`"`],line_breaks:!0}),ra=L({name:`UNCLOSED_MARKDOWN_STRING`,pattern:/"`[^]*/,line_breaks:!0}),ia=L({name:`COMMENT`,pattern:Ji,start_chars_hint:[`%`],line_breaks:!1}),q=L({name:`NEWLINE`,pattern:/\r\n|\n|\r/,line_breaks:!0}),aa=L({name:`ACC_DESCR_BLOCK`,pattern:Zi,start_chars_hint:[`a`],line_breaks:!0}),oa=/^accTitle[\t ]*:[^\n\r]*/,sa=/^accDescr[\t ]*:[^\n\r]*/,ca=L({name:`ACC_TITLE_LINE`,pattern:t((e,t)=>Xi(e,t,oa),`pattern`),start_chars_hint:[`a`],line_breaks:!1}),la=L({name:`ACC_DESCR_LINE`,pattern:t((e,t)=>Xi(e,t,sa),`pattern`),start_chars_hint:[`a`],line_breaks:!1}),ua=L({name:`JSON_DECLARATION_START`,pattern:/json[\t ]+\w+[\t ]*@[\t ]*(?={)/,push_mode:`jsonBody`}),da=L({name:`JSON_OBJECT_LITERAL`,pattern:Qi,start_chars_hint:[`{`],line_breaks:!0,pop_mode:!0}),fa=L({name:`UNCLOSED_JSON_OBJECT_LITERAL`,pattern:/{[^]*/,line_breaks:!0,pop_mode:!0}),J=t((e,t)=>L({name:e,pattern:t,longer_alt:G,categories:ea}),`keyword`),pa=J(`USECASE`,/usecase-beta/),ma=J(`ACTOR`,/actor/),ha=J(`SYSTEM_BOUNDARY`,/systemBoundary/),ga=J(`END`,/end/),_a=J(`DIRECTION`,/direction/),va=J(`TD`,/TD/),ya=J(`TB`,/TB/),ba=J(`BT`,/BT/),xa=J(`LR`,/LR/),Sa=J(`RL`,/RL/),Ca=J(`NOTE`,/note/),wa=J(`FOR`,/for/),Ta=J(`JSON`,/json/),Ea=J(`CLASS_DEF`,/classDef/),Da=J(`CLASS`,/class/),Oa=J(`STYLE`,/style/),ka=J(`INCLUDE`,/include/i),Aa=J(`EXTEND`,/extend/i),ja=J(`TRUE`,/true/),Ma=J(`FALSE`,/false/),Na=L({name:`GENERALIZATION`,pattern:/--\|>/}),Pa=L({name:`DEPENDENCY_ARROW`,pattern:/\.\.>/}),Fa=L({name:`STEREOTYPE_START`,pattern:/<</,push_mode:`stereotype`}),Ia=L({name:`STEREOTYPE_END`,pattern:/>>/,pop_mode:!0}),La=L({name:`STEREOTYPE_TEXT`,pattern:$i,line_breaks:!1}),Ra=L({name:`UNCLOSED_STEREOTYPE_TEXT`,pattern:/[^\n\r]+/,line_breaks:!1,pop_mode:!0}),za=L({name:`CLASS_SEPARATOR`,pattern:/:::/}),Ba=L({name:`FORWARD_SOLID`,pattern:/--+>/}),Va=L({name:`BACKWARD_SOLID`,pattern:/<--+/}),Ha=L({name:`FORWARD_CIRCLE`,pattern:/--o/}),Ua=L({name:`BACKWARD_CIRCLE`,pattern:/o--/}),Wa=L({name:`FORWARD_CROSS`,pattern:/--x/}),Ga=L({name:`BACKWARD_CROSS`,pattern:/x--/}),Y=L({name:`MARKERLESS_SOLID`,pattern:/--+/}),Ka=L({name:`METADATA_START`,pattern:/@{/}),qa=L({name:`AT`,pattern:/@/,categories:W}),Ja=L({name:`LBRACE`,pattern:/{/}),Ya=L({name:`RBRACE`,pattern:/}/}),Xa=L({name:`LBRACKET`,pattern:/\[/}),Za=L({name:`RBRACKET`,pattern:/]/}),Qa=L({name:`LPAREN`,pattern:/\(/}),$a=L({name:`RPAREN`,pattern:/\)/}),X=L({name:`COMMA`,pattern:/,/,categories:W}),eo=L({name:`COLON`,pattern:/:/,categories:W}),to=L({name:`HASH_COLOR`,pattern:/#[\dA-Fa-f]+/,categories:W}),Z=L({name:`PLAIN_STRING`,pattern:/"[^\n\r"]*"|'[^\n\r']*'/}),no=L({name:`CSS_IDENTIFIER`,pattern:/--[A-Z_a-z][\w-]*|[A-Z_a-z]\w*(?:-\w+)+/,categories:W}),ro=L({name:`CSS_ESCAPED_COMMA`,pattern:/\\,/,categories:W}),io=L({name:`DASH`,pattern:/-/,categories:W}),ao=L({name:`DOT`,pattern:/\./,categories:W}),oo=L({name:`PERCENT`,pattern:/%/,categories:W}),so=L({name:`CSS_PUNCTUATION`,pattern:/[!#$&*+/=?^_|~]/,categories:W}),co=[W,ea,na,K,ra,ia,q,aa,ca,la,ua,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,za,Ba,Va,Ha,Ua,Wa,Ga,Y,Ka,qa,Ja,Ya,Xa,Za,Qa,$a,X,eo,to,Z,no,G,ta,ro,io,ao,oo,so,L({name:`LABEL_PUNCTUATION`,pattern:/[;<>\\`]/,categories:W}),L({name:`LABEL_SYMBOL`,pattern:/[^\t\n\r !-~]+/,categories:W})],lo={defaultMode:`defaultMode`,modes:{defaultMode:[...co],jsonBody:[da,fa],stereotype:[Ia,La,Ra]}},uo=[...co,da,fa,Ia,La,Ra],fo=new I(lo),po=t(e=>ln(e,W)||e.tokenType===Z||e.tokenType===K,`isLabelToken`),mo={allowmixing:!0,newpage:!0,package:!0,rectangle:!0,skinparam:!0},ho=new class extends ui{static{t(this,`UsecaseParser`)}constructor(){super(uo,{nodeLocationTracking:`full`}),this.RULE(`start`,()=>{this.CONSUME(pa),this.SUBRULE(this.lineEnd),this.MANY(()=>this.SUBRULE(this.line))}),this.RULE(`line`,()=>{this.OR([{ALT:t(()=>this.SUBRULE(this.blankLine),`ALT`)},{ALT:t(()=>this.SUBRULE(this.commentLine),`ALT`)},{GATE:t(()=>this.isStatementStart(),`GATE`),ALT:t(()=>this.SUBRULE(this.statement),`ALT`)}])}),this.RULE(`statement`,()=>{this.OR([{ALT:t(()=>this.SUBRULE(this.accTitleStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.accDescrStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.directionStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.actorStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.systemBoundaryStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.noteStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.jsonStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.classDefStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.classStatement),`ALT`)},{ALT:t(()=>this.SUBRULE(this.styleStatement),`ALT`)},{GATE:t(()=>this.isMetadataAssignment(),`GATE`),ALT:t(()=>this.SUBRULE(this.metadataAssignmentStatement),`ALT`)},{GATE:t(()=>!this.isForbiddenPlantUmlStatement(),`GATE`),ALT:t(()=>this.SUBRULE(this.entityStatement),`ALT`)}])}),this.RULE(`lineEnd`,()=>{this.OR([{ALT:t(()=>this.CONSUME(q),`ALT`)},{ALT:t(()=>this.CONSUME(R),`ALT`)}])}),this.RULE(`blankLine`,()=>{this.CONSUME(q)}),this.RULE(`commentLine`,()=>{this.CONSUME(ia),this.SUBRULE(this.lineEnd)}),this.RULE(`accTitleStatement`,()=>{this.CONSUME(ca),this.SUBRULE(this.lineEnd)}),this.RULE(`accDescrStatement`,()=>{this.OR([{ALT:t(()=>this.CONSUME(la),`ALT`)},{ALT:t(()=>this.CONSUME(aa),`ALT`)}]),this.SUBRULE(this.lineEnd)}),this.RULE(`actorStatement`,()=>{this.CONSUME(ma),this.SUBRULE(this.actorItem),this.OPTION(()=>{this.OR([{ALT:t(()=>this.AT_LEAST_ONE(()=>{this.CONSUME(X),this.SUBRULE2(this.actorItem)}),`ALT`)},{ALT:t(()=>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:t(()=>{this.CONSUME(G),this.OPTION(()=>{this.CONSUME(Qa),this.SUBRULE(this.nodeLabel),this.CONSUME($a)})},`ALT`)},{ALT:t(()=>this.CONSUME(Z),`ALT`)},{ALT:t(()=>this.CONSUME(K),`ALT`)}])}),this.RULE(`actorDeclarationOnly`,()=>{this.CONSUME(ma),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:t(()=>{this.CONSUME(G),this.OPTION(()=>{this.OR2([{ALT:t(()=>{this.CONSUME(Qa),this.SUBRULE(this.nodeLabel),this.CONSUME($a)},`ALT`)},{ALT:t(()=>{this.CONSUME(Xa),this.SUBRULE2(this.nodeLabel),this.CONSUME(Za)},`ALT`)}])})},`ALT`)},{ALT:t(()=>this.CONSUME(Z),`ALT`)},{ALT:t(()=>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:t(()=>this.CONSUME(Z),`ALT`)},{ALT:t(()=>this.CONSUME(K),`ALT`)},{ALT:t(()=>this.AT_LEAST_ONE(()=>this.CONSUME(W)),`ALT`)}])}),this.RULE(`useCaseMetadata`,()=>{this.SUBRULE(this.metadata)}),this.RULE(`relationTail`,()=>{this.OPTION({GATE:t(()=>this.LA(1).tokenType===G&&this.LA(2).tokenType===qa,`GATE`),DEF:t(()=>{this.CONSUME(G),this.CONSUME(qa)},`DEF`)}),this.SUBRULE(this.arrow),this.SUBRULE(this.entityName)}),this.RULE(`arrow`,()=>{this.OR([{ALT:t(()=>this.SUBRULE(this.semanticRelation),`ALT`)},{ALT:t(()=>this.SUBRULE(this.forwardSolidOperator),`ALT`)},{ALT:t(()=>this.SUBRULE(this.backwardSolidOperator),`ALT`)},{ALT:t(()=>this.SUBRULE(this.markerlessSolidOperator),`ALT`)},{ALT:t(()=>this.SUBRULE(this.forwardCircleOperator),`ALT`)},{ALT:t(()=>this.SUBRULE(this.backwardCircleOperator),`ALT`)},{ALT:t(()=>this.SUBRULE(this.forwardCrossOperator),`ALT`)},{ALT:t(()=>this.SUBRULE(this.backwardCrossOperator),`ALT`)}])}),this.RULE(`forwardSolidOperator`,()=>{this.CONSUME(Ba)}),this.RULE(`backwardSolidOperator`,()=>{this.CONSUME(Va),this.OPTION({GATE:t(()=>this.LA(0).image===`<--`&&this.hasLabeledRight([Y]),`GATE`),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(Y)},`DEF`)})}),this.RULE(`markerlessSolidOperator`,()=>{this.CONSUME(Y),this.OPTION({GATE:t(()=>this.LA(0).image===`--`&&this.hasLabeledRight([Ba,Y,Ha,Wa]),`GATE`),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.OR([{ALT:t(()=>this.CONSUME(Ba),`ALT`)},{ALT:t(()=>this.CONSUME2(Y),`ALT`)},{ALT:t(()=>this.CONSUME(Ha),`ALT`)},{ALT:t(()=>this.CONSUME(Wa),`ALT`)}])},`DEF`)})}),this.RULE(`forwardCircleOperator`,()=>{this.CONSUME(Ha)}),this.RULE(`backwardCircleOperator`,()=>{this.CONSUME(Ua),this.OPTION({GATE:t(()=>this.hasLabeledRight([Y]),`GATE`),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(Y)},`DEF`)})}),this.RULE(`forwardCrossOperator`,()=>{this.CONSUME(Wa)}),this.RULE(`backwardCrossOperator`,()=>{this.CONSUME(Ga),this.OPTION({GATE:t(()=>this.hasLabeledRight([Y]),`GATE`),DEF:t(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(Y)},`DEF`)})}),this.RULE(`edgeLabel`,()=>{this.OR([{ALT:t(()=>this.CONSUME(Z),`ALT`)},{ALT:t(()=>this.CONSUME(K),`ALT`)},{ALT:t(()=>this.AT_LEAST_ONE(()=>this.CONSUME(W)),`ALT`)}])}),this.RULE(`semanticRelation`,()=>{this.OR([{ALT:t(()=>{this.CONSUME(Pa),this.CONSUME(eo),this.OR2([{ALT:t(()=>this.CONSUME(ka),`ALT`)},{ALT:t(()=>this.CONSUME(Aa),`ALT`)}])},`ALT`)},{ALT:t(()=>this.CONSUME(Na),`ALT`)}])}),this.RULE(`metadata`,()=>{this.CONSUME(Ka),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(Ya)}),this.RULE(`metadataProperty`,()=>{this.OR([{ALT:t(()=>this.CONSUME(G),`ALT`)},{ALT:t(()=>this.CONSUME(Z),`ALT`)}]),this.CONSUME(eo),this.OR2([{ALT:t(()=>this.CONSUME2(G),`ALT`)},{ALT:t(()=>this.CONSUME2(Z),`ALT`)},{ALT:t(()=>this.CONSUME(ja),`ALT`)},{ALT:t(()=>this.CONSUME(Ma),`ALT`)}])}),this.RULE(`metadataSeparator`,()=>{this.OR([{ALT:t(()=>{this.CONSUME(X),this.MANY(()=>this.CONSUME(q))},`ALT`)},{ALT:t(()=>{this.AT_LEAST_ONE(()=>this.CONSUME2(q)),this.OPTION(()=>this.CONSUME2(X)),this.MANY2(()=>this.CONSUME3(q))},`ALT`)}])}),this.RULE(`systemBoundaryStatement`,()=>{this.CONSUME(ha),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(ga),this.SUBRULE2(this.lineEnd)}),this.RULE(`systemBoundaryName`,()=>{this.OR([{ALT:t(()=>{this.CONSUME(G),this.OPTION(()=>{this.OR2([{ALT:t(()=>{this.CONSUME(Qa),this.SUBRULE(this.nodeLabel),this.CONSUME($a)},`ALT`)},{ALT:t(()=>{this.CONSUME(Xa),this.SUBRULE2(this.nodeLabel),this.CONSUME(Za)},`ALT`)}])})},`ALT`)},{ALT:t(()=>this.CONSUME(Z),`ALT`)},{ALT:t(()=>this.CONSUME(K),`ALT`)}])}),this.RULE(`systemBoundaryContent`,()=>{this.MANY(()=>{this.OR([{ALT:t(()=>this.SUBRULE(this.blankLine),`ALT`)},{ALT:t(()=>this.SUBRULE(this.commentLine),`ALT`)},{ALT:t(()=>this.SUBRULE(this.boundaryElement),`ALT`)}])})}),this.RULE(`boundaryElement`,()=>{this.OR([{ALT:t(()=>this.SUBRULE(this.actorDeclarationOnly),`ALT`)},{ALT:t(()=>{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:t(()=>this.CONSUME(G),`ALT`)},{ALT:t(()=>this.CONSUME(Z),`ALT`)},{ALT:t(()=>this.CONSUME(K),`ALT`)}])}),this.RULE(`noteStatement`,()=>{this.CONSUME(Ca),this.CONSUME(wa),this.CONSUME(G),this.SUBRULE(this.nodeLabel),this.SUBRULE(this.lineEnd)}),this.RULE(`stereotype`,()=>{this.CONSUME(Fa),this.CONSUME(La),this.CONSUME(Ia)}),this.RULE(`classSuffix`,()=>{this.CONSUME(za),this.CONSUME(G),this.MANY(()=>{this.CONSUME(X),this.CONSUME2(G)})}),this.RULE(`jsonStatement`,()=>{this.CONSUME(ua),this.CONSUME(da),this.OPTION(()=>this.SUBRULE(this.classSuffix)),this.SUBRULE(this.lineEnd)}),this.RULE(`directionStatement`,()=>{this.CONSUME(_a),this.OR([{ALT:t(()=>this.CONSUME(va),`ALT`)},{ALT:t(()=>this.CONSUME(ya),`ALT`)},{ALT:t(()=>this.CONSUME(ba),`ALT`)},{ALT:t(()=>this.CONSUME(xa),`ALT`)},{ALT:t(()=>this.CONSUME(Sa),`ALT`)}]),this.SUBRULE(this.lineEnd)}),this.RULE(`classDefStatement`,()=>{this.CONSUME(Ea),this.CONSUME(G),this.MANY(()=>{this.CONSUME(X),this.CONSUME2(G)}),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE(`classStatement`,()=>{this.CONSUME(Da),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(Oa),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:t(()=>this.CONSUME(ea),`ALT`)},{ALT:t(()=>this.CONSUME(no),`ALT`)},{ALT:t(()=>{this.CONSUME(Y),this.CONSUME2(ea)},`ALT`)}]),this.CONSUME(eo),this.AT_LEAST_ONE(()=>this.SUBRULE(this.styleComponent))}),this.RULE(`styleComponent`,()=>{this.OR([{ALT:t(()=>this.CONSUME(ea),`ALT`)},{ALT:t(()=>this.CONSUME(Z),`ALT`)},{ALT:t(()=>this.CONSUME(ta),`ALT`)},{ALT:t(()=>this.CONSUME(to),`ALT`)},{ALT:t(()=>this.CONSUME(no),`ALT`)},{ALT:t(()=>this.CONSUME(ro),`ALT`)},{ALT:t(()=>this.CONSUME(io),`ALT`)},{ALT:t(()=>this.CONSUME(ao),`ALT`)},{ALT:t(()=>this.CONSUME(oo),`ALT`)},{ALT:t(()=>this.CONSUME(so),`ALT`)},{ALT:t(()=>this.CONSUME(eo),`ALT`)},{ALT:t(()=>this.CONSUME(Qa),`ALT`)},{ALT:t(()=>this.CONSUME($a),`ALT`)},{ALT:t(()=>this.CONSUME(Xa),`ALT`)},{ALT:t(()=>this.CONSUME(Za),`ALT`)},{ALT:t(()=>this.CONSUME(Ja),`ALT`)},{ALT:t(()=>this.CONSUME(Ya),`ALT`)},{ALT:t(()=>this.CONSUME(qa),`ALT`)},{ALT:t(()=>this.CONSUME(Y),`ALT`)}])}),this.performSelfAnalysis()}isMetadataAssignment(){let e=this.LA(1).tokenType;return(e===G||e===Z||e===K)&&this.LA(2).tokenType===Ka}isStatementStart(){let e=this.LA(1).tokenType;return e!==R&&e!==q&&e!==ia}isForbiddenPlantUmlStatement(){return this.LA(1).tokenType===G&&mo[this.LA(1).image.toLowerCase()]===!0}hasLabeledRight(e){if(!po(this.LA(1)))return!1;for(let t=2;;t++){let n=this.LA(t);if(e.includes(n.tokenType))return!0;if(!po(n))return!1}}},go=class extends Error{constructor(e,t,n){super(`${e} (line ${t}, column ${n})`),this.line=t,this.column=n,this.name=`UsecaseJsonError`}static{t(this,`UsecaseJsonError`)}},_o=t((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`),vo=t((e,t,n,r)=>{let i=/\bposition (\d+)\b/u.exec(e);if(i)return _o(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 _o(t,t.length,n,r)},`locationFromErrorMessage`),Q=class extends Error{constructor(e){super(`Invalid JSON token`),this.offset=e}static{t(this,`JsonWalkError`)}},yo=class{constructor(e){this.text=e,this.offset=0,this.propertyOrder={}}static{t(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 bo(e,t,n){let r;try{r=JSON.parse(e)}catch(r){let i=r instanceof Error?r.message:String(r),a=vo(i,e,t,n);if(!a){let r=0;try{new yo(e).collect()}catch(e){e instanceof Q&&(r=e.offset)}a=_o(e,r,t,n)}throw new go(`Invalid JSON: ${i}`,a.line,a.column)}if(typeof r!=`object`||!r||Array.isArray(r))throw new go(`JSON value must have an object root`,t,n);return{value:r,propertyOrder:new yo(e).collect()}}t(bo,`parseOrderedJsonObject`);var xo=t(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`),So=t(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`),Co=t(e=>({label:e.label,shape:`note`,attrs:{kind:`note`,target:e.target,labelType:e.labelType}}),`noteNode`),wo=t(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`),To=t(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`),Eo=t(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`),Do=t((e,t,n,r)=>{let i={};for(let t of e.getActors().values())i[t.id]=xo(t);for(let t of e.getUseCases().values())i[t.id]=So(t);for(let t of e.getNotes().values())i[t.id]=Co(t);for(let t of e.getJsonNodes().values())i[t.id]=wo(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(To),...[...e.getNotes().values()].map(Eo)],groups:a,classDefs:o,statements:r}},`buildUsecaseGraphAST`),$=t(e=>`line ${e.line}, column ${e.column} [${e.span[0]},${e.span[1]})`,`locationText`),Oo=t(e=>e===void 0?``:` (label "${e}")`,`labelSuffix`),ko=t(e=>e.generated?e.label:void 0,`generatedFrom`),Ao=t((e,t)=>{for(let n of t)e.includes(n)||e.push(n)},`pushUnique`),jo=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{t(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=Do(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=ko({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,ko(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,ko(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,Ao(a.classes,e.classes),this.applyDeclarationMetadata(a,e.metadata)}collectBoundary(e,t,n){let r=t.get(e.id),i=ko({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,ko(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,ko(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),Ao(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)Ao(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(e,n,r,i){let a=t(e=>e===`actor`||e===`usecase`||e===`json`,`allowed`);if(a(n)||this.conflict(`Relationship source '${e.source.id}' cannot be ${n}`,e.source.location,i.get(e.source.id).location),a(r)||this.conflict(`Relationship target '${e.target.id}' cannot be ${r}`,e.target.location,i.get(e.target.id).location),(e.type===`include`||e.type===`extend`)&&(n!==`usecase`||r!==`usecase`))throw Error(`${e.type} relationship requires use-case endpoints at ${$(e.location)}`);if(e.type===`generalization`&&(n!==`actor`&&n!==`usecase`||n!==r))throw Error(`Generalization requires actor-to-actor or use-case-to-use-case endpoints at ${$(e.location)}`);if(e.type===`association`&&(n===`json`||r===`json`)&&![0,1,2].includes(e.arrowType))throw Error(`JSON relationship '${e.source.id}' to '${e.target.id}' permits only point, reversed-point, or markerless solid association at ${$(e.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,ko(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)}${Oo(r)}; previous declaration at ${$(n)}${Oo(i)}`)}},Mo=ho.getBaseCstVisitorConstructor(),No=new class extends Mo{constructor(){super(),this.builder=new jo(Gi),this.source=``,this.anonymousEdge=0,this.anonymousNote=0,this.validateVisitor()}static{t(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=bo(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)}},Po={parse:t(async e=>{Gi.clear(),ho.input=[];try{fi({diagramType:`usecase`,lexer:fo,parser:ho,entry:t(()=>ho.start(),`entry`),visit:t(t=>No.build(t,e),`visit`)},e)}catch(t){Gi.clear();let n=ho.errors[0];if(n){let{token:r}=n,i=di(r.startOffset)?r.startOffset:e.length,a=di(r.endOffset)?r.endOffset+1:i,o=di(r.startLine)?r.startLine:e.slice(0,i).split(/\r\n|\r|\n/).length,s=Math.max(e.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 bo(e,t,n){let r;try{r=JSON.parse(e)}catch(r){let i=r instanceof Error?r.message:String(r),a=vo(i,e,t,n);if(!a){let r=0;try{new yo(e).collect()}catch(e){e instanceof Q&&(r=e.offset)}a=_o(e,r,t,n)}throw new go(`Invalid JSON: ${i}`,a.line,a.column)}if(typeof r!=`object`||!r||Array.isArray(r))throw new go(`JSON value must have an object root`,t,n);return{value:r,propertyOrder:new yo(e).collect()}}t(bo,`parseOrderedJsonObject`);var xo=t(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`),So=t(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`),Co=t(e=>({label:e.label,shape:`note`,attrs:{kind:`note`,target:e.target,labelType:e.labelType}}),`noteNode`),wo=t(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`),To=t(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`),Eo=t(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`),Do=t((e,t,n,r)=>{let i={};for(let t of e.getActors().values())i[t.id]=xo(t);for(let t of e.getUseCases().values())i[t.id]=So(t);for(let t of e.getNotes().values())i[t.id]=Co(t);for(let t of e.getJsonNodes().values())i[t.id]=wo(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(To),...[...e.getNotes().values()].map(Eo)],groups:a,classDefs:o,statements:r}},`buildUsecaseGraphAST`),$=t(e=>`line ${e.line}, column ${e.column} [${e.span[0]},${e.span[1]})`,`locationText`),Oo=t(e=>e===void 0?``:` (label "${e}")`,`labelSuffix`),ko=t(e=>e.generated?e.label:void 0,`generatedFrom`),Ao=t((e,t)=>{for(let n of t)e.includes(n)||e.push(n)},`pushUnique`),jo=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{t(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=Do(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=ko({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,ko(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,ko(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,Ao(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=ko({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,ko(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,ko(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),Ao(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)Ao(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(e,n,r,i){let a=t(e=>e===`actor`||e===`usecase`||e===`json`,`allowed`);if(a(n)||this.conflict(`Relationship source '${e.source.id}' cannot be ${n}`,e.source.location,i.get(e.source.id).location),a(r)||this.conflict(`Relationship target '${e.target.id}' cannot be ${r}`,e.target.location,i.get(e.target.id).location),(e.type===`include`||e.type===`extend`)&&(n!==`usecase`||r!==`usecase`))throw Error(`${e.type} relationship requires use-case endpoints at ${$(e.location)}`);if(e.type===`generalization`&&(n!==`actor`&&n!==`usecase`||n!==r))throw Error(`Generalization requires actor-to-actor or use-case-to-use-case endpoints at ${$(e.location)}`);if(e.type===`association`&&(n===`json`||r===`json`)&&![0,1,2].includes(e.arrowType))throw Error(`JSON relationship '${e.source.id}' to '${e.target.id}' permits only point, reversed-point, or markerless solid association at ${$(e.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,ko(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)}${Oo(r)}; previous declaration at ${$(n)}${Oo(i)}`)}},Mo=ho.getBaseCstVisitorConstructor(),No=new class extends Mo{constructor(){super(),this.builder=new jo(Gi),this.source=``,this.anonymousEdge=0,this.anonymousNote=0,this.validateVisitor()}static{t(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=bo(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)}},Po={parse:t(async e=>{Gi.clear(),ho.input=[];try{fi({diagramType:`usecase`,lexer:fo,parser:ho,entry:t(()=>ho.start(),`entry`),visit:t(t=>No.build(t,e),`visit`)},e)}catch(t){Gi.clear();let n=ho.errors[0];if(n){let{token:r}=n,i=di(r.startOffset)?r.startOffset:e.length,a=di(r.endOffset)?r.endOffset+1:i,o=di(r.startLine)?r.startLine:e.slice(0,i).split(/\r\n|\r|\n/).length,s=Math.max(e.lastIndexOf(`
75
75
  `,i-1),e.lastIndexOf(`\r`,i-1)),c=di(r.startColumn)?r.startColumn:i-s,l=t instanceof Error?t.message:String(t);throw Error(`${l} at line ${o}, column ${c} [${i},${a})`)}throw t}},`parse`)},Fo=[`point`,`circle`,`cross`,`extension`],Io={usecaseActor:!0,usecaseActorHollow:!0,usecaseActorAwesome:!0,usecaseActorIcon:!0},Lo=t((e,t)=>{let[n,r]=[e,t].map(e=>e.replace(/[^\w-]+/g,`_`).replace(/^_+|_+$/g,``)||`element`);return`usecase-${n}-${r}`},`usecaseDomId`),Ro=t(e=>`usecase-${e.replace(/[^\w-]+/g,`_`).replace(/^_+|_+$/g,``)||`element`}`,`usecaseNodeDomId`),zo=t((e,t)=>t===`markdown`?h(e).map(e=>e.map(e=>e.content).join(` `)).join(`
76
76
  `):e,`getAccessibleLabel`),Bo=t(e=>{let t=zo(e.label??e.id,e.labelType);if(Io[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`),Vo=t(e=>`${e.boundaryType} system boundary ${zo(e.label??e.id,e.labelType)}`,`getUsecaseBoundaryAccessibleName`),Ho=t(e=>e.relationshipType===`note`?``:`${e.relationshipType===`association`&&e.label?`association ${zo(e.label,e.labelType)}`:e.relationshipType} from ${e.sourceLabel} to ${e.targetLabel}`,`getUsecaseEdgeAccessibleName`),Uo=t(e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),`escapePlainLabel`),Wo=t(e=>e.replace(/([*[\\\]_`])/g,`\\$1`),`escapeMarkdownMarkers`),Go=t((e,t)=>{e.diagramId=t,e.markers=[...Fo];for(let t of e.nodes){let e=t;if(e.domId=Ro(t.id),t.label!==void 0&&t.labelType===`text`&&(t.label=Uo(t.label)),t.stereotype&&=Uo(t.stereotype),!t.isGroup&&t.shape===`usecaseJsonTable`&&(t.jsonRows=t.jsonRows?.map(e=>({...e,key:Uo(e.key),value:Uo(e.value)}))),!t.isGroup&&(t.shape===`usecaseEllipse`||t.shape===`rect`)&&t.stereotype){let n=t.label??Uo(t.id);t.label=`\xAB${Wo(t.stereotype)}\xBB<br/>${t.labelType===`text`?Wo(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=Uo(t.label));return e},`prepareUsecaseLayoutData`),Ko=t((t,n,r)=>{for(let e of n.nodes){let i=typeof e.domId==`string`?e.domId:Lo(n.diagramId,e.id),a=t.select(`#${i}`),o=e.isGroup?`boundary`:Io[e.shape]?`actor`:e.shape===`note`?`note`:e.shape===`usecaseJsonTable`?`json`:`usecase`,s=r.nodes.get(e.id)??e.id;if(a.attr(`data-usecase-id`,e.id).attr(`data-usecase-kind`,o).attr(`role`,`img`).attr(`aria-label`,s),!e.isGroup&&(e.shape===`usecaseEllipse`||e.shape===`rect`)&&`hasFoldedStereotype`in e&&e.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]));t.selectAll(`path[data-et="edge"]`).each(function(){let t=i.get(this.getAttribute(`data-id`)??``);if(!t)return;let a=e(this);a.attr(`id`,Lo(n.diagramId,t.id)).attr(`data-usecase-id`,t.id).attr(`data-usecase-kind`,t.internal?`note-connector`:`relationship`),t.internal?a.attr(`aria-hidden`,`true`):a.attr(`role`,`img`).attr(`aria-label`,r.edges.get(t.id)??t.id)})},`annotateUsecaseElements`),qo=t((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`),Jo={draw:t(async(e,t,r,i)=>{n.info(`Drawing usecase diagram (unified)`,t);let{layout:a}=c(),o=i.db,s=o.getData(),l=new Map(s.nodes.map(e=>[e.id,zo(e.label??e.id,e.labelType)])),u={nodes:new Map(s.nodes.map(e=>[e.id,e.isGroup?Vo(e):Bo(e.shape===`note`?{...e,noteTargetLabel:l.get(e.noteTarget??``)}:e)])),edges:new Map(s.edges.map(e=>[e.id,Ho({...e,sourceLabel:l.get(e.source)??e.sourceLabel,targetLabel:l.get(e.target)??e.targetLabel})]))},d=te(t,s.config.securityLevel);s.layoutAlgorithm=ie(a),Go(s,t),qo(d,s),await re(s,d),Ko(d,s,u);let f=s.diagramPadding;m.insertTitle(d,`usecaseDiagramTitleText`,0,o.getDiagramTitle?.()??``),ne(d,f,`usecaseDiagram`,s.useMaxWidth),qo(d,s)},`draw`)},Yo=t(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`),Xo=t(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!_(t,r))return``;let i=f().usecase?.colorScheme===`rotate`,a=ee(e.look),o=a===`handDrawn`,s=v(n),c=``;for(let e=0;e<g(r);e++){let t=r[e],l=s?`fill: ${n[e%n.length]};`:``,u=`[data-look="${a}"][data-color-id="color-${e}"]`;c+=`
77
77
 
@@ -1 +1 @@
1
- import"./chunk-SRAX5OIU-KFQikY-4.js";var e={signUp:``,signIn:``,paste:``,pasteAsPlaintext:``,pasteCharts:``,chartType_bar:``,chartType_line:``,chartType_radar:``,chartType_plaintext:``,selectAll:``,multiSelect:``,moveCanvas:``,cut:``,copy:``,copyAsPng:``,copyAsSvg:``,copyText:``,copySource:``,convertToCode:``,bringForward:``,sendToBack:``,bringToFront:``,sendBackward:``,delete:``,copyStyles:``,pasteStyles:``,stroke:``,changeStroke:``,background:``,changeBackground:``,fill:``,strokeWidth:``,strokeStyle:``,strokeStyle_solid:``,strokeStyle_dashed:``,strokeStyle_dotted:``,sloppiness:``,pressure:``,pressure_constant:``,pressure_variable:``,opacity:``,textAlign:``,edges:``,sharp:``,round:``,arrowheads:``,arrowhead_none:``,arrowhead_arrow:``,arrowhead_bar:``,arrowhead_circle:``,arrowhead_circle_outline:``,arrowhead_triangle:``,arrowhead_triangle_outline:``,arrowhead_diamond:``,arrowhead_diamond_outline:``,arrowhead_crowfoot_many:``,arrowhead_crowfoot_one:``,arrowhead_crowfoot_one_or_many:``,arrowhead_cardinality_one:``,arrowhead_cardinality_many:``,arrowhead_cardinality_one_or_many:``,arrowhead_cardinality_exactly_one:``,arrowhead_cardinality_zero_or_one:``,arrowhead_cardinality_zero_or_many:``,more_options:``,cardinality:``,arrowtypes:``,arrowtype_sharp:``,arrowtype_round:``,arrowtype_elbowed:``,fontSize:``,fontFamily:``,addWatermark:``,handDrawn:``,normal:``,code:``,small:``,medium:``,large:``,veryLarge:``,solid:``,hachure:``,zigzag:``,crossHatch:``,thin:``,bold:``,left:``,center:``,right:``,extraBold:``,architect:``,artist:``,cartoonist:``,fileTitle:``,colorPicker:``,canvasColors:``,canvasBackground:``,drawingCanvas:``,clearCanvas:``,layers:``,actions:``,language:``,liveCollaboration:``,duplicateSelection:``,untitled:``,name:``,yourName:``,madeWithExcalidraw:``,group:``,ungroup:``,collaborators:``,you:``,toggleGrid:``,addToLibrary:``,removeFromLibrary:``,libraryLoadingMessage:``,libraries:``,loadingScene:``,loadScene:``,align:``,alignTop:``,alignBottom:``,alignLeft:``,alignRight:``,centerVertically:``,centerHorizontally:``,distributeHorizontally:``,distributeVertically:``,flipHorizontal:``,flipVertical:``,viewMode:``,share:``,showStroke:``,showBackground:``,showFonts:``,toggleTheme:``,theme:``,personalLib:``,excalidrawLib:``,decreaseFontSize:``,increaseFontSize:``,unbindText:``,bindText:``,createContainerFromText:``,link:{edit:``,editEmbed:``,create:``,label:``,labelEmbed:``,empty:``,hint:``,goToElement:``},lineEditor:{edit:``,editArrow:``},polygon:{breakPolygon:``,convertToPolygon:``},elementLock:{lock:``,unlock:``,lockAll:``,unlockAll:``},statusPublished:``,sidebarLock:``,selectAllElementsInFrame:``,removeAllElementsFromFrame:``,eyeDropper:``,textToDiagram:``,prompt:``,followUs:``,discordChat:``,zoomToFitViewport:``,zoomToFitSelection:``,zoomToFit:``,installPWA:``,autoResize:``,imageCropping:``,unCroppedDimension:``,copyElementLink:``,linkToElement:``,wrapSelectionInFrame:``,tab:``,shapeSwitch:``,preferences:``,preferences_toolLock:``,boxSelectionMode:``,boxSelectionContain:``,boxSelectionOverlap:``,arrowBinding:``,midpointSnapping:``},t={title:``,desc:``,notFound:``},n={noItems:``,hint_emptyLibrary:``,hint_emptyPrivateLibrary:``,search:{inputPlaceholder:``,heading:``,noResults:``,clearSearch:``}},r={title:``,noMatch:``,singleResult:``,multipleResults:``,placeholder:``,frames:``,texts:``},i={clearReset:``,exportJSON:``,exportImage:``,export:``,copyToClipboard:``,copyLink:``,save:``,saveAs:``,load:``,getShareableLink:``,close:``,selectLanguage:``,scrollBackToContent:``,zoomIn:``,zoomOut:``,resetZoom:``,menu:``,done:``,edit:``,undo:``,redo:``,resetLibrary:``,createNewRoom:``,fullScreen:``,darkMode:``,lightMode:``,systemMode:``,zenMode:``,objectsSnapMode:``,exitZenMode:``,cancel:``,saveLibNames:``,clear:``,remove:``,embed:``,publishLibrary:``,submit:``,confirm:``,embeddableInteractionButton:``},a={clearReset:``,couldNotCreateShareableLink:``,couldNotCreateShareableLinkTooBig:``,couldNotLoadInvalidFile:``,importBackendFailed:``,cannotExportEmptyCanvas:``,couldNotCopyToClipboard:``,decryptFailed:``,uploadedSecurly:``,loadSceneOverridePrompt:``,collabStopOverridePrompt:``,errorAddingToLibrary:``,errorRemovingFromLibrary:``,confirmAddLibrary:``,imageDoesNotContainScene:``,cannotRestoreFromImage:``,invalidSceneUrl:``,resetLibrary:``,removeItemsFromsLibrary:``,invalidEncryptionKey:``,collabOfflineWarning:``,localStorageQuotaExceeded:``},o={unsupportedFileType:``,imageInsertError:``,fileTooBig:``,svgImageInsertError:``,failedToFetchImage:``,cannotResolveCollabServer:``,importLibraryError:``,saveLibraryError:``,collabSaveFailed:``,collabSaveFailed_sizeExceeded:``,imageToolNotSupported:``,brave_measure_text_error:{line1:``,line2:``,line3:``,line4:``},libraryElementTypeError:{embeddable:``,iframe:``,image:``},asyncPasteFailedOnRead:``,asyncPasteFailedOnParse:``,copyToSystemClipboardFailed:``},s={selection:``,lasso:``,image:``,rectangle:``,diamond:``,ellipse:``,arrow:``,line:``,freedraw:``,text:``,library:``,lock:``,penMode:``,link:``,eraser:``,frame:``,magicframe:``,embeddable:``,laser:``,autoshape:``,bucketfill:``,hand:``,extraTools:``,mermaidToExcalidraw:``,convertElementType:``},c={noRegion:``,tooComplex:``},l={rectangle:``,diamond:``,ellipse:``,arrow:``,line:``,freedraw:``,text:``,image:``,group:``,frame:``,magicframe:``,embeddable:``,selection:``,iframe:``},u={canvasActions:``,selectedShapeActions:``,shapes:``},d={dismissSearch:``,canvasPanning:``,linearElement:``,arrowTool:``,arrowBindModifiers:``,freeDraw:``,text:``,embeddable:``,autoshape:``,text_selected:``,text_editing:``,linearElementMulti:``,lockAngle:``,resize:``,resizeImage:``,rotate:``,toggleArrowhead:``,lineEditor_info:``,lineEditor_line_info:``,lineEditor_pointSelected:``,lineEditor_nothingSelected:``,publishLibrary:``,bindTextToElement:``,createFlowchart:``,deepBoxSelect:``,eraserRevert:``,firefox_clipboard_write:``,disableSnapping:``,enterCropEditor:``,leaveCropEditor:``},f={cannotShowPreview:``,canvasTooBig:``,canvasTooBigTip:``},p={headingMain:``,clearCanvasMessage:``,clearCanvasCaveat:``,trackedToSentry:``,openIssueMessage:``,sceneContent:``},m={or:``},h={desc_intro:``,desc_privacy:``,button_startSession:``,button_stopSession:``,desc_inProgressIntro:``,desc_shareLink:``,desc_exitSession:``,shareTitle:``},g={title:``},_={title:``,defaultMessage:``},v={disk_title:``,disk_details:``,disk_button:``,link_title:``,link_details:``,link_button:``,excalidrawplus_description:``,excalidrawplus_button:``,excalidrawplus_exportError:``},y={blog:``,click:``,deepSelect:``,deepBoxSelect:``,createFlowchart:``,navigateFlowchart:``,curvedArrow:``,curvedLine:``,documentation:``,doubleClick:``,drag:``,editor:``,editLineArrowPoints:``,editText:``,github:``,howto:``,or:``,preventBinding:``,tools:``,shortcuts:``,textFinish:``,textNewLine:``,title:``,view:``,zoomToFit:``,zoomToSelection:``,toggleElementLock:``,movePageUpDown:``,movePageLeftRight:``,cropStart:``,cropFinish:``},b={title:``},x={title:``,itemName:``,authorName:``,githubUsername:``,twitterUsername:``,libraryName:``,libraryDesc:``,website:``,placeholder:{authorName:``,libraryName:``,libraryDesc:``,githubHandle:``,twitterHandle:``,website:``},errors:{required:``,website:``},noteDescription:``,noteGuidelines:``,noteLicense:``,noteItems:``,atleastOneLibItem:``,republishWarning:``},S={title:``,content:``},C={resetLibrary:``,removeItemsFromLib:``},w={header:``,label:{withBackground:``,onlySelected:``,darkMode:``,embedScene:``,scale:``,padding:``},tooltip:{embedScene:``},title:{exportToPng:``,exportToSvg:``,copyPngToClipboard:``},button:{exportToPng:``,exportToSvg:``,copyPngToClipboard:``}},T={tooltip:``,link:``},E={angle:``,shapes:``,height:``,scene:``,selected:``,storage:``,fullTitle:``,title:``,generalStats:``,elementProperties:``,total:``,version:``,versionCopy:``,versionNotAvailable:``,width:``},D={addedToLibrary:``,copyStyles:``,copyToClipboard:``,copyToClipboardAsPng:``,copyToClipboardAsSvg:``,fileSaved:``,fileSavedToFilename:``,canvas:``,selection:``,pasteAsSingleElement:``,unableToEmbed:``,unrecognizedLinkFormat:``,elementLinkCopied:``},O={transparent:``,black:``,white:``,red:``,pink:``,grape:``,violet:``,gray:``,blue:``,cyan:``,teal:``,green:``,yellow:``,orange:``,bronze:``},k={app:{center_heading:``,center_heading_line2:``,center_heading_line3:``,center_heading_plus:``,menuHint:``},defaults:{menuHint:``,center_heading:``,toolbarHint:``,helpHint:``}},A={color:``,mostUsedCustomColors:``,colors:``,shades:``,hexCode:``,noShades:``,invalidColor:``,invalidHexLength:``,topPicksTip:``,resetTopPicks:``},j={action:{exportToImage:{title:``,button:``,description:``},saveToDisk:{title:``,button:``,description:``},excalidrawPlus:{title:``,button:``,description:``}},modal:{loadFromFile:{title:``,button:``,description:``},shareableLink:{title:``,button:``,description:``}}},M={title:``,button:``,description:``,syntax:``,preview:``,label:``,inputPlaceholder:``,autoFixAvailable:``},N={error:``},P={inputPlaceholder:``,inputPlaceholderWithMessages:``,generating:``,rateLimitRemaining:``,role:{user:``,assistant:``,system:``},aiBeta:``,label:``,menu:``,newChat:``,deleteChat:``,deleteMessage:``,viewAsMermaid:``,placeholder:{title:``,description:``,hint:``},preview:``,insert:``,retry:``,errors:{promptTooShort:``,promptTooLong:``,generationFailed:``,invalidDiagram:``,fixInMermaid:``,aiRepair:``,requestAborted:``,requestFailed:``,mermaidParseError:``},rateLimit:{messageLimit:``,generalRateLimit:``,messageLimitInputPlaceholder:``},upsellBtnLabel:``},F={placeholder:``},I={badge:{old:``},sceneFonts:``,availableFonts:``,empty:``},L={empty:``,hint:{text:``,followStatus:``,inCall:``,micMuted:``,isSpeaking:``}},R={title:``,shortcuts:{select:``,confirm:``,close:``},recents:``,search:{placeholder:``,noMatch:``},itemNotAvailable:``,shortcutHint:``},z={ctrl:``,option:``,cmd:``,alt:``,escape:``,enter:``,shift:``,spacebar:``,delete:``,mmb:``},B={labels:e,elementLink:t,library:n,search:r,buttons:i,alerts:a,errors:o,toolBar:s,bucketfill:c,element:l,headings:u,hints:d,canvasError:f,errorSplash:p,shareDialog:m,roomDialog:h,errorDialog:g,progressDialog:_,exportDialog:v,helpDialog:y,clearCanvasDialog:b,publishDialog:x,publishSuccessDialog:S,confirmDialog:C,imageExportDialog:w,encrypted:T,stats:E,toast:D,colors:O,welcomeScreen:k,colorPicker:A,overwriteConfirm:j,mermaid:M,ttd:N,chat:P,quickSearch:F,fontList:I,userList:L,commandPalette:R,keys:z};export{a as alerts,c as bucketfill,i as buttons,f as canvasError,P as chat,b as clearCanvasDialog,A as colorPicker,O as colors,R as commandPalette,C as confirmDialog,B as default,l as element,t as elementLink,T as encrypted,g as errorDialog,p as errorSplash,o as errors,v as exportDialog,I as fontList,u as headings,y as helpDialog,d as hints,w as imageExportDialog,z as keys,e as labels,n as library,M as mermaid,j as overwriteConfirm,_ as progressDialog,x as publishDialog,S as publishSuccessDialog,F as quickSearch,h as roomDialog,r as search,m as shareDialog,E as stats,D as toast,s as toolBar,N as ttd,L as userList,k as welcomeScreen};
1
+ import"./chunk-SRAX5OIU-wzfotNc-.js";var e={signUp:``,signIn:``,paste:``,pasteAsPlaintext:``,pasteCharts:``,chartType_bar:``,chartType_line:``,chartType_radar:``,chartType_plaintext:``,selectAll:``,multiSelect:``,moveCanvas:``,cut:``,copy:``,copyAsPng:``,copyAsSvg:``,copyText:``,copySource:``,convertToCode:``,bringForward:``,sendToBack:``,bringToFront:``,sendBackward:``,delete:``,copyStyles:``,pasteStyles:``,stroke:``,changeStroke:``,background:``,changeBackground:``,fill:``,strokeWidth:``,strokeStyle:``,strokeStyle_solid:``,strokeStyle_dashed:``,strokeStyle_dotted:``,sloppiness:``,pressure:``,pressure_constant:``,pressure_variable:``,opacity:``,textAlign:``,edges:``,sharp:``,round:``,arrowheads:``,arrowhead_none:``,arrowhead_arrow:``,arrowhead_bar:``,arrowhead_circle:``,arrowhead_circle_outline:``,arrowhead_triangle:``,arrowhead_triangle_outline:``,arrowhead_diamond:``,arrowhead_diamond_outline:``,arrowhead_crowfoot_many:``,arrowhead_crowfoot_one:``,arrowhead_crowfoot_one_or_many:``,arrowhead_cardinality_one:``,arrowhead_cardinality_many:``,arrowhead_cardinality_one_or_many:``,arrowhead_cardinality_exactly_one:``,arrowhead_cardinality_zero_or_one:``,arrowhead_cardinality_zero_or_many:``,more_options:``,cardinality:``,arrowtypes:``,arrowtype_sharp:``,arrowtype_round:``,arrowtype_elbowed:``,fontSize:``,fontFamily:``,addWatermark:``,handDrawn:``,normal:``,code:``,small:``,medium:``,large:``,veryLarge:``,solid:``,hachure:``,zigzag:``,crossHatch:``,thin:``,bold:``,left:``,center:``,right:``,extraBold:``,architect:``,artist:``,cartoonist:``,fileTitle:``,colorPicker:``,canvasColors:``,canvasBackground:``,drawingCanvas:``,clearCanvas:``,layers:``,actions:``,language:``,liveCollaboration:``,duplicateSelection:``,untitled:``,name:``,yourName:``,madeWithExcalidraw:``,group:``,ungroup:``,collaborators:``,you:``,toggleGrid:``,addToLibrary:``,removeFromLibrary:``,libraryLoadingMessage:``,libraries:``,loadingScene:``,loadScene:``,align:``,alignTop:``,alignBottom:``,alignLeft:``,alignRight:``,centerVertically:``,centerHorizontally:``,distributeHorizontally:``,distributeVertically:``,flipHorizontal:``,flipVertical:``,viewMode:``,share:``,showStroke:``,showBackground:``,showFonts:``,toggleTheme:``,theme:``,personalLib:``,excalidrawLib:``,decreaseFontSize:``,increaseFontSize:``,unbindText:``,bindText:``,createContainerFromText:``,link:{edit:``,editEmbed:``,create:``,label:``,labelEmbed:``,empty:``,hint:``,goToElement:``},lineEditor:{edit:``,editArrow:``},polygon:{breakPolygon:``,convertToPolygon:``},elementLock:{lock:``,unlock:``,lockAll:``,unlockAll:``},statusPublished:``,sidebarLock:``,selectAllElementsInFrame:``,removeAllElementsFromFrame:``,eyeDropper:``,textToDiagram:``,prompt:``,followUs:``,discordChat:``,zoomToFitViewport:``,zoomToFitSelection:``,zoomToFit:``,installPWA:``,autoResize:``,imageCropping:``,unCroppedDimension:``,copyElementLink:``,linkToElement:``,wrapSelectionInFrame:``,tab:``,shapeSwitch:``,preferences:``,preferences_toolLock:``,boxSelectionMode:``,boxSelectionContain:``,boxSelectionOverlap:``,arrowBinding:``,midpointSnapping:``},t={title:``,desc:``,notFound:``},n={noItems:``,hint_emptyLibrary:``,hint_emptyPrivateLibrary:``,search:{inputPlaceholder:``,heading:``,noResults:``,clearSearch:``}},r={title:``,noMatch:``,singleResult:``,multipleResults:``,placeholder:``,frames:``,texts:``},i={clearReset:``,exportJSON:``,exportImage:``,export:``,copyToClipboard:``,copyLink:``,save:``,saveAs:``,load:``,getShareableLink:``,close:``,selectLanguage:``,scrollBackToContent:``,zoomIn:``,zoomOut:``,resetZoom:``,menu:``,done:``,edit:``,undo:``,redo:``,resetLibrary:``,createNewRoom:``,fullScreen:``,darkMode:``,lightMode:``,systemMode:``,zenMode:``,objectsSnapMode:``,exitZenMode:``,cancel:``,saveLibNames:``,clear:``,remove:``,embed:``,publishLibrary:``,submit:``,confirm:``,embeddableInteractionButton:``},a={clearReset:``,couldNotCreateShareableLink:``,couldNotCreateShareableLinkTooBig:``,couldNotLoadInvalidFile:``,importBackendFailed:``,cannotExportEmptyCanvas:``,couldNotCopyToClipboard:``,decryptFailed:``,uploadedSecurly:``,loadSceneOverridePrompt:``,collabStopOverridePrompt:``,errorAddingToLibrary:``,errorRemovingFromLibrary:``,confirmAddLibrary:``,imageDoesNotContainScene:``,cannotRestoreFromImage:``,invalidSceneUrl:``,resetLibrary:``,removeItemsFromsLibrary:``,invalidEncryptionKey:``,collabOfflineWarning:``,localStorageQuotaExceeded:``},o={unsupportedFileType:``,imageInsertError:``,fileTooBig:``,svgImageInsertError:``,failedToFetchImage:``,cannotResolveCollabServer:``,importLibraryError:``,saveLibraryError:``,collabSaveFailed:``,collabSaveFailed_sizeExceeded:``,imageToolNotSupported:``,brave_measure_text_error:{line1:``,line2:``,line3:``,line4:``},libraryElementTypeError:{embeddable:``,iframe:``,image:``},asyncPasteFailedOnRead:``,asyncPasteFailedOnParse:``,copyToSystemClipboardFailed:``},s={selection:``,lasso:``,image:``,rectangle:``,diamond:``,ellipse:``,arrow:``,line:``,freedraw:``,text:``,library:``,lock:``,penMode:``,link:``,eraser:``,frame:``,magicframe:``,embeddable:``,laser:``,autoshape:``,bucketfill:``,hand:``,extraTools:``,mermaidToExcalidraw:``,convertElementType:``},c={noRegion:``,tooComplex:``},l={rectangle:``,diamond:``,ellipse:``,arrow:``,line:``,freedraw:``,text:``,image:``,group:``,frame:``,magicframe:``,embeddable:``,selection:``,iframe:``},u={canvasActions:``,selectedShapeActions:``,shapes:``},d={dismissSearch:``,canvasPanning:``,linearElement:``,arrowTool:``,arrowBindModifiers:``,freeDraw:``,text:``,embeddable:``,autoshape:``,text_selected:``,text_editing:``,linearElementMulti:``,lockAngle:``,resize:``,resizeImage:``,rotate:``,toggleArrowhead:``,lineEditor_info:``,lineEditor_line_info:``,lineEditor_pointSelected:``,lineEditor_nothingSelected:``,publishLibrary:``,bindTextToElement:``,createFlowchart:``,deepBoxSelect:``,eraserRevert:``,firefox_clipboard_write:``,disableSnapping:``,enterCropEditor:``,leaveCropEditor:``},f={cannotShowPreview:``,canvasTooBig:``,canvasTooBigTip:``},p={headingMain:``,clearCanvasMessage:``,clearCanvasCaveat:``,trackedToSentry:``,openIssueMessage:``,sceneContent:``},m={or:``},h={desc_intro:``,desc_privacy:``,button_startSession:``,button_stopSession:``,desc_inProgressIntro:``,desc_shareLink:``,desc_exitSession:``,shareTitle:``},g={title:``},_={title:``,defaultMessage:``},v={disk_title:``,disk_details:``,disk_button:``,link_title:``,link_details:``,link_button:``,excalidrawplus_description:``,excalidrawplus_button:``,excalidrawplus_exportError:``},y={blog:``,click:``,deepSelect:``,deepBoxSelect:``,createFlowchart:``,navigateFlowchart:``,curvedArrow:``,curvedLine:``,documentation:``,doubleClick:``,drag:``,editor:``,editLineArrowPoints:``,editText:``,github:``,howto:``,or:``,preventBinding:``,tools:``,shortcuts:``,textFinish:``,textNewLine:``,title:``,view:``,zoomToFit:``,zoomToSelection:``,toggleElementLock:``,movePageUpDown:``,movePageLeftRight:``,cropStart:``,cropFinish:``},b={title:``},x={title:``,itemName:``,authorName:``,githubUsername:``,twitterUsername:``,libraryName:``,libraryDesc:``,website:``,placeholder:{authorName:``,libraryName:``,libraryDesc:``,githubHandle:``,twitterHandle:``,website:``},errors:{required:``,website:``},noteDescription:``,noteGuidelines:``,noteLicense:``,noteItems:``,atleastOneLibItem:``,republishWarning:``},S={title:``,content:``},C={resetLibrary:``,removeItemsFromLib:``},w={header:``,label:{withBackground:``,onlySelected:``,darkMode:``,embedScene:``,scale:``,padding:``},tooltip:{embedScene:``},title:{exportToPng:``,exportToSvg:``,copyPngToClipboard:``},button:{exportToPng:``,exportToSvg:``,copyPngToClipboard:``}},T={tooltip:``,link:``},E={angle:``,shapes:``,height:``,scene:``,selected:``,storage:``,fullTitle:``,title:``,generalStats:``,elementProperties:``,total:``,version:``,versionCopy:``,versionNotAvailable:``,width:``},D={addedToLibrary:``,copyStyles:``,copyToClipboard:``,copyToClipboardAsPng:``,copyToClipboardAsSvg:``,fileSaved:``,fileSavedToFilename:``,canvas:``,selection:``,pasteAsSingleElement:``,unableToEmbed:``,unrecognizedLinkFormat:``,elementLinkCopied:``},O={transparent:``,black:``,white:``,red:``,pink:``,grape:``,violet:``,gray:``,blue:``,cyan:``,teal:``,green:``,yellow:``,orange:``,bronze:``},k={app:{center_heading:``,center_heading_line2:``,center_heading_line3:``,center_heading_plus:``,menuHint:``},defaults:{menuHint:``,center_heading:``,toolbarHint:``,helpHint:``}},A={color:``,mostUsedCustomColors:``,colors:``,shades:``,hexCode:``,noShades:``,invalidColor:``,invalidHexLength:``,topPicksTip:``,resetTopPicks:``},j={action:{exportToImage:{title:``,button:``,description:``},saveToDisk:{title:``,button:``,description:``},excalidrawPlus:{title:``,button:``,description:``}},modal:{loadFromFile:{title:``,button:``,description:``},shareableLink:{title:``,button:``,description:``}}},M={title:``,button:``,description:``,syntax:``,preview:``,label:``,inputPlaceholder:``,autoFixAvailable:``},N={error:``},P={inputPlaceholder:``,inputPlaceholderWithMessages:``,generating:``,rateLimitRemaining:``,role:{user:``,assistant:``,system:``},aiBeta:``,label:``,menu:``,newChat:``,deleteChat:``,deleteMessage:``,viewAsMermaid:``,placeholder:{title:``,description:``,hint:``},preview:``,insert:``,retry:``,errors:{promptTooShort:``,promptTooLong:``,generationFailed:``,invalidDiagram:``,fixInMermaid:``,aiRepair:``,requestAborted:``,requestFailed:``,mermaidParseError:``},rateLimit:{messageLimit:``,generalRateLimit:``,messageLimitInputPlaceholder:``},upsellBtnLabel:``},F={placeholder:``},I={badge:{old:``},sceneFonts:``,availableFonts:``,empty:``},L={empty:``,hint:{text:``,followStatus:``,inCall:``,micMuted:``,isSpeaking:``}},R={title:``,shortcuts:{select:``,confirm:``,close:``},recents:``,search:{placeholder:``,noMatch:``},itemNotAvailable:``,shortcutHint:``},z={ctrl:``,option:``,cmd:``,alt:``,escape:``,enter:``,shift:``,spacebar:``,delete:``,mmb:``},B={labels:e,elementLink:t,library:n,search:r,buttons:i,alerts:a,errors:o,toolBar:s,bucketfill:c,element:l,headings:u,hints:d,canvasError:f,errorSplash:p,shareDialog:m,roomDialog:h,errorDialog:g,progressDialog:_,exportDialog:v,helpDialog:y,clearCanvasDialog:b,publishDialog:x,publishSuccessDialog:S,confirmDialog:C,imageExportDialog:w,encrypted:T,stats:E,toast:D,colors:O,welcomeScreen:k,colorPicker:A,overwriteConfirm:j,mermaid:M,ttd:N,chat:P,quickSearch:F,fontList:I,userList:L,commandPalette:R,keys:z};export{a as alerts,c as bucketfill,i as buttons,f as canvasError,P as chat,b as clearCanvasDialog,A as colorPicker,O as colors,R as commandPalette,C as confirmDialog,B as default,l as element,t as elementLink,T as encrypted,g as errorDialog,p as errorSplash,o as errors,v as exportDialog,I as fontList,u as headings,y as helpDialog,d as hints,w as imageExportDialog,z as keys,e as labels,n as library,M as mermaid,j as overwriteConfirm,_ as progressDialog,x as publishDialog,S as publishSuccessDialog,F as quickSearch,h as roomDialog,r as search,m as shareDialog,E as stats,D as toast,s as toolBar,N as ttd,L as userList,k as welcomeScreen};
@@ -1,7 +1,25 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./auth-gate-C3mlS_4N.css"])))=>i.map(i=>d[i]);
2
- import{a as e,c as t,g as n,h as r,p as i,v as a}from"./file-kind-BGxTVHan.js";import{a as o,n as s,s as c,t as l}from"./api-client-utils-C5ESDKMG.js";import{t as u}from"./preload-helper-CYtfOYgs.js";import{r as d}from"./runtime-paths-qQGhzNx4.js";import{d as f,n as p}from"./runtime-config-CvrkHb0n.js";function m(e){let t=String(e??``).trim().replace(/\\/g,`/`);if(!t||t.startsWith(`/`))return``;let n=t.split(`/`).map(e=>e.trim()).filter(Boolean);return n.some(e=>e===`.`||e===`..`)?``:n.join(`/`)}function h(e,t){let n=m(e),r=m(t);return n?r?`${n}/${r}`:n:r}function g(e=``){return String(e??``).replace(/\/+$/u,``).split(`/`).filter(Boolean).pop()||``}function _(e=``){let t=String(e??``).replace(/\/+$/u,``),n=t.lastIndexOf(`/`);return n>=0?t.slice(0,n):``}function v(e,t){return e.toLowerCase().endsWith(t.toLowerCase())?e:`${e}${t}`}function y(e){return`# ${a(String(e??``).split(`/`).pop()||``)||`Untitled`}\n\n`}function b(t){let n=m(t),r=e(n)?n:`${n}.base`;return{content:[`views:`,` - type: table`,` name: Table`,` order:`,` - file.name`,``].join(`
3
- `),path:r}}function x(e){let t=m(e),n=i(t)?t:`${t}.mmd`;return{content:[`flowchart TD`,` A[Start] --> B{Decide}`,` B -->|Yes| C[Ship it]`,` B -->|No| D[Revise]`,``].join(`
4
- `),path:n}}function S(e){let n=m(e),r=t(n)?n:`${n}.drawio`;return{content:[`<mxfile host="app.diagrams.net" modified="2026-01-01T00:00:00.000Z" agent="CollabMD" version="24.7.17">`,` <diagram id="page-1" name="Page-1">`,` <mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">`,` <root>`,` <mxCell id="0" />`,` <mxCell id="1" parent="0" />`,` </root>`,` </mxGraphModel>`,` </diagram>`,`</mxfile>`,``].join(`
5
- `),path:r}}function C(e){let t=m(e),n=r(t)?t:`${t}.puml`;return{content:[`@startuml`,`Alice -> Bob: Hello`,`@enduml`,``].join(`
6
- `),path:n}}function w(e){let t=m(e),r=n(t)?t:`${t}.dsl`;return{content:`workspace "CollabMD Example" "A small Structurizr workspace" {, model {, user = person "User" "Uses the system", system = softwareSystem "Example System" "The system being documented" {, web = container "Web Application" "Serves the user interface" "JavaScript" {, home = component "Home Page" "Shows the landing page" "React", editor = component "Editor" "Edits workspace content" "React", }, api = container "API" "Handles requests" "Node.js", }, user -> system "Uses", web -> api "Calls" "HTTPS/JSON", home -> editor "Links to", }, views {, systemContext system "Context" {, include *, autoLayout, }, container system "Containers" {, include *, autoLayout, }, component web "Components" {, include *, autoLayout, }, styles {, element "Person" {, shape person, }, }, },},`.split(`,`).join(`
7
- `),path:r}}var T={enabled:!1,implemented:!0,loginEndpoint:`/api/auth/oidc/login`,passwordLabel:`Password`,provider:``,requiresLogin:!1,sessionEndpoint:`/api/auth/session`,statusEndpoint:`/api/auth/status`,strategy:`none`,submitLabel:`Continue`},E=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAIAAAABc2X6AAAGsklEQVR4Ae3cA3jsShgG4Gvbtu1js7aObdu2bdbudmvbtu1VtUg2ydw7x95mstnt5rZ5voflG80/fzL72L89bOsF94J7wWgb2dSgiAzpPHmwbfPK1qWzxDNsRdb6Ar2BgtF9hSbDRbYG4mk2beuXwm+Q89yV+TmAILgHptrb5DyPtg3LhBZjBCP+RovewNZlc2TOl8nGel0HA4LA4qPhkRSM6XcHoEYk86fIfT2AQqFzYIBjMncHofkoZBWNCM1GSq+cpdpadQIMKEoRzIeXIroEkW08TObpDAiiO8F4Tga85TBnoEc8xVKZm9UNYECS0stnBCP/Ud+AnJH/SC+eAiShPTDZ3CRZPIN9CUokC6ZSYqE2wHhmKhw/2TegR2RnSFSUaRaMJccLxg7QsAQhktkTAACaAmOxkbA80h2taKIZKWzR1BFWRAQLRvXhphYdDEtcWDxxU4sOhjdDkdVYbmrRwYAgJIums3RTNWrftbHz/AmZh5MiLBAGVqOdZ4+1790inmrFvpYZuPPEATWdknmT5f7eZEN9V2N7o9zPu3XNInQte2BlcYE6tVTbltXw4kf9h5QlhW3rliBr1QcDAODsjPFlhmelqfNvKQty4S9B0KoPVgTxmWk7Tx0COMZCF6GzA3ZC0LWMwJSsTWiOXj+O6iP382KzowAAvMOhaxmAqw/Ijr4tGPsHgnbsACwxlpNNPABIIv5LIvxpzOVlkdXPNMGK8CCudi2pFi+ovRFlwLOtc7/uUgvnxhxu05LpIyD17nTu+EAw8q9HaVtXzgcAcBUMcAER/sx9YBj5pdeExr897NLtT9TVcLgRTzVcgbyHBuc9L5n8PdLJzAEwmWP1KDCMMvTp9jWf3tbC1gdQKDgMBhRBRL0GYaojO35zxOo8fZjbz5ZAZz700Anm9pLI9g+yoY7bYKrJBWJoRpk8SJ0/fDoc13QuRuNdgMmydfTBZPkGdcDDd0q1EDkOVIKzTOiDKVGY7oPLmylVYCKlL30wIKW6D44tJlSCE76nC45+CwHXfWDfdKVKcMwHdMEJ33MC7JqEqwRHvEgXnDaYE+ArMayBB3ECDAennnVKn4tUDU74gS446k1OgB3i8Z41LHmkKHtW4eGfpRpctv5/VlomlxOsTR6kKQN1H1wnptiZHpYFv27pMbqus4kxOChbySzTz8loakfukhIkYKEBEBzw6SBXk79cLQ5lXv5XuxtJAaMDdA/v+JMydVs8irBnDvB+g9QbGeY1SUFg2gTn1JD0z+cdPIVaTbym0JemeQ6FzrtzJtdFm+DT4Rh9MD9DybxNmxL03mg3g/u0MP3cbWo6GrWjbZMBg/0Id6wqAcWwEX+F/10fVzPIe2jmRW3VTiP+VBjC4bU6KgMAID9qaQt9frl3P6hSndOaP7HrxdSYPQiH92QYhvAwTRH7KdSWBL9h5j4GeugkqDpWc1oZBqaelSGNwMWNJMLjUkHxBn//zwZeH3topr+7bWxDmia0AID17gok7aTTMrTnw1KsfZTPVMhAyj9uVl5lIexqcQLs4KFpYXjpSjQw3HwrIqCBQQ5mXsZInBWtoIOac1GOqrU4IsUJwOSllsmha5iZTf3npzXnqXka+1dFmzo4D9vZgQp2TsAZvrZUIC7729WSmRlmVfz+HGExKpUCVGJj1oSQlTd+SZ9Lm4bubqKvtTkmk+OAIRhu+zMu3jEwyqTQ1d7lofWdzV0VyWSxpPJkjpOB76z7fsPfjjOHHMhBb0QzAhMUMS18nRrgOzHkz96YdPR4toNTMT+gKjq4OtatNPBCvgfcp9PD1w/wsFP14y7WA4/zu9SudVWw8HKpUC4Zw5uOLmQ//c4fGrZL8iit+WEpvMmxAIZbtrCor7uNLpj/ubpk6N6Kh059M6tINl8Qh4UUHGa73wzjNGHQ4dj7wC6JOPtLACLqkvq4WeuE2cWi/+nLt0csOKnQ1CKP+IYMWELqgPnGiLVh6O7Go8GYZpfxpDbnwkaHjpj3JfLRV7Wgb01SARxIupc6wntyfGOG9pbikRQJmzvodRg7mRq2tkkm7IbFlhktBdaBS7SsPZx1haDIbltOSwGKXxl5px7UZGaEb8gXlerEgmmMxB2KfEciTKHRAsvbmPo0nVsST1BEdH3Kyrh9bJVlQ7wmbk05USSu0PUPPWjDOtxLg5bF7h7tM42B08x//o7U0/AmrCSV3PtYiwZpS3B13MHMS/DIz4rYaBO0VM93JpwbwaJtqNfEsbwZFgEL50VtgcJLBV6wK9aKtfd+cEkvuBfcC37k9h8VGR+csPdltgAAAABJRU5ErkJggg==`;function D(){return{...T,...p().auth??{}}}function O(){return f(window.location.hash).get(`auth_password`)||``}function k(){let e=f(window.location.hash);if(!e.has(`auth_password`))return;e.delete(`auth_password`);let t=e.toString(),n=`${window.location.pathname}${window.location.search}${t?`#${t}`:``}`;window.history.replaceState(null,``,n)}function A(e){let t=f(window.location.hash),n=t.get(e)||``;if(!n)return``;t.delete(e);let r=t.toString(),i=`${window.location.pathname}${window.location.search}${r?`#${r}`:``}`;return window.history.replaceState(null,``,i),n}function j(){return`${window.location.pathname}${window.location.search}${window.location.hash}`}async function M(e){let t=await fetch(e.statusEndpoint,{headers:{Accept:`application/json`}});return s(t,`Failed to read auth status`)}function N(e){let t=e?.auth??{};if(t.strategy!==`oidc`||t.provider!==`google`)return;let n=String(e?.user?.name??``).trim();if(n)try{window.localStorage.setItem(`collabmd-user-name`,n)}catch{}}async function P(e,t){let n=await fetch(e.sessionEndpoint,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({password:t})});return s(n,`Authentication failed`)}function F(){let e=document.createElement(`div`);e.className=`auth-gate-overlay`;let t=document.createElement(`section`);return t.className=`auth-gate-card`,e.append(t),{card:t,overlay:e}}function I(){let e=document.createElement(`span`);e.className=`auth-gate-button__icon`,e.setAttribute(`aria-hidden`,`true`);let t=document.createElement(`img`);return t.alt=``,t.decoding=`async`,t.height=20,t.loading=`eager`,t.src=E,t.width=20,e.append(t),e}function L(e,t,{errorMessage:n=``}){e.replaceChildren();let r=document.createElement(`h1`);r.textContent=`Authentication required`;let i=document.createElement(`p`);i.textContent=`Sign in with Google to join this session.`;let a=document.createElement(`div`);a.className=`auth-gate-actions`;let o=document.createElement(`button`);o.className=`ui-button ui-button--secondary auth-gate-button auth-gate-button--google`,o.type=`button`,o.append(I(),document.createTextNode(t.submitLabel||`Continue with Google`));let s=document.createElement(`div`);s.className=`auth-gate-error`,s.textContent=n,a.append(o),e.append(r,i,s,a),o.addEventListener(`click`,()=>{let e=new URL(t.loginEndpoint,window.location.origin);e.searchParams.set(`returnTo`,j()),window.location.assign(e.toString())})}function R(e,{title:t,body:n,secondaryActionLabel:r=``,onSecondaryAction:i=null}){e.replaceChildren();let a=document.createElement(`h1`);a.textContent=t;let o=document.createElement(`p`);if(o.textContent=n,e.append(a,o),r&&typeof i==`function`){let t=document.createElement(`button`);t.className=`ui-button ui-button--secondary auth-gate-secondary-button`,t.type=`button`,t.textContent=r,t.addEventListener(`click`,()=>{i()}),e.append(t)}}function z(e,t,{onSubmit:n}){e.replaceChildren();let r=document.createElement(`h1`);r.textContent=`Authentication required`;let i=document.createElement(`p`);i.textContent=`Enter the host password to join this shared session.`;let a=document.createElement(`form`);a.className=`auth-gate-form`;let o=document.createElement(`label`);o.className=`auth-gate-label`,o.textContent=t.passwordLabel;let s=document.createElement(`input`);s.className=`ui-input auth-gate-input`,s.type=`password`,s.name=`password`,s.autocomplete=`current-password`,s.required=!0;let c=document.createElement(`div`);c.className=`auth-gate-error`;let l=document.createElement(`div`);l.className=`auth-gate-actions`;let u=document.createElement(`button`);u.className=`ui-button ui-button--primary auth-gate-button`,u.type=`submit`,u.textContent=t.submitLabel,l.append(u),o.append(s),a.append(r,i,o,c,l),e.append(a),a.addEventListener(`submit`,e=>{e.preventDefault();let t=s.value;s.disabled=!0,u.disabled=!0,c.textContent=``,n(t).catch(e=>{c.textContent=e instanceof Error?e.message:`Authentication failed`,s.disabled=!1,u.disabled=!1,s.select(),s.focus()})}),queueMicrotask(()=>{s.focus()})}async function B(){let e=D();if(!e.enabled||e.strategy===`none`)return{authenticated:!0,auth:e};await u(()=>Promise.resolve({}),__vite__mapDeps([0]),import.meta.url);let{card:t,overlay:n}=F();document.body.append(n);let r=A(`auth_error`);return new Promise(i=>{let a=(t=null)=>{k(),N(t),n.remove(),i({authenticated:!0,auth:t?.auth??e,user:t?.user??null})};(async()=>{R(t,{body:`Checking access to this session…`,title:`CollabMD`});try{let t=await M(e);if(t.authenticated){a(t);return}}catch(e){R(t,{body:e instanceof Error?`${e.message} Refresh the page and try again.`:`Failed to contact the auth service. Refresh the page and try again.`,title:`Cannot verify access`});return}if(e.strategy===`password`){let n=O();if(n)try{k(),await P(e,n),a();return}catch{}z(t,e,{onSubmit:async t=>{await P(e,t),a()}});return}if(e.strategy===`oidc`){L(t,e,{errorMessage:r}),r=``;return}R(t,{body:`This authentication strategy is not available.`,title:`Authentication unavailable`})})()})}function V(e){return encodeURIComponent(String(e??``))}async function H(e,{fallbackError:t,fallbackFileName:n}={}){let r=await fetch(e);if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error||t)}let i=await r.blob();return o(i,c(r.headers.get(`content-disposition`)||``,n),{removeDelayMs:0,revokeDelayMs:0}),r}var U={async readTree(e){let t=await fetch(d(`/files`,e));return s(t,`Failed to load file tree`)},async callAgentTool(e,t,{signal:n}={}){let r=await fetch(d(`/agent/tools/${encodeURIComponent(e)}`),{body:JSON.stringify(t),headers:{"Content-Type":`application/json`},method:`POST`,signal:n});return s(r,`Failed to execute ${e}`)},async readCommentOverview(){let e=await fetch(d(`/comments/overview`));return s(e,`Failed to load comment overview`)},async readFile(e,t){let n=await fetch(d(`/file?path=${encodeURIComponent(e)}`,t));return s(n,`Failed to read file`)},async readBacklinks(e,{signal:t}={}){let n=await fetch(d(`/backlinks?file=${encodeURIComponent(e)}`),{signal:t}),r=await s(n,`Failed to load backlinks`);return Array.isArray(r.backlinks)?r.backlinks:[]},async syncStructurizrWorkspace({path:e,source:t}){let n=await fetch(d(`/structurizr/sync`),{body:JSON.stringify({path:e,source:t}),headers:{"Content-Type":`application/json`},method:`POST`});return s(n,`Failed to sync Structurizr workspace`)},async renderSvg(e){let t=await fetch(d(`/plantuml/render`),{body:JSON.stringify({source:e}),headers:{"Content-Type":`application/json`},method:`POST`}),n=await s(t,`Failed to render PlantUML`);if(!n.ok||typeof n.svg!=`string`)throw Error(n.error||`Failed to render PlantUML`);return n.svg},async searchText({limit:e=50,query:t=``,signal:n=null}={}){let r=new URLSearchParams({limit:String(e),q:String(t??``)}),i=await fetch(d(`/search?${r.toString()}`),{signal:n});return s(i,`Failed to search files`)},async queryBase({activeFilePath:e=``,path:t=``,search:n=``,source:r=null,sourcePath:i=``,view:a=``}={}){let o=await fetch(d(`/base/query`),{body:JSON.stringify({activeFilePath:e,path:t,search:n,source:r,sourcePath:i,view:a}),headers:{"Content-Type":`application/json`},method:`POST`});return s(o,`Failed to query base`)},async exportBaseCsv({activeFilePath:e=``,path:t=``,search:n=``,source:r=null,sourcePath:i=``,view:a=``}={}){let o=await fetch(d(`/base/export`),{body:JSON.stringify({activeFilePath:e,path:t,search:n,source:r,sourcePath:i,view:a}),headers:{"Content-Type":`application/json`},method:`POST`});if(!o.ok){let e=await o.json().catch(()=>({}));throw Error(e.error||`Failed to export base CSV`)}return{blob:await o.blob(),contentDisposition:o.headers.get(`content-disposition`)||``}},async queryBasePropertyValues({activeFilePath:e=``,path:t=``,propertyId:n=``,query:r=``,source:i=null,sourcePath:a=``,view:o=``}={}){let c=await fetch(d(`/base/property-values`),{body:JSON.stringify({activeFilePath:e,path:t,propertyId:n,query:r,source:i,sourcePath:a,view:o}),headers:{"Content-Type":`application/json`},method:`POST`});return s(c,`Failed to load base property values`)},async transformBase({activeFilePath:e=``,mutation:t=null,path:n=``,source:r=null,sourcePath:i=``,view:a=``}={}){let o=await fetch(d(`/base/transform`),{body:JSON.stringify({activeFilePath:e,mutation:t,path:n,source:r,sourcePath:i,view:a}),headers:{"Content-Type":`application/json`},method:`POST`});return s(o,`Failed to transform base`)},async createFile({content:e,path:t,requestId:n=null}){let r=await fetch(d(`/file`),{body:JSON.stringify({content:e,path:t}),headers:l(n,{"Content-Type":`application/json`}),method:`POST`});return s(r,`Failed to create file`)},async writeFile({content:e,path:t,requestId:n=null}){let r=await fetch(d(`/file`),{body:JSON.stringify({content:e,path:t}),headers:l(n,{"Content-Type":`application/json`}),method:`PUT`});return s(r,`Failed to write file`)},async renameFile({oldPath:e,newPath:t,requestId:n=null}){let r=await fetch(d(`/file`),{body:JSON.stringify({newPath:t,oldPath:e}),headers:l(n,{"Content-Type":`application/json`}),method:`PATCH`});return s(r,`Failed to rename file`)},async deleteFile(e,{requestId:t=null}={}){let n=await fetch(d(`/file?path=${encodeURIComponent(e)}`),{headers:t?l(t):void 0,method:`DELETE`});return s(n,`Failed to delete file`)},async createDirectory(e,{requestId:t=null}={}){let n=await fetch(d(`/directory`),{body:JSON.stringify({path:e}),headers:l(t,{"Content-Type":`application/json`}),method:`POST`});return s(n,`Failed to create folder`)},async renameDirectory({oldPath:e,newPath:t,requestId:n=null}){let r=await fetch(d(`/directory`),{body:JSON.stringify({newPath:t,oldPath:e}),headers:l(n,{"Content-Type":`application/json`}),method:`PATCH`});return s(r,`Failed to rename folder`)},async deleteDirectory(e,{recursive:t=!1,requestId:n=null}={}){let r=new URLSearchParams({path:String(e??``)});t&&r.set(`recursive`,`1`);let i=await fetch(d(`/directory?${r.toString()}`),{headers:n?l(n):void 0,method:`DELETE`});return s(i,`Failed to delete folder`)},async uploadImageAttachment({file:e,fileName:t=``,sourcePath:n}){let r=await fetch(d(`/attachments`),{body:e,headers:{"Content-Type":e?.type||`application/octet-stream`,"X-CollabMD-File-Name":V(t),"X-CollabMD-Source-Path":V(n)},method:`POST`});return s(r,`Failed to upload image`)},async uploadFile({file:e,path:t,requestId:n=null}){let r=await fetch(d(`/file/upload`),{body:e,headers:l(n,{"Content-Type":e?.type||`application/octet-stream`,"X-CollabMD-File-Path":V(t)}),method:`POST`});return s(r,`Failed to upload file`)},async downloadFile(e){let t=g(e)||`download`;return H(d(`/download/file?path=${encodeURIComponent(e)}`),{fallbackError:`Failed to download file`,fallbackFileName:t})},async downloadDirectory(e){let t=g(e)||`vault`;return H(d(`/download/directory?path=${encodeURIComponent(e)}`),{fallbackError:`Failed to download folder`,fallbackFileName:`${t}.zip`})}};export{S as a,C as c,g as d,_ as f,b as i,w as l,B as n,y as o,m as p,h as r,x as s,U as t,v as u};
2
+ import{a as e,c as t,g as n,h as r,p as i,v as a}from"./file-kind-BGxTVHan.js";import{a as o,n as s,s as c,t as l}from"./api-client-utils-DkW9xiiw.js";import{t as u}from"./preload-helper-khBccGFq.js";import{r as d}from"./runtime-paths-qQGhzNx4.js";import{d as f,n as p}from"./runtime-config-CvrkHb0n.js";function m(e){let t=String(e??``).trim().replace(/\\/g,`/`);if(!t||t.startsWith(`/`))return``;let n=t.split(`/`).map(e=>e.trim()).filter(Boolean);return n.some(e=>e===`.`||e===`..`)?``:n.join(`/`)}function h(e,t){let n=m(e),r=m(t);return n?r?`${n}/${r}`:n:r}function g(e=``){return String(e??``).replace(/\/+$/u,``).split(`/`).filter(Boolean).pop()||``}function _(e=``){let t=String(e??``).replace(/\/+$/u,``),n=t.lastIndexOf(`/`);return n>=0?t.slice(0,n):``}function v(e,t){return e.toLowerCase().endsWith(t.toLowerCase())?e:`${e}${t}`}function y(e){return`# ${a(String(e??``).split(`/`).pop()||``)||`Untitled`}\n\n`}function b(t){let n=m(t);return{content:`views:
3
+ - type: table
4
+ name: Table
5
+ order:
6
+ - file.name
7
+ `,path:e(n)?n:`${n}.base`}}function x(e){let t=m(e);return{content:`flowchart TD
8
+ A[Start] --> B{Decide}
9
+ B -->|Yes| C[Ship it]
10
+ B -->|No| D[Revise]
11
+ `,path:i(t)?t:`${t}.mmd`}}function S(e){let n=m(e);return{content:`<mxfile host="app.diagrams.net" modified="2026-01-01T00:00:00.000Z" agent="CollabMD" version="24.7.17">
12
+ <diagram id="page-1" name="Page-1">
13
+ <mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
14
+ <root>
15
+ <mxCell id="0" />
16
+ <mxCell id="1" parent="0" />
17
+ </root>
18
+ </mxGraphModel>
19
+ </diagram>
20
+ </mxfile>
21
+ `,path:t(n)?n:`${n}.drawio`}}function C(e){let t=m(e);return{content:`@startuml
22
+ Alice -> Bob: Hello
23
+ @enduml
24
+ `,path:r(t)?t:`${t}.puml`}}function w(e){let t=m(e),r=n(t)?t:`${t}.dsl`;return{content:`workspace "CollabMD Example" "A small Structurizr workspace" {, model {, user = person "User" "Uses the system", system = softwareSystem "Example System" "The system being documented" {, web = container "Web Application" "Serves the user interface" "JavaScript" {, home = component "Home Page" "Shows the landing page" "React", editor = component "Editor" "Edits workspace content" "React", }, api = container "API" "Handles requests" "Node.js", }, user -> system "Uses", web -> api "Calls" "HTTPS/JSON", home -> editor "Links to", }, views {, systemContext system "Context" {, include *, autoLayout, }, container system "Containers" {, include *, autoLayout, }, component web "Components" {, include *, autoLayout, }, styles {, element "Person" {, shape person, }, }, },},`.split(`,`).join(`
25
+ `),path:r}}var T={enabled:!1,implemented:!0,loginEndpoint:`/api/auth/oidc/login`,passwordLabel:`Password`,provider:``,requiresLogin:!1,sessionEndpoint:`/api/auth/session`,statusEndpoint:`/api/auth/status`,strategy:`none`,submitLabel:`Continue`},E=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAIAAAABc2X6AAAGsklEQVR4Ae3cA3jsShgG4Gvbtu1js7aObdu2bdbudmvbtu1VtUg2ydw7x95mstnt5rZ5voflG80/fzL72L89bOsF94J7wWgb2dSgiAzpPHmwbfPK1qWzxDNsRdb6Ar2BgtF9hSbDRbYG4mk2beuXwm+Q89yV+TmAILgHptrb5DyPtg3LhBZjBCP+RovewNZlc2TOl8nGel0HA4LA4qPhkRSM6XcHoEYk86fIfT2AQqFzYIBjMncHofkoZBWNCM1GSq+cpdpadQIMKEoRzIeXIroEkW08TObpDAiiO8F4Tga85TBnoEc8xVKZm9UNYECS0stnBCP/Ud+AnJH/SC+eAiShPTDZ3CRZPIN9CUokC6ZSYqE2wHhmKhw/2TegR2RnSFSUaRaMJccLxg7QsAQhktkTAACaAmOxkbA80h2taKIZKWzR1BFWRAQLRvXhphYdDEtcWDxxU4sOhjdDkdVYbmrRwYAgJIums3RTNWrftbHz/AmZh5MiLBAGVqOdZ4+1790inmrFvpYZuPPEATWdknmT5f7eZEN9V2N7o9zPu3XNInQte2BlcYE6tVTbltXw4kf9h5QlhW3rliBr1QcDAODsjPFlhmelqfNvKQty4S9B0KoPVgTxmWk7Tx0COMZCF6GzA3ZC0LWMwJSsTWiOXj+O6iP382KzowAAvMOhaxmAqw/Ijr4tGPsHgnbsACwxlpNNPABIIv5LIvxpzOVlkdXPNMGK8CCudi2pFi+ovRFlwLOtc7/uUgvnxhxu05LpIyD17nTu+EAw8q9HaVtXzgcAcBUMcAER/sx9YBj5pdeExr897NLtT9TVcLgRTzVcgbyHBuc9L5n8PdLJzAEwmWP1KDCMMvTp9jWf3tbC1gdQKDgMBhRBRL0GYaojO35zxOo8fZjbz5ZAZz700Anm9pLI9g+yoY7bYKrJBWJoRpk8SJ0/fDoc13QuRuNdgMmydfTBZPkGdcDDd0q1EDkOVIKzTOiDKVGY7oPLmylVYCKlL30wIKW6D44tJlSCE76nC45+CwHXfWDfdKVKcMwHdMEJ33MC7JqEqwRHvEgXnDaYE+ArMayBB3ECDAennnVKn4tUDU74gS446k1OgB3i8Z41LHmkKHtW4eGfpRpctv5/VlomlxOsTR6kKQN1H1wnptiZHpYFv27pMbqus4kxOChbySzTz8loakfukhIkYKEBEBzw6SBXk79cLQ5lXv5XuxtJAaMDdA/v+JMydVs8irBnDvB+g9QbGeY1SUFg2gTn1JD0z+cdPIVaTbym0JemeQ6FzrtzJtdFm+DT4Rh9MD9DybxNmxL03mg3g/u0MP3cbWo6GrWjbZMBg/0Id6wqAcWwEX+F/10fVzPIe2jmRW3VTiP+VBjC4bU6KgMAID9qaQt9frl3P6hSndOaP7HrxdSYPQiH92QYhvAwTRH7KdSWBL9h5j4GeugkqDpWc1oZBqaelSGNwMWNJMLjUkHxBn//zwZeH3topr+7bWxDmia0AID17gok7aTTMrTnw1KsfZTPVMhAyj9uVl5lIexqcQLs4KFpYXjpSjQw3HwrIqCBQQ5mXsZInBWtoIOac1GOqrU4IsUJwOSllsmha5iZTf3npzXnqXka+1dFmzo4D9vZgQp2TsAZvrZUIC7729WSmRlmVfz+HGExKpUCVGJj1oSQlTd+SZ9Lm4bubqKvtTkmk+OAIRhu+zMu3jEwyqTQ1d7lofWdzV0VyWSxpPJkjpOB76z7fsPfjjOHHMhBb0QzAhMUMS18nRrgOzHkz96YdPR4toNTMT+gKjq4OtatNPBCvgfcp9PD1w/wsFP14y7WA4/zu9SudVWw8HKpUC4Zw5uOLmQ//c4fGrZL8iit+WEpvMmxAIZbtrCor7uNLpj/ubpk6N6Kh059M6tINl8Qh4UUHGa73wzjNGHQ4dj7wC6JOPtLACLqkvq4WeuE2cWi/+nLt0csOKnQ1CKP+IYMWELqgPnGiLVh6O7Go8GYZpfxpDbnwkaHjpj3JfLRV7Wgb01SARxIupc6wntyfGOG9pbikRQJmzvodRg7mRq2tkkm7IbFlhktBdaBS7SsPZx1haDIbltOSwGKXxl5px7UZGaEb8gXlerEgmmMxB2KfEciTKHRAsvbmPo0nVsST1BEdH3Kyrh9bJVlQ7wmbk05USSu0PUPPWjDOtxLg5bF7h7tM42B08x//o7U0/AmrCSV3PtYiwZpS3B13MHMS/DIz4rYaBO0VM93JpwbwaJtqNfEsbwZFgEL50VtgcJLBV6wK9aKtfd+cEkvuBfcC37k9h8VGR+csPdltgAAAABJRU5ErkJggg==`;function D(){return{...T,...p().auth??{}}}function O(){return f(window.location.hash).get(`auth_password`)||``}function k(){let e=f(window.location.hash);if(!e.has(`auth_password`))return;e.delete(`auth_password`);let t=e.toString(),n=`${window.location.pathname}${window.location.search}${t?`#${t}`:``}`;window.history.replaceState(null,``,n)}function A(e){let t=f(window.location.hash),n=t.get(e)||``;if(!n)return``;t.delete(e);let r=t.toString(),i=`${window.location.pathname}${window.location.search}${r?`#${r}`:``}`;return window.history.replaceState(null,``,i),n}function j(){return`${window.location.pathname}${window.location.search}${window.location.hash}`}async function M(e){let t=await fetch(e.statusEndpoint,{headers:{Accept:`application/json`}});return s(t,`Failed to read auth status`)}function N(e){let t=e?.auth??{};if(t.strategy!==`oidc`||t.provider!==`google`)return;let n=String(e?.user?.name??``).trim();if(n)try{window.localStorage.setItem(`collabmd-user-name`,n)}catch{}}async function P(e,t){let n=await fetch(e.sessionEndpoint,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({password:t})});return s(n,`Authentication failed`)}function F(){let e=document.createElement(`div`);e.className=`auth-gate-overlay`;let t=document.createElement(`section`);return t.className=`auth-gate-card`,e.append(t),{card:t,overlay:e}}function I(){let e=document.createElement(`span`);e.className=`auth-gate-button__icon`,e.setAttribute(`aria-hidden`,`true`);let t=document.createElement(`img`);return t.alt=``,t.decoding=`async`,t.height=20,t.loading=`eager`,t.src=E,t.width=20,e.append(t),e}function L(e,t,{errorMessage:n=``}){e.replaceChildren();let r=document.createElement(`h1`);r.textContent=`Authentication required`;let i=document.createElement(`p`);i.textContent=`Sign in with Google to join this session.`;let a=document.createElement(`div`);a.className=`auth-gate-actions`;let o=document.createElement(`button`);o.className=`ui-button ui-button--secondary auth-gate-button auth-gate-button--google`,o.type=`button`,o.append(I(),document.createTextNode(t.submitLabel||`Continue with Google`));let s=document.createElement(`div`);s.className=`auth-gate-error`,s.textContent=n,a.append(o),e.append(r,i,s,a),o.addEventListener(`click`,()=>{let e=new URL(t.loginEndpoint,window.location.origin);e.searchParams.set(`returnTo`,j()),window.location.assign(e.toString())})}function R(e,{title:t,body:n,secondaryActionLabel:r=``,onSecondaryAction:i=null}){e.replaceChildren();let a=document.createElement(`h1`);a.textContent=t;let o=document.createElement(`p`);if(o.textContent=n,e.append(a,o),r&&typeof i==`function`){let t=document.createElement(`button`);t.className=`ui-button ui-button--secondary auth-gate-secondary-button`,t.type=`button`,t.textContent=r,t.addEventListener(`click`,()=>{i()}),e.append(t)}}function z(e,t,{onSubmit:n}){e.replaceChildren();let r=document.createElement(`h1`);r.textContent=`Authentication required`;let i=document.createElement(`p`);i.textContent=`Enter the host password to join this shared session.`;let a=document.createElement(`form`);a.className=`auth-gate-form`;let o=document.createElement(`label`);o.className=`auth-gate-label`,o.textContent=t.passwordLabel;let s=document.createElement(`input`);s.className=`ui-input auth-gate-input`,s.type=`password`,s.name=`password`,s.autocomplete=`current-password`,s.required=!0;let c=document.createElement(`div`);c.className=`auth-gate-error`;let l=document.createElement(`div`);l.className=`auth-gate-actions`;let u=document.createElement(`button`);u.className=`ui-button ui-button--primary auth-gate-button`,u.type=`submit`,u.textContent=t.submitLabel,l.append(u),o.append(s),a.append(r,i,o,c,l),e.append(a),a.addEventListener(`submit`,e=>{e.preventDefault();let t=s.value;s.disabled=!0,u.disabled=!0,c.textContent=``,n(t).catch(e=>{c.textContent=e instanceof Error?e.message:`Authentication failed`,s.disabled=!1,u.disabled=!1,s.select(),s.focus()})}),queueMicrotask(()=>{s.focus()})}async function B(){let e=D();if(!e.enabled||e.strategy===`none`)return{authenticated:!0,auth:e};await u(()=>Promise.resolve({}),__vite__mapDeps([0]),import.meta.url);let{card:t,overlay:n}=F();document.body.append(n);let r=A(`auth_error`);return new Promise(i=>{let a=(t=null)=>{k(),N(t),n.remove(),i({authenticated:!0,auth:t?.auth??e,user:t?.user??null})};(async()=>{R(t,{body:`Checking access to this session…`,title:`CollabMD`});try{let t=await M(e);if(t.authenticated){a(t);return}}catch(e){R(t,{body:e instanceof Error?`${e.message} Refresh the page and try again.`:`Failed to contact the auth service. Refresh the page and try again.`,title:`Cannot verify access`});return}if(e.strategy===`password`){let n=O();if(n)try{k(),await P(e,n),a();return}catch{}z(t,e,{onSubmit:async t=>{await P(e,t),a()}})}else e.strategy===`oidc`?(L(t,e,{errorMessage:r}),r=``):R(t,{body:`This authentication strategy is not available.`,title:`Authentication unavailable`})})()})}function V(e){return encodeURIComponent(String(e??``))}async function H(e,{fallbackError:t,fallbackFileName:n}={}){let r=await fetch(e);if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error||t)}let i=await r.blob();return o(i,c(r.headers.get(`content-disposition`)||``,n),{removeDelayMs:0,revokeDelayMs:0}),r}var U={async readTree(e){let t=await fetch(d(`/files`,e));return s(t,`Failed to load file tree`)},async callAgentTool(e,t,{signal:n}={}){let r=await fetch(d(`/agent/tools/${encodeURIComponent(e)}`),{body:JSON.stringify(t),headers:{"Content-Type":`application/json`},method:`POST`,signal:n});return s(r,`Failed to execute ${e}`)},async readCommentOverview(){let e=await fetch(d(`/comments/overview`));return s(e,`Failed to load comment overview`)},async readFile(e,t){let n=await fetch(d(`/file?path=${encodeURIComponent(e)}`,t));return s(n,`Failed to read file`)},async readBacklinks(e,{signal:t}={}){let n=await fetch(d(`/backlinks?file=${encodeURIComponent(e)}`),{signal:t}),r=await s(n,`Failed to load backlinks`);return Array.isArray(r.backlinks)?r.backlinks:[]},async syncStructurizrWorkspace({path:e,source:t}){let n=await fetch(d(`/structurizr/sync`),{body:JSON.stringify({path:e,source:t}),headers:{"Content-Type":`application/json`},method:`POST`});return s(n,`Failed to sync Structurizr workspace`)},async renderSvg(e){let t=await fetch(d(`/plantuml/render`),{body:JSON.stringify({source:e}),headers:{"Content-Type":`application/json`},method:`POST`}),n=await s(t,`Failed to render PlantUML`);if(!n.ok||typeof n.svg!=`string`)throw Error(n.error||`Failed to render PlantUML`);return n.svg},async searchText({limit:e=50,query:t=``,signal:n=null}={}){let r=new URLSearchParams({limit:String(e),q:String(t??``)}),i=await fetch(d(`/search?${r.toString()}`),{signal:n});return s(i,`Failed to search files`)},async queryBase({activeFilePath:e=``,path:t=``,search:n=``,source:r=null,sourcePath:i=``,view:a=``}={}){let o=await fetch(d(`/base/query`),{body:JSON.stringify({activeFilePath:e,path:t,search:n,source:r,sourcePath:i,view:a}),headers:{"Content-Type":`application/json`},method:`POST`});return s(o,`Failed to query base`)},async exportBaseCsv({activeFilePath:e=``,path:t=``,search:n=``,source:r=null,sourcePath:i=``,view:a=``}={}){let o=await fetch(d(`/base/export`),{body:JSON.stringify({activeFilePath:e,path:t,search:n,source:r,sourcePath:i,view:a}),headers:{"Content-Type":`application/json`},method:`POST`});if(!o.ok){let e=await o.json().catch(()=>({}));throw Error(e.error||`Failed to export base CSV`)}return{blob:await o.blob(),contentDisposition:o.headers.get(`content-disposition`)||``}},async queryBasePropertyValues({activeFilePath:e=``,path:t=``,propertyId:n=``,query:r=``,source:i=null,sourcePath:a=``,view:o=``}={}){let c=await fetch(d(`/base/property-values`),{body:JSON.stringify({activeFilePath:e,path:t,propertyId:n,query:r,source:i,sourcePath:a,view:o}),headers:{"Content-Type":`application/json`},method:`POST`});return s(c,`Failed to load base property values`)},async transformBase({activeFilePath:e=``,mutation:t=null,path:n=``,source:r=null,sourcePath:i=``,view:a=``}={}){let o=await fetch(d(`/base/transform`),{body:JSON.stringify({activeFilePath:e,mutation:t,path:n,source:r,sourcePath:i,view:a}),headers:{"Content-Type":`application/json`},method:`POST`});return s(o,`Failed to transform base`)},async createFile({content:e,path:t,requestId:n=null}){let r=await fetch(d(`/file`),{body:JSON.stringify({content:e,path:t}),headers:l(n,{"Content-Type":`application/json`}),method:`POST`});return s(r,`Failed to create file`)},async writeFile({content:e,path:t,requestId:n=null}){let r=await fetch(d(`/file`),{body:JSON.stringify({content:e,path:t}),headers:l(n,{"Content-Type":`application/json`}),method:`PUT`});return s(r,`Failed to write file`)},async renameFile({oldPath:e,newPath:t,requestId:n=null}){let r=await fetch(d(`/file`),{body:JSON.stringify({newPath:t,oldPath:e}),headers:l(n,{"Content-Type":`application/json`}),method:`PATCH`});return s(r,`Failed to rename file`)},async deleteFile(e,{requestId:t=null}={}){let n=await fetch(d(`/file?path=${encodeURIComponent(e)}`),{headers:t?l(t):void 0,method:`DELETE`});return s(n,`Failed to delete file`)},async createDirectory(e,{requestId:t=null}={}){let n=await fetch(d(`/directory`),{body:JSON.stringify({path:e}),headers:l(t,{"Content-Type":`application/json`}),method:`POST`});return s(n,`Failed to create folder`)},async renameDirectory({oldPath:e,newPath:t,requestId:n=null}){let r=await fetch(d(`/directory`),{body:JSON.stringify({newPath:t,oldPath:e}),headers:l(n,{"Content-Type":`application/json`}),method:`PATCH`});return s(r,`Failed to rename folder`)},async deleteDirectory(e,{recursive:t=!1,requestId:n=null}={}){let r=new URLSearchParams({path:String(e??``)});t&&r.set(`recursive`,`1`);let i=await fetch(d(`/directory?${r.toString()}`),{headers:n?l(n):void 0,method:`DELETE`});return s(i,`Failed to delete folder`)},async uploadImageAttachment({file:e,fileName:t=``,sourcePath:n}){let r=await fetch(d(`/attachments`),{body:e,headers:{"Content-Type":e?.type||`application/octet-stream`,"X-CollabMD-File-Name":V(t),"X-CollabMD-Source-Path":V(n)},method:`POST`});return s(r,`Failed to upload image`)},async uploadFile({file:e,path:t,requestId:n=null}){let r=await fetch(d(`/file/upload`),{body:e,headers:l(n,{"Content-Type":e?.type||`application/octet-stream`,"X-CollabMD-File-Path":V(t)}),method:`POST`});return s(r,`Failed to upload file`)},async downloadFile(e){let t=g(e)||`download`;return H(d(`/download/file?path=${encodeURIComponent(e)}`),{fallbackError:`Failed to download file`,fallbackFileName:t})},async downloadDirectory(e){let t=g(e)||`vault`;return H(d(`/download/directory?path=${encodeURIComponent(e)}`),{fallbackError:`Failed to download folder`,fallbackFileName:`${t}.zip`})}};export{S as a,C as c,g as d,_ as f,b as i,w as l,B as n,y as o,m as p,h as r,x as s,U as t,v as u};
@@ -1 +1 @@
1
- function e(e=``,t=``){let n=String(e??``).replace(/\\/g,`/`).split(`/`).filter(Boolean),r=String(t??``).split(`/`).map(e=>{try{return decodeURIComponent(e)}catch{return e}});if(r.length===0)return``;n.pop();let i=[...n];for(let e of r){let t=String(e??``).trim();if(t&&t!==`.`){if(t===`..`){if(i.length===0)return``;i.pop();continue}i.push(t)}}return i.join(`/`)}export{e as t};
1
+ function e(e=``,t=``){let n=String(e??``).replace(/\\/g,`/`).split(`/`).filter(Boolean),r=String(t??``).split(`/`).map(e=>{try{return decodeURIComponent(e)}catch{return e}});if(r.length===0)return``;n.pop();let i=[...n];for(let e of r){let t=String(e??``).trim();if(t&&t!==`.`){if(t===`..`){if(i.length===0)return``;i.pop()}else i.push(t)}}return i.join(`/`)}export{e as t};