@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,859 @@
1
+ import { s as setupViewPortForSVG } from './chunk-SKB7J2MH-BlwHRDiW.mjs';
2
+ import { _ as __name, b as setAccTitle, a as getAccTitle, q as setDiagramTitle, t as getDiagramTitle, g as getAccDescription, s as setAccDescription, G as getConfig, F as cleanAndMerge, aP as isLabelStyle, z as clear$2, l as log, H as defaultConfig_default, K as selectSvgElement, e as configureSvgSize, aO as styles2String, d as select } from './mermaid.core-CAqkCmS1.mjs';
3
+ import { p as populateCommonDb } from './chunk-353BL4L5-Dn_Y_Yna.mjs';
4
+ import { p as parse } from './mermaid-parser.core-CH9ryA1K.mjs';
5
+ import { b as format } from './defaultLocale-DVr69WTU.mjs';
6
+ import { o as ordinal } from './ordinal-DSZU4PqD.mjs';
7
+ import './index3.mjs';
8
+ import 'vue';
9
+ import '@vunk/plus/components/bubble-templates';
10
+ import '@vunk/core/components/spread-to';
11
+ import 'element-plus';
12
+ import '@vunk/shared/function';
13
+ import './_plugin-vue_export-helper.mjs';
14
+ import '@vunk/plus/components/agent-chat-provider';
15
+ import './_baseUniq-BXtq6_NW.mjs';
16
+ import './min-BngCxx8g.mjs';
17
+ import './clone-CEJtuQzg.mjs';
18
+ import './init-ZxktEp_H.mjs';
19
+
20
+ var _a;
21
+ function count(node) {
22
+ var sum = 0, children = node.children, i = children && children.length;
23
+ if (!i) sum = 1;
24
+ else while (--i >= 0) sum += children[i].value;
25
+ node.value = sum;
26
+ }
27
+ function node_count() {
28
+ return this.eachAfter(count);
29
+ }
30
+ function node_each(callback, that) {
31
+ let index = -1;
32
+ for (const node of this) {
33
+ callback.call(that, node, ++index, this);
34
+ }
35
+ return this;
36
+ }
37
+ function node_eachBefore(callback, that) {
38
+ var node = this, nodes = [node], children, i, index = -1;
39
+ while (node = nodes.pop()) {
40
+ callback.call(that, node, ++index, this);
41
+ if (children = node.children) {
42
+ for (i = children.length - 1; i >= 0; --i) {
43
+ nodes.push(children[i]);
44
+ }
45
+ }
46
+ }
47
+ return this;
48
+ }
49
+ function node_eachAfter(callback, that) {
50
+ var node = this, nodes = [node], next = [], children, i, n, index = -1;
51
+ while (node = nodes.pop()) {
52
+ next.push(node);
53
+ if (children = node.children) {
54
+ for (i = 0, n = children.length; i < n; ++i) {
55
+ nodes.push(children[i]);
56
+ }
57
+ }
58
+ }
59
+ while (node = next.pop()) {
60
+ callback.call(that, node, ++index, this);
61
+ }
62
+ return this;
63
+ }
64
+ function node_find(callback, that) {
65
+ let index = -1;
66
+ for (const node of this) {
67
+ if (callback.call(that, node, ++index, this)) {
68
+ return node;
69
+ }
70
+ }
71
+ }
72
+ function node_sum(value) {
73
+ return this.eachAfter(function(node) {
74
+ var sum = +value(node.data) || 0, children = node.children, i = children && children.length;
75
+ while (--i >= 0) sum += children[i].value;
76
+ node.value = sum;
77
+ });
78
+ }
79
+ function node_sort(compare) {
80
+ return this.eachBefore(function(node) {
81
+ if (node.children) {
82
+ node.children.sort(compare);
83
+ }
84
+ });
85
+ }
86
+ function node_path(end) {
87
+ var start = this, ancestor = leastCommonAncestor(start, end), nodes = [start];
88
+ while (start !== ancestor) {
89
+ start = start.parent;
90
+ nodes.push(start);
91
+ }
92
+ var k = nodes.length;
93
+ while (end !== ancestor) {
94
+ nodes.splice(k, 0, end);
95
+ end = end.parent;
96
+ }
97
+ return nodes;
98
+ }
99
+ function leastCommonAncestor(a, b) {
100
+ if (a === b) return a;
101
+ var aNodes = a.ancestors(), bNodes = b.ancestors(), c = null;
102
+ a = aNodes.pop();
103
+ b = bNodes.pop();
104
+ while (a === b) {
105
+ c = a;
106
+ a = aNodes.pop();
107
+ b = bNodes.pop();
108
+ }
109
+ return c;
110
+ }
111
+ function node_ancestors() {
112
+ var node = this, nodes = [node];
113
+ while (node = node.parent) {
114
+ nodes.push(node);
115
+ }
116
+ return nodes;
117
+ }
118
+ function node_descendants() {
119
+ return Array.from(this);
120
+ }
121
+ function node_leaves() {
122
+ var leaves = [];
123
+ this.eachBefore(function(node) {
124
+ if (!node.children) {
125
+ leaves.push(node);
126
+ }
127
+ });
128
+ return leaves;
129
+ }
130
+ function node_links() {
131
+ var root = this, links = [];
132
+ root.each(function(node) {
133
+ if (node !== root) {
134
+ links.push({ source: node.parent, target: node });
135
+ }
136
+ });
137
+ return links;
138
+ }
139
+ function* node_iterator() {
140
+ var node = this, current, next = [node], children, i, n;
141
+ do {
142
+ current = next.reverse(), next = [];
143
+ while (node = current.pop()) {
144
+ yield node;
145
+ if (children = node.children) {
146
+ for (i = 0, n = children.length; i < n; ++i) {
147
+ next.push(children[i]);
148
+ }
149
+ }
150
+ }
151
+ } while (next.length);
152
+ }
153
+ function hierarchy(data, children) {
154
+ if (data instanceof Map) {
155
+ data = [void 0, data];
156
+ if (children === void 0) children = mapChildren;
157
+ } else if (children === void 0) {
158
+ children = objectChildren;
159
+ }
160
+ var root = new Node(data), node, nodes = [root], child, childs, i, n;
161
+ while (node = nodes.pop()) {
162
+ if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {
163
+ node.children = childs;
164
+ for (i = n - 1; i >= 0; --i) {
165
+ nodes.push(child = childs[i] = new Node(childs[i]));
166
+ child.parent = node;
167
+ child.depth = node.depth + 1;
168
+ }
169
+ }
170
+ }
171
+ return root.eachBefore(computeHeight);
172
+ }
173
+ function node_copy() {
174
+ return hierarchy(this).eachBefore(copyData);
175
+ }
176
+ function objectChildren(d) {
177
+ return d.children;
178
+ }
179
+ function mapChildren(d) {
180
+ return Array.isArray(d) ? d[1] : null;
181
+ }
182
+ function copyData(node) {
183
+ if (node.data.value !== void 0) node.value = node.data.value;
184
+ node.data = node.data.data;
185
+ }
186
+ function computeHeight(node) {
187
+ var height = 0;
188
+ do
189
+ node.height = height;
190
+ while ((node = node.parent) && node.height < ++height);
191
+ }
192
+ function Node(data) {
193
+ this.data = data;
194
+ this.depth = this.height = 0;
195
+ this.parent = null;
196
+ }
197
+ Node.prototype = hierarchy.prototype = {
198
+ constructor: Node,
199
+ count: node_count,
200
+ each: node_each,
201
+ eachAfter: node_eachAfter,
202
+ eachBefore: node_eachBefore,
203
+ find: node_find,
204
+ sum: node_sum,
205
+ sort: node_sort,
206
+ path: node_path,
207
+ ancestors: node_ancestors,
208
+ descendants: node_descendants,
209
+ leaves: node_leaves,
210
+ links: node_links,
211
+ copy: node_copy,
212
+ [Symbol.iterator]: node_iterator
213
+ };
214
+ function required(f) {
215
+ if (typeof f !== "function") throw new Error();
216
+ return f;
217
+ }
218
+ function constantZero() {
219
+ return 0;
220
+ }
221
+ function constant(x) {
222
+ return function() {
223
+ return x;
224
+ };
225
+ }
226
+ function roundNode(node) {
227
+ node.x0 = Math.round(node.x0);
228
+ node.y0 = Math.round(node.y0);
229
+ node.x1 = Math.round(node.x1);
230
+ node.y1 = Math.round(node.y1);
231
+ }
232
+ function treemapDice(parent, x0, y0, x1, y1) {
233
+ var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (x1 - x0) / parent.value;
234
+ while (++i < n) {
235
+ node = nodes[i], node.y0 = y0, node.y1 = y1;
236
+ node.x0 = x0, node.x1 = x0 += node.value * k;
237
+ }
238
+ }
239
+ function treemapSlice(parent, x0, y0, x1, y1) {
240
+ var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (y1 - y0) / parent.value;
241
+ while (++i < n) {
242
+ node = nodes[i], node.x0 = x0, node.x1 = x1;
243
+ node.y0 = y0, node.y1 = y0 += node.value * k;
244
+ }
245
+ }
246
+ var phi = (1 + Math.sqrt(5)) / 2;
247
+ function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
248
+ var rows = [], nodes = parent.children, row, nodeValue, i0 = 0, i1 = 0, n = nodes.length, dx, dy, value = parent.value, sumValue, minValue, maxValue, newRatio, minRatio, alpha, beta;
249
+ while (i0 < n) {
250
+ dx = x1 - x0, dy = y1 - y0;
251
+ do
252
+ sumValue = nodes[i1++].value;
253
+ while (!sumValue && i1 < n);
254
+ minValue = maxValue = sumValue;
255
+ alpha = Math.max(dy / dx, dx / dy) / (value * ratio);
256
+ beta = sumValue * sumValue * alpha;
257
+ minRatio = Math.max(maxValue / beta, beta / minValue);
258
+ for (; i1 < n; ++i1) {
259
+ sumValue += nodeValue = nodes[i1].value;
260
+ if (nodeValue < minValue) minValue = nodeValue;
261
+ if (nodeValue > maxValue) maxValue = nodeValue;
262
+ beta = sumValue * sumValue * alpha;
263
+ newRatio = Math.max(maxValue / beta, beta / minValue);
264
+ if (newRatio > minRatio) {
265
+ sumValue -= nodeValue;
266
+ break;
267
+ }
268
+ minRatio = newRatio;
269
+ }
270
+ rows.push(row = { value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1) });
271
+ if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
272
+ else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
273
+ value -= sumValue, i0 = i1;
274
+ }
275
+ return rows;
276
+ }
277
+ const squarify = function custom(ratio) {
278
+ function squarify2(parent, x0, y0, x1, y1) {
279
+ squarifyRatio(ratio, parent, x0, y0, x1, y1);
280
+ }
281
+ squarify2.ratio = function(x) {
282
+ return custom((x = +x) > 1 ? x : 1);
283
+ };
284
+ return squarify2;
285
+ }(phi);
286
+ function treemap() {
287
+ var tile = squarify, round = false, dx = 1, dy = 1, paddingStack = [0], paddingInner = constantZero, paddingTop = constantZero, paddingRight = constantZero, paddingBottom = constantZero, paddingLeft = constantZero;
288
+ function treemap2(root) {
289
+ root.x0 = root.y0 = 0;
290
+ root.x1 = dx;
291
+ root.y1 = dy;
292
+ root.eachBefore(positionNode);
293
+ paddingStack = [0];
294
+ if (round) root.eachBefore(roundNode);
295
+ return root;
296
+ }
297
+ function positionNode(node) {
298
+ var p = paddingStack[node.depth], x0 = node.x0 + p, y0 = node.y0 + p, x1 = node.x1 - p, y1 = node.y1 - p;
299
+ if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
300
+ if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
301
+ node.x0 = x0;
302
+ node.y0 = y0;
303
+ node.x1 = x1;
304
+ node.y1 = y1;
305
+ if (node.children) {
306
+ p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
307
+ x0 += paddingLeft(node) - p;
308
+ y0 += paddingTop(node) - p;
309
+ x1 -= paddingRight(node) - p;
310
+ y1 -= paddingBottom(node) - p;
311
+ if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
312
+ if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
313
+ tile(node, x0, y0, x1, y1);
314
+ }
315
+ }
316
+ treemap2.round = function(x) {
317
+ return arguments.length ? (round = !!x, treemap2) : round;
318
+ };
319
+ treemap2.size = function(x) {
320
+ return arguments.length ? (dx = +x[0], dy = +x[1], treemap2) : [dx, dy];
321
+ };
322
+ treemap2.tile = function(x) {
323
+ return arguments.length ? (tile = required(x), treemap2) : tile;
324
+ };
325
+ treemap2.padding = function(x) {
326
+ return arguments.length ? treemap2.paddingInner(x).paddingOuter(x) : treemap2.paddingInner();
327
+ };
328
+ treemap2.paddingInner = function(x) {
329
+ return arguments.length ? (paddingInner = typeof x === "function" ? x : constant(+x), treemap2) : paddingInner;
330
+ };
331
+ treemap2.paddingOuter = function(x) {
332
+ return arguments.length ? treemap2.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap2.paddingTop();
333
+ };
334
+ treemap2.paddingTop = function(x) {
335
+ return arguments.length ? (paddingTop = typeof x === "function" ? x : constant(+x), treemap2) : paddingTop;
336
+ };
337
+ treemap2.paddingRight = function(x) {
338
+ return arguments.length ? (paddingRight = typeof x === "function" ? x : constant(+x), treemap2) : paddingRight;
339
+ };
340
+ treemap2.paddingBottom = function(x) {
341
+ return arguments.length ? (paddingBottom = typeof x === "function" ? x : constant(+x), treemap2) : paddingBottom;
342
+ };
343
+ treemap2.paddingLeft = function(x) {
344
+ return arguments.length ? (paddingLeft = typeof x === "function" ? x : constant(+x), treemap2) : paddingLeft;
345
+ };
346
+ return treemap2;
347
+ }
348
+ var TreeMapDB = (_a = class {
349
+ constructor() {
350
+ this.nodes = [];
351
+ this.levels = /* @__PURE__ */ new Map();
352
+ this.outerNodes = [];
353
+ this.classes = /* @__PURE__ */ new Map();
354
+ this.setAccTitle = setAccTitle;
355
+ this.getAccTitle = getAccTitle;
356
+ this.setDiagramTitle = setDiagramTitle;
357
+ this.getDiagramTitle = getDiagramTitle;
358
+ this.getAccDescription = getAccDescription;
359
+ this.setAccDescription = setAccDescription;
360
+ }
361
+ getNodes() {
362
+ return this.nodes;
363
+ }
364
+ getConfig() {
365
+ const defaultConfig = defaultConfig_default;
366
+ const userConfig = getConfig();
367
+ return cleanAndMerge({
368
+ ...defaultConfig.treemap,
369
+ ...userConfig.treemap ?? {}
370
+ });
371
+ }
372
+ addNode(node, level) {
373
+ this.nodes.push(node);
374
+ this.levels.set(node, level);
375
+ if (level === 0) {
376
+ this.outerNodes.push(node);
377
+ this.root ?? (this.root = node);
378
+ }
379
+ }
380
+ getRoot() {
381
+ return { name: "", children: this.outerNodes };
382
+ }
383
+ addClass(id, _style) {
384
+ const styleClass = this.classes.get(id) ?? { id, styles: [], textStyles: [] };
385
+ const styles = _style.replace(/\\,/g, "§§§").replace(/,/g, ";").replace(/§§§/g, ",").split(";");
386
+ if (styles) {
387
+ styles.forEach((s) => {
388
+ if (isLabelStyle(s)) {
389
+ if (styleClass == null ? void 0 : styleClass.textStyles) {
390
+ styleClass.textStyles.push(s);
391
+ } else {
392
+ styleClass.textStyles = [s];
393
+ }
394
+ }
395
+ if (styleClass == null ? void 0 : styleClass.styles) {
396
+ styleClass.styles.push(s);
397
+ } else {
398
+ styleClass.styles = [s];
399
+ }
400
+ });
401
+ }
402
+ this.classes.set(id, styleClass);
403
+ }
404
+ getClasses() {
405
+ return this.classes;
406
+ }
407
+ getStylesForClass(classSelector) {
408
+ var _a2;
409
+ return ((_a2 = this.classes.get(classSelector)) == null ? void 0 : _a2.styles) ?? [];
410
+ }
411
+ clear() {
412
+ clear$2();
413
+ this.nodes = [];
414
+ this.levels = /* @__PURE__ */ new Map();
415
+ this.outerNodes = [];
416
+ this.classes = /* @__PURE__ */ new Map();
417
+ this.root = void 0;
418
+ }
419
+ }, __name(_a, "TreeMapDB"), _a);
420
+ function buildHierarchy(items) {
421
+ if (!items.length) {
422
+ return [];
423
+ }
424
+ const root = [];
425
+ const stack = [];
426
+ items.forEach((item) => {
427
+ const node = {
428
+ name: item.name,
429
+ children: item.type === "Leaf" ? void 0 : []
430
+ };
431
+ node.classSelector = item == null ? void 0 : item.classSelector;
432
+ if (item == null ? void 0 : item.cssCompiledStyles) {
433
+ node.cssCompiledStyles = [item.cssCompiledStyles];
434
+ }
435
+ if (item.type === "Leaf" && item.value !== void 0) {
436
+ node.value = item.value;
437
+ }
438
+ while (stack.length > 0 && stack[stack.length - 1].level >= item.level) {
439
+ stack.pop();
440
+ }
441
+ if (stack.length === 0) {
442
+ root.push(node);
443
+ } else {
444
+ const parent = stack[stack.length - 1].node;
445
+ if (parent.children) {
446
+ parent.children.push(node);
447
+ } else {
448
+ parent.children = [node];
449
+ }
450
+ }
451
+ if (item.type !== "Leaf") {
452
+ stack.push({ node, level: item.level });
453
+ }
454
+ });
455
+ return root;
456
+ }
457
+ __name(buildHierarchy, "buildHierarchy");
458
+ var populate = /* @__PURE__ */ __name((ast, db) => {
459
+ populateCommonDb(ast, db);
460
+ const items = [];
461
+ for (const row of ast.TreemapRows ?? []) {
462
+ if (row.$type === "ClassDefStatement") {
463
+ db.addClass(row.className ?? "", row.styleText ?? "");
464
+ }
465
+ }
466
+ for (const row of ast.TreemapRows ?? []) {
467
+ const item = row.item;
468
+ if (!item) {
469
+ continue;
470
+ }
471
+ const level = row.indent ? parseInt(row.indent) : 0;
472
+ const name = getItemName(item);
473
+ const styles = item.classSelector ? db.getStylesForClass(item.classSelector) : [];
474
+ const cssCompiledStyles = styles.length > 0 ? styles.join(";") : void 0;
475
+ const itemData = {
476
+ level,
477
+ name,
478
+ type: item.$type,
479
+ value: item.value,
480
+ classSelector: item.classSelector,
481
+ cssCompiledStyles
482
+ };
483
+ items.push(itemData);
484
+ }
485
+ const hierarchyNodes = buildHierarchy(items);
486
+ const addNodesRecursively = /* @__PURE__ */ __name((nodes, level) => {
487
+ for (const node of nodes) {
488
+ db.addNode(node, level);
489
+ if (node.children && node.children.length > 0) {
490
+ addNodesRecursively(node.children, level + 1);
491
+ }
492
+ }
493
+ }, "addNodesRecursively");
494
+ addNodesRecursively(hierarchyNodes, 0);
495
+ }, "populate");
496
+ var getItemName = /* @__PURE__ */ __name((item) => {
497
+ return item.name ? String(item.name) : "";
498
+ }, "getItemName");
499
+ var parser = {
500
+ // @ts-expect-error - TreeMapDB is not assignable to DiagramDB
501
+ parser: { yy: void 0 },
502
+ parse: /* @__PURE__ */ __name(async (text) => {
503
+ var _a2;
504
+ try {
505
+ const parseFunc = parse;
506
+ const ast = await parseFunc("treemap", text);
507
+ log.debug("Treemap AST:", ast);
508
+ const db = (_a2 = parser.parser) == null ? void 0 : _a2.yy;
509
+ if (!(db instanceof TreeMapDB)) {
510
+ throw new Error(
511
+ "parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
512
+ );
513
+ }
514
+ populate(ast, db);
515
+ } catch (error) {
516
+ log.error("Error parsing treemap:", error);
517
+ throw error;
518
+ }
519
+ }, "parse")
520
+ };
521
+ var DEFAULT_INNER_PADDING = 10;
522
+ var SECTION_INNER_PADDING = 10;
523
+ var SECTION_HEADER_HEIGHT = 25;
524
+ var draw = /* @__PURE__ */ __name((_text, id, _version, diagram2) => {
525
+ const treemapDb = diagram2.db;
526
+ const config = treemapDb.getConfig();
527
+ const treemapInnerPadding = config.padding ?? DEFAULT_INNER_PADDING;
528
+ const title = treemapDb.getDiagramTitle();
529
+ const root = treemapDb.getRoot();
530
+ const { themeVariables } = getConfig();
531
+ if (!root) {
532
+ return;
533
+ }
534
+ const titleHeight = title ? 30 : 0;
535
+ const svg = selectSvgElement(id);
536
+ const width = config.nodeWidth ? config.nodeWidth * SECTION_INNER_PADDING : 960;
537
+ const height = config.nodeHeight ? config.nodeHeight * SECTION_INNER_PADDING : 500;
538
+ const svgWidth = width;
539
+ const svgHeight = height + titleHeight;
540
+ svg.attr("viewBox", `0 0 ${svgWidth} ${svgHeight}`);
541
+ configureSvgSize(svg, svgHeight, svgWidth, config.useMaxWidth);
542
+ let valueFormat;
543
+ try {
544
+ const formatStr = config.valueFormat || ",";
545
+ if (formatStr === "$0,0") {
546
+ valueFormat = /* @__PURE__ */ __name((value) => "$" + format(",")(value), "valueFormat");
547
+ } else if (formatStr.startsWith("$") && formatStr.includes(",")) {
548
+ const precision = /\.\d+/.exec(formatStr);
549
+ const precisionStr = precision ? precision[0] : "";
550
+ valueFormat = /* @__PURE__ */ __name((value) => "$" + format("," + precisionStr)(value), "valueFormat");
551
+ } else if (formatStr.startsWith("$")) {
552
+ const restOfFormat = formatStr.substring(1);
553
+ valueFormat = /* @__PURE__ */ __name((value) => "$" + format(restOfFormat || "")(value), "valueFormat");
554
+ } else {
555
+ valueFormat = format(formatStr);
556
+ }
557
+ } catch (error) {
558
+ log.error("Error creating format function:", error);
559
+ valueFormat = format(",");
560
+ }
561
+ const colorScale = ordinal().range([
562
+ "transparent",
563
+ themeVariables.cScale0,
564
+ themeVariables.cScale1,
565
+ themeVariables.cScale2,
566
+ themeVariables.cScale3,
567
+ themeVariables.cScale4,
568
+ themeVariables.cScale5,
569
+ themeVariables.cScale6,
570
+ themeVariables.cScale7,
571
+ themeVariables.cScale8,
572
+ themeVariables.cScale9,
573
+ themeVariables.cScale10,
574
+ themeVariables.cScale11
575
+ ]);
576
+ const colorScalePeer = ordinal().range([
577
+ "transparent",
578
+ themeVariables.cScalePeer0,
579
+ themeVariables.cScalePeer1,
580
+ themeVariables.cScalePeer2,
581
+ themeVariables.cScalePeer3,
582
+ themeVariables.cScalePeer4,
583
+ themeVariables.cScalePeer5,
584
+ themeVariables.cScalePeer6,
585
+ themeVariables.cScalePeer7,
586
+ themeVariables.cScalePeer8,
587
+ themeVariables.cScalePeer9,
588
+ themeVariables.cScalePeer10,
589
+ themeVariables.cScalePeer11
590
+ ]);
591
+ const colorScaleLabel = ordinal().range([
592
+ themeVariables.cScaleLabel0,
593
+ themeVariables.cScaleLabel1,
594
+ themeVariables.cScaleLabel2,
595
+ themeVariables.cScaleLabel3,
596
+ themeVariables.cScaleLabel4,
597
+ themeVariables.cScaleLabel5,
598
+ themeVariables.cScaleLabel6,
599
+ themeVariables.cScaleLabel7,
600
+ themeVariables.cScaleLabel8,
601
+ themeVariables.cScaleLabel9,
602
+ themeVariables.cScaleLabel10,
603
+ themeVariables.cScaleLabel11
604
+ ]);
605
+ if (title) {
606
+ svg.append("text").attr("x", svgWidth / 2).attr("y", titleHeight / 2).attr("class", "treemapTitle").attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(title);
607
+ }
608
+ const g = svg.append("g").attr("transform", `translate(0, ${titleHeight})`).attr("class", "treemapContainer");
609
+ const hierarchyRoot = hierarchy(root).sum((d) => d.value ?? 0).sort((a, b) => (b.value ?? 0) - (a.value ?? 0));
610
+ const treemapLayout = treemap().size([width, height]).paddingTop(
611
+ (d) => d.children && d.children.length > 0 ? SECTION_HEADER_HEIGHT + SECTION_INNER_PADDING : 0
612
+ ).paddingInner(treemapInnerPadding).paddingLeft((d) => d.children && d.children.length > 0 ? SECTION_INNER_PADDING : 0).paddingRight((d) => d.children && d.children.length > 0 ? SECTION_INNER_PADDING : 0).paddingBottom((d) => d.children && d.children.length > 0 ? SECTION_INNER_PADDING : 0).round(true);
613
+ const treemapData = treemapLayout(hierarchyRoot);
614
+ const branchNodes = treemapData.descendants().filter((d) => d.children && d.children.length > 0);
615
+ const sections = g.selectAll(".treemapSection").data(branchNodes).enter().append("g").attr("class", "treemapSection").attr("transform", (d) => `translate(${d.x0},${d.y0})`);
616
+ sections.append("rect").attr("width", (d) => d.x1 - d.x0).attr("height", SECTION_HEADER_HEIGHT).attr("class", "treemapSectionHeader").attr("fill", "none").attr("fill-opacity", 0.6).attr("stroke-width", 0.6).attr("style", (d) => {
617
+ if (d.depth === 0) {
618
+ return "display: none;";
619
+ }
620
+ return "";
621
+ });
622
+ sections.append("clipPath").attr("id", (_d, i) => `clip-section-${id}-${i}`).append("rect").attr("width", (d) => Math.max(0, d.x1 - d.x0 - 12)).attr("height", SECTION_HEADER_HEIGHT);
623
+ sections.append("rect").attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0).attr("class", (_d, i) => {
624
+ return `treemapSection section${i}`;
625
+ }).attr("fill", (d) => colorScale(d.data.name)).attr("fill-opacity", 0.6).attr("stroke", (d) => colorScalePeer(d.data.name)).attr("stroke-width", 2).attr("stroke-opacity", 0.4).attr("style", (d) => {
626
+ if (d.depth === 0) {
627
+ return "display: none;";
628
+ }
629
+ const styles = styles2String({ cssCompiledStyles: d.data.cssCompiledStyles });
630
+ return styles.nodeStyles + ";" + styles.borderStyles.join(";");
631
+ });
632
+ sections.append("text").attr("class", "treemapSectionLabel").attr("x", 6).attr("y", SECTION_HEADER_HEIGHT / 2).attr("dominant-baseline", "middle").text((d) => d.depth === 0 ? "" : d.data.name).attr("font-weight", "bold").attr("style", (d) => {
633
+ if (d.depth === 0) {
634
+ return "display: none;";
635
+ }
636
+ const labelStyles = "dominant-baseline: middle; font-size: 12px; fill:" + colorScaleLabel(d.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;";
637
+ const styles = styles2String({ cssCompiledStyles: d.data.cssCompiledStyles });
638
+ return labelStyles + styles.labelStyles.replace("color:", "fill:");
639
+ }).each(function(d) {
640
+ if (d.depth === 0) {
641
+ return;
642
+ }
643
+ const self = select(this);
644
+ const originalText = d.data.name;
645
+ self.text(originalText);
646
+ const totalHeaderWidth = d.x1 - d.x0;
647
+ const labelXPosition = 6;
648
+ let spaceForTextContent;
649
+ if (config.showValues !== false && d.value) {
650
+ const valueEndsAtXRelative = totalHeaderWidth - 10;
651
+ const estimatedValueTextActualWidth = 30;
652
+ const gapBetweenLabelAndValue = 10;
653
+ const labelMustEndBeforeX = valueEndsAtXRelative - estimatedValueTextActualWidth - gapBetweenLabelAndValue;
654
+ spaceForTextContent = labelMustEndBeforeX - labelXPosition;
655
+ } else {
656
+ const labelOwnRightPadding = 6;
657
+ spaceForTextContent = totalHeaderWidth - labelXPosition - labelOwnRightPadding;
658
+ }
659
+ const minimumWidthToDisplay = 15;
660
+ const actualAvailableWidth = Math.max(minimumWidthToDisplay, spaceForTextContent);
661
+ const textNode = self.node();
662
+ const currentTextContentLength = textNode.getComputedTextLength();
663
+ if (currentTextContentLength > actualAvailableWidth) {
664
+ const ellipsis = "...";
665
+ let currentTruncatedText = originalText;
666
+ while (currentTruncatedText.length > 0) {
667
+ currentTruncatedText = originalText.substring(0, currentTruncatedText.length - 1);
668
+ if (currentTruncatedText.length === 0) {
669
+ self.text(ellipsis);
670
+ if (textNode.getComputedTextLength() > actualAvailableWidth) {
671
+ self.text("");
672
+ }
673
+ break;
674
+ }
675
+ self.text(currentTruncatedText + ellipsis);
676
+ if (textNode.getComputedTextLength() <= actualAvailableWidth) {
677
+ break;
678
+ }
679
+ }
680
+ }
681
+ });
682
+ if (config.showValues !== false) {
683
+ sections.append("text").attr("class", "treemapSectionValue").attr("x", (d) => d.x1 - d.x0 - 10).attr("y", SECTION_HEADER_HEIGHT / 2).attr("text-anchor", "end").attr("dominant-baseline", "middle").text((d) => d.value ? valueFormat(d.value) : "").attr("font-style", "italic").attr("style", (d) => {
684
+ if (d.depth === 0) {
685
+ return "display: none;";
686
+ }
687
+ const labelStyles = "text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:" + colorScaleLabel(d.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;";
688
+ const styles = styles2String({ cssCompiledStyles: d.data.cssCompiledStyles });
689
+ return labelStyles + styles.labelStyles.replace("color:", "fill:");
690
+ });
691
+ }
692
+ const leafNodes = treemapData.leaves();
693
+ const cell = g.selectAll(".treemapLeafGroup").data(leafNodes).enter().append("g").attr("class", (d, i) => {
694
+ return `treemapNode treemapLeafGroup leaf${i}${d.data.classSelector ? ` ${d.data.classSelector}` : ""}x`;
695
+ }).attr("transform", (d) => `translate(${d.x0},${d.y0})`);
696
+ cell.append("rect").attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0).attr("class", "treemapLeaf").attr("fill", (d) => {
697
+ return d.parent ? colorScale(d.parent.data.name) : colorScale(d.data.name);
698
+ }).attr("style", (d) => {
699
+ const styles = styles2String({ cssCompiledStyles: d.data.cssCompiledStyles });
700
+ return styles.nodeStyles;
701
+ }).attr("fill-opacity", 0.3).attr("stroke", (d) => {
702
+ return d.parent ? colorScale(d.parent.data.name) : colorScale(d.data.name);
703
+ }).attr("stroke-width", 3);
704
+ cell.append("clipPath").attr("id", (_d, i) => `clip-${id}-${i}`).append("rect").attr("width", (d) => Math.max(0, d.x1 - d.x0 - 4)).attr("height", (d) => Math.max(0, d.y1 - d.y0 - 4));
705
+ const leafLabels = cell.append("text").attr("class", "treemapLabel").attr("x", (d) => (d.x1 - d.x0) / 2).attr("y", (d) => (d.y1 - d.y0) / 2).attr("style", (d) => {
706
+ const labelStyles = "text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:" + colorScaleLabel(d.data.name) + ";";
707
+ const styles = styles2String({ cssCompiledStyles: d.data.cssCompiledStyles });
708
+ return labelStyles + styles.labelStyles.replace("color:", "fill:");
709
+ }).attr("clip-path", (_d, i) => `url(#clip-${id}-${i})`).text((d) => d.data.name);
710
+ leafLabels.each(function(d) {
711
+ const self = select(this);
712
+ const nodeWidth = d.x1 - d.x0;
713
+ const nodeHeight = d.y1 - d.y0;
714
+ const textNode = self.node();
715
+ const padding = 4;
716
+ const availableWidth = nodeWidth - 2 * padding;
717
+ const availableHeight = nodeHeight - 2 * padding;
718
+ if (availableWidth < 10 || availableHeight < 10) {
719
+ self.style("display", "none");
720
+ return;
721
+ }
722
+ let currentLabelFontSize = parseInt(self.style("font-size"), 10);
723
+ const minLabelFontSize = 8;
724
+ const originalValueRelFontSize = 28;
725
+ const valueScaleFactor = 0.6;
726
+ const minValueFontSize = 6;
727
+ const spacingBetweenLabelAndValue = 2;
728
+ while (textNode.getComputedTextLength() > availableWidth && currentLabelFontSize > minLabelFontSize) {
729
+ currentLabelFontSize--;
730
+ self.style("font-size", `${currentLabelFontSize}px`);
731
+ }
732
+ let prospectiveValueFontSize = Math.max(
733
+ minValueFontSize,
734
+ Math.min(originalValueRelFontSize, Math.round(currentLabelFontSize * valueScaleFactor))
735
+ );
736
+ let combinedHeight = currentLabelFontSize + spacingBetweenLabelAndValue + prospectiveValueFontSize;
737
+ while (combinedHeight > availableHeight && currentLabelFontSize > minLabelFontSize) {
738
+ currentLabelFontSize--;
739
+ prospectiveValueFontSize = Math.max(
740
+ minValueFontSize,
741
+ Math.min(originalValueRelFontSize, Math.round(currentLabelFontSize * valueScaleFactor))
742
+ );
743
+ if (prospectiveValueFontSize < minValueFontSize && currentLabelFontSize === minLabelFontSize) {
744
+ break;
745
+ }
746
+ self.style("font-size", `${currentLabelFontSize}px`);
747
+ combinedHeight = currentLabelFontSize + spacingBetweenLabelAndValue + prospectiveValueFontSize;
748
+ }
749
+ self.style("font-size", `${currentLabelFontSize}px`);
750
+ if (textNode.getComputedTextLength() > availableWidth || currentLabelFontSize < minLabelFontSize || availableHeight < currentLabelFontSize) {
751
+ self.style("display", "none");
752
+ }
753
+ });
754
+ if (config.showValues !== false) {
755
+ const leafValues = cell.append("text").attr("class", "treemapValue").attr("x", (d) => (d.x1 - d.x0) / 2).attr("y", function(d) {
756
+ return (d.y1 - d.y0) / 2;
757
+ }).attr("style", (d) => {
758
+ const labelStyles = "text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:" + colorScaleLabel(d.data.name) + ";";
759
+ const styles = styles2String({ cssCompiledStyles: d.data.cssCompiledStyles });
760
+ return labelStyles + styles.labelStyles.replace("color:", "fill:");
761
+ }).attr("clip-path", (_d, i) => `url(#clip-${id}-${i})`).text((d) => d.value ? valueFormat(d.value) : "");
762
+ leafValues.each(function(d) {
763
+ const valueTextElement = select(this);
764
+ const parentCellNode = this.parentNode;
765
+ if (!parentCellNode) {
766
+ valueTextElement.style("display", "none");
767
+ return;
768
+ }
769
+ const labelElement = select(parentCellNode).select(".treemapLabel");
770
+ if (labelElement.empty() || labelElement.style("display") === "none") {
771
+ valueTextElement.style("display", "none");
772
+ return;
773
+ }
774
+ const finalLabelFontSize = parseFloat(labelElement.style("font-size"));
775
+ const originalValueFontSize = 28;
776
+ const valueScaleFactor = 0.6;
777
+ const minValueFontSize = 6;
778
+ const spacingBetweenLabelAndValue = 2;
779
+ const actualValueFontSize = Math.max(
780
+ minValueFontSize,
781
+ Math.min(originalValueFontSize, Math.round(finalLabelFontSize * valueScaleFactor))
782
+ );
783
+ valueTextElement.style("font-size", `${actualValueFontSize}px`);
784
+ const labelCenterY = (d.y1 - d.y0) / 2;
785
+ const valueTopActualY = labelCenterY + finalLabelFontSize / 2 + spacingBetweenLabelAndValue;
786
+ valueTextElement.attr("y", valueTopActualY);
787
+ const nodeWidth = d.x1 - d.x0;
788
+ const nodeTotalHeight = d.y1 - d.y0;
789
+ const cellBottomPadding = 4;
790
+ const maxValueBottomY = nodeTotalHeight - cellBottomPadding;
791
+ const availableWidthForValue = nodeWidth - 2 * 4;
792
+ if (valueTextElement.node().getComputedTextLength() > availableWidthForValue || valueTopActualY + actualValueFontSize > maxValueBottomY || actualValueFontSize < minValueFontSize) {
793
+ valueTextElement.style("display", "none");
794
+ } else {
795
+ valueTextElement.style("display", null);
796
+ }
797
+ });
798
+ }
799
+ const diagramPadding = config.diagramPadding ?? 8;
800
+ setupViewPortForSVG(svg, diagramPadding, "flowchart", (config == null ? void 0 : config.useMaxWidth) || false);
801
+ }, "draw");
802
+ var getClasses = /* @__PURE__ */ __name(function(_text, diagramObj) {
803
+ return diagramObj.db.getClasses();
804
+ }, "getClasses");
805
+ var renderer = { draw, getClasses };
806
+ var defaultTreemapStyleOptions = {
807
+ sectionStrokeColor: "black",
808
+ sectionStrokeWidth: "1",
809
+ sectionFillColor: "#efefef",
810
+ leafStrokeColor: "black",
811
+ leafStrokeWidth: "1",
812
+ leafFillColor: "#efefef",
813
+ labelColor: "black",
814
+ labelFontSize: "12px",
815
+ valueFontSize: "10px",
816
+ valueColor: "black",
817
+ titleColor: "black",
818
+ titleFontSize: "14px"
819
+ };
820
+ var getStyles = /* @__PURE__ */ __name(({
821
+ treemap: treemap2
822
+ } = {}) => {
823
+ const options = cleanAndMerge(defaultTreemapStyleOptions, treemap2);
824
+ return `
825
+ .treemapNode.section {
826
+ stroke: ${options.sectionStrokeColor};
827
+ stroke-width: ${options.sectionStrokeWidth};
828
+ fill: ${options.sectionFillColor};
829
+ }
830
+ .treemapNode.leaf {
831
+ stroke: ${options.leafStrokeColor};
832
+ stroke-width: ${options.leafStrokeWidth};
833
+ fill: ${options.leafFillColor};
834
+ }
835
+ .treemapLabel {
836
+ fill: ${options.labelColor};
837
+ font-size: ${options.labelFontSize};
838
+ }
839
+ .treemapValue {
840
+ fill: ${options.valueColor};
841
+ font-size: ${options.valueFontSize};
842
+ }
843
+ .treemapTitle {
844
+ fill: ${options.titleColor};
845
+ font-size: ${options.titleFontSize};
846
+ }
847
+ `;
848
+ }, "getStyles");
849
+ var styles_default = getStyles;
850
+ var diagram = {
851
+ parser,
852
+ get db() {
853
+ return new TreeMapDB();
854
+ },
855
+ renderer,
856
+ styles: styles_default
857
+ };
858
+
859
+ export { diagram };