@marimo-team/islands 0.24.3-dev9 → 0.25.1-dev1

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 (440) hide show
  1. package/dist/{ConnectedDataExplorerComponent-C9OF_75w.js → ConnectedDataExplorerComponent-KVhjDMSe.js} +1066 -1066
  2. package/dist/ErrorBoundary-pXXIvlr3.js +200 -0
  3. package/dist/{ImageComparisonComponent-2a9TMMm2.js → ImageComparisonComponent-Dlm5aWnH.js} +4 -4
  4. package/dist/{Plot-C-9MQeGP.js → Plot-CTyjbQDT.js} +21032 -20666
  5. package/dist/_baseMerge-BiGRwuqv.js +165 -0
  6. package/dist/{abnfDiagram-N423BO3Z-CQKwzX8t.js → abnfDiagram-VCTEODGH-CpN0FRda.js} +17 -18
  7. package/dist/{any-language-editor-DmQ7dyCx.js → any-language-editor-CycIVIeP.js} +17 -17
  8. package/dist/arc-7ra3iNdN.js +81 -0
  9. package/dist/architecture-7GRP2DOG-BWLylgiA.js +3 -0
  10. package/dist/{architectureDiagram-T3A2C74G-CncrDpfa.js → architectureDiagram-5GKGNRK7-DDyj5SRB.js} +25 -25
  11. package/dist/assets/__vite-browser-external-C9iR87Zl.js +1 -0
  12. package/dist/assets/worker-D7hWi02M.js +109 -0
  13. package/dist/blockDiagram-I7D4REHJ-BbXEXJRu.js +1922 -0
  14. package/dist/{button-CKBkqR9J.js → button-DdXAm8iz.js} +5 -5
  15. package/dist/{c4Diagram-5PPSVZJV-DarUk3Yq.js → c4Diagram-7LVT6UL2-DcLsbQmR.js} +696 -668
  16. package/dist/{capabilities-CMBBJTcc.js → capabilities-B3ce_GNu.js} +1 -1
  17. package/dist/{html-to-image-BtFMe_Nq.js → cells-DYIkSxs6.js} +6757 -10137
  18. package/dist/{channel-CyiYUzJv.js → channel-B5XnTarr.js} +1 -1
  19. package/dist/chat-ui-BXj3uYjy.js +5786 -0
  20. package/dist/{check-CHig47QV.js → check-B7cIK6gb.js} +1 -1
  21. package/dist/{chunk-2Q5K7J3B-BMuJl2jB.js → chunk-2Q5K7J3B-BMkUkeuy.js} +2 -2
  22. package/dist/chunk-4HAMMTFA-D2qv8E0X.js +4188 -0
  23. package/dist/{chunk-5VM5RSS4-Bcq0ftdy.js → chunk-5VM5RSS4-DKsmPCL6.js} +2 -2
  24. package/dist/{chunk-NSK5VX7P-CDTMcJB0.js → chunk-75Z2AOVW-5_HsvXwr.js} +23 -23
  25. package/dist/{chunk-I66GZJ75-BqyTCAPf.js → chunk-DU6HZSFF-BUgAHvnM.js} +21 -4
  26. package/dist/{chunk-2GRJ4B5K-DgO8Qudq.js → chunk-F27PBJKO-DHmYWZXr.js} +4 -4
  27. package/dist/{chunk-KEIR6QF5-C4KX3XYh.js → chunk-FOHPRMQF-BpYR8RqP.js} +4 -4
  28. package/dist/{chunk-WRU74C26-BpWsbiDK.js → chunk-GMAD6QVW-Czynz8aA.js} +486 -258
  29. package/dist/chunk-GVQU2GXP-yQEdulRS.js +37 -0
  30. package/dist/{chunk-5RXB4S5H-tLNUVDdO.js → chunk-IMKFNOWR-BfwTebD0.js} +11 -11
  31. package/dist/{chunk-JWPE2WC7-BJwjGUnF.js → chunk-JWPE2WC7-DJvv1t8U.js} +2 -2
  32. package/dist/chunk-L3NEJ4N5-DwRWnDDK.js +245 -0
  33. package/dist/{chunk-7Z6QIM7H-Dc18hFxH.js → chunk-OSK3NFVY-BBKU_Ign.js} +222 -144
  34. package/dist/{chunk-W5SLKNZC-DLnvpEtV.js → chunk-P2QGCYS3-C0iGU29N.js} +20 -20
  35. package/dist/{chunk-KBJHAD2P-BuqWqkcW.js → chunk-POPQ4Y6H-BCbS3Ozc.js} +4 -4
  36. package/dist/{chunk-4I5QYGJK-DpytHuZQ.js → chunk-PWAF6VOD-CTFCL0jI.js} +4 -4
  37. package/dist/{chunk-JQJVKLGR-CgqCwe8E.js → chunk-SHT3W25Y-BspJEJ5H.js} +109 -63
  38. package/dist/{chunk-6Q2QTUOP-DmTcEBMn.js → chunk-SVP7TREG-DX3rFNTe.js} +5 -5
  39. package/dist/{chunk-GF5L2VYU-B0wgCQgS.js → chunk-TICWLB2K-fVF7Uujg.js} +13 -13
  40. package/dist/{chunk-XXDRQBXY-D73H4IN0.js → chunk-XXDRQBXY-Dnl5VBqG.js} +3 -3
  41. package/dist/{chunk-Y2CYZVJY-DoegUj_e.js → chunk-Y2CYZVJY-DKKS1VyV.js} +1 -1
  42. package/dist/{chunk-5FQGJX7Z-B85XCPv6.js → chunk-YOKDWASO-DrWbKnxA.js} +6925 -5460
  43. package/dist/classDiagram-ZZMXUADV-Fe-V14Sc.js +30 -0
  44. package/dist/classDiagram-v2-VYDZK3BY-xTDg7lOs.js +30 -0
  45. package/dist/code-visibility-BC_yF09p.js +138 -0
  46. package/dist/{common-Cv-4hMa0.js → common-Dv227ygK.js} +8838 -12645
  47. package/dist/{compiler-runtime-CAH9RLw2.js → compiler-runtime-Cj8ZWiNS.js} +2 -2
  48. package/dist/copy-icon-CLdENY__.js +190 -0
  49. package/dist/{cose-bilkent-JH36ORCC-FUWHkXFX.js → cose-bilkent-JH36ORCC-_LyRKVqm.js} +2 -2
  50. package/dist/cubic-OaEBhQPK.js +1404 -0
  51. package/dist/cynefin-OW5HDTMX-obq-i80l.js +3 -0
  52. package/dist/{cynefinDiagram-MW4NZA55-BXSFK93J.js → cynefinDiagram-5FMLGOSQ-CFQrqzSX.js} +10 -10
  53. package/dist/{dagre-CGyalH38.js → dagre-BGSfXNEb.js} +678 -537
  54. package/dist/dagre-GXQ25YYZ-xHNAUTyG.js +425 -0
  55. package/dist/{data-grid-overlay-editor-DZM4BAaI.js → data-grid-overlay-editor-B-I2K7z3.js} +8 -9
  56. package/dist/{data-grid-types-BnZwWG8z.js → data-grid-types-BucVmDDp.js} +1 -1
  57. package/dist/{defaultLocale-DKaU_opG.js → defaultLocale-JI_lnoCe.js} +1 -1
  58. package/dist/{diagram-7IWD3JNH-BjfzDNvj.js → diagram-S7CK7UJ4-Bt1rPbAx.js} +40 -39
  59. package/dist/{diagram-UB23O5K3-DDg-7wLA.js → diagram-UQ7AKVKN-D1sq5FoZ.js} +10 -10
  60. package/dist/{diagram-B4RE2ZJO-CKccR9eE.js → diagram-VSXAHHWV-BKpmG23x.js} +10 -10
  61. package/dist/{diagram-Q27KOJAE-Zhz01ss7.js → diagram-VX7I27RA-BMwGFVD6.js} +21 -21
  62. package/dist/{diagram-LBJQPF4R-CJ-bOruh.js → diagram-Z3DM3KII--KLDR9Pl.js} +10 -10
  63. package/dist/dialog-CgNq6y9-.js +94 -0
  64. package/dist/{dist-dAqZAPcF.js → dist-1HDa70oE.js} +3 -3
  65. package/dist/{dist-Re9sOPOx.js → dist-9x1ZRe-e.js} +2 -2
  66. package/dist/{dist-DEeLqRlU.js → dist-B1vYLK28.js} +1 -1
  67. package/dist/{dist-C5Bn52W4.js → dist-B8D7McG3.js} +3 -3
  68. package/dist/{dist-_XvgytiS.js → dist-BHCHt1NI.js} +1 -1
  69. package/dist/{dist-CRjAdnqF.js → dist-BRxfaJgs.js} +3 -3
  70. package/dist/{dist-Byj2bV8o.js → dist-BVGtK7Ht.js} +1 -1
  71. package/dist/{dist-BIN5LKyE.js → dist-BaHjhkpZ.js} +2 -2
  72. package/dist/{dist-DVFbIwc5.js → dist-BtKIs9N-.js} +1 -1
  73. package/dist/{dist-BrQGcfQ9.js → dist-C2KzV-vf.js} +2 -2
  74. package/dist/{dist-DJFiGP2k.js → dist-C2wDlYdD.js} +2 -2
  75. package/dist/{dist-BVRM2y1P.js → dist-C8xMLVYi.js} +2 -2
  76. package/dist/dist-CMh_W4y4.js +538 -0
  77. package/dist/{extends-BPB6_lTK.js → dist-CO1AwwG_.js} +516 -561
  78. package/dist/{dist-BzN60Z2s.js → dist-CPGxfVGX.js} +1 -1
  79. package/dist/{dist-C7v-9nUK.js → dist-Cm3iAFMD.js} +3 -3
  80. package/dist/{dist-CGAxEiaM.js → dist-Cs2FijYk.js} +2 -2
  81. package/dist/{dist-hXd65f0_.js → dist-D1PpnuZB.js} +1 -1
  82. package/dist/{dist-VdvbxG72.js → dist-DHOTQar0.js} +1 -1
  83. package/dist/{dist-DcgzXCfy.js → dist-DPcEtqmG.js} +2 -2
  84. package/dist/{dist-D4Z_qdP4.js → dist-Df0wKI0F.js} +1 -1
  85. package/dist/{dist-qhLI-SHd.js → dist-DszxuxS1.js} +2 -2
  86. package/dist/{dist-BEmkrGoQ.js → dist-Kxgjxakw.js} +1 -1
  87. package/dist/{dist-BbSMhhD2.js → dist-KzZ7WELx.js} +2 -2
  88. package/dist/{dist-jWUab2d1.js → dist-lA1Cttkb.js} +1 -1
  89. package/dist/dropdown-menu-CZgjYSAh.js +4502 -0
  90. package/dist/{ebnfDiagram-BXEA7PRR-Dm75pCAS.js → ebnfDiagram-PWID7BFC-WnG4cvSQ.js} +17 -18
  91. package/dist/{erDiagram-JOGREHBK-rVDG3VSQ.js → erDiagram-RLTQ6QDP-DhzKiYHc.js} +1037 -798
  92. package/dist/error-banner-B94dcDmP.js +391 -0
  93. package/dist/error-entries-C0NsUqXl.js +56 -0
  94. package/dist/{esm-CR1nhb1c.js → esm-BElI3qKH.js} +22 -22
  95. package/dist/{esm-C1d0g6Bv.js → esm-G4Fhsgng.js} +51 -37
  96. package/dist/{esm-CesmlDrs.js → esm-h8f7-1CJ.js} +423 -423
  97. package/dist/eventmodeling-NTZA5JFV-D7nP7Uyu.js +3 -0
  98. package/dist/feedback-button-D2hUXe09.js +380 -0
  99. package/dist/flowDiagram-HODETNUW-6dMdB8pR.js +16 -0
  100. package/dist/{formats-CslNOKy0.js → formats-BR5iGb4s.js} +8 -8
  101. package/dist/{ganttDiagram-PKOTCBZU-9D-LXF6P.js → ganttDiagram-EL5Y4UJY-DbzEBLbl.js} +15 -15
  102. package/dist/gitGraph-4MIJSDKK-Dy9uQXGh.js +3 -0
  103. package/dist/{gitGraphDiagram-DS77QQ5N-BfpsXTLf.js → gitGraphDiagram-WWUBYQGX-BMf0iKi1.js} +10 -10
  104. package/dist/{glide-data-editor-sPZ8fUFn.js → glide-data-editor-B851uguN.js} +2143 -1910
  105. package/dist/{glide-utils-NShAPPtn.js → glide-utils-B3rUT5PI.js} +15 -15
  106. package/dist/globals-CmijFoIU.js +19 -0
  107. package/dist/highlighted-body-KPVGNVTW-Ad3MKZ18.js +38 -0
  108. package/dist/html-to-image-CeYYvQNb.js +3272 -0
  109. package/dist/info-A6RAGUB7-DKoayiHY.js +3 -0
  110. package/dist/{infoDiagram-6WML65LV-DqCTXHVy.js → infoDiagram-27XIBGKW-BagtCX_5.js} +7 -7
  111. package/dist/{ishikawaDiagram-WSZJBQD7-BCUYmZ1v.js → ishikawaDiagram-5VMMS53U-DByDehYy.js} +8 -8
  112. package/dist/{journeyDiagram-NVQOT4AX-BXB6M4zN.js → journeyDiagram-3NMN7TZE-D2LcKDUO.js} +8 -8
  113. package/dist/{jsx-runtime-CpoKNRgu.js → jsx-runtime-DgDPJV9S.js} +1 -1
  114. package/dist/{kanban-definition-27J2QSJJ-CGRhrDUX.js → kanban-definition-UXKFOSKX-BxwkbBI_.js} +29 -29
  115. package/dist/katex-DFBiSucW.js +21840 -0
  116. package/dist/{label-lwzzBHUW.js → label-BJ49YTvk.js} +6 -6
  117. package/dist/{linear-D5r_1YqD.js → linear-Cnaq3Tfb.js} +4 -4
  118. package/dist/{loader-VZ__bv4g.js → loader-D2W4oM-3.js} +15 -15
  119. package/dist/main.js +8113 -13475
  120. package/dist/mermaid-DPNuhemn.js +3084 -0
  121. package/dist/mermaid-HWGCJPDP-DYCzSILp.js +2 -0
  122. package/dist/mermaid-parser.core-DxuSfYwJ.js +638 -0
  123. package/dist/{mhchem-BjwrxcV-.js → mhchem-DWCF06w9.js} +1 -1
  124. package/dist/{micromark-factory-space-DruVGzeG.js → micromark-factory-space-DGxAzmw8.js} +2 -2
  125. package/dist/{mindmap-definition-FAOFIHXS-C9gRhzZq.js → mindmap-definition-YA3MSWOX-Cgvojw3y.js} +17 -17
  126. package/dist/{node-sql-parser-DesT1xNw.js → node-sql-parser-BiZOJ-FS.js} +0 -3
  127. package/dist/{number-overlay-editor-De2CabLL.js → number-overlay-editor-BtdoxWiD.js} +5 -5
  128. package/dist/objectWithoutPropertiesLoose-BRDcTsfB.js +23 -0
  129. package/dist/packet-AYTQ26CC-Yw7ajchJ.js +3 -0
  130. package/dist/{pegDiagram-VL7TDLO6-Df9IUjMD.js → pegDiagram-XKGWAZYB-DahHhYyN.js} +19 -20
  131. package/dist/{pick-SnHlmIBN.js → pick-CJeoxYOS.js} +1 -1
  132. package/dist/pie-WAS4IAKB-BKdKOAkL.js +3 -0
  133. package/dist/{pieDiagram-7S7Q4E2Y-BmRzQ8ZP.js → pieDiagram-E7YTZNPT-CCtX0oCK.js} +29 -31
  134. package/dist/{process-output-CPy0YKUe.js → process-output-BCTjlyuH.js} +7 -6
  135. package/dist/purify.es-DgKyQviY.js +805 -0
  136. package/dist/{quadrantDiagram-CIZ2JOQS-wFBvWcxS.js → quadrantDiagram-AXDQQJYC-DftINo6g.js} +5 -5
  137. package/dist/radar-RG4KPBEZ-ScR_D_Ts.js +3 -0
  138. package/dist/railroad-74A4TZTK-DQvPSdo5.js +3 -0
  139. package/dist/railroad-abnf-HS5TGJTU-CsJQG2O8.js +3 -0
  140. package/dist/railroad-ebnf-LZEXJU2U-BgEobkSn.js +3 -0
  141. package/dist/railroad-peg-WCYAUIDC-DjLAjofI.js +3 -0
  142. package/dist/{railroadDiagram-AXF67PYL-DxbIatiN.js → railroadDiagram-O6MQD6OU-Du5NsPUb.js} +17 -18
  143. package/dist/{react-dom-C94wmq5w.js → react-dom-BUgJ-ab_.js} +3 -3
  144. package/dist/{react-DMWcHin-.js → react-ofJbxM4x.js} +2 -2
  145. package/dist/{react-vega-DSD5aT7_.js → react-vega-5AcMW8gG.js} +10012 -9369
  146. package/dist/{requirementDiagram-LRYGKXZP-X_x-Y713.js → requirementDiagram-BXWQKSXE-0pmmxL6_.js} +20 -19
  147. package/dist/{reveal-component-CVsYlb9J.js → reveal-component-DQq7NUGJ.js} +1303 -1237
  148. package/dist/{sankeyDiagram-W5VNT64P-BYJALbbm.js → sankeyDiagram-P5KCCOFB-CDKR5TJH.js} +4 -4
  149. package/dist/{select-3qHpFKF9.js → select-C6plhmZr.js} +317 -562
  150. package/dist/{sequenceDiagram-SI44F4Z6-BiPBe3Sv.js → sequenceDiagram-WJ2MYXX4-DB-ChWwU.js} +11 -11
  151. package/dist/{sizeCapture-X5ZJPWSS-BKLDeh5H.js → sizeCapture-INFHLROL-Dx5SpkQF.js} +2 -2
  152. package/dist/{spec-CutWdqo3.js → spec-CAYwFeV6.js} +4 -4
  153. package/dist/{src-C31ngt98.js → src-CA_m4ONl.js} +298 -303
  154. package/dist/{stateDiagram-OKZ733FA-B7QyNBxH.js → stateDiagram-D77RDMKH-orN6AwMx.js} +19 -20
  155. package/dist/stateDiagram-v2-MP3YSRHH-o05_rJN8.js +30 -0
  156. package/dist/style.css +2 -2
  157. package/dist/{swimlanes-SLNWSIFB-B4f8VP3b.js → swimlanes-42K2YHIH-BkSDcqDT.js} +1501 -1591
  158. package/dist/swimlanesDiagram-VR7AAH4N-D_nFQfRc.js +30 -0
  159. package/dist/{swiper-component-C90YjhaV.js → swiper-component-IOUowglM.js} +39 -26
  160. package/dist/{time-aWGfjN8x.js → time-BieKwdYS.js} +42 -42
  161. package/dist/{timeline-definition-Z64GVDOM-Dacq_5lr.js → timeline-definition-24CTP7MA-BuqJUIRZ.js} +7 -7
  162. package/dist/{toDate-CpXBeDq0.js → toDate-WXg1yLcI.js} +7 -7
  163. package/dist/toast-DvY70eFX.js +1834 -0
  164. package/dist/tooltip-qB8NlSqV.js +1742 -0
  165. package/dist/treeView-Q6P3EWNA-DuRV97YF.js +3 -0
  166. package/dist/treemap-WGGIJYW6-AsLq-uwC.js +3 -0
  167. package/dist/use-restore-focus-D5D9xEjZ.js +5946 -0
  168. package/dist/{use-vega-container-remeasure-DUW4tRxq.js → use-vega-container-remeasure-4DwJbPWu.js} +2 -2
  169. package/dist/{useAsyncData-CH6-CgJF.js → useAsyncData-BD6AStMt.js} +3 -3
  170. package/dist/{useDateFormatter-Cp9Jdxls.js → useDateFormatter-BRTPsUK7.js} +8 -8
  171. package/dist/{useDeepCompareMemoize-JC87C_jO.js → useDeepCompareMemoize-D_HNdyvI.js} +2 -2
  172. package/dist/{useIframeCapabilities-De3C-9b4.js → useIframeCapabilities-CVtNkI3Y.js} +2 -2
  173. package/dist/{useLifecycle-B4RGlyf0.js → useLifecycle-DPgiiwwU.js} +6 -6
  174. package/dist/useNumberFormatter-BfDpa21j.js +251 -0
  175. package/dist/useTheme-DzXmYZ5V.js +904 -0
  176. package/dist/{vega-component-ovBXgp91.js → vega-component-D0QXopU8.js} +34 -34
  177. package/dist/{vega-embed-container-TJ5z5dZw.js → vega-embed-container-CbnTccZi.js} +6 -6
  178. package/dist/vega-loader.browser-D95WfUcj.js +1139 -0
  179. package/dist/{vennDiagram-T6HMQDX7-D-Rcq3Iu.js → vennDiagram-4TSXK5OY-CTUlJ2PK.js} +9 -9
  180. package/dist/wardley-WFR3VGLG-Na-tFhQJ.js +3 -0
  181. package/dist/{wardleyDiagram-T6FBY63Y-Z-Og7_Wd.js → wardleyDiagram-VM6X3IG4-3evLUb0M.js} +10 -10
  182. package/dist/{xychartDiagram-ELKLHX3M-BDJ2dITA.js → xychartDiagram-S5SC5T6Z-DL2E3K8-.js} +248 -139
  183. package/package.json +54 -57
  184. package/src/__mocks__/notebook.ts +1 -0
  185. package/src/__mocks__/requests.ts +7 -0
  186. package/src/__tests__/__snapshots__/CellStatus.test.tsx.snap +12 -12
  187. package/src/__tests__/fixtures/pair-preview.ts +19 -0
  188. package/src/__tests__/mount.test.ts +18 -0
  189. package/src/components/app-config/optional-features.tsx +6 -0
  190. package/src/components/chat/acp/__tests__/agent-panel-initialization.test.tsx +394 -0
  191. package/src/components/chat/acp/__tests__/agent-panel.test.tsx +272 -0
  192. package/src/components/chat/acp/__tests__/state.test.ts +2 -2
  193. package/src/components/chat/acp/agent-panel.tsx +115 -74
  194. package/src/components/chat/acp/state.ts +1 -1
  195. package/src/components/data-table/__tests__/filters.test.ts +21 -21
  196. package/src/components/data-table/charts/__tests__/spec.test.ts +5 -10
  197. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +2 -6
  198. package/src/components/data-table/column-summary/chart-spec-model.tsx +1 -1
  199. package/src/components/data-table/columns.tsx +64 -67
  200. package/src/components/editor/RecoveryButton.tsx +1 -0
  201. package/src/components/editor/__tests__/dynamic-favicon.test.tsx +36 -2
  202. package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +115 -0
  203. package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +218 -0
  204. package/src/components/editor/actions/pair-with-agent-commands.ts +46 -9
  205. package/src/components/editor/actions/pair-with-agent-modal.tsx +49 -23
  206. package/src/components/editor/ai/add-cell-with-ai.tsx +1 -0
  207. package/src/components/editor/ai/ai-completion-editor.tsx +3 -1
  208. package/src/components/editor/alerts/__tests__/connection-notice.test.tsx +186 -0
  209. package/src/components/editor/alerts/__tests__/startup-progress.test.tsx +185 -0
  210. package/src/components/editor/alerts/connecting-alert.tsx +1 -66
  211. package/src/components/editor/alerts/connection-notice.tsx +186 -0
  212. package/src/components/editor/alerts/startup-output.tsx +173 -0
  213. package/src/components/editor/alerts/startup-progress.tsx +204 -0
  214. package/src/components/editor/app-container.tsx +9 -3
  215. package/src/components/editor/boundary/ErrorBoundary.tsx +38 -16
  216. package/src/components/editor/boundary/__tests__/ErrorBoundary.test.tsx +311 -0
  217. package/src/components/editor/cell/__tests__/toolbar.test.tsx +73 -0
  218. package/src/components/editor/cell/code/__tests__/rtc-editor-config.test.ts +50 -0
  219. package/src/components/editor/cell/code/cell-editor.tsx +41 -42
  220. package/src/components/editor/cell/toolbar.tsx +11 -0
  221. package/src/components/editor/chrome/components/__tests__/feedback-button.test.tsx +94 -0
  222. package/src/components/editor/chrome/components/feedback-button.tsx +63 -42
  223. package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +164 -8
  224. package/src/components/editor/chrome/panels/__tests__/sandbox-details.test.tsx +358 -0
  225. package/src/components/editor/chrome/panels/__tests__/sandbox-recovery.test.tsx +168 -0
  226. package/src/components/editor/chrome/panels/packages-panel.tsx +113 -175
  227. package/src/components/editor/chrome/panels/sandbox-controller.tsx +106 -0
  228. package/src/components/editor/chrome/panels/sandbox-details-state.ts +38 -0
  229. package/src/components/editor/chrome/panels/sandbox-panel.tsx +230 -0
  230. package/src/components/editor/chrome/panels/sandbox-toggle.tsx +52 -0
  231. package/src/components/editor/chrome/wrapper/app-chrome.tsx +7 -0
  232. package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +3 -1
  233. package/src/components/editor/code/__tests__/readonly-diff.test.tsx +65 -0
  234. package/src/components/editor/code/readonly-diff.tsx +1 -1
  235. package/src/components/editor/connections/database/__tests__/__snapshots__/as-code.test.ts.snap +98 -98
  236. package/src/components/editor/connections/database/__tests__/as-code.test.ts +11 -5
  237. package/src/components/editor/dynamic-favicon.tsx +17 -10
  238. package/src/components/editor/file-tree/__tests__/file-explorer-navigation.test.tsx +13 -11
  239. package/src/components/editor/file-tree/__tests__/tree-actions.test.tsx +54 -0
  240. package/src/components/editor/file-tree/tree-actions.tsx +11 -14
  241. package/src/components/editor/header/__tests__/status.test.tsx +8 -20
  242. package/src/components/editor/header/filename-input.tsx +2 -0
  243. package/src/components/editor/header/status.tsx +5 -3
  244. package/src/components/editor/navigation/clipboard.ts +1 -0
  245. package/src/components/editor/notebook-cell.tsx +4 -2
  246. package/src/components/editor/output/JsonOutput.tsx +182 -632
  247. package/src/components/editor/output/Outputs.css +49 -17
  248. package/src/components/editor/output/__tests__/JsonOutput-interactions.test.tsx +254 -0
  249. package/src/components/editor/output/__tests__/JsonOutput-mimetype.test.tsx +41 -46
  250. package/src/components/editor/output/__tests__/{json-output.test.ts → json-output-formatting.test.ts} +113 -75
  251. package/src/components/editor/output/__tests__/json-output-pagination.test.ts +252 -0
  252. package/src/components/editor/output/json-output/formatting.ts +167 -0
  253. package/src/components/editor/output/json-output/pagination.ts +155 -0
  254. package/src/components/editor/output/json-output/renderers.tsx +196 -0
  255. package/src/components/editor/output/json-output/themes.ts +52 -0
  256. package/src/components/editor/package-alert.tsx +112 -66
  257. package/src/components/editor/renderers/cell-array.tsx +1 -5
  258. package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +3 -7
  259. package/src/components/slides/slide-form.tsx +1 -0
  260. package/src/components/slides/slide-notes-editor.tsx +1 -0
  261. package/src/components/tracing/tracing-spec.ts +1 -1
  262. package/src/components/ui/__tests__/badge.test.ts +6 -4
  263. package/src/components/ui/use-toast.ts +8 -0
  264. package/src/core/MarimoApp.tsx +0 -2
  265. package/src/core/ai/context/providers/__tests__/error.test.ts +16 -22
  266. package/src/core/alerts/__tests__/environment.test.ts +183 -0
  267. package/src/core/alerts/__tests__/state.test.tsx +240 -0
  268. package/src/core/alerts/environment.ts +57 -0
  269. package/src/core/alerts/state.ts +155 -99
  270. package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +296 -259
  271. package/src/core/cells/__tests__/apply-transaction.test.ts +34 -0
  272. package/src/core/cells/__tests__/cell.test.ts +61 -0
  273. package/src/core/cells/__tests__/cells.test.ts +182 -37
  274. package/src/core/cells/__tests__/document-changes.test.ts +39 -1
  275. package/src/core/cells/__tests__/outputs.test.tsx +117 -0
  276. package/src/core/cells/__tests__/pending-delete-service.test.tsx +4 -3
  277. package/src/core/cells/__tests__/session.test.ts +7 -0
  278. package/src/core/cells/cell.ts +9 -1
  279. package/src/core/cells/cells.ts +13 -18
  280. package/src/core/cells/document-changes.ts +11 -1
  281. package/src/core/cells/outputs.ts +66 -9
  282. package/src/core/cells/pending-delete-service.ts +12 -16
  283. package/src/core/cells/session.ts +2 -0
  284. package/src/core/cells/types.ts +2 -0
  285. package/src/core/codemirror/find-replace/__tests__/navigate.test.ts +8 -16
  286. package/src/core/codemirror/language/__tests__/sql.test.ts +70 -2
  287. package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +4 -8
  288. package/src/core/codemirror/language/languages/sql/sql.ts +16 -1
  289. package/src/core/codemirror/rtc/extension.ts +5 -2
  290. package/src/core/config/pair.ts +19 -0
  291. package/src/core/datasets/__tests__/data-source.test.ts +2 -0
  292. package/src/core/datasets/data-source-connections.ts +15 -10
  293. package/src/core/edit-app.tsx +8 -5
  294. package/src/core/errors/state.ts +1 -2
  295. package/src/core/export/__tests__/hooks.test.ts +1 -6
  296. package/src/core/islands/bootstrap.ts +3 -1
  297. package/src/core/islands/bridge.ts +3 -0
  298. package/src/core/islands/worker-factory.ts +2 -12
  299. package/src/core/kernel/messages.ts +2 -2
  300. package/src/core/network/__tests__/requests-network.test.ts +4 -3
  301. package/src/core/network/connection-notice.ts +117 -0
  302. package/src/core/network/connection.ts +19 -0
  303. package/src/core/network/requests-lazy.ts +3 -0
  304. package/src/core/network/requests-network.ts +12 -0
  305. package/src/core/network/requests-static.ts +3 -0
  306. package/src/core/network/requests-toasting.tsx +3 -0
  307. package/src/core/network/resolve.ts +2 -1
  308. package/src/core/network/types.ts +7 -0
  309. package/src/core/network/useConnectionNotice.ts +53 -0
  310. package/src/core/packages/__tests__/usePackageAction.test.tsx +129 -0
  311. package/src/core/packages/__tests__/useSandboxController.test.tsx +246 -0
  312. package/src/core/packages/package-data.ts +35 -0
  313. package/src/core/packages/sandbox-state.ts +67 -0
  314. package/src/core/packages/toast-components.tsx +11 -0
  315. package/src/core/packages/useInstallPackage.ts +1 -1
  316. package/src/core/packages/usePackageAction.ts +51 -0
  317. package/src/core/packages/usePackageDependencies.ts +22 -0
  318. package/src/core/packages/useSandboxController.ts +208 -0
  319. package/src/core/run-app.tsx +2 -0
  320. package/src/core/static/__tests__/files.test.ts +12 -30
  321. package/src/core/wasm/__tests__/bootstrap.test.ts +63 -0
  322. package/src/core/wasm/__tests__/bridge.test.ts +13 -4
  323. package/src/core/wasm/__tests__/fs.test.ts +22 -0
  324. package/src/core/wasm/__tests__/runtime-config.test.ts +65 -0
  325. package/src/core/wasm/bridge.ts +35 -23
  326. package/src/core/wasm/rpc.ts +2 -0
  327. package/src/core/wasm/runtime-config.ts +31 -0
  328. package/src/core/wasm/worker/bootstrap.ts +21 -11
  329. package/src/core/wasm/worker/constants.ts +1 -0
  330. package/src/core/wasm/worker/fs.ts +4 -0
  331. package/src/core/wasm/worker/getController.ts +3 -1
  332. package/src/core/wasm/worker/save-worker.ts +10 -9
  333. package/src/core/wasm/worker/types.ts +6 -4
  334. package/src/core/wasm/worker/worker.ts +9 -9
  335. package/src/core/websocket/__tests__/useMarimoKernelConnection.hook.test.tsx +404 -3
  336. package/src/core/websocket/__tests__/useMarimoKernelConnection.test.ts +8 -6
  337. package/src/core/websocket/transports/transport.ts +1 -1
  338. package/src/core/websocket/transports/ws.ts +1 -1
  339. package/src/core/websocket/types.ts +11 -1
  340. package/src/core/websocket/useMarimoKernelConnection.tsx +63 -16
  341. package/src/hooks/useDebounce.ts +2 -0
  342. package/src/mount.tsx +3 -0
  343. package/src/plugins/core/BadPlugin.tsx +3 -14
  344. package/src/plugins/core/RenderHTML.tsx +22 -2
  345. package/src/plugins/core/__test__/RenderHTML.test.ts +187 -0
  346. package/src/plugins/core/registerReactComponent.tsx +0 -1
  347. package/src/plugins/impl/FileBrowserPlugin.tsx +10 -4
  348. package/src/plugins/impl/FormPlugin.tsx +2 -0
  349. package/src/plugins/impl/MatrixPlugin.tsx +2 -0
  350. package/src/plugins/impl/RangeSliderPlugin.tsx +2 -0
  351. package/src/plugins/impl/SliderPlugin.tsx +2 -0
  352. package/src/plugins/impl/__tests__/FileBrowserPlugin.test.tsx +50 -1
  353. package/src/plugins/impl/data-editor/__tests__/glide-data-editor.test.tsx +23 -18
  354. package/src/plugins/impl/data-frames/panel.tsx +1 -0
  355. package/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx +1 -1
  356. package/src/plugins/impl/image-comparison/__tests__/ImageComparisonComponent.test.tsx +15 -0
  357. package/src/plugins/impl/vega/__tests__/make-selectable.test.ts +42 -48
  358. package/src/plugins/layout/AccordionPlugin.tsx +7 -2
  359. package/src/plugins/layout/JsonOutputPlugin.tsx +7 -10
  360. package/src/plugins/layout/__test__/AccordionPlugin.test.tsx +66 -0
  361. package/src/stories/sandbox.stories.tsx +488 -0
  362. package/src/utils/__tests__/path.test.ts +6 -5
  363. package/src/utils/__tests__/worker.test.ts +81 -0
  364. package/src/utils/worker.ts +22 -0
  365. package/dist/ErrorBoundary-CR-ZQN_c.js +0 -125
  366. package/dist/_baseMerge-Dv8bBloN.js +0 -73
  367. package/dist/_initCloneObject---vediN2.js +0 -95
  368. package/dist/arc-DOVLrCPd.js +0 -82
  369. package/dist/architecture-TIHT7OUA-MiJpPpQW.js +0 -3
  370. package/dist/array-CApNbSU9.js +0 -6
  371. package/dist/assets/__vite-browser-external-BdKGjRZ4.js +0 -1
  372. package/dist/assets/worker-DlIBfp9S.js +0 -98
  373. package/dist/blockDiagram-VBNYF7ZC-Bc--I65C.js +0 -3158
  374. package/dist/chat-ui-BSwr409J.js +0 -8455
  375. package/dist/chunk-3NCLNEKW-BIp_lB_4.js +0 -14
  376. package/dist/chunk-5FCAYU7R-C_HO9A1J.js +0 -23
  377. package/dist/chunk-5HE753X5-Bixm_MV-.js +0 -38
  378. package/dist/chunk-5JV3BV7I-CH5J3iZY.js +0 -54
  379. package/dist/chunk-5TONJI2A-DG6gDiSS.js +0 -62
  380. package/dist/chunk-7BUUIJ7U-5afmIPeo.js +0 -82
  381. package/dist/chunk-BIQX33UG-7TMBUf89.js +0 -23
  382. package/dist/chunk-CQNSW5MT-Cnqqsxt-.js +0 -38
  383. package/dist/chunk-CYSBUYHQ-BAbymFHR.js +0 -23
  384. package/dist/chunk-EMLP6XTP-Bsz-QL77.js +0 -23
  385. package/dist/chunk-J7OUQ5F2-CM_meqZH.js +0 -57
  386. package/dist/chunk-JG7HCLWE-DUnCDgPk.js +0 -62
  387. package/dist/chunk-MOZMSUNE-BG6IHvzT.js +0 -35
  388. package/dist/chunk-OSBZ3O6U-CYwj_bvR.js +0 -23
  389. package/dist/chunk-QBLGF6JB-B4vJ4j8J.js +0 -23
  390. package/dist/chunk-QR6OTTB3-D4wH2ldi.js +0 -3738
  391. package/dist/chunk-R7FJI6CG-Blf8FcmZ.js +0 -64
  392. package/dist/chunk-RYQCIY6F-BWbIlBIH.js +0 -241
  393. package/dist/chunk-U6XO7XAA-COw445DS.js +0 -63
  394. package/dist/chunk-UBXNYLIW-BHigVU4H.js +0 -32
  395. package/dist/chunk-YOTPTUD7-Dn044Q_d.js +0 -30
  396. package/dist/chunk-ZIRB5QZD-BR4TMfOa.js +0 -1153
  397. package/dist/classDiagram-JCYQIIEL-DmXSLxe_.js +0 -30
  398. package/dist/classDiagram-v2-OCEON4UE-CooqVexA.js +0 -30
  399. package/dist/click-outside-container-D_URcm3D.js +0 -167
  400. package/dist/code-block-37QAKDTI-CQrzBOr-.js +0 -107
  401. package/dist/copy-CD7S58CY.js +0 -141
  402. package/dist/cynefin-VYW2F7L2-CeHAxOEX.js +0 -3
  403. package/dist/dagre-VZM6K2ZE-CJggWPTJ.js +0 -328
  404. package/dist/dist-3_o3T78I.js +0 -1360
  405. package/dist/dist-ABQjhuek.js +0 -64
  406. package/dist/dist-CO5R6VMi.js +0 -538
  407. package/dist/dropdown-menu-DhCfcscX.js +0 -5858
  408. package/dist/emotion-is-prop-valid.esm-M57VsT8j.js +0 -14
  409. package/dist/error-banner-CsXbEEjo.js +0 -611
  410. package/dist/eventmodeling-45OFAUF4-B_lWZ-Pd.js +0 -3
  411. package/dist/flowDiagram-UKHOOZJN-g1AmrZzM.js +0 -17
  412. package/dist/gitGraph-TEB2WS4Q-Dj-eXUph.js +0 -3
  413. package/dist/info-DKCQHKI2-Bhb-pe2e.js +0 -3
  414. package/dist/line-CuKjIQa1.js +0 -34
  415. package/dist/map-BJpOfPlL.js +0 -149
  416. package/dist/math-BXtKgYah.js +0 -10
  417. package/dist/mermaid-4DMBBIKO-Ddp9TgNp.js +0 -2
  418. package/dist/mermaid-Bi23Ibnw.js +0 -1173
  419. package/dist/mermaid-parser.core-Din9FvSi.js +0 -99
  420. package/dist/packet-7NZHBO7P-fbkIIyKE.js +0 -3
  421. package/dist/path-BNHuHZP8.js +0 -87
  422. package/dist/pie-RZYD4A2V-CLRIsxY1.js +0 -3
  423. package/dist/purify.es-CB-YO1Hn.js +0 -774
  424. package/dist/radar-I7S5WNFK-BGzCbgXu.js +0 -3
  425. package/dist/railroad-3IZDKUUU-CvQIIcuU.js +0 -3
  426. package/dist/railroad-abnf-AHOZXSZD-CMwtlNtu.js +0 -3
  427. package/dist/railroad-ebnf-EBAXGLYW-n1QUOAsh.js +0 -3
  428. package/dist/railroad-peg-LSFZ7HO6-PjnrpmCs.js +0 -3
  429. package/dist/schemas-DzK6U94N.js +0 -6057
  430. package/dist/stateDiagram-v2-UEYNNEHI-BTRUs8Il.js +0 -30
  431. package/dist/step-CKczO72Q.js +0 -670
  432. package/dist/swimlanesDiagram-ULZ7WXOC-NBmgBl9G.js +0 -31
  433. package/dist/timer-DpDyj9G0.js +0 -596
  434. package/dist/tooltip-Dt77sBeT.js +0 -390
  435. package/dist/treeView-QDETBFTQ-DU8LwHuf.js +0 -3
  436. package/dist/treemap-6X3UGDF4-DUk4-k_O.js +0 -3
  437. package/dist/useTheme-CVJ0UOf2.js +0 -841
  438. package/dist/vega-loader.browser-DEggZzni.js +0 -1083
  439. package/dist/wardley-OPB4EBWU-Db-AaGas.js +0 -3
  440. package/src/components/editor/output/EmotionCacheProvider.tsx +0 -32
@@ -1,3158 +0,0 @@
1
- import { t as e } from "./graphlib-BmY_CCV9.js";
2
- import { _ as t } from "./step-CKczO72Q.js";
3
- import { t as n } from "./line-CuKjIQa1.js";
4
- import { A as r, B as i, C as a, D as o, E as s, F as c, G as l, H as u, I as d, L as f, M as p, N as m, O as h, P as g, R as _, T as v, U as y, V as b, W as x, a as S, b as C, g as w, j as T, k as E, l as D, v as O, w as ee, z as k } from "./chunk-NSK5VX7P-CDTMcJB0.js";
5
- import { n as A, t as j } from "./src-C31ngt98.js";
6
- import { n as M } from "./chunk-Y2CYZVJY-DoegUj_e.js";
7
- import { O as te, T as N, a as ne, b as P, c as re, rt as ie, s as ae, x as F, z as oe } from "./chunk-I66GZJ75-BqyTCAPf.js";
8
- import { t as se } from "./channel-CyiYUzJv.js";
9
- import { n as ce, t as le } from "./chunk-UBXNYLIW-BHigVU4H.js";
10
- import "./chunk-4I5QYGJK-DpytHuZQ.js";
11
- import { n as ue } from "./chunk-WRU74C26-BpWsbiDK.js";
12
- import { n as de, t as I } from "./chunk-7BUUIJ7U-5afmIPeo.js";
13
- import { t as fe } from "./chunk-5VM5RSS4-Bcq0ftdy.js";
14
- //#region ../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/predicate/isArray.mjs
15
- function pe(e) {
16
- return Array.isArray(e);
17
- }
18
- //#endregion
19
- //#region ../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/object/clone.mjs
20
- function me(e) {
21
- if (C(e)) return e;
22
- let t = l(e);
23
- if (!he(e)) return {};
24
- if (pe(e)) {
25
- let t = Array.from(e);
26
- return e.length > 0 && typeof e[0] == "string" && Object.hasOwn(e, "index") && (t.index = e.index, t.input = e.input), t;
27
- }
28
- if (O(e)) {
29
- let t = e, n = t.constructor;
30
- return new n(t.buffer, t.byteOffset, t.length);
31
- }
32
- if (t === "[object ArrayBuffer]") return new ArrayBuffer(e.byteLength);
33
- if (t === "[object DataView]") {
34
- let t = e, n = t.buffer, r = t.byteOffset, i = t.byteLength, a = new ArrayBuffer(i), o = new Uint8Array(n, r, i);
35
- return new Uint8Array(a).set(o), new DataView(a);
36
- }
37
- if (t === "[object Boolean]" || t === "[object Number]" || t === "[object String]") {
38
- let n = e.constructor, r = new n(e.valueOf());
39
- return t === "[object String]" ? ve(r, e) : ge(r, e), r;
40
- }
41
- if (t === "[object Date]") return new Date(Number(e));
42
- if (t === "[object RegExp]") {
43
- let t = e, n = new RegExp(t.source, t.flags);
44
- return n.lastIndex = t.lastIndex, n;
45
- }
46
- if (t === "[object Symbol]") return Object(Symbol.prototype.valueOf.call(e));
47
- if (t === "[object Map]") {
48
- let t = e, n = /* @__PURE__ */ new Map();
49
- return t.forEach((e, t) => {
50
- n.set(t, e);
51
- }), n;
52
- }
53
- if (t === "[object Set]") {
54
- let t = e, n = /* @__PURE__ */ new Set();
55
- return t.forEach((e) => {
56
- n.add(e);
57
- }), n;
58
- }
59
- if (t === "[object Arguments]") {
60
- let t = e, n = {};
61
- return ge(n, t), n.length = t.length, n[Symbol.iterator] = t[Symbol.iterator], n;
62
- }
63
- let n = {};
64
- return ye(n, e), ge(n, e), _e(n, e), n;
65
- }
66
- function he(e) {
67
- switch (l(e)) {
68
- case a:
69
- case v:
70
- case ee:
71
- case o:
72
- case s:
73
- case h:
74
- case E:
75
- case r:
76
- case m:
77
- case T:
78
- case p:
79
- case g:
80
- case c:
81
- case d:
82
- case f:
83
- case _:
84
- case k:
85
- case i:
86
- case y:
87
- case x:
88
- case b:
89
- case u: return !0;
90
- default: return !1;
91
- }
92
- }
93
- function ge(e, t) {
94
- for (let n in t) Object.hasOwn(t, n) && (e[n] = t[n]);
95
- }
96
- function _e(e, t) {
97
- let n = Object.getOwnPropertySymbols(t);
98
- for (let r = 0; r < n.length; r++) {
99
- let i = n[r];
100
- Object.prototype.propertyIsEnumerable.call(t, i) && (e[i] = t[i]);
101
- }
102
- }
103
- function ve(e, t) {
104
- let n = t.valueOf().length;
105
- for (let r in t) Object.hasOwn(t, r) && (Number.isNaN(Number(r)) || Number(r) >= n) && (e[r] = t[r]);
106
- }
107
- function ye(e, t) {
108
- let n = Object.getPrototypeOf(t);
109
- n !== null && typeof t.constructor == "function" && Object.setPrototypeOf(e, n);
110
- }
111
- //#endregion
112
- //#region ../node_modules/.pnpm/mermaid@11.16.1/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-VBNYF7ZC.mjs
113
- var L = (function() {
114
- var e = /* @__PURE__ */ M(function(e, t, n, r) {
115
- for (n ||= {}, r = e.length; r--; n[e[r]] = t);
116
- return n;
117
- }, "o"), t = [1, 15], n = [1, 7], r = [1, 13], i = [1, 14], a = [1, 19], o = [1, 16], s = [1, 17], c = [1, 18], l = [8, 30], u = [
118
- 8,
119
- 10,
120
- 21,
121
- 28,
122
- 29,
123
- 30,
124
- 31,
125
- 39,
126
- 43,
127
- 46
128
- ], d = [1, 23], f = [1, 24], p = [
129
- 8,
130
- 10,
131
- 15,
132
- 16,
133
- 21,
134
- 28,
135
- 29,
136
- 30,
137
- 31,
138
- 39,
139
- 43,
140
- 46
141
- ], m = [
142
- 8,
143
- 10,
144
- 15,
145
- 16,
146
- 21,
147
- 27,
148
- 28,
149
- 29,
150
- 30,
151
- 31,
152
- 39,
153
- 43,
154
- 46
155
- ], h = [1, 49], g = {
156
- trace: /* @__PURE__ */ M(function() {}, "trace"),
157
- yy: {},
158
- symbols_: {
159
- error: 2,
160
- spaceLines: 3,
161
- SPACELINE: 4,
162
- NL: 5,
163
- separator: 6,
164
- SPACE: 7,
165
- EOF: 8,
166
- start: 9,
167
- BLOCK_DIAGRAM_KEY: 10,
168
- document: 11,
169
- stop: 12,
170
- statement: 13,
171
- link: 14,
172
- LINK: 15,
173
- START_LINK: 16,
174
- LINK_LABEL: 17,
175
- STR: 18,
176
- nodeStatement: 19,
177
- columnsStatement: 20,
178
- SPACE_BLOCK: 21,
179
- blockStatement: 22,
180
- classDefStatement: 23,
181
- cssClassStatement: 24,
182
- styleStatement: 25,
183
- node: 26,
184
- SIZE: 27,
185
- COLUMNS: 28,
186
- "id-block": 29,
187
- end: 30,
188
- NODE_ID: 31,
189
- nodeShapeNLabel: 32,
190
- dirList: 33,
191
- DIR: 34,
192
- NODE_DSTART: 35,
193
- NODE_DEND: 36,
194
- BLOCK_ARROW_START: 37,
195
- BLOCK_ARROW_END: 38,
196
- classDef: 39,
197
- CLASSDEF_ID: 40,
198
- CLASSDEF_STYLEOPTS: 41,
199
- DEFAULT: 42,
200
- class: 43,
201
- CLASSENTITY_IDS: 44,
202
- STYLECLASS: 45,
203
- style: 46,
204
- STYLE_ENTITY_IDS: 47,
205
- STYLE_DEFINITION_DATA: 48,
206
- $accept: 0,
207
- $end: 1
208
- },
209
- terminals_: {
210
- 2: "error",
211
- 4: "SPACELINE",
212
- 5: "NL",
213
- 7: "SPACE",
214
- 8: "EOF",
215
- 10: "BLOCK_DIAGRAM_KEY",
216
- 15: "LINK",
217
- 16: "START_LINK",
218
- 17: "LINK_LABEL",
219
- 18: "STR",
220
- 21: "SPACE_BLOCK",
221
- 27: "SIZE",
222
- 28: "COLUMNS",
223
- 29: "id-block",
224
- 30: "end",
225
- 31: "NODE_ID",
226
- 34: "DIR",
227
- 35: "NODE_DSTART",
228
- 36: "NODE_DEND",
229
- 37: "BLOCK_ARROW_START",
230
- 38: "BLOCK_ARROW_END",
231
- 39: "classDef",
232
- 40: "CLASSDEF_ID",
233
- 41: "CLASSDEF_STYLEOPTS",
234
- 42: "DEFAULT",
235
- 43: "class",
236
- 44: "CLASSENTITY_IDS",
237
- 45: "STYLECLASS",
238
- 46: "style",
239
- 47: "STYLE_ENTITY_IDS",
240
- 48: "STYLE_DEFINITION_DATA"
241
- },
242
- productions_: [
243
- 0,
244
- [3, 1],
245
- [3, 2],
246
- [3, 2],
247
- [6, 1],
248
- [6, 1],
249
- [6, 1],
250
- [9, 3],
251
- [12, 1],
252
- [12, 1],
253
- [12, 2],
254
- [12, 2],
255
- [11, 1],
256
- [11, 2],
257
- [14, 1],
258
- [14, 4],
259
- [13, 1],
260
- [13, 1],
261
- [13, 1],
262
- [13, 1],
263
- [13, 1],
264
- [13, 1],
265
- [13, 1],
266
- [19, 3],
267
- [19, 2],
268
- [19, 1],
269
- [20, 1],
270
- [22, 4],
271
- [22, 3],
272
- [26, 1],
273
- [26, 2],
274
- [33, 1],
275
- [33, 2],
276
- [32, 3],
277
- [32, 4],
278
- [23, 3],
279
- [23, 3],
280
- [24, 3],
281
- [25, 3]
282
- ],
283
- performAction: /* @__PURE__ */ M(function(e, t, n, r, i, a, o) {
284
- var s = a.length - 1;
285
- switch (i) {
286
- case 4:
287
- r.getLogger().debug("Rule: separator (NL) ");
288
- break;
289
- case 5:
290
- r.getLogger().debug("Rule: separator (Space) ");
291
- break;
292
- case 6:
293
- r.getLogger().debug("Rule: separator (EOF) ");
294
- break;
295
- case 7:
296
- r.getLogger().debug("Rule: hierarchy: ", a[s - 1]), r.setHierarchy(a[s - 1]);
297
- break;
298
- case 8:
299
- r.getLogger().debug("Stop NL ");
300
- break;
301
- case 9:
302
- r.getLogger().debug("Stop EOF ");
303
- break;
304
- case 10:
305
- r.getLogger().debug("Stop NL2 ");
306
- break;
307
- case 11:
308
- r.getLogger().debug("Stop EOF2 ");
309
- break;
310
- case 12:
311
- r.getLogger().debug("Rule: statement: ", a[s]), this.$ = typeof a[s].length == "number" ? a[s] : [a[s]];
312
- break;
313
- case 13:
314
- r.getLogger().debug("Rule: statement #2: ", a[s - 1]), this.$ = [a[s - 1]].concat(a[s]);
315
- break;
316
- case 14:
317
- r.getLogger().debug("Rule: link: ", a[s], e), this.$ = {
318
- edgeTypeStr: a[s],
319
- label: ""
320
- };
321
- break;
322
- case 15:
323
- r.getLogger().debug("Rule: LABEL link: ", a[s - 3], a[s - 1], a[s]), this.$ = {
324
- edgeTypeStr: a[s],
325
- label: a[s - 1]
326
- };
327
- break;
328
- case 18:
329
- let t = parseInt(a[s]), n = r.generateId();
330
- this.$ = {
331
- id: n,
332
- type: "space",
333
- label: "",
334
- width: t,
335
- children: []
336
- };
337
- break;
338
- case 23:
339
- r.getLogger().debug("Rule: (nodeStatement link node) ", a[s - 2], a[s - 1], a[s], " typestr: ", a[s - 1].edgeTypeStr);
340
- let i = r.edgeStrToEdgeData(a[s - 1].edgeTypeStr), o = r.edgeStrToEdgeStartData(a[s - 1].edgeTypeStr), c = r.edgeStrToThickness(a[s - 1].edgeTypeStr), l = r.edgeStrToPattern(a[s - 1].edgeTypeStr);
341
- this.$ = [
342
- {
343
- id: a[s - 2].id,
344
- label: a[s - 2].label,
345
- type: a[s - 2].type,
346
- directions: a[s - 2].directions
347
- },
348
- {
349
- id: a[s - 2].id + "-" + a[s].id,
350
- start: a[s - 2].id,
351
- end: a[s].id,
352
- label: a[s - 1].label,
353
- type: "edge",
354
- thickness: c,
355
- pattern: l,
356
- directions: a[s].directions,
357
- arrowTypeEnd: i,
358
- arrowTypeStart: o
359
- },
360
- {
361
- id: a[s].id,
362
- label: a[s].label,
363
- type: r.typeStr2Type(a[s].typeStr),
364
- directions: a[s].directions
365
- }
366
- ];
367
- break;
368
- case 24:
369
- r.getLogger().debug("Rule: nodeStatement (abc88 node size) ", a[s - 1], a[s]), this.$ = {
370
- id: a[s - 1].id,
371
- label: a[s - 1].label,
372
- type: r.typeStr2Type(a[s - 1].typeStr),
373
- directions: a[s - 1].directions,
374
- widthInColumns: parseInt(a[s], 10)
375
- };
376
- break;
377
- case 25:
378
- r.getLogger().debug("Rule: nodeStatement (node) ", a[s]), this.$ = {
379
- id: a[s].id,
380
- label: a[s].label,
381
- type: r.typeStr2Type(a[s].typeStr),
382
- directions: a[s].directions,
383
- widthInColumns: 1
384
- };
385
- break;
386
- case 26:
387
- r.getLogger().debug("APA123", this ? this : "na"), r.getLogger().debug("COLUMNS: ", a[s]), this.$ = {
388
- type: "column-setting",
389
- columns: a[s] === "auto" ? -1 : parseInt(a[s])
390
- };
391
- break;
392
- case 27:
393
- r.getLogger().debug("Rule: id-block statement : ", a[s - 2], a[s - 1]), r.generateId(), this.$ = {
394
- ...a[s - 2],
395
- type: "composite",
396
- children: a[s - 1]
397
- };
398
- break;
399
- case 28:
400
- r.getLogger().debug("Rule: blockStatement : ", a[s - 2], a[s - 1], a[s]);
401
- let u = r.generateId();
402
- this.$ = {
403
- id: u,
404
- type: "composite",
405
- label: "",
406
- children: a[s - 1]
407
- };
408
- break;
409
- case 29:
410
- r.getLogger().debug("Rule: node (NODE_ID separator): ", a[s]), this.$ = { id: a[s] };
411
- break;
412
- case 30:
413
- r.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", a[s - 1], a[s]), this.$ = {
414
- id: a[s - 1],
415
- label: a[s].label,
416
- typeStr: a[s].typeStr,
417
- directions: a[s].directions
418
- };
419
- break;
420
- case 31:
421
- r.getLogger().debug("Rule: dirList: ", a[s]), this.$ = [a[s]];
422
- break;
423
- case 32:
424
- r.getLogger().debug("Rule: dirList: ", a[s - 1], a[s]), this.$ = [a[s - 1]].concat(a[s]);
425
- break;
426
- case 33:
427
- r.getLogger().debug("Rule: nodeShapeNLabel: ", a[s - 2], a[s - 1], a[s]), this.$ = {
428
- typeStr: a[s - 2] + a[s],
429
- label: a[s - 1]
430
- };
431
- break;
432
- case 34:
433
- r.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", a[s - 3], a[s - 2], " #3:", a[s - 1], a[s]), this.$ = {
434
- typeStr: a[s - 3] + a[s],
435
- label: a[s - 2],
436
- directions: a[s - 1]
437
- };
438
- break;
439
- case 35:
440
- case 36:
441
- this.$ = {
442
- type: "classDef",
443
- id: a[s - 1].trim(),
444
- css: a[s].trim()
445
- };
446
- break;
447
- case 37:
448
- this.$ = {
449
- type: "applyClass",
450
- id: a[s - 1].trim(),
451
- styleClass: a[s].trim()
452
- };
453
- break;
454
- case 38: this.$ = {
455
- type: "applyStyles",
456
- id: a[s - 1].trim(),
457
- stylesStr: a[s].trim()
458
- };
459
- }
460
- }, "anonymous"),
461
- table: [
462
- {
463
- 9: 1,
464
- 10: [1, 2]
465
- },
466
- { 1: [3] },
467
- {
468
- 10: t,
469
- 11: 3,
470
- 13: 4,
471
- 19: 5,
472
- 20: 6,
473
- 21: n,
474
- 22: 8,
475
- 23: 9,
476
- 24: 10,
477
- 25: 11,
478
- 26: 12,
479
- 28: r,
480
- 29: i,
481
- 31: a,
482
- 39: o,
483
- 43: s,
484
- 46: c
485
- },
486
- { 8: [1, 20] },
487
- e(l, [2, 12], {
488
- 13: 4,
489
- 19: 5,
490
- 20: 6,
491
- 22: 8,
492
- 23: 9,
493
- 24: 10,
494
- 25: 11,
495
- 26: 12,
496
- 11: 21,
497
- 10: t,
498
- 21: n,
499
- 28: r,
500
- 29: i,
501
- 31: a,
502
- 39: o,
503
- 43: s,
504
- 46: c
505
- }),
506
- e(u, [2, 16], {
507
- 14: 22,
508
- 15: d,
509
- 16: f
510
- }),
511
- e(u, [2, 17]),
512
- e(u, [2, 18]),
513
- e(u, [2, 19]),
514
- e(u, [2, 20]),
515
- e(u, [2, 21]),
516
- e(u, [2, 22]),
517
- e(p, [2, 25], { 27: [1, 25] }),
518
- e(u, [2, 26]),
519
- {
520
- 19: 26,
521
- 26: 12,
522
- 31: a
523
- },
524
- {
525
- 10: t,
526
- 11: 27,
527
- 13: 4,
528
- 19: 5,
529
- 20: 6,
530
- 21: n,
531
- 22: 8,
532
- 23: 9,
533
- 24: 10,
534
- 25: 11,
535
- 26: 12,
536
- 28: r,
537
- 29: i,
538
- 31: a,
539
- 39: o,
540
- 43: s,
541
- 46: c
542
- },
543
- {
544
- 40: [1, 28],
545
- 42: [1, 29]
546
- },
547
- { 44: [1, 30] },
548
- { 47: [1, 31] },
549
- e(m, [2, 29], {
550
- 32: 32,
551
- 35: [1, 33],
552
- 37: [1, 34]
553
- }),
554
- { 1: [2, 7] },
555
- e(l, [2, 13]),
556
- {
557
- 26: 35,
558
- 31: a
559
- },
560
- { 31: [2, 14] },
561
- { 17: [1, 36] },
562
- e(p, [2, 24]),
563
- {
564
- 10: t,
565
- 11: 37,
566
- 13: 4,
567
- 14: 22,
568
- 15: d,
569
- 16: f,
570
- 19: 5,
571
- 20: 6,
572
- 21: n,
573
- 22: 8,
574
- 23: 9,
575
- 24: 10,
576
- 25: 11,
577
- 26: 12,
578
- 28: r,
579
- 29: i,
580
- 31: a,
581
- 39: o,
582
- 43: s,
583
- 46: c
584
- },
585
- { 30: [1, 38] },
586
- { 41: [1, 39] },
587
- { 41: [1, 40] },
588
- { 45: [1, 41] },
589
- { 48: [1, 42] },
590
- e(m, [2, 30]),
591
- { 18: [1, 43] },
592
- { 18: [1, 44] },
593
- e(p, [2, 23]),
594
- { 18: [1, 45] },
595
- { 30: [1, 46] },
596
- e(u, [2, 28]),
597
- e(u, [2, 35]),
598
- e(u, [2, 36]),
599
- e(u, [2, 37]),
600
- e(u, [2, 38]),
601
- { 36: [1, 47] },
602
- {
603
- 33: 48,
604
- 34: h
605
- },
606
- { 15: [1, 50] },
607
- e(u, [2, 27]),
608
- e(m, [2, 33]),
609
- { 38: [1, 51] },
610
- {
611
- 33: 52,
612
- 34: h,
613
- 38: [2, 31]
614
- },
615
- { 31: [2, 15] },
616
- e(m, [2, 34]),
617
- { 38: [2, 32] }
618
- ],
619
- defaultActions: {
620
- 20: [2, 7],
621
- 23: [2, 14],
622
- 50: [2, 15],
623
- 52: [2, 32]
624
- },
625
- parseError: /* @__PURE__ */ M(function(e, t) {
626
- if (t.recoverable) this.trace(e);
627
- else {
628
- var n = Error(e);
629
- throw n.hash = t, n;
630
- }
631
- }, "parseError"),
632
- parse: /* @__PURE__ */ M(function(e) {
633
- var t = this, n = [0], r = [], i = [null], a = [], o = this.table, s = "", c = 0, l = 0, u = 0, d = 2, f = 1, p = a.slice.call(arguments, 1), m = Object.create(this.lexer), h = { yy: {} };
634
- for (var g in this.yy) Object.prototype.hasOwnProperty.call(this.yy, g) && (h.yy[g] = this.yy[g]);
635
- m.setInput(e, h.yy), h.yy.lexer = m, h.yy.parser = this, m.yylloc === void 0 && (m.yylloc = {});
636
- var _ = m.yylloc;
637
- a.push(_);
638
- var v = m.options && m.options.ranges;
639
- this.parseError = typeof h.yy.parseError == "function" ? h.yy.parseError : Object.getPrototypeOf(this).parseError;
640
- function y(e) {
641
- n.length -= 2 * e, i.length -= e, a.length -= e;
642
- }
643
- M(y, "popStack");
644
- function b() {
645
- var e = r.pop() || m.lex() || f;
646
- return typeof e != "number" && (e instanceof Array && (r = e, e = r.pop()), e = t.symbols_[e] || e), e;
647
- }
648
- M(b, "lex");
649
- for (var x, S, C, w, T, E = {}, D, O, ee, k;;) {
650
- if (C = n[n.length - 1], this.defaultActions[C] ? w = this.defaultActions[C] : (x ??= b(), w = o[C] && o[C][x]), w === void 0 || !w.length || !w[0]) {
651
- var A = "";
652
- for (D in k = [], o[C]) this.terminals_[D] && D > d && k.push("'" + this.terminals_[D] + "'");
653
- A = m.showPosition ? "Parse error on line " + (c + 1) + ":\n" + m.showPosition() + "\nExpecting " + k.join(", ") + ", got '" + (this.terminals_[x] || x) + "'" : "Parse error on line " + (c + 1) + ": Unexpected " + (x == f ? "end of input" : "'" + (this.terminals_[x] || x) + "'"), this.parseError(A, {
654
- text: m.match,
655
- token: this.terminals_[x] || x,
656
- line: m.yylineno,
657
- loc: _,
658
- expected: k
659
- });
660
- }
661
- if (w[0] instanceof Array && w.length > 1) throw Error("Parse Error: multiple actions possible at state: " + C + ", token: " + x);
662
- switch (w[0]) {
663
- case 1:
664
- n.push(x), i.push(m.yytext), a.push(m.yylloc), n.push(w[1]), x = null, S ? (x = S, S = null) : (l = m.yyleng, s = m.yytext, c = m.yylineno, _ = m.yylloc, u > 0 && u--);
665
- break;
666
- case 2:
667
- if (O = this.productions_[w[1]][1], E.$ = i[i.length - O], E._$ = {
668
- first_line: a[a.length - (O || 1)].first_line,
669
- last_line: a[a.length - 1].last_line,
670
- first_column: a[a.length - (O || 1)].first_column,
671
- last_column: a[a.length - 1].last_column
672
- }, v && (E._$.range = [a[a.length - (O || 1)].range[0], a[a.length - 1].range[1]]), T = this.performAction.apply(E, [
673
- s,
674
- l,
675
- c,
676
- h.yy,
677
- w[1],
678
- i,
679
- a
680
- ].concat(p)), T !== void 0) return T;
681
- O && (n = n.slice(0, -1 * O * 2), i = i.slice(0, -1 * O), a = a.slice(0, -1 * O)), n.push(this.productions_[w[1]][0]), i.push(E.$), a.push(E._$), ee = o[n[n.length - 2]][n[n.length - 1]], n.push(ee);
682
- break;
683
- case 3: return !0;
684
- }
685
- }
686
- return !0;
687
- }, "parse")
688
- };
689
- g.lexer = /* @__PURE__ */ (function() {
690
- return {
691
- EOF: 1,
692
- parseError: /* @__PURE__ */ M(function(e, t) {
693
- if (this.yy.parser) this.yy.parser.parseError(e, t);
694
- else throw Error(e);
695
- }, "parseError"),
696
- setInput: /* @__PURE__ */ M(function(e, t) {
697
- return this.yy = t || this.yy || {}, this._input = e, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
698
- first_line: 1,
699
- first_column: 0,
700
- last_line: 1,
701
- last_column: 0
702
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
703
- }, "setInput"),
704
- input: /* @__PURE__ */ M(function() {
705
- var e = this._input[0];
706
- return this.yytext += e, this.yyleng++, this.offset++, this.match += e, this.matched += e, e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), e;
707
- }, "input"),
708
- unput: /* @__PURE__ */ M(function(e) {
709
- var t = e.length, n = e.split(/(?:\r\n?|\n)/g);
710
- this._input = e + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - t), this.offset -= t;
711
- var r = this.match.split(/(?:\r\n?|\n)/g);
712
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
713
- var i = this.yylloc.range;
714
- return this.yylloc = {
715
- first_line: this.yylloc.first_line,
716
- last_line: this.yylineno + 1,
717
- first_column: this.yylloc.first_column,
718
- last_column: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - t
719
- }, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - t]), this.yyleng = this.yytext.length, this;
720
- }, "unput"),
721
- more: /* @__PURE__ */ M(function() {
722
- return this._more = !0, this;
723
- }, "more"),
724
- reject: /* @__PURE__ */ M(function() {
725
- if (this.options.backtrack_lexer) this._backtrack = !0;
726
- else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
727
- text: "",
728
- token: null,
729
- line: this.yylineno
730
- });
731
- return this;
732
- }, "reject"),
733
- less: /* @__PURE__ */ M(function(e) {
734
- this.unput(this.match.slice(e));
735
- }, "less"),
736
- pastInput: /* @__PURE__ */ M(function() {
737
- var e = this.matched.substr(0, this.matched.length - this.match.length);
738
- return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, "");
739
- }, "pastInput"),
740
- upcomingInput: /* @__PURE__ */ M(function() {
741
- var e = this.match;
742
- return e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "");
743
- }, "upcomingInput"),
744
- showPosition: /* @__PURE__ */ M(function() {
745
- var e = this.pastInput(), t = Array(e.length + 1).join("-");
746
- return e + this.upcomingInput() + "\n" + t + "^";
747
- }, "showPosition"),
748
- test_match: /* @__PURE__ */ M(function(e, t) {
749
- var n, r, i;
750
- if (this.options.backtrack_lexer && (i = {
751
- yylineno: this.yylineno,
752
- yylloc: {
753
- first_line: this.yylloc.first_line,
754
- last_line: this.last_line,
755
- first_column: this.yylloc.first_column,
756
- last_column: this.yylloc.last_column
757
- },
758
- yytext: this.yytext,
759
- match: this.match,
760
- matches: this.matches,
761
- matched: this.matched,
762
- yyleng: this.yyleng,
763
- offset: this.offset,
764
- _more: this._more,
765
- _input: this._input,
766
- yy: this.yy,
767
- conditionStack: this.conditionStack.slice(0),
768
- done: this.done
769
- }, this.options.ranges && (i.yylloc.range = this.yylloc.range.slice(0))), r = e[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
770
- first_line: this.yylloc.last_line,
771
- last_line: this.yylineno + 1,
772
- first_column: this.yylloc.last_column,
773
- last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length
774
- }, this.yytext += e[0], this.match += e[0], this.matches = e, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(e[0].length), this.matched += e[0], n = this.performAction.call(this, this.yy, this, t, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n) return n;
775
- if (this._backtrack) {
776
- for (var a in i) this[a] = i[a];
777
- return !1;
778
- }
779
- return !1;
780
- }, "test_match"),
781
- next: /* @__PURE__ */ M(function() {
782
- if (this.done) return this.EOF;
783
- this._input || (this.done = !0);
784
- var e, t, n, r;
785
- this._more || (this.yytext = "", this.match = "");
786
- for (var i = this._currentRules(), a = 0; a < i.length; a++) if (n = this._input.match(this.rules[i[a]]), n && (!t || n[0].length > t[0].length)) {
787
- if (t = n, r = a, this.options.backtrack_lexer) {
788
- if (e = this.test_match(n, i[a]), e !== !1) return e;
789
- if (this._backtrack) {
790
- t = !1;
791
- continue;
792
- }
793
- return !1;
794
- }
795
- if (!this.options.flex) break;
796
- }
797
- return t ? (e = this.test_match(t, i[r]), e !== !1 && e) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
798
- text: "",
799
- token: null,
800
- line: this.yylineno
801
- });
802
- }, "next"),
803
- lex: /* @__PURE__ */ M(function() {
804
- return this.next() || this.lex();
805
- }, "lex"),
806
- begin: /* @__PURE__ */ M(function(e) {
807
- this.conditionStack.push(e);
808
- }, "begin"),
809
- popState: /* @__PURE__ */ M(function() {
810
- return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
811
- }, "popState"),
812
- _currentRules: /* @__PURE__ */ M(function() {
813
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
814
- }, "_currentRules"),
815
- topState: /* @__PURE__ */ M(function(e) {
816
- return e = this.conditionStack.length - 1 - Math.abs(e || 0), e >= 0 ? this.conditionStack[e] : "INITIAL";
817
- }, "topState"),
818
- pushState: /* @__PURE__ */ M(function(e) {
819
- this.begin(e);
820
- }, "pushState"),
821
- stateStackSize: /* @__PURE__ */ M(function() {
822
- return this.conditionStack.length;
823
- }, "stateStackSize"),
824
- options: {},
825
- performAction: /* @__PURE__ */ M(function(e, t, n, r) {
826
- switch (n) {
827
- case 0: return e.getLogger().debug("Found block-beta"), 10;
828
- case 1: return e.getLogger().debug("Found id-block"), 29;
829
- case 2: return e.getLogger().debug("Found block"), 10;
830
- case 3:
831
- e.getLogger().debug(".", t.yytext);
832
- break;
833
- case 4:
834
- e.getLogger().debug("_", t.yytext);
835
- break;
836
- case 5: return 5;
837
- case 6: return t.yytext = -1, 28;
838
- case 7: return t.yytext = t.yytext.replace(/columns\s+/, ""), e.getLogger().debug("COLUMNS (LEX)", t.yytext), 28;
839
- case 8:
840
- this.pushState("md_string");
841
- break;
842
- case 9: return "MD_STR";
843
- case 10:
844
- this.popState();
845
- break;
846
- case 11:
847
- this.pushState("string");
848
- break;
849
- case 12:
850
- e.getLogger().debug("LEX: POPPING STR:", t.yytext), this.popState();
851
- break;
852
- case 13: return e.getLogger().debug("LEX: STR end:", t.yytext), "STR";
853
- case 14: return t.yytext = t.yytext.replace(/space\:/, ""), e.getLogger().debug("SPACE NUM (LEX)", t.yytext), 21;
854
- case 15: return t.yytext = "1", e.getLogger().debug("COLUMNS (LEX)", t.yytext), 21;
855
- case 16: return 42;
856
- case 17: return "LINKSTYLE";
857
- case 18: return "INTERPOLATE";
858
- case 19: return this.pushState("CLASSDEF"), 39;
859
- case 20: return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
860
- case 21: return this.popState(), this.pushState("CLASSDEFID"), 40;
861
- case 22: return this.popState(), 41;
862
- case 23: return this.pushState("CLASS"), 43;
863
- case 24: return this.popState(), this.pushState("CLASS_STYLE"), 44;
864
- case 25: return this.popState(), 45;
865
- case 26: return this.pushState("STYLE_STMNT"), 46;
866
- case 27: return this.popState(), this.pushState("STYLE_DEFINITION"), 47;
867
- case 28: return this.popState(), 48;
868
- case 29: return this.pushState("acc_title"), "acc_title";
869
- case 30: return this.popState(), "acc_title_value";
870
- case 31: return this.pushState("acc_descr"), "acc_descr";
871
- case 32: return this.popState(), "acc_descr_value";
872
- case 33:
873
- this.pushState("acc_descr_multiline");
874
- break;
875
- case 34:
876
- this.popState();
877
- break;
878
- case 35: return "acc_descr_multiline_value";
879
- case 36: return 30;
880
- case 37: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
881
- case 38: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
882
- case 39: return this.popState(), e.getLogger().debug("Lex: ))"), "NODE_DEND";
883
- case 40: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
884
- case 41: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
885
- case 42: return this.popState(), e.getLogger().debug("Lex: (-"), "NODE_DEND";
886
- case 43: return this.popState(), e.getLogger().debug("Lex: -)"), "NODE_DEND";
887
- case 44: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
888
- case 45: return this.popState(), e.getLogger().debug("Lex: ]]"), "NODE_DEND";
889
- case 46: return this.popState(), e.getLogger().debug("Lex: ("), "NODE_DEND";
890
- case 47: return this.popState(), e.getLogger().debug("Lex: ])"), "NODE_DEND";
891
- case 48: return this.popState(), e.getLogger().debug("Lex: /]"), "NODE_DEND";
892
- case 49: return this.popState(), e.getLogger().debug("Lex: /]"), "NODE_DEND";
893
- case 50: return this.popState(), e.getLogger().debug("Lex: )]"), "NODE_DEND";
894
- case 51: return this.popState(), e.getLogger().debug("Lex: )"), "NODE_DEND";
895
- case 52: return this.popState(), e.getLogger().debug("Lex: ]>"), "NODE_DEND";
896
- case 53: return this.popState(), e.getLogger().debug("Lex: ]"), "NODE_DEND";
897
- case 54: return e.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 35;
898
- case 55: return e.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 35;
899
- case 56: return e.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 35;
900
- case 57: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
901
- case 58: return e.getLogger().debug("Lex: ((("), this.pushState("NODE"), 35;
902
- case 59: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
903
- case 60: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
904
- case 61: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
905
- case 62: return e.getLogger().debug("Lexc: >"), this.pushState("NODE"), 35;
906
- case 63: return e.getLogger().debug("Lexa: (["), this.pushState("NODE"), 35;
907
- case 64: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
908
- case 65: return this.pushState("NODE"), 35;
909
- case 66: return this.pushState("NODE"), 35;
910
- case 67: return this.pushState("NODE"), 35;
911
- case 68: return this.pushState("NODE"), 35;
912
- case 69: return this.pushState("NODE"), 35;
913
- case 70: return this.pushState("NODE"), 35;
914
- case 71: return this.pushState("NODE"), 35;
915
- case 72: return e.getLogger().debug("Lexa: ["), this.pushState("NODE"), 35;
916
- case 73: return this.pushState("BLOCK_ARROW"), e.getLogger().debug("LEX ARR START"), 37;
917
- case 74: return e.getLogger().debug("Lex: NODE_ID", t.yytext), 31;
918
- case 75: return e.getLogger().debug("Lex: EOF", t.yytext), 8;
919
- case 76:
920
- this.pushState("md_string");
921
- break;
922
- case 77:
923
- this.pushState("md_string");
924
- break;
925
- case 78: return "NODE_DESCR";
926
- case 79:
927
- this.popState();
928
- break;
929
- case 80:
930
- e.getLogger().debug("Lex: Starting string"), this.pushState("string");
931
- break;
932
- case 81:
933
- e.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
934
- break;
935
- case 82: return e.getLogger().debug("LEX: NODE_DESCR:", t.yytext), "NODE_DESCR";
936
- case 83:
937
- e.getLogger().debug("LEX POPPING"), this.popState();
938
- break;
939
- case 84:
940
- e.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
941
- break;
942
- case 85: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (right): dir:", t.yytext), "DIR";
943
- case 86: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (left):", t.yytext), "DIR";
944
- case 87: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (x):", t.yytext), "DIR";
945
- case 88: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (y):", t.yytext), "DIR";
946
- case 89: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (up):", t.yytext), "DIR";
947
- case 90: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (down):", t.yytext), "DIR";
948
- case 91: return t.yytext = "]>", e.getLogger().debug("Lex (ARROW_DIR end):", t.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
949
- case 92: return e.getLogger().debug("Lex: LINK", "#" + t.yytext + "#"), 15;
950
- case 93: return e.getLogger().debug("Lex: LINK", t.yytext), 15;
951
- case 94: return e.getLogger().debug("Lex: LINK", t.yytext), 15;
952
- case 95: return e.getLogger().debug("Lex: LINK", t.yytext), 15;
953
- case 96: return e.getLogger().debug("Lex: START_LINK", t.yytext), this.pushState("LLABEL"), 16;
954
- case 97: return e.getLogger().debug("Lex: START_LINK", t.yytext), this.pushState("LLABEL"), 16;
955
- case 98: return e.getLogger().debug("Lex: START_LINK", t.yytext), this.pushState("LLABEL"), 16;
956
- case 99:
957
- this.pushState("md_string");
958
- break;
959
- case 100: return e.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
960
- case 101: return this.popState(), e.getLogger().debug("Lex: LINK", "#" + t.yytext + "#"), 15;
961
- case 102: return this.popState(), e.getLogger().debug("Lex: LINK", t.yytext), 15;
962
- case 103: return this.popState(), e.getLogger().debug("Lex: LINK", t.yytext), 15;
963
- case 104: return e.getLogger().debug("Lex: COLON", t.yytext), t.yytext = t.yytext.slice(1), 27;
964
- }
965
- }, "anonymous"),
966
- rules: [
967
- /^(?:block-beta\b)/,
968
- /^(?:block:)/,
969
- /^(?:block\b)/,
970
- /^(?:[\s]+)/,
971
- /^(?:[\n]+)/,
972
- /^(?:((\u000D\u000A)|(\u000A)))/,
973
- /^(?:columns\s+auto\b)/,
974
- /^(?:columns\s+[\d]+)/,
975
- /^(?:["][`])/,
976
- /^(?:[^`"]+)/,
977
- /^(?:[`]["])/,
978
- /^(?:["])/,
979
- /^(?:["])/,
980
- /^(?:[^"]*)/,
981
- /^(?:space[:]\d+)/,
982
- /^(?:space\b)/,
983
- /^(?:default\b)/,
984
- /^(?:linkStyle\b)/,
985
- /^(?:interpolate\b)/,
986
- /^(?:classDef\s+)/,
987
- /^(?:DEFAULT\s+)/,
988
- /^(?:\w+\s+)/,
989
- /^(?:[^\n]*)/,
990
- /^(?:class\s+)/,
991
- /^(?:(\w+)+((,\s*\w+)*))/,
992
- /^(?:[^\n]*)/,
993
- /^(?:style\s+)/,
994
- /^(?:(\w+)+((,\s*\w+)*))/,
995
- /^(?:[^\n]*)/,
996
- /^(?:accTitle\s*:\s*)/,
997
- /^(?:(?!\n||)*[^\n]*)/,
998
- /^(?:accDescr\s*:\s*)/,
999
- /^(?:(?!\n||)*[^\n]*)/,
1000
- /^(?:accDescr\s*\{\s*)/,
1001
- /^(?:[\}])/,
1002
- /^(?:[^\}]*)/,
1003
- /^(?:end\b\s*)/,
1004
- /^(?:\(\(\()/,
1005
- /^(?:\)\)\))/,
1006
- /^(?:[\)]\))/,
1007
- /^(?:\}\})/,
1008
- /^(?:\})/,
1009
- /^(?:\(-)/,
1010
- /^(?:-\))/,
1011
- /^(?:\(\()/,
1012
- /^(?:\]\])/,
1013
- /^(?:\()/,
1014
- /^(?:\]\))/,
1015
- /^(?:\\\])/,
1016
- /^(?:\/\])/,
1017
- /^(?:\)\])/,
1018
- /^(?:[\)])/,
1019
- /^(?:\]>)/,
1020
- /^(?:[\]])/,
1021
- /^(?:-\))/,
1022
- /^(?:\(-)/,
1023
- /^(?:\)\))/,
1024
- /^(?:\))/,
1025
- /^(?:\(\(\()/,
1026
- /^(?:\(\()/,
1027
- /^(?:\{\{)/,
1028
- /^(?:\{)/,
1029
- /^(?:>)/,
1030
- /^(?:\(\[)/,
1031
- /^(?:\()/,
1032
- /^(?:\[\[)/,
1033
- /^(?:\[\|)/,
1034
- /^(?:\[\()/,
1035
- /^(?:\)\)\))/,
1036
- /^(?:\[\\)/,
1037
- /^(?:\[\/)/,
1038
- /^(?:\[\\)/,
1039
- /^(?:\[)/,
1040
- /^(?:<\[)/,
1041
- /^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,
1042
- /^(?:$)/,
1043
- /^(?:["][`])/,
1044
- /^(?:["][`])/,
1045
- /^(?:[^`"]+)/,
1046
- /^(?:[`]["])/,
1047
- /^(?:["])/,
1048
- /^(?:["])/,
1049
- /^(?:[^"]+)/,
1050
- /^(?:["])/,
1051
- /^(?:\]>\s*\()/,
1052
- /^(?:,?\s*right\s*)/,
1053
- /^(?:,?\s*left\s*)/,
1054
- /^(?:,?\s*x\s*)/,
1055
- /^(?:,?\s*y\s*)/,
1056
- /^(?:,?\s*up\s*)/,
1057
- /^(?:,?\s*down\s*)/,
1058
- /^(?:\)\s*)/,
1059
- /^(?:\s*[xo<]?--+[-xo>]\s*)/,
1060
- /^(?:\s*[xo<]?==+[=xo>]\s*)/,
1061
- /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,
1062
- /^(?:\s*~~[\~]+\s*)/,
1063
- /^(?:\s*[xo<]?--\s*)/,
1064
- /^(?:\s*[xo<]?==\s*)/,
1065
- /^(?:\s*[xo<]?-\.\s*)/,
1066
- /^(?:["][`])/,
1067
- /^(?:["])/,
1068
- /^(?:\s*[xo<]?--+[-xo>]\s*)/,
1069
- /^(?:\s*[xo<]?==+[=xo>]\s*)/,
1070
- /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,
1071
- /^(?::\d+)/
1072
- ],
1073
- conditions: {
1074
- STYLE_DEFINITION: {
1075
- rules: [28],
1076
- inclusive: !1
1077
- },
1078
- STYLE_STMNT: {
1079
- rules: [27],
1080
- inclusive: !1
1081
- },
1082
- CLASSDEFID: {
1083
- rules: [22],
1084
- inclusive: !1
1085
- },
1086
- CLASSDEF: {
1087
- rules: [20, 21],
1088
- inclusive: !1
1089
- },
1090
- CLASS_STYLE: {
1091
- rules: [25],
1092
- inclusive: !1
1093
- },
1094
- CLASS: {
1095
- rules: [24],
1096
- inclusive: !1
1097
- },
1098
- LLABEL: {
1099
- rules: [
1100
- 99,
1101
- 100,
1102
- 101,
1103
- 102,
1104
- 103
1105
- ],
1106
- inclusive: !1
1107
- },
1108
- ARROW_DIR: {
1109
- rules: [
1110
- 85,
1111
- 86,
1112
- 87,
1113
- 88,
1114
- 89,
1115
- 90,
1116
- 91
1117
- ],
1118
- inclusive: !1
1119
- },
1120
- BLOCK_ARROW: {
1121
- rules: [
1122
- 76,
1123
- 81,
1124
- 84
1125
- ],
1126
- inclusive: !1
1127
- },
1128
- NODE: {
1129
- rules: [
1130
- 37,
1131
- 38,
1132
- 39,
1133
- 40,
1134
- 41,
1135
- 42,
1136
- 43,
1137
- 44,
1138
- 45,
1139
- 46,
1140
- 47,
1141
- 48,
1142
- 49,
1143
- 50,
1144
- 51,
1145
- 52,
1146
- 53,
1147
- 77,
1148
- 80
1149
- ],
1150
- inclusive: !1
1151
- },
1152
- md_string: {
1153
- rules: [
1154
- 9,
1155
- 10,
1156
- 78,
1157
- 79
1158
- ],
1159
- inclusive: !1
1160
- },
1161
- space: {
1162
- rules: [],
1163
- inclusive: !1
1164
- },
1165
- string: {
1166
- rules: [
1167
- 12,
1168
- 13,
1169
- 82,
1170
- 83
1171
- ],
1172
- inclusive: !1
1173
- },
1174
- acc_descr_multiline: {
1175
- rules: [34, 35],
1176
- inclusive: !1
1177
- },
1178
- acc_descr: {
1179
- rules: [32],
1180
- inclusive: !1
1181
- },
1182
- acc_title: {
1183
- rules: [30],
1184
- inclusive: !1
1185
- },
1186
- INITIAL: {
1187
- rules: [
1188
- 0,
1189
- 1,
1190
- 2,
1191
- 3,
1192
- 4,
1193
- 5,
1194
- 6,
1195
- 7,
1196
- 8,
1197
- 11,
1198
- 14,
1199
- 15,
1200
- 16,
1201
- 17,
1202
- 18,
1203
- 19,
1204
- 23,
1205
- 26,
1206
- 29,
1207
- 31,
1208
- 33,
1209
- 36,
1210
- 54,
1211
- 55,
1212
- 56,
1213
- 57,
1214
- 58,
1215
- 59,
1216
- 60,
1217
- 61,
1218
- 62,
1219
- 63,
1220
- 64,
1221
- 65,
1222
- 66,
1223
- 67,
1224
- 68,
1225
- 69,
1226
- 70,
1227
- 71,
1228
- 72,
1229
- 73,
1230
- 74,
1231
- 75,
1232
- 92,
1233
- 93,
1234
- 94,
1235
- 95,
1236
- 96,
1237
- 97,
1238
- 98,
1239
- 104
1240
- ],
1241
- inclusive: !0
1242
- }
1243
- }
1244
- };
1245
- })();
1246
- function _() {
1247
- this.yy = {};
1248
- }
1249
- return M(_, "Parser"), _.prototype = g, g.Parser = _, new _();
1250
- })();
1251
- L.parser = L;
1252
- var be = L, R = /* @__PURE__ */ new Map(), z = [], xe = /* @__PURE__ */ new Map(), Se = "color", Ce = "fill", we = "bgFill", Te = ",", B = /* @__PURE__ */ new Map(), Ee = "", De = /* @__PURE__ */ M((e) => ae.sanitizeText(e, F()), "sanitizeText"), Oe = /* @__PURE__ */ M(function(e, t = "") {
1253
- let n = B.get(e);
1254
- n || (n = {
1255
- id: e,
1256
- styles: [],
1257
- textStyles: []
1258
- }, B.set(e, n)), t?.split(Te).forEach((e) => {
1259
- let t = e.replace(/([^;]*);/, "$1").trim();
1260
- if (RegExp(Se).exec(e)) {
1261
- let e = t.replace(Ce, we).replace(Se, Ce);
1262
- n.textStyles.push(e);
1263
- }
1264
- n.styles.push(t);
1265
- });
1266
- }, "addStyleClass"), ke = /* @__PURE__ */ M(function(e, t = "") {
1267
- let n = R.get(e);
1268
- t != null && (n.styles = t.split(Te));
1269
- }, "addStyle2Node"), Ae = /* @__PURE__ */ M(function(e, t) {
1270
- e.split(",").forEach(function(e) {
1271
- let n = R.get(e);
1272
- if (n === void 0) {
1273
- let t = e.trim();
1274
- n = {
1275
- id: t,
1276
- type: "na",
1277
- children: []
1278
- }, R.set(t, n);
1279
- }
1280
- n.classes || (n.classes = []), n.classes.push(t);
1281
- });
1282
- }, "setCssClass"), je = /* @__PURE__ */ M((e, t) => {
1283
- let n = e.flat(), r = [], i = n.find((e) => e?.type === "column-setting")?.columns ?? -1;
1284
- for (let e of n) {
1285
- if (typeof i == "number" && i > 0 && e.type !== "column-setting" && typeof e.widthInColumns == "number" && e.widthInColumns > i && A.warn(`Block ${e.id} width ${e.widthInColumns} exceeds configured column width ${i}`), e.label &&= De(e.label), e.type === "classDef") {
1286
- Oe(e.id, e.css);
1287
- continue;
1288
- }
1289
- if (e.type === "applyClass") {
1290
- Ae(e.id, e?.styleClass ?? "");
1291
- continue;
1292
- }
1293
- if (e.type === "applyStyles") {
1294
- e?.stylesStr && ke(e.id, e?.stylesStr);
1295
- continue;
1296
- }
1297
- if (e.type === "column-setting") t.columns = e.columns ?? -1;
1298
- else if (e.type === "edge") {
1299
- let t = (xe.get(e.id) ?? 0) + 1;
1300
- xe.set(e.id, t), e.id = t + "-" + e.id, z.push(e);
1301
- } else {
1302
- e.label ||= e.type === "composite" ? "" : e.id;
1303
- let t = R.get(e.id);
1304
- if (t === void 0 ? R.set(e.id, e) : (e.type !== "na" && (t.type = e.type), e.label !== e.id && (t.label = e.label)), e.children && je(e.children, e), e.type === "space") {
1305
- let t = e.width ?? 1;
1306
- for (let n = 0; n < t; n++) {
1307
- let t = me(e);
1308
- t.id = t.id + "-" + n, R.set(t.id, t), r.push(t);
1309
- }
1310
- } else t === void 0 && r.push(e);
1311
- }
1312
- }
1313
- t.children = r;
1314
- }, "populateBlockDatabase"), Me = [], V = {
1315
- id: "root",
1316
- type: "composite",
1317
- children: [],
1318
- columns: -1
1319
- }, Ne = /* @__PURE__ */ M(() => {
1320
- A.debug("Clear called"), ne(), V = {
1321
- id: "root",
1322
- type: "composite",
1323
- children: [],
1324
- columns: -1
1325
- }, R = /* @__PURE__ */ new Map([["root", V]]), Me = [], B = /* @__PURE__ */ new Map(), z = [], xe = /* @__PURE__ */ new Map(), Ee = "";
1326
- }, "clear");
1327
- function Pe(e) {
1328
- switch (A.debug("typeStr2Type", e), e) {
1329
- case "[]": return "square";
1330
- case "()": return A.debug("we have a round"), "round";
1331
- case "(())": return "circle";
1332
- case ">]": return "rect_left_inv_arrow";
1333
- case "{}": return "diamond";
1334
- case "{{}}": return "hexagon";
1335
- case "([])": return "stadium";
1336
- case "[[]]": return "subroutine";
1337
- case "[()]": return "cylinder";
1338
- case "((()))": return "doublecircle";
1339
- case "[//]": return "lean_right";
1340
- case "[\\\\]": return "lean_left";
1341
- case "[/\\]": return "trapezoid";
1342
- case "[\\/]": return "inv_trapezoid";
1343
- case "<[]>": return "block_arrow";
1344
- default: return "na";
1345
- }
1346
- }
1347
- M(Pe, "typeStr2Type");
1348
- function Fe(e) {
1349
- switch (A.debug("typeStr2Type", e), e) {
1350
- case "==": return "thick";
1351
- default: return "normal";
1352
- }
1353
- }
1354
- M(Fe, "edgeTypeStr2Type");
1355
- function Ie(e) {
1356
- switch (e.trim().slice(-1)) {
1357
- case "x": return "arrow_cross";
1358
- case "o": return "arrow_circle";
1359
- case ">": return "arrow_point";
1360
- default: return "";
1361
- }
1362
- }
1363
- M(Ie, "edgeStrToEdgeData");
1364
- function Le(e) {
1365
- switch (e.trim().charAt(0)) {
1366
- case "x": return "arrow_cross";
1367
- case "o": return "arrow_circle";
1368
- case "<": return "arrow_point";
1369
- default: return "arrow_open";
1370
- }
1371
- }
1372
- M(Le, "edgeStrToEdgeStartData");
1373
- function Re(e) {
1374
- return e.includes("==") ? "thick" : "normal";
1375
- }
1376
- M(Re, "edgeStrToThickness");
1377
- function ze(e) {
1378
- return e.includes(".-") ? "dotted" : "solid";
1379
- }
1380
- M(ze, "edgeStrToPattern");
1381
- var Be = 0, Ve = {
1382
- getConfig: /* @__PURE__ */ M(() => P().block, "getConfig"),
1383
- typeStr2Type: Pe,
1384
- edgeTypeStr2Type: Fe,
1385
- edgeStrToEdgeData: Ie,
1386
- edgeStrToEdgeStartData: Le,
1387
- edgeStrToThickness: Re,
1388
- edgeStrToPattern: ze,
1389
- getLogger: /* @__PURE__ */ M(() => A, "getLogger"),
1390
- getBlocksFlat: /* @__PURE__ */ M(() => [...R.values()], "getBlocksFlat"),
1391
- getBlocks: /* @__PURE__ */ M(() => Me || [], "getBlocks"),
1392
- getEdges: /* @__PURE__ */ M(() => z, "getEdges"),
1393
- setHierarchy: /* @__PURE__ */ M((e) => {
1394
- V.children = e, je(e, V), Me = V.children;
1395
- }, "setHierarchy"),
1396
- getBlock: /* @__PURE__ */ M((e) => R.get(e), "getBlock"),
1397
- setBlock: /* @__PURE__ */ M((e) => {
1398
- R.set(e.id, e);
1399
- }, "setBlock"),
1400
- getColumns: /* @__PURE__ */ M((e) => {
1401
- let t = R.get(e);
1402
- return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1;
1403
- }, "getColumns"),
1404
- getClasses: /* @__PURE__ */ M(function() {
1405
- return B;
1406
- }, "getClasses"),
1407
- clear: Ne,
1408
- generateId: /* @__PURE__ */ M(() => (Be++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + Be), "generateId"),
1409
- setDiagramId: /* @__PURE__ */ M((e) => {
1410
- Ee = e;
1411
- }, "setDiagramId"),
1412
- getDiagramId: /* @__PURE__ */ M(() => Ee, "getDiagramId")
1413
- }, He = /* @__PURE__ */ M((e, t) => {
1414
- let n = se, r = n(e, "r"), i = n(e, "g"), a = n(e, "b");
1415
- return ie(r, i, a, t);
1416
- }, "fade"), Ue = /* @__PURE__ */ M((e) => `.label {
1417
- font-family: ${e.fontFamily};
1418
- color: ${e.nodeTextColor || e.textColor};
1419
- }
1420
- .cluster-label text {
1421
- fill: ${e.titleColor};
1422
- }
1423
- .cluster-label span,p {
1424
- color: ${e.titleColor};
1425
- }
1426
-
1427
-
1428
-
1429
- .label text,span,p {
1430
- fill: ${e.nodeTextColor || e.textColor};
1431
- color: ${e.nodeTextColor || e.textColor};
1432
- }
1433
-
1434
- .node rect,
1435
- .node circle,
1436
- .node ellipse,
1437
- .node polygon,
1438
- .node path {
1439
- fill: ${e.mainBkg};
1440
- stroke: ${e.nodeBorder};
1441
- stroke-width: 1px;
1442
- }
1443
- .flowchart-label text {
1444
- text-anchor: middle;
1445
- }
1446
- // .flowchart-label .text-outer-tspan {
1447
- // text-anchor: middle;
1448
- // }
1449
- // .flowchart-label .text-inner-tspan {
1450
- // text-anchor: start;
1451
- // }
1452
-
1453
- .node .label {
1454
- text-align: center;
1455
- }
1456
- .node.clickable {
1457
- cursor: pointer;
1458
- }
1459
-
1460
- .arrowheadPath {
1461
- fill: ${e.arrowheadColor};
1462
- }
1463
-
1464
- .edgePath .path {
1465
- stroke: ${e.lineColor};
1466
- stroke-width: 2.0px;
1467
- }
1468
-
1469
- .flowchart-link {
1470
- stroke: ${e.lineColor};
1471
- fill: none;
1472
- }
1473
-
1474
- .edgeLabel {
1475
- background-color: ${e.edgeLabelBackground};
1476
- /*
1477
- * This is for backward compatibility with existing code that didn't
1478
- * add a \`<p>\` around edge labels.
1479
- *
1480
- * TODO: We should probably remove this in a future release.
1481
- */
1482
- p {
1483
- margin: 0;
1484
- padding: 0;
1485
- display: inline;
1486
- }
1487
- rect {
1488
- opacity: 0.5;
1489
- background-color: ${e.edgeLabelBackground};
1490
- fill: ${e.edgeLabelBackground};
1491
- }
1492
- text-align: center;
1493
- }
1494
-
1495
- /* For html labels only */
1496
- .labelBkg {
1497
- background-color: ${e.edgeLabelBackground};
1498
- }
1499
-
1500
- .node .cluster {
1501
- // fill: ${He(e.mainBkg, .5)};
1502
- fill: ${He(e.clusterBkg, .5)};
1503
- stroke: ${He(e.clusterBorder, .2)};
1504
- box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
1505
- stroke-width: 1px;
1506
- }
1507
-
1508
- .cluster text {
1509
- fill: ${e.titleColor};
1510
- }
1511
-
1512
- .cluster span,p {
1513
- color: ${e.titleColor};
1514
- }
1515
- /* .cluster div {
1516
- color: ${e.titleColor};
1517
- } */
1518
-
1519
- div.mermaidTooltip {
1520
- position: absolute;
1521
- text-align: center;
1522
- max-width: 200px;
1523
- padding: 2px;
1524
- font-family: ${e.fontFamily};
1525
- font-size: 12px;
1526
- background: ${e.tertiaryColor};
1527
- border: 1px solid ${e.border2};
1528
- border-radius: 2px;
1529
- pointer-events: none;
1530
- z-index: 100;
1531
- }
1532
-
1533
- .flowchartTitleText {
1534
- text-anchor: middle;
1535
- font-size: 18px;
1536
- fill: ${e.textColor};
1537
- }
1538
- ${fe()}
1539
- `, "getStyles"), We = /* @__PURE__ */ M((e, t, n, r) => {
1540
- t.forEach((t) => {
1541
- Ge[t](e, n, r);
1542
- });
1543
- }, "insertMarkers"), Ge = {
1544
- extension: /* @__PURE__ */ M((e, t, n) => {
1545
- A.trace("Making markers for ", n), e.append("defs").append("marker").attr("id", n + "_" + t + "-extensionStart").attr("class", "marker extension " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", n + "_" + t + "-extensionEnd").attr("class", "marker extension " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
1546
- }, "extension"),
1547
- composition: /* @__PURE__ */ M((e, t, n) => {
1548
- e.append("defs").append("marker").attr("id", n + "_" + t + "-compositionStart").attr("class", "marker composition " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", n + "_" + t + "-compositionEnd").attr("class", "marker composition " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
1549
- }, "composition"),
1550
- aggregation: /* @__PURE__ */ M((e, t, n) => {
1551
- e.append("defs").append("marker").attr("id", n + "_" + t + "-aggregationStart").attr("class", "marker aggregation " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", n + "_" + t + "-aggregationEnd").attr("class", "marker aggregation " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
1552
- }, "aggregation"),
1553
- dependency: /* @__PURE__ */ M((e, t, n) => {
1554
- e.append("defs").append("marker").attr("id", n + "_" + t + "-dependencyStart").attr("class", "marker dependency " + t).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", n + "_" + t + "-dependencyEnd").attr("class", "marker dependency " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
1555
- }, "dependency"),
1556
- lollipop: /* @__PURE__ */ M((e, t, n) => {
1557
- e.append("defs").append("marker").attr("id", n + "_" + t + "-lollipopStart").attr("class", "marker lollipop " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6), e.append("defs").append("marker").attr("id", n + "_" + t + "-lollipopEnd").attr("class", "marker lollipop " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
1558
- }, "lollipop"),
1559
- point: /* @__PURE__ */ M((e, t, n) => {
1560
- e.append("marker").attr("id", n + "_" + t + "-pointEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 6).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", n + "_" + t + "-pointStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
1561
- }, "point"),
1562
- circle: /* @__PURE__ */ M((e, t, n) => {
1563
- e.append("marker").attr("id", n + "_" + t + "-circleEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", n + "_" + t + "-circleStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
1564
- }, "circle"),
1565
- cross: /* @__PURE__ */ M((e, t, n) => {
1566
- e.append("marker").attr("id", n + "_" + t + "-crossEnd").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", n + "_" + t + "-crossStart").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
1567
- }, "cross"),
1568
- barb: /* @__PURE__ */ M((e, t, n) => {
1569
- e.append("defs").append("marker").attr("id", n + "_" + t + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
1570
- }, "barb")
1571
- }, Ke = We;
1572
- function qe(e, t) {
1573
- if (e === 0 || !Number.isInteger(e)) throw Error("Columns must be an integer !== 0.");
1574
- if (t < 0 || !Number.isInteger(t)) throw Error("Position must be a non-negative integer." + t);
1575
- return e < 0 ? {
1576
- px: t,
1577
- py: 0
1578
- } : e === 1 ? {
1579
- px: 0,
1580
- py: t
1581
- } : {
1582
- px: t % e,
1583
- py: Math.floor(t / e)
1584
- };
1585
- }
1586
- M(qe, "calculateBlockPosition");
1587
- var Je = /* @__PURE__ */ M((e) => {
1588
- let t = 0, n = 0;
1589
- for (let r of e.children) {
1590
- let { width: e, height: i, x: a, y: o } = r.size ?? {
1591
- width: 0,
1592
- height: 0,
1593
- x: 0,
1594
- y: 0
1595
- };
1596
- if (A.debug("getMaxChildSize abc95 child:", r.id, "width:", e, "height:", i, "x:", a, "y:", o, r.type), r.type === "space") continue;
1597
- let s = e / (r.widthInColumns ?? 1);
1598
- s > t && (t = s), i > n && (n = i);
1599
- }
1600
- return {
1601
- width: t,
1602
- height: n
1603
- };
1604
- }, "getMaxChildSize");
1605
- function H(e, t, n = 0, r = 0, i = 8) {
1606
- A.debug("setBlockSizes abc95 (start)", e.id, e?.size?.x, "block width =", e?.size, "siblingWidth", n), e?.size?.width || (e.size = {
1607
- width: n,
1608
- height: r,
1609
- x: 0,
1610
- y: 0
1611
- });
1612
- let a = 0, o = 0;
1613
- if (e.children?.length > 0) {
1614
- for (let n of e.children) H(n, t, 0, 0, i);
1615
- let s = Je(e);
1616
- a = s.width, o = s.height, A.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", a, o);
1617
- for (let t of e.children) t.size && (A.debug(`abc95 Setting size of children of ${e.id} id=${t.id} ${a} ${o} ${JSON.stringify(t.size)}`), t.size.width = a * (t.widthInColumns ?? 1) + i * ((t.widthInColumns ?? 1) - 1), t.size.height = o, t.size.x = 0, t.size.y = 0, A.debug(`abc95 updating size of ${e.id} children child:${t.id} maxWidth:${a} maxHeight:${o}`));
1618
- for (let n of e.children) H(n, t, a, o, i);
1619
- let c = e.columns ?? -1, l = 0;
1620
- for (let t of e.children) l += t.widthInColumns ?? 1;
1621
- let u = e.children.length;
1622
- c > 0 && c < l && (u = c);
1623
- let d = Math.ceil(l / u), f = u * (a + i) + i, p = d * (o + i) + i;
1624
- if (f < n) {
1625
- A.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${n} siblingHeight ${r} width ${f}`), f = n, p = r;
1626
- let t = (n - u * i - i) / u, s = (r - d * i - i) / d;
1627
- A.debug("Size indata abc88", e.id, "childWidth", t, "maxWidth", a), A.debug("Size indata abc88", e.id, "childHeight", s, "maxHeight", o), A.debug("Size indata abc88 xSize", u, "padding", i);
1628
- for (let n of e.children) n.size && (n.size.width = t, n.size.height = s, n.size.x = 0, n.size.y = 0);
1629
- }
1630
- if (A.debug(`abc95 (finale calc) ${e.id} xSize ${u} ySize ${d} columns ${c}${e.children.length} width=${Math.max(f, e.size?.width || 0)}`), f < (e?.size?.width || 0)) {
1631
- f = e?.size?.width || 0;
1632
- let t = c > 0 ? Math.min(e.children.length, c) : e.children.length;
1633
- if (t > 0) {
1634
- let n = (f - t * i - i) / t;
1635
- A.debug("abc95 (growing to fit) width", e.id, f, e.size?.width, n);
1636
- for (let t of e.children) t.size && (t.size.width = n);
1637
- }
1638
- }
1639
- e.size = {
1640
- width: f,
1641
- height: p,
1642
- x: 0,
1643
- y: 0
1644
- };
1645
- }
1646
- A.debug("setBlockSizes abc94 (done)", e.id, e?.size?.x, e?.size?.width, e?.size?.y, e?.size?.height);
1647
- }
1648
- M(H, "setBlockSizes");
1649
- function Ye(e, t, n = 8) {
1650
- A.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);
1651
- let r = e.columns ?? -1;
1652
- if (A.debug("layoutBlocks columns abc95", e.id, "=>", r, e), e.children && e.children.length > 0) {
1653
- let i = e?.children[0]?.size?.width ?? 0, a = e.children.length * i + (e.children.length - 1) * n;
1654
- A.debug("widthOfChildren 88", a, "posX");
1655
- let o = /* @__PURE__ */ new Map();
1656
- {
1657
- let t = 0;
1658
- for (let n of e.children) {
1659
- if (!n.size) continue;
1660
- let { py: e } = qe(r, t), i = o.get(e) ?? 0;
1661
- n.size.height > i && o.set(e, n.size.height);
1662
- let a = n?.widthInColumns ?? 1;
1663
- r > 0 && (a = Math.min(a, r - t % r)), t += a;
1664
- }
1665
- }
1666
- let s = /* @__PURE__ */ new Map();
1667
- {
1668
- let e = 0, t = [...o.keys()].sort((e, t) => e - t);
1669
- for (let r of t) s.set(r, e), e += (o.get(r) ?? 0) + n;
1670
- }
1671
- let c = 0;
1672
- A.debug("abc91 block?.size?.x", e.id, e?.size?.x);
1673
- let l = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -n, u = 0;
1674
- for (let i of e.children) {
1675
- let a = e;
1676
- if (!i.size) continue;
1677
- let { width: d, height: f } = i.size, { px: p, py: m } = qe(r, c);
1678
- if (m != u && (u = m, l = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -n, A.debug("New row in layout for block", e.id, " and child ", i.id, u)), A.debug(`abc89 layout blocks (child) id: ${i.id} Pos: ${c} (px, py) ${p},${m} (${a?.size?.x},${a?.size?.y}) parent: ${a.id} width: ${d}${n}`), a.size) {
1679
- let e = d / 2;
1680
- i.size.x = l + n + e, A.debug(`abc91 layout blocks (calc) px, pyid:${i.id} startingPos=X${l} new startingPosX${i.size.x} ${e} padding=${n} width=${d} halfWidth=${e} => x:${i.size.x} y:${i.size.y} ${i.widthInColumns} (width * (child?.w || 1)) / 2 ${d * (i?.widthInColumns ?? 1) / 2}`), l = i.size.x + e;
1681
- let t = s.get(m) ?? 0, r = o.get(m) ?? f;
1682
- i.size.y = a.size.y - a.size.height / 2 + t + r / 2 + n, A.debug(`abc88 layout blocks (calc) px, pyid:${i.id}startingPosX${l}${n}${e}=>x:${i.size.x}y:${i.size.y}${i.widthInColumns}(width * (child?.w || 1)) / 2${d * (i?.widthInColumns ?? 1) / 2}`);
1683
- }
1684
- i.children && Ye(i, t, n);
1685
- let h = i?.widthInColumns ?? 1;
1686
- r > 0 && (h = Math.min(h, r - c % r)), c += h, A.debug("abc88 columnsPos", i, c);
1687
- }
1688
- }
1689
- A.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);
1690
- }
1691
- M(Ye, "layoutBlocks");
1692
- function Xe(e, { minX: t, minY: n, maxX: r, maxY: i } = {
1693
- minX: 0,
1694
- minY: 0,
1695
- maxX: 0,
1696
- maxY: 0
1697
- }) {
1698
- if (e.size && e.id !== "root") {
1699
- let { x: a, y: o, width: s, height: c } = e.size;
1700
- a - s / 2 < t && (t = a - s / 2), o - c / 2 < n && (n = o - c / 2), a + s / 2 > r && (r = a + s / 2), o + c / 2 > i && (i = o + c / 2);
1701
- }
1702
- if (e.children) for (let a of e.children) ({minX: t, minY: n, maxX: r, maxY: i} = Xe(a, {
1703
- minX: t,
1704
- minY: n,
1705
- maxX: r,
1706
- maxY: i
1707
- }));
1708
- return {
1709
- minX: t,
1710
- minY: n,
1711
- maxX: r,
1712
- maxY: i
1713
- };
1714
- }
1715
- M(Xe, "findBounds");
1716
- function Ze(e) {
1717
- let t = e.getBlock("root");
1718
- if (!t) return;
1719
- let n = F()?.block?.padding ?? 8;
1720
- H(t, e, 0, 0, n), Ye(t, e, n), A.debug("getBlocks", JSON.stringify(t, null, 2));
1721
- let { minX: r, minY: i, maxX: a, maxY: o } = Xe(t), s = o - i;
1722
- return {
1723
- x: r,
1724
- y: i,
1725
- width: a - r,
1726
- height: s
1727
- };
1728
- }
1729
- M(Ze, "layout");
1730
- var U = /* @__PURE__ */ M(async (e, t, n, r = !1, i = !1) => {
1731
- let a = t || "";
1732
- typeof a == "object" && (a = a[0]);
1733
- let o = F(), s = N(o);
1734
- return await ue(e, a, {
1735
- style: n,
1736
- isTitle: r,
1737
- useHtmlLabels: s,
1738
- markdown: !1,
1739
- isNode: i,
1740
- width: Infinity
1741
- }, o);
1742
- }, "createLabel"), Qe = /* @__PURE__ */ M((e, t, n, r, i) => {
1743
- t.arrowTypeStart && et(e, "start", t.arrowTypeStart, n, r, i), t.arrowTypeEnd && et(e, "end", t.arrowTypeEnd, n, r, i);
1744
- }, "addEdgeMarkers"), $e = {
1745
- arrow_cross: "cross",
1746
- arrow_point: "point",
1747
- arrow_barb: "barb",
1748
- arrow_circle: "circle",
1749
- aggregation: "aggregation",
1750
- extension: "extension",
1751
- composition: "composition",
1752
- dependency: "dependency",
1753
- lollipop: "lollipop"
1754
- }, et = /* @__PURE__ */ M((e, t, n, r, i, a) => {
1755
- let o = $e[n];
1756
- if (!o) {
1757
- A.warn(`Unknown arrow type: ${n}`);
1758
- return;
1759
- }
1760
- let s = t === "start" ? "Start" : "End";
1761
- e.attr(`marker-${t}`, `url(${r}#${i}_${a}-${o}${s})`);
1762
- }, "addEdgeMarker"), tt = {}, W = {}, nt = /* @__PURE__ */ M(async (e, t) => {
1763
- let n = F(), r = N(n), i = e.insert("g").attr("class", "edgeLabel"), a = i.insert("g").attr("class", "label"), o = t.labelType === "markdown", s = await ue(e, t.label, {
1764
- style: t.labelStyle,
1765
- useHtmlLabels: r,
1766
- addSvgBackground: o,
1767
- isNode: !1,
1768
- markdown: o,
1769
- width: o ? void 0 : Infinity
1770
- }, n);
1771
- a.node().appendChild(s);
1772
- let c = s.getBBox(), l = c;
1773
- if (r) {
1774
- let e = s.children[0], t = j(s);
1775
- c = e.getBoundingClientRect(), l = c, t.attr("width", c.width), t.attr("height", c.height);
1776
- } else {
1777
- let e = j(s).select("text").node();
1778
- e && typeof e.getBBox == "function" && (l = e.getBBox());
1779
- }
1780
- a.attr("transform", I(l, r)), tt[t.id] = i, t.width = c.width, t.height = c.height;
1781
- let u;
1782
- if (t.startLabelLeft) {
1783
- let n = e.insert("g").attr("class", "edgeTerminals"), i = n.insert("g").attr("class", "inner"), a = await U(i, t.startLabelLeft, t.labelStyle);
1784
- u = a;
1785
- let o = a.getBBox();
1786
- if (r) {
1787
- let e = a.children[0], t = j(a);
1788
- o = e.getBoundingClientRect(), t.attr("width", o.width), t.attr("height", o.height);
1789
- }
1790
- i.attr("transform", I(o, r)), W[t.id] || (W[t.id] = {}), W[t.id].startLeft = n, G(u, t.startLabelLeft);
1791
- }
1792
- if (t.startLabelRight) {
1793
- let n = e.insert("g").attr("class", "edgeTerminals"), i = n.insert("g").attr("class", "inner"), a = await U(i, t.startLabelRight, t.labelStyle);
1794
- u = a;
1795
- let o = a.getBBox();
1796
- if (r) {
1797
- let e = a.children[0], t = j(a);
1798
- o = e.getBoundingClientRect(), t.attr("width", o.width), t.attr("height", o.height);
1799
- }
1800
- i.attr("transform", I(o, r)), W[t.id] || (W[t.id] = {}), W[t.id].startRight = n, G(u, t.startLabelRight);
1801
- }
1802
- if (t.endLabelLeft) {
1803
- let n = e.insert("g").attr("class", "edgeTerminals"), i = n.insert("g").attr("class", "inner"), a = await U(n, t.endLabelLeft, t.labelStyle);
1804
- u = a;
1805
- let o = a.getBBox();
1806
- if (r) {
1807
- let e = a.children[0], t = j(a);
1808
- o = e.getBoundingClientRect(), t.attr("width", o.width), t.attr("height", o.height);
1809
- }
1810
- i.attr("transform", I(o, r)), W[t.id] || (W[t.id] = {}), W[t.id].endLeft = n, G(u, t.endLabelLeft);
1811
- }
1812
- if (t.endLabelRight) {
1813
- let n = e.insert("g").attr("class", "edgeTerminals"), i = n.insert("g").attr("class", "inner"), a = await U(n, t.endLabelRight, t.labelStyle);
1814
- u = a;
1815
- let o = a.getBBox();
1816
- if (r) {
1817
- let e = a.children[0], t = j(a);
1818
- o = e.getBoundingClientRect(), t.attr("width", o.width), t.attr("height", o.height);
1819
- }
1820
- i.attr("transform", I(o, r)), W[t.id] || (W[t.id] = {}), W[t.id].endRight = n, G(u, t.endLabelRight);
1821
- }
1822
- return s;
1823
- }, "insertEdgeLabel");
1824
- function G(e, t) {
1825
- N(F()) && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px");
1826
- }
1827
- M(G, "setTerminalWidth");
1828
- var rt = /* @__PURE__ */ M((e, t) => {
1829
- A.debug("Moving label abc88 ", e.id, e.label, tt[e.id], t);
1830
- let n = t.updatedPath ? t.updatedPath : t.originalPath, r = F(), { subGraphTitleTotalMargin: i } = ce(r);
1831
- if (e.label) {
1832
- let r = tt[e.id], a = e.x, o = e.y;
1833
- if (n) {
1834
- let r = w.calcLabelPosition(n);
1835
- A.debug("Moving label " + e.label + " from (", a, ",", o, ") to (", r.x, ",", r.y, ") abc88"), t.updatedPath && (a = r.x, o = r.y);
1836
- }
1837
- r.attr("transform", `translate(${a}, ${o + i / 2})`);
1838
- }
1839
- if (e.startLabelLeft) {
1840
- let t = W[e.id].startLeft, r = e.x, i = e.y;
1841
- if (n) {
1842
- let t = w.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", n);
1843
- r = t.x, i = t.y;
1844
- }
1845
- t.attr("transform", `translate(${r}, ${i})`);
1846
- }
1847
- if (e.startLabelRight) {
1848
- let t = W[e.id].startRight, r = e.x, i = e.y;
1849
- if (n) {
1850
- let t = w.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_right", n);
1851
- r = t.x, i = t.y;
1852
- }
1853
- t.attr("transform", `translate(${r}, ${i})`);
1854
- }
1855
- if (e.endLabelLeft) {
1856
- let t = W[e.id].endLeft, r = e.x, i = e.y;
1857
- if (n) {
1858
- let t = w.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", n);
1859
- r = t.x, i = t.y;
1860
- }
1861
- t.attr("transform", `translate(${r}, ${i})`);
1862
- }
1863
- if (e.endLabelRight) {
1864
- let t = W[e.id].endRight, r = e.x, i = e.y;
1865
- if (n) {
1866
- let t = w.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", n);
1867
- r = t.x, i = t.y;
1868
- }
1869
- t.attr("transform", `translate(${r}, ${i})`);
1870
- }
1871
- }, "positionEdgeLabel"), it = /* @__PURE__ */ M((e, t) => {
1872
- let n = e.x, r = e.y, i = Math.abs(t.x - n), a = Math.abs(t.y - r), o = e.width / 2, s = e.height / 2;
1873
- return i >= o || a >= s;
1874
- }, "outsideNode"), at = /* @__PURE__ */ M((e, t, n) => {
1875
- A.debug(`intersection calc abc89:
1876
- outsidePoint: ${JSON.stringify(t)}
1877
- insidePoint : ${JSON.stringify(n)}
1878
- node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);
1879
- let r = e.x, i = e.y, a = Math.abs(r - n.x), o = e.width / 2, s = n.x < t.x ? o - a : o + a, c = e.height / 2, l = Math.abs(t.y - n.y), u = Math.abs(t.x - n.x);
1880
- if (Math.abs(i - t.y) * o > Math.abs(r - t.x) * c) {
1881
- let e = n.y < t.y ? t.y - c - i : i - c - t.y;
1882
- s = u * e / l;
1883
- let r = {
1884
- x: n.x < t.x ? n.x + s : n.x - u + s,
1885
- y: n.y < t.y ? n.y + l - e : n.y - l + e
1886
- };
1887
- return s === 0 && (r.x = t.x, r.y = t.y), u === 0 && (r.x = t.x), l === 0 && (r.y = t.y), A.debug(`abc89 topp/bott calc, Q ${l}, q ${e}, R ${u}, r ${s}`, r), r;
1888
- }
1889
- {
1890
- s = n.x < t.x ? t.x - o - r : r - o - t.x;
1891
- let e = l * s / u, i = n.x < t.x ? n.x + u - s : n.x - u + s, a = n.y < t.y ? n.y + e : n.y - e;
1892
- return A.debug(`sides calc abc89, Q ${l}, q ${e}, R ${u}, r ${s}`, {
1893
- _x: i,
1894
- _y: a
1895
- }), s === 0 && (i = t.x, a = t.y), u === 0 && (i = t.x), l === 0 && (a = t.y), {
1896
- x: i,
1897
- y: a
1898
- };
1899
- }
1900
- }, "intersection"), ot = /* @__PURE__ */ M((e, t) => {
1901
- A.debug("abc88 cutPathAtIntersect", e, t);
1902
- let n = [], r = e[0], i = !1;
1903
- return e.forEach((e) => {
1904
- if (!it(t, e) && !i) {
1905
- let a = at(t, r, e), o = !1;
1906
- n.forEach((e) => {
1907
- o ||= e.x === a.x && e.y === a.y;
1908
- }), n.some((e) => e.x === a.x && e.y === a.y) || n.push(a), i = !0;
1909
- } else r = e, i || n.push(e);
1910
- }), n;
1911
- }, "cutPathAtIntersect"), st = /* @__PURE__ */ M(function(e, r, i, a, o, s, c) {
1912
- let l = i.points;
1913
- A.debug("abc88 InsertEdge: edge=", i, "e=", r);
1914
- let u = !1, d = s.node(r.v);
1915
- var f = s.node(r.w);
1916
- f?.intersect && d?.intersect && (l = l.slice(1, i.points.length - 1), l.unshift(d.intersect(l[0])), l.push(f.intersect(l[l.length - 1]))), i.toCluster && (A.debug("to cluster abc88", a[i.toCluster]), l = ot(i.points, a[i.toCluster].node), u = !0), i.fromCluster && (A.debug("from cluster abc88", a[i.fromCluster]), l = ot(l.reverse(), a[i.fromCluster].node).reverse(), u = !0);
1917
- let p = l.filter((e) => !Number.isNaN(e.y)), m = t;
1918
- i.curve && (o === "graph" || o === "flowchart") && (m = i.curve);
1919
- let { x: h, y: g } = de(i), _ = n().x(h).y(g).curve(m), v;
1920
- switch (i.thickness) {
1921
- case "normal":
1922
- v = "edge-thickness-normal";
1923
- break;
1924
- case "thick":
1925
- v = "edge-thickness-thick";
1926
- break;
1927
- case "invisible":
1928
- v = "edge-thickness-thick";
1929
- break;
1930
- default: v = "";
1931
- }
1932
- switch (i.pattern) {
1933
- case "solid":
1934
- v += " edge-pattern-solid";
1935
- break;
1936
- case "dotted":
1937
- v += " edge-pattern-dotted";
1938
- break;
1939
- case "dashed": v += " edge-pattern-dashed";
1940
- }
1941
- let y = e.append("path").attr("d", _(p)).attr("id", i.id).attr("class", " " + v + (i.classes ? " " + i.classes : "")).attr("style", i.style), b = "";
1942
- (F().flowchart.arrowMarkerAbsolute || F().state.arrowMarkerAbsolute) && (b = te(!0)), Qe(y, i, b, c, o);
1943
- let x = {};
1944
- return u && (x.updatedPath = l), x.originalPath = i.points, x;
1945
- }, "insertEdge"), ct = /* @__PURE__ */ M((e) => {
1946
- let t = /* @__PURE__ */ new Set();
1947
- for (let n of e) switch (n) {
1948
- case "x":
1949
- t.add("right"), t.add("left");
1950
- break;
1951
- case "y":
1952
- t.add("up"), t.add("down");
1953
- break;
1954
- default: t.add(n);
1955
- }
1956
- return t;
1957
- }, "expandAndDeduplicateDirections"), lt = /* @__PURE__ */ M((e, t, n, r) => {
1958
- let i = ct(e), a = t.height + 2 * n.padding, o = a / 2, s = r ?? t.width + 2 * o + n.padding, c = n.padding / 2;
1959
- return i.has("right") && i.has("left") && i.has("up") && i.has("down") ? [
1960
- {
1961
- x: 0,
1962
- y: 0
1963
- },
1964
- {
1965
- x: o,
1966
- y: 0
1967
- },
1968
- {
1969
- x: s / 2,
1970
- y: 2 * c
1971
- },
1972
- {
1973
- x: s - o,
1974
- y: 0
1975
- },
1976
- {
1977
- x: s,
1978
- y: 0
1979
- },
1980
- {
1981
- x: s,
1982
- y: -a / 3
1983
- },
1984
- {
1985
- x: s + 2 * c,
1986
- y: -a / 2
1987
- },
1988
- {
1989
- x: s,
1990
- y: -2 * a / 3
1991
- },
1992
- {
1993
- x: s,
1994
- y: -a
1995
- },
1996
- {
1997
- x: s - o,
1998
- y: -a
1999
- },
2000
- {
2001
- x: s / 2,
2002
- y: -a - 2 * c
2003
- },
2004
- {
2005
- x: o,
2006
- y: -a
2007
- },
2008
- {
2009
- x: 0,
2010
- y: -a
2011
- },
2012
- {
2013
- x: 0,
2014
- y: -2 * a / 3
2015
- },
2016
- {
2017
- x: -2 * c,
2018
- y: -a / 2
2019
- },
2020
- {
2021
- x: 0,
2022
- y: -a / 3
2023
- }
2024
- ] : i.has("right") && i.has("left") && i.has("up") ? [
2025
- {
2026
- x: o,
2027
- y: 0
2028
- },
2029
- {
2030
- x: s - o,
2031
- y: 0
2032
- },
2033
- {
2034
- x: s,
2035
- y: -a / 2
2036
- },
2037
- {
2038
- x: s - o,
2039
- y: -a
2040
- },
2041
- {
2042
- x: o,
2043
- y: -a
2044
- },
2045
- {
2046
- x: 0,
2047
- y: -a / 2
2048
- }
2049
- ] : i.has("right") && i.has("left") && i.has("down") ? [
2050
- {
2051
- x: 0,
2052
- y: 0
2053
- },
2054
- {
2055
- x: o,
2056
- y: -a
2057
- },
2058
- {
2059
- x: s - o,
2060
- y: -a
2061
- },
2062
- {
2063
- x: s,
2064
- y: 0
2065
- }
2066
- ] : i.has("right") && i.has("up") && i.has("down") ? [
2067
- {
2068
- x: 0,
2069
- y: 0
2070
- },
2071
- {
2072
- x: s,
2073
- y: -o
2074
- },
2075
- {
2076
- x: s,
2077
- y: -a + o
2078
- },
2079
- {
2080
- x: 0,
2081
- y: -a
2082
- }
2083
- ] : i.has("left") && i.has("up") && i.has("down") ? [
2084
- {
2085
- x: s,
2086
- y: 0
2087
- },
2088
- {
2089
- x: 0,
2090
- y: -o
2091
- },
2092
- {
2093
- x: 0,
2094
- y: -a + o
2095
- },
2096
- {
2097
- x: s,
2098
- y: -a
2099
- }
2100
- ] : i.has("right") && i.has("left") ? [
2101
- {
2102
- x: o,
2103
- y: 0
2104
- },
2105
- {
2106
- x: o,
2107
- y: -c
2108
- },
2109
- {
2110
- x: s - o,
2111
- y: -c
2112
- },
2113
- {
2114
- x: s - o,
2115
- y: 0
2116
- },
2117
- {
2118
- x: s,
2119
- y: -a / 2
2120
- },
2121
- {
2122
- x: s - o,
2123
- y: -a
2124
- },
2125
- {
2126
- x: s - o,
2127
- y: -a + c
2128
- },
2129
- {
2130
- x: o,
2131
- y: -a + c
2132
- },
2133
- {
2134
- x: o,
2135
- y: -a
2136
- },
2137
- {
2138
- x: 0,
2139
- y: -a / 2
2140
- }
2141
- ] : i.has("up") && i.has("down") ? [
2142
- {
2143
- x: s / 2,
2144
- y: 0
2145
- },
2146
- {
2147
- x: 0,
2148
- y: -c
2149
- },
2150
- {
2151
- x: o,
2152
- y: -c
2153
- },
2154
- {
2155
- x: o,
2156
- y: -a + c
2157
- },
2158
- {
2159
- x: 0,
2160
- y: -a + c
2161
- },
2162
- {
2163
- x: s / 2,
2164
- y: -a
2165
- },
2166
- {
2167
- x: s,
2168
- y: -a + c
2169
- },
2170
- {
2171
- x: s - o,
2172
- y: -a + c
2173
- },
2174
- {
2175
- x: s - o,
2176
- y: -c
2177
- },
2178
- {
2179
- x: s,
2180
- y: -c
2181
- }
2182
- ] : i.has("right") && i.has("up") ? [
2183
- {
2184
- x: 0,
2185
- y: 0
2186
- },
2187
- {
2188
- x: s,
2189
- y: -o
2190
- },
2191
- {
2192
- x: 0,
2193
- y: -a
2194
- }
2195
- ] : i.has("right") && i.has("down") ? [
2196
- {
2197
- x: 0,
2198
- y: 0
2199
- },
2200
- {
2201
- x: s,
2202
- y: 0
2203
- },
2204
- {
2205
- x: 0,
2206
- y: -a
2207
- }
2208
- ] : i.has("left") && i.has("up") ? [
2209
- {
2210
- x: s,
2211
- y: 0
2212
- },
2213
- {
2214
- x: 0,
2215
- y: -o
2216
- },
2217
- {
2218
- x: s,
2219
- y: -a
2220
- }
2221
- ] : i.has("left") && i.has("down") ? [
2222
- {
2223
- x: s,
2224
- y: 0
2225
- },
2226
- {
2227
- x: 0,
2228
- y: 0
2229
- },
2230
- {
2231
- x: s,
2232
- y: -a
2233
- }
2234
- ] : i.has("right") ? [
2235
- {
2236
- x: o,
2237
- y: -c
2238
- },
2239
- {
2240
- x: o,
2241
- y: -c
2242
- },
2243
- {
2244
- x: s - o,
2245
- y: -c
2246
- },
2247
- {
2248
- x: s - o,
2249
- y: 0
2250
- },
2251
- {
2252
- x: s,
2253
- y: -a / 2
2254
- },
2255
- {
2256
- x: s - o,
2257
- y: -a
2258
- },
2259
- {
2260
- x: s - o,
2261
- y: -a + c
2262
- },
2263
- {
2264
- x: o,
2265
- y: -a + c
2266
- },
2267
- {
2268
- x: o,
2269
- y: -a + c
2270
- }
2271
- ] : i.has("left") ? [
2272
- {
2273
- x: o,
2274
- y: 0
2275
- },
2276
- {
2277
- x: o,
2278
- y: -c
2279
- },
2280
- {
2281
- x: s - o,
2282
- y: -c
2283
- },
2284
- {
2285
- x: s - o,
2286
- y: -a + c
2287
- },
2288
- {
2289
- x: o,
2290
- y: -a + c
2291
- },
2292
- {
2293
- x: o,
2294
- y: -a
2295
- },
2296
- {
2297
- x: 0,
2298
- y: -a / 2
2299
- }
2300
- ] : i.has("up") ? [
2301
- {
2302
- x: o,
2303
- y: -c
2304
- },
2305
- {
2306
- x: o,
2307
- y: -a + c
2308
- },
2309
- {
2310
- x: 0,
2311
- y: -a + c
2312
- },
2313
- {
2314
- x: s / 2,
2315
- y: -a
2316
- },
2317
- {
2318
- x: s,
2319
- y: -a + c
2320
- },
2321
- {
2322
- x: s - o,
2323
- y: -a + c
2324
- },
2325
- {
2326
- x: s - o,
2327
- y: -c
2328
- }
2329
- ] : i.has("down") ? [
2330
- {
2331
- x: s / 2,
2332
- y: 0
2333
- },
2334
- {
2335
- x: 0,
2336
- y: -c
2337
- },
2338
- {
2339
- x: o,
2340
- y: -c
2341
- },
2342
- {
2343
- x: o,
2344
- y: -a + c
2345
- },
2346
- {
2347
- x: s - o,
2348
- y: -a + c
2349
- },
2350
- {
2351
- x: s - o,
2352
- y: -c
2353
- },
2354
- {
2355
- x: s,
2356
- y: -c
2357
- }
2358
- ] : [{
2359
- x: 0,
2360
- y: 0
2361
- }];
2362
- }, "getArrowPoints");
2363
- function ut(e, t) {
2364
- return e.intersect(t);
2365
- }
2366
- M(ut, "intersectNode");
2367
- var dt = ut;
2368
- function ft(e, t, n, r) {
2369
- var i = e.x, a = e.y, o = i - r.x, s = a - r.y, c = Math.sqrt(t * t * s * s + n * n * o * o), l = Math.abs(t * n * o / c);
2370
- r.x < i && (l = -l);
2371
- var u = Math.abs(t * n * s / c);
2372
- return r.y < a && (u = -u), {
2373
- x: i + l,
2374
- y: a + u
2375
- };
2376
- }
2377
- M(ft, "intersectEllipse");
2378
- var pt = ft;
2379
- function mt(e, t, n) {
2380
- return pt(e, t, t, n);
2381
- }
2382
- M(mt, "intersectCircle");
2383
- var ht = mt;
2384
- function gt(e, t, n, r) {
2385
- var i = t.y - e.y, a, o = e.x - t.x, s, c = t.x * e.y - e.x * t.y, l, u, d, f = i * n.x + o * n.y + c, p = i * r.x + o * r.y + c, m, h, g, _, v;
2386
- if (!(f !== 0 && p !== 0 && _t(f, p)) && (a = r.y - n.y, s = n.x - r.x, l = r.x * n.y - n.x * r.y, u = a * e.x + s * e.y + l, d = a * t.x + s * t.y + l, !(u !== 0 && d !== 0 && _t(u, d)) && (m = i * s - a * o, m !== 0))) return h = Math.abs(m / 2), g = o * l - s * c, _ = g < 0 ? (g - h) / m : (g + h) / m, g = a * c - i * l, v = g < 0 ? (g - h) / m : (g + h) / m, {
2387
- x: _,
2388
- y: v
2389
- };
2390
- }
2391
- M(gt, "intersectLine");
2392
- function _t(e, t) {
2393
- return e * t > 0;
2394
- }
2395
- M(_t, "sameSign");
2396
- var vt = gt, yt = bt;
2397
- function bt(e, t, n) {
2398
- var r = e.x, i = e.y, a = [], o = Infinity, s = Infinity;
2399
- typeof t.forEach == "function" ? t.forEach(function(e) {
2400
- o = Math.min(o, e.x), s = Math.min(s, e.y);
2401
- }) : (o = Math.min(o, t.x), s = Math.min(s, t.y));
2402
- for (var c = r - e.width / 2 - o, l = i - e.height / 2 - s, u = 0; u < t.length; u++) {
2403
- var d = t[u], f = t[u < t.length - 1 ? u + 1 : 0], p = vt(e, n, {
2404
- x: c + d.x,
2405
- y: l + d.y
2406
- }, {
2407
- x: c + f.x,
2408
- y: l + f.y
2409
- });
2410
- p && a.push(p);
2411
- }
2412
- return a.length ? (a.length > 1 && a.sort(function(e, t) {
2413
- var r = e.x - n.x, i = e.y - n.y, a = Math.sqrt(r * r + i * i), o = t.x - n.x, s = t.y - n.y, c = Math.sqrt(o * o + s * s);
2414
- return a < c ? -1 : a === c ? 0 : 1;
2415
- }), a[0]) : e;
2416
- }
2417
- M(bt, "intersectPolygon");
2418
- var K = {
2419
- node: dt,
2420
- circle: ht,
2421
- ellipse: pt,
2422
- polygon: yt,
2423
- rect: /* @__PURE__ */ M((e, t) => {
2424
- var n = e.x, r = e.y, i = t.x - n, a = t.y - r, o = e.width / 2, s = e.height / 2, c, l;
2425
- return Math.abs(a) * o > Math.abs(i) * s ? (a < 0 && (s = -s), c = a === 0 ? 0 : s * i / a, l = s) : (i < 0 && (o = -o), c = o, l = i === 0 ? 0 : o * a / i), {
2426
- x: n + c,
2427
- y: r + l
2428
- };
2429
- }, "intersectRect")
2430
- }, q = /* @__PURE__ */ M(async (e, t, n, r) => {
2431
- let i = F(), a, o = t.useHtmlLabels || N(i);
2432
- a = n || "node default";
2433
- let s = e.insert("g").attr("class", a).attr("id", t.domId || t.id), c = s.insert("g").attr("class", "label").attr("style", t.labelStyle), l;
2434
- l = t.labelText === void 0 ? "" : typeof t.labelText == "string" ? t.labelText : t.labelText[0];
2435
- let u;
2436
- u = t.labelType === "markdown" ? ue(c, oe(S(l), i), {
2437
- useHtmlLabels: o,
2438
- width: t.width || i.flowchart.wrappingWidth,
2439
- classes: "markdown-node-label"
2440
- }, i) : await U(c, oe(S(l), i), t.labelStyle, !1, r);
2441
- let d = u.getBBox(), f = t.padding / 2;
2442
- if (N(i)) {
2443
- let e = u.children[0], t = j(u);
2444
- await le(e, l), d = e.getBoundingClientRect(), t.attr("width", d.width), t.attr("height", d.height);
2445
- }
2446
- return o ? c.attr("transform", "translate(" + -d.width / 2 + ", " + -d.height / 2 + ")") : c.attr("transform", "translate(0, " + -d.height / 2 + ")"), t.centerLabel && c.attr("transform", "translate(" + -d.width / 2 + ", " + -d.height / 2 + ")"), c.insert("rect", ":first-child"), {
2447
- shapeSvg: s,
2448
- bbox: d,
2449
- halfPadding: f,
2450
- label: c
2451
- };
2452
- }, "labelHelper"), J = /* @__PURE__ */ M((e, t) => {
2453
- let n = t.node().getBBox();
2454
- e.width = n.width, e.height = n.height;
2455
- }, "updateNodeBounds");
2456
- function Y(e, t, n, r) {
2457
- return e.insert("polygon", ":first-child").attr("points", r.map(function(e) {
2458
- return e.x + "," + e.y;
2459
- }).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + n / 2 + ")");
2460
- }
2461
- M(Y, "insertPolygonShape");
2462
- var xt = /* @__PURE__ */ M(async (e, t) => {
2463
- t.useHtmlLabels || N(F()) || (t.centerLabel = !0);
2464
- let { shapeSvg: n, bbox: r, halfPadding: i } = await q(e, t, "node " + t.classes, !0);
2465
- A.info("Classes = ", t.classes);
2466
- let a = n.insert("rect", ":first-child");
2467
- return a.attr("rx", t.rx).attr("ry", t.ry).attr("x", -r.width / 2 - i).attr("y", -r.height / 2 - i).attr("width", r.width + t.padding).attr("height", r.height + t.padding), J(t, a), t.intersect = function(e) {
2468
- return K.rect(t, e);
2469
- }, n;
2470
- }, "note"), St = /* @__PURE__ */ M((e) => e ? " " + e : "", "formatClass"), X = /* @__PURE__ */ M((e, t) => `${t || "node default"}${St(e.classes)} ${St(e.class)}`, "getClassesFromNode"), Ct = /* @__PURE__ */ M(async (e, t) => {
2471
- let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.width + t.padding + (r.height + t.padding), a = [
2472
- {
2473
- x: i / 2,
2474
- y: 0
2475
- },
2476
- {
2477
- x: i,
2478
- y: -i / 2
2479
- },
2480
- {
2481
- x: i / 2,
2482
- y: -i
2483
- },
2484
- {
2485
- x: 0,
2486
- y: -i / 2
2487
- }
2488
- ];
2489
- A.info("Question main (Circle)");
2490
- let o = Y(n, i, i, a);
2491
- return o.attr("style", t.style), J(t, o), t.intersect = function(e) {
2492
- return A.warn("Intersect called"), K.polygon(t, a, e);
2493
- }, n;
2494
- }, "question"), wt = /* @__PURE__ */ M((e, t) => {
2495
- let n = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
2496
- return n.insert("polygon", ":first-child").attr("points", [
2497
- {
2498
- x: 0,
2499
- y: 14
2500
- },
2501
- {
2502
- x: 14,
2503
- y: 0
2504
- },
2505
- {
2506
- x: 0,
2507
- y: -14
2508
- },
2509
- {
2510
- x: -14,
2511
- y: 0
2512
- }
2513
- ].map(function(e) {
2514
- return e.x + "," + e.y;
2515
- }).join(" ")).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(e) {
2516
- return K.circle(t, 14, e);
2517
- }, n;
2518
- }, "choice"), Tt = /* @__PURE__ */ M(async (e, t) => {
2519
- let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = t.positioned ? t.height : r.height + t.padding, a = i / 4, o = t.positioned ? t.width : r.width + 2 * a + t.padding, s = [
2520
- {
2521
- x: a,
2522
- y: 0
2523
- },
2524
- {
2525
- x: o - a,
2526
- y: 0
2527
- },
2528
- {
2529
- x: o,
2530
- y: -i / 2
2531
- },
2532
- {
2533
- x: o - a,
2534
- y: -i
2535
- },
2536
- {
2537
- x: a,
2538
- y: -i
2539
- },
2540
- {
2541
- x: 0,
2542
- y: -i / 2
2543
- }
2544
- ], c = Y(n, o, i, s);
2545
- return c.attr("style", t.style), J(t, c), t.intersect = function(e) {
2546
- return K.polygon(t, s, e);
2547
- }, n;
2548
- }, "hexagon"), Et = /* @__PURE__ */ M(async (e, t) => {
2549
- let { shapeSvg: n, bbox: r } = await q(e, t, void 0, !0), i = r.height + 2 * t.padding, a = i / 2, o = r.width + 2 * a + t.padding, s = t.positioned && (t.widthInColumns ?? 1) > 1 && t.width > o ? t.width : o, c = lt(t.directions, r, t, s), l = Y(n, s, i, c);
2550
- return l.attr("style", t.style), J(t, l), t.intersect = function(e) {
2551
- return K.polygon(t, c, e);
2552
- }, n;
2553
- }, "block_arrow"), Dt = /* @__PURE__ */ M(async (e, t) => {
2554
- let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2555
- {
2556
- x: -a / 2,
2557
- y: 0
2558
- },
2559
- {
2560
- x: i,
2561
- y: 0
2562
- },
2563
- {
2564
- x: i,
2565
- y: -a
2566
- },
2567
- {
2568
- x: -a / 2,
2569
- y: -a
2570
- },
2571
- {
2572
- x: 0,
2573
- y: -a / 2
2574
- }
2575
- ];
2576
- return Y(n, i, a, o).attr("style", t.style), t.width = i + a, t.height = a, t.intersect = function(e) {
2577
- return K.polygon(t, o, e);
2578
- }, n;
2579
- }, "rect_left_inv_arrow"), Ot = /* @__PURE__ */ M(async (e, t) => {
2580
- let { shapeSvg: n, bbox: r } = await q(e, t, X(t), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2581
- {
2582
- x: -2 * a / 6,
2583
- y: 0
2584
- },
2585
- {
2586
- x: i - a / 6,
2587
- y: 0
2588
- },
2589
- {
2590
- x: i + 2 * a / 6,
2591
- y: -a
2592
- },
2593
- {
2594
- x: a / 6,
2595
- y: -a
2596
- }
2597
- ], s = Y(n, i, a, o);
2598
- return s.attr("style", t.style), J(t, s), t.intersect = function(e) {
2599
- return K.polygon(t, o, e);
2600
- }, n;
2601
- }, "lean_right"), kt = /* @__PURE__ */ M(async (e, t) => {
2602
- let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2603
- {
2604
- x: 2 * a / 6,
2605
- y: 0
2606
- },
2607
- {
2608
- x: i + a / 6,
2609
- y: 0
2610
- },
2611
- {
2612
- x: i - 2 * a / 6,
2613
- y: -a
2614
- },
2615
- {
2616
- x: -a / 6,
2617
- y: -a
2618
- }
2619
- ], s = Y(n, i, a, o);
2620
- return s.attr("style", t.style), J(t, s), t.intersect = function(e) {
2621
- return K.polygon(t, o, e);
2622
- }, n;
2623
- }, "lean_left"), At = /* @__PURE__ */ M(async (e, t) => {
2624
- let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2625
- {
2626
- x: -2 * a / 6,
2627
- y: 0
2628
- },
2629
- {
2630
- x: i + 2 * a / 6,
2631
- y: 0
2632
- },
2633
- {
2634
- x: i - a / 6,
2635
- y: -a
2636
- },
2637
- {
2638
- x: a / 6,
2639
- y: -a
2640
- }
2641
- ], s = Y(n, i, a, o);
2642
- return s.attr("style", t.style), J(t, s), t.intersect = function(e) {
2643
- return K.polygon(t, o, e);
2644
- }, n;
2645
- }, "trapezoid"), jt = /* @__PURE__ */ M(async (e, t) => {
2646
- let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2647
- {
2648
- x: a / 6,
2649
- y: 0
2650
- },
2651
- {
2652
- x: i - a / 6,
2653
- y: 0
2654
- },
2655
- {
2656
- x: i + 2 * a / 6,
2657
- y: -a
2658
- },
2659
- {
2660
- x: -2 * a / 6,
2661
- y: -a
2662
- }
2663
- ], s = Y(n, i, a, o);
2664
- return s.attr("style", t.style), J(t, s), t.intersect = function(e) {
2665
- return K.polygon(t, o, e);
2666
- }, n;
2667
- }, "inv_trapezoid"), Mt = /* @__PURE__ */ M(async (e, t) => {
2668
- let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2669
- {
2670
- x: 0,
2671
- y: 0
2672
- },
2673
- {
2674
- x: i + a / 2,
2675
- y: 0
2676
- },
2677
- {
2678
- x: i,
2679
- y: -a / 2
2680
- },
2681
- {
2682
- x: i + a / 2,
2683
- y: -a
2684
- },
2685
- {
2686
- x: 0,
2687
- y: -a
2688
- }
2689
- ], s = Y(n, i, a, o);
2690
- return s.attr("style", t.style), J(t, s), t.intersect = function(e) {
2691
- return K.polygon(t, o, e);
2692
- }, n;
2693
- }, "rect_right_inv_arrow"), Nt = /* @__PURE__ */ M(async (e, t) => {
2694
- let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.width + t.padding, a = i / 2, o = a / (2.5 + i / 50), s = r.height + o + t.padding, c = "M 0," + o + " a " + a + "," + o + " 0,0,0 " + i + " 0 a " + a + "," + o + " 0,0,0 " + -i + " 0 l 0," + s + " a " + a + "," + o + " 0,0,0 " + i + " 0 l 0," + -s;
2695
- return J(t, n.attr("label-offset-y", o).insert("path", ":first-child").attr("style", t.style).attr("d", c).attr("transform", "translate(" + -i / 2 + "," + -(s / 2 + o) + ")")), t.intersect = function(e) {
2696
- let n = K.rect(t, e), r = n.x - t.x;
2697
- if (a != 0 && (Math.abs(r) < t.width / 2 || Math.abs(r) == t.width / 2 && Math.abs(n.y - t.y) > t.height / 2 - o)) {
2698
- let i = o * o * (1 - r * r / (a * a));
2699
- i != 0 && (i = Math.sqrt(i)), i = o - i, e.y - t.y > 0 && (i = -i), n.y += i;
2700
- }
2701
- return n;
2702
- }, n;
2703
- }, "cylinder"), Pt = /* @__PURE__ */ M(async (e, t) => {
2704
- let { shapeSvg: n, bbox: r, halfPadding: i } = await q(e, t, "node " + t.classes + " " + t.class, !0), a = n.insert("rect", ":first-child"), o = t.positioned ? t.width : r.width + t.padding, s = t.positioned ? t.height : r.height + t.padding, c = t.positioned ? -o / 2 : -r.width / 2 - i, l = t.positioned ? -s / 2 : -r.height / 2 - i;
2705
- if (a.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", c).attr("y", l).attr("width", o).attr("height", s), t.props) {
2706
- let e = new Set(Object.keys(t.props));
2707
- t.props.borders && (Z(a, t.props.borders, o, s), e.delete("borders")), e.forEach((e) => {
2708
- A.warn(`Unknown node property ${e}`);
2709
- });
2710
- }
2711
- return J(t, a), t.intersect = function(e) {
2712
- return K.rect(t, e);
2713
- }, n;
2714
- }, "rect"), Ft = /* @__PURE__ */ M(async (e, t) => {
2715
- let { shapeSvg: n, bbox: r, halfPadding: i } = await q(e, t, "node " + t.classes, !0), a = n.insert("rect", ":first-child"), o = t.positioned ? t.width : r.width + t.padding, s = t.positioned ? t.height : r.height + t.padding, c = t.positioned ? -o / 2 : -r.width / 2 - i, l = t.positioned ? -s / 2 : -r.height / 2 - i;
2716
- if (a.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", c).attr("y", l).attr("width", o).attr("height", s), t.props) {
2717
- let e = new Set(Object.keys(t.props));
2718
- t.props.borders && (Z(a, t.props.borders, o, s), e.delete("borders")), e.forEach((e) => {
2719
- A.warn(`Unknown node property ${e}`);
2720
- });
2721
- }
2722
- return J(t, a), t.intersect = function(e) {
2723
- return K.rect(t, e);
2724
- }, n;
2725
- }, "composite"), It = /* @__PURE__ */ M(async (e, t) => {
2726
- let { shapeSvg: n } = await q(e, t, "label", !0);
2727
- A.trace("Classes = ", t.class);
2728
- let r = n.insert("rect", ":first-child");
2729
- if (r.attr("width", 0).attr("height", 0), n.attr("class", "label edgeLabel"), t.props) {
2730
- let e = new Set(Object.keys(t.props));
2731
- t.props.borders && (Z(r, t.props.borders, 0, 0), e.delete("borders")), e.forEach((e) => {
2732
- A.warn(`Unknown node property ${e}`);
2733
- });
2734
- }
2735
- return J(t, r), t.intersect = function(e) {
2736
- return K.rect(t, e);
2737
- }, n;
2738
- }, "labelRect");
2739
- function Z(e, t, n, r) {
2740
- let i = [], a = /* @__PURE__ */ M((e) => {
2741
- i.push(e, 0);
2742
- }, "addBorder"), o = /* @__PURE__ */ M((e) => {
2743
- i.push(0, e);
2744
- }, "skipBorder");
2745
- t.includes("t") ? (A.debug("add top border"), a(n)) : o(n), t.includes("r") ? (A.debug("add right border"), a(r)) : o(r), t.includes("b") ? (A.debug("add bottom border"), a(n)) : o(n), t.includes("l") ? (A.debug("add left border"), a(r)) : o(r), e.attr("stroke-dasharray", i.join(" "));
2746
- }
2747
- M(Z, "applyNodePropertyBorders");
2748
- var Lt = /* @__PURE__ */ M(async (e, t) => {
2749
- let n;
2750
- n = t.classes ? "node " + t.classes : "node default";
2751
- let r = e.insert("g").attr("class", n).attr("id", t.domId || t.id), i = r.insert("rect", ":first-child"), a = r.insert("line"), o = r.insert("g").attr("class", "label"), s = t.labelText.flat ? t.labelText.flat() : t.labelText, c = "";
2752
- c = typeof s == "object" ? s[0] : s, A.info("Label text abc79", c, s, typeof s == "object");
2753
- let l = await U(o, c, t.labelStyle, !0, !0), u = {
2754
- width: 0,
2755
- height: 0
2756
- };
2757
- if (N(F())) {
2758
- let e = l.children[0], t = j(l);
2759
- u = e.getBoundingClientRect(), t.attr("width", u.width), t.attr("height", u.height);
2760
- }
2761
- A.info("Text 2", s);
2762
- let d = s.slice(1, s.length), f = l.getBBox(), p = await U(o, d.join ? d.join("<br/>") : d, t.labelStyle, !0, !0);
2763
- if (N(F())) {
2764
- let e = p.children[0], t = j(p);
2765
- u = e.getBoundingClientRect(), t.attr("width", u.width), t.attr("height", u.height);
2766
- }
2767
- let m = t.padding / 2;
2768
- return j(p).attr("transform", "translate( " + (u.width > f.width ? 0 : (f.width - u.width) / 2) + ", " + (f.height + m + 5) + ")"), j(l).attr("transform", "translate( " + (u.width < f.width ? 0 : -(f.width - u.width) / 2) + ", 0)"), u = o.node().getBBox(), o.attr("transform", "translate(" + -u.width / 2 + ", " + (-u.height / 2 - m + 3) + ")"), i.attr("class", "outer title-state").attr("x", -u.width / 2 - m).attr("y", -u.height / 2 - m).attr("width", u.width + t.padding).attr("height", u.height + t.padding), a.attr("class", "divider").attr("x1", -u.width / 2 - m).attr("x2", u.width / 2 + m).attr("y1", -u.height / 2 - m + f.height + m).attr("y2", -u.height / 2 - m + f.height + m), J(t, i), t.intersect = function(e) {
2769
- return K.rect(t, e);
2770
- }, r;
2771
- }, "rectWithTitle"), Rt = /* @__PURE__ */ M(async (e, t) => {
2772
- let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.height + t.padding, a = r.width + i / 4 + t.padding;
2773
- return J(t, n.insert("rect", ":first-child").attr("style", t.style).attr("rx", i / 2).attr("ry", i / 2).attr("x", -a / 2).attr("y", -i / 2).attr("width", a).attr("height", i)), t.intersect = function(e) {
2774
- return K.rect(t, e);
2775
- }, n;
2776
- }, "stadium"), zt = /* @__PURE__ */ M(async (e, t) => {
2777
- let { shapeSvg: n, bbox: r, halfPadding: i } = await q(e, t, X(t, void 0), !0), a = n.insert("circle", ":first-child");
2778
- return a.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", r.width / 2 + i).attr("width", r.width + t.padding).attr("height", r.height + t.padding), A.info("Circle main"), J(t, a), t.intersect = function(e) {
2779
- return A.info("Circle intersect", t, r.width / 2 + i, e), K.circle(t, r.width / 2 + i, e);
2780
- }, n;
2781
- }, "circle"), Bt = /* @__PURE__ */ M(async (e, t) => {
2782
- let { shapeSvg: n, bbox: r, halfPadding: i } = await q(e, t, X(t, void 0), !0), a = n.insert("g", ":first-child"), o = a.insert("circle"), s = a.insert("circle");
2783
- return a.attr("class", t.class), o.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", r.width / 2 + i + 5).attr("width", r.width + t.padding + 10).attr("height", r.height + t.padding + 10), s.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", r.width / 2 + i).attr("width", r.width + t.padding).attr("height", r.height + t.padding), A.info("DoubleCircle main"), J(t, o), t.intersect = function(e) {
2784
- return A.info("DoubleCircle intersect", t, r.width / 2 + i + 5, e), K.circle(t, r.width / 2 + i + 5, e);
2785
- }, n;
2786
- }, "doublecircle"), Vt = /* @__PURE__ */ M(async (e, t) => {
2787
- let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2788
- {
2789
- x: 0,
2790
- y: 0
2791
- },
2792
- {
2793
- x: i,
2794
- y: 0
2795
- },
2796
- {
2797
- x: i,
2798
- y: -a
2799
- },
2800
- {
2801
- x: 0,
2802
- y: -a
2803
- },
2804
- {
2805
- x: 0,
2806
- y: 0
2807
- },
2808
- {
2809
- x: -8,
2810
- y: 0
2811
- },
2812
- {
2813
- x: i + 8,
2814
- y: 0
2815
- },
2816
- {
2817
- x: i + 8,
2818
- y: -a
2819
- },
2820
- {
2821
- x: -8,
2822
- y: -a
2823
- },
2824
- {
2825
- x: -8,
2826
- y: 0
2827
- }
2828
- ], s = Y(n, i, a, o);
2829
- return s.attr("style", t.style), J(t, s), t.intersect = function(e) {
2830
- return K.polygon(t, o, e);
2831
- }, n;
2832
- }, "subroutine"), Ht = /* @__PURE__ */ M((e, t) => {
2833
- let n = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), r = n.insert("circle", ":first-child");
2834
- return r.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), J(t, r), t.intersect = function(e) {
2835
- return K.circle(t, 7, e);
2836
- }, n;
2837
- }, "start"), Ut = /* @__PURE__ */ M((e, t, n) => {
2838
- let r = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = 70, a = 10;
2839
- return n === "LR" && (i = 10, a = 70), J(t, r.append("rect").attr("x", -1 * i / 2).attr("y", -1 * a / 2).attr("width", i).attr("height", a).attr("class", "fork-join")), t.height += t.padding / 2, t.width += t.padding / 2, t.intersect = function(e) {
2840
- return K.rect(t, e);
2841
- }, r;
2842
- }, "forkJoin"), Wt = {
2843
- rhombus: Ct,
2844
- composite: Ft,
2845
- question: Ct,
2846
- rect: Pt,
2847
- labelRect: It,
2848
- rectWithTitle: Lt,
2849
- choice: wt,
2850
- circle: zt,
2851
- doublecircle: Bt,
2852
- stadium: Rt,
2853
- hexagon: Tt,
2854
- block_arrow: Et,
2855
- rect_left_inv_arrow: Dt,
2856
- lean_right: Ot,
2857
- lean_left: kt,
2858
- trapezoid: At,
2859
- inv_trapezoid: jt,
2860
- rect_right_inv_arrow: Mt,
2861
- cylinder: Nt,
2862
- start: Ht,
2863
- end: /* @__PURE__ */ M((e, t) => {
2864
- let n = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), r = n.insert("circle", ":first-child"), i = n.insert("circle", ":first-child");
2865
- return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), r.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), J(t, i), t.intersect = function(e) {
2866
- return K.circle(t, 7, e);
2867
- }, n;
2868
- }, "end"),
2869
- note: xt,
2870
- subroutine: Vt,
2871
- fork: Ut,
2872
- join: Ut,
2873
- class_box: /* @__PURE__ */ M(async (e, t) => {
2874
- let n = t.padding / 2, r;
2875
- r = t.classes ? "node " + t.classes : "node default";
2876
- let i = e.insert("g").attr("class", r).attr("id", t.domId || t.id), a = i.insert("rect", ":first-child"), o = i.insert("line"), s = i.insert("line"), c = 0, l = 4, u = i.insert("g").attr("class", "label"), d = 0, f = t.classData.annotations?.[0], p = await U(u, t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", t.labelStyle, !0, !0), m = p.getBBox();
2877
- if (N(F())) {
2878
- let e = p.children[0], t = j(p);
2879
- m = e.getBoundingClientRect(), t.attr("width", m.width), t.attr("height", m.height);
2880
- }
2881
- t.classData.annotations[0] && (l += m.height + 4, c += m.width);
2882
- let h = t.classData.label;
2883
- t.classData.type !== void 0 && t.classData.type !== "" && (N(F()) ? h += "&lt;" + t.classData.type + "&gt;" : h += "<" + t.classData.type + ">");
2884
- let g = await U(u, h, t.labelStyle, !0, !0);
2885
- j(g).attr("class", "classTitle");
2886
- let _ = g.getBBox();
2887
- if (N(F())) {
2888
- let e = g.children[0], t = j(g);
2889
- _ = e.getBoundingClientRect(), t.attr("width", _.width), t.attr("height", _.height);
2890
- }
2891
- l += _.height + 4, _.width > c && (c = _.width);
2892
- let v = [];
2893
- t.classData.members.forEach(async (e) => {
2894
- let n = e.getDisplayDetails(), r = n.displayText;
2895
- N(F()) && (r = r.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2896
- let i = await U(u, r, n.cssStyle ? n.cssStyle : t.labelStyle, !0, !0), a = i.getBBox();
2897
- if (N(F())) {
2898
- let e = i.children[0], t = j(i);
2899
- a = e.getBoundingClientRect(), t.attr("width", a.width), t.attr("height", a.height);
2900
- }
2901
- a.width > c && (c = a.width), l += a.height + 4, v.push(i);
2902
- }), l += 8;
2903
- let y = [];
2904
- if (t.classData.methods.forEach(async (e) => {
2905
- let n = e.getDisplayDetails(), r = n.displayText;
2906
- N(F()) && (r = r.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2907
- let i = await U(u, r, n.cssStyle ? n.cssStyle : t.labelStyle, !0, !0), a = i.getBBox();
2908
- if (N(F())) {
2909
- let e = i.children[0], t = j(i);
2910
- a = e.getBoundingClientRect(), t.attr("width", a.width), t.attr("height", a.height);
2911
- }
2912
- a.width > c && (c = a.width), l += a.height + 4, y.push(i);
2913
- }), l += 8, f) {
2914
- let e = (c - m.width) / 2;
2915
- j(p).attr("transform", "translate( " + (-1 * c / 2 + e) + ", " + -1 * l / 2 + ")"), d = m.height + 4;
2916
- }
2917
- let b = (c - _.width) / 2;
2918
- return j(g).attr("transform", "translate( " + (-1 * c / 2 + b) + ", " + (-1 * l / 2 + d) + ")"), d += _.height + 4, o.attr("class", "divider").attr("x1", -c / 2 - n).attr("x2", c / 2 + n).attr("y1", -l / 2 - n + 8 + d).attr("y2", -l / 2 - n + 8 + d), d += 8, v.forEach((e) => {
2919
- j(e).attr("transform", "translate( " + -c / 2 + ", " + (-1 * l / 2 + d + 4) + ")");
2920
- let t = e?.getBBox();
2921
- d += (t?.height ?? 0) + 4;
2922
- }), d += 8, s.attr("class", "divider").attr("x1", -c / 2 - n).attr("x2", c / 2 + n).attr("y1", -l / 2 - n + 8 + d).attr("y2", -l / 2 - n + 8 + d), d += 8, y.forEach((e) => {
2923
- j(e).attr("transform", "translate( " + -c / 2 + ", " + (-1 * l / 2 + d) + ")");
2924
- let t = e?.getBBox();
2925
- d += (t?.height ?? 0) + 4;
2926
- }), a.attr("style", t.style).attr("class", "outer title-state").attr("x", -c / 2 - n).attr("y", -(l / 2) - n).attr("width", c + t.padding).attr("height", l + t.padding), J(t, a), t.intersect = function(e) {
2927
- return K.rect(t, e);
2928
- }, i;
2929
- }, "class_box")
2930
- }, Q = {}, Gt = /* @__PURE__ */ M(async (e, t, n) => {
2931
- let r, i;
2932
- if (t.link) {
2933
- let a;
2934
- F().securityLevel === "sandbox" ? a = "_top" : t.linkTarget && (a = t.linkTarget || "_blank"), r = e.insert("svg:a").attr("xlink:href", t.link).attr("target", a), i = await Wt[t.shape](r, t, n);
2935
- } else i = await Wt[t.shape](e, t, n), r = i;
2936
- return t.tooltip && i.attr("title", t.tooltip), t.class && i.attr("class", "node default " + t.class), Q[t.id] = r, t.haveCallback && Q[t.id].attr("class", Q[t.id].attr("class") + " clickable"), r;
2937
- }, "insertNode"), Kt = /* @__PURE__ */ M((e) => {
2938
- let t = Q[e.id];
2939
- A.trace("Transforming node", e.diff, e, "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")");
2940
- let n = e.diff || 0;
2941
- return e.clusterNode ? t.attr("transform", "translate(" + (e.x + n - e.width / 2) + ", " + (e.y - e.height / 2 - 8) + ")") : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), n;
2942
- }, "positionNode");
2943
- function qt(e, t, n = !1) {
2944
- let r = e, i = "default";
2945
- (r?.classes?.length || 0) > 0 && (i = (r?.classes ?? []).join(" ")), i += " flowchart-label";
2946
- let a = 0, o = "", s;
2947
- switch (r.type) {
2948
- case "round":
2949
- a = 5, o = "rect";
2950
- break;
2951
- case "composite":
2952
- a = 0, o = "composite", s = 0;
2953
- break;
2954
- case "square":
2955
- o = "rect";
2956
- break;
2957
- case "diamond":
2958
- o = "question";
2959
- break;
2960
- case "hexagon":
2961
- o = "hexagon";
2962
- break;
2963
- case "block_arrow":
2964
- o = "block_arrow";
2965
- break;
2966
- case "odd":
2967
- o = "rect_left_inv_arrow";
2968
- break;
2969
- case "lean_right":
2970
- o = "lean_right";
2971
- break;
2972
- case "lean_left":
2973
- o = "lean_left";
2974
- break;
2975
- case "trapezoid":
2976
- o = "trapezoid";
2977
- break;
2978
- case "inv_trapezoid":
2979
- o = "inv_trapezoid";
2980
- break;
2981
- case "rect_left_inv_arrow":
2982
- o = "rect_left_inv_arrow";
2983
- break;
2984
- case "circle":
2985
- o = "circle";
2986
- break;
2987
- case "ellipse":
2988
- o = "ellipse";
2989
- break;
2990
- case "stadium":
2991
- o = "stadium";
2992
- break;
2993
- case "subroutine":
2994
- o = "subroutine";
2995
- break;
2996
- case "cylinder":
2997
- o = "cylinder";
2998
- break;
2999
- case "group":
3000
- o = "rect";
3001
- break;
3002
- case "doublecircle":
3003
- o = "doublecircle";
3004
- break;
3005
- default: o = "rect";
3006
- }
3007
- let c = D(r?.styles ?? []), l = r.label, u = r.size ?? {
3008
- width: 0,
3009
- height: 0,
3010
- x: 0,
3011
- y: 0
3012
- }, d = t.getDiagramId();
3013
- return {
3014
- labelStyle: c.labelStyle,
3015
- shape: o,
3016
- labelText: l,
3017
- rx: a,
3018
- ry: a,
3019
- class: i,
3020
- style: c.style,
3021
- id: r.id,
3022
- domId: d ? `${d}-${r.id}` : r.id,
3023
- directions: r.directions,
3024
- width: u.width,
3025
- height: u.height,
3026
- x: u.x,
3027
- y: u.y,
3028
- positioned: n,
3029
- intersect: void 0,
3030
- type: r.type,
3031
- padding: s ?? P()?.block?.padding ?? 0,
3032
- widthInColumns: r.widthInColumns ?? 1
3033
- };
3034
- }
3035
- M(qt, "getNodeFromBlock");
3036
- async function Jt(e, t, n) {
3037
- let r = qt(t, n, !1);
3038
- if (r.type === "group") return;
3039
- let i = await Gt(e, r, { config: P() }), a = i.node().getBBox(), o = n.getBlock(r.id);
3040
- o.size = {
3041
- width: a.width,
3042
- height: a.height,
3043
- x: 0,
3044
- y: 0,
3045
- node: i
3046
- }, n.setBlock(o), i.remove();
3047
- }
3048
- M(Jt, "calculateBlockSize");
3049
- async function Yt(e, t, n) {
3050
- let r = qt(t, n, !0);
3051
- n.getBlock(r.id).type !== "space" && (await Gt(e, r, { config: P() }), t.intersect = r?.intersect, Kt(r));
3052
- }
3053
- M(Yt, "insertBlockPositioned");
3054
- async function $(e, t, n, r) {
3055
- for (let i of t) await r(e, i, n), i.children && await $(e, i.children, n, r);
3056
- }
3057
- M($, "performOperations");
3058
- async function Xt(e, t, n) {
3059
- await $(e, t, n, Jt);
3060
- }
3061
- M(Xt, "calculateBlockSizes");
3062
- async function Zt(e, t, n) {
3063
- await $(e, t, n, Yt);
3064
- }
3065
- M(Zt, "insertBlocks");
3066
- async function Qt(t, n, r, i, a) {
3067
- let o = new e({
3068
- multigraph: !0,
3069
- compound: !0
3070
- });
3071
- o.setGraph({
3072
- rankdir: "TB",
3073
- nodesep: 10,
3074
- ranksep: 10,
3075
- marginx: 8,
3076
- marginy: 8
3077
- });
3078
- for (let e of r) e.size && o.setNode(e.id, {
3079
- width: e.size.width,
3080
- height: e.size.height,
3081
- intersect: e.intersect
3082
- });
3083
- for (let e of n) if (e.start && e.end) {
3084
- let n = i.getBlock(e.start), r = i.getBlock(e.end);
3085
- if (n?.size && r?.size) {
3086
- let i = n.size, s = r.size, c = [
3087
- {
3088
- x: i.x,
3089
- y: i.y
3090
- },
3091
- {
3092
- x: i.x + (s.x - i.x) / 2,
3093
- y: i.y + (s.y - i.y) / 2
3094
- },
3095
- {
3096
- x: s.x,
3097
- y: s.y
3098
- }
3099
- ], l = a ? `${a}-${e.id}` : e.id, u = `${e.thickness === "thick" ? "edge-thickness-thick" : "edge-thickness-normal"} ${e.pattern === "dotted" ? "edge-pattern-dotted" : "edge-pattern-solid"} flowchart-link LS-a1 LE-b1`;
3100
- st(t, {
3101
- v: e.start,
3102
- w: e.end,
3103
- name: l
3104
- }, {
3105
- ...e,
3106
- id: l,
3107
- arrowTypeEnd: e.arrowTypeEnd,
3108
- arrowTypeStart: e.arrowTypeStart,
3109
- points: c,
3110
- classes: u
3111
- }, void 0, "block", o, a), e.label && (await nt(t, {
3112
- ...e,
3113
- label: e.label,
3114
- labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
3115
- arrowTypeEnd: e.arrowTypeEnd,
3116
- arrowTypeStart: e.arrowTypeStart,
3117
- points: c,
3118
- classes: u
3119
- }), rt({
3120
- ...e,
3121
- x: c[1].x,
3122
- y: c[1].y
3123
- }, { originalPath: c }));
3124
- }
3125
- }
3126
- }
3127
- M(Qt, "insertEdges");
3128
- var $t = {
3129
- parser: be,
3130
- db: Ve,
3131
- renderer: {
3132
- draw: /* @__PURE__ */ M(async function(e, t, n, r) {
3133
- let { securityLevel: i, block: a } = P(), o = r.db;
3134
- o.setDiagramId(t);
3135
- let s;
3136
- i === "sandbox" && (s = j("#i" + t));
3137
- let c = j(i === "sandbox" ? s.nodes()[0].contentDocument.body : "body"), l = i === "sandbox" ? c.select(`[id="${t}"]`) : j(`[id="${t}"]`);
3138
- Ke(l, [
3139
- "point",
3140
- "circle",
3141
- "cross"
3142
- ], r.type, t);
3143
- let u = o.getBlocks(), d = o.getBlocksFlat(), f = o.getEdges(), p = l.insert("g").attr("class", "block");
3144
- await Xt(p, u, o);
3145
- let m = Ze(o);
3146
- if (await Zt(p, u, o), await Qt(p, f, d, o, t), m) {
3147
- let e = m, t = Math.max(1, Math.round(.125 * (e.width / e.height))), n = e.height + t + 10, r = e.width + 10, { useMaxWidth: i } = a;
3148
- re(l, n, r, !!i), A.debug("Here Bounds", m, e), l.attr("viewBox", `${e.x - 5} ${e.y - 5} ${e.width + 10} ${e.height + 10}`);
3149
- }
3150
- }, "draw"),
3151
- getClasses: /* @__PURE__ */ M(function(e, t) {
3152
- return t.db.getClasses();
3153
- }, "getClasses")
3154
- },
3155
- styles: Ue
3156
- };
3157
- //#endregion
3158
- export { $t as diagram };