@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
@@ -0,0 +1,1922 @@
1
+ import { t as e } from "./graphlib-BmY_CCV9.js";
2
+ import { A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, L as u, M as d, N as f, O as p, P as m, R as h, T as g, U as _, V as ee, W as te, b as v, j as y, k as b, l as x, v as S, w as C, z as w } from "./chunk-75Z2AOVW-5_HsvXwr.js";
3
+ import { n as T, t as E } from "./src-CA_m4ONl.js";
4
+ import { n as D } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
5
+ import { a as O, b as k, c as A, rt as ne, s as re, x as ie } from "./chunk-DU6HZSFF-BUgAHvnM.js";
6
+ import { t as ae } from "./channel-B5XnTarr.js";
7
+ import "./chunk-P2QGCYS3-C0iGU29N.js";
8
+ import "./chunk-PWAF6VOD-CTFCL0jI.js";
9
+ import "./chunk-GMAD6QVW-Czynz8aA.js";
10
+ import "./chunk-4HAMMTFA-D2qv8E0X.js";
11
+ import { i as oe, r as se } from "./chunk-GVQU2GXP-yQEdulRS.js";
12
+ import { a as ce, c as le, i as ue, s as de } from "./chunk-OSK3NFVY-BBKU_Ign.js";
13
+ import { t as fe } from "./chunk-5VM5RSS4-DKsmPCL6.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 (v(e)) return e;
22
+ let t = s(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 (S(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]" ? _e(r, e) : j(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 j(n, t), n.length = t.length, n[Symbol.iterator] = t[Symbol.iterator], n;
62
+ }
63
+ let n = {};
64
+ return ve(n, e), j(n, e), ge(n, e), n;
65
+ }
66
+ function he(e) {
67
+ switch (s(e)) {
68
+ case r:
69
+ case g:
70
+ case C:
71
+ case i:
72
+ case a:
73
+ case p:
74
+ case b:
75
+ case t:
76
+ case f:
77
+ case y:
78
+ case d:
79
+ case m:
80
+ case o:
81
+ case l:
82
+ case u:
83
+ case h:
84
+ case w:
85
+ case n:
86
+ case _:
87
+ case te:
88
+ case ee:
89
+ case c: return !0;
90
+ default: return !1;
91
+ }
92
+ }
93
+ function j(e, t) {
94
+ for (let n in t) Object.hasOwn(t, n) && (e[n] = t[n]);
95
+ }
96
+ function ge(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 _e(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 ve(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.17.2/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-I7D4REHJ.mjs
113
+ var M = (function() {
114
+ var e = /* @__PURE__ */ D(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__ */ D(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__ */ D(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__ */ D(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__ */ D(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 ee = m.options && m.options.ranges;
639
+ this.parseError = typeof h.yy.parseError == "function" ? h.yy.parseError : Object.getPrototypeOf(this).parseError;
640
+ function te(e) {
641
+ n.length -= 2 * e, i.length -= e, a.length -= e;
642
+ }
643
+ D(te, "popStack");
644
+ function v() {
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
+ D(v, "lex");
649
+ for (var y, b, x, S, C, w = {}, T, E, O, k;;) {
650
+ if (x = n[n.length - 1], this.defaultActions[x] ? S = this.defaultActions[x] : (y ??= v(), S = o[x] && o[x][y]), S === void 0 || !S.length || !S[0]) {
651
+ var A = "";
652
+ for (T in k = [], o[x]) this.terminals_[T] && T > d && k.push("'" + this.terminals_[T] + "'");
653
+ A = m.showPosition ? "Parse error on line " + (c + 1) + ":\n" + m.showPosition() + "\nExpecting " + k.join(", ") + ", got '" + (this.terminals_[y] || y) + "'" : "Parse error on line " + (c + 1) + ": Unexpected " + (y == f ? "end of input" : "'" + (this.terminals_[y] || y) + "'"), this.parseError(A, {
654
+ text: m.match,
655
+ token: this.terminals_[y] || y,
656
+ line: m.yylineno,
657
+ loc: _,
658
+ expected: k
659
+ });
660
+ }
661
+ if (S[0] instanceof Array && S.length > 1) throw Error("Parse Error: multiple actions possible at state: " + x + ", token: " + y);
662
+ switch (S[0]) {
663
+ case 1:
664
+ n.push(y), i.push(m.yytext), a.push(m.yylloc), n.push(S[1]), y = null, b ? (y = b, b = null) : (l = m.yyleng, s = m.yytext, c = m.yylineno, _ = m.yylloc, u > 0 && u--);
665
+ break;
666
+ case 2:
667
+ if (E = this.productions_[S[1]][1], w.$ = i[i.length - E], w._$ = {
668
+ first_line: a[a.length - (E || 1)].first_line,
669
+ last_line: a[a.length - 1].last_line,
670
+ first_column: a[a.length - (E || 1)].first_column,
671
+ last_column: a[a.length - 1].last_column
672
+ }, ee && (w._$.range = [a[a.length - (E || 1)].range[0], a[a.length - 1].range[1]]), C = this.performAction.apply(w, [
673
+ s,
674
+ l,
675
+ c,
676
+ h.yy,
677
+ S[1],
678
+ i,
679
+ a
680
+ ].concat(p)), C !== void 0) return C;
681
+ E && (n = n.slice(0, -1 * E * 2), i = i.slice(0, -1 * E), a = a.slice(0, -1 * E)), n.push(this.productions_[S[1]][0]), i.push(w.$), a.push(w._$), O = o[n[n.length - 2]][n[n.length - 1]], n.push(O);
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__ */ D(function(e, t) {
693
+ if (this.yy.parser) this.yy.parser.parseError(e, t);
694
+ else throw Error(e);
695
+ }, "parseError"),
696
+ setInput: /* @__PURE__ */ D(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__ */ D(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__ */ D(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__ */ D(function() {
722
+ return this._more = !0, this;
723
+ }, "more"),
724
+ reject: /* @__PURE__ */ D(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__ */ D(function(e) {
734
+ this.unput(this.match.slice(e));
735
+ }, "less"),
736
+ pastInput: /* @__PURE__ */ D(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__ */ D(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__ */ D(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__ */ D(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__ */ D(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__ */ D(function() {
804
+ return this.next() || this.lex();
805
+ }, "lex"),
806
+ begin: /* @__PURE__ */ D(function(e) {
807
+ this.conditionStack.push(e);
808
+ }, "begin"),
809
+ popState: /* @__PURE__ */ D(function() {
810
+ return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
811
+ }, "popState"),
812
+ _currentRules: /* @__PURE__ */ D(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__ */ D(function(e) {
816
+ return e = this.conditionStack.length - 1 - Math.abs(e || 0), e >= 0 ? this.conditionStack[e] : "INITIAL";
817
+ }, "topState"),
818
+ pushState: /* @__PURE__ */ D(function(e) {
819
+ this.begin(e);
820
+ }, "pushState"),
821
+ stateStackSize: /* @__PURE__ */ D(function() {
822
+ return this.conditionStack.length;
823
+ }, "stateStackSize"),
824
+ options: {},
825
+ performAction: /* @__PURE__ */ D(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 D(_, "Parser"), _.prototype = g, g.Parser = _, new _();
1250
+ })();
1251
+ M.parser = M;
1252
+ var ye = M, N = /* @__PURE__ */ new Map(), P = [], F = /* @__PURE__ */ new Map(), be = "color", xe = "fill", Se = "bgFill", Ce = ",", I = /* @__PURE__ */ new Map(), L = "", we = /* @__PURE__ */ D((e) => re.sanitizeText(e, ie()), "sanitizeText"), Te = /* @__PURE__ */ D(function(e, t = "") {
1253
+ let n = I.get(e);
1254
+ n || (n = {
1255
+ id: e,
1256
+ styles: [],
1257
+ textStyles: []
1258
+ }, I.set(e, n)), t?.split(Ce).forEach((e) => {
1259
+ let t = e.replace(/([^;]*);/, "$1").trim();
1260
+ if (RegExp(be).exec(e)) {
1261
+ let e = t.replace(xe, Se).replace(be, xe);
1262
+ n.textStyles.push(e);
1263
+ }
1264
+ n.styles.push(t);
1265
+ });
1266
+ }, "addStyleClass"), Ee = /* @__PURE__ */ D(function(e, t = "") {
1267
+ let n = N.get(e);
1268
+ t != null && (n.styles = t.split(Ce));
1269
+ }, "addStyle2Node"), De = /* @__PURE__ */ D(function(e, t) {
1270
+ e.split(",").forEach(function(e) {
1271
+ let n = N.get(e);
1272
+ if (n === void 0) {
1273
+ let t = e.trim();
1274
+ n = {
1275
+ id: t,
1276
+ type: "na",
1277
+ children: []
1278
+ }, N.set(t, n);
1279
+ }
1280
+ n.classes || (n.classes = []), n.classes.push(t);
1281
+ });
1282
+ }, "setCssClass"), Oe = /* @__PURE__ */ D((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 && T.warn(`Block ${e.id} width ${e.widthInColumns} exceeds configured column width ${i}`), e.label &&= we(e.label), e.type === "classDef") {
1286
+ Te(e.id, e.css);
1287
+ continue;
1288
+ }
1289
+ if (e.type === "applyClass") {
1290
+ De(e.id, e?.styleClass ?? "");
1291
+ continue;
1292
+ }
1293
+ if (e.type === "applyStyles") {
1294
+ e?.stylesStr && Ee(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 = (F.get(e.id) ?? 0) + 1;
1300
+ F.set(e.id, t), e.id = t + "-" + e.id, P.push(e);
1301
+ } else {
1302
+ e.label ||= e.type === "composite" ? "" : e.id;
1303
+ let t = N.get(e.id);
1304
+ if (t === void 0 ? N.set(e.id, e) : (e.type !== "na" && (t.type = e.type), e.label !== e.id && (t.label = e.label)), e.children && Oe(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, N.set(t.id, t), r.push(t);
1309
+ }
1310
+ } else t === void 0 && r.push(e);
1311
+ }
1312
+ }
1313
+ t.children = r;
1314
+ }, "populateBlockDatabase"), R = [], z = {
1315
+ id: "root",
1316
+ type: "composite",
1317
+ children: [],
1318
+ columns: -1
1319
+ }, ke = /* @__PURE__ */ D(() => {
1320
+ T.debug("Clear called"), O(), z = {
1321
+ id: "root",
1322
+ type: "composite",
1323
+ children: [],
1324
+ columns: -1
1325
+ }, N = /* @__PURE__ */ new Map([["root", z]]), R = [], I = /* @__PURE__ */ new Map(), P = [], F = /* @__PURE__ */ new Map(), L = "";
1326
+ }, "clear");
1327
+ function Ae(e) {
1328
+ switch (T.debug("typeStr2Type", e), e) {
1329
+ case "[]": return "square";
1330
+ case "()": return T.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
+ D(Ae, "typeStr2Type");
1348
+ function B(e) {
1349
+ switch (T.debug("typeStr2Type", e), e) {
1350
+ case "==": return "thick";
1351
+ default: return "normal";
1352
+ }
1353
+ }
1354
+ D(B, "edgeTypeStr2Type");
1355
+ function V(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
+ D(V, "edgeStrToEdgeData");
1364
+ function H(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
+ D(H, "edgeStrToEdgeStartData");
1373
+ function U(e) {
1374
+ return e.includes("==") ? "thick" : "normal";
1375
+ }
1376
+ D(U, "edgeStrToThickness");
1377
+ function W(e) {
1378
+ return e.includes(".-") ? "dotted" : "solid";
1379
+ }
1380
+ D(W, "edgeStrToPattern");
1381
+ var G = 0, je = {
1382
+ getConfig: /* @__PURE__ */ D(() => k().block, "getConfig"),
1383
+ typeStr2Type: Ae,
1384
+ edgeTypeStr2Type: B,
1385
+ edgeStrToEdgeData: V,
1386
+ edgeStrToEdgeStartData: H,
1387
+ edgeStrToThickness: U,
1388
+ edgeStrToPattern: W,
1389
+ getLogger: /* @__PURE__ */ D(() => T, "getLogger"),
1390
+ getBlocksFlat: /* @__PURE__ */ D(() => [...N.values()], "getBlocksFlat"),
1391
+ getBlocks: /* @__PURE__ */ D(() => R || [], "getBlocks"),
1392
+ getEdges: /* @__PURE__ */ D(() => P, "getEdges"),
1393
+ setHierarchy: /* @__PURE__ */ D((e) => {
1394
+ z.children = e, Oe(e, z), R = z.children;
1395
+ }, "setHierarchy"),
1396
+ getBlock: /* @__PURE__ */ D((e) => N.get(e), "getBlock"),
1397
+ setBlock: /* @__PURE__ */ D((e) => {
1398
+ N.set(e.id, e);
1399
+ }, "setBlock"),
1400
+ getColumns: /* @__PURE__ */ D((e) => {
1401
+ let t = N.get(e);
1402
+ return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1;
1403
+ }, "getColumns"),
1404
+ getClasses: /* @__PURE__ */ D(function() {
1405
+ return I;
1406
+ }, "getClasses"),
1407
+ clear: ke,
1408
+ generateId: /* @__PURE__ */ D(() => (G++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + G), "generateId"),
1409
+ setDiagramId: /* @__PURE__ */ D((e) => {
1410
+ L = e;
1411
+ }, "setDiagramId"),
1412
+ getDiagramId: /* @__PURE__ */ D(() => L, "getDiagramId")
1413
+ }, K = /* @__PURE__ */ D((e, t) => {
1414
+ let n = ae, r = n(e, "r"), i = n(e, "g"), a = n(e, "b");
1415
+ return ne(r, i, a, t);
1416
+ }, "fade"), Me = /* @__PURE__ */ D((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 {
1424
+ color: ${e.titleColor};
1425
+ }
1426
+
1427
+
1428
+
1429
+ .label text,span {
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
+ .edgePaths .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: ${K(e.mainBkg, .5)};
1502
+ fill: ${K(e.clusterBkg, .5)};
1503
+ stroke: ${K(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 {
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");
1540
+ function q(e, t) {
1541
+ if (e === 0 || !Number.isInteger(e)) throw Error("Columns must be an integer !== 0.");
1542
+ if (t < 0 || !Number.isInteger(t)) throw Error("Position must be a non-negative integer." + t);
1543
+ return e < 0 ? {
1544
+ px: t,
1545
+ py: 0
1546
+ } : e === 1 ? {
1547
+ px: 0,
1548
+ py: t
1549
+ } : {
1550
+ px: t % e,
1551
+ py: Math.floor(t / e)
1552
+ };
1553
+ }
1554
+ D(q, "calculateBlockPosition");
1555
+ var Ne = /* @__PURE__ */ D((e) => {
1556
+ let t = 0, n = 0;
1557
+ for (let r of e.children) {
1558
+ let { width: e, height: i, x: a, y: o } = r.size ?? {
1559
+ width: 0,
1560
+ height: 0,
1561
+ x: 0,
1562
+ y: 0
1563
+ };
1564
+ if (T.debug("getMaxChildSize abc95 child:", r.id, "width:", e, "height:", i, "x:", a, "y:", o, r.type), r.type === "space") continue;
1565
+ let s = e / (r.widthInColumns ?? 1);
1566
+ s > t && (t = s), i > n && (n = i);
1567
+ }
1568
+ return {
1569
+ width: t,
1570
+ height: n
1571
+ };
1572
+ }, "getMaxChildSize");
1573
+ function J(e, t, n = 0, r = 0, i = 8) {
1574
+ T.debug("setBlockSizes abc95 (start)", e.id, e?.size?.x, "block width =", e?.size, "siblingWidth", n), e?.size?.width || (e.size = {
1575
+ width: n,
1576
+ height: r,
1577
+ x: 0,
1578
+ y: 0
1579
+ });
1580
+ let a = 0, o = 0;
1581
+ if (e.children?.length > 0) {
1582
+ for (let n of e.children) J(n, t, 0, 0, i);
1583
+ let s = Ne(e);
1584
+ a = s.width, o = s.height, T.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", a, o);
1585
+ for (let t of e.children) t.size && (T.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, T.debug(`abc95 updating size of ${e.id} children child:${t.id} maxWidth:${a} maxHeight:${o}`));
1586
+ for (let n of e.children) J(n, t, a, o, i);
1587
+ let c = e.columns ?? -1, l = 0;
1588
+ for (let t of e.children) l += t.widthInColumns ?? 1;
1589
+ let u = e.children.length;
1590
+ c > 0 && c < l && (u = c);
1591
+ let d = Math.ceil(l / u), f = u * (a + i) + i, p = d * (o + i) + i;
1592
+ if (f < n) {
1593
+ T.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${n} siblingHeight ${r} width ${f}`), f = n, p = r;
1594
+ let t = (n - u * i - i) / u, s = (r - d * i - i) / d;
1595
+ T.debug("Size indata abc88", e.id, "childWidth", t, "maxWidth", a), T.debug("Size indata abc88", e.id, "childHeight", s, "maxHeight", o), T.debug("Size indata abc88 xSize", u, "padding", i);
1596
+ for (let n of e.children) n.size && (n.size.width = t, n.size.height = s, n.size.x = 0, n.size.y = 0);
1597
+ }
1598
+ if (T.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)) {
1599
+ f = e?.size?.width || 0;
1600
+ let t = c > 0 ? Math.min(e.children.length, c) : e.children.length;
1601
+ if (t > 0) {
1602
+ let n = (f - t * i - i) / t;
1603
+ T.debug("abc95 (growing to fit) width", e.id, f, e.size?.width, n);
1604
+ for (let t of e.children) t.size && (t.size.width = n);
1605
+ }
1606
+ }
1607
+ e.size = {
1608
+ width: f,
1609
+ height: p,
1610
+ x: 0,
1611
+ y: 0
1612
+ };
1613
+ }
1614
+ T.debug("setBlockSizes abc94 (done)", e.id, e?.size?.x, e?.size?.width, e?.size?.y, e?.size?.height);
1615
+ }
1616
+ D(J, "setBlockSizes");
1617
+ function Y(e, t, n = 8) {
1618
+ T.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);
1619
+ let r = e.columns ?? -1;
1620
+ if (T.debug("layoutBlocks columns abc95", e.id, "=>", r, e), e.children && e.children.length > 0) {
1621
+ let i = e?.children[0]?.size?.width ?? 0, a = e.children.length * i + (e.children.length - 1) * n;
1622
+ T.debug("widthOfChildren 88", a, "posX");
1623
+ let o = /* @__PURE__ */ new Map();
1624
+ {
1625
+ let t = 0;
1626
+ for (let n of e.children) {
1627
+ if (!n.size) continue;
1628
+ let { py: e } = q(r, t), i = o.get(e) ?? 0;
1629
+ n.size.height > i && o.set(e, n.size.height);
1630
+ let a = n?.widthInColumns ?? 1;
1631
+ r > 0 && (a = Math.min(a, r - t % r)), t += a;
1632
+ }
1633
+ }
1634
+ let s = /* @__PURE__ */ new Map();
1635
+ {
1636
+ let e = 0, t = [...o.keys()].sort((e, t) => e - t);
1637
+ for (let r of t) s.set(r, e), e += (o.get(r) ?? 0) + n;
1638
+ }
1639
+ let c = 0;
1640
+ T.debug("abc91 block?.size?.x", e.id, e?.size?.x);
1641
+ let l = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -n, u = 0;
1642
+ for (let i of e.children) {
1643
+ let a = e;
1644
+ if (!i.size) continue;
1645
+ let { width: d, height: f } = i.size, { px: p, py: m } = q(r, c);
1646
+ if (m != u && (u = m, l = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -n, T.debug("New row in layout for block", e.id, " and child ", i.id, u)), T.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) {
1647
+ let e = d / 2;
1648
+ i.size.x = l + n + e, T.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;
1649
+ let t = s.get(m) ?? 0, r = o.get(m) ?? f;
1650
+ i.size.y = a.size.y - a.size.height / 2 + t + r / 2 + n, T.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}`);
1651
+ }
1652
+ i.children && Y(i, t, n);
1653
+ let h = i?.widthInColumns ?? 1;
1654
+ r > 0 && (h = Math.min(h, r - c % r)), c += h, T.debug("abc88 columnsPos", i, c);
1655
+ }
1656
+ }
1657
+ T.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);
1658
+ }
1659
+ D(Y, "layoutBlocks");
1660
+ function X(e, { minX: t, minY: n, maxX: r, maxY: i } = {
1661
+ minX: 0,
1662
+ minY: 0,
1663
+ maxX: 0,
1664
+ maxY: 0
1665
+ }) {
1666
+ if (e.size && e.id !== "root") {
1667
+ let { x: a, y: o, width: s, height: c } = e.size;
1668
+ 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);
1669
+ }
1670
+ if (e.children) for (let a of e.children) ({minX: t, minY: n, maxX: r, maxY: i} = X(a, {
1671
+ minX: t,
1672
+ minY: n,
1673
+ maxX: r,
1674
+ maxY: i
1675
+ }));
1676
+ return {
1677
+ minX: t,
1678
+ minY: n,
1679
+ maxX: r,
1680
+ maxY: i
1681
+ };
1682
+ }
1683
+ D(X, "findBounds");
1684
+ function Pe(e) {
1685
+ let t = e.getBlock("root");
1686
+ if (!t) return;
1687
+ let n = ie()?.block?.padding ?? 8;
1688
+ J(t, e, 0, 0, n), Y(t, e, n), T.debug("getBlocks", JSON.stringify(t, null, 2));
1689
+ let { minX: r, minY: i, maxX: a, maxY: o } = X(t), s = o - i;
1690
+ return {
1691
+ x: r,
1692
+ y: i,
1693
+ width: a - r,
1694
+ height: s
1695
+ };
1696
+ }
1697
+ D(Pe, "layout");
1698
+ function Z(e, t, n = !1) {
1699
+ let r = e, i = "default";
1700
+ (r?.classes?.length || 0) > 0 && (i = (r?.classes ?? []).join(" ")), i += " flowchart-label";
1701
+ let a = (r?.classes ?? []).flatMap((e) => t.getClasses().get(e)?.styles ?? []), o = 0, s = "rect", c;
1702
+ switch (r.type) {
1703
+ case "round":
1704
+ o = 5, s = "rect";
1705
+ break;
1706
+ case "composite":
1707
+ o = 0, s = "composite", c = 0;
1708
+ break;
1709
+ case "square":
1710
+ s = "rect";
1711
+ break;
1712
+ case "diamond":
1713
+ s = "question";
1714
+ break;
1715
+ case "hexagon":
1716
+ s = "hexagon";
1717
+ break;
1718
+ case "block_arrow":
1719
+ s = "block_arrow";
1720
+ break;
1721
+ case "odd":
1722
+ s = "rect_left_inv_arrow";
1723
+ break;
1724
+ case "lean_right":
1725
+ s = "lean_right";
1726
+ break;
1727
+ case "lean_left":
1728
+ s = "lean_left";
1729
+ break;
1730
+ case "trapezoid":
1731
+ s = "trapezoid";
1732
+ break;
1733
+ case "inv_trapezoid":
1734
+ s = "inv_trapezoid";
1735
+ break;
1736
+ case "rect_left_inv_arrow":
1737
+ s = "rect_left_inv_arrow";
1738
+ break;
1739
+ case "circle":
1740
+ s = "circle";
1741
+ break;
1742
+ case "ellipse":
1743
+ s = "ellipse";
1744
+ break;
1745
+ case "stadium":
1746
+ s = "stadium";
1747
+ break;
1748
+ case "subroutine":
1749
+ s = "subroutine";
1750
+ break;
1751
+ case "cylinder":
1752
+ s = "cylinder";
1753
+ break;
1754
+ case "group":
1755
+ s = "rect";
1756
+ break;
1757
+ case "doublecircle":
1758
+ s = "doublecircle";
1759
+ break;
1760
+ default: s = "rect";
1761
+ }
1762
+ let l = x(r?.styles ?? []), u = r.label, d = r.size ?? {
1763
+ width: 0,
1764
+ height: 0,
1765
+ x: 0,
1766
+ y: 0
1767
+ }, f = t.getDiagramId();
1768
+ return {
1769
+ labelStyle: l.labelStyle,
1770
+ shape: s,
1771
+ label: u,
1772
+ labelText: u,
1773
+ rx: o,
1774
+ ry: o,
1775
+ class: i,
1776
+ cssClasses: i,
1777
+ cssStyles: r?.styles ?? [],
1778
+ cssCompiledStyles: a,
1779
+ style: l.style,
1780
+ id: r.id,
1781
+ domId: f ? `${f}-${r.id}` : r.id,
1782
+ isGroup: !1,
1783
+ directions: r.directions,
1784
+ width: d.width || void 0,
1785
+ height: d.height || void 0,
1786
+ wrappingWidth: d.width || Infinity,
1787
+ x: d.x,
1788
+ y: d.y,
1789
+ positioned: n,
1790
+ intersect: void 0,
1791
+ padding: c ?? k()?.block?.padding ?? 0,
1792
+ widthInColumns: r.widthInColumns ?? 1
1793
+ };
1794
+ }
1795
+ D(Z, "getNodeFromBlock");
1796
+ async function Fe(e, t, n) {
1797
+ let r = Z(t, n, !1);
1798
+ if (t.type === "group") return;
1799
+ let i = k(), a = await se(e, r, { config: i }), o = a.node()?.getBBox() ?? {
1800
+ width: 0,
1801
+ height: 0
1802
+ }, s = n.getBlock(r.id);
1803
+ s.size = {
1804
+ width: o.width,
1805
+ height: o.height,
1806
+ x: 0,
1807
+ y: 0,
1808
+ node: a
1809
+ }, n.setBlock(s), a.remove();
1810
+ }
1811
+ D(Fe, "calculateBlockSize");
1812
+ async function Q(e, t, n) {
1813
+ let r = Z(t, n, !0);
1814
+ if (n.getBlock(r.id).type !== "space") {
1815
+ let n = k();
1816
+ await se(e, r, { config: n }), t.intersect = r?.intersect, oe(r);
1817
+ }
1818
+ }
1819
+ D(Q, "insertBlockPositioned");
1820
+ async function $(e, t, n, r) {
1821
+ for (let i of t) await r(e, i, n), i.children && await $(e, i.children, n, r);
1822
+ }
1823
+ D($, "performOperations");
1824
+ async function Ie(e, t, n) {
1825
+ await $(e, t, n, Fe);
1826
+ }
1827
+ D(Ie, "calculateBlockSizes");
1828
+ async function Le(e, t, n) {
1829
+ await $(e, t, n, Q);
1830
+ }
1831
+ D(Le, "insertBlocks");
1832
+ async function Re(t, n, r, i, a) {
1833
+ let o = new e({
1834
+ multigraph: !0,
1835
+ compound: !0
1836
+ });
1837
+ o.setGraph({
1838
+ rankdir: "TB",
1839
+ nodesep: 10,
1840
+ ranksep: 10,
1841
+ marginx: 8,
1842
+ marginy: 8
1843
+ });
1844
+ for (let e of r) e.size && o.setNode(e.id, {
1845
+ width: e.size.width,
1846
+ height: e.size.height,
1847
+ intersect: e.intersect
1848
+ });
1849
+ for (let e of n) if (e.start && e.end) {
1850
+ let n = i.getBlock(e.start), r = i.getBlock(e.end);
1851
+ if (n?.size && r?.size) {
1852
+ let i = n.size, s = r.size, c = [
1853
+ {
1854
+ x: i.x,
1855
+ y: i.y
1856
+ },
1857
+ {
1858
+ x: i.x + (s.x - i.x) / 2,
1859
+ y: i.y + (s.y - i.y) / 2
1860
+ },
1861
+ {
1862
+ x: s.x,
1863
+ y: s.y
1864
+ }
1865
+ ], 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`;
1866
+ ue(t, {
1867
+ ...e,
1868
+ id: l,
1869
+ arrowTypeEnd: e.arrowTypeEnd,
1870
+ arrowTypeStart: e.arrowTypeStart,
1871
+ points: c,
1872
+ classes: u
1873
+ }, {}, "block", o.node(e.start), o.node(e.end), a), e.label && (await ce(t, {
1874
+ ...e,
1875
+ label: e.label,
1876
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
1877
+ arrowTypeEnd: e.arrowTypeEnd,
1878
+ arrowTypeStart: e.arrowTypeStart,
1879
+ points: c,
1880
+ classes: u
1881
+ }), le({
1882
+ ...e,
1883
+ x: c[1].x,
1884
+ y: c[1].y
1885
+ }, { originalPath: c }));
1886
+ }
1887
+ }
1888
+ }
1889
+ D(Re, "insertEdges");
1890
+ var ze = {
1891
+ parser: ye,
1892
+ db: je,
1893
+ renderer: {
1894
+ draw: /* @__PURE__ */ D(async function(e, t, n, r) {
1895
+ let { securityLevel: i, block: a } = k(), o = r.db;
1896
+ o.setDiagramId(t);
1897
+ let s;
1898
+ i === "sandbox" && (s = E("#i" + t));
1899
+ let c = E(i === "sandbox" ? s.nodes()[0].contentDocument.body : "body"), l = i === "sandbox" ? c.select(`[id="${t}"]`) : E(`[id="${t}"]`);
1900
+ de(l, [
1901
+ "point",
1902
+ "circle",
1903
+ "cross"
1904
+ ], r.type, t);
1905
+ let u = o.getBlocks(), d = o.getBlocksFlat(), f = o.getEdges(), p = l.insert("g").attr("class", "block");
1906
+ await Ie(p, u, o);
1907
+ let m = Pe(o);
1908
+ await Le(p, u, o), await Re(p, f, d, o, t);
1909
+ let h = p.node()?.getBBox(), g = h && Number.isFinite(h.width) && Number.isFinite(h.height) ? h : m;
1910
+ if (g) {
1911
+ let e = Math.max(1, Math.round(.125 * (g.width / g.height))), t = g.height + e + 10, n = g.width + 10, { useMaxWidth: r } = a;
1912
+ A(l, t, n, !!r), T.debug("Here Bounds", m, g), l.attr("viewBox", `${g.x - 5} ${g.y - 5} ${g.width + 10} ${g.height + 10}`);
1913
+ }
1914
+ }, "draw"),
1915
+ getClasses: /* @__PURE__ */ D(function(e, t) {
1916
+ return t.db.getClasses();
1917
+ }, "getClasses")
1918
+ },
1919
+ styles: Me
1920
+ };
1921
+ //#endregion
1922
+ export { ze as diagram };