@scalar/agent-chat 0.2.3 → 0.2.6

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 (270) hide show
  1. package/LICENSE +21 -0
  2. package/dist/App.vue.d.ts +3 -2
  3. package/dist/App.vue.d.ts.map +1 -1
  4. package/dist/App.vue.js +32 -0
  5. package/dist/App.vue2.js +4 -0
  6. package/dist/Chat.vue.d.ts.map +1 -1
  7. package/dist/Chat.vue.js +23 -0
  8. package/dist/Chat.vue2.js +4 -0
  9. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  10. package/dist/api.d.ts +50 -0
  11. package/dist/api.d.ts.map +1 -0
  12. package/dist/api.js +68 -0
  13. package/dist/components/ApprovalSection.vue.d.ts.map +1 -1
  14. package/dist/components/ApprovalSection.vue.js +7 -0
  15. package/dist/components/ApprovalSection.vue2.js +42 -0
  16. package/dist/components/AuthenticationProvided.vue.d.ts +3 -0
  17. package/dist/components/AuthenticationProvided.vue.d.ts.map +1 -0
  18. package/dist/components/AuthenticationProvided.vue.js +13 -0
  19. package/dist/components/AuthenticationRequired.vue.d.ts +3 -0
  20. package/dist/components/AuthenticationRequired.vue.d.ts.map +1 -0
  21. package/dist/components/AuthenticationRequired.vue.js +13 -0
  22. package/dist/components/AutosendPaused.vue.d.ts.map +1 -1
  23. package/dist/components/AutosendPaused.vue.js +13 -0
  24. package/dist/components/ContextItem.vue.d.ts.map +1 -1
  25. package/dist/components/ContextItem.vue.js +7 -0
  26. package/dist/components/ContextItem.vue2.js +19 -0
  27. package/dist/components/ErrorMessage.vue.d.ts +2 -1
  28. package/dist/components/ErrorMessage.vue.d.ts.map +1 -1
  29. package/dist/components/ErrorMessage.vue.js +7 -0
  30. package/dist/components/ErrorMessage.vue2.js +22 -0
  31. package/dist/components/LoadingMiniOpenAPIDoc.vue.d.ts.map +1 -1
  32. package/dist/components/LoadingMiniOpenAPIDoc.vue.js +14 -0
  33. package/dist/components/LoadingOpenAPISpecsSummary.vue.d.ts.map +1 -1
  34. package/dist/components/LoadingOpenAPISpecsSummary.vue.js +14 -0
  35. package/dist/components/Logo.vue.d.ts.map +1 -1
  36. package/dist/components/Logo.vue.js +23 -0
  37. package/dist/components/PaymentSection.vue.d.ts.map +1 -1
  38. package/dist/components/PaymentSection.vue.js +7 -0
  39. package/dist/components/PaymentSection.vue2.js +34 -0
  40. package/dist/components/RequestApproved.vue.d.ts.map +1 -1
  41. package/dist/components/RequestApproved.vue.js +13 -0
  42. package/dist/components/RequestFailed.vue.d.ts.map +1 -1
  43. package/dist/components/RequestFailed.vue.js +24 -0
  44. package/dist/components/RequestPreview.vue.d.ts +1 -1
  45. package/dist/components/RequestPreview.vue.d.ts.map +1 -1
  46. package/dist/components/RequestPreview.vue.js +7 -0
  47. package/dist/components/RequestPreview.vue2.js +123 -0
  48. package/dist/components/RequestRejected.vue.d.ts.map +1 -1
  49. package/dist/components/RequestRejected.vue.js +22 -0
  50. package/dist/components/RequestSuccess.vue.d.ts.map +1 -1
  51. package/dist/components/RequestSuccess.vue.js +13 -0
  52. package/dist/components/ResponseBody/ResponseBody.vue.d.ts +1 -1
  53. package/dist/components/ResponseBody/ResponseBody.vue.d.ts.map +1 -1
  54. package/dist/components/ResponseBody/ResponseBody.vue.js +41 -0
  55. package/dist/components/ResponseBody/ResponseBody.vue2.js +4 -0
  56. package/dist/components/ResponseBody/ResponseBodyInfo.vue.d.ts.map +1 -1
  57. package/dist/components/ResponseBody/ResponseBodyInfo.vue.js +14 -0
  58. package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts +1 -1
  59. package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts.map +1 -1
  60. package/dist/components/ResponseBody/ResponseBodyPreview.vue.js +7 -0
  61. package/dist/components/ResponseBody/ResponseBodyPreview.vue2.js +65 -0
  62. package/dist/components/ResponseBody/ResponseBodyRaw.vue.d.ts.map +1 -1
  63. package/dist/components/ResponseBody/ResponseBodyRaw.vue.js +20 -0
  64. package/dist/components/ResponseBody/ResponseBodyRaw.vue2.js +4 -0
  65. package/dist/components/ResponseBody/ResponseBodyToggle.vue.d.ts +2 -2
  66. package/dist/components/ResponseBody/ResponseBodyToggle.vue.d.ts.map +1 -1
  67. package/dist/components/ResponseBody/ResponseBodyToggle.vue.js +26 -0
  68. package/dist/components/ResponseBody/ResponseBodyToggle.vue2.js +4 -0
  69. package/dist/components/ResponseBody/helpers/media-types.js +130 -0
  70. package/dist/components/ResponseBody/helpers/process-response-body.d.ts +1 -1
  71. package/dist/components/ResponseBody/helpers/process-response-body.d.ts.map +1 -1
  72. package/dist/components/ResponseBody/helpers/process-response-body.js +33 -0
  73. package/dist/components/SearchPopover.vue.d.ts +2 -2
  74. package/dist/components/SearchPopover.vue.d.ts.map +1 -1
  75. package/dist/components/SearchPopover.vue.js +7 -0
  76. package/dist/components/SearchPopover.vue2.js +67 -0
  77. package/dist/components/Selector.vue.d.ts +24 -0
  78. package/dist/components/Selector.vue.d.ts.map +1 -0
  79. package/dist/components/Selector.vue.js +67 -0
  80. package/dist/components/Selector.vue2.js +4 -0
  81. package/dist/components/SendingRequest.vue.d.ts.map +1 -1
  82. package/dist/components/SendingRequest.vue.js +24 -0
  83. package/dist/components/ServerSelector.vue.d.ts +22 -0
  84. package/dist/components/ServerSelector.vue.d.ts.map +1 -0
  85. package/dist/components/ServerSelector.vue.js +57 -0
  86. package/dist/components/ServerSelector.vue2.js +4 -0
  87. package/dist/components/Suggestion.vue.d.ts.map +1 -1
  88. package/dist/components/TestRequestButton.vue.d.ts.map +1 -1
  89. package/dist/components/{Endpoint.vue.d.ts → UploadSection.vue.d.ts} +3 -5
  90. package/dist/components/UploadSection.vue.d.ts.map +1 -0
  91. package/dist/components/UploadSection.vue.js +7 -0
  92. package/dist/components/UploadSection.vue2.js +62 -0
  93. package/dist/entities/prompt/constants.d.ts +2 -0
  94. package/dist/entities/prompt/constants.d.ts.map +1 -0
  95. package/dist/entities/prompt/constants.js +4 -0
  96. package/dist/entities/registry/document.d.ts +21 -0
  97. package/dist/entities/registry/document.d.ts.map +1 -0
  98. package/dist/entities/registry/document.js +12 -0
  99. package/dist/entities/tools/ask-for-authentication.d.ts +7 -0
  100. package/dist/entities/tools/ask-for-authentication.d.ts.map +1 -0
  101. package/dist/entities/tools/ask-for-authentication.js +8 -0
  102. package/dist/entities/tools/constants.d.ts +2 -0
  103. package/dist/entities/tools/constants.d.ts.map +1 -0
  104. package/dist/entities/tools/constants.js +4 -0
  105. package/dist/entities/tools/execute-request.d.ts +42 -0
  106. package/dist/entities/tools/execute-request.d.ts.map +1 -0
  107. package/dist/entities/tools/execute-request.js +11 -0
  108. package/dist/entities/tools/get-mini-openapi-spec.d.ts +12 -0
  109. package/dist/entities/tools/get-mini-openapi-spec.d.ts.map +1 -0
  110. package/dist/entities/tools/get-mini-openapi-spec.js +8 -0
  111. package/dist/entities/tools/get-openapi-spec-summary.d.ts +10 -0
  112. package/dist/entities/tools/get-openapi-spec-summary.d.ts.map +1 -0
  113. package/dist/entities/tools/get-openapi-spec-summary.js +4 -0
  114. package/dist/helpers.d.ts +20 -12
  115. package/dist/helpers.d.ts.map +1 -1
  116. package/dist/helpers.js +122 -0
  117. package/dist/hooks/{useChatApprovals.d.ts → use-chat-approvals.d.ts} +1 -1
  118. package/dist/hooks/use-chat-approvals.d.ts.map +1 -0
  119. package/dist/hooks/use-chat-approvals.js +21 -0
  120. package/dist/hooks/use-chat-error.d.ts +14 -0
  121. package/dist/hooks/use-chat-error.d.ts.map +1 -0
  122. package/dist/hooks/use-chat-error.js +23 -0
  123. package/dist/hooks/use-chat-pending-client-tool-parts.d.ts +19 -0
  124. package/dist/hooks/use-chat-pending-client-tool-parts.d.ts.map +1 -0
  125. package/dist/hooks/use-chat-pending-client-tool-parts.js +12 -0
  126. package/dist/hooks/{useChatScroll.d.ts → use-chat-scroll.d.ts} +1 -1
  127. package/dist/hooks/use-chat-scroll.d.ts.map +1 -0
  128. package/dist/hooks/use-chat-scroll.js +16 -0
  129. package/dist/hooks/{useSearch.d.ts → use-search.d.ts} +11 -11
  130. package/dist/hooks/use-search.d.ts.map +1 -0
  131. package/dist/hooks/use-search.js +25 -0
  132. package/dist/hooks/use-term-and-conditions.d.ts +6 -0
  133. package/dist/hooks/use-term-and-conditions.d.ts.map +1 -0
  134. package/dist/hooks/use-term-and-conditions.js +16 -0
  135. package/dist/hooks/use-upload-tmp-document.d.ts +19 -0
  136. package/dist/hooks/use-upload-tmp-document.d.ts.map +1 -0
  137. package/dist/hooks/use-upload-tmp-document.js +64 -0
  138. package/dist/index.d.ts +2 -1
  139. package/dist/index.d.ts.map +1 -1
  140. package/dist/index.js +2 -1
  141. package/dist/package.json +34 -23
  142. package/dist/registry/add-documents-to-store.d.ts +6 -6
  143. package/dist/registry/add-documents-to-store.d.ts.map +1 -1
  144. package/dist/registry/add-documents-to-store.js +40 -0
  145. package/dist/registry/create-document-name.d.ts +2 -0
  146. package/dist/registry/create-document-name.d.ts.map +1 -0
  147. package/dist/registry/create-document-name.js +6 -0
  148. package/dist/state/state.d.ts +20 -8
  149. package/dist/state/state.d.ts.map +1 -1
  150. package/dist/state/state.js +110 -0
  151. package/dist/style.css +1 -1
  152. package/dist/types.d.ts +2 -0
  153. package/dist/types.d.ts.map +1 -0
  154. package/dist/views/Chat/Chat.vue.d.ts.map +1 -1
  155. package/dist/views/Chat/Chat.vue.js +7 -0
  156. package/dist/views/Chat/Chat.vue2.js +77 -0
  157. package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts +10 -0
  158. package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts.map +1 -0
  159. package/dist/views/Chat/Messages/AskForAuthentication.vue.js +7 -0
  160. package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +93 -0
  161. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts +2 -2
  162. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts.map +1 -1
  163. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +7 -0
  164. package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js +23 -0
  165. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts +2 -2
  166. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts.map +1 -1
  167. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.js +7 -0
  168. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue2.js +56 -0
  169. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts +2 -2
  170. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts.map +1 -1
  171. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js +26 -0
  172. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue2.js +4 -0
  173. package/dist/views/Chat/Messages/Text.vue.d.ts.map +1 -1
  174. package/dist/views/Chat/Messages/Text.vue.js +16 -0
  175. package/dist/views/Chat/Messages/Text.vue2.js +4 -0
  176. package/dist/views/Layout.vue.d.ts.map +1 -1
  177. package/dist/views/Layout.vue.js +7 -0
  178. package/dist/views/Layout.vue2.js +23 -0
  179. package/dist/views/PromptForm.vue.d.ts.map +1 -1
  180. package/dist/views/PromptForm.vue.js +7 -0
  181. package/dist/views/PromptForm.vue2.js +212 -0
  182. package/dist/views/Settings/Auth.vue.d.ts.map +1 -1
  183. package/dist/views/Settings/Auth.vue.js +67 -0
  184. package/dist/views/Settings/Auth.vue2.js +4 -0
  185. package/dist/views/Settings/DocSettings.vue.d.ts.map +1 -1
  186. package/dist/views/Settings/DocSettings.vue.js +7 -0
  187. package/dist/views/Settings/DocSettings.vue2.js +48 -0
  188. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  189. package/dist/views/Settings/Settings.vue.js +8 -0
  190. package/dist/views/Settings/Settings.vue2.js +67 -0
  191. package/dist/views/Start.vue.d.ts.map +1 -1
  192. package/dist/views/Start.vue.js +7 -0
  193. package/dist/views/Start.vue2.js +41 -0
  194. package/package.json +52 -7
  195. package/dist/Tooltip-Cm82QgNj.js +0 -575
  196. package/dist/__vite-optional-peer-dep_stream-markdown_markstream-vue_false-sdjmOmXd.js +0 -5
  197. package/dist/__vite-optional-peer-dep_stream-monaco_markstream-vue_false-HdL4xm5U.js +0 -5
  198. package/dist/__vite-optional-peer-dep_vue-i18n_markstream-vue_false-B9Pwe5kz.js +0 -5
  199. package/dist/_basePickBy-hHD8tMGb.js +0 -151
  200. package/dist/_baseUniq-DTF1wuF6.js +0 -614
  201. package/dist/arc-Dw2RQerU.js +0 -83
  202. package/dist/architecture-U656AL7Q-B00Z9eXr.js +0 -36
  203. package/dist/architectureDiagram-VXUJARFQ-BtOffFaM.js +0 -4662
  204. package/dist/blockDiagram-VD42YOAC-BUqFMMQe.js +0 -2261
  205. package/dist/c4Diagram-YG6GDRKO-NrM1YcpG.js +0 -1579
  206. package/dist/channel-105myCGU.js +0 -5
  207. package/dist/chunk-4BX2VUAB-TAxJli7C.js +0 -8
  208. package/dist/chunk-55IACEB6-VXFJ4bz5.js +0 -8
  209. package/dist/chunk-B4BG7PRW-CZDQpfj5.js +0 -1375
  210. package/dist/chunk-DI55MBZ5-D3l7TA-E.js +0 -1370
  211. package/dist/chunk-FMBD7UC4-BMXFm8I3.js +0 -19
  212. package/dist/chunk-QN33PNHL-BOUpbpWp.js +0 -19
  213. package/dist/chunk-QZHKN3VN-C-TEEx05.js +0 -15
  214. package/dist/chunk-TZMSLE5B-BUiROKNR.js +0 -64
  215. package/dist/classDiagram-2ON5EDUG-HQET4ybK.js +0 -16
  216. package/dist/classDiagram-v2-WZHVMYZB-HQET4ybK.js +0 -16
  217. package/dist/clone-CIIO71O9.js +0 -8
  218. package/dist/components/Endpoint.vue.d.ts.map +0 -1
  219. package/dist/cose-bilkent-S5V4N54A-CMsF4n-5.js +0 -2609
  220. package/dist/cytoscape.esm-DfdJODL8.js +0 -18735
  221. package/dist/dagre-6UL2VRFP-DqzdQ6Qg.js +0 -444
  222. package/dist/defaultLocale-BEa-49Qz.js +0 -171
  223. package/dist/diagram-PSM6KHXK-1xyGntw2.js +0 -531
  224. package/dist/diagram-QEK2KX5R-DdZdlAm1.js +0 -217
  225. package/dist/diagram-S2PKOQOG-C80Eo2jp.js +0 -142
  226. package/dist/erDiagram-Q2GNP2WA-DFVRrMXT.js +0 -841
  227. package/dist/flowDiagram-NV44I4VS-D9QK_qqB.js +0 -1620
  228. package/dist/ganttDiagram-LVOFAZNH-Bo1NTkeQ.js +0 -2506
  229. package/dist/gitGraph-F6HP7TQM-C5hdgcgO.js +0 -27
  230. package/dist/gitGraphDiagram-NY62KEGX-BZqnqZh6.js +0 -699
  231. package/dist/graph-Dth4IhEK.js +0 -247
  232. package/dist/hooks/useChatApprovals.d.ts.map +0 -1
  233. package/dist/hooks/useChatOperationBlocks.d.ts +0 -3
  234. package/dist/hooks/useChatOperationBlocks.d.ts.map +0 -1
  235. package/dist/hooks/useChatScroll.d.ts.map +0 -1
  236. package/dist/hooks/useSearch.d.ts.map +0 -1
  237. package/dist/index-BOvT43H8.js +0 -111780
  238. package/dist/index2-B36B-gt0.js +0 -69
  239. package/dist/index3-CtIyYUnG.js +0 -70
  240. package/dist/index4-Dzz91Ao2.js +0 -537
  241. package/dist/index5-Bmz0gMSP.js +0 -590
  242. package/dist/index6-DMB3qTSV.js +0 -196
  243. package/dist/info-NVLQJR56-azt5obk5.js +0 -27
  244. package/dist/infoDiagram-ER5ION4S-DD4Jtctm.js +0 -24
  245. package/dist/infographic_markstream-vue_false-BfsmcXxk.js +0 -5
  246. package/dist/init-DjUOC4st.js +0 -16
  247. package/dist/journeyDiagram-XKPGCS4Q-CXL6UO0r.js +0 -834
  248. package/dist/kanban-definition-3W4ZIXB7-B57do5Wg.js +0 -719
  249. package/dist/katex-SsTUIUTC.js +0 -11688
  250. package/dist/layout-7TCY8eA2.js +0 -1332
  251. package/dist/linear-DSm5i91N.js +0 -625
  252. package/dist/mermaid-parser.core-CUQWpAMM.js +0 -12746
  253. package/dist/mermaid.core-QjuzH7xx.js +0 -14164
  254. package/dist/mhchem-XHl7cef5.js +0 -2306
  255. package/dist/mindmap-definition-VGOIOE7T-DAQyGNAM.js +0 -784
  256. package/dist/ordinal-DfAQgscy.js +0 -61
  257. package/dist/packet-BFZMPI3H-CixuxAEA.js +0 -27
  258. package/dist/pie-7BOR55EZ-D3cgnzR1.js +0 -32
  259. package/dist/pieDiagram-ADFJNKIX-BqxgYwrL.js +0 -161
  260. package/dist/quadrantDiagram-AYHSOK5B-CQ4v-9Hh.js +0 -1022
  261. package/dist/radar-NHE76QYJ-DhV0Od_M.js +0 -27
  262. package/dist/requirementDiagram-UZGBJVZJ-ncWNAgFi.js +0 -850
  263. package/dist/safeRaf-I3a3-dyJ.js +0 -10
  264. package/dist/sankeyDiagram-TZEHDZUN-yCR2_cH5.js +0 -810
  265. package/dist/sequenceDiagram-WL72ISMW-DZ7wqFyd.js +0 -2511
  266. package/dist/stateDiagram-FKZM4ZOC-Dra68Tzi.js +0 -263
  267. package/dist/stateDiagram-v2-4FDKWEC3-CARbPECD.js +0 -16
  268. package/dist/timeline-definition-IT6M3QCI-DEbG9QIM.js +0 -795
  269. package/dist/treemap-KMMF4GRG-CQbPsyWe.js +0 -81
  270. package/dist/xychartDiagram-PRI3JC2R-C94Pu8hL.js +0 -1340
@@ -1,2261 +0,0 @@
1
- import { g as oe } from "./chunk-FMBD7UC4-BMXFm8I3.js";
2
- import { _ as d, E as rt, d as O, e as he, l as L, y as de, A as ge, c as R, ak as ue, R as pe, S as fe, O as xe, al as j, am as Wt, an as ye, u as $, k as be, ao as we, ap as xt, i as yt, aq as me } from "./mermaid.core-QjuzH7xx.js";
3
- import { c as Le } from "./clone-CIIO71O9.js";
4
- import { c as Se } from "./channel-105myCGU.js";
5
- import { G as ke } from "./graph-Dth4IhEK.js";
6
- var bt = (function() {
7
- var e = /* @__PURE__ */ d(function(D, y, g, f) {
8
- for (g = g || {}, f = D.length; f--; g[D[f]] = y) ;
9
- return g;
10
- }, "o"), t = [1, 15], a = [1, 7], i = [1, 13], l = [1, 14], s = [1, 19], r = [1, 16], n = [1, 17], c = [1, 18], u = [8, 30], o = [8, 10, 21, 28, 29, 30, 31, 39, 43, 46], x = [1, 23], w = [1, 24], b = [8, 10, 15, 16, 21, 28, 29, 30, 31, 39, 43, 46], S = [8, 10, 15, 16, 21, 27, 28, 29, 30, 31, 39, 43, 46], v = [1, 49], k = {
11
- trace: /* @__PURE__ */ d(function() {
12
- }, "trace"),
13
- yy: {},
14
- symbols_: { error: 2, spaceLines: 3, SPACELINE: 4, NL: 5, separator: 6, SPACE: 7, EOF: 8, start: 9, BLOCK_DIAGRAM_KEY: 10, document: 11, stop: 12, statement: 13, link: 14, LINK: 15, START_LINK: 16, LINK_LABEL: 17, STR: 18, nodeStatement: 19, columnsStatement: 20, SPACE_BLOCK: 21, blockStatement: 22, classDefStatement: 23, cssClassStatement: 24, styleStatement: 25, node: 26, SIZE: 27, COLUMNS: 28, "id-block": 29, end: 30, NODE_ID: 31, nodeShapeNLabel: 32, dirList: 33, DIR: 34, NODE_DSTART: 35, NODE_DEND: 36, BLOCK_ARROW_START: 37, BLOCK_ARROW_END: 38, classDef: 39, CLASSDEF_ID: 40, CLASSDEF_STYLEOPTS: 41, DEFAULT: 42, class: 43, CLASSENTITY_IDS: 44, STYLECLASS: 45, style: 46, STYLE_ENTITY_IDS: 47, STYLE_DEFINITION_DATA: 48, $accept: 0, $end: 1 },
15
- terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "NODE_ID", 34: "DIR", 35: "NODE_DSTART", 36: "NODE_DEND", 37: "BLOCK_ARROW_START", 38: "BLOCK_ARROW_END", 39: "classDef", 40: "CLASSDEF_ID", 41: "CLASSDEF_STYLEOPTS", 42: "DEFAULT", 43: "class", 44: "CLASSENTITY_IDS", 45: "STYLECLASS", 46: "style", 47: "STYLE_ENTITY_IDS", 48: "STYLE_DEFINITION_DATA" },
16
- productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [33, 1], [33, 2], [32, 3], [32, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
17
- performAction: /* @__PURE__ */ d(function(y, g, f, m, E, h, W) {
18
- var p = h.length - 1;
19
- switch (E) {
20
- case 4:
21
- m.getLogger().debug("Rule: separator (NL) ");
22
- break;
23
- case 5:
24
- m.getLogger().debug("Rule: separator (Space) ");
25
- break;
26
- case 6:
27
- m.getLogger().debug("Rule: separator (EOF) ");
28
- break;
29
- case 7:
30
- m.getLogger().debug("Rule: hierarchy: ", h[p - 1]), m.setHierarchy(h[p - 1]);
31
- break;
32
- case 8:
33
- m.getLogger().debug("Stop NL ");
34
- break;
35
- case 9:
36
- m.getLogger().debug("Stop EOF ");
37
- break;
38
- case 10:
39
- m.getLogger().debug("Stop NL2 ");
40
- break;
41
- case 11:
42
- m.getLogger().debug("Stop EOF2 ");
43
- break;
44
- case 12:
45
- m.getLogger().debug("Rule: statement: ", h[p]), typeof h[p].length == "number" ? this.$ = h[p] : this.$ = [h[p]];
46
- break;
47
- case 13:
48
- m.getLogger().debug("Rule: statement #2: ", h[p - 1]), this.$ = [h[p - 1]].concat(h[p]);
49
- break;
50
- case 14:
51
- m.getLogger().debug("Rule: link: ", h[p], y), this.$ = { edgeTypeStr: h[p], label: "" };
52
- break;
53
- case 15:
54
- m.getLogger().debug("Rule: LABEL link: ", h[p - 3], h[p - 1], h[p]), this.$ = { edgeTypeStr: h[p], label: h[p - 1] };
55
- break;
56
- case 18:
57
- const I = parseInt(h[p]), Z = m.generateId();
58
- this.$ = { id: Z, type: "space", label: "", width: I, children: [] };
59
- break;
60
- case 23:
61
- m.getLogger().debug("Rule: (nodeStatement link node) ", h[p - 2], h[p - 1], h[p], " typestr: ", h[p - 1].edgeTypeStr);
62
- const V = m.edgeStrToEdgeData(h[p - 1].edgeTypeStr);
63
- this.$ = [
64
- { id: h[p - 2].id, label: h[p - 2].label, type: h[p - 2].type, directions: h[p - 2].directions },
65
- { id: h[p - 2].id + "-" + h[p].id, start: h[p - 2].id, end: h[p].id, label: h[p - 1].label, type: "edge", directions: h[p].directions, arrowTypeEnd: V, arrowTypeStart: "arrow_open" },
66
- { id: h[p].id, label: h[p].label, type: m.typeStr2Type(h[p].typeStr), directions: h[p].directions }
67
- ];
68
- break;
69
- case 24:
70
- m.getLogger().debug("Rule: nodeStatement (abc88 node size) ", h[p - 1], h[p]), this.$ = { id: h[p - 1].id, label: h[p - 1].label, type: m.typeStr2Type(h[p - 1].typeStr), directions: h[p - 1].directions, widthInColumns: parseInt(h[p], 10) };
71
- break;
72
- case 25:
73
- m.getLogger().debug("Rule: nodeStatement (node) ", h[p]), this.$ = { id: h[p].id, label: h[p].label, type: m.typeStr2Type(h[p].typeStr), directions: h[p].directions, widthInColumns: 1 };
74
- break;
75
- case 26:
76
- m.getLogger().debug("APA123", this ? this : "na"), m.getLogger().debug("COLUMNS: ", h[p]), this.$ = { type: "column-setting", columns: h[p] === "auto" ? -1 : parseInt(h[p]) };
77
- break;
78
- case 27:
79
- m.getLogger().debug("Rule: id-block statement : ", h[p - 2], h[p - 1]), m.generateId(), this.$ = { ...h[p - 2], type: "composite", children: h[p - 1] };
80
- break;
81
- case 28:
82
- m.getLogger().debug("Rule: blockStatement : ", h[p - 2], h[p - 1], h[p]);
83
- const at = m.generateId();
84
- this.$ = { id: at, type: "composite", label: "", children: h[p - 1] };
85
- break;
86
- case 29:
87
- m.getLogger().debug("Rule: node (NODE_ID separator): ", h[p]), this.$ = { id: h[p] };
88
- break;
89
- case 30:
90
- m.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", h[p - 1], h[p]), this.$ = { id: h[p - 1], label: h[p].label, typeStr: h[p].typeStr, directions: h[p].directions };
91
- break;
92
- case 31:
93
- m.getLogger().debug("Rule: dirList: ", h[p]), this.$ = [h[p]];
94
- break;
95
- case 32:
96
- m.getLogger().debug("Rule: dirList: ", h[p - 1], h[p]), this.$ = [h[p - 1]].concat(h[p]);
97
- break;
98
- case 33:
99
- m.getLogger().debug("Rule: nodeShapeNLabel: ", h[p - 2], h[p - 1], h[p]), this.$ = { typeStr: h[p - 2] + h[p], label: h[p - 1] };
100
- break;
101
- case 34:
102
- m.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", h[p - 3], h[p - 2], " #3:", h[p - 1], h[p]), this.$ = { typeStr: h[p - 3] + h[p], label: h[p - 2], directions: h[p - 1] };
103
- break;
104
- case 35:
105
- case 36:
106
- this.$ = { type: "classDef", id: h[p - 1].trim(), css: h[p].trim() };
107
- break;
108
- case 37:
109
- this.$ = { type: "applyClass", id: h[p - 1].trim(), styleClass: h[p].trim() };
110
- break;
111
- case 38:
112
- this.$ = { type: "applyStyles", id: h[p - 1].trim(), stylesStr: h[p].trim() };
113
- break;
114
- }
115
- }, "anonymous"),
116
- table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 10: t, 11: 3, 13: 4, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: i, 29: l, 31: s, 39: r, 43: n, 46: c }, { 8: [1, 20] }, e(u, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 10: t, 21: a, 28: i, 29: l, 31: s, 39: r, 43: n, 46: c }), e(o, [2, 16], { 14: 22, 15: x, 16: w }), e(o, [2, 17]), e(o, [2, 18]), e(o, [2, 19]), e(o, [2, 20]), e(o, [2, 21]), e(o, [2, 22]), e(b, [2, 25], { 27: [1, 25] }), e(o, [2, 26]), { 19: 26, 26: 12, 31: s }, { 10: t, 11: 27, 13: 4, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: i, 29: l, 31: s, 39: r, 43: n, 46: c }, { 40: [1, 28], 42: [1, 29] }, { 44: [1, 30] }, { 47: [1, 31] }, e(S, [2, 29], { 32: 32, 35: [1, 33], 37: [1, 34] }), { 1: [2, 7] }, e(u, [2, 13]), { 26: 35, 31: s }, { 31: [2, 14] }, { 17: [1, 36] }, e(b, [2, 24]), { 10: t, 11: 37, 13: 4, 14: 22, 15: x, 16: w, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: i, 29: l, 31: s, 39: r, 43: n, 46: c }, { 30: [1, 38] }, { 41: [1, 39] }, { 41: [1, 40] }, { 45: [1, 41] }, { 48: [1, 42] }, e(S, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, e(b, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, e(o, [2, 28]), e(o, [2, 35]), e(o, [2, 36]), e(o, [2, 37]), e(o, [2, 38]), { 36: [1, 47] }, { 33: 48, 34: v }, { 15: [1, 50] }, e(o, [2, 27]), e(S, [2, 33]), { 38: [1, 51] }, { 33: 52, 34: v, 38: [2, 31] }, { 31: [2, 15] }, e(S, [2, 34]), { 38: [2, 32] }],
117
- defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
118
- parseError: /* @__PURE__ */ d(function(y, g) {
119
- if (g.recoverable)
120
- this.trace(y);
121
- else {
122
- var f = new Error(y);
123
- throw f.hash = g, f;
124
- }
125
- }, "parseError"),
126
- parse: /* @__PURE__ */ d(function(y) {
127
- var g = this, f = [0], m = [], E = [null], h = [], W = this.table, p = "", I = 0, Z = 0, V = 2, at = 1, ne = h.slice.call(arguments, 1), z = Object.create(this.lexer), q = { yy: {} };
128
- for (var gt in this.yy)
129
- Object.prototype.hasOwnProperty.call(this.yy, gt) && (q.yy[gt] = this.yy[gt]);
130
- z.setInput(y, q.yy), q.yy.lexer = z, q.yy.parser = this, typeof z.yylloc > "u" && (z.yylloc = {});
131
- var ut = z.yylloc;
132
- h.push(ut);
133
- var le = z.options && z.options.ranges;
134
- typeof q.yy.parseError == "function" ? this.parseError = q.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
135
- function ce(P) {
136
- f.length = f.length - 2 * P, E.length = E.length - P, h.length = h.length - P;
137
- }
138
- d(ce, "popStack");
139
- function Nt() {
140
- var P;
141
- return P = m.pop() || z.lex() || at, typeof P != "number" && (P instanceof Array && (m = P, P = m.pop()), P = g.symbols_[P] || P), P;
142
- }
143
- d(Nt, "lex");
144
- for (var F, J, H, pt, Q = {}, st, G, Tt, it; ; ) {
145
- if (J = f[f.length - 1], this.defaultActions[J] ? H = this.defaultActions[J] : ((F === null || typeof F > "u") && (F = Nt()), H = W[J] && W[J][F]), typeof H > "u" || !H.length || !H[0]) {
146
- var ft = "";
147
- it = [];
148
- for (st in W[J])
149
- this.terminals_[st] && st > V && it.push("'" + this.terminals_[st] + "'");
150
- z.showPosition ? ft = "Parse error on line " + (I + 1) + `:
151
- ` + z.showPosition() + `
152
- Expecting ` + it.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : ft = "Parse error on line " + (I + 1) + ": Unexpected " + (F == at ? "end of input" : "'" + (this.terminals_[F] || F) + "'"), this.parseError(ft, {
153
- text: z.match,
154
- token: this.terminals_[F] || F,
155
- line: z.yylineno,
156
- loc: ut,
157
- expected: it
158
- });
159
- }
160
- if (H[0] instanceof Array && H.length > 1)
161
- throw new Error("Parse Error: multiple actions possible at state: " + J + ", token: " + F);
162
- switch (H[0]) {
163
- case 1:
164
- f.push(F), E.push(z.yytext), h.push(z.yylloc), f.push(H[1]), F = null, Z = z.yyleng, p = z.yytext, I = z.yylineno, ut = z.yylloc;
165
- break;
166
- case 2:
167
- if (G = this.productions_[H[1]][1], Q.$ = E[E.length - G], Q._$ = {
168
- first_line: h[h.length - (G || 1)].first_line,
169
- last_line: h[h.length - 1].last_line,
170
- first_column: h[h.length - (G || 1)].first_column,
171
- last_column: h[h.length - 1].last_column
172
- }, le && (Q._$.range = [
173
- h[h.length - (G || 1)].range[0],
174
- h[h.length - 1].range[1]
175
- ]), pt = this.performAction.apply(Q, [
176
- p,
177
- Z,
178
- I,
179
- q.yy,
180
- H[1],
181
- E,
182
- h
183
- ].concat(ne)), typeof pt < "u")
184
- return pt;
185
- G && (f = f.slice(0, -1 * G * 2), E = E.slice(0, -1 * G), h = h.slice(0, -1 * G)), f.push(this.productions_[H[1]][0]), E.push(Q.$), h.push(Q._$), Tt = W[f[f.length - 2]][f[f.length - 1]], f.push(Tt);
186
- break;
187
- case 3:
188
- return !0;
189
- }
190
- }
191
- return !0;
192
- }, "parse")
193
- }, B = /* @__PURE__ */ (function() {
194
- var D = {
195
- EOF: 1,
196
- parseError: /* @__PURE__ */ d(function(g, f) {
197
- if (this.yy.parser)
198
- this.yy.parser.parseError(g, f);
199
- else
200
- throw new Error(g);
201
- }, "parseError"),
202
- // resets the lexer, sets new input
203
- setInput: /* @__PURE__ */ d(function(y, g) {
204
- return this.yy = g || this.yy || {}, this._input = y, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
205
- first_line: 1,
206
- first_column: 0,
207
- last_line: 1,
208
- last_column: 0
209
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
210
- }, "setInput"),
211
- // consumes and returns one char from the input
212
- input: /* @__PURE__ */ d(function() {
213
- var y = this._input[0];
214
- this.yytext += y, this.yyleng++, this.offset++, this.match += y, this.matched += y;
215
- var g = y.match(/(?:\r\n?|\n).*/g);
216
- return g ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), y;
217
- }, "input"),
218
- // unshifts one char (or a string) into the input
219
- unput: /* @__PURE__ */ d(function(y) {
220
- var g = y.length, f = y.split(/(?:\r\n?|\n)/g);
221
- this._input = y + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - g), this.offset -= g;
222
- var m = this.match.split(/(?:\r\n?|\n)/g);
223
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), f.length - 1 && (this.yylineno -= f.length - 1);
224
- var E = this.yylloc.range;
225
- return this.yylloc = {
226
- first_line: this.yylloc.first_line,
227
- last_line: this.yylineno + 1,
228
- first_column: this.yylloc.first_column,
229
- last_column: f ? (f.length === m.length ? this.yylloc.first_column : 0) + m[m.length - f.length].length - f[0].length : this.yylloc.first_column - g
230
- }, this.options.ranges && (this.yylloc.range = [E[0], E[0] + this.yyleng - g]), this.yyleng = this.yytext.length, this;
231
- }, "unput"),
232
- // When called from action, caches matched text and appends it on next action
233
- more: /* @__PURE__ */ d(function() {
234
- return this._more = !0, this;
235
- }, "more"),
236
- // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
237
- reject: /* @__PURE__ */ d(function() {
238
- if (this.options.backtrack_lexer)
239
- this._backtrack = !0;
240
- else
241
- 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).
242
- ` + this.showPosition(), {
243
- text: "",
244
- token: null,
245
- line: this.yylineno
246
- });
247
- return this;
248
- }, "reject"),
249
- // retain first n characters of the match
250
- less: /* @__PURE__ */ d(function(y) {
251
- this.unput(this.match.slice(y));
252
- }, "less"),
253
- // displays already matched input, i.e. for error messages
254
- pastInput: /* @__PURE__ */ d(function() {
255
- var y = this.matched.substr(0, this.matched.length - this.match.length);
256
- return (y.length > 20 ? "..." : "") + y.substr(-20).replace(/\n/g, "");
257
- }, "pastInput"),
258
- // displays upcoming input, i.e. for error messages
259
- upcomingInput: /* @__PURE__ */ d(function() {
260
- var y = this.match;
261
- return y.length < 20 && (y += this._input.substr(0, 20 - y.length)), (y.substr(0, 20) + (y.length > 20 ? "..." : "")).replace(/\n/g, "");
262
- }, "upcomingInput"),
263
- // displays the character position where the lexing error occurred, i.e. for error messages
264
- showPosition: /* @__PURE__ */ d(function() {
265
- var y = this.pastInput(), g = new Array(y.length + 1).join("-");
266
- return y + this.upcomingInput() + `
267
- ` + g + "^";
268
- }, "showPosition"),
269
- // test the lexed token: return FALSE when not a match, otherwise return token
270
- test_match: /* @__PURE__ */ d(function(y, g) {
271
- var f, m, E;
272
- if (this.options.backtrack_lexer && (E = {
273
- yylineno: this.yylineno,
274
- yylloc: {
275
- first_line: this.yylloc.first_line,
276
- last_line: this.last_line,
277
- first_column: this.yylloc.first_column,
278
- last_column: this.yylloc.last_column
279
- },
280
- yytext: this.yytext,
281
- match: this.match,
282
- matches: this.matches,
283
- matched: this.matched,
284
- yyleng: this.yyleng,
285
- offset: this.offset,
286
- _more: this._more,
287
- _input: this._input,
288
- yy: this.yy,
289
- conditionStack: this.conditionStack.slice(0),
290
- done: this.done
291
- }, this.options.ranges && (E.yylloc.range = this.yylloc.range.slice(0))), m = y[0].match(/(?:\r\n?|\n).*/g), m && (this.yylineno += m.length), this.yylloc = {
292
- first_line: this.yylloc.last_line,
293
- last_line: this.yylineno + 1,
294
- first_column: this.yylloc.last_column,
295
- last_column: m ? m[m.length - 1].length - m[m.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + y[0].length
296
- }, this.yytext += y[0], this.match += y[0], this.matches = y, 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(y[0].length), this.matched += y[0], f = this.performAction.call(this, this.yy, this, g, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), f)
297
- return f;
298
- if (this._backtrack) {
299
- for (var h in E)
300
- this[h] = E[h];
301
- return !1;
302
- }
303
- return !1;
304
- }, "test_match"),
305
- // return next match in input
306
- next: /* @__PURE__ */ d(function() {
307
- if (this.done)
308
- return this.EOF;
309
- this._input || (this.done = !0);
310
- var y, g, f, m;
311
- this._more || (this.yytext = "", this.match = "");
312
- for (var E = this._currentRules(), h = 0; h < E.length; h++)
313
- if (f = this._input.match(this.rules[E[h]]), f && (!g || f[0].length > g[0].length)) {
314
- if (g = f, m = h, this.options.backtrack_lexer) {
315
- if (y = this.test_match(f, E[h]), y !== !1)
316
- return y;
317
- if (this._backtrack) {
318
- g = !1;
319
- continue;
320
- } else
321
- return !1;
322
- } else if (!this.options.flex)
323
- break;
324
- }
325
- return g ? (y = this.test_match(g, E[m]), y !== !1 ? y : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
326
- ` + this.showPosition(), {
327
- text: "",
328
- token: null,
329
- line: this.yylineno
330
- });
331
- }, "next"),
332
- // return next match that has a token
333
- lex: /* @__PURE__ */ d(function() {
334
- var g = this.next();
335
- return g || this.lex();
336
- }, "lex"),
337
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
338
- begin: /* @__PURE__ */ d(function(g) {
339
- this.conditionStack.push(g);
340
- }, "begin"),
341
- // pop the previously active lexer condition state off the condition stack
342
- popState: /* @__PURE__ */ d(function() {
343
- var g = this.conditionStack.length - 1;
344
- return g > 0 ? this.conditionStack.pop() : this.conditionStack[0];
345
- }, "popState"),
346
- // produce the lexer rule set which is active for the currently active lexer condition state
347
- _currentRules: /* @__PURE__ */ d(function() {
348
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
349
- }, "_currentRules"),
350
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
351
- topState: /* @__PURE__ */ d(function(g) {
352
- return g = this.conditionStack.length - 1 - Math.abs(g || 0), g >= 0 ? this.conditionStack[g] : "INITIAL";
353
- }, "topState"),
354
- // alias for begin(condition)
355
- pushState: /* @__PURE__ */ d(function(g) {
356
- this.begin(g);
357
- }, "pushState"),
358
- // return the number of states currently on the stack
359
- stateStackSize: /* @__PURE__ */ d(function() {
360
- return this.conditionStack.length;
361
- }, "stateStackSize"),
362
- options: {},
363
- performAction: /* @__PURE__ */ d(function(g, f, m, E) {
364
- switch (m) {
365
- case 0:
366
- return g.getLogger().debug("Found block-beta"), 10;
367
- case 1:
368
- return g.getLogger().debug("Found id-block"), 29;
369
- case 2:
370
- return g.getLogger().debug("Found block"), 10;
371
- case 3:
372
- g.getLogger().debug(".", f.yytext);
373
- break;
374
- case 4:
375
- g.getLogger().debug("_", f.yytext);
376
- break;
377
- case 5:
378
- return 5;
379
- case 6:
380
- return f.yytext = -1, 28;
381
- case 7:
382
- return f.yytext = f.yytext.replace(/columns\s+/, ""), g.getLogger().debug("COLUMNS (LEX)", f.yytext), 28;
383
- case 8:
384
- this.pushState("md_string");
385
- break;
386
- case 9:
387
- return "MD_STR";
388
- case 10:
389
- this.popState();
390
- break;
391
- case 11:
392
- this.pushState("string");
393
- break;
394
- case 12:
395
- g.getLogger().debug("LEX: POPPING STR:", f.yytext), this.popState();
396
- break;
397
- case 13:
398
- return g.getLogger().debug("LEX: STR end:", f.yytext), "STR";
399
- case 14:
400
- return f.yytext = f.yytext.replace(/space\:/, ""), g.getLogger().debug("SPACE NUM (LEX)", f.yytext), 21;
401
- case 15:
402
- return f.yytext = "1", g.getLogger().debug("COLUMNS (LEX)", f.yytext), 21;
403
- case 16:
404
- return 42;
405
- case 17:
406
- return "LINKSTYLE";
407
- case 18:
408
- return "INTERPOLATE";
409
- case 19:
410
- return this.pushState("CLASSDEF"), 39;
411
- case 20:
412
- return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
413
- case 21:
414
- return this.popState(), this.pushState("CLASSDEFID"), 40;
415
- case 22:
416
- return this.popState(), 41;
417
- case 23:
418
- return this.pushState("CLASS"), 43;
419
- case 24:
420
- return this.popState(), this.pushState("CLASS_STYLE"), 44;
421
- case 25:
422
- return this.popState(), 45;
423
- case 26:
424
- return this.pushState("STYLE_STMNT"), 46;
425
- case 27:
426
- return this.popState(), this.pushState("STYLE_DEFINITION"), 47;
427
- case 28:
428
- return this.popState(), 48;
429
- case 29:
430
- return this.pushState("acc_title"), "acc_title";
431
- case 30:
432
- return this.popState(), "acc_title_value";
433
- case 31:
434
- return this.pushState("acc_descr"), "acc_descr";
435
- case 32:
436
- return this.popState(), "acc_descr_value";
437
- case 33:
438
- this.pushState("acc_descr_multiline");
439
- break;
440
- case 34:
441
- this.popState();
442
- break;
443
- case 35:
444
- return "acc_descr_multiline_value";
445
- case 36:
446
- return 30;
447
- case 37:
448
- return this.popState(), g.getLogger().debug("Lex: (("), "NODE_DEND";
449
- case 38:
450
- return this.popState(), g.getLogger().debug("Lex: (("), "NODE_DEND";
451
- case 39:
452
- return this.popState(), g.getLogger().debug("Lex: ))"), "NODE_DEND";
453
- case 40:
454
- return this.popState(), g.getLogger().debug("Lex: (("), "NODE_DEND";
455
- case 41:
456
- return this.popState(), g.getLogger().debug("Lex: (("), "NODE_DEND";
457
- case 42:
458
- return this.popState(), g.getLogger().debug("Lex: (-"), "NODE_DEND";
459
- case 43:
460
- return this.popState(), g.getLogger().debug("Lex: -)"), "NODE_DEND";
461
- case 44:
462
- return this.popState(), g.getLogger().debug("Lex: (("), "NODE_DEND";
463
- case 45:
464
- return this.popState(), g.getLogger().debug("Lex: ]]"), "NODE_DEND";
465
- case 46:
466
- return this.popState(), g.getLogger().debug("Lex: ("), "NODE_DEND";
467
- case 47:
468
- return this.popState(), g.getLogger().debug("Lex: ])"), "NODE_DEND";
469
- case 48:
470
- return this.popState(), g.getLogger().debug("Lex: /]"), "NODE_DEND";
471
- case 49:
472
- return this.popState(), g.getLogger().debug("Lex: /]"), "NODE_DEND";
473
- case 50:
474
- return this.popState(), g.getLogger().debug("Lex: )]"), "NODE_DEND";
475
- case 51:
476
- return this.popState(), g.getLogger().debug("Lex: )"), "NODE_DEND";
477
- case 52:
478
- return this.popState(), g.getLogger().debug("Lex: ]>"), "NODE_DEND";
479
- case 53:
480
- return this.popState(), g.getLogger().debug("Lex: ]"), "NODE_DEND";
481
- case 54:
482
- return g.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 35;
483
- case 55:
484
- return g.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 35;
485
- case 56:
486
- return g.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 35;
487
- case 57:
488
- return g.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
489
- case 58:
490
- return g.getLogger().debug("Lex: ((("), this.pushState("NODE"), 35;
491
- case 59:
492
- return g.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
493
- case 60:
494
- return g.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
495
- case 61:
496
- return g.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
497
- case 62:
498
- return g.getLogger().debug("Lexc: >"), this.pushState("NODE"), 35;
499
- case 63:
500
- return g.getLogger().debug("Lexa: (["), this.pushState("NODE"), 35;
501
- case 64:
502
- return g.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
503
- case 65:
504
- return this.pushState("NODE"), 35;
505
- case 66:
506
- return this.pushState("NODE"), 35;
507
- case 67:
508
- return this.pushState("NODE"), 35;
509
- case 68:
510
- return this.pushState("NODE"), 35;
511
- case 69:
512
- return this.pushState("NODE"), 35;
513
- case 70:
514
- return this.pushState("NODE"), 35;
515
- case 71:
516
- return this.pushState("NODE"), 35;
517
- case 72:
518
- return g.getLogger().debug("Lexa: ["), this.pushState("NODE"), 35;
519
- case 73:
520
- return this.pushState("BLOCK_ARROW"), g.getLogger().debug("LEX ARR START"), 37;
521
- case 74:
522
- return g.getLogger().debug("Lex: NODE_ID", f.yytext), 31;
523
- case 75:
524
- return g.getLogger().debug("Lex: EOF", f.yytext), 8;
525
- case 76:
526
- this.pushState("md_string");
527
- break;
528
- case 77:
529
- this.pushState("md_string");
530
- break;
531
- case 78:
532
- return "NODE_DESCR";
533
- case 79:
534
- this.popState();
535
- break;
536
- case 80:
537
- g.getLogger().debug("Lex: Starting string"), this.pushState("string");
538
- break;
539
- case 81:
540
- g.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
541
- break;
542
- case 82:
543
- return g.getLogger().debug("LEX: NODE_DESCR:", f.yytext), "NODE_DESCR";
544
- case 83:
545
- g.getLogger().debug("LEX POPPING"), this.popState();
546
- break;
547
- case 84:
548
- g.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
549
- break;
550
- case 85:
551
- return f.yytext = f.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (right): dir:", f.yytext), "DIR";
552
- case 86:
553
- return f.yytext = f.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (left):", f.yytext), "DIR";
554
- case 87:
555
- return f.yytext = f.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (x):", f.yytext), "DIR";
556
- case 88:
557
- return f.yytext = f.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (y):", f.yytext), "DIR";
558
- case 89:
559
- return f.yytext = f.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (up):", f.yytext), "DIR";
560
- case 90:
561
- return f.yytext = f.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (down):", f.yytext), "DIR";
562
- case 91:
563
- return f.yytext = "]>", g.getLogger().debug("Lex (ARROW_DIR end):", f.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
564
- case 92:
565
- return g.getLogger().debug("Lex: LINK", "#" + f.yytext + "#"), 15;
566
- case 93:
567
- return g.getLogger().debug("Lex: LINK", f.yytext), 15;
568
- case 94:
569
- return g.getLogger().debug("Lex: LINK", f.yytext), 15;
570
- case 95:
571
- return g.getLogger().debug("Lex: LINK", f.yytext), 15;
572
- case 96:
573
- return g.getLogger().debug("Lex: START_LINK", f.yytext), this.pushState("LLABEL"), 16;
574
- case 97:
575
- return g.getLogger().debug("Lex: START_LINK", f.yytext), this.pushState("LLABEL"), 16;
576
- case 98:
577
- return g.getLogger().debug("Lex: START_LINK", f.yytext), this.pushState("LLABEL"), 16;
578
- case 99:
579
- this.pushState("md_string");
580
- break;
581
- case 100:
582
- return g.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
583
- case 101:
584
- return this.popState(), g.getLogger().debug("Lex: LINK", "#" + f.yytext + "#"), 15;
585
- case 102:
586
- return this.popState(), g.getLogger().debug("Lex: LINK", f.yytext), 15;
587
- case 103:
588
- return this.popState(), g.getLogger().debug("Lex: LINK", f.yytext), 15;
589
- case 104:
590
- return g.getLogger().debug("Lex: COLON", f.yytext), f.yytext = f.yytext.slice(1), 27;
591
- }
592
- }, "anonymous"),
593
- rules: [/^(?:block-beta\b)/, /^(?:block:)/, /^(?:block\b)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
594
- conditions: { STYLE_DEFINITION: { rules: [28], inclusive: !1 }, STYLE_STMNT: { rules: [27], inclusive: !1 }, CLASSDEFID: { rules: [22], inclusive: !1 }, CLASSDEF: { rules: [20, 21], inclusive: !1 }, CLASS_STYLE: { rules: [25], inclusive: !1 }, CLASS: { rules: [24], inclusive: !1 }, LLABEL: { rules: [99, 100, 101, 102, 103], inclusive: !1 }, ARROW_DIR: { rules: [85, 86, 87, 88, 89, 90, 91], inclusive: !1 }, BLOCK_ARROW: { rules: [76, 81, 84], inclusive: !1 }, NODE: { rules: [37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 77, 80], inclusive: !1 }, md_string: { rules: [9, 10, 78, 79], inclusive: !1 }, space: { rules: [], inclusive: !1 }, string: { rules: [12, 13, 82, 83], inclusive: !1 }, acc_descr_multiline: { rules: [34, 35], inclusive: !1 }, acc_descr: { rules: [32], inclusive: !1 }, acc_title: { rules: [30], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 14, 15, 16, 17, 18, 19, 23, 26, 29, 31, 33, 36, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 92, 93, 94, 95, 96, 97, 98, 104], inclusive: !0 } }
595
- };
596
- return D;
597
- })();
598
- k.lexer = B;
599
- function _() {
600
- this.yy = {};
601
- }
602
- return d(_, "Parser"), _.prototype = k, k.Parser = _, new _();
603
- })();
604
- bt.parser = bt;
605
- var ve = bt, X = /* @__PURE__ */ new Map(), kt = [], wt = /* @__PURE__ */ new Map(), Bt = "color", Ct = "fill", Ee = "bgFill", Pt = ",", _e = R(), ct = /* @__PURE__ */ new Map(), De = /* @__PURE__ */ d((e) => be.sanitizeText(e, _e), "sanitizeText"), Ne = /* @__PURE__ */ d(function(e, t = "") {
606
- let a = ct.get(e);
607
- a || (a = { id: e, styles: [], textStyles: [] }, ct.set(e, a)), t?.split(Pt).forEach((i) => {
608
- const l = i.replace(/([^;]*);/, "$1").trim();
609
- if (RegExp(Bt).exec(i)) {
610
- const r = l.replace(Ct, Ee).replace(Bt, Ct);
611
- a.textStyles.push(r);
612
- }
613
- a.styles.push(l);
614
- });
615
- }, "addStyleClass"), Te = /* @__PURE__ */ d(function(e, t = "") {
616
- const a = X.get(e);
617
- t != null && (a.styles = t.split(Pt));
618
- }, "addStyle2Node"), Be = /* @__PURE__ */ d(function(e, t) {
619
- e.split(",").forEach(function(a) {
620
- let i = X.get(a);
621
- if (i === void 0) {
622
- const l = a.trim();
623
- i = { id: l, type: "na", children: [] }, X.set(l, i);
624
- }
625
- i.classes || (i.classes = []), i.classes.push(t);
626
- });
627
- }, "setCssClass"), Yt = /* @__PURE__ */ d((e, t) => {
628
- const a = e.flat(), i = [], s = a.find((r) => r?.type === "column-setting")?.columns ?? -1;
629
- for (const r of a) {
630
- if (typeof s == "number" && s > 0 && r.type !== "column-setting" && typeof r.widthInColumns == "number" && r.widthInColumns > s && L.warn(
631
- `Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${s}`
632
- ), r.label && (r.label = De(r.label)), r.type === "classDef") {
633
- Ne(r.id, r.css);
634
- continue;
635
- }
636
- if (r.type === "applyClass") {
637
- Be(r.id, r?.styleClass ?? "");
638
- continue;
639
- }
640
- if (r.type === "applyStyles") {
641
- r?.stylesStr && Te(r.id, r?.stylesStr);
642
- continue;
643
- }
644
- if (r.type === "column-setting")
645
- t.columns = r.columns ?? -1;
646
- else if (r.type === "edge") {
647
- const n = (wt.get(r.id) ?? 0) + 1;
648
- wt.set(r.id, n), r.id = n + "-" + r.id, kt.push(r);
649
- } else {
650
- r.label || (r.type === "composite" ? r.label = "" : r.label = r.id);
651
- const n = X.get(r.id);
652
- if (n === void 0 ? X.set(r.id, r) : (r.type !== "na" && (n.type = r.type), r.label !== r.id && (n.label = r.label)), r.children && Yt(r.children, r), r.type === "space") {
653
- const c = r.width ?? 1;
654
- for (let u = 0; u < c; u++) {
655
- const o = Le(r);
656
- o.id = o.id + "-" + u, X.set(o.id, o), i.push(o);
657
- }
658
- } else n === void 0 && i.push(r);
659
- }
660
- }
661
- t.children = i;
662
- }, "populateBlockDatabase"), vt = [], et = { id: "root", type: "composite", children: [], columns: -1 }, Ce = /* @__PURE__ */ d(() => {
663
- L.debug("Clear called"), de(), et = { id: "root", type: "composite", children: [], columns: -1 }, X = /* @__PURE__ */ new Map([["root", et]]), vt = [], ct = /* @__PURE__ */ new Map(), kt = [], wt = /* @__PURE__ */ new Map();
664
- }, "clear");
665
- function Ht(e) {
666
- switch (L.debug("typeStr2Type", e), e) {
667
- case "[]":
668
- return "square";
669
- case "()":
670
- return L.debug("we have a round"), "round";
671
- case "(())":
672
- return "circle";
673
- case ">]":
674
- return "rect_left_inv_arrow";
675
- case "{}":
676
- return "diamond";
677
- case "{{}}":
678
- return "hexagon";
679
- case "([])":
680
- return "stadium";
681
- case "[[]]":
682
- return "subroutine";
683
- case "[()]":
684
- return "cylinder";
685
- case "((()))":
686
- return "doublecircle";
687
- case "[//]":
688
- return "lean_right";
689
- case "[\\\\]":
690
- return "lean_left";
691
- case "[/\\]":
692
- return "trapezoid";
693
- case "[\\/]":
694
- return "inv_trapezoid";
695
- case "<[]>":
696
- return "block_arrow";
697
- default:
698
- return "na";
699
- }
700
- }
701
- d(Ht, "typeStr2Type");
702
- function Kt(e) {
703
- switch (L.debug("typeStr2Type", e), e) {
704
- case "==":
705
- return "thick";
706
- default:
707
- return "normal";
708
- }
709
- }
710
- d(Kt, "edgeTypeStr2Type");
711
- function Xt(e) {
712
- switch (e.replace(/^[\s-]+|[\s-]+$/g, "")) {
713
- case "x":
714
- return "arrow_cross";
715
- case "o":
716
- return "arrow_circle";
717
- case ">":
718
- return "arrow_point";
719
- default:
720
- return "";
721
- }
722
- }
723
- d(Xt, "edgeStrToEdgeData");
724
- var It = 0, Ie = /* @__PURE__ */ d(() => (It++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + It), "generateId"), Oe = /* @__PURE__ */ d((e) => {
725
- et.children = e, Yt(e, et), vt = et.children;
726
- }, "setHierarchy"), Re = /* @__PURE__ */ d((e) => {
727
- const t = X.get(e);
728
- return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1;
729
- }, "getColumns"), ze = /* @__PURE__ */ d(() => [...X.values()], "getBlocksFlat"), Ae = /* @__PURE__ */ d(() => vt || [], "getBlocks"), Me = /* @__PURE__ */ d(() => kt, "getEdges"), Fe = /* @__PURE__ */ d((e) => X.get(e), "getBlock"), We = /* @__PURE__ */ d((e) => {
730
- X.set(e.id, e);
731
- }, "setBlock"), Pe = /* @__PURE__ */ d(() => L, "getLogger"), Ye = /* @__PURE__ */ d(function() {
732
- return ct;
733
- }, "getClasses"), He = {
734
- getConfig: /* @__PURE__ */ d(() => rt().block, "getConfig"),
735
- typeStr2Type: Ht,
736
- edgeTypeStr2Type: Kt,
737
- edgeStrToEdgeData: Xt,
738
- getLogger: Pe,
739
- getBlocksFlat: ze,
740
- getBlocks: Ae,
741
- getEdges: Me,
742
- setHierarchy: Oe,
743
- getBlock: Fe,
744
- setBlock: We,
745
- getColumns: Re,
746
- getClasses: Ye,
747
- clear: Ce,
748
- generateId: Ie
749
- }, Ke = He, nt = /* @__PURE__ */ d((e, t) => {
750
- const a = Se, i = a(e, "r"), l = a(e, "g"), s = a(e, "b");
751
- return ge(i, l, s, t);
752
- }, "fade"), Xe = /* @__PURE__ */ d((e) => `.label {
753
- font-family: ${e.fontFamily};
754
- color: ${e.nodeTextColor || e.textColor};
755
- }
756
- .cluster-label text {
757
- fill: ${e.titleColor};
758
- }
759
- .cluster-label span,p {
760
- color: ${e.titleColor};
761
- }
762
-
763
-
764
-
765
- .label text,span,p {
766
- fill: ${e.nodeTextColor || e.textColor};
767
- color: ${e.nodeTextColor || e.textColor};
768
- }
769
-
770
- .node rect,
771
- .node circle,
772
- .node ellipse,
773
- .node polygon,
774
- .node path {
775
- fill: ${e.mainBkg};
776
- stroke: ${e.nodeBorder};
777
- stroke-width: 1px;
778
- }
779
- .flowchart-label text {
780
- text-anchor: middle;
781
- }
782
- // .flowchart-label .text-outer-tspan {
783
- // text-anchor: middle;
784
- // }
785
- // .flowchart-label .text-inner-tspan {
786
- // text-anchor: start;
787
- // }
788
-
789
- .node .label {
790
- text-align: center;
791
- }
792
- .node.clickable {
793
- cursor: pointer;
794
- }
795
-
796
- .arrowheadPath {
797
- fill: ${e.arrowheadColor};
798
- }
799
-
800
- .edgePath .path {
801
- stroke: ${e.lineColor};
802
- stroke-width: 2.0px;
803
- }
804
-
805
- .flowchart-link {
806
- stroke: ${e.lineColor};
807
- fill: none;
808
- }
809
-
810
- .edgeLabel {
811
- background-color: ${e.edgeLabelBackground};
812
- rect {
813
- opacity: 0.5;
814
- background-color: ${e.edgeLabelBackground};
815
- fill: ${e.edgeLabelBackground};
816
- }
817
- text-align: center;
818
- }
819
-
820
- /* For html labels only */
821
- .labelBkg {
822
- background-color: ${nt(e.edgeLabelBackground, 0.5)};
823
- // background-color:
824
- }
825
-
826
- .node .cluster {
827
- // fill: ${nt(e.mainBkg, 0.5)};
828
- fill: ${nt(e.clusterBkg, 0.5)};
829
- stroke: ${nt(e.clusterBorder, 0.2)};
830
- box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
831
- stroke-width: 1px;
832
- }
833
-
834
- .cluster text {
835
- fill: ${e.titleColor};
836
- }
837
-
838
- .cluster span,p {
839
- color: ${e.titleColor};
840
- }
841
- /* .cluster div {
842
- color: ${e.titleColor};
843
- } */
844
-
845
- div.mermaidTooltip {
846
- position: absolute;
847
- text-align: center;
848
- max-width: 200px;
849
- padding: 2px;
850
- font-family: ${e.fontFamily};
851
- font-size: 12px;
852
- background: ${e.tertiaryColor};
853
- border: 1px solid ${e.border2};
854
- border-radius: 2px;
855
- pointer-events: none;
856
- z-index: 100;
857
- }
858
-
859
- .flowchartTitleText {
860
- text-anchor: middle;
861
- font-size: 18px;
862
- fill: ${e.textColor};
863
- }
864
- ${oe()}
865
- `, "getStyles"), Ue = Xe, je = /* @__PURE__ */ d((e, t, a, i) => {
866
- t.forEach((l) => {
867
- rr[l](e, a, i);
868
- });
869
- }, "insertMarkers"), Ve = /* @__PURE__ */ d((e, t, a) => {
870
- L.trace("Making markers for ", a), e.append("defs").append("marker").attr("id", a + "_" + 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", a + "_" + 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");
871
- }, "extension"), Ge = /* @__PURE__ */ d((e, t, a) => {
872
- e.append("defs").append("marker").attr("id", a + "_" + 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", a + "_" + 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");
873
- }, "composition"), Ze = /* @__PURE__ */ d((e, t, a) => {
874
- e.append("defs").append("marker").attr("id", a + "_" + 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", a + "_" + 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");
875
- }, "aggregation"), qe = /* @__PURE__ */ d((e, t, a) => {
876
- e.append("defs").append("marker").attr("id", a + "_" + 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", a + "_" + 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");
877
- }, "dependency"), Je = /* @__PURE__ */ d((e, t, a) => {
878
- e.append("defs").append("marker").attr("id", a + "_" + 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", a + "_" + 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);
879
- }, "lollipop"), Qe = /* @__PURE__ */ d((e, t, a) => {
880
- e.append("marker").attr("id", a + "_" + 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", a + "_" + 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");
881
- }, "point"), $e = /* @__PURE__ */ d((e, t, a) => {
882
- e.append("marker").attr("id", a + "_" + 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", a + "_" + 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");
883
- }, "circle"), tr = /* @__PURE__ */ d((e, t, a) => {
884
- e.append("marker").attr("id", a + "_" + 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", a + "_" + 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");
885
- }, "cross"), er = /* @__PURE__ */ d((e, t, a) => {
886
- e.append("defs").append("marker").attr("id", a + "_" + 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");
887
- }, "barb"), rr = {
888
- extension: Ve,
889
- composition: Ge,
890
- aggregation: Ze,
891
- dependency: qe,
892
- lollipop: Je,
893
- point: Qe,
894
- circle: $e,
895
- cross: tr,
896
- barb: er
897
- }, ar = je, C = R()?.block?.padding ?? 8;
898
- function Ut(e, t) {
899
- if (e === 0 || !Number.isInteger(e))
900
- throw new Error("Columns must be an integer !== 0.");
901
- if (t < 0 || !Number.isInteger(t))
902
- throw new Error("Position must be a non-negative integer." + t);
903
- if (e < 0)
904
- return { px: t, py: 0 };
905
- if (e === 1)
906
- return { px: 0, py: t };
907
- const a = t % e, i = Math.floor(t / e);
908
- return { px: a, py: i };
909
- }
910
- d(Ut, "calculateBlockPosition");
911
- var sr = /* @__PURE__ */ d((e) => {
912
- let t = 0, a = 0;
913
- for (const i of e.children) {
914
- const { width: l, height: s, x: r, y: n } = i.size ?? { width: 0, height: 0, x: 0, y: 0 };
915
- L.debug(
916
- "getMaxChildSize abc95 child:",
917
- i.id,
918
- "width:",
919
- l,
920
- "height:",
921
- s,
922
- "x:",
923
- r,
924
- "y:",
925
- n,
926
- i.type
927
- ), i.type !== "space" && (l > t && (t = l / (e.widthInColumns ?? 1)), s > a && (a = s));
928
- }
929
- return { width: t, height: a };
930
- }, "getMaxChildSize");
931
- function ot(e, t, a = 0, i = 0) {
932
- L.debug(
933
- "setBlockSizes abc95 (start)",
934
- e.id,
935
- e?.size?.x,
936
- "block width =",
937
- e?.size,
938
- "siblingWidth",
939
- a
940
- ), e?.size?.width || (e.size = {
941
- width: a,
942
- height: i,
943
- x: 0,
944
- y: 0
945
- });
946
- let l = 0, s = 0;
947
- if (e.children?.length > 0) {
948
- for (const b of e.children)
949
- ot(b, t);
950
- const r = sr(e);
951
- l = r.width, s = r.height, L.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", l, s);
952
- for (const b of e.children)
953
- b.size && (L.debug(
954
- `abc95 Setting size of children of ${e.id} id=${b.id} ${l} ${s} ${JSON.stringify(b.size)}`
955
- ), b.size.width = l * (b.widthInColumns ?? 1) + C * ((b.widthInColumns ?? 1) - 1), b.size.height = s, b.size.x = 0, b.size.y = 0, L.debug(
956
- `abc95 updating size of ${e.id} children child:${b.id} maxWidth:${l} maxHeight:${s}`
957
- ));
958
- for (const b of e.children)
959
- ot(b, t, l, s);
960
- const n = e.columns ?? -1;
961
- let c = 0;
962
- for (const b of e.children)
963
- c += b.widthInColumns ?? 1;
964
- let u = e.children.length;
965
- n > 0 && n < c && (u = n);
966
- const o = Math.ceil(c / u);
967
- let x = u * (l + C) + C, w = o * (s + C) + C;
968
- if (x < a) {
969
- L.debug(
970
- `Detected to small sibling: abc95 ${e.id} siblingWidth ${a} siblingHeight ${i} width ${x}`
971
- ), x = a, w = i;
972
- const b = (a - u * C - C) / u, S = (i - o * C - C) / o;
973
- L.debug("Size indata abc88", e.id, "childWidth", b, "maxWidth", l), L.debug("Size indata abc88", e.id, "childHeight", S, "maxHeight", s), L.debug("Size indata abc88 xSize", u, "padding", C);
974
- for (const v of e.children)
975
- v.size && (v.size.width = b, v.size.height = S, v.size.x = 0, v.size.y = 0);
976
- }
977
- if (L.debug(
978
- `abc95 (finale calc) ${e.id} xSize ${u} ySize ${o} columns ${n}${e.children.length} width=${Math.max(x, e.size?.width || 0)}`
979
- ), x < (e?.size?.width || 0)) {
980
- x = e?.size?.width || 0;
981
- const b = n > 0 ? Math.min(e.children.length, n) : e.children.length;
982
- if (b > 0) {
983
- const S = (x - b * C - C) / b;
984
- L.debug("abc95 (growing to fit) width", e.id, x, e.size?.width, S);
985
- for (const v of e.children)
986
- v.size && (v.size.width = S);
987
- }
988
- }
989
- e.size = {
990
- width: x,
991
- height: w,
992
- x: 0,
993
- y: 0
994
- };
995
- }
996
- L.debug(
997
- "setBlockSizes abc94 (done)",
998
- e.id,
999
- e?.size?.x,
1000
- e?.size?.width,
1001
- e?.size?.y,
1002
- e?.size?.height
1003
- );
1004
- }
1005
- d(ot, "setBlockSizes");
1006
- function Et(e, t) {
1007
- L.debug(
1008
- `abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`
1009
- );
1010
- const a = e.columns ?? -1;
1011
- if (L.debug("layoutBlocks columns abc95", e.id, "=>", a, e), e.children && // find max width of children
1012
- e.children.length > 0) {
1013
- const i = e?.children[0]?.size?.width ?? 0, l = e.children.length * i + (e.children.length - 1) * C;
1014
- L.debug("widthOfChildren 88", l, "posX");
1015
- let s = 0;
1016
- L.debug("abc91 block?.size?.x", e.id, e?.size?.x);
1017
- let r = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -C, n = 0;
1018
- for (const c of e.children) {
1019
- const u = e;
1020
- if (!c.size)
1021
- continue;
1022
- const { width: o, height: x } = c.size, { px: w, py: b } = Ut(a, s);
1023
- if (b != n && (n = b, r = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -C, L.debug("New row in layout for block", e.id, " and child ", c.id, n)), L.debug(
1024
- `abc89 layout blocks (child) id: ${c.id} Pos: ${s} (px, py) ${w},${b} (${u?.size?.x},${u?.size?.y}) parent: ${u.id} width: ${o}${C}`
1025
- ), u.size) {
1026
- const v = o / 2;
1027
- c.size.x = r + C + v, L.debug(
1028
- `abc91 layout blocks (calc) px, pyid:${c.id} startingPos=X${r} new startingPosX${c.size.x} ${v} padding=${C} width=${o} halfWidth=${v} => x:${c.size.x} y:${c.size.y} ${c.widthInColumns} (width * (child?.w || 1)) / 2 ${o * (c?.widthInColumns ?? 1) / 2}`
1029
- ), r = c.size.x + v, c.size.y = u.size.y - u.size.height / 2 + b * (x + C) + x / 2 + C, L.debug(
1030
- `abc88 layout blocks (calc) px, pyid:${c.id}startingPosX${r}${C}${v}=>x:${c.size.x}y:${c.size.y}${c.widthInColumns}(width * (child?.w || 1)) / 2${o * (c?.widthInColumns ?? 1) / 2}`
1031
- );
1032
- }
1033
- c.children && Et(c);
1034
- let S = c?.widthInColumns ?? 1;
1035
- a > 0 && (S = Math.min(S, a - s % a)), s += S, L.debug("abc88 columnsPos", c, s);
1036
- }
1037
- }
1038
- L.debug(
1039
- `layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`
1040
- );
1041
- }
1042
- d(Et, "layoutBlocks");
1043
- function _t(e, { minX: t, minY: a, maxX: i, maxY: l } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
1044
- if (e.size && e.id !== "root") {
1045
- const { x: s, y: r, width: n, height: c } = e.size;
1046
- s - n / 2 < t && (t = s - n / 2), r - c / 2 < a && (a = r - c / 2), s + n / 2 > i && (i = s + n / 2), r + c / 2 > l && (l = r + c / 2);
1047
- }
1048
- if (e.children)
1049
- for (const s of e.children)
1050
- ({ minX: t, minY: a, maxX: i, maxY: l } = _t(s, { minX: t, minY: a, maxX: i, maxY: l }));
1051
- return { minX: t, minY: a, maxX: i, maxY: l };
1052
- }
1053
- d(_t, "findBounds");
1054
- function jt(e) {
1055
- const t = e.getBlock("root");
1056
- if (!t)
1057
- return;
1058
- ot(t, e, 0, 0), Et(t), L.debug("getBlocks", JSON.stringify(t, null, 2));
1059
- const { minX: a, minY: i, maxX: l, maxY: s } = _t(t), r = s - i, n = l - a;
1060
- return { x: a, y: i, width: n, height: r };
1061
- }
1062
- d(jt, "layout");
1063
- function mt(e, t) {
1064
- t && e.attr("style", t);
1065
- }
1066
- d(mt, "applyStyle");
1067
- function Vt(e, t) {
1068
- const a = O(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), i = a.append("xhtml:div"), l = e.label, s = e.isNode ? "nodeLabel" : "edgeLabel", r = i.append("span");
1069
- return r.html(yt(l, t)), mt(r, e.labelStyle), r.attr("class", s), mt(i, e.labelStyle), i.style("display", "inline-block"), i.style("white-space", "nowrap"), i.attr("xmlns", "http://www.w3.org/1999/xhtml"), a.node();
1070
- }
1071
- d(Vt, "addHtmlLabel");
1072
- var ir = /* @__PURE__ */ d(async (e, t, a, i) => {
1073
- let l = e || "";
1074
- typeof l == "object" && (l = l[0]);
1075
- const s = R();
1076
- if (j(s.flowchart.htmlLabels)) {
1077
- l = l.replace(/\\n|\n/g, "<br />"), L.debug("vertexText" + l);
1078
- const r = await we(xt(l)), n = {
1079
- isNode: i,
1080
- label: r,
1081
- labelStyle: t.replace("fill:", "color:")
1082
- };
1083
- return Vt(n, s);
1084
- } else {
1085
- const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
1086
- r.setAttribute("style", t.replace("color:", "fill:"));
1087
- let n = [];
1088
- typeof l == "string" ? n = l.split(/\\n|\n|<br\s*\/?>/gi) : Array.isArray(l) ? n = l : n = [];
1089
- for (const c of n) {
1090
- const u = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
1091
- u.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), u.setAttribute("dy", "1em"), u.setAttribute("x", "0"), a ? u.setAttribute("class", "title-row") : u.setAttribute("class", "row"), u.textContent = c.trim(), r.appendChild(u);
1092
- }
1093
- return r;
1094
- }
1095
- }, "createLabel"), K = ir, nr = /* @__PURE__ */ d((e, t, a, i, l) => {
1096
- t.arrowTypeStart && Ot(e, "start", t.arrowTypeStart, a, i, l), t.arrowTypeEnd && Ot(e, "end", t.arrowTypeEnd, a, i, l);
1097
- }, "addEdgeMarkers"), lr = {
1098
- arrow_cross: "cross",
1099
- arrow_point: "point",
1100
- arrow_barb: "barb",
1101
- arrow_circle: "circle",
1102
- aggregation: "aggregation",
1103
- extension: "extension",
1104
- composition: "composition",
1105
- dependency: "dependency",
1106
- lollipop: "lollipop"
1107
- }, Ot = /* @__PURE__ */ d((e, t, a, i, l, s) => {
1108
- const r = lr[a];
1109
- if (!r) {
1110
- L.warn(`Unknown arrow type: ${a}`);
1111
- return;
1112
- }
1113
- const n = t === "start" ? "Start" : "End";
1114
- e.attr(`marker-${t}`, `url(${i}#${l}_${s}-${r}${n})`);
1115
- }, "addEdgeMarker"), Lt = {}, M = {}, cr = /* @__PURE__ */ d(async (e, t) => {
1116
- const a = R(), i = j(a.flowchart.htmlLabels), l = t.labelType === "markdown" ? Wt(
1117
- e,
1118
- t.label,
1119
- {
1120
- style: t.labelStyle,
1121
- useHtmlLabels: i,
1122
- addSvgBackground: !0
1123
- },
1124
- a
1125
- ) : await K(t.label, t.labelStyle), s = e.insert("g").attr("class", "edgeLabel"), r = s.insert("g").attr("class", "label");
1126
- r.node().appendChild(l);
1127
- let n = l.getBBox();
1128
- if (i) {
1129
- const u = l.children[0], o = O(l);
1130
- n = u.getBoundingClientRect(), o.attr("width", n.width), o.attr("height", n.height);
1131
- }
1132
- r.attr("transform", "translate(" + -n.width / 2 + ", " + -n.height / 2 + ")"), Lt[t.id] = s, t.width = n.width, t.height = n.height;
1133
- let c;
1134
- if (t.startLabelLeft) {
1135
- const u = await K(t.startLabelLeft, t.labelStyle), o = e.insert("g").attr("class", "edgeTerminals"), x = o.insert("g").attr("class", "inner");
1136
- c = x.node().appendChild(u);
1137
- const w = u.getBBox();
1138
- x.attr("transform", "translate(" + -w.width / 2 + ", " + -w.height / 2 + ")"), M[t.id] || (M[t.id] = {}), M[t.id].startLeft = o, tt(c, t.startLabelLeft);
1139
- }
1140
- if (t.startLabelRight) {
1141
- const u = await K(t.startLabelRight, t.labelStyle), o = e.insert("g").attr("class", "edgeTerminals"), x = o.insert("g").attr("class", "inner");
1142
- c = o.node().appendChild(u), x.node().appendChild(u);
1143
- const w = u.getBBox();
1144
- x.attr("transform", "translate(" + -w.width / 2 + ", " + -w.height / 2 + ")"), M[t.id] || (M[t.id] = {}), M[t.id].startRight = o, tt(c, t.startLabelRight);
1145
- }
1146
- if (t.endLabelLeft) {
1147
- const u = await K(t.endLabelLeft, t.labelStyle), o = e.insert("g").attr("class", "edgeTerminals"), x = o.insert("g").attr("class", "inner");
1148
- c = x.node().appendChild(u);
1149
- const w = u.getBBox();
1150
- x.attr("transform", "translate(" + -w.width / 2 + ", " + -w.height / 2 + ")"), o.node().appendChild(u), M[t.id] || (M[t.id] = {}), M[t.id].endLeft = o, tt(c, t.endLabelLeft);
1151
- }
1152
- if (t.endLabelRight) {
1153
- const u = await K(t.endLabelRight, t.labelStyle), o = e.insert("g").attr("class", "edgeTerminals"), x = o.insert("g").attr("class", "inner");
1154
- c = x.node().appendChild(u);
1155
- const w = u.getBBox();
1156
- x.attr("transform", "translate(" + -w.width / 2 + ", " + -w.height / 2 + ")"), o.node().appendChild(u), M[t.id] || (M[t.id] = {}), M[t.id].endRight = o, tt(c, t.endLabelRight);
1157
- }
1158
- return l;
1159
- }, "insertEdgeLabel");
1160
- function tt(e, t) {
1161
- R().flowchart.htmlLabels && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px");
1162
- }
1163
- d(tt, "setTerminalWidth");
1164
- var or = /* @__PURE__ */ d((e, t) => {
1165
- L.debug("Moving label abc88 ", e.id, e.label, Lt[e.id], t);
1166
- let a = t.updatedPath ? t.updatedPath : t.originalPath;
1167
- const i = R(), { subGraphTitleTotalMargin: l } = ye(i);
1168
- if (e.label) {
1169
- const s = Lt[e.id];
1170
- let r = e.x, n = e.y;
1171
- if (a) {
1172
- const c = $.calcLabelPosition(a);
1173
- L.debug(
1174
- "Moving label " + e.label + " from (",
1175
- r,
1176
- ",",
1177
- n,
1178
- ") to (",
1179
- c.x,
1180
- ",",
1181
- c.y,
1182
- ") abc88"
1183
- ), t.updatedPath && (r = c.x, n = c.y);
1184
- }
1185
- s.attr("transform", `translate(${r}, ${n + l / 2})`);
1186
- }
1187
- if (e.startLabelLeft) {
1188
- const s = M[e.id].startLeft;
1189
- let r = e.x, n = e.y;
1190
- if (a) {
1191
- const c = $.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", a);
1192
- r = c.x, n = c.y;
1193
- }
1194
- s.attr("transform", `translate(${r}, ${n})`);
1195
- }
1196
- if (e.startLabelRight) {
1197
- const s = M[e.id].startRight;
1198
- let r = e.x, n = e.y;
1199
- if (a) {
1200
- const c = $.calcTerminalLabelPosition(
1201
- e.arrowTypeStart ? 10 : 0,
1202
- "start_right",
1203
- a
1204
- );
1205
- r = c.x, n = c.y;
1206
- }
1207
- s.attr("transform", `translate(${r}, ${n})`);
1208
- }
1209
- if (e.endLabelLeft) {
1210
- const s = M[e.id].endLeft;
1211
- let r = e.x, n = e.y;
1212
- if (a) {
1213
- const c = $.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", a);
1214
- r = c.x, n = c.y;
1215
- }
1216
- s.attr("transform", `translate(${r}, ${n})`);
1217
- }
1218
- if (e.endLabelRight) {
1219
- const s = M[e.id].endRight;
1220
- let r = e.x, n = e.y;
1221
- if (a) {
1222
- const c = $.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", a);
1223
- r = c.x, n = c.y;
1224
- }
1225
- s.attr("transform", `translate(${r}, ${n})`);
1226
- }
1227
- }, "positionEdgeLabel"), hr = /* @__PURE__ */ d((e, t) => {
1228
- const a = e.x, i = e.y, l = Math.abs(t.x - a), s = Math.abs(t.y - i), r = e.width / 2, n = e.height / 2;
1229
- return l >= r || s >= n;
1230
- }, "outsideNode"), dr = /* @__PURE__ */ d((e, t, a) => {
1231
- L.debug(`intersection calc abc89:
1232
- outsidePoint: ${JSON.stringify(t)}
1233
- insidePoint : ${JSON.stringify(a)}
1234
- node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);
1235
- const i = e.x, l = e.y, s = Math.abs(i - a.x), r = e.width / 2;
1236
- let n = a.x < t.x ? r - s : r + s;
1237
- const c = e.height / 2, u = Math.abs(t.y - a.y), o = Math.abs(t.x - a.x);
1238
- if (Math.abs(l - t.y) * r > Math.abs(i - t.x) * c) {
1239
- let x = a.y < t.y ? t.y - c - l : l - c - t.y;
1240
- n = o * x / u;
1241
- const w = {
1242
- x: a.x < t.x ? a.x + n : a.x - o + n,
1243
- y: a.y < t.y ? a.y + u - x : a.y - u + x
1244
- };
1245
- return n === 0 && (w.x = t.x, w.y = t.y), o === 0 && (w.x = t.x), u === 0 && (w.y = t.y), L.debug(`abc89 topp/bott calc, Q ${u}, q ${x}, R ${o}, r ${n}`, w), w;
1246
- } else {
1247
- a.x < t.x ? n = t.x - r - i : n = i - r - t.x;
1248
- let x = u * n / o, w = a.x < t.x ? a.x + o - n : a.x - o + n, b = a.y < t.y ? a.y + x : a.y - x;
1249
- return L.debug(`sides calc abc89, Q ${u}, q ${x}, R ${o}, r ${n}`, { _x: w, _y: b }), n === 0 && (w = t.x, b = t.y), o === 0 && (w = t.x), u === 0 && (b = t.y), { x: w, y: b };
1250
- }
1251
- }, "intersection"), Rt = /* @__PURE__ */ d((e, t) => {
1252
- L.debug("abc88 cutPathAtIntersect", e, t);
1253
- let a = [], i = e[0], l = !1;
1254
- return e.forEach((s) => {
1255
- if (!hr(t, s) && !l) {
1256
- const r = dr(t, i, s);
1257
- let n = !1;
1258
- a.forEach((c) => {
1259
- n = n || c.x === r.x && c.y === r.y;
1260
- }), a.some((c) => c.x === r.x && c.y === r.y) || a.push(r), l = !0;
1261
- } else
1262
- i = s, l || a.push(s);
1263
- }), a;
1264
- }, "cutPathAtIntersect"), gr = /* @__PURE__ */ d(function(e, t, a, i, l, s, r) {
1265
- let n = a.points;
1266
- L.debug("abc88 InsertEdge: edge=", a, "e=", t);
1267
- let c = !1;
1268
- const u = s.node(t.v);
1269
- var o = s.node(t.w);
1270
- o?.intersect && u?.intersect && (n = n.slice(1, a.points.length - 1), n.unshift(u.intersect(n[0])), n.push(o.intersect(n[n.length - 1]))), a.toCluster && (L.debug("to cluster abc88", i[a.toCluster]), n = Rt(a.points, i[a.toCluster].node), c = !0), a.fromCluster && (L.debug("from cluster abc88", i[a.fromCluster]), n = Rt(n.reverse(), i[a.fromCluster].node).reverse(), c = !0);
1271
- const x = n.filter((y) => !Number.isNaN(y.y));
1272
- let w = fe;
1273
- a.curve && (l === "graph" || l === "flowchart") && (w = a.curve);
1274
- const { x: b, y: S } = ue(a), v = pe().x(b).y(S).curve(w);
1275
- let k;
1276
- switch (a.thickness) {
1277
- case "normal":
1278
- k = "edge-thickness-normal";
1279
- break;
1280
- case "thick":
1281
- k = "edge-thickness-thick";
1282
- break;
1283
- case "invisible":
1284
- k = "edge-thickness-thick";
1285
- break;
1286
- default:
1287
- k = "";
1288
- }
1289
- switch (a.pattern) {
1290
- case "solid":
1291
- k += " edge-pattern-solid";
1292
- break;
1293
- case "dotted":
1294
- k += " edge-pattern-dotted";
1295
- break;
1296
- case "dashed":
1297
- k += " edge-pattern-dashed";
1298
- break;
1299
- }
1300
- const B = e.append("path").attr("d", v(x)).attr("id", a.id).attr("class", " " + k + (a.classes ? " " + a.classes : "")).attr("style", a.style);
1301
- let _ = "";
1302
- (R().flowchart.arrowMarkerAbsolute || R().state.arrowMarkerAbsolute) && (_ = xe(!0)), nr(B, a, _, r, l);
1303
- let D = {};
1304
- return c && (D.updatedPath = n), D.originalPath = a.points, D;
1305
- }, "insertEdge"), ur = /* @__PURE__ */ d((e) => {
1306
- const t = /* @__PURE__ */ new Set();
1307
- for (const a of e)
1308
- switch (a) {
1309
- case "x":
1310
- t.add("right"), t.add("left");
1311
- break;
1312
- case "y":
1313
- t.add("up"), t.add("down");
1314
- break;
1315
- default:
1316
- t.add(a);
1317
- break;
1318
- }
1319
- return t;
1320
- }, "expandAndDeduplicateDirections"), pr = /* @__PURE__ */ d((e, t, a) => {
1321
- const i = ur(e), l = 2, s = t.height + 2 * a.padding, r = s / l, n = t.width + 2 * r + a.padding, c = a.padding / 2;
1322
- return i.has("right") && i.has("left") && i.has("up") && i.has("down") ? [
1323
- // Bottom
1324
- { x: 0, y: 0 },
1325
- { x: r, y: 0 },
1326
- { x: n / 2, y: 2 * c },
1327
- { x: n - r, y: 0 },
1328
- { x: n, y: 0 },
1329
- // Right
1330
- { x: n, y: -s / 3 },
1331
- { x: n + 2 * c, y: -s / 2 },
1332
- { x: n, y: -2 * s / 3 },
1333
- { x: n, y: -s },
1334
- // Top
1335
- { x: n - r, y: -s },
1336
- { x: n / 2, y: -s - 2 * c },
1337
- { x: r, y: -s },
1338
- // Left
1339
- { x: 0, y: -s },
1340
- { x: 0, y: -2 * s / 3 },
1341
- { x: -2 * c, y: -s / 2 },
1342
- { x: 0, y: -s / 3 }
1343
- ] : i.has("right") && i.has("left") && i.has("up") ? [
1344
- { x: r, y: 0 },
1345
- { x: n - r, y: 0 },
1346
- { x: n, y: -s / 2 },
1347
- { x: n - r, y: -s },
1348
- { x: r, y: -s },
1349
- { x: 0, y: -s / 2 }
1350
- ] : i.has("right") && i.has("left") && i.has("down") ? [
1351
- { x: 0, y: 0 },
1352
- { x: r, y: -s },
1353
- { x: n - r, y: -s },
1354
- { x: n, y: 0 }
1355
- ] : i.has("right") && i.has("up") && i.has("down") ? [
1356
- { x: 0, y: 0 },
1357
- { x: n, y: -r },
1358
- { x: n, y: -s + r },
1359
- { x: 0, y: -s }
1360
- ] : i.has("left") && i.has("up") && i.has("down") ? [
1361
- { x: n, y: 0 },
1362
- { x: 0, y: -r },
1363
- { x: 0, y: -s + r },
1364
- { x: n, y: -s }
1365
- ] : i.has("right") && i.has("left") ? [
1366
- { x: r, y: 0 },
1367
- { x: r, y: -c },
1368
- { x: n - r, y: -c },
1369
- { x: n - r, y: 0 },
1370
- { x: n, y: -s / 2 },
1371
- { x: n - r, y: -s },
1372
- { x: n - r, y: -s + c },
1373
- { x: r, y: -s + c },
1374
- { x: r, y: -s },
1375
- { x: 0, y: -s / 2 }
1376
- ] : i.has("up") && i.has("down") ? [
1377
- // Bottom center
1378
- { x: n / 2, y: 0 },
1379
- // Left pont of bottom arrow
1380
- { x: 0, y: -c },
1381
- { x: r, y: -c },
1382
- // Left top over vertical section
1383
- { x: r, y: -s + c },
1384
- { x: 0, y: -s + c },
1385
- // Top of arrow
1386
- { x: n / 2, y: -s },
1387
- { x: n, y: -s + c },
1388
- // Top of right vertical bar
1389
- { x: n - r, y: -s + c },
1390
- { x: n - r, y: -c },
1391
- { x: n, y: -c }
1392
- ] : i.has("right") && i.has("up") ? [
1393
- { x: 0, y: 0 },
1394
- { x: n, y: -r },
1395
- { x: 0, y: -s }
1396
- ] : i.has("right") && i.has("down") ? [
1397
- { x: 0, y: 0 },
1398
- { x: n, y: 0 },
1399
- { x: 0, y: -s }
1400
- ] : i.has("left") && i.has("up") ? [
1401
- { x: n, y: 0 },
1402
- { x: 0, y: -r },
1403
- { x: n, y: -s }
1404
- ] : i.has("left") && i.has("down") ? [
1405
- { x: n, y: 0 },
1406
- { x: 0, y: 0 },
1407
- { x: n, y: -s }
1408
- ] : i.has("right") ? [
1409
- { x: r, y: -c },
1410
- { x: r, y: -c },
1411
- { x: n - r, y: -c },
1412
- { x: n - r, y: 0 },
1413
- { x: n, y: -s / 2 },
1414
- { x: n - r, y: -s },
1415
- { x: n - r, y: -s + c },
1416
- // top left corner of arrow
1417
- { x: r, y: -s + c },
1418
- { x: r, y: -s + c }
1419
- ] : i.has("left") ? [
1420
- { x: r, y: 0 },
1421
- { x: r, y: -c },
1422
- // Two points, the right corners
1423
- { x: n - r, y: -c },
1424
- { x: n - r, y: -s + c },
1425
- { x: r, y: -s + c },
1426
- { x: r, y: -s },
1427
- { x: 0, y: -s / 2 }
1428
- ] : i.has("up") ? [
1429
- // Bottom center
1430
- { x: r, y: -c },
1431
- // Left top over vertical section
1432
- { x: r, y: -s + c },
1433
- { x: 0, y: -s + c },
1434
- // Top of arrow
1435
- { x: n / 2, y: -s },
1436
- { x: n, y: -s + c },
1437
- // Top of right vertical bar
1438
- { x: n - r, y: -s + c },
1439
- { x: n - r, y: -c }
1440
- ] : i.has("down") ? [
1441
- // Bottom center
1442
- { x: n / 2, y: 0 },
1443
- // Left pont of bottom arrow
1444
- { x: 0, y: -c },
1445
- { x: r, y: -c },
1446
- // Left top over vertical section
1447
- { x: r, y: -s + c },
1448
- { x: n - r, y: -s + c },
1449
- { x: n - r, y: -c },
1450
- { x: n, y: -c }
1451
- ] : [{ x: 0, y: 0 }];
1452
- }, "getArrowPoints");
1453
- function Gt(e, t) {
1454
- return e.intersect(t);
1455
- }
1456
- d(Gt, "intersectNode");
1457
- var fr = Gt;
1458
- function Zt(e, t, a, i) {
1459
- var l = e.x, s = e.y, r = l - i.x, n = s - i.y, c = Math.sqrt(t * t * n * n + a * a * r * r), u = Math.abs(t * a * r / c);
1460
- i.x < l && (u = -u);
1461
- var o = Math.abs(t * a * n / c);
1462
- return i.y < s && (o = -o), { x: l + u, y: s + o };
1463
- }
1464
- d(Zt, "intersectEllipse");
1465
- var qt = Zt;
1466
- function Jt(e, t, a) {
1467
- return qt(e, t, t, a);
1468
- }
1469
- d(Jt, "intersectCircle");
1470
- var xr = Jt;
1471
- function Qt(e, t, a, i) {
1472
- var l, s, r, n, c, u, o, x, w, b, S, v, k, B, _;
1473
- if (l = t.y - e.y, r = e.x - t.x, c = t.x * e.y - e.x * t.y, w = l * a.x + r * a.y + c, b = l * i.x + r * i.y + c, !(w !== 0 && b !== 0 && St(w, b)) && (s = i.y - a.y, n = a.x - i.x, u = i.x * a.y - a.x * i.y, o = s * e.x + n * e.y + u, x = s * t.x + n * t.y + u, !(o !== 0 && x !== 0 && St(o, x)) && (S = l * n - s * r, S !== 0)))
1474
- return v = Math.abs(S / 2), k = r * u - n * c, B = k < 0 ? (k - v) / S : (k + v) / S, k = s * c - l * u, _ = k < 0 ? (k - v) / S : (k + v) / S, { x: B, y: _ };
1475
- }
1476
- d(Qt, "intersectLine");
1477
- function St(e, t) {
1478
- return e * t > 0;
1479
- }
1480
- d(St, "sameSign");
1481
- var yr = Qt, br = $t;
1482
- function $t(e, t, a) {
1483
- var i = e.x, l = e.y, s = [], r = Number.POSITIVE_INFINITY, n = Number.POSITIVE_INFINITY;
1484
- typeof t.forEach == "function" ? t.forEach(function(S) {
1485
- r = Math.min(r, S.x), n = Math.min(n, S.y);
1486
- }) : (r = Math.min(r, t.x), n = Math.min(n, t.y));
1487
- for (var c = i - e.width / 2 - r, u = l - e.height / 2 - n, o = 0; o < t.length; o++) {
1488
- var x = t[o], w = t[o < t.length - 1 ? o + 1 : 0], b = yr(
1489
- e,
1490
- a,
1491
- { x: c + x.x, y: u + x.y },
1492
- { x: c + w.x, y: u + w.y }
1493
- );
1494
- b && s.push(b);
1495
- }
1496
- return s.length ? (s.length > 1 && s.sort(function(S, v) {
1497
- var k = S.x - a.x, B = S.y - a.y, _ = Math.sqrt(k * k + B * B), D = v.x - a.x, y = v.y - a.y, g = Math.sqrt(D * D + y * y);
1498
- return _ < g ? -1 : _ === g ? 0 : 1;
1499
- }), s[0]) : e;
1500
- }
1501
- d($t, "intersectPolygon");
1502
- var wr = /* @__PURE__ */ d((e, t) => {
1503
- var a = e.x, i = e.y, l = t.x - a, s = t.y - i, r = e.width / 2, n = e.height / 2, c, u;
1504
- return Math.abs(s) * r > Math.abs(l) * n ? (s < 0 && (n = -n), c = s === 0 ? 0 : n * l / s, u = n) : (l < 0 && (r = -r), c = r, u = l === 0 ? 0 : r * s / l), { x: a + c, y: i + u };
1505
- }, "intersectRect"), mr = wr, N = {
1506
- node: fr,
1507
- circle: xr,
1508
- ellipse: qt,
1509
- polygon: br,
1510
- rect: mr
1511
- }, A = /* @__PURE__ */ d(async (e, t, a, i) => {
1512
- const l = R();
1513
- let s;
1514
- const r = t.useHtmlLabels || j(l.flowchart.htmlLabels);
1515
- a ? s = a : s = "node default";
1516
- const n = e.insert("g").attr("class", s).attr("id", t.domId || t.id), c = n.insert("g").attr("class", "label").attr("style", t.labelStyle);
1517
- let u;
1518
- t.labelText === void 0 ? u = "" : u = typeof t.labelText == "string" ? t.labelText : t.labelText[0];
1519
- const o = c.node();
1520
- let x;
1521
- t.labelType === "markdown" ? x = Wt(
1522
- c,
1523
- yt(xt(u), l),
1524
- {
1525
- useHtmlLabels: r,
1526
- width: t.width || l.flowchart.wrappingWidth,
1527
- classes: "markdown-node-label"
1528
- },
1529
- l
1530
- ) : x = o.appendChild(
1531
- await K(
1532
- yt(xt(u), l),
1533
- t.labelStyle,
1534
- !1,
1535
- i
1536
- )
1537
- );
1538
- let w = x.getBBox();
1539
- const b = t.padding / 2;
1540
- if (j(l.flowchart.htmlLabels)) {
1541
- const S = x.children[0], v = O(x), k = S.getElementsByTagName("img");
1542
- if (k) {
1543
- const B = u.replace(/<img[^>]*>/g, "").trim() === "";
1544
- await Promise.all(
1545
- [...k].map(
1546
- (_) => new Promise((D) => {
1547
- function y() {
1548
- if (_.style.display = "flex", _.style.flexDirection = "column", B) {
1549
- const g = l.fontSize ? l.fontSize : window.getComputedStyle(document.body).fontSize, m = parseInt(g, 10) * 5 + "px";
1550
- _.style.minWidth = m, _.style.maxWidth = m;
1551
- } else
1552
- _.style.width = "100%";
1553
- D(_);
1554
- }
1555
- d(y, "setupImage"), setTimeout(() => {
1556
- _.complete && y();
1557
- }), _.addEventListener("error", y), _.addEventListener("load", y);
1558
- })
1559
- )
1560
- );
1561
- }
1562
- w = S.getBoundingClientRect(), v.attr("width", w.width), v.attr("height", w.height);
1563
- }
1564
- return r ? c.attr("transform", "translate(" + -w.width / 2 + ", " + -w.height / 2 + ")") : c.attr("transform", "translate(0, " + -w.height / 2 + ")"), t.centerLabel && c.attr("transform", "translate(" + -w.width / 2 + ", " + -w.height / 2 + ")"), c.insert("rect", ":first-child"), { shapeSvg: n, bbox: w, halfPadding: b, label: c };
1565
- }, "labelHelper"), T = /* @__PURE__ */ d((e, t) => {
1566
- const a = t.node().getBBox();
1567
- e.width = a.width, e.height = a.height;
1568
- }, "updateNodeBounds");
1569
- function U(e, t, a, i) {
1570
- return e.insert("polygon", ":first-child").attr(
1571
- "points",
1572
- i.map(function(l) {
1573
- return l.x + "," + l.y;
1574
- }).join(" ")
1575
- ).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + a / 2 + ")");
1576
- }
1577
- d(U, "insertPolygonShape");
1578
- var Lr = /* @__PURE__ */ d(async (e, t) => {
1579
- t.useHtmlLabels || R().flowchart.htmlLabels || (t.centerLabel = !0);
1580
- const { shapeSvg: i, bbox: l, halfPadding: s } = await A(
1581
- e,
1582
- t,
1583
- "node " + t.classes,
1584
- !0
1585
- );
1586
- L.info("Classes = ", t.classes);
1587
- const r = i.insert("rect", ":first-child");
1588
- return r.attr("rx", t.rx).attr("ry", t.ry).attr("x", -l.width / 2 - s).attr("y", -l.height / 2 - s).attr("width", l.width + t.padding).attr("height", l.height + t.padding), T(t, r), t.intersect = function(n) {
1589
- return N.rect(t, n);
1590
- }, i;
1591
- }, "note"), Sr = Lr, zt = /* @__PURE__ */ d((e) => e ? " " + e : "", "formatClass"), Y = /* @__PURE__ */ d((e, t) => `${t || "node default"}${zt(e.classes)} ${zt(
1592
- e.class
1593
- )}`, "getClassesFromNode"), At = /* @__PURE__ */ d(async (e, t) => {
1594
- const { shapeSvg: a, bbox: i } = await A(
1595
- e,
1596
- t,
1597
- Y(t, void 0),
1598
- !0
1599
- ), l = i.width + t.padding, s = i.height + t.padding, r = l + s, n = [
1600
- { x: r / 2, y: 0 },
1601
- { x: r, y: -r / 2 },
1602
- { x: r / 2, y: -r },
1603
- { x: 0, y: -r / 2 }
1604
- ];
1605
- L.info("Question main (Circle)");
1606
- const c = U(a, r, r, n);
1607
- return c.attr("style", t.style), T(t, c), t.intersect = function(u) {
1608
- return L.warn("Intersect called"), N.polygon(t, n, u);
1609
- }, a;
1610
- }, "question"), kr = /* @__PURE__ */ d((e, t) => {
1611
- const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = 28, l = [
1612
- { x: 0, y: i / 2 },
1613
- { x: i / 2, y: 0 },
1614
- { x: 0, y: -i / 2 },
1615
- { x: -i / 2, y: 0 }
1616
- ];
1617
- return a.insert("polygon", ":first-child").attr(
1618
- "points",
1619
- l.map(function(r) {
1620
- return r.x + "," + r.y;
1621
- }).join(" ")
1622
- ).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(r) {
1623
- return N.circle(t, 14, r);
1624
- }, a;
1625
- }, "choice"), vr = /* @__PURE__ */ d(async (e, t) => {
1626
- const { shapeSvg: a, bbox: i } = await A(
1627
- e,
1628
- t,
1629
- Y(t, void 0),
1630
- !0
1631
- ), l = 4, s = i.height + t.padding, r = s / l, n = i.width + 2 * r + t.padding, c = [
1632
- { x: r, y: 0 },
1633
- { x: n - r, y: 0 },
1634
- { x: n, y: -s / 2 },
1635
- { x: n - r, y: -s },
1636
- { x: r, y: -s },
1637
- { x: 0, y: -s / 2 }
1638
- ], u = U(a, n, s, c);
1639
- return u.attr("style", t.style), T(t, u), t.intersect = function(o) {
1640
- return N.polygon(t, c, o);
1641
- }, a;
1642
- }, "hexagon"), Er = /* @__PURE__ */ d(async (e, t) => {
1643
- const { shapeSvg: a, bbox: i } = await A(e, t, void 0, !0), l = 2, s = i.height + 2 * t.padding, r = s / l, n = i.width + 2 * r + t.padding, c = pr(t.directions, i, t), u = U(a, n, s, c);
1644
- return u.attr("style", t.style), T(t, u), t.intersect = function(o) {
1645
- return N.polygon(t, c, o);
1646
- }, a;
1647
- }, "block_arrow"), _r = /* @__PURE__ */ d(async (e, t) => {
1648
- const { shapeSvg: a, bbox: i } = await A(
1649
- e,
1650
- t,
1651
- Y(t, void 0),
1652
- !0
1653
- ), l = i.width + t.padding, s = i.height + t.padding, r = [
1654
- { x: -s / 2, y: 0 },
1655
- { x: l, y: 0 },
1656
- { x: l, y: -s },
1657
- { x: -s / 2, y: -s },
1658
- { x: 0, y: -s / 2 }
1659
- ];
1660
- return U(a, l, s, r).attr("style", t.style), t.width = l + s, t.height = s, t.intersect = function(c) {
1661
- return N.polygon(t, r, c);
1662
- }, a;
1663
- }, "rect_left_inv_arrow"), Dr = /* @__PURE__ */ d(async (e, t) => {
1664
- const { shapeSvg: a, bbox: i } = await A(e, t, Y(t), !0), l = i.width + t.padding, s = i.height + t.padding, r = [
1665
- { x: -2 * s / 6, y: 0 },
1666
- { x: l - s / 6, y: 0 },
1667
- { x: l + 2 * s / 6, y: -s },
1668
- { x: s / 6, y: -s }
1669
- ], n = U(a, l, s, r);
1670
- return n.attr("style", t.style), T(t, n), t.intersect = function(c) {
1671
- return N.polygon(t, r, c);
1672
- }, a;
1673
- }, "lean_right"), Nr = /* @__PURE__ */ d(async (e, t) => {
1674
- const { shapeSvg: a, bbox: i } = await A(
1675
- e,
1676
- t,
1677
- Y(t, void 0),
1678
- !0
1679
- ), l = i.width + t.padding, s = i.height + t.padding, r = [
1680
- { x: 2 * s / 6, y: 0 },
1681
- { x: l + s / 6, y: 0 },
1682
- { x: l - 2 * s / 6, y: -s },
1683
- { x: -s / 6, y: -s }
1684
- ], n = U(a, l, s, r);
1685
- return n.attr("style", t.style), T(t, n), t.intersect = function(c) {
1686
- return N.polygon(t, r, c);
1687
- }, a;
1688
- }, "lean_left"), Tr = /* @__PURE__ */ d(async (e, t) => {
1689
- const { shapeSvg: a, bbox: i } = await A(
1690
- e,
1691
- t,
1692
- Y(t, void 0),
1693
- !0
1694
- ), l = i.width + t.padding, s = i.height + t.padding, r = [
1695
- { x: -2 * s / 6, y: 0 },
1696
- { x: l + 2 * s / 6, y: 0 },
1697
- { x: l - s / 6, y: -s },
1698
- { x: s / 6, y: -s }
1699
- ], n = U(a, l, s, r);
1700
- return n.attr("style", t.style), T(t, n), t.intersect = function(c) {
1701
- return N.polygon(t, r, c);
1702
- }, a;
1703
- }, "trapezoid"), Br = /* @__PURE__ */ d(async (e, t) => {
1704
- const { shapeSvg: a, bbox: i } = await A(
1705
- e,
1706
- t,
1707
- Y(t, void 0),
1708
- !0
1709
- ), l = i.width + t.padding, s = i.height + t.padding, r = [
1710
- { x: s / 6, y: 0 },
1711
- { x: l - s / 6, y: 0 },
1712
- { x: l + 2 * s / 6, y: -s },
1713
- { x: -2 * s / 6, y: -s }
1714
- ], n = U(a, l, s, r);
1715
- return n.attr("style", t.style), T(t, n), t.intersect = function(c) {
1716
- return N.polygon(t, r, c);
1717
- }, a;
1718
- }, "inv_trapezoid"), Cr = /* @__PURE__ */ d(async (e, t) => {
1719
- const { shapeSvg: a, bbox: i } = await A(
1720
- e,
1721
- t,
1722
- Y(t, void 0),
1723
- !0
1724
- ), l = i.width + t.padding, s = i.height + t.padding, r = [
1725
- { x: 0, y: 0 },
1726
- { x: l + s / 2, y: 0 },
1727
- { x: l, y: -s / 2 },
1728
- { x: l + s / 2, y: -s },
1729
- { x: 0, y: -s }
1730
- ], n = U(a, l, s, r);
1731
- return n.attr("style", t.style), T(t, n), t.intersect = function(c) {
1732
- return N.polygon(t, r, c);
1733
- }, a;
1734
- }, "rect_right_inv_arrow"), Ir = /* @__PURE__ */ d(async (e, t) => {
1735
- const { shapeSvg: a, bbox: i } = await A(
1736
- e,
1737
- t,
1738
- Y(t, void 0),
1739
- !0
1740
- ), l = i.width + t.padding, s = l / 2, r = s / (2.5 + l / 50), n = i.height + r + t.padding, c = "M 0," + r + " a " + s + "," + r + " 0,0,0 " + l + " 0 a " + s + "," + r + " 0,0,0 " + -l + " 0 l 0," + n + " a " + s + "," + r + " 0,0,0 " + l + " 0 l 0," + -n, u = a.attr("label-offset-y", r).insert("path", ":first-child").attr("style", t.style).attr("d", c).attr("transform", "translate(" + -l / 2 + "," + -(n / 2 + r) + ")");
1741
- return T(t, u), t.intersect = function(o) {
1742
- const x = N.rect(t, o), w = x.x - t.x;
1743
- if (s != 0 && (Math.abs(w) < t.width / 2 || Math.abs(w) == t.width / 2 && Math.abs(x.y - t.y) > t.height / 2 - r)) {
1744
- let b = r * r * (1 - w * w / (s * s));
1745
- b != 0 && (b = Math.sqrt(b)), b = r - b, o.y - t.y > 0 && (b = -b), x.y += b;
1746
- }
1747
- return x;
1748
- }, a;
1749
- }, "cylinder"), Or = /* @__PURE__ */ d(async (e, t) => {
1750
- const { shapeSvg: a, bbox: i, halfPadding: l } = await A(
1751
- e,
1752
- t,
1753
- "node " + t.classes + " " + t.class,
1754
- !0
1755
- ), s = a.insert("rect", ":first-child"), r = t.positioned ? t.width : i.width + t.padding, n = t.positioned ? t.height : i.height + t.padding, c = t.positioned ? -r / 2 : -i.width / 2 - l, u = t.positioned ? -n / 2 : -i.height / 2 - l;
1756
- if (s.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", c).attr("y", u).attr("width", r).attr("height", n), t.props) {
1757
- const o = new Set(Object.keys(t.props));
1758
- t.props.borders && (ht(s, t.props.borders, r, n), o.delete("borders")), o.forEach((x) => {
1759
- L.warn(`Unknown node property ${x}`);
1760
- });
1761
- }
1762
- return T(t, s), t.intersect = function(o) {
1763
- return N.rect(t, o);
1764
- }, a;
1765
- }, "rect"), Rr = /* @__PURE__ */ d(async (e, t) => {
1766
- const { shapeSvg: a, bbox: i, halfPadding: l } = await A(
1767
- e,
1768
- t,
1769
- "node " + t.classes,
1770
- !0
1771
- ), s = a.insert("rect", ":first-child"), r = t.positioned ? t.width : i.width + t.padding, n = t.positioned ? t.height : i.height + t.padding, c = t.positioned ? -r / 2 : -i.width / 2 - l, u = t.positioned ? -n / 2 : -i.height / 2 - l;
1772
- if (s.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", c).attr("y", u).attr("width", r).attr("height", n), t.props) {
1773
- const o = new Set(Object.keys(t.props));
1774
- t.props.borders && (ht(s, t.props.borders, r, n), o.delete("borders")), o.forEach((x) => {
1775
- L.warn(`Unknown node property ${x}`);
1776
- });
1777
- }
1778
- return T(t, s), t.intersect = function(o) {
1779
- return N.rect(t, o);
1780
- }, a;
1781
- }, "composite"), zr = /* @__PURE__ */ d(async (e, t) => {
1782
- const { shapeSvg: a } = await A(e, t, "label", !0);
1783
- L.trace("Classes = ", t.class);
1784
- const i = a.insert("rect", ":first-child"), l = 0, s = 0;
1785
- if (i.attr("width", l).attr("height", s), a.attr("class", "label edgeLabel"), t.props) {
1786
- const r = new Set(Object.keys(t.props));
1787
- t.props.borders && (ht(i, t.props.borders, l, s), r.delete("borders")), r.forEach((n) => {
1788
- L.warn(`Unknown node property ${n}`);
1789
- });
1790
- }
1791
- return T(t, i), t.intersect = function(r) {
1792
- return N.rect(t, r);
1793
- }, a;
1794
- }, "labelRect");
1795
- function ht(e, t, a, i) {
1796
- const l = [], s = /* @__PURE__ */ d((n) => {
1797
- l.push(n, 0);
1798
- }, "addBorder"), r = /* @__PURE__ */ d((n) => {
1799
- l.push(0, n);
1800
- }, "skipBorder");
1801
- t.includes("t") ? (L.debug("add top border"), s(a)) : r(a), t.includes("r") ? (L.debug("add right border"), s(i)) : r(i), t.includes("b") ? (L.debug("add bottom border"), s(a)) : r(a), t.includes("l") ? (L.debug("add left border"), s(i)) : r(i), e.attr("stroke-dasharray", l.join(" "));
1802
- }
1803
- d(ht, "applyNodePropertyBorders");
1804
- var Ar = /* @__PURE__ */ d(async (e, t) => {
1805
- let a;
1806
- t.classes ? a = "node " + t.classes : a = "node default";
1807
- const i = e.insert("g").attr("class", a).attr("id", t.domId || t.id), l = i.insert("rect", ":first-child"), s = i.insert("line"), r = i.insert("g").attr("class", "label"), n = t.labelText.flat ? t.labelText.flat() : t.labelText;
1808
- let c = "";
1809
- typeof n == "object" ? c = n[0] : c = n, L.info("Label text abc79", c, n, typeof n == "object");
1810
- const u = r.node().appendChild(await K(c, t.labelStyle, !0, !0));
1811
- let o = { width: 0, height: 0 };
1812
- if (j(R().flowchart.htmlLabels)) {
1813
- const v = u.children[0], k = O(u);
1814
- o = v.getBoundingClientRect(), k.attr("width", o.width), k.attr("height", o.height);
1815
- }
1816
- L.info("Text 2", n);
1817
- const x = n.slice(1, n.length);
1818
- let w = u.getBBox();
1819
- const b = r.node().appendChild(
1820
- await K(
1821
- x.join ? x.join("<br/>") : x,
1822
- t.labelStyle,
1823
- !0,
1824
- !0
1825
- )
1826
- );
1827
- if (j(R().flowchart.htmlLabels)) {
1828
- const v = b.children[0], k = O(b);
1829
- o = v.getBoundingClientRect(), k.attr("width", o.width), k.attr("height", o.height);
1830
- }
1831
- const S = t.padding / 2;
1832
- return O(b).attr(
1833
- "transform",
1834
- "translate( " + // (titleBox.width - bbox.width) / 2 +
1835
- (o.width > w.width ? 0 : (w.width - o.width) / 2) + ", " + (w.height + S + 5) + ")"
1836
- ), O(u).attr(
1837
- "transform",
1838
- "translate( " + // (titleBox.width - bbox.width) / 2 +
1839
- (o.width < w.width ? 0 : -(w.width - o.width) / 2) + ", 0)"
1840
- ), o = r.node().getBBox(), r.attr(
1841
- "transform",
1842
- "translate(" + -o.width / 2 + ", " + (-o.height / 2 - S + 3) + ")"
1843
- ), l.attr("class", "outer title-state").attr("x", -o.width / 2 - S).attr("y", -o.height / 2 - S).attr("width", o.width + t.padding).attr("height", o.height + t.padding), s.attr("class", "divider").attr("x1", -o.width / 2 - S).attr("x2", o.width / 2 + S).attr("y1", -o.height / 2 - S + w.height + S).attr("y2", -o.height / 2 - S + w.height + S), T(t, l), t.intersect = function(v) {
1844
- return N.rect(t, v);
1845
- }, i;
1846
- }, "rectWithTitle"), Mr = /* @__PURE__ */ d(async (e, t) => {
1847
- const { shapeSvg: a, bbox: i } = await A(
1848
- e,
1849
- t,
1850
- Y(t, void 0),
1851
- !0
1852
- ), l = i.height + t.padding, s = i.width + l / 4 + t.padding, r = a.insert("rect", ":first-child").attr("style", t.style).attr("rx", l / 2).attr("ry", l / 2).attr("x", -s / 2).attr("y", -l / 2).attr("width", s).attr("height", l);
1853
- return T(t, r), t.intersect = function(n) {
1854
- return N.rect(t, n);
1855
- }, a;
1856
- }, "stadium"), Fr = /* @__PURE__ */ d(async (e, t) => {
1857
- const { shapeSvg: a, bbox: i, halfPadding: l } = await A(
1858
- e,
1859
- t,
1860
- Y(t, void 0),
1861
- !0
1862
- ), s = a.insert("circle", ":first-child");
1863
- return s.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), L.info("Circle main"), T(t, s), t.intersect = function(r) {
1864
- return L.info("Circle intersect", t, i.width / 2 + l, r), N.circle(t, i.width / 2 + l, r);
1865
- }, a;
1866
- }, "circle"), Wr = /* @__PURE__ */ d(async (e, t) => {
1867
- const { shapeSvg: a, bbox: i, halfPadding: l } = await A(
1868
- e,
1869
- t,
1870
- Y(t, void 0),
1871
- !0
1872
- ), s = 5, r = a.insert("g", ":first-child"), n = r.insert("circle"), c = r.insert("circle");
1873
- return r.attr("class", t.class), n.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l + s).attr("width", i.width + t.padding + s * 2).attr("height", i.height + t.padding + s * 2), c.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), L.info("DoubleCircle main"), T(t, n), t.intersect = function(u) {
1874
- return L.info("DoubleCircle intersect", t, i.width / 2 + l + s, u), N.circle(t, i.width / 2 + l + s, u);
1875
- }, a;
1876
- }, "doublecircle"), Pr = /* @__PURE__ */ d(async (e, t) => {
1877
- const { shapeSvg: a, bbox: i } = await A(
1878
- e,
1879
- t,
1880
- Y(t, void 0),
1881
- !0
1882
- ), l = i.width + t.padding, s = i.height + t.padding, r = [
1883
- { x: 0, y: 0 },
1884
- { x: l, y: 0 },
1885
- { x: l, y: -s },
1886
- { x: 0, y: -s },
1887
- { x: 0, y: 0 },
1888
- { x: -8, y: 0 },
1889
- { x: l + 8, y: 0 },
1890
- { x: l + 8, y: -s },
1891
- { x: -8, y: -s },
1892
- { x: -8, y: 0 }
1893
- ], n = U(a, l, s, r);
1894
- return n.attr("style", t.style), T(t, n), t.intersect = function(c) {
1895
- return N.polygon(t, r, c);
1896
- }, a;
1897
- }, "subroutine"), Yr = /* @__PURE__ */ d((e, t) => {
1898
- const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = a.insert("circle", ":first-child");
1899
- return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), T(t, i), t.intersect = function(l) {
1900
- return N.circle(t, 7, l);
1901
- }, a;
1902
- }, "start"), Mt = /* @__PURE__ */ d((e, t, a) => {
1903
- const i = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
1904
- let l = 70, s = 10;
1905
- a === "LR" && (l = 10, s = 70);
1906
- const r = i.append("rect").attr("x", -1 * l / 2).attr("y", -1 * s / 2).attr("width", l).attr("height", s).attr("class", "fork-join");
1907
- return T(t, r), t.height = t.height + t.padding / 2, t.width = t.width + t.padding / 2, t.intersect = function(n) {
1908
- return N.rect(t, n);
1909
- }, i;
1910
- }, "forkJoin"), Hr = /* @__PURE__ */ d((e, t) => {
1911
- const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = a.insert("circle", ":first-child"), l = a.insert("circle", ":first-child");
1912
- return l.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), i.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), T(t, l), t.intersect = function(s) {
1913
- return N.circle(t, 7, s);
1914
- }, a;
1915
- }, "end"), Kr = /* @__PURE__ */ d(async (e, t) => {
1916
- const a = t.padding / 2, i = 4, l = 8;
1917
- let s;
1918
- t.classes ? s = "node " + t.classes : s = "node default";
1919
- const r = e.insert("g").attr("class", s).attr("id", t.domId || t.id), n = r.insert("rect", ":first-child"), c = r.insert("line"), u = r.insert("line");
1920
- let o = 0, x = i;
1921
- const w = r.insert("g").attr("class", "label");
1922
- let b = 0;
1923
- const S = t.classData.annotations?.[0], v = t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", k = w.node().appendChild(await K(v, t.labelStyle, !0, !0));
1924
- let B = k.getBBox();
1925
- if (j(R().flowchart.htmlLabels)) {
1926
- const E = k.children[0], h = O(k);
1927
- B = E.getBoundingClientRect(), h.attr("width", B.width), h.attr("height", B.height);
1928
- }
1929
- t.classData.annotations[0] && (x += B.height + i, o += B.width);
1930
- let _ = t.classData.label;
1931
- t.classData.type !== void 0 && t.classData.type !== "" && (R().flowchart.htmlLabels ? _ += "&lt;" + t.classData.type + "&gt;" : _ += "<" + t.classData.type + ">");
1932
- const D = w.node().appendChild(await K(_, t.labelStyle, !0, !0));
1933
- O(D).attr("class", "classTitle");
1934
- let y = D.getBBox();
1935
- if (j(R().flowchart.htmlLabels)) {
1936
- const E = D.children[0], h = O(D);
1937
- y = E.getBoundingClientRect(), h.attr("width", y.width), h.attr("height", y.height);
1938
- }
1939
- x += y.height + i, y.width > o && (o = y.width);
1940
- const g = [];
1941
- t.classData.members.forEach(async (E) => {
1942
- const h = E.getDisplayDetails();
1943
- let W = h.displayText;
1944
- R().flowchart.htmlLabels && (W = W.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
1945
- const p = w.node().appendChild(
1946
- await K(
1947
- W,
1948
- h.cssStyle ? h.cssStyle : t.labelStyle,
1949
- !0,
1950
- !0
1951
- )
1952
- );
1953
- let I = p.getBBox();
1954
- if (j(R().flowchart.htmlLabels)) {
1955
- const Z = p.children[0], V = O(p);
1956
- I = Z.getBoundingClientRect(), V.attr("width", I.width), V.attr("height", I.height);
1957
- }
1958
- I.width > o && (o = I.width), x += I.height + i, g.push(p);
1959
- }), x += l;
1960
- const f = [];
1961
- if (t.classData.methods.forEach(async (E) => {
1962
- const h = E.getDisplayDetails();
1963
- let W = h.displayText;
1964
- R().flowchart.htmlLabels && (W = W.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
1965
- const p = w.node().appendChild(
1966
- await K(
1967
- W,
1968
- h.cssStyle ? h.cssStyle : t.labelStyle,
1969
- !0,
1970
- !0
1971
- )
1972
- );
1973
- let I = p.getBBox();
1974
- if (j(R().flowchart.htmlLabels)) {
1975
- const Z = p.children[0], V = O(p);
1976
- I = Z.getBoundingClientRect(), V.attr("width", I.width), V.attr("height", I.height);
1977
- }
1978
- I.width > o && (o = I.width), x += I.height + i, f.push(p);
1979
- }), x += l, S) {
1980
- let E = (o - B.width) / 2;
1981
- O(k).attr(
1982
- "transform",
1983
- "translate( " + (-1 * o / 2 + E) + ", " + -1 * x / 2 + ")"
1984
- ), b = B.height + i;
1985
- }
1986
- let m = (o - y.width) / 2;
1987
- return O(D).attr(
1988
- "transform",
1989
- "translate( " + (-1 * o / 2 + m) + ", " + (-1 * x / 2 + b) + ")"
1990
- ), b += y.height + i, c.attr("class", "divider").attr("x1", -o / 2 - a).attr("x2", o / 2 + a).attr("y1", -x / 2 - a + l + b).attr("y2", -x / 2 - a + l + b), b += l, g.forEach((E) => {
1991
- O(E).attr(
1992
- "transform",
1993
- "translate( " + -o / 2 + ", " + (-1 * x / 2 + b + l / 2) + ")"
1994
- );
1995
- const h = E?.getBBox();
1996
- b += (h?.height ?? 0) + i;
1997
- }), b += l, u.attr("class", "divider").attr("x1", -o / 2 - a).attr("x2", o / 2 + a).attr("y1", -x / 2 - a + l + b).attr("y2", -x / 2 - a + l + b), b += l, f.forEach((E) => {
1998
- O(E).attr(
1999
- "transform",
2000
- "translate( " + -o / 2 + ", " + (-1 * x / 2 + b) + ")"
2001
- );
2002
- const h = E?.getBBox();
2003
- b += (h?.height ?? 0) + i;
2004
- }), n.attr("style", t.style).attr("class", "outer title-state").attr("x", -o / 2 - a).attr("y", -(x / 2) - a).attr("width", o + t.padding).attr("height", x + t.padding), T(t, n), t.intersect = function(E) {
2005
- return N.rect(t, E);
2006
- }, r;
2007
- }, "class_box"), Ft = {
2008
- rhombus: At,
2009
- composite: Rr,
2010
- question: At,
2011
- rect: Or,
2012
- labelRect: zr,
2013
- rectWithTitle: Ar,
2014
- choice: kr,
2015
- circle: Fr,
2016
- doublecircle: Wr,
2017
- stadium: Mr,
2018
- hexagon: vr,
2019
- block_arrow: Er,
2020
- rect_left_inv_arrow: _r,
2021
- lean_right: Dr,
2022
- lean_left: Nr,
2023
- trapezoid: Tr,
2024
- inv_trapezoid: Br,
2025
- rect_right_inv_arrow: Cr,
2026
- cylinder: Ir,
2027
- start: Yr,
2028
- end: Hr,
2029
- note: Sr,
2030
- subroutine: Pr,
2031
- fork: Mt,
2032
- join: Mt,
2033
- class_box: Kr
2034
- }, lt = {}, te = /* @__PURE__ */ d(async (e, t, a) => {
2035
- let i, l;
2036
- if (t.link) {
2037
- let s;
2038
- R().securityLevel === "sandbox" ? s = "_top" : t.linkTarget && (s = t.linkTarget || "_blank"), i = e.insert("svg:a").attr("xlink:href", t.link).attr("target", s), l = await Ft[t.shape](i, t, a);
2039
- } else
2040
- l = await Ft[t.shape](e, t, a), i = l;
2041
- return t.tooltip && l.attr("title", t.tooltip), t.class && l.attr("class", "node default " + t.class), lt[t.id] = i, t.haveCallback && lt[t.id].attr("class", lt[t.id].attr("class") + " clickable"), i;
2042
- }, "insertNode"), Xr = /* @__PURE__ */ d((e) => {
2043
- const t = lt[e.id];
2044
- L.trace(
2045
- "Transforming node",
2046
- e.diff,
2047
- e,
2048
- "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")"
2049
- );
2050
- const a = 8, i = e.diff || 0;
2051
- return e.clusterNode ? t.attr(
2052
- "transform",
2053
- "translate(" + (e.x + i - e.width / 2) + ", " + (e.y - e.height / 2 - a) + ")"
2054
- ) : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), i;
2055
- }, "positionNode");
2056
- function Dt(e, t, a = !1) {
2057
- const i = e;
2058
- let l = "default";
2059
- (i?.classes?.length || 0) > 0 && (l = (i?.classes ?? []).join(" ")), l = l + " flowchart-label";
2060
- let s = 0, r = "", n;
2061
- switch (i.type) {
2062
- case "round":
2063
- s = 5, r = "rect";
2064
- break;
2065
- case "composite":
2066
- s = 0, r = "composite", n = 0;
2067
- break;
2068
- case "square":
2069
- r = "rect";
2070
- break;
2071
- case "diamond":
2072
- r = "question";
2073
- break;
2074
- case "hexagon":
2075
- r = "hexagon";
2076
- break;
2077
- case "block_arrow":
2078
- r = "block_arrow";
2079
- break;
2080
- case "odd":
2081
- r = "rect_left_inv_arrow";
2082
- break;
2083
- case "lean_right":
2084
- r = "lean_right";
2085
- break;
2086
- case "lean_left":
2087
- r = "lean_left";
2088
- break;
2089
- case "trapezoid":
2090
- r = "trapezoid";
2091
- break;
2092
- case "inv_trapezoid":
2093
- r = "inv_trapezoid";
2094
- break;
2095
- case "rect_left_inv_arrow":
2096
- r = "rect_left_inv_arrow";
2097
- break;
2098
- case "circle":
2099
- r = "circle";
2100
- break;
2101
- case "ellipse":
2102
- r = "ellipse";
2103
- break;
2104
- case "stadium":
2105
- r = "stadium";
2106
- break;
2107
- case "subroutine":
2108
- r = "subroutine";
2109
- break;
2110
- case "cylinder":
2111
- r = "cylinder";
2112
- break;
2113
- case "group":
2114
- r = "rect";
2115
- break;
2116
- case "doublecircle":
2117
- r = "doublecircle";
2118
- break;
2119
- default:
2120
- r = "rect";
2121
- }
2122
- const c = me(i?.styles ?? []), u = i.label, o = i.size ?? { width: 0, height: 0, x: 0, y: 0 };
2123
- return {
2124
- labelStyle: c.labelStyle,
2125
- shape: r,
2126
- labelText: u,
2127
- rx: s,
2128
- ry: s,
2129
- class: l,
2130
- style: c.style,
2131
- id: i.id,
2132
- directions: i.directions,
2133
- width: o.width,
2134
- height: o.height,
2135
- x: o.x,
2136
- y: o.y,
2137
- positioned: a,
2138
- intersect: void 0,
2139
- type: i.type,
2140
- padding: n ?? rt()?.block?.padding ?? 0
2141
- };
2142
- }
2143
- d(Dt, "getNodeFromBlock");
2144
- async function ee(e, t, a) {
2145
- const i = Dt(t, a, !1);
2146
- if (i.type === "group")
2147
- return;
2148
- const l = rt(), s = await te(e, i, { config: l }), r = s.node().getBBox(), n = a.getBlock(i.id);
2149
- n.size = { width: r.width, height: r.height, x: 0, y: 0, node: s }, a.setBlock(n), s.remove();
2150
- }
2151
- d(ee, "calculateBlockSize");
2152
- async function re(e, t, a) {
2153
- const i = Dt(t, a, !0);
2154
- if (a.getBlock(i.id).type !== "space") {
2155
- const s = rt();
2156
- await te(e, i, { config: s }), t.intersect = i?.intersect, Xr(i);
2157
- }
2158
- }
2159
- d(re, "insertBlockPositioned");
2160
- async function dt(e, t, a, i) {
2161
- for (const l of t)
2162
- await i(e, l, a), l.children && await dt(e, l.children, a, i);
2163
- }
2164
- d(dt, "performOperations");
2165
- async function ae(e, t, a) {
2166
- await dt(e, t, a, ee);
2167
- }
2168
- d(ae, "calculateBlockSizes");
2169
- async function se(e, t, a) {
2170
- await dt(e, t, a, re);
2171
- }
2172
- d(se, "insertBlocks");
2173
- async function ie(e, t, a, i, l) {
2174
- const s = new ke({
2175
- multigraph: !0,
2176
- compound: !0
2177
- });
2178
- s.setGraph({
2179
- rankdir: "TB",
2180
- nodesep: 10,
2181
- ranksep: 10,
2182
- marginx: 8,
2183
- marginy: 8
2184
- });
2185
- for (const r of a)
2186
- r.size && s.setNode(r.id, {
2187
- width: r.size.width,
2188
- height: r.size.height,
2189
- intersect: r.intersect
2190
- });
2191
- for (const r of t)
2192
- if (r.start && r.end) {
2193
- const n = i.getBlock(r.start), c = i.getBlock(r.end);
2194
- if (n?.size && c?.size) {
2195
- const u = n.size, o = c.size, x = [
2196
- { x: u.x, y: u.y },
2197
- { x: u.x + (o.x - u.x) / 2, y: u.y + (o.y - u.y) / 2 },
2198
- { x: o.x, y: o.y }
2199
- ];
2200
- gr(
2201
- e,
2202
- { v: r.start, w: r.end, name: r.id },
2203
- {
2204
- ...r,
2205
- arrowTypeEnd: r.arrowTypeEnd,
2206
- arrowTypeStart: r.arrowTypeStart,
2207
- points: x,
2208
- classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
2209
- },
2210
- void 0,
2211
- "block",
2212
- s,
2213
- l
2214
- ), r.label && (await cr(e, {
2215
- ...r,
2216
- label: r.label,
2217
- labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
2218
- arrowTypeEnd: r.arrowTypeEnd,
2219
- arrowTypeStart: r.arrowTypeStart,
2220
- points: x,
2221
- classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
2222
- }), or(
2223
- { ...r, x: x[1].x, y: x[1].y },
2224
- {
2225
- originalPath: x
2226
- }
2227
- ));
2228
- }
2229
- }
2230
- }
2231
- d(ie, "insertEdges");
2232
- var Ur = /* @__PURE__ */ d(function(e, t) {
2233
- return t.db.getClasses();
2234
- }, "getClasses"), jr = /* @__PURE__ */ d(async function(e, t, a, i) {
2235
- const { securityLevel: l, block: s } = rt(), r = i.db;
2236
- let n;
2237
- l === "sandbox" && (n = O("#i" + t));
2238
- const c = l === "sandbox" ? O(n.nodes()[0].contentDocument.body) : O("body"), u = l === "sandbox" ? c.select(`[id="${t}"]`) : O(`[id="${t}"]`);
2239
- ar(u, ["point", "circle", "cross"], i.type, t);
2240
- const x = r.getBlocks(), w = r.getBlocksFlat(), b = r.getEdges(), S = u.insert("g").attr("class", "block");
2241
- await ae(S, x, r);
2242
- const v = jt(r);
2243
- if (await se(S, x, r), await ie(S, b, w, r, t), v) {
2244
- const k = v, B = Math.max(1, Math.round(0.125 * (k.width / k.height))), _ = k.height + B + 10, D = k.width + 10, { useMaxWidth: y } = s;
2245
- he(u, _, D, !!y), L.debug("Here Bounds", v, k), u.attr(
2246
- "viewBox",
2247
- `${k.x - 5} ${k.y - 5} ${k.width + 10} ${k.height + 10}`
2248
- );
2249
- }
2250
- }, "draw"), Vr = {
2251
- draw: jr,
2252
- getClasses: Ur
2253
- }, $r = {
2254
- parser: ve,
2255
- db: Ke,
2256
- renderer: Vr,
2257
- styles: Ue
2258
- };
2259
- export {
2260
- $r as diagram
2261
- };