@vunk/plus 1.6.11 → 1.7.0

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 (321) hide show
  1. package/components/_baseUniq-BXtq6_NW.mjs +239 -0
  2. package/components/abap-B7h4dtBh.mjs +6 -0
  3. package/components/actionscript-3-Bmm7RA3Y.mjs +6 -0
  4. package/components/ada-BZS802Se.mjs +6 -0
  5. package/components/agent-chat-provider/index.d.ts +1 -0
  6. package/components/agent-chat-provider/index.mjs +74 -39
  7. package/components/agent-chat-provider/src/MessageView.d.ts +29 -0
  8. package/components/agent-chat-provider/src/types.d.ts +12 -6
  9. package/components/agent-chat-provider/src/use.d.ts +5 -4
  10. package/components/andromeeda-CrngpmZk.mjs +3 -0
  11. package/components/apache-D4roVlsU.mjs +6 -0
  12. package/components/apex-D6mfw0H5.mjs +6 -0
  13. package/components/apl-DDK-VObo.mjs +18 -0
  14. package/components/applescript-C43Knf0G.mjs +6 -0
  15. package/components/ara-DRBH84ND.mjs +6 -0
  16. package/components/arc-Js_tyW10.mjs +131 -0
  17. package/components/architecture-O4VJ6CD3-ZoZ2IAk2.mjs +13 -0
  18. package/components/architectureDiagram-SUXI7LT5-kyYGGrHN.mjs +8676 -0
  19. package/components/asm-3tg4MVib.mjs +6 -0
  20. package/components/astro-v4FYbRud.mjs +19 -0
  21. package/components/aurora-x-wJ4-eM2h.mjs +3 -0
  22. package/components/awk-ChreaG-G.mjs +6 -0
  23. package/components/ayu-dark-BEKp3oqs.mjs +3 -0
  24. package/components/ballerina-B0yt0TYU.mjs +6 -0
  25. package/components/batch-Ce_EX3Sx.mjs +14 -0
  26. package/components/beancount-BRIsdQEB.mjs +6 -0
  27. package/components/berry-Brv4WWdL.mjs +14 -0
  28. package/components/bibtex-BLeFwAes.mjs +6 -0
  29. package/components/bicep-BVrgfErX.mjs +6 -0
  30. package/components/blade-By3Sw_Ex.mjs +22 -0
  31. package/components/blockDiagram-6J76NXCF-IAr4zDV3.mjs +3608 -0
  32. package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +1 -1
  33. package/components/broadcasting-markdown/src/index.vue.d.ts +3 -3
  34. package/components/bubble-list/index.css +22 -0
  35. package/components/bubble-list/index.mjs +7 -134
  36. package/components/bubble-list/src/ctx.d.ts +0 -4
  37. package/components/bubble-list/src/index.vue.d.ts +169 -525
  38. package/components/bubble-templates/index.d.ts +2 -1
  39. package/components/bubble-templates/index.mjs +11438 -101
  40. package/components/bubble-templates/src/core.d.ts +69 -0
  41. package/components/bubble-templates/src/index.vue.d.ts +133 -486
  42. package/components/bubble-templates/src/legacy.vue.d.ts +153 -0
  43. package/components/bubble-templates/src/types.d.ts +13 -8
  44. package/components/c-C4VtT7JA.mjs +6 -0
  45. package/components/c4Diagram-6F6E4RAY-Dv27rXcJ.mjs +2490 -0
  46. package/components/catppuccin-frappe-zLMNRRUx.mjs +3 -0
  47. package/components/catppuccin-latte-CdF5jC3c.mjs +3 -0
  48. package/components/catppuccin-macchiato-DyjXeyRt.mjs +3 -0
  49. package/components/catppuccin-mocha-66IdYxR8.mjs +3 -0
  50. package/components/cdc-30ktANo3.mjs +14 -0
  51. package/components/channel-BBZy6zOT.mjs +7 -0
  52. package/components/chat-independent/index.mjs +4 -4
  53. package/components/chat-independent/src/index.vue.d.ts +194 -550
  54. package/components/chunk-353BL4L5-Dn_Y_Yna.mjs +17 -0
  55. package/components/chunk-67H74DCK-Br5U8bfD.mjs +102 -0
  56. package/components/chunk-AACKK3MU-DH_MKxca.mjs +17 -0
  57. package/components/chunk-BFAMUDN2-DHLCoYMN.mjs +13 -0
  58. package/components/chunk-E2GYISFI-DQPHyyga.mjs +19 -0
  59. package/components/chunk-OW32GOEJ-CQOSE6Bn.mjs +1924 -0
  60. package/components/chunk-SKB7J2MH-BlwHRDiW.mjs +25 -0
  61. package/components/chunk-SZ463SBG-DEp8buKJ.mjs +1823 -0
  62. package/components/clarity-6uBl6Vpb.mjs +6 -0
  63. package/components/classDiagram-M3E45YP4-D0ySDe-v.mjs +30 -0
  64. package/components/classDiagram-v2-YAWTLIQI-D0ySDe-v.mjs +30 -0
  65. package/components/clojure-COBRmwo8.mjs +14 -0
  66. package/components/clone-CEJtuQzg.mjs +8 -0
  67. package/components/cmake-CDfQILeU.mjs +6 -0
  68. package/components/cobol-BOOIiISO.mjs +13 -0
  69. package/components/coffee-DO_RGoZp.mjs +9 -0
  70. package/components/cpp-DAK8ktHO.mjs +25 -0
  71. package/components/crystal-CBGbbyVp.mjs +19 -0
  72. package/components/cs-h3ksD6-P.mjs +14 -0
  73. package/components/css-BtVcDqlU.mjs +6 -0
  74. package/components/cue-BFSVLV6N.mjs +6 -0
  75. package/components/cypher-Dl2CXoXF.mjs +14 -0
  76. package/components/cytoscape.esm-BojS1z60.mjs +30216 -0
  77. package/components/d-9qSZPw74.mjs +6 -0
  78. package/components/dagre-JOIXM2OF-5zx0JY2T.mjs +705 -0
  79. package/components/dark-plus-DmZ1Dzd4.mjs +3 -0
  80. package/components/dart-CCSsOg9l.mjs +6 -0
  81. package/components/dax-CvsmLV-B.mjs +6 -0
  82. package/components/defaultLocale-DVr69WTU.mjs +202 -0
  83. package/components/diagram-5UYTHUR4-C19nyAKc.mjs +213 -0
  84. package/components/diagram-VMROVX33-DkGwo-hj.mjs +859 -0
  85. package/components/diagram-ZTM2IBQH-CBgHCu9L.mjs +315 -0
  86. package/components/diff-BEdzuHlE.mjs +6 -0
  87. package/components/dockerfile-B3DP334t.mjs +14 -0
  88. package/components/dracula-B8-AVrwI.mjs +3 -0
  89. package/components/dracula-soft-BHeefow7.mjs +3 -0
  90. package/components/dream-maker-CNLQpoF-.mjs +6 -0
  91. package/components/elixir-0rTCSSfp.mjs +11 -0
  92. package/components/elm-BhwiZPvf.mjs +10 -0
  93. package/components/erDiagram-3M52JZNH-cttdAJXW.mjs +1167 -0
  94. package/components/erb-Lra8TlYM.mjs +27 -0
  95. package/components/erlang-D2NNgvtR.mjs +17 -0
  96. package/components/everforest-dark-Cg1xdODP.mjs +3 -0
  97. package/components/everforest-light-BmTD3bxe.mjs +3 -0
  98. package/components/fish-BU5HSdZy.mjs +6 -0
  99. package/components/flowDiagram-KYDEHFYC-9HpsqDdB.mjs +2343 -0
  100. package/components/fs-CdBSddpF.mjs +17 -0
  101. package/components/ganttDiagram-EK5VF46D-8QB3ofs6.mjs +3495 -0
  102. package/components/gdresource-CAbkn6H_.mjs +11 -0
  103. package/components/gdscript-Be_cubqt.mjs +6 -0
  104. package/components/gdshader-BEzE4j_3.mjs +6 -0
  105. package/components/gherkin-xCNF9gh8.mjs +6 -0
  106. package/components/git-commit-PP9xCApN.mjs +9 -0
  107. package/components/git-rebase-DqdGofLo.mjs +9 -0
  108. package/components/gitGraph-ZV4HHKMB-BSmtVGRu.mjs +13 -0
  109. package/components/gitGraphDiagram-GW3U2K7C-DNzc0Vx_.mjs +1225 -0
  110. package/components/github-dark-O22yVQaY.mjs +3 -0
  111. package/components/github-dark-default-DB2Hkvqn.mjs +3 -0
  112. package/components/github-dark-dimmed-CMZ_OfqC.mjs +3 -0
  113. package/components/github-dark-high-contrast-DmxWVmCU.mjs +3 -0
  114. package/components/github-light-BTbR9xVK.mjs +3 -0
  115. package/components/github-light-default-DWEonwFe.mjs +3 -0
  116. package/components/github-light-high-contrast-WJ_cPDts.mjs +3 -0
  117. package/components/glimmer-js-BkPYTyD4.mjs +23 -0
  118. package/components/glsl-CGsiYPcu.mjs +9 -0
  119. package/components/gnuplot-tV8vezdE.mjs +6 -0
  120. package/components/go-CBmVHZBz.mjs +6 -0
  121. package/components/graph-3zJxsO-i.mjs +425 -0
  122. package/components/graphql-D4pgneW3.mjs +15 -0
  123. package/components/groovy-Bn4MhXgW.mjs +6 -0
  124. package/components/gruvbox-dark-hard-C89wZ4s3.mjs +3 -0
  125. package/components/gruvbox-dark-medium-swz85q_b.mjs +3 -0
  126. package/components/gruvbox-dark-soft-BYHBHQJW.mjs +3 -0
  127. package/components/gruvbox-light-hard-DEF_ZxYZ.mjs +3 -0
  128. package/components/gruvbox-light-medium-ziUMnHJx.mjs +3 -0
  129. package/components/gruvbox-light-soft-Cuwp0tsB.mjs +3 -0
  130. package/components/gts-d3WsqAZM.mjs +23 -0
  131. package/components/hack-CwaBuF5l.mjs +13 -0
  132. package/components/haml-gLijj4rW.mjs +11 -0
  133. package/components/hbs-CFi5SpI3.mjs +23 -0
  134. package/components/hcl-axoq0Ycu.mjs +6 -0
  135. package/components/hjson-I7LcauIB.mjs +6 -0
  136. package/components/hlsl-TRzjajlb.mjs +6 -0
  137. package/components/houston-CF_ws8Cq.mjs +3 -0
  138. package/components/hs-DXSGqUFF.mjs +14 -0
  139. package/components/html-CLq-n30c.mjs +11 -0
  140. package/components/html-derivative-C8POX8SL.mjs +9 -0
  141. package/components/http-BYUKZ6kX.mjs +20 -0
  142. package/components/imba-C4923lSV.mjs +6 -0
  143. package/components/index3.mjs +79526 -0
  144. package/components/info-63CPKGFF-C8sYWczU.mjs +13 -0
  145. package/components/infoDiagram-LHK5PUON-C-vFFPTf.mjs +42 -0
  146. package/components/init-ZxktEp_H.mjs +15 -0
  147. package/components/java-BfXh-0uJ.mjs +6 -0
  148. package/components/jinja-html-BmW4v_vu.mjs +11 -0
  149. package/components/jison-C9kAT_Oj.mjs +9 -0
  150. package/components/journeyDiagram-EWQZEKCU-BJrw4-AG.mjs +1262 -0
  151. package/components/js-CN_xSsjU.mjs +14 -0
  152. package/components/json-TjWBGEk1.mjs +6 -0
  153. package/components/json5-DCGCKrmX.mjs +6 -0
  154. package/components/jsonc-DLVLp8id.mjs +6 -0
  155. package/components/jsonl-B-R_pDGg.mjs +6 -0
  156. package/components/jsonnet-Cs8BnnC6.mjs +6 -0
  157. package/components/jssm-D_YBQ_cM.mjs +14 -0
  158. package/components/jsx-BPmvoin2.mjs +6 -0
  159. package/components/julia-C-JjBobP.mjs +19 -0
  160. package/components/kanagawa-dragon-DU8n2NNT.mjs +3 -0
  161. package/components/kanagawa-lotus-Byd0CDet.mjs +3 -0
  162. package/components/kanagawa-wave-DExoagcR.mjs +3 -0
  163. package/components/kanban-definition-ZSS6B67P-BptAnqU-.mjs +1057 -0
  164. package/components/kotlin-BM2ZNTMh.mjs +6 -0
  165. package/components/kusto-D9MF7CZf.mjs +14 -0
  166. package/components/laserwave-DF03wMlf.mjs +3 -0
  167. package/components/latex-BsqkLZB_.mjs +10 -0
  168. package/components/layout-sGZIJplX.mjs +2043 -0
  169. package/components/less-BAzLMJNR.mjs +6 -0
  170. package/components/light-plus-DS08Xg5J.mjs +3 -0
  171. package/components/linear-DqgVh5FN.mjs +336 -0
  172. package/components/liquid-f2VHt0dg.mjs +15 -0
  173. package/components/lisp-DAq1kaby.mjs +6 -0
  174. package/components/logo-D9l7oEJ8.mjs +6 -0
  175. package/components/lua-CH3ttzl_.mjs +9 -0
  176. package/components/makefile-D2qLe7q0.mjs +14 -0
  177. package/components/marko-DwRyI_--.mjs +15 -0
  178. package/components/material-theme-B8B2U48Q.mjs +3 -0
  179. package/components/material-theme-darker-BV0iY_T3.mjs +3 -0
  180. package/components/material-theme-lighter-DrzybSTF.mjs +3 -0
  181. package/components/material-theme-ocean-BRPLVReX.mjs +3 -0
  182. package/components/material-theme-palenight-DSJwsR_D.mjs +3 -0
  183. package/components/matlab-7XHduepk.mjs +6 -0
  184. package/components/md-BIvDPr-W.mjs +14 -0
  185. package/components/mdc-Rx6hWSHn.mjs +16 -0
  186. package/components/mdx-D5wExp-O.mjs +6 -0
  187. package/components/mermaid-CUjtoYEe.mjs +6 -0
  188. package/components/mermaid-parser.core-CH9ryA1K.mjs +16987 -0
  189. package/components/mermaid.core-CAqkCmS1.mjs +20975 -0
  190. package/components/metahuman-broadcasting/src/index.vue.d.ts +3 -3
  191. package/components/min-BngCxx8g.mjs +109 -0
  192. package/components/min-dark-BNaN9fWk.mjs +3 -0
  193. package/components/min-light-CMrjentn.mjs +3 -0
  194. package/components/mindmap-definition-6CBA2TL7-Cp_EeEsh.mjs +5854 -0
  195. package/components/mojo-CrbF881p.mjs +6 -0
  196. package/components/monokai-DelygWXa.mjs +3 -0
  197. package/components/narrat-DOwkIbBe.mjs +14 -0
  198. package/components/nf-DHfvJ2gH.mjs +14 -0
  199. package/components/nginx-B_jWsywZ.mjs +10 -0
  200. package/components/night-owl-DSS199ra.mjs +3 -0
  201. package/components/nim-yzbnZKJd.mjs +22 -0
  202. package/components/nix--3K2gyjg.mjs +6 -0
  203. package/components/nord-CvDbBq5M.mjs +3 -0
  204. package/components/objective-c-DkOBZg1J.mjs +14 -0
  205. package/components/objective-cpp-DEoN9Fe5.mjs +6 -0
  206. package/components/ocaml-B1kfGk9Y.mjs +6 -0
  207. package/components/one-dark-pro-CsMf0BoJ.mjs +3 -0
  208. package/components/one-light-BwwAsfsj.mjs +3 -0
  209. package/components/ordinal-DSZU4PqD.mjs +76 -0
  210. package/components/packet-HUATNLJX-bfFWFja0.mjs +13 -0
  211. package/components/pascal-CU8Kjkr_.mjs +6 -0
  212. package/components/perl-FH6su6vZ.mjs +18 -0
  213. package/components/php-Dnl1TfYH.mjs +20 -0
  214. package/components/pie-WTHONI2E-QPrWs3SR.mjs +13 -0
  215. package/components/pieDiagram-NIOCPIFQ-C46Y_4C6.mjs +248 -0
  216. package/components/plastic-BjwMpBc0.mjs +3 -0
  217. package/components/plsql-B3Na24V4.mjs +6 -0
  218. package/components/poimandres-ChWyhPrn.mjs +3 -0
  219. package/components/postcss-kj1IbjVd.mjs +6 -0
  220. package/components/powerquery-B-e1fO-k.mjs +6 -0
  221. package/components/prisma-bmxcSDxq.mjs +6 -0
  222. package/components/prolog-BT9GCzqD.mjs +6 -0
  223. package/components/properties-D6yKO1eW.mjs +14 -0
  224. package/components/proto-BIXM0k1a.mjs +6 -0
  225. package/components/ps1-aFyNx8UH.mjs +18 -0
  226. package/components/pug-BrOx0bSt.mjs +21 -0
  227. package/components/puppet-N15G4Usj.mjs +6 -0
  228. package/components/purescript-DrwsEYNH.mjs +6 -0
  229. package/components/python-D2s92fRP.mjs +14 -0
  230. package/components/ql-DTm-NCRo.mjs +14 -0
  231. package/components/quadrantDiagram-2OG54O6I-Dgf6d6F_.mjs +1347 -0
  232. package/components/r-oprfD2-9.mjs +6 -0
  233. package/components/radar-NJJJXTRR-BnUCJhQL.mjs +13 -0
  234. package/components/raku-xArQd_rF.mjs +14 -0
  235. package/components/razor-BoXCAbWQ.mjs +13 -0
  236. package/components/red-DByOl5N0.mjs +3 -0
  237. package/components/reg-CULnG2WX.mjs +6 -0
  238. package/components/rel-CHRwzjd4.mjs +6 -0
  239. package/components/requirementDiagram-QOLK2EJ7-CSF6N7HA.mjs +1171 -0
  240. package/components/riscv-BNQ9cVpw.mjs +6 -0
  241. package/components/rose-pine-LL9gXmP2.mjs +3 -0
  242. package/components/rose-pine-dawn-CH9zdisO.mjs +3 -0
  243. package/components/rose-pine-moon-B1oKSfEJ.mjs +3 -0
  244. package/components/rst-bEtD1v7N.mjs +36 -0
  245. package/components/ruby-BmfBy6EV.mjs +44 -0
  246. package/components/rust-Bf_fdNdL.mjs +14 -0
  247. package/components/sankeyDiagram-4UZDY2LN-BAHB7dMS.mjs +1199 -0
  248. package/components/sas-BLBgC3TA.mjs +9 -0
  249. package/components/sass-BheygBdF.mjs +6 -0
  250. package/components/scala-B-_7vFVn.mjs +6 -0
  251. package/components/scheme-BSHdPinv.mjs +6 -0
  252. package/components/scss-Dq-LbI_c.mjs +9 -0
  253. package/components/sender/src/index.vue.d.ts +3 -3
  254. package/components/sequenceDiagram-SKLFT4DO-10gLJ50N.mjs +3422 -0
  255. package/components/shaderlab-BOQRTiQi.mjs +17 -0
  256. package/components/shellsession-Cu3c0QAc.mjs +17 -0
  257. package/components/slack-dark-BEe10hxO.mjs +3 -0
  258. package/components/slack-ochin-BKmu9pBc.mjs +3 -0
  259. package/components/smalltalk-qxcGy4fT.mjs +6 -0
  260. package/components/snazzy-light-Dcvd-ZyI.mjs +3 -0
  261. package/components/solarized-dark-BBl5y5sR.mjs +3 -0
  262. package/components/solarized-light-DW9b_AY8.mjs +3 -0
  263. package/components/solidity-CewKZgp-.mjs +6 -0
  264. package/components/sparql-DswowMAp.mjs +9 -0
  265. package/components/splunk-gK6Iw_P9.mjs +14 -0
  266. package/components/sql-DzUuSofg.mjs +6 -0
  267. package/components/ssh-config-Bk_I5wDR.mjs +6 -0
  268. package/components/stata-Dl7wDdBE.mjs +9 -0
  269. package/components/stateDiagram-MI5ZYTHO-D6p6nCaj.mjs +459 -0
  270. package/components/stateDiagram-v2-5AN5P6BG-DaN5hC-t.mjs +29 -0
  271. package/components/stylus-qRNkxrFU.mjs +14 -0
  272. package/components/svelte-B9qv3vkS.mjs +15 -0
  273. package/components/swift-BRQRsam8.mjs +6 -0
  274. package/components/synthwave-84-CoUef9sh.mjs +3 -0
  275. package/components/system-verilog-BcESSvRn.mjs +6 -0
  276. package/components/table-columns/src/ctx.d.ts +2 -2
  277. package/components/table-columns/src/el-ctx.d.ts +2 -2
  278. package/components/table-columns/src/index.vue.d.ts +4 -4
  279. package/components/tables-v1/src/ctx.d.ts +3 -3
  280. package/components/tables-v1/src/index.vue.d.ts +9 -9
  281. package/components/tables-v1-checkbox/src/ctx.d.ts +3 -3
  282. package/components/tables-v1-checkbox/src/index.vue.d.ts +17 -17
  283. package/components/tasl-DfOr2qHi.mjs +6 -0
  284. package/components/tcl-CTsc4-t7.mjs +6 -0
  285. package/components/tex-CumJx1zu.mjs +9 -0
  286. package/components/text/src/ctx.d.ts +1 -1
  287. package/components/text/src/index.vue.d.ts +1 -1
  288. package/components/timeline-definition-MYPXXCX6-gLqnWxDu.mjs +1234 -0
  289. package/components/tokyo-night-DjtLpAEY.mjs +3 -0
  290. package/components/toml-vHPzWDj6.mjs +6 -0
  291. package/components/treemap-75Q7IDZK-B2atdfMH.mjs +13 -0
  292. package/components/tsx-CmGGo4Hm.mjs +6 -0
  293. package/components/turtle-BnC7StHY.mjs +6 -0
  294. package/components/twig-0XKNpXN1.mjs +35 -0
  295. package/components/typescript-CgxwwAuC.mjs +14 -0
  296. package/components/v-Bmdjo9cy.mjs +6 -0
  297. package/components/vb-DuF6ZenW.mjs +14 -0
  298. package/components/verilog-CCb_iTfF.mjs +6 -0
  299. package/components/vesper-4Q1cEwPL.mjs +3 -0
  300. package/components/vhdl-DMqk4T2s.mjs +6 -0
  301. package/components/vimscript-aKp9YbYm.mjs +18 -0
  302. package/components/vitesse-black-BqNLki8b.mjs +3 -0
  303. package/components/vitesse-dark-jJ32WhwH.mjs +3 -0
  304. package/components/vitesse-light-476zM4e6.mjs +3 -0
  305. package/components/vue-DVNNTw2l.mjs +40 -0
  306. package/components/vue-html-Cr5wciIP.mjs +16 -0
  307. package/components/vyper-DYedWgAE.mjs +14 -0
  308. package/components/wasm-BBh6f151.mjs +6 -0
  309. package/components/wasm-DDgzZJey.mjs +7 -0
  310. package/components/wenyan-BdqozpMZ.mjs +6 -0
  311. package/components/wgsl-Vo-hHVWH.mjs +6 -0
  312. package/components/wolfram-CRmjUoI4.mjs +6 -0
  313. package/components/xml-BMzZeaqs.mjs +9 -0
  314. package/components/xsl-CAhvzxWv.mjs +10 -0
  315. package/components/xychartDiagram-H2YORKM3-Whqa4ezL.mjs +1893 -0
  316. package/components/yml-BhSrWWMS.mjs +14 -0
  317. package/components/zenscript-DFINJL6j.mjs +6 -0
  318. package/components/zig-CS4FMAZp.mjs +6 -0
  319. package/components/zsh-hcK4TBd7.mjs +26 -0
  320. package/index.css +23 -0
  321. package/package.json +4 -1
@@ -0,0 +1,2490 @@
1
+ import { d as drawRect, g as getNoteRect } from './chunk-67H74DCK-Br5U8bfD.mjs';
2
+ import { _ as __name, b as setAccTitle, a as getAccTitle, g as getAccDescription, s as setAccDescription, c as getConfig2, f as assignWithDepth_default, w as wrapLabel, k as common_default, m as calculateTextHeight, h as calculateTextWidth, i as sanitizeText, d as select, l as log, e as configureSvgSize, j as distExports } from './mermaid.core-CAqkCmS1.mjs';
3
+ import './index3.mjs';
4
+ import 'vue';
5
+ import '@vunk/plus/components/bubble-templates';
6
+ import '@vunk/core/components/spread-to';
7
+ import 'element-plus';
8
+ import '@vunk/shared/function';
9
+ import './_plugin-vue_export-helper.mjs';
10
+ import '@vunk/plus/components/agent-chat-provider';
11
+
12
+ var _a, _b;
13
+ var parser = function() {
14
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
15
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
16
+ return o2;
17
+ }, "o"), $V0 = [1, 24], $V1 = [1, 25], $V2 = [1, 26], $V3 = [1, 27], $V4 = [1, 28], $V5 = [1, 63], $V6 = [1, 64], $V7 = [1, 65], $V8 = [1, 66], $V9 = [1, 67], $Va = [1, 68], $Vb = [1, 69], $Vc = [1, 29], $Vd = [1, 30], $Ve = [1, 31], $Vf = [1, 32], $Vg = [1, 33], $Vh = [1, 34], $Vi = [1, 35], $Vj = [1, 36], $Vk = [1, 37], $Vl = [1, 38], $Vm = [1, 39], $Vn = [1, 40], $Vo = [1, 41], $Vp = [1, 42], $Vq = [1, 43], $Vr = [1, 44], $Vs = [1, 45], $Vt = [1, 46], $Vu = [1, 47], $Vv = [1, 48], $Vw = [1, 50], $Vx = [1, 51], $Vy = [1, 52], $Vz = [1, 53], $VA = [1, 54], $VB = [1, 55], $VC = [1, 56], $VD = [1, 57], $VE = [1, 58], $VF = [1, 59], $VG = [1, 60], $VH = [14, 42], $VI = [14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VJ = [12, 14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VK = [1, 82], $VL = [1, 83], $VM = [1, 84], $VN = [1, 85], $VO = [12, 14, 42], $VP = [12, 14, 33, 42], $VQ = [12, 14, 33, 42, 76, 77, 79, 80], $VR = [12, 33], $VS = [34, 36, 37, 38, 39, 40, 41, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74];
18
+ var parser2 = {
19
+ trace: /* @__PURE__ */ __name(function trace() {
20
+ }, "trace"),
21
+ yy: {},
22
+ symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "direction": 5, "direction_tb": 6, "direction_bt": 7, "direction_rl": 8, "direction_lr": 9, "graphConfig": 10, "C4_CONTEXT": 11, "NEWLINE": 12, "statements": 13, "EOF": 14, "C4_CONTAINER": 15, "C4_COMPONENT": 16, "C4_DYNAMIC": 17, "C4_DEPLOYMENT": 18, "otherStatements": 19, "diagramStatements": 20, "otherStatement": 21, "title": 22, "accDescription": 23, "acc_title": 24, "acc_title_value": 25, "acc_descr": 26, "acc_descr_value": 27, "acc_descr_multiline_value": 28, "boundaryStatement": 29, "boundaryStartStatement": 30, "boundaryStopStatement": 31, "boundaryStart": 32, "LBRACE": 33, "ENTERPRISE_BOUNDARY": 34, "attributes": 35, "SYSTEM_BOUNDARY": 36, "BOUNDARY": 37, "CONTAINER_BOUNDARY": 38, "NODE": 39, "NODE_L": 40, "NODE_R": 41, "RBRACE": 42, "diagramStatement": 43, "PERSON": 44, "PERSON_EXT": 45, "SYSTEM": 46, "SYSTEM_DB": 47, "SYSTEM_QUEUE": 48, "SYSTEM_EXT": 49, "SYSTEM_EXT_DB": 50, "SYSTEM_EXT_QUEUE": 51, "CONTAINER": 52, "CONTAINER_DB": 53, "CONTAINER_QUEUE": 54, "CONTAINER_EXT": 55, "CONTAINER_EXT_DB": 56, "CONTAINER_EXT_QUEUE": 57, "COMPONENT": 58, "COMPONENT_DB": 59, "COMPONENT_QUEUE": 60, "COMPONENT_EXT": 61, "COMPONENT_EXT_DB": 62, "COMPONENT_EXT_QUEUE": 63, "REL": 64, "BIREL": 65, "REL_U": 66, "REL_D": 67, "REL_L": 68, "REL_R": 69, "REL_B": 70, "REL_INDEX": 71, "UPDATE_EL_STYLE": 72, "UPDATE_REL_STYLE": 73, "UPDATE_LAYOUT_CONFIG": 74, "attribute": 75, "STR": 76, "STR_KEY": 77, "STR_VALUE": 78, "ATTRIBUTE": 79, "ATTRIBUTE_EMPTY": 80, "$accept": 0, "$end": 1 },
23
+ terminals_: { 2: "error", 6: "direction_tb", 7: "direction_bt", 8: "direction_rl", 9: "direction_lr", 11: "C4_CONTEXT", 12: "NEWLINE", 14: "EOF", 15: "C4_CONTAINER", 16: "C4_COMPONENT", 17: "C4_DYNAMIC", 18: "C4_DEPLOYMENT", 22: "title", 23: "accDescription", 24: "acc_title", 25: "acc_title_value", 26: "acc_descr", 27: "acc_descr_value", 28: "acc_descr_multiline_value", 33: "LBRACE", 34: "ENTERPRISE_BOUNDARY", 36: "SYSTEM_BOUNDARY", 37: "BOUNDARY", 38: "CONTAINER_BOUNDARY", 39: "NODE", 40: "NODE_L", 41: "NODE_R", 42: "RBRACE", 44: "PERSON", 45: "PERSON_EXT", 46: "SYSTEM", 47: "SYSTEM_DB", 48: "SYSTEM_QUEUE", 49: "SYSTEM_EXT", 50: "SYSTEM_EXT_DB", 51: "SYSTEM_EXT_QUEUE", 52: "CONTAINER", 53: "CONTAINER_DB", 54: "CONTAINER_QUEUE", 55: "CONTAINER_EXT", 56: "CONTAINER_EXT_DB", 57: "CONTAINER_EXT_QUEUE", 58: "COMPONENT", 59: "COMPONENT_DB", 60: "COMPONENT_QUEUE", 61: "COMPONENT_EXT", 62: "COMPONENT_EXT_DB", 63: "COMPONENT_EXT_QUEUE", 64: "REL", 65: "BIREL", 66: "REL_U", 67: "REL_D", 68: "REL_L", 69: "REL_R", 70: "REL_B", 71: "REL_INDEX", 72: "UPDATE_EL_STYLE", 73: "UPDATE_REL_STYLE", 74: "UPDATE_LAYOUT_CONFIG", 76: "STR", 77: "STR_KEY", 78: "STR_VALUE", 79: "ATTRIBUTE", 80: "ATTRIBUTE_EMPTY" },
24
+ productions_: [0, [3, 1], [3, 1], [5, 1], [5, 1], [5, 1], [5, 1], [4, 1], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [13, 1], [13, 1], [13, 2], [19, 1], [19, 2], [19, 3], [21, 1], [21, 1], [21, 2], [21, 2], [21, 1], [29, 3], [30, 3], [30, 3], [30, 4], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [31, 1], [20, 1], [20, 2], [20, 3], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 1], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [35, 1], [35, 2], [75, 1], [75, 2], [75, 1], [75, 1]],
25
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
26
+ var $0 = $$.length - 1;
27
+ switch (yystate) {
28
+ case 3:
29
+ yy.setDirection("TB");
30
+ break;
31
+ case 4:
32
+ yy.setDirection("BT");
33
+ break;
34
+ case 5:
35
+ yy.setDirection("RL");
36
+ break;
37
+ case 6:
38
+ yy.setDirection("LR");
39
+ break;
40
+ case 8:
41
+ case 9:
42
+ case 10:
43
+ case 11:
44
+ case 12:
45
+ yy.setC4Type($$[$0 - 3]);
46
+ break;
47
+ case 19:
48
+ yy.setTitle($$[$0].substring(6));
49
+ this.$ = $$[$0].substring(6);
50
+ break;
51
+ case 20:
52
+ yy.setAccDescription($$[$0].substring(15));
53
+ this.$ = $$[$0].substring(15);
54
+ break;
55
+ case 21:
56
+ this.$ = $$[$0].trim();
57
+ yy.setTitle(this.$);
58
+ break;
59
+ case 22:
60
+ case 23:
61
+ this.$ = $$[$0].trim();
62
+ yy.setAccDescription(this.$);
63
+ break;
64
+ case 28:
65
+ $$[$0].splice(2, 0, "ENTERPRISE");
66
+ yy.addPersonOrSystemBoundary(...$$[$0]);
67
+ this.$ = $$[$0];
68
+ break;
69
+ case 29:
70
+ $$[$0].splice(2, 0, "SYSTEM");
71
+ yy.addPersonOrSystemBoundary(...$$[$0]);
72
+ this.$ = $$[$0];
73
+ break;
74
+ case 30:
75
+ yy.addPersonOrSystemBoundary(...$$[$0]);
76
+ this.$ = $$[$0];
77
+ break;
78
+ case 31:
79
+ $$[$0].splice(2, 0, "CONTAINER");
80
+ yy.addContainerBoundary(...$$[$0]);
81
+ this.$ = $$[$0];
82
+ break;
83
+ case 32:
84
+ yy.addDeploymentNode("node", ...$$[$0]);
85
+ this.$ = $$[$0];
86
+ break;
87
+ case 33:
88
+ yy.addDeploymentNode("nodeL", ...$$[$0]);
89
+ this.$ = $$[$0];
90
+ break;
91
+ case 34:
92
+ yy.addDeploymentNode("nodeR", ...$$[$0]);
93
+ this.$ = $$[$0];
94
+ break;
95
+ case 35:
96
+ yy.popBoundaryParseStack();
97
+ break;
98
+ case 39:
99
+ yy.addPersonOrSystem("person", ...$$[$0]);
100
+ this.$ = $$[$0];
101
+ break;
102
+ case 40:
103
+ yy.addPersonOrSystem("external_person", ...$$[$0]);
104
+ this.$ = $$[$0];
105
+ break;
106
+ case 41:
107
+ yy.addPersonOrSystem("system", ...$$[$0]);
108
+ this.$ = $$[$0];
109
+ break;
110
+ case 42:
111
+ yy.addPersonOrSystem("system_db", ...$$[$0]);
112
+ this.$ = $$[$0];
113
+ break;
114
+ case 43:
115
+ yy.addPersonOrSystem("system_queue", ...$$[$0]);
116
+ this.$ = $$[$0];
117
+ break;
118
+ case 44:
119
+ yy.addPersonOrSystem("external_system", ...$$[$0]);
120
+ this.$ = $$[$0];
121
+ break;
122
+ case 45:
123
+ yy.addPersonOrSystem("external_system_db", ...$$[$0]);
124
+ this.$ = $$[$0];
125
+ break;
126
+ case 46:
127
+ yy.addPersonOrSystem("external_system_queue", ...$$[$0]);
128
+ this.$ = $$[$0];
129
+ break;
130
+ case 47:
131
+ yy.addContainer("container", ...$$[$0]);
132
+ this.$ = $$[$0];
133
+ break;
134
+ case 48:
135
+ yy.addContainer("container_db", ...$$[$0]);
136
+ this.$ = $$[$0];
137
+ break;
138
+ case 49:
139
+ yy.addContainer("container_queue", ...$$[$0]);
140
+ this.$ = $$[$0];
141
+ break;
142
+ case 50:
143
+ yy.addContainer("external_container", ...$$[$0]);
144
+ this.$ = $$[$0];
145
+ break;
146
+ case 51:
147
+ yy.addContainer("external_container_db", ...$$[$0]);
148
+ this.$ = $$[$0];
149
+ break;
150
+ case 52:
151
+ yy.addContainer("external_container_queue", ...$$[$0]);
152
+ this.$ = $$[$0];
153
+ break;
154
+ case 53:
155
+ yy.addComponent("component", ...$$[$0]);
156
+ this.$ = $$[$0];
157
+ break;
158
+ case 54:
159
+ yy.addComponent("component_db", ...$$[$0]);
160
+ this.$ = $$[$0];
161
+ break;
162
+ case 55:
163
+ yy.addComponent("component_queue", ...$$[$0]);
164
+ this.$ = $$[$0];
165
+ break;
166
+ case 56:
167
+ yy.addComponent("external_component", ...$$[$0]);
168
+ this.$ = $$[$0];
169
+ break;
170
+ case 57:
171
+ yy.addComponent("external_component_db", ...$$[$0]);
172
+ this.$ = $$[$0];
173
+ break;
174
+ case 58:
175
+ yy.addComponent("external_component_queue", ...$$[$0]);
176
+ this.$ = $$[$0];
177
+ break;
178
+ case 60:
179
+ yy.addRel("rel", ...$$[$0]);
180
+ this.$ = $$[$0];
181
+ break;
182
+ case 61:
183
+ yy.addRel("birel", ...$$[$0]);
184
+ this.$ = $$[$0];
185
+ break;
186
+ case 62:
187
+ yy.addRel("rel_u", ...$$[$0]);
188
+ this.$ = $$[$0];
189
+ break;
190
+ case 63:
191
+ yy.addRel("rel_d", ...$$[$0]);
192
+ this.$ = $$[$0];
193
+ break;
194
+ case 64:
195
+ yy.addRel("rel_l", ...$$[$0]);
196
+ this.$ = $$[$0];
197
+ break;
198
+ case 65:
199
+ yy.addRel("rel_r", ...$$[$0]);
200
+ this.$ = $$[$0];
201
+ break;
202
+ case 66:
203
+ yy.addRel("rel_b", ...$$[$0]);
204
+ this.$ = $$[$0];
205
+ break;
206
+ case 67:
207
+ $$[$0].splice(0, 1);
208
+ yy.addRel("rel", ...$$[$0]);
209
+ this.$ = $$[$0];
210
+ break;
211
+ case 68:
212
+ yy.updateElStyle("update_el_style", ...$$[$0]);
213
+ this.$ = $$[$0];
214
+ break;
215
+ case 69:
216
+ yy.updateRelStyle("update_rel_style", ...$$[$0]);
217
+ this.$ = $$[$0];
218
+ break;
219
+ case 70:
220
+ yy.updateLayoutConfig("update_layout_config", ...$$[$0]);
221
+ this.$ = $$[$0];
222
+ break;
223
+ case 71:
224
+ this.$ = [$$[$0]];
225
+ break;
226
+ case 72:
227
+ $$[$0].unshift($$[$0 - 1]);
228
+ this.$ = $$[$0];
229
+ break;
230
+ case 73:
231
+ case 75:
232
+ this.$ = $$[$0].trim();
233
+ break;
234
+ case 74:
235
+ let kv = {};
236
+ kv[$$[$0 - 1].trim()] = $$[$0].trim();
237
+ this.$ = kv;
238
+ break;
239
+ case 76:
240
+ this.$ = "";
241
+ break;
242
+ }
243
+ }, "anonymous"),
244
+ table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 7: [1, 6], 8: [1, 7], 9: [1, 8], 10: 4, 11: [1, 9], 15: [1, 10], 16: [1, 11], 17: [1, 12], 18: [1, 13] }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 7] }, { 1: [2, 3] }, { 1: [2, 4] }, { 1: [2, 5] }, { 1: [2, 6] }, { 12: [1, 14] }, { 12: [1, 15] }, { 12: [1, 16] }, { 12: [1, 17] }, { 12: [1, 18] }, { 13: 19, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 70, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 71, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 72, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 73, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 14: [1, 74] }, o($VH, [2, 13], { 43: 23, 29: 49, 30: 61, 32: 62, 20: 75, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o($VH, [2, 14]), o($VI, [2, 16], { 12: [1, 76] }), o($VH, [2, 36], { 12: [1, 77] }), o($VJ, [2, 19]), o($VJ, [2, 20]), { 25: [1, 78] }, { 27: [1, 79] }, o($VJ, [2, 23]), { 35: 80, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 86, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 87, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 88, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 89, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 90, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 91, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 92, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 93, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 94, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 95, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 96, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 97, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 98, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 99, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 100, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 101, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 102, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 103, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 104, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, o($VO, [2, 59]), { 35: 105, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 106, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 107, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 108, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 109, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 110, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 111, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 112, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 113, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 114, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 115, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 20: 116, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 12: [1, 118], 33: [1, 117] }, { 35: 119, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 120, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 121, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 122, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 123, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 124, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 125, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 14: [1, 126] }, { 14: [1, 127] }, { 14: [1, 128] }, { 14: [1, 129] }, { 1: [2, 8] }, o($VH, [2, 15]), o($VI, [2, 17], { 21: 22, 19: 130, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4 }), o($VH, [2, 37], { 19: 20, 20: 21, 21: 22, 43: 23, 29: 49, 30: 61, 32: 62, 13: 131, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o($VJ, [2, 21]), o($VJ, [2, 22]), o($VO, [2, 39]), o($VP, [2, 71], { 75: 81, 35: 132, 76: $VK, 77: $VL, 79: $VM, 80: $VN }), o($VQ, [2, 73]), { 78: [1, 133] }, o($VQ, [2, 75]), o($VQ, [2, 76]), o($VO, [2, 40]), o($VO, [2, 41]), o($VO, [2, 42]), o($VO, [2, 43]), o($VO, [2, 44]), o($VO, [2, 45]), o($VO, [2, 46]), o($VO, [2, 47]), o($VO, [2, 48]), o($VO, [2, 49]), o($VO, [2, 50]), o($VO, [2, 51]), o($VO, [2, 52]), o($VO, [2, 53]), o($VO, [2, 54]), o($VO, [2, 55]), o($VO, [2, 56]), o($VO, [2, 57]), o($VO, [2, 58]), o($VO, [2, 60]), o($VO, [2, 61]), o($VO, [2, 62]), o($VO, [2, 63]), o($VO, [2, 64]), o($VO, [2, 65]), o($VO, [2, 66]), o($VO, [2, 67]), o($VO, [2, 68]), o($VO, [2, 69]), o($VO, [2, 70]), { 31: 134, 42: [1, 135] }, { 12: [1, 136] }, { 33: [1, 137] }, o($VR, [2, 28]), o($VR, [2, 29]), o($VR, [2, 30]), o($VR, [2, 31]), o($VR, [2, 32]), o($VR, [2, 33]), o($VR, [2, 34]), { 1: [2, 9] }, { 1: [2, 10] }, { 1: [2, 11] }, { 1: [2, 12] }, o($VI, [2, 18]), o($VH, [2, 38]), o($VP, [2, 72]), o($VQ, [2, 74]), o($VO, [2, 24]), o($VO, [2, 35]), o($VS, [2, 25]), o($VS, [2, 26], { 12: [1, 138] }), o($VS, [2, 27])],
245
+ defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 7], 5: [2, 3], 6: [2, 4], 7: [2, 5], 8: [2, 6], 74: [2, 8], 126: [2, 9], 127: [2, 10], 128: [2, 11], 129: [2, 12] },
246
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
247
+ if (hash.recoverable) {
248
+ this.trace(str);
249
+ } else {
250
+ var error = new Error(str);
251
+ error.hash = hash;
252
+ throw error;
253
+ }
254
+ }, "parseError"),
255
+ parse: /* @__PURE__ */ __name(function parse(input) {
256
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
257
+ var args = lstack.slice.call(arguments, 1);
258
+ var lexer2 = Object.create(this.lexer);
259
+ var sharedState = { yy: {} };
260
+ for (var k in this.yy) {
261
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
262
+ sharedState.yy[k] = this.yy[k];
263
+ }
264
+ }
265
+ lexer2.setInput(input, sharedState.yy);
266
+ sharedState.yy.lexer = lexer2;
267
+ sharedState.yy.parser = this;
268
+ if (typeof lexer2.yylloc == "undefined") {
269
+ lexer2.yylloc = {};
270
+ }
271
+ var yyloc = lexer2.yylloc;
272
+ lstack.push(yyloc);
273
+ var ranges = lexer2.options && lexer2.options.ranges;
274
+ if (typeof sharedState.yy.parseError === "function") {
275
+ this.parseError = sharedState.yy.parseError;
276
+ } else {
277
+ this.parseError = Object.getPrototypeOf(this).parseError;
278
+ }
279
+ function popStack(n) {
280
+ stack.length = stack.length - 2 * n;
281
+ vstack.length = vstack.length - n;
282
+ lstack.length = lstack.length - n;
283
+ }
284
+ __name(popStack, "popStack");
285
+ function lex() {
286
+ var token;
287
+ token = tstack.pop() || lexer2.lex() || EOF;
288
+ if (typeof token !== "number") {
289
+ if (token instanceof Array) {
290
+ tstack = token;
291
+ token = tstack.pop();
292
+ }
293
+ token = self.symbols_[token] || token;
294
+ }
295
+ return token;
296
+ }
297
+ __name(lex, "lex");
298
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
299
+ while (true) {
300
+ state = stack[stack.length - 1];
301
+ if (this.defaultActions[state]) {
302
+ action = this.defaultActions[state];
303
+ } else {
304
+ if (symbol === null || typeof symbol == "undefined") {
305
+ symbol = lex();
306
+ }
307
+ action = table[state] && table[state][symbol];
308
+ }
309
+ if (typeof action === "undefined" || !action.length || !action[0]) {
310
+ var errStr = "";
311
+ expected = [];
312
+ for (p in table[state]) {
313
+ if (this.terminals_[p] && p > TERROR) {
314
+ expected.push("'" + this.terminals_[p] + "'");
315
+ }
316
+ }
317
+ if (lexer2.showPosition) {
318
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
319
+ } else {
320
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
321
+ }
322
+ this.parseError(errStr, {
323
+ text: lexer2.match,
324
+ token: this.terminals_[symbol] || symbol,
325
+ line: lexer2.yylineno,
326
+ loc: yyloc,
327
+ expected
328
+ });
329
+ }
330
+ if (action[0] instanceof Array && action.length > 1) {
331
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
332
+ }
333
+ switch (action[0]) {
334
+ case 1:
335
+ stack.push(symbol);
336
+ vstack.push(lexer2.yytext);
337
+ lstack.push(lexer2.yylloc);
338
+ stack.push(action[1]);
339
+ symbol = null;
340
+ {
341
+ yyleng = lexer2.yyleng;
342
+ yytext = lexer2.yytext;
343
+ yylineno = lexer2.yylineno;
344
+ yyloc = lexer2.yylloc;
345
+ }
346
+ break;
347
+ case 2:
348
+ len = this.productions_[action[1]][1];
349
+ yyval.$ = vstack[vstack.length - len];
350
+ yyval._$ = {
351
+ first_line: lstack[lstack.length - (len || 1)].first_line,
352
+ last_line: lstack[lstack.length - 1].last_line,
353
+ first_column: lstack[lstack.length - (len || 1)].first_column,
354
+ last_column: lstack[lstack.length - 1].last_column
355
+ };
356
+ if (ranges) {
357
+ yyval._$.range = [
358
+ lstack[lstack.length - (len || 1)].range[0],
359
+ lstack[lstack.length - 1].range[1]
360
+ ];
361
+ }
362
+ r = this.performAction.apply(yyval, [
363
+ yytext,
364
+ yyleng,
365
+ yylineno,
366
+ sharedState.yy,
367
+ action[1],
368
+ vstack,
369
+ lstack
370
+ ].concat(args));
371
+ if (typeof r !== "undefined") {
372
+ return r;
373
+ }
374
+ if (len) {
375
+ stack = stack.slice(0, -1 * len * 2);
376
+ vstack = vstack.slice(0, -1 * len);
377
+ lstack = lstack.slice(0, -1 * len);
378
+ }
379
+ stack.push(this.productions_[action[1]][0]);
380
+ vstack.push(yyval.$);
381
+ lstack.push(yyval._$);
382
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
383
+ stack.push(newState);
384
+ break;
385
+ case 3:
386
+ return true;
387
+ }
388
+ }
389
+ return true;
390
+ }, "parse")
391
+ };
392
+ var lexer = /* @__PURE__ */ function() {
393
+ var lexer2 = {
394
+ EOF: 1,
395
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
396
+ if (this.yy.parser) {
397
+ this.yy.parser.parseError(str, hash);
398
+ } else {
399
+ throw new Error(str);
400
+ }
401
+ }, "parseError"),
402
+ // resets the lexer, sets new input
403
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
404
+ this.yy = yy || this.yy || {};
405
+ this._input = input;
406
+ this._more = this._backtrack = this.done = false;
407
+ this.yylineno = this.yyleng = 0;
408
+ this.yytext = this.matched = this.match = "";
409
+ this.conditionStack = ["INITIAL"];
410
+ this.yylloc = {
411
+ first_line: 1,
412
+ first_column: 0,
413
+ last_line: 1,
414
+ last_column: 0
415
+ };
416
+ if (this.options.ranges) {
417
+ this.yylloc.range = [0, 0];
418
+ }
419
+ this.offset = 0;
420
+ return this;
421
+ }, "setInput"),
422
+ // consumes and returns one char from the input
423
+ input: /* @__PURE__ */ __name(function() {
424
+ var ch = this._input[0];
425
+ this.yytext += ch;
426
+ this.yyleng++;
427
+ this.offset++;
428
+ this.match += ch;
429
+ this.matched += ch;
430
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
431
+ if (lines) {
432
+ this.yylineno++;
433
+ this.yylloc.last_line++;
434
+ } else {
435
+ this.yylloc.last_column++;
436
+ }
437
+ if (this.options.ranges) {
438
+ this.yylloc.range[1]++;
439
+ }
440
+ this._input = this._input.slice(1);
441
+ return ch;
442
+ }, "input"),
443
+ // unshifts one char (or a string) into the input
444
+ unput: /* @__PURE__ */ __name(function(ch) {
445
+ var len = ch.length;
446
+ var lines = ch.split(/(?:\r\n?|\n)/g);
447
+ this._input = ch + this._input;
448
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
449
+ this.offset -= len;
450
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
451
+ this.match = this.match.substr(0, this.match.length - 1);
452
+ this.matched = this.matched.substr(0, this.matched.length - 1);
453
+ if (lines.length - 1) {
454
+ this.yylineno -= lines.length - 1;
455
+ }
456
+ var r = this.yylloc.range;
457
+ this.yylloc = {
458
+ first_line: this.yylloc.first_line,
459
+ last_line: this.yylineno + 1,
460
+ first_column: this.yylloc.first_column,
461
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
462
+ };
463
+ if (this.options.ranges) {
464
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
465
+ }
466
+ this.yyleng = this.yytext.length;
467
+ return this;
468
+ }, "unput"),
469
+ // When called from action, caches matched text and appends it on next action
470
+ more: /* @__PURE__ */ __name(function() {
471
+ this._more = true;
472
+ return this;
473
+ }, "more"),
474
+ // 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.
475
+ reject: /* @__PURE__ */ __name(function() {
476
+ if (this.options.backtrack_lexer) {
477
+ this._backtrack = true;
478
+ } else {
479
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
480
+ text: "",
481
+ token: null,
482
+ line: this.yylineno
483
+ });
484
+ }
485
+ return this;
486
+ }, "reject"),
487
+ // retain first n characters of the match
488
+ less: /* @__PURE__ */ __name(function(n) {
489
+ this.unput(this.match.slice(n));
490
+ }, "less"),
491
+ // displays already matched input, i.e. for error messages
492
+ pastInput: /* @__PURE__ */ __name(function() {
493
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
494
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
495
+ }, "pastInput"),
496
+ // displays upcoming input, i.e. for error messages
497
+ upcomingInput: /* @__PURE__ */ __name(function() {
498
+ var next = this.match;
499
+ if (next.length < 20) {
500
+ next += this._input.substr(0, 20 - next.length);
501
+ }
502
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
503
+ }, "upcomingInput"),
504
+ // displays the character position where the lexing error occurred, i.e. for error messages
505
+ showPosition: /* @__PURE__ */ __name(function() {
506
+ var pre = this.pastInput();
507
+ var c2 = new Array(pre.length + 1).join("-");
508
+ return pre + this.upcomingInput() + "\n" + c2 + "^";
509
+ }, "showPosition"),
510
+ // test the lexed token: return FALSE when not a match, otherwise return token
511
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
512
+ var token, lines, backup;
513
+ if (this.options.backtrack_lexer) {
514
+ backup = {
515
+ yylineno: this.yylineno,
516
+ yylloc: {
517
+ first_line: this.yylloc.first_line,
518
+ last_line: this.last_line,
519
+ first_column: this.yylloc.first_column,
520
+ last_column: this.yylloc.last_column
521
+ },
522
+ yytext: this.yytext,
523
+ match: this.match,
524
+ matches: this.matches,
525
+ matched: this.matched,
526
+ yyleng: this.yyleng,
527
+ offset: this.offset,
528
+ _more: this._more,
529
+ _input: this._input,
530
+ yy: this.yy,
531
+ conditionStack: this.conditionStack.slice(0),
532
+ done: this.done
533
+ };
534
+ if (this.options.ranges) {
535
+ backup.yylloc.range = this.yylloc.range.slice(0);
536
+ }
537
+ }
538
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
539
+ if (lines) {
540
+ this.yylineno += lines.length;
541
+ }
542
+ this.yylloc = {
543
+ first_line: this.yylloc.last_line,
544
+ last_line: this.yylineno + 1,
545
+ first_column: this.yylloc.last_column,
546
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
547
+ };
548
+ this.yytext += match[0];
549
+ this.match += match[0];
550
+ this.matches = match;
551
+ this.yyleng = this.yytext.length;
552
+ if (this.options.ranges) {
553
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
554
+ }
555
+ this._more = false;
556
+ this._backtrack = false;
557
+ this._input = this._input.slice(match[0].length);
558
+ this.matched += match[0];
559
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
560
+ if (this.done && this._input) {
561
+ this.done = false;
562
+ }
563
+ if (token) {
564
+ return token;
565
+ } else if (this._backtrack) {
566
+ for (var k in backup) {
567
+ this[k] = backup[k];
568
+ }
569
+ return false;
570
+ }
571
+ return false;
572
+ }, "test_match"),
573
+ // return next match in input
574
+ next: /* @__PURE__ */ __name(function() {
575
+ if (this.done) {
576
+ return this.EOF;
577
+ }
578
+ if (!this._input) {
579
+ this.done = true;
580
+ }
581
+ var token, match, tempMatch, index;
582
+ if (!this._more) {
583
+ this.yytext = "";
584
+ this.match = "";
585
+ }
586
+ var rules = this._currentRules();
587
+ for (var i = 0; i < rules.length; i++) {
588
+ tempMatch = this._input.match(this.rules[rules[i]]);
589
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
590
+ match = tempMatch;
591
+ index = i;
592
+ if (this.options.backtrack_lexer) {
593
+ token = this.test_match(tempMatch, rules[i]);
594
+ if (token !== false) {
595
+ return token;
596
+ } else if (this._backtrack) {
597
+ match = false;
598
+ continue;
599
+ } else {
600
+ return false;
601
+ }
602
+ } else if (!this.options.flex) {
603
+ break;
604
+ }
605
+ }
606
+ }
607
+ if (match) {
608
+ token = this.test_match(match, rules[index]);
609
+ if (token !== false) {
610
+ return token;
611
+ }
612
+ return false;
613
+ }
614
+ if (this._input === "") {
615
+ return this.EOF;
616
+ } else {
617
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
618
+ text: "",
619
+ token: null,
620
+ line: this.yylineno
621
+ });
622
+ }
623
+ }, "next"),
624
+ // return next match that has a token
625
+ lex: /* @__PURE__ */ __name(function lex() {
626
+ var r = this.next();
627
+ if (r) {
628
+ return r;
629
+ } else {
630
+ return this.lex();
631
+ }
632
+ }, "lex"),
633
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
634
+ begin: /* @__PURE__ */ __name(function begin(condition) {
635
+ this.conditionStack.push(condition);
636
+ }, "begin"),
637
+ // pop the previously active lexer condition state off the condition stack
638
+ popState: /* @__PURE__ */ __name(function popState() {
639
+ var n = this.conditionStack.length - 1;
640
+ if (n > 0) {
641
+ return this.conditionStack.pop();
642
+ } else {
643
+ return this.conditionStack[0];
644
+ }
645
+ }, "popState"),
646
+ // produce the lexer rule set which is active for the currently active lexer condition state
647
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
648
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
649
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
650
+ } else {
651
+ return this.conditions["INITIAL"].rules;
652
+ }
653
+ }, "_currentRules"),
654
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
655
+ topState: /* @__PURE__ */ __name(function topState(n) {
656
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
657
+ if (n >= 0) {
658
+ return this.conditionStack[n];
659
+ } else {
660
+ return "INITIAL";
661
+ }
662
+ }, "topState"),
663
+ // alias for begin(condition)
664
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
665
+ this.begin(condition);
666
+ }, "pushState"),
667
+ // return the number of states currently on the stack
668
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
669
+ return this.conditionStack.length;
670
+ }, "stateStackSize"),
671
+ options: {},
672
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
673
+ switch ($avoiding_name_collisions) {
674
+ case 0:
675
+ return 6;
676
+ case 1:
677
+ return 7;
678
+ case 2:
679
+ return 8;
680
+ case 3:
681
+ return 9;
682
+ case 4:
683
+ return 22;
684
+ case 5:
685
+ return 23;
686
+ case 6:
687
+ this.begin("acc_title");
688
+ return 24;
689
+ case 7:
690
+ this.popState();
691
+ return "acc_title_value";
692
+ case 8:
693
+ this.begin("acc_descr");
694
+ return 26;
695
+ case 9:
696
+ this.popState();
697
+ return "acc_descr_value";
698
+ case 10:
699
+ this.begin("acc_descr_multiline");
700
+ break;
701
+ case 11:
702
+ this.popState();
703
+ break;
704
+ case 12:
705
+ return "acc_descr_multiline_value";
706
+ case 13:
707
+ break;
708
+ case 14:
709
+ c;
710
+ break;
711
+ case 15:
712
+ return 12;
713
+ case 16:
714
+ break;
715
+ case 17:
716
+ return 11;
717
+ case 18:
718
+ return 15;
719
+ case 19:
720
+ return 16;
721
+ case 20:
722
+ return 17;
723
+ case 21:
724
+ return 18;
725
+ case 22:
726
+ this.begin("person_ext");
727
+ return 45;
728
+ case 23:
729
+ this.begin("person");
730
+ return 44;
731
+ case 24:
732
+ this.begin("system_ext_queue");
733
+ return 51;
734
+ case 25:
735
+ this.begin("system_ext_db");
736
+ return 50;
737
+ case 26:
738
+ this.begin("system_ext");
739
+ return 49;
740
+ case 27:
741
+ this.begin("system_queue");
742
+ return 48;
743
+ case 28:
744
+ this.begin("system_db");
745
+ return 47;
746
+ case 29:
747
+ this.begin("system");
748
+ return 46;
749
+ case 30:
750
+ this.begin("boundary");
751
+ return 37;
752
+ case 31:
753
+ this.begin("enterprise_boundary");
754
+ return 34;
755
+ case 32:
756
+ this.begin("system_boundary");
757
+ return 36;
758
+ case 33:
759
+ this.begin("container_ext_queue");
760
+ return 57;
761
+ case 34:
762
+ this.begin("container_ext_db");
763
+ return 56;
764
+ case 35:
765
+ this.begin("container_ext");
766
+ return 55;
767
+ case 36:
768
+ this.begin("container_queue");
769
+ return 54;
770
+ case 37:
771
+ this.begin("container_db");
772
+ return 53;
773
+ case 38:
774
+ this.begin("container");
775
+ return 52;
776
+ case 39:
777
+ this.begin("container_boundary");
778
+ return 38;
779
+ case 40:
780
+ this.begin("component_ext_queue");
781
+ return 63;
782
+ case 41:
783
+ this.begin("component_ext_db");
784
+ return 62;
785
+ case 42:
786
+ this.begin("component_ext");
787
+ return 61;
788
+ case 43:
789
+ this.begin("component_queue");
790
+ return 60;
791
+ case 44:
792
+ this.begin("component_db");
793
+ return 59;
794
+ case 45:
795
+ this.begin("component");
796
+ return 58;
797
+ case 46:
798
+ this.begin("node");
799
+ return 39;
800
+ case 47:
801
+ this.begin("node");
802
+ return 39;
803
+ case 48:
804
+ this.begin("node_l");
805
+ return 40;
806
+ case 49:
807
+ this.begin("node_r");
808
+ return 41;
809
+ case 50:
810
+ this.begin("rel");
811
+ return 64;
812
+ case 51:
813
+ this.begin("birel");
814
+ return 65;
815
+ case 52:
816
+ this.begin("rel_u");
817
+ return 66;
818
+ case 53:
819
+ this.begin("rel_u");
820
+ return 66;
821
+ case 54:
822
+ this.begin("rel_d");
823
+ return 67;
824
+ case 55:
825
+ this.begin("rel_d");
826
+ return 67;
827
+ case 56:
828
+ this.begin("rel_l");
829
+ return 68;
830
+ case 57:
831
+ this.begin("rel_l");
832
+ return 68;
833
+ case 58:
834
+ this.begin("rel_r");
835
+ return 69;
836
+ case 59:
837
+ this.begin("rel_r");
838
+ return 69;
839
+ case 60:
840
+ this.begin("rel_b");
841
+ return 70;
842
+ case 61:
843
+ this.begin("rel_index");
844
+ return 71;
845
+ case 62:
846
+ this.begin("update_el_style");
847
+ return 72;
848
+ case 63:
849
+ this.begin("update_rel_style");
850
+ return 73;
851
+ case 64:
852
+ this.begin("update_layout_config");
853
+ return 74;
854
+ case 65:
855
+ return "EOF_IN_STRUCT";
856
+ case 66:
857
+ this.begin("attribute");
858
+ return "ATTRIBUTE_EMPTY";
859
+ case 67:
860
+ this.begin("attribute");
861
+ break;
862
+ case 68:
863
+ this.popState();
864
+ this.popState();
865
+ break;
866
+ case 69:
867
+ return 80;
868
+ case 70:
869
+ break;
870
+ case 71:
871
+ return 80;
872
+ case 72:
873
+ this.begin("string");
874
+ break;
875
+ case 73:
876
+ this.popState();
877
+ break;
878
+ case 74:
879
+ return "STR";
880
+ case 75:
881
+ this.begin("string_kv");
882
+ break;
883
+ case 76:
884
+ this.begin("string_kv_key");
885
+ return "STR_KEY";
886
+ case 77:
887
+ this.popState();
888
+ this.begin("string_kv_value");
889
+ break;
890
+ case 78:
891
+ return "STR_VALUE";
892
+ case 79:
893
+ this.popState();
894
+ this.popState();
895
+ break;
896
+ case 80:
897
+ return "STR";
898
+ case 81:
899
+ return "LBRACE";
900
+ case 82:
901
+ return "RBRACE";
902
+ case 83:
903
+ return "SPACE";
904
+ case 84:
905
+ return "EOL";
906
+ case 85:
907
+ return 14;
908
+ }
909
+ }, "anonymous"),
910
+ rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:title\s[^#\n;]+)/, /^(?:accDescription\s[^#\n;]+)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:C4Context\b)/, /^(?:C4Container\b)/, /^(?:C4Component\b)/, /^(?:C4Dynamic\b)/, /^(?:C4Deployment\b)/, /^(?:Person_Ext\b)/, /^(?:Person\b)/, /^(?:SystemQueue_Ext\b)/, /^(?:SystemDb_Ext\b)/, /^(?:System_Ext\b)/, /^(?:SystemQueue\b)/, /^(?:SystemDb\b)/, /^(?:System\b)/, /^(?:Boundary\b)/, /^(?:Enterprise_Boundary\b)/, /^(?:System_Boundary\b)/, /^(?:ContainerQueue_Ext\b)/, /^(?:ContainerDb_Ext\b)/, /^(?:Container_Ext\b)/, /^(?:ContainerQueue\b)/, /^(?:ContainerDb\b)/, /^(?:Container\b)/, /^(?:Container_Boundary\b)/, /^(?:ComponentQueue_Ext\b)/, /^(?:ComponentDb_Ext\b)/, /^(?:Component_Ext\b)/, /^(?:ComponentQueue\b)/, /^(?:ComponentDb\b)/, /^(?:Component\b)/, /^(?:Deployment_Node\b)/, /^(?:Node\b)/, /^(?:Node_L\b)/, /^(?:Node_R\b)/, /^(?:Rel\b)/, /^(?:BiRel\b)/, /^(?:Rel_Up\b)/, /^(?:Rel_U\b)/, /^(?:Rel_Down\b)/, /^(?:Rel_D\b)/, /^(?:Rel_Left\b)/, /^(?:Rel_L\b)/, /^(?:Rel_Right\b)/, /^(?:Rel_R\b)/, /^(?:Rel_Back\b)/, /^(?:RelIndex\b)/, /^(?:UpdateElementStyle\b)/, /^(?:UpdateRelStyle\b)/, /^(?:UpdateLayoutConfig\b)/, /^(?:$)/, /^(?:[(][ ]*[,])/, /^(?:[(])/, /^(?:[)])/, /^(?:,,)/, /^(?:,)/, /^(?:[ ]*["]["])/, /^(?:[ ]*["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:[ ]*[\$])/, /^(?:[^=]*)/, /^(?:[=][ ]*["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:[^,]+)/, /^(?:\{)/, /^(?:\})/, /^(?:[\s]+)/, /^(?:[\n\r]+)/, /^(?:$)/],
911
+ conditions: { "acc_descr_multiline": { "rules": [11, 12], "inclusive": false }, "acc_descr": { "rules": [9], "inclusive": false }, "acc_title": { "rules": [7], "inclusive": false }, "string_kv_value": { "rules": [78, 79], "inclusive": false }, "string_kv_key": { "rules": [77], "inclusive": false }, "string_kv": { "rules": [76], "inclusive": false }, "string": { "rules": [73, 74], "inclusive": false }, "attribute": { "rules": [68, 69, 70, 71, 72, 75, 80], "inclusive": false }, "update_layout_config": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_rel_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_el_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_b": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_d": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_u": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_bi": { "rules": [], "inclusive": false }, "rel": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "node": { "rules": [65, 66, 67, 68], "inclusive": false }, "index": { "rules": [], "inclusive": false }, "rel_index": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext_queue": { "rules": [], "inclusive": false }, "component_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container": { "rules": [65, 66, 67, 68], "inclusive": false }, "birel": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "enterprise_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system": { "rules": [65, 66, 67, 68], "inclusive": false }, "person_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "person": { "rules": [65, 66, 67, 68], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 81, 82, 83, 84, 85], "inclusive": true } }
912
+ };
913
+ return lexer2;
914
+ }();
915
+ parser2.lexer = lexer;
916
+ function Parser() {
917
+ this.yy = {};
918
+ }
919
+ __name(Parser, "Parser");
920
+ Parser.prototype = parser2;
921
+ parser2.Parser = Parser;
922
+ return new Parser();
923
+ }();
924
+ parser.parser = parser;
925
+ var c4Diagram_default = parser;
926
+ var c4ShapeArray = [];
927
+ var boundaryParseStack = [""];
928
+ var currentBoundaryParse = "global";
929
+ var parentBoundaryParse = "";
930
+ var boundaries = [
931
+ {
932
+ alias: "global",
933
+ label: { text: "global" },
934
+ type: { text: "global" },
935
+ tags: null,
936
+ link: null,
937
+ parentBoundary: ""
938
+ }
939
+ ];
940
+ var rels = [];
941
+ var title = "";
942
+ var wrapEnabled = false;
943
+ var c4ShapeInRow = 4;
944
+ var c4BoundaryInRow = 2;
945
+ var c4Type;
946
+ var getC4Type = /* @__PURE__ */ __name(function() {
947
+ return c4Type;
948
+ }, "getC4Type");
949
+ var setC4Type = /* @__PURE__ */ __name(function(c4TypeParam) {
950
+ let sanitizedText = sanitizeText(c4TypeParam, getConfig2());
951
+ c4Type = sanitizedText;
952
+ }, "setC4Type");
953
+ var addRel = /* @__PURE__ */ __name(function(type, from, to, label, techn, descr, sprite, tags, link) {
954
+ if (type === void 0 || type === null || from === void 0 || from === null || to === void 0 || to === null || label === void 0 || label === null) {
955
+ return;
956
+ }
957
+ let rel = {};
958
+ const old = rels.find((rel2) => rel2.from === from && rel2.to === to);
959
+ if (old) {
960
+ rel = old;
961
+ } else {
962
+ rels.push(rel);
963
+ }
964
+ rel.type = type;
965
+ rel.from = from;
966
+ rel.to = to;
967
+ rel.label = { text: label };
968
+ if (techn === void 0 || techn === null) {
969
+ rel.techn = { text: "" };
970
+ } else {
971
+ if (typeof techn === "object") {
972
+ let [key, value] = Object.entries(techn)[0];
973
+ rel[key] = { text: value };
974
+ } else {
975
+ rel.techn = { text: techn };
976
+ }
977
+ }
978
+ if (descr === void 0 || descr === null) {
979
+ rel.descr = { text: "" };
980
+ } else {
981
+ if (typeof descr === "object") {
982
+ let [key, value] = Object.entries(descr)[0];
983
+ rel[key] = { text: value };
984
+ } else {
985
+ rel.descr = { text: descr };
986
+ }
987
+ }
988
+ if (typeof sprite === "object") {
989
+ let [key, value] = Object.entries(sprite)[0];
990
+ rel[key] = value;
991
+ } else {
992
+ rel.sprite = sprite;
993
+ }
994
+ if (typeof tags === "object") {
995
+ let [key, value] = Object.entries(tags)[0];
996
+ rel[key] = value;
997
+ } else {
998
+ rel.tags = tags;
999
+ }
1000
+ if (typeof link === "object") {
1001
+ let [key, value] = Object.entries(link)[0];
1002
+ rel[key] = value;
1003
+ } else {
1004
+ rel.link = link;
1005
+ }
1006
+ rel.wrap = autoWrap();
1007
+ }, "addRel");
1008
+ var addPersonOrSystem = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, descr, sprite, tags, link) {
1009
+ if (alias === null || label === null) {
1010
+ return;
1011
+ }
1012
+ let personOrSystem = {};
1013
+ const old = c4ShapeArray.find((personOrSystem2) => personOrSystem2.alias === alias);
1014
+ if (old && alias === old.alias) {
1015
+ personOrSystem = old;
1016
+ } else {
1017
+ personOrSystem.alias = alias;
1018
+ c4ShapeArray.push(personOrSystem);
1019
+ }
1020
+ if (label === void 0 || label === null) {
1021
+ personOrSystem.label = { text: "" };
1022
+ } else {
1023
+ personOrSystem.label = { text: label };
1024
+ }
1025
+ if (descr === void 0 || descr === null) {
1026
+ personOrSystem.descr = { text: "" };
1027
+ } else {
1028
+ if (typeof descr === "object") {
1029
+ let [key, value] = Object.entries(descr)[0];
1030
+ personOrSystem[key] = { text: value };
1031
+ } else {
1032
+ personOrSystem.descr = { text: descr };
1033
+ }
1034
+ }
1035
+ if (typeof sprite === "object") {
1036
+ let [key, value] = Object.entries(sprite)[0];
1037
+ personOrSystem[key] = value;
1038
+ } else {
1039
+ personOrSystem.sprite = sprite;
1040
+ }
1041
+ if (typeof tags === "object") {
1042
+ let [key, value] = Object.entries(tags)[0];
1043
+ personOrSystem[key] = value;
1044
+ } else {
1045
+ personOrSystem.tags = tags;
1046
+ }
1047
+ if (typeof link === "object") {
1048
+ let [key, value] = Object.entries(link)[0];
1049
+ personOrSystem[key] = value;
1050
+ } else {
1051
+ personOrSystem.link = link;
1052
+ }
1053
+ personOrSystem.typeC4Shape = { text: typeC4Shape };
1054
+ personOrSystem.parentBoundary = currentBoundaryParse;
1055
+ personOrSystem.wrap = autoWrap();
1056
+ }, "addPersonOrSystem");
1057
+ var addContainer = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
1058
+ if (alias === null || label === null) {
1059
+ return;
1060
+ }
1061
+ let container = {};
1062
+ const old = c4ShapeArray.find((container2) => container2.alias === alias);
1063
+ if (old && alias === old.alias) {
1064
+ container = old;
1065
+ } else {
1066
+ container.alias = alias;
1067
+ c4ShapeArray.push(container);
1068
+ }
1069
+ if (label === void 0 || label === null) {
1070
+ container.label = { text: "" };
1071
+ } else {
1072
+ container.label = { text: label };
1073
+ }
1074
+ if (techn === void 0 || techn === null) {
1075
+ container.techn = { text: "" };
1076
+ } else {
1077
+ if (typeof techn === "object") {
1078
+ let [key, value] = Object.entries(techn)[0];
1079
+ container[key] = { text: value };
1080
+ } else {
1081
+ container.techn = { text: techn };
1082
+ }
1083
+ }
1084
+ if (descr === void 0 || descr === null) {
1085
+ container.descr = { text: "" };
1086
+ } else {
1087
+ if (typeof descr === "object") {
1088
+ let [key, value] = Object.entries(descr)[0];
1089
+ container[key] = { text: value };
1090
+ } else {
1091
+ container.descr = { text: descr };
1092
+ }
1093
+ }
1094
+ if (typeof sprite === "object") {
1095
+ let [key, value] = Object.entries(sprite)[0];
1096
+ container[key] = value;
1097
+ } else {
1098
+ container.sprite = sprite;
1099
+ }
1100
+ if (typeof tags === "object") {
1101
+ let [key, value] = Object.entries(tags)[0];
1102
+ container[key] = value;
1103
+ } else {
1104
+ container.tags = tags;
1105
+ }
1106
+ if (typeof link === "object") {
1107
+ let [key, value] = Object.entries(link)[0];
1108
+ container[key] = value;
1109
+ } else {
1110
+ container.link = link;
1111
+ }
1112
+ container.wrap = autoWrap();
1113
+ container.typeC4Shape = { text: typeC4Shape };
1114
+ container.parentBoundary = currentBoundaryParse;
1115
+ }, "addContainer");
1116
+ var addComponent = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
1117
+ if (alias === null || label === null) {
1118
+ return;
1119
+ }
1120
+ let component = {};
1121
+ const old = c4ShapeArray.find((component2) => component2.alias === alias);
1122
+ if (old && alias === old.alias) {
1123
+ component = old;
1124
+ } else {
1125
+ component.alias = alias;
1126
+ c4ShapeArray.push(component);
1127
+ }
1128
+ if (label === void 0 || label === null) {
1129
+ component.label = { text: "" };
1130
+ } else {
1131
+ component.label = { text: label };
1132
+ }
1133
+ if (techn === void 0 || techn === null) {
1134
+ component.techn = { text: "" };
1135
+ } else {
1136
+ if (typeof techn === "object") {
1137
+ let [key, value] = Object.entries(techn)[0];
1138
+ component[key] = { text: value };
1139
+ } else {
1140
+ component.techn = { text: techn };
1141
+ }
1142
+ }
1143
+ if (descr === void 0 || descr === null) {
1144
+ component.descr = { text: "" };
1145
+ } else {
1146
+ if (typeof descr === "object") {
1147
+ let [key, value] = Object.entries(descr)[0];
1148
+ component[key] = { text: value };
1149
+ } else {
1150
+ component.descr = { text: descr };
1151
+ }
1152
+ }
1153
+ if (typeof sprite === "object") {
1154
+ let [key, value] = Object.entries(sprite)[0];
1155
+ component[key] = value;
1156
+ } else {
1157
+ component.sprite = sprite;
1158
+ }
1159
+ if (typeof tags === "object") {
1160
+ let [key, value] = Object.entries(tags)[0];
1161
+ component[key] = value;
1162
+ } else {
1163
+ component.tags = tags;
1164
+ }
1165
+ if (typeof link === "object") {
1166
+ let [key, value] = Object.entries(link)[0];
1167
+ component[key] = value;
1168
+ } else {
1169
+ component.link = link;
1170
+ }
1171
+ component.wrap = autoWrap();
1172
+ component.typeC4Shape = { text: typeC4Shape };
1173
+ component.parentBoundary = currentBoundaryParse;
1174
+ }, "addComponent");
1175
+ var addPersonOrSystemBoundary = /* @__PURE__ */ __name(function(alias, label, type, tags, link) {
1176
+ if (alias === null || label === null) {
1177
+ return;
1178
+ }
1179
+ let boundary = {};
1180
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
1181
+ if (old && alias === old.alias) {
1182
+ boundary = old;
1183
+ } else {
1184
+ boundary.alias = alias;
1185
+ boundaries.push(boundary);
1186
+ }
1187
+ if (label === void 0 || label === null) {
1188
+ boundary.label = { text: "" };
1189
+ } else {
1190
+ boundary.label = { text: label };
1191
+ }
1192
+ if (type === void 0 || type === null) {
1193
+ boundary.type = { text: "system" };
1194
+ } else {
1195
+ if (typeof type === "object") {
1196
+ let [key, value] = Object.entries(type)[0];
1197
+ boundary[key] = { text: value };
1198
+ } else {
1199
+ boundary.type = { text: type };
1200
+ }
1201
+ }
1202
+ if (typeof tags === "object") {
1203
+ let [key, value] = Object.entries(tags)[0];
1204
+ boundary[key] = value;
1205
+ } else {
1206
+ boundary.tags = tags;
1207
+ }
1208
+ if (typeof link === "object") {
1209
+ let [key, value] = Object.entries(link)[0];
1210
+ boundary[key] = value;
1211
+ } else {
1212
+ boundary.link = link;
1213
+ }
1214
+ boundary.parentBoundary = currentBoundaryParse;
1215
+ boundary.wrap = autoWrap();
1216
+ parentBoundaryParse = currentBoundaryParse;
1217
+ currentBoundaryParse = alias;
1218
+ boundaryParseStack.push(parentBoundaryParse);
1219
+ }, "addPersonOrSystemBoundary");
1220
+ var addContainerBoundary = /* @__PURE__ */ __name(function(alias, label, type, tags, link) {
1221
+ if (alias === null || label === null) {
1222
+ return;
1223
+ }
1224
+ let boundary = {};
1225
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
1226
+ if (old && alias === old.alias) {
1227
+ boundary = old;
1228
+ } else {
1229
+ boundary.alias = alias;
1230
+ boundaries.push(boundary);
1231
+ }
1232
+ if (label === void 0 || label === null) {
1233
+ boundary.label = { text: "" };
1234
+ } else {
1235
+ boundary.label = { text: label };
1236
+ }
1237
+ if (type === void 0 || type === null) {
1238
+ boundary.type = { text: "container" };
1239
+ } else {
1240
+ if (typeof type === "object") {
1241
+ let [key, value] = Object.entries(type)[0];
1242
+ boundary[key] = { text: value };
1243
+ } else {
1244
+ boundary.type = { text: type };
1245
+ }
1246
+ }
1247
+ if (typeof tags === "object") {
1248
+ let [key, value] = Object.entries(tags)[0];
1249
+ boundary[key] = value;
1250
+ } else {
1251
+ boundary.tags = tags;
1252
+ }
1253
+ if (typeof link === "object") {
1254
+ let [key, value] = Object.entries(link)[0];
1255
+ boundary[key] = value;
1256
+ } else {
1257
+ boundary.link = link;
1258
+ }
1259
+ boundary.parentBoundary = currentBoundaryParse;
1260
+ boundary.wrap = autoWrap();
1261
+ parentBoundaryParse = currentBoundaryParse;
1262
+ currentBoundaryParse = alias;
1263
+ boundaryParseStack.push(parentBoundaryParse);
1264
+ }, "addContainerBoundary");
1265
+ var addDeploymentNode = /* @__PURE__ */ __name(function(nodeType, alias, label, type, descr, sprite, tags, link) {
1266
+ if (alias === null || label === null) {
1267
+ return;
1268
+ }
1269
+ let boundary = {};
1270
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
1271
+ if (old && alias === old.alias) {
1272
+ boundary = old;
1273
+ } else {
1274
+ boundary.alias = alias;
1275
+ boundaries.push(boundary);
1276
+ }
1277
+ if (label === void 0 || label === null) {
1278
+ boundary.label = { text: "" };
1279
+ } else {
1280
+ boundary.label = { text: label };
1281
+ }
1282
+ if (type === void 0 || type === null) {
1283
+ boundary.type = { text: "node" };
1284
+ } else {
1285
+ if (typeof type === "object") {
1286
+ let [key, value] = Object.entries(type)[0];
1287
+ boundary[key] = { text: value };
1288
+ } else {
1289
+ boundary.type = { text: type };
1290
+ }
1291
+ }
1292
+ if (descr === void 0 || descr === null) {
1293
+ boundary.descr = { text: "" };
1294
+ } else {
1295
+ if (typeof descr === "object") {
1296
+ let [key, value] = Object.entries(descr)[0];
1297
+ boundary[key] = { text: value };
1298
+ } else {
1299
+ boundary.descr = { text: descr };
1300
+ }
1301
+ }
1302
+ if (typeof tags === "object") {
1303
+ let [key, value] = Object.entries(tags)[0];
1304
+ boundary[key] = value;
1305
+ } else {
1306
+ boundary.tags = tags;
1307
+ }
1308
+ if (typeof link === "object") {
1309
+ let [key, value] = Object.entries(link)[0];
1310
+ boundary[key] = value;
1311
+ } else {
1312
+ boundary.link = link;
1313
+ }
1314
+ boundary.nodeType = nodeType;
1315
+ boundary.parentBoundary = currentBoundaryParse;
1316
+ boundary.wrap = autoWrap();
1317
+ parentBoundaryParse = currentBoundaryParse;
1318
+ currentBoundaryParse = alias;
1319
+ boundaryParseStack.push(parentBoundaryParse);
1320
+ }, "addDeploymentNode");
1321
+ var popBoundaryParseStack = /* @__PURE__ */ __name(function() {
1322
+ currentBoundaryParse = parentBoundaryParse;
1323
+ boundaryParseStack.pop();
1324
+ parentBoundaryParse = boundaryParseStack.pop();
1325
+ boundaryParseStack.push(parentBoundaryParse);
1326
+ }, "popBoundaryParseStack");
1327
+ var updateElStyle = /* @__PURE__ */ __name(function(typeC4Shape, elementName, bgColor, fontColor, borderColor, shadowing, shape, sprite, techn, legendText, legendSprite) {
1328
+ let old = c4ShapeArray.find((element) => element.alias === elementName);
1329
+ if (old === void 0) {
1330
+ old = boundaries.find((element) => element.alias === elementName);
1331
+ if (old === void 0) {
1332
+ return;
1333
+ }
1334
+ }
1335
+ if (bgColor !== void 0 && bgColor !== null) {
1336
+ if (typeof bgColor === "object") {
1337
+ let [key, value] = Object.entries(bgColor)[0];
1338
+ old[key] = value;
1339
+ } else {
1340
+ old.bgColor = bgColor;
1341
+ }
1342
+ }
1343
+ if (fontColor !== void 0 && fontColor !== null) {
1344
+ if (typeof fontColor === "object") {
1345
+ let [key, value] = Object.entries(fontColor)[0];
1346
+ old[key] = value;
1347
+ } else {
1348
+ old.fontColor = fontColor;
1349
+ }
1350
+ }
1351
+ if (borderColor !== void 0 && borderColor !== null) {
1352
+ if (typeof borderColor === "object") {
1353
+ let [key, value] = Object.entries(borderColor)[0];
1354
+ old[key] = value;
1355
+ } else {
1356
+ old.borderColor = borderColor;
1357
+ }
1358
+ }
1359
+ if (shadowing !== void 0 && shadowing !== null) {
1360
+ if (typeof shadowing === "object") {
1361
+ let [key, value] = Object.entries(shadowing)[0];
1362
+ old[key] = value;
1363
+ } else {
1364
+ old.shadowing = shadowing;
1365
+ }
1366
+ }
1367
+ if (shape !== void 0 && shape !== null) {
1368
+ if (typeof shape === "object") {
1369
+ let [key, value] = Object.entries(shape)[0];
1370
+ old[key] = value;
1371
+ } else {
1372
+ old.shape = shape;
1373
+ }
1374
+ }
1375
+ if (sprite !== void 0 && sprite !== null) {
1376
+ if (typeof sprite === "object") {
1377
+ let [key, value] = Object.entries(sprite)[0];
1378
+ old[key] = value;
1379
+ } else {
1380
+ old.sprite = sprite;
1381
+ }
1382
+ }
1383
+ if (techn !== void 0 && techn !== null) {
1384
+ if (typeof techn === "object") {
1385
+ let [key, value] = Object.entries(techn)[0];
1386
+ old[key] = value;
1387
+ } else {
1388
+ old.techn = techn;
1389
+ }
1390
+ }
1391
+ if (legendText !== void 0 && legendText !== null) {
1392
+ if (typeof legendText === "object") {
1393
+ let [key, value] = Object.entries(legendText)[0];
1394
+ old[key] = value;
1395
+ } else {
1396
+ old.legendText = legendText;
1397
+ }
1398
+ }
1399
+ if (legendSprite !== void 0 && legendSprite !== null) {
1400
+ if (typeof legendSprite === "object") {
1401
+ let [key, value] = Object.entries(legendSprite)[0];
1402
+ old[key] = value;
1403
+ } else {
1404
+ old.legendSprite = legendSprite;
1405
+ }
1406
+ }
1407
+ }, "updateElStyle");
1408
+ var updateRelStyle = /* @__PURE__ */ __name(function(typeC4Shape, from, to, textColor, lineColor, offsetX, offsetY) {
1409
+ const old = rels.find((rel) => rel.from === from && rel.to === to);
1410
+ if (old === void 0) {
1411
+ return;
1412
+ }
1413
+ if (textColor !== void 0 && textColor !== null) {
1414
+ if (typeof textColor === "object") {
1415
+ let [key, value] = Object.entries(textColor)[0];
1416
+ old[key] = value;
1417
+ } else {
1418
+ old.textColor = textColor;
1419
+ }
1420
+ }
1421
+ if (lineColor !== void 0 && lineColor !== null) {
1422
+ if (typeof lineColor === "object") {
1423
+ let [key, value] = Object.entries(lineColor)[0];
1424
+ old[key] = value;
1425
+ } else {
1426
+ old.lineColor = lineColor;
1427
+ }
1428
+ }
1429
+ if (offsetX !== void 0 && offsetX !== null) {
1430
+ if (typeof offsetX === "object") {
1431
+ let [key, value] = Object.entries(offsetX)[0];
1432
+ old[key] = parseInt(value);
1433
+ } else {
1434
+ old.offsetX = parseInt(offsetX);
1435
+ }
1436
+ }
1437
+ if (offsetY !== void 0 && offsetY !== null) {
1438
+ if (typeof offsetY === "object") {
1439
+ let [key, value] = Object.entries(offsetY)[0];
1440
+ old[key] = parseInt(value);
1441
+ } else {
1442
+ old.offsetY = parseInt(offsetY);
1443
+ }
1444
+ }
1445
+ }, "updateRelStyle");
1446
+ var updateLayoutConfig = /* @__PURE__ */ __name(function(typeC4Shape, c4ShapeInRowParam, c4BoundaryInRowParam) {
1447
+ let c4ShapeInRowValue = c4ShapeInRow;
1448
+ let c4BoundaryInRowValue = c4BoundaryInRow;
1449
+ if (typeof c4ShapeInRowParam === "object") {
1450
+ const value = Object.values(c4ShapeInRowParam)[0];
1451
+ c4ShapeInRowValue = parseInt(value);
1452
+ } else {
1453
+ c4ShapeInRowValue = parseInt(c4ShapeInRowParam);
1454
+ }
1455
+ if (typeof c4BoundaryInRowParam === "object") {
1456
+ const value = Object.values(c4BoundaryInRowParam)[0];
1457
+ c4BoundaryInRowValue = parseInt(value);
1458
+ } else {
1459
+ c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam);
1460
+ }
1461
+ if (c4ShapeInRowValue >= 1) {
1462
+ c4ShapeInRow = c4ShapeInRowValue;
1463
+ }
1464
+ if (c4BoundaryInRowValue >= 1) {
1465
+ c4BoundaryInRow = c4BoundaryInRowValue;
1466
+ }
1467
+ }, "updateLayoutConfig");
1468
+ var getC4ShapeInRow = /* @__PURE__ */ __name(function() {
1469
+ return c4ShapeInRow;
1470
+ }, "getC4ShapeInRow");
1471
+ var getC4BoundaryInRow = /* @__PURE__ */ __name(function() {
1472
+ return c4BoundaryInRow;
1473
+ }, "getC4BoundaryInRow");
1474
+ var getCurrentBoundaryParse = /* @__PURE__ */ __name(function() {
1475
+ return currentBoundaryParse;
1476
+ }, "getCurrentBoundaryParse");
1477
+ var getParentBoundaryParse = /* @__PURE__ */ __name(function() {
1478
+ return parentBoundaryParse;
1479
+ }, "getParentBoundaryParse");
1480
+ var getC4ShapeArray = /* @__PURE__ */ __name(function(parentBoundary) {
1481
+ if (parentBoundary === void 0 || parentBoundary === null) {
1482
+ return c4ShapeArray;
1483
+ } else {
1484
+ return c4ShapeArray.filter((personOrSystem) => {
1485
+ return personOrSystem.parentBoundary === parentBoundary;
1486
+ });
1487
+ }
1488
+ }, "getC4ShapeArray");
1489
+ var getC4Shape = /* @__PURE__ */ __name(function(alias) {
1490
+ return c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias);
1491
+ }, "getC4Shape");
1492
+ var getC4ShapeKeys = /* @__PURE__ */ __name(function(parentBoundary) {
1493
+ return Object.keys(getC4ShapeArray(parentBoundary));
1494
+ }, "getC4ShapeKeys");
1495
+ var getBoundaries = /* @__PURE__ */ __name(function(parentBoundary) {
1496
+ if (parentBoundary === void 0 || parentBoundary === null) {
1497
+ return boundaries;
1498
+ } else {
1499
+ return boundaries.filter((boundary) => boundary.parentBoundary === parentBoundary);
1500
+ }
1501
+ }, "getBoundaries");
1502
+ var getBoundarys = getBoundaries;
1503
+ var getRels = /* @__PURE__ */ __name(function() {
1504
+ return rels;
1505
+ }, "getRels");
1506
+ var getTitle = /* @__PURE__ */ __name(function() {
1507
+ return title;
1508
+ }, "getTitle");
1509
+ var setWrap = /* @__PURE__ */ __name(function(wrapSetting) {
1510
+ wrapEnabled = wrapSetting;
1511
+ }, "setWrap");
1512
+ var autoWrap = /* @__PURE__ */ __name(function() {
1513
+ return wrapEnabled;
1514
+ }, "autoWrap");
1515
+ var clear = /* @__PURE__ */ __name(function() {
1516
+ c4ShapeArray = [];
1517
+ boundaries = [
1518
+ {
1519
+ alias: "global",
1520
+ label: { text: "global" },
1521
+ type: { text: "global" },
1522
+ tags: null,
1523
+ link: null,
1524
+ parentBoundary: ""
1525
+ }
1526
+ ];
1527
+ parentBoundaryParse = "";
1528
+ currentBoundaryParse = "global";
1529
+ boundaryParseStack = [""];
1530
+ rels = [];
1531
+ boundaryParseStack = [""];
1532
+ title = "";
1533
+ wrapEnabled = false;
1534
+ c4ShapeInRow = 4;
1535
+ c4BoundaryInRow = 2;
1536
+ }, "clear");
1537
+ var LINETYPE = {
1538
+ SOLID: 0,
1539
+ DOTTED: 1,
1540
+ NOTE: 2,
1541
+ SOLID_CROSS: 3,
1542
+ DOTTED_CROSS: 4,
1543
+ SOLID_OPEN: 5,
1544
+ DOTTED_OPEN: 6,
1545
+ LOOP_START: 10,
1546
+ LOOP_END: 11,
1547
+ ALT_START: 12,
1548
+ ALT_ELSE: 13,
1549
+ ALT_END: 14,
1550
+ OPT_START: 15,
1551
+ OPT_END: 16,
1552
+ ACTIVE_START: 17,
1553
+ ACTIVE_END: 18,
1554
+ PAR_START: 19,
1555
+ PAR_AND: 20,
1556
+ PAR_END: 21,
1557
+ RECT_START: 22,
1558
+ RECT_END: 23,
1559
+ SOLID_POINT: 24,
1560
+ DOTTED_POINT: 25
1561
+ };
1562
+ var ARROWTYPE = {
1563
+ FILLED: 0,
1564
+ OPEN: 1
1565
+ };
1566
+ var PLACEMENT = {
1567
+ LEFTOF: 0,
1568
+ RIGHTOF: 1,
1569
+ OVER: 2
1570
+ };
1571
+ var setTitle = /* @__PURE__ */ __name(function(txt) {
1572
+ let sanitizedText = sanitizeText(txt, getConfig2());
1573
+ title = sanitizedText;
1574
+ }, "setTitle");
1575
+ var c4Db_default = {
1576
+ addPersonOrSystem,
1577
+ addPersonOrSystemBoundary,
1578
+ addContainer,
1579
+ addContainerBoundary,
1580
+ addComponent,
1581
+ addDeploymentNode,
1582
+ popBoundaryParseStack,
1583
+ addRel,
1584
+ updateElStyle,
1585
+ updateRelStyle,
1586
+ updateLayoutConfig,
1587
+ autoWrap,
1588
+ setWrap,
1589
+ getC4ShapeArray,
1590
+ getC4Shape,
1591
+ getC4ShapeKeys,
1592
+ getBoundaries,
1593
+ getBoundarys,
1594
+ getCurrentBoundaryParse,
1595
+ getParentBoundaryParse,
1596
+ getRels,
1597
+ getTitle,
1598
+ getC4Type,
1599
+ getC4ShapeInRow,
1600
+ getC4BoundaryInRow,
1601
+ setAccTitle,
1602
+ getAccTitle,
1603
+ getAccDescription,
1604
+ setAccDescription,
1605
+ getConfig: /* @__PURE__ */ __name(() => getConfig2().c4, "getConfig"),
1606
+ clear,
1607
+ LINETYPE,
1608
+ ARROWTYPE,
1609
+ PLACEMENT,
1610
+ setTitle,
1611
+ setC4Type
1612
+ // apply,
1613
+ };
1614
+ var drawRect2 = /* @__PURE__ */ __name(function(elem, rectData) {
1615
+ return drawRect(elem, rectData);
1616
+ }, "drawRect");
1617
+ var drawImage = /* @__PURE__ */ __name(function(elem, width, height, x, y, link) {
1618
+ const imageElem = elem.append("image");
1619
+ imageElem.attr("width", width);
1620
+ imageElem.attr("height", height);
1621
+ imageElem.attr("x", x);
1622
+ imageElem.attr("y", y);
1623
+ let sanitizedLink = link.startsWith("data:image/png;base64") ? link : distExports.sanitizeUrl(link);
1624
+ imageElem.attr("xlink:href", sanitizedLink);
1625
+ }, "drawImage");
1626
+ var drawRels = /* @__PURE__ */ __name((elem, rels2, conf2) => {
1627
+ const relsElem = elem.append("g");
1628
+ let i = 0;
1629
+ for (let rel of rels2) {
1630
+ let textColor = rel.textColor ? rel.textColor : "#444444";
1631
+ let strokeColor = rel.lineColor ? rel.lineColor : "#444444";
1632
+ let offsetX = rel.offsetX ? parseInt(rel.offsetX) : 0;
1633
+ let offsetY = rel.offsetY ? parseInt(rel.offsetY) : 0;
1634
+ let url = "";
1635
+ if (i === 0) {
1636
+ let line = relsElem.append("line");
1637
+ line.attr("x1", rel.startPoint.x);
1638
+ line.attr("y1", rel.startPoint.y);
1639
+ line.attr("x2", rel.endPoint.x);
1640
+ line.attr("y2", rel.endPoint.y);
1641
+ line.attr("stroke-width", "1");
1642
+ line.attr("stroke", strokeColor);
1643
+ line.style("fill", "none");
1644
+ if (rel.type !== "rel_b") {
1645
+ line.attr("marker-end", "url(" + url + "#arrowhead)");
1646
+ }
1647
+ if (rel.type === "birel" || rel.type === "rel_b") {
1648
+ line.attr("marker-start", "url(" + url + "#arrowend)");
1649
+ }
1650
+ i = -1;
1651
+ } else {
1652
+ let line = relsElem.append("path");
1653
+ line.attr("fill", "none").attr("stroke-width", "1").attr("stroke", strokeColor).attr(
1654
+ "d",
1655
+ "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", rel.startPoint.x).replaceAll("starty", rel.startPoint.y).replaceAll(
1656
+ "controlx",
1657
+ rel.startPoint.x + (rel.endPoint.x - rel.startPoint.x) / 2 - (rel.endPoint.x - rel.startPoint.x) / 4
1658
+ ).replaceAll("controly", rel.startPoint.y + (rel.endPoint.y - rel.startPoint.y) / 2).replaceAll("stopx", rel.endPoint.x).replaceAll("stopy", rel.endPoint.y)
1659
+ );
1660
+ if (rel.type !== "rel_b") {
1661
+ line.attr("marker-end", "url(" + url + "#arrowhead)");
1662
+ }
1663
+ if (rel.type === "birel" || rel.type === "rel_b") {
1664
+ line.attr("marker-start", "url(" + url + "#arrowend)");
1665
+ }
1666
+ }
1667
+ let messageConf = conf2.messageFont();
1668
+ _drawTextCandidateFunc(conf2)(
1669
+ rel.label.text,
1670
+ relsElem,
1671
+ Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX,
1672
+ Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + offsetY,
1673
+ rel.label.width,
1674
+ rel.label.height,
1675
+ { fill: textColor },
1676
+ messageConf
1677
+ );
1678
+ if (rel.techn && rel.techn.text !== "") {
1679
+ messageConf = conf2.messageFont();
1680
+ _drawTextCandidateFunc(conf2)(
1681
+ "[" + rel.techn.text + "]",
1682
+ relsElem,
1683
+ Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX,
1684
+ Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + conf2.messageFontSize + 5 + offsetY,
1685
+ Math.max(rel.label.width, rel.techn.width),
1686
+ rel.techn.height,
1687
+ { fill: textColor, "font-style": "italic" },
1688
+ messageConf
1689
+ );
1690
+ }
1691
+ }
1692
+ }, "drawRels");
1693
+ var drawBoundary = /* @__PURE__ */ __name(function(elem, boundary, conf2) {
1694
+ const boundaryElem = elem.append("g");
1695
+ let fillColor = boundary.bgColor ? boundary.bgColor : "none";
1696
+ let strokeColor = boundary.borderColor ? boundary.borderColor : "#444444";
1697
+ let fontColor = boundary.fontColor ? boundary.fontColor : "black";
1698
+ let attrsValue = { "stroke-width": 1, "stroke-dasharray": "7.0,7.0" };
1699
+ if (boundary.nodeType) {
1700
+ attrsValue = { "stroke-width": 1 };
1701
+ }
1702
+ let rectData = {
1703
+ x: boundary.x,
1704
+ y: boundary.y,
1705
+ fill: fillColor,
1706
+ stroke: strokeColor,
1707
+ width: boundary.width,
1708
+ height: boundary.height,
1709
+ rx: 2.5,
1710
+ ry: 2.5,
1711
+ attrs: attrsValue
1712
+ };
1713
+ drawRect2(boundaryElem, rectData);
1714
+ let boundaryConf = conf2.boundaryFont();
1715
+ boundaryConf.fontWeight = "bold";
1716
+ boundaryConf.fontSize = boundaryConf.fontSize + 2;
1717
+ boundaryConf.fontColor = fontColor;
1718
+ _drawTextCandidateFunc(conf2)(
1719
+ boundary.label.text,
1720
+ boundaryElem,
1721
+ boundary.x,
1722
+ boundary.y + boundary.label.Y,
1723
+ boundary.width,
1724
+ boundary.height,
1725
+ { fill: "#444444" },
1726
+ boundaryConf
1727
+ );
1728
+ if (boundary.type && boundary.type.text !== "") {
1729
+ boundaryConf = conf2.boundaryFont();
1730
+ boundaryConf.fontColor = fontColor;
1731
+ _drawTextCandidateFunc(conf2)(
1732
+ boundary.type.text,
1733
+ boundaryElem,
1734
+ boundary.x,
1735
+ boundary.y + boundary.type.Y,
1736
+ boundary.width,
1737
+ boundary.height,
1738
+ { fill: "#444444" },
1739
+ boundaryConf
1740
+ );
1741
+ }
1742
+ if (boundary.descr && boundary.descr.text !== "") {
1743
+ boundaryConf = conf2.boundaryFont();
1744
+ boundaryConf.fontSize = boundaryConf.fontSize - 2;
1745
+ boundaryConf.fontColor = fontColor;
1746
+ _drawTextCandidateFunc(conf2)(
1747
+ boundary.descr.text,
1748
+ boundaryElem,
1749
+ boundary.x,
1750
+ boundary.y + boundary.descr.Y,
1751
+ boundary.width,
1752
+ boundary.height,
1753
+ { fill: "#444444" },
1754
+ boundaryConf
1755
+ );
1756
+ }
1757
+ }, "drawBoundary");
1758
+ var drawC4Shape = /* @__PURE__ */ __name(function(elem, c4Shape, conf2) {
1759
+ var _a2;
1760
+ let fillColor = c4Shape.bgColor ? c4Shape.bgColor : conf2[c4Shape.typeC4Shape.text + "_bg_color"];
1761
+ let strokeColor = c4Shape.borderColor ? c4Shape.borderColor : conf2[c4Shape.typeC4Shape.text + "_border_color"];
1762
+ let fontColor = c4Shape.fontColor ? c4Shape.fontColor : "#FFFFFF";
1763
+ let personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
1764
+ switch (c4Shape.typeC4Shape.text) {
1765
+ case "person":
1766
+ personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
1767
+ break;
1768
+ case "external_person":
1769
+ personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";
1770
+ break;
1771
+ }
1772
+ const c4ShapeElem = elem.append("g");
1773
+ c4ShapeElem.attr("class", "person-man");
1774
+ const rect = getNoteRect();
1775
+ switch (c4Shape.typeC4Shape.text) {
1776
+ case "person":
1777
+ case "external_person":
1778
+ case "system":
1779
+ case "external_system":
1780
+ case "container":
1781
+ case "external_container":
1782
+ case "component":
1783
+ case "external_component":
1784
+ rect.x = c4Shape.x;
1785
+ rect.y = c4Shape.y;
1786
+ rect.fill = fillColor;
1787
+ rect.width = c4Shape.width;
1788
+ rect.height = c4Shape.height;
1789
+ rect.stroke = strokeColor;
1790
+ rect.rx = 2.5;
1791
+ rect.ry = 2.5;
1792
+ rect.attrs = { "stroke-width": 0.5 };
1793
+ drawRect2(c4ShapeElem, rect);
1794
+ break;
1795
+ case "system_db":
1796
+ case "external_system_db":
1797
+ case "container_db":
1798
+ case "external_container_db":
1799
+ case "component_db":
1800
+ case "external_component_db":
1801
+ c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1802
+ "d",
1803
+ "Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2).replaceAll("height", c4Shape.height)
1804
+ );
1805
+ c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1806
+ "d",
1807
+ "Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2)
1808
+ );
1809
+ break;
1810
+ case "system_queue":
1811
+ case "external_system_queue":
1812
+ case "container_queue":
1813
+ case "external_container_queue":
1814
+ case "component_queue":
1815
+ case "external_component_queue":
1816
+ c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1817
+ "d",
1818
+ "Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("width", c4Shape.width).replaceAll("half", c4Shape.height / 2)
1819
+ );
1820
+ c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1821
+ "d",
1822
+ "Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx", c4Shape.x + c4Shape.width).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.height / 2)
1823
+ );
1824
+ break;
1825
+ }
1826
+ let c4ShapeFontConf = getC4ShapeFont(conf2, c4Shape.typeC4Shape.text);
1827
+ c4ShapeElem.append("text").attr("fill", fontColor).attr("font-family", c4ShapeFontConf.fontFamily).attr("font-size", c4ShapeFontConf.fontSize - 2).attr("font-style", "italic").attr("lengthAdjust", "spacing").attr("textLength", c4Shape.typeC4Shape.width).attr("x", c4Shape.x + c4Shape.width / 2 - c4Shape.typeC4Shape.width / 2).attr("y", c4Shape.y + c4Shape.typeC4Shape.Y).text("<<" + c4Shape.typeC4Shape.text + ">>");
1828
+ switch (c4Shape.typeC4Shape.text) {
1829
+ case "person":
1830
+ case "external_person":
1831
+ drawImage(
1832
+ c4ShapeElem,
1833
+ 48,
1834
+ 48,
1835
+ c4Shape.x + c4Shape.width / 2 - 24,
1836
+ c4Shape.y + c4Shape.image.Y,
1837
+ personImg
1838
+ );
1839
+ break;
1840
+ }
1841
+ let textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"]();
1842
+ textFontConf.fontWeight = "bold";
1843
+ textFontConf.fontSize = textFontConf.fontSize + 2;
1844
+ textFontConf.fontColor = fontColor;
1845
+ _drawTextCandidateFunc(conf2)(
1846
+ c4Shape.label.text,
1847
+ c4ShapeElem,
1848
+ c4Shape.x,
1849
+ c4Shape.y + c4Shape.label.Y,
1850
+ c4Shape.width,
1851
+ c4Shape.height,
1852
+ { fill: fontColor },
1853
+ textFontConf
1854
+ );
1855
+ textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"]();
1856
+ textFontConf.fontColor = fontColor;
1857
+ if (c4Shape.techn && ((_a2 = c4Shape.techn) == null ? void 0 : _a2.text) !== "") {
1858
+ _drawTextCandidateFunc(conf2)(
1859
+ c4Shape.techn.text,
1860
+ c4ShapeElem,
1861
+ c4Shape.x,
1862
+ c4Shape.y + c4Shape.techn.Y,
1863
+ c4Shape.width,
1864
+ c4Shape.height,
1865
+ { fill: fontColor, "font-style": "italic" },
1866
+ textFontConf
1867
+ );
1868
+ } else if (c4Shape.type && c4Shape.type.text !== "") {
1869
+ _drawTextCandidateFunc(conf2)(
1870
+ c4Shape.type.text,
1871
+ c4ShapeElem,
1872
+ c4Shape.x,
1873
+ c4Shape.y + c4Shape.type.Y,
1874
+ c4Shape.width,
1875
+ c4Shape.height,
1876
+ { fill: fontColor, "font-style": "italic" },
1877
+ textFontConf
1878
+ );
1879
+ }
1880
+ if (c4Shape.descr && c4Shape.descr.text !== "") {
1881
+ textFontConf = conf2.personFont();
1882
+ textFontConf.fontColor = fontColor;
1883
+ _drawTextCandidateFunc(conf2)(
1884
+ c4Shape.descr.text,
1885
+ c4ShapeElem,
1886
+ c4Shape.x,
1887
+ c4Shape.y + c4Shape.descr.Y,
1888
+ c4Shape.width,
1889
+ c4Shape.height,
1890
+ { fill: fontColor },
1891
+ textFontConf
1892
+ );
1893
+ }
1894
+ return c4Shape.height;
1895
+ }, "drawC4Shape");
1896
+ var insertDatabaseIcon = /* @__PURE__ */ __name(function(elem) {
1897
+ elem.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1898
+ "d",
1899
+ "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z"
1900
+ );
1901
+ }, "insertDatabaseIcon");
1902
+ var insertComputerIcon = /* @__PURE__ */ __name(function(elem) {
1903
+ elem.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1904
+ "d",
1905
+ "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z"
1906
+ );
1907
+ }, "insertComputerIcon");
1908
+ var insertClockIcon = /* @__PURE__ */ __name(function(elem) {
1909
+ elem.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1910
+ "d",
1911
+ "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z"
1912
+ );
1913
+ }, "insertClockIcon");
1914
+ var insertArrowHead = /* @__PURE__ */ __name(function(elem) {
1915
+ elem.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 9).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");
1916
+ }, "insertArrowHead");
1917
+ var insertArrowEnd = /* @__PURE__ */ __name(function(elem) {
1918
+ elem.append("defs").append("marker").attr("id", "arrowend").attr("refX", 1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z");
1919
+ }, "insertArrowEnd");
1920
+ var insertArrowFilledHead = /* @__PURE__ */ __name(function(elem) {
1921
+ elem.append("defs").append("marker").attr("id", "filled-head").attr("refX", 18).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");
1922
+ }, "insertArrowFilledHead");
1923
+ var insertDynamicNumber = /* @__PURE__ */ __name(function(elem) {
1924
+ elem.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
1925
+ }, "insertDynamicNumber");
1926
+ var insertArrowCrossHead = /* @__PURE__ */ __name(function(elem) {
1927
+ const defs = elem.append("defs");
1928
+ const marker = defs.append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4);
1929
+ marker.append("path").attr("fill", "black").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 9,2 V 6 L16,4 Z");
1930
+ marker.append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 0,1 L 6,7 M 6,1 L 0,7");
1931
+ }, "insertArrowCrossHead");
1932
+ var getC4ShapeFont = /* @__PURE__ */ __name((cnf, typeC4Shape) => {
1933
+ return {
1934
+ fontFamily: cnf[typeC4Shape + "FontFamily"],
1935
+ fontSize: cnf[typeC4Shape + "FontSize"],
1936
+ fontWeight: cnf[typeC4Shape + "FontWeight"]
1937
+ };
1938
+ }, "getC4ShapeFont");
1939
+ var _drawTextCandidateFunc = /* @__PURE__ */ function() {
1940
+ function byText(content, g, x, y, width, height, textAttrs) {
1941
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("text-anchor", "middle").text(content);
1942
+ _setTextAttrs(text, textAttrs);
1943
+ }
1944
+ __name(byText, "byText");
1945
+ function byTspan(content, g, x, y, width, height, textAttrs, conf2) {
1946
+ const { fontSize, fontFamily, fontWeight } = conf2;
1947
+ const lines = content.split(common_default.lineBreakRegex);
1948
+ for (let i = 0; i < lines.length; i++) {
1949
+ const dy = i * fontSize - fontSize * (lines.length - 1) / 2;
1950
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", fontSize).style("font-weight", fontWeight).style("font-family", fontFamily);
1951
+ text.append("tspan").attr("dy", dy).text(lines[i]).attr("alignment-baseline", "mathematical");
1952
+ _setTextAttrs(text, textAttrs);
1953
+ }
1954
+ }
1955
+ __name(byTspan, "byTspan");
1956
+ function byFo(content, g, x, y, width, height, textAttrs, conf2) {
1957
+ const s = g.append("switch");
1958
+ const f = s.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height);
1959
+ const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1960
+ text.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
1961
+ byTspan(content, s, x, y, width, height, textAttrs, conf2);
1962
+ _setTextAttrs(text, textAttrs);
1963
+ }
1964
+ __name(byFo, "byFo");
1965
+ function _setTextAttrs(toText, fromTextAttrsDict) {
1966
+ for (const key in fromTextAttrsDict) {
1967
+ if (fromTextAttrsDict.hasOwnProperty(key)) {
1968
+ toText.attr(key, fromTextAttrsDict[key]);
1969
+ }
1970
+ }
1971
+ }
1972
+ __name(_setTextAttrs, "_setTextAttrs");
1973
+ return function(conf2) {
1974
+ return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan;
1975
+ };
1976
+ }();
1977
+ var svgDraw_default = {
1978
+ drawRect: drawRect2,
1979
+ drawBoundary,
1980
+ drawC4Shape,
1981
+ drawRels,
1982
+ drawImage,
1983
+ insertArrowHead,
1984
+ insertArrowEnd,
1985
+ insertArrowFilledHead,
1986
+ insertDynamicNumber,
1987
+ insertArrowCrossHead,
1988
+ insertDatabaseIcon,
1989
+ insertComputerIcon,
1990
+ insertClockIcon
1991
+ };
1992
+ var globalBoundaryMaxX = 0;
1993
+ var globalBoundaryMaxY = 0;
1994
+ var c4ShapeInRow2 = 4;
1995
+ var c4BoundaryInRow2 = 2;
1996
+ parser.yy = c4Db_default;
1997
+ var conf = {};
1998
+ var Bounds = (_a = class {
1999
+ constructor(diagObj) {
2000
+ this.name = "";
2001
+ this.data = {};
2002
+ this.data.startx = void 0;
2003
+ this.data.stopx = void 0;
2004
+ this.data.starty = void 0;
2005
+ this.data.stopy = void 0;
2006
+ this.data.widthLimit = void 0;
2007
+ this.nextData = {};
2008
+ this.nextData.startx = void 0;
2009
+ this.nextData.stopx = void 0;
2010
+ this.nextData.starty = void 0;
2011
+ this.nextData.stopy = void 0;
2012
+ this.nextData.cnt = 0;
2013
+ setConf(diagObj.db.getConfig());
2014
+ }
2015
+ setData(startx, stopx, starty, stopy) {
2016
+ this.nextData.startx = this.data.startx = startx;
2017
+ this.nextData.stopx = this.data.stopx = stopx;
2018
+ this.nextData.starty = this.data.starty = starty;
2019
+ this.nextData.stopy = this.data.stopy = stopy;
2020
+ }
2021
+ updateVal(obj, key, val, fun) {
2022
+ if (obj[key] === void 0) {
2023
+ obj[key] = val;
2024
+ } else {
2025
+ obj[key] = fun(val, obj[key]);
2026
+ }
2027
+ }
2028
+ insert(c4Shape) {
2029
+ this.nextData.cnt = this.nextData.cnt + 1;
2030
+ let _startx = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + c4Shape.margin : this.nextData.stopx + c4Shape.margin * 2;
2031
+ let _stopx = _startx + c4Shape.width;
2032
+ let _starty = this.nextData.starty + c4Shape.margin * 2;
2033
+ let _stopy = _starty + c4Shape.height;
2034
+ if (_startx >= this.data.widthLimit || _stopx >= this.data.widthLimit || this.nextData.cnt > c4ShapeInRow2) {
2035
+ _startx = this.nextData.startx + c4Shape.margin + conf.nextLinePaddingX;
2036
+ _starty = this.nextData.stopy + c4Shape.margin * 2;
2037
+ this.nextData.stopx = _stopx = _startx + c4Shape.width;
2038
+ this.nextData.starty = this.nextData.stopy;
2039
+ this.nextData.stopy = _stopy = _starty + c4Shape.height;
2040
+ this.nextData.cnt = 1;
2041
+ }
2042
+ c4Shape.x = _startx;
2043
+ c4Shape.y = _starty;
2044
+ this.updateVal(this.data, "startx", _startx, Math.min);
2045
+ this.updateVal(this.data, "starty", _starty, Math.min);
2046
+ this.updateVal(this.data, "stopx", _stopx, Math.max);
2047
+ this.updateVal(this.data, "stopy", _stopy, Math.max);
2048
+ this.updateVal(this.nextData, "startx", _startx, Math.min);
2049
+ this.updateVal(this.nextData, "starty", _starty, Math.min);
2050
+ this.updateVal(this.nextData, "stopx", _stopx, Math.max);
2051
+ this.updateVal(this.nextData, "stopy", _stopy, Math.max);
2052
+ }
2053
+ init(diagObj) {
2054
+ this.name = "";
2055
+ this.data = {
2056
+ startx: void 0,
2057
+ stopx: void 0,
2058
+ starty: void 0,
2059
+ stopy: void 0,
2060
+ widthLimit: void 0
2061
+ };
2062
+ this.nextData = {
2063
+ startx: void 0,
2064
+ stopx: void 0,
2065
+ starty: void 0,
2066
+ stopy: void 0,
2067
+ cnt: 0
2068
+ };
2069
+ setConf(diagObj.db.getConfig());
2070
+ }
2071
+ bumpLastMargin(margin) {
2072
+ this.data.stopx += margin;
2073
+ this.data.stopy += margin;
2074
+ }
2075
+ }, __name(_a, "Bounds"), _a);
2076
+ var setConf = /* @__PURE__ */ __name(function(cnf) {
2077
+ assignWithDepth_default(conf, cnf);
2078
+ if (cnf.fontFamily) {
2079
+ conf.personFontFamily = conf.systemFontFamily = conf.messageFontFamily = cnf.fontFamily;
2080
+ }
2081
+ if (cnf.fontSize) {
2082
+ conf.personFontSize = conf.systemFontSize = conf.messageFontSize = cnf.fontSize;
2083
+ }
2084
+ if (cnf.fontWeight) {
2085
+ conf.personFontWeight = conf.systemFontWeight = conf.messageFontWeight = cnf.fontWeight;
2086
+ }
2087
+ }, "setConf");
2088
+ var c4ShapeFont = /* @__PURE__ */ __name((cnf, typeC4Shape) => {
2089
+ return {
2090
+ fontFamily: cnf[typeC4Shape + "FontFamily"],
2091
+ fontSize: cnf[typeC4Shape + "FontSize"],
2092
+ fontWeight: cnf[typeC4Shape + "FontWeight"]
2093
+ };
2094
+ }, "c4ShapeFont");
2095
+ var boundaryFont = /* @__PURE__ */ __name((cnf) => {
2096
+ return {
2097
+ fontFamily: cnf.boundaryFontFamily,
2098
+ fontSize: cnf.boundaryFontSize,
2099
+ fontWeight: cnf.boundaryFontWeight
2100
+ };
2101
+ }, "boundaryFont");
2102
+ var messageFont = /* @__PURE__ */ __name((cnf) => {
2103
+ return {
2104
+ fontFamily: cnf.messageFontFamily,
2105
+ fontSize: cnf.messageFontSize,
2106
+ fontWeight: cnf.messageFontWeight
2107
+ };
2108
+ }, "messageFont");
2109
+ function calcC4ShapeTextWH(textType, c4Shape, c4ShapeTextWrap, textConf, textLimitWidth) {
2110
+ if (!c4Shape[textType].width) {
2111
+ if (c4ShapeTextWrap) {
2112
+ c4Shape[textType].text = wrapLabel(c4Shape[textType].text, textLimitWidth, textConf);
2113
+ c4Shape[textType].textLines = c4Shape[textType].text.split(common_default.lineBreakRegex).length;
2114
+ c4Shape[textType].width = textLimitWidth;
2115
+ c4Shape[textType].height = calculateTextHeight(c4Shape[textType].text, textConf);
2116
+ } else {
2117
+ let lines = c4Shape[textType].text.split(common_default.lineBreakRegex);
2118
+ c4Shape[textType].textLines = lines.length;
2119
+ let lineHeight = 0;
2120
+ c4Shape[textType].height = 0;
2121
+ c4Shape[textType].width = 0;
2122
+ for (const line of lines) {
2123
+ c4Shape[textType].width = Math.max(
2124
+ calculateTextWidth(line, textConf),
2125
+ c4Shape[textType].width
2126
+ );
2127
+ lineHeight = calculateTextHeight(line, textConf);
2128
+ c4Shape[textType].height = c4Shape[textType].height + lineHeight;
2129
+ }
2130
+ }
2131
+ }
2132
+ }
2133
+ __name(calcC4ShapeTextWH, "calcC4ShapeTextWH");
2134
+ var drawBoundary2 = /* @__PURE__ */ __name(function(diagram2, boundary, bounds) {
2135
+ boundary.x = bounds.data.startx;
2136
+ boundary.y = bounds.data.starty;
2137
+ boundary.width = bounds.data.stopx - bounds.data.startx;
2138
+ boundary.height = bounds.data.stopy - bounds.data.starty;
2139
+ boundary.label.y = conf.c4ShapeMargin - 35;
2140
+ let boundaryTextWrap = boundary.wrap && conf.wrap;
2141
+ let boundaryLabelConf = boundaryFont(conf);
2142
+ boundaryLabelConf.fontSize = boundaryLabelConf.fontSize + 2;
2143
+ boundaryLabelConf.fontWeight = "bold";
2144
+ let textLimitWidth = calculateTextWidth(boundary.label.text, boundaryLabelConf);
2145
+ calcC4ShapeTextWH("label", boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth);
2146
+ svgDraw_default.drawBoundary(diagram2, boundary, conf);
2147
+ }, "drawBoundary");
2148
+ var drawC4ShapeArray = /* @__PURE__ */ __name(function(currentBounds, diagram2, c4ShapeArray2, c4ShapeKeys) {
2149
+ let Y = 0;
2150
+ for (const c4ShapeKey of c4ShapeKeys) {
2151
+ Y = 0;
2152
+ const c4Shape = c4ShapeArray2[c4ShapeKey];
2153
+ let c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2154
+ c4ShapeTypeConf.fontSize = c4ShapeTypeConf.fontSize - 2;
2155
+ c4Shape.typeC4Shape.width = calculateTextWidth(
2156
+ "«" + c4Shape.typeC4Shape.text + "»",
2157
+ c4ShapeTypeConf
2158
+ );
2159
+ c4Shape.typeC4Shape.height = c4ShapeTypeConf.fontSize + 2;
2160
+ c4Shape.typeC4Shape.Y = conf.c4ShapePadding;
2161
+ Y = c4Shape.typeC4Shape.Y + c4Shape.typeC4Shape.height - 4;
2162
+ c4Shape.image = { width: 0, height: 0, Y: 0 };
2163
+ switch (c4Shape.typeC4Shape.text) {
2164
+ case "person":
2165
+ case "external_person":
2166
+ c4Shape.image.width = 48;
2167
+ c4Shape.image.height = 48;
2168
+ c4Shape.image.Y = Y;
2169
+ Y = c4Shape.image.Y + c4Shape.image.height;
2170
+ break;
2171
+ }
2172
+ if (c4Shape.sprite) {
2173
+ c4Shape.image.width = 48;
2174
+ c4Shape.image.height = 48;
2175
+ c4Shape.image.Y = Y;
2176
+ Y = c4Shape.image.Y + c4Shape.image.height;
2177
+ }
2178
+ let c4ShapeTextWrap = c4Shape.wrap && conf.wrap;
2179
+ let textLimitWidth = conf.width - conf.c4ShapePadding * 2;
2180
+ let c4ShapeLabelConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2181
+ c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2;
2182
+ c4ShapeLabelConf.fontWeight = "bold";
2183
+ calcC4ShapeTextWH("label", c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth);
2184
+ c4Shape.label.Y = Y + 8;
2185
+ Y = c4Shape.label.Y + c4Shape.label.height;
2186
+ if (c4Shape.type && c4Shape.type.text !== "") {
2187
+ c4Shape.type.text = "[" + c4Shape.type.text + "]";
2188
+ let c4ShapeTypeConf2 = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2189
+ calcC4ShapeTextWH("type", c4Shape, c4ShapeTextWrap, c4ShapeTypeConf2, textLimitWidth);
2190
+ c4Shape.type.Y = Y + 5;
2191
+ Y = c4Shape.type.Y + c4Shape.type.height;
2192
+ } else if (c4Shape.techn && c4Shape.techn.text !== "") {
2193
+ c4Shape.techn.text = "[" + c4Shape.techn.text + "]";
2194
+ let c4ShapeTechnConf = c4ShapeFont(conf, c4Shape.techn.text);
2195
+ calcC4ShapeTextWH("techn", c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth);
2196
+ c4Shape.techn.Y = Y + 5;
2197
+ Y = c4Shape.techn.Y + c4Shape.techn.height;
2198
+ }
2199
+ let rectHeight = Y;
2200
+ let rectWidth = c4Shape.label.width;
2201
+ if (c4Shape.descr && c4Shape.descr.text !== "") {
2202
+ let c4ShapeDescrConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2203
+ calcC4ShapeTextWH("descr", c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth);
2204
+ c4Shape.descr.Y = Y + 20;
2205
+ Y = c4Shape.descr.Y + c4Shape.descr.height;
2206
+ rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width);
2207
+ rectHeight = Y - c4Shape.descr.textLines * 5;
2208
+ }
2209
+ rectWidth = rectWidth + conf.c4ShapePadding;
2210
+ c4Shape.width = Math.max(c4Shape.width || conf.width, rectWidth, conf.width);
2211
+ c4Shape.height = Math.max(c4Shape.height || conf.height, rectHeight, conf.height);
2212
+ c4Shape.margin = c4Shape.margin || conf.c4ShapeMargin;
2213
+ currentBounds.insert(c4Shape);
2214
+ svgDraw_default.drawC4Shape(diagram2, c4Shape, conf);
2215
+ }
2216
+ currentBounds.bumpLastMargin(conf.c4ShapeMargin);
2217
+ }, "drawC4ShapeArray");
2218
+ var Point = (_b = class {
2219
+ constructor(x, y) {
2220
+ this.x = x;
2221
+ this.y = y;
2222
+ }
2223
+ }, __name(_b, "Point"), _b);
2224
+ var getIntersectPoint = /* @__PURE__ */ __name(function(fromNode, endPoint) {
2225
+ let x1 = fromNode.x;
2226
+ let y1 = fromNode.y;
2227
+ let x2 = endPoint.x;
2228
+ let y2 = endPoint.y;
2229
+ let fromCenterX = x1 + fromNode.width / 2;
2230
+ let fromCenterY = y1 + fromNode.height / 2;
2231
+ let dx = Math.abs(x1 - x2);
2232
+ let dy = Math.abs(y1 - y2);
2233
+ let tanDYX = dy / dx;
2234
+ let fromDYX = fromNode.height / fromNode.width;
2235
+ let returnPoint = null;
2236
+ if (y1 == y2 && x1 < x2) {
2237
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY);
2238
+ } else if (y1 == y2 && x1 > x2) {
2239
+ returnPoint = new Point(x1, fromCenterY);
2240
+ } else if (x1 == x2 && y1 < y2) {
2241
+ returnPoint = new Point(fromCenterX, y1 + fromNode.height);
2242
+ } else if (x1 == x2 && y1 > y2) {
2243
+ returnPoint = new Point(fromCenterX, y1);
2244
+ }
2245
+ if (x1 > x2 && y1 < y2) {
2246
+ if (fromDYX >= tanDYX) {
2247
+ returnPoint = new Point(x1, fromCenterY + tanDYX * fromNode.width / 2);
2248
+ } else {
2249
+ returnPoint = new Point(
2250
+ fromCenterX - dx / dy * fromNode.height / 2,
2251
+ y1 + fromNode.height
2252
+ );
2253
+ }
2254
+ } else if (x1 < x2 && y1 < y2) {
2255
+ if (fromDYX >= tanDYX) {
2256
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY + tanDYX * fromNode.width / 2);
2257
+ } else {
2258
+ returnPoint = new Point(
2259
+ fromCenterX + dx / dy * fromNode.height / 2,
2260
+ y1 + fromNode.height
2261
+ );
2262
+ }
2263
+ } else if (x1 < x2 && y1 > y2) {
2264
+ if (fromDYX >= tanDYX) {
2265
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY - tanDYX * fromNode.width / 2);
2266
+ } else {
2267
+ returnPoint = new Point(fromCenterX + fromNode.height / 2 * dx / dy, y1);
2268
+ }
2269
+ } else if (x1 > x2 && y1 > y2) {
2270
+ if (fromDYX >= tanDYX) {
2271
+ returnPoint = new Point(x1, fromCenterY - fromNode.width / 2 * tanDYX);
2272
+ } else {
2273
+ returnPoint = new Point(fromCenterX - fromNode.height / 2 * dx / dy, y1);
2274
+ }
2275
+ }
2276
+ return returnPoint;
2277
+ }, "getIntersectPoint");
2278
+ var getIntersectPoints = /* @__PURE__ */ __name(function(fromNode, endNode) {
2279
+ let endIntersectPoint = { x: 0, y: 0 };
2280
+ endIntersectPoint.x = endNode.x + endNode.width / 2;
2281
+ endIntersectPoint.y = endNode.y + endNode.height / 2;
2282
+ let startPoint = getIntersectPoint(fromNode, endIntersectPoint);
2283
+ endIntersectPoint.x = fromNode.x + fromNode.width / 2;
2284
+ endIntersectPoint.y = fromNode.y + fromNode.height / 2;
2285
+ let endPoint = getIntersectPoint(endNode, endIntersectPoint);
2286
+ return { startPoint, endPoint };
2287
+ }, "getIntersectPoints");
2288
+ var drawRels2 = /* @__PURE__ */ __name(function(diagram2, rels2, getC4ShapeObj, diagObj) {
2289
+ let i = 0;
2290
+ for (let rel of rels2) {
2291
+ i = i + 1;
2292
+ let relTextWrap = rel.wrap && conf.wrap;
2293
+ let relConf = messageFont(conf);
2294
+ let diagramType = diagObj.db.getC4Type();
2295
+ if (diagramType === "C4Dynamic") {
2296
+ rel.label.text = i + ": " + rel.label.text;
2297
+ }
2298
+ let textLimitWidth = calculateTextWidth(rel.label.text, relConf);
2299
+ calcC4ShapeTextWH("label", rel, relTextWrap, relConf, textLimitWidth);
2300
+ if (rel.techn && rel.techn.text !== "") {
2301
+ textLimitWidth = calculateTextWidth(rel.techn.text, relConf);
2302
+ calcC4ShapeTextWH("techn", rel, relTextWrap, relConf, textLimitWidth);
2303
+ }
2304
+ if (rel.descr && rel.descr.text !== "") {
2305
+ textLimitWidth = calculateTextWidth(rel.descr.text, relConf);
2306
+ calcC4ShapeTextWH("descr", rel, relTextWrap, relConf, textLimitWidth);
2307
+ }
2308
+ let fromNode = getC4ShapeObj(rel.from);
2309
+ let endNode = getC4ShapeObj(rel.to);
2310
+ let points = getIntersectPoints(fromNode, endNode);
2311
+ rel.startPoint = points.startPoint;
2312
+ rel.endPoint = points.endPoint;
2313
+ }
2314
+ svgDraw_default.drawRels(diagram2, rels2, conf);
2315
+ }, "drawRels");
2316
+ function drawInsideBoundary(diagram2, parentBoundaryAlias, parentBounds, currentBoundaries, diagObj) {
2317
+ let currentBounds = new Bounds(diagObj);
2318
+ currentBounds.data.widthLimit = parentBounds.data.widthLimit / Math.min(c4BoundaryInRow2, currentBoundaries.length);
2319
+ for (let [i, currentBoundary] of currentBoundaries.entries()) {
2320
+ let Y = 0;
2321
+ currentBoundary.image = { width: 0, height: 0, Y: 0 };
2322
+ if (currentBoundary.sprite) {
2323
+ currentBoundary.image.width = 48;
2324
+ currentBoundary.image.height = 48;
2325
+ currentBoundary.image.Y = Y;
2326
+ Y = currentBoundary.image.Y + currentBoundary.image.height;
2327
+ }
2328
+ let currentBoundaryTextWrap = currentBoundary.wrap && conf.wrap;
2329
+ let currentBoundaryLabelConf = boundaryFont(conf);
2330
+ currentBoundaryLabelConf.fontSize = currentBoundaryLabelConf.fontSize + 2;
2331
+ currentBoundaryLabelConf.fontWeight = "bold";
2332
+ calcC4ShapeTextWH(
2333
+ "label",
2334
+ currentBoundary,
2335
+ currentBoundaryTextWrap,
2336
+ currentBoundaryLabelConf,
2337
+ currentBounds.data.widthLimit
2338
+ );
2339
+ currentBoundary.label.Y = Y + 8;
2340
+ Y = currentBoundary.label.Y + currentBoundary.label.height;
2341
+ if (currentBoundary.type && currentBoundary.type.text !== "") {
2342
+ currentBoundary.type.text = "[" + currentBoundary.type.text + "]";
2343
+ let currentBoundaryTypeConf = boundaryFont(conf);
2344
+ calcC4ShapeTextWH(
2345
+ "type",
2346
+ currentBoundary,
2347
+ currentBoundaryTextWrap,
2348
+ currentBoundaryTypeConf,
2349
+ currentBounds.data.widthLimit
2350
+ );
2351
+ currentBoundary.type.Y = Y + 5;
2352
+ Y = currentBoundary.type.Y + currentBoundary.type.height;
2353
+ }
2354
+ if (currentBoundary.descr && currentBoundary.descr.text !== "") {
2355
+ let currentBoundaryDescrConf = boundaryFont(conf);
2356
+ currentBoundaryDescrConf.fontSize = currentBoundaryDescrConf.fontSize - 2;
2357
+ calcC4ShapeTextWH(
2358
+ "descr",
2359
+ currentBoundary,
2360
+ currentBoundaryTextWrap,
2361
+ currentBoundaryDescrConf,
2362
+ currentBounds.data.widthLimit
2363
+ );
2364
+ currentBoundary.descr.Y = Y + 20;
2365
+ Y = currentBoundary.descr.Y + currentBoundary.descr.height;
2366
+ }
2367
+ if (i == 0 || i % c4BoundaryInRow2 === 0) {
2368
+ let _x = parentBounds.data.startx + conf.diagramMarginX;
2369
+ let _y = parentBounds.data.stopy + conf.diagramMarginY + Y;
2370
+ currentBounds.setData(_x, _x, _y, _y);
2371
+ } else {
2372
+ let _x = currentBounds.data.stopx !== currentBounds.data.startx ? currentBounds.data.stopx + conf.diagramMarginX : currentBounds.data.startx;
2373
+ let _y = currentBounds.data.starty;
2374
+ currentBounds.setData(_x, _x, _y, _y);
2375
+ }
2376
+ currentBounds.name = currentBoundary.alias;
2377
+ let currentPersonOrSystemArray = diagObj.db.getC4ShapeArray(currentBoundary.alias);
2378
+ let currentPersonOrSystemKeys = diagObj.db.getC4ShapeKeys(currentBoundary.alias);
2379
+ if (currentPersonOrSystemKeys.length > 0) {
2380
+ drawC4ShapeArray(
2381
+ currentBounds,
2382
+ diagram2,
2383
+ currentPersonOrSystemArray,
2384
+ currentPersonOrSystemKeys
2385
+ );
2386
+ }
2387
+ parentBoundaryAlias = currentBoundary.alias;
2388
+ let nextCurrentBoundaries = diagObj.db.getBoundaries(parentBoundaryAlias);
2389
+ if (nextCurrentBoundaries.length > 0) {
2390
+ drawInsideBoundary(
2391
+ diagram2,
2392
+ parentBoundaryAlias,
2393
+ currentBounds,
2394
+ nextCurrentBoundaries,
2395
+ diagObj
2396
+ );
2397
+ }
2398
+ if (currentBoundary.alias !== "global") {
2399
+ drawBoundary2(diagram2, currentBoundary, currentBounds);
2400
+ }
2401
+ parentBounds.data.stopy = Math.max(
2402
+ currentBounds.data.stopy + conf.c4ShapeMargin,
2403
+ parentBounds.data.stopy
2404
+ );
2405
+ parentBounds.data.stopx = Math.max(
2406
+ currentBounds.data.stopx + conf.c4ShapeMargin,
2407
+ parentBounds.data.stopx
2408
+ );
2409
+ globalBoundaryMaxX = Math.max(globalBoundaryMaxX, parentBounds.data.stopx);
2410
+ globalBoundaryMaxY = Math.max(globalBoundaryMaxY, parentBounds.data.stopy);
2411
+ }
2412
+ }
2413
+ __name(drawInsideBoundary, "drawInsideBoundary");
2414
+ var draw = /* @__PURE__ */ __name(function(_text, id, _version, diagObj) {
2415
+ conf = getConfig2().c4;
2416
+ const securityLevel = getConfig2().securityLevel;
2417
+ let sandboxElement;
2418
+ if (securityLevel === "sandbox") {
2419
+ sandboxElement = select("#i" + id);
2420
+ }
2421
+ const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
2422
+ let db = diagObj.db;
2423
+ diagObj.db.setWrap(conf.wrap);
2424
+ c4ShapeInRow2 = db.getC4ShapeInRow();
2425
+ c4BoundaryInRow2 = db.getC4BoundaryInRow();
2426
+ log.debug(`C:${JSON.stringify(conf, null, 2)}`);
2427
+ const diagram2 = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : select(`[id="${id}"]`);
2428
+ svgDraw_default.insertComputerIcon(diagram2);
2429
+ svgDraw_default.insertDatabaseIcon(diagram2);
2430
+ svgDraw_default.insertClockIcon(diagram2);
2431
+ let screenBounds = new Bounds(diagObj);
2432
+ screenBounds.setData(
2433
+ conf.diagramMarginX,
2434
+ conf.diagramMarginX,
2435
+ conf.diagramMarginY,
2436
+ conf.diagramMarginY
2437
+ );
2438
+ screenBounds.data.widthLimit = screen.availWidth;
2439
+ globalBoundaryMaxX = conf.diagramMarginX;
2440
+ globalBoundaryMaxY = conf.diagramMarginY;
2441
+ const title2 = diagObj.db.getTitle();
2442
+ let currentBoundaries = diagObj.db.getBoundaries("");
2443
+ drawInsideBoundary(diagram2, "", screenBounds, currentBoundaries, diagObj);
2444
+ svgDraw_default.insertArrowHead(diagram2);
2445
+ svgDraw_default.insertArrowEnd(diagram2);
2446
+ svgDraw_default.insertArrowCrossHead(diagram2);
2447
+ svgDraw_default.insertArrowFilledHead(diagram2);
2448
+ drawRels2(diagram2, diagObj.db.getRels(), diagObj.db.getC4Shape, diagObj);
2449
+ screenBounds.data.stopx = globalBoundaryMaxX;
2450
+ screenBounds.data.stopy = globalBoundaryMaxY;
2451
+ const box = screenBounds.data;
2452
+ let boxHeight = box.stopy - box.starty;
2453
+ let height = boxHeight + 2 * conf.diagramMarginY;
2454
+ let boxWidth = box.stopx - box.startx;
2455
+ const width = boxWidth + 2 * conf.diagramMarginX;
2456
+ if (title2) {
2457
+ diagram2.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr("y", box.starty + conf.diagramMarginY);
2458
+ }
2459
+ configureSvgSize(diagram2, height, width, conf.useMaxWidth);
2460
+ const extraVertForTitle = title2 ? 60 : 0;
2461
+ diagram2.attr(
2462
+ "viewBox",
2463
+ box.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + extraVertForTitle) + " " + width + " " + (height + extraVertForTitle)
2464
+ );
2465
+ log.debug(`models:`, box);
2466
+ }, "draw");
2467
+ var c4Renderer_default = {
2468
+ drawPersonOrSystemArray: drawC4ShapeArray,
2469
+ drawBoundary: drawBoundary2,
2470
+ setConf,
2471
+ draw
2472
+ };
2473
+ var getStyles = /* @__PURE__ */ __name((options) => `.person {
2474
+ stroke: ${options.personBorder};
2475
+ fill: ${options.personBkg};
2476
+ }
2477
+ `, "getStyles");
2478
+ var styles_default = getStyles;
2479
+ var diagram = {
2480
+ parser: c4Diagram_default,
2481
+ db: c4Db_default,
2482
+ renderer: c4Renderer_default,
2483
+ styles: styles_default,
2484
+ init: /* @__PURE__ */ __name(({ c4, wrap }) => {
2485
+ c4Renderer_default.setConf(c4);
2486
+ c4Db_default.setWrap(wrap);
2487
+ }, "init")
2488
+ };
2489
+
2490
+ export { diagram };