@aiquants/markdown 9.0.1 → 11.0.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 (140) hide show
  1. package/README.md +161 -52
  2. package/dist/{abnfDiagram-VRR7QNED-CqzHEoGP.js → abnfDiagram-VRR7QNED-CxQnFjoJ.js} +3 -3
  3. package/dist/{abnfDiagram-VRR7QNED-CfcidEeF.cjs → abnfDiagram-VRR7QNED-npWEsqYc.cjs} +1 -1
  4. package/dist/{arc-CIHnI5Tn.js → arc-8h1FB6uq.js} +20 -20
  5. package/dist/{arc-BD-XC8JG.cjs → arc-CUfL06Yf.cjs} +1 -1
  6. package/dist/{architectureDiagram-ZJ3FMSHR-CLgC4ySs.cjs → architectureDiagram-ZJ3FMSHR-B20pDRbn.cjs} +1 -1
  7. package/dist/{architectureDiagram-ZJ3FMSHR-CX5DaRgk.js → architectureDiagram-ZJ3FMSHR-B3AN9LVb.js} +2 -2
  8. package/dist/{blockDiagram-677ZJIJ3-B45jR5Ef.cjs → blockDiagram-677ZJIJ3-BpyvdB6a.cjs} +1 -1
  9. package/dist/{blockDiagram-677ZJIJ3-BVvPQ2BZ.js → blockDiagram-677ZJIJ3-Cyl2Lsxi.js} +3 -3
  10. package/dist/{c4Diagram-LMCZKHZV-CmpNmuYQ.js → c4Diagram-LMCZKHZV-B1v06ANz.js} +2 -2
  11. package/dist/{c4Diagram-LMCZKHZV-CUgZ93IA.cjs → c4Diagram-LMCZKHZV-C9aMoZww.cjs} +1 -1
  12. package/dist/{channel-CCNoIO-n.cjs → channel-BFKA8ne6.cjs} +1 -1
  13. package/dist/{channel-CJnvKaiK.js → channel-DHWInoX5.js} +1 -1
  14. package/dist/{chunk-2Q5K7J3B-CGvZIrla.cjs → chunk-2Q5K7J3B-CKQJDnvh.cjs} +1 -1
  15. package/dist/{chunk-2Q5K7J3B-DI5NSXs3.js → chunk-2Q5K7J3B-Hkei_N8G.js} +1 -1
  16. package/dist/{chunk-32BRIVSS-DBxZTCPU.js → chunk-32BRIVSS-BVjoQVFd.js} +1 -1
  17. package/dist/{chunk-32BRIVSS-Buxmelj1.cjs → chunk-32BRIVSS-BegSeeKc.cjs} +1 -1
  18. package/dist/{chunk-5VM5RSS4-DJudqxeH.cjs → chunk-5VM5RSS4-BQ9OvvVm.cjs} +1 -1
  19. package/dist/{chunk-5VM5RSS4-B3vhx_6_.js → chunk-5VM5RSS4-Bwvu3ZQn.js} +1 -1
  20. package/dist/{chunk-EX3LRPZG-BYk-yeom.cjs → chunk-EX3LRPZG-Bj_q1v7R.cjs} +1 -1
  21. package/dist/{chunk-EX3LRPZG-3mU4tF-T.js → chunk-EX3LRPZG-Bz5BV4Fn.js} +4 -4
  22. package/dist/{chunk-JWPE2WC7-05_7DU1b.js → chunk-JWPE2WC7-C01naS5D.js} +1 -1
  23. package/dist/{chunk-JWPE2WC7-CF8PY84Z.cjs → chunk-JWPE2WC7-CZGO5NQs.cjs} +1 -1
  24. package/dist/{chunk-MOJQB5TN-MX6h9dRz.js → chunk-MOJQB5TN-C3Hq75Zv.js} +10 -10
  25. package/dist/{chunk-MOJQB5TN-C1PxO_ZB.cjs → chunk-MOJQB5TN-DFFX8TKc.cjs} +1 -1
  26. package/dist/{chunk-PUDLZKDR-nwjWRhQa.cjs → chunk-PUDLZKDR-2MWL0ZoW.cjs} +1 -1
  27. package/dist/{chunk-PUDLZKDR-CEaKE3Nm.js → chunk-PUDLZKDR-Sz0OB5IT.js} +6 -6
  28. package/dist/{chunk-RYQCIY6F-DCzkxbV-.js → chunk-RYQCIY6F-CBI5EYhC.js} +12 -12
  29. package/dist/{chunk-RYQCIY6F-0Xvnmozd.cjs → chunk-RYQCIY6F-CSDblZx6.cjs} +1 -1
  30. package/dist/{chunk-V7JOEXUC-9kUlPSlw.js → chunk-V7JOEXUC-Br5K_lDL.js} +15 -15
  31. package/dist/{chunk-V7JOEXUC-DJ6NOMBh.cjs → chunk-V7JOEXUC-D3Y19ZhK.cjs} +1 -1
  32. package/dist/{chunk-VR4S4FIN-DTcdZAIy.js → chunk-VR4S4FIN-CQXol07w.js} +3 -3
  33. package/dist/{chunk-VR4S4FIN-DjgjZOol.cjs → chunk-VR4S4FIN-DjxDq6sN.cjs} +1 -1
  34. package/dist/{chunk-XXDRQBXY-BSD7H18E.js → chunk-XXDRQBXY--FT3CTeH.js} +1 -1
  35. package/dist/{chunk-XXDRQBXY-BAN-bNyU.cjs → chunk-XXDRQBXY-DwP8HH5V.cjs} +1 -1
  36. package/dist/{classDiagram-v2-EOCWNBFH-CAVtDASr.js → classDiagram-OUVF2IWQ-HKTI1J11.js} +2 -2
  37. package/dist/{classDiagram-OUVF2IWQ-D9dkL55K.cjs → classDiagram-OUVF2IWQ-WUNGB5FC.cjs} +1 -1
  38. package/dist/{classDiagram-OUVF2IWQ-CAVtDASr.js → classDiagram-v2-EOCWNBFH-HKTI1J11.js} +2 -2
  39. package/dist/{classDiagram-v2-EOCWNBFH-D9dkL55K.cjs → classDiagram-v2-EOCWNBFH-WUNGB5FC.cjs} +1 -1
  40. package/dist/code-blocks-Bax5Xik7.cjs +4 -0
  41. package/dist/code-blocks-bgwDIVp1.js +267 -0
  42. package/dist/code-blocks.cjs +1 -1
  43. package/dist/code-blocks.d.ts +15 -1
  44. package/dist/code-blocks.js +19 -34
  45. package/dist/components/SpreadsheetBlock.d.ts +8 -2
  46. package/dist/components/SpreadsheetToolbar.d.ts +20 -2
  47. package/dist/components/blockKeys.d.ts +14 -0
  48. package/dist/components/controlStyles.d.ts +2 -1
  49. package/dist/components/spreadsheetClipboard.d.ts +1 -1
  50. package/dist/components/spreadsheetLabels.d.ts +13 -0
  51. package/dist/components/spreadsheetModel.d.ts +13 -8
  52. package/dist/components/toolbar.d.ts +25 -0
  53. package/dist/components/viewerLabels.d.ts +5 -2
  54. package/dist/converter.wasm +0 -0
  55. package/dist/{cose-bilkent-JH36ORCC-aJGIpkTB.js → cose-bilkent-JH36ORCC-BYqXiffa.js} +5 -5
  56. package/dist/{cose-bilkent-JH36ORCC-KQT29htQ.cjs → cose-bilkent-JH36ORCC-X2Leg8js.cjs} +1 -1
  57. package/dist/{cynefinDiagram-TSTJHNR4-C_rGUs0a.cjs → cynefinDiagram-TSTJHNR4-DYAvR3E8.cjs} +1 -1
  58. package/dist/{cynefinDiagram-TSTJHNR4-C3F_WdyT.js → cynefinDiagram-TSTJHNR4-YATbGDfo.js} +47 -47
  59. package/dist/{dagre-VKFMJZFB-CrmCHDPv.js → dagre-VKFMJZFB-Co2RmhO1.js} +20 -20
  60. package/dist/{dagre-VKFMJZFB-Bn_WdZ6A.cjs → dagre-VKFMJZFB-yjrP1oXL.cjs} +1 -1
  61. package/dist/{diagram-FQU43EPY-B8Bka9S6.cjs → diagram-FQU43EPY-DVts5oXk.cjs} +1 -1
  62. package/dist/{diagram-FQU43EPY-DuJ6IxJz.js → diagram-FQU43EPY-DfigqQP9.js} +2 -2
  63. package/dist/{diagram-G47NLZAW-D--MA_nT.cjs → diagram-G47NLZAW-Cave3JO_.cjs} +1 -1
  64. package/dist/{diagram-G47NLZAW-3UXM5joI.js → diagram-G47NLZAW-k5OpX3J4.js} +38 -38
  65. package/dist/{diagram-NH7WQ7WH-Cqc8orqE.cjs → diagram-NH7WQ7WH-ByEOvB5o.cjs} +1 -1
  66. package/dist/{diagram-NH7WQ7WH-CtH8Gdkl.js → diagram-NH7WQ7WH-DDA_wiMC.js} +20 -20
  67. package/dist/{diagram-OA4YK3LP-DfKPIPFJ.cjs → diagram-OA4YK3LP-C85REJhK.cjs} +1 -1
  68. package/dist/{diagram-OA4YK3LP-CWRyqD4L.js → diagram-OA4YK3LP-DR63MTHd.js} +58 -58
  69. package/dist/{diagram-WEI45ONY-BYMVLI0Q.cjs → diagram-WEI45ONY-9_82j2nL.cjs} +1 -1
  70. package/dist/{diagram-WEI45ONY-C0OrOx2a.js → diagram-WEI45ONY-DKy9LVdb.js} +10 -10
  71. package/dist/{ebnfDiagram-CCIWWBDH-DZKq52yC.cjs → ebnfDiagram-CCIWWBDH-CYd0AUSE.cjs} +1 -1
  72. package/dist/{ebnfDiagram-CCIWWBDH-CQ7558AK.js → ebnfDiagram-CCIWWBDH-Cn6FnIur.js} +5 -5
  73. package/dist/{erDiagram-Q63AITRT-CsCp6RSB.js → erDiagram-Q63AITRT-BF_5IEpU.js} +9 -9
  74. package/dist/{erDiagram-Q63AITRT-CzkYgQ0q.cjs → erDiagram-Q63AITRT-CMIoja24.cjs} +1 -1
  75. package/dist/{extractHeadings-BUjTmniO.js → extractHeadings-DZi9v6vp.js} +8478 -8138
  76. package/dist/extractHeadings-sSLGzcdt.cjs +315 -0
  77. package/dist/fencedBlockLines.d.ts +36 -0
  78. package/dist/flowDiagram-23GEKE2U-BCDxgNfH.js +7 -0
  79. package/dist/flowDiagram-23GEKE2U-DDbv1eCW.cjs +1 -0
  80. package/dist/{ganttDiagram-NO4QXBWP-BVnjew_C.js → ganttDiagram-NO4QXBWP-DEnf80Mq.js} +2 -2
  81. package/dist/{ganttDiagram-NO4QXBWP-7oIdk62h.cjs → ganttDiagram-NO4QXBWP-Drcm5yEd.cjs} +1 -1
  82. package/dist/{gitGraphDiagram-IHSO6WYX-BufmbyyT.cjs → gitGraphDiagram-IHSO6WYX-GII6PPu9.cjs} +1 -1
  83. package/dist/{gitGraphDiagram-IHSO6WYX-fP0zuss4.js → gitGraphDiagram-IHSO6WYX-eyfAn5cz.js} +10 -10
  84. package/dist/index.cjs +1 -1
  85. package/dist/index.client.cjs +1 -1
  86. package/dist/index.client.d.ts +2 -2
  87. package/dist/index.client.js +37 -35
  88. package/dist/index.js +37 -35
  89. package/dist/{infoDiagram-FWYZ7A6U-DerCFmks.cjs → infoDiagram-FWYZ7A6U-C2FBPXIG.cjs} +1 -1
  90. package/dist/{infoDiagram-FWYZ7A6U-DzsSutoh.js → infoDiagram-FWYZ7A6U-DPC7xHqx.js} +1 -1
  91. package/dist/{ishikawaDiagram-FXEZZL3T-BN-byOYP.cjs → ishikawaDiagram-FXEZZL3T-CJVI_dU0.cjs} +1 -1
  92. package/dist/{ishikawaDiagram-FXEZZL3T-BZ_ric9v.js → ishikawaDiagram-FXEZZL3T-DqNbTlei.js} +25 -25
  93. package/dist/{journeyDiagram-5HDEW3XC-C7iTlBhN.cjs → journeyDiagram-5HDEW3XC-DiVOEWa6.cjs} +1 -1
  94. package/dist/{journeyDiagram-5HDEW3XC-CfZ11aJu.js → journeyDiagram-5HDEW3XC-DuKx5oFy.js} +4 -4
  95. package/dist/{kanban-definition-HUTT4EX6-BNNQtqj9.cjs → kanban-definition-HUTT4EX6-BklyDLxL.cjs} +1 -1
  96. package/dist/{kanban-definition-HUTT4EX6-De7q9Kj3.js → kanban-definition-HUTT4EX6-DezliCFs.js} +52 -52
  97. package/dist/{linear-Bh2aX99D.js → linear-CdYfVjua.js} +5 -5
  98. package/dist/{linear-D8TLf9nV.cjs → linear-w1JR48Qh.cjs} +1 -1
  99. package/dist/{mindmap-definition-LN4V7U3C-3bksVDiB.js → mindmap-definition-LN4V7U3C-7q4b7Jdd.js} +16 -16
  100. package/dist/{mindmap-definition-LN4V7U3C-CmbdSctZ.cjs → mindmap-definition-LN4V7U3C-BlvTH7wL.cjs} +1 -1
  101. package/dist/{pegDiagram-2B236MQR-ffi6qFEn.js → pegDiagram-2B236MQR-BPY_9I4m.js} +3 -3
  102. package/dist/{pegDiagram-2B236MQR-BWozQII1.cjs → pegDiagram-2B236MQR-DirAhjr9.cjs} +1 -1
  103. package/dist/{pieDiagram-ENE6RG2P-DfTgyWpG.cjs → pieDiagram-ENE6RG2P-CLMNCcZD.cjs} +1 -1
  104. package/dist/{pieDiagram-ENE6RG2P-De3q_Av5.js → pieDiagram-ENE6RG2P-L4j2AB7Y.js} +51 -51
  105. package/dist/{quadrantDiagram-ABIIQ3AL-CP7NgI8w.js → quadrantDiagram-ABIIQ3AL-B9uzT4Zl.js} +43 -43
  106. package/dist/{quadrantDiagram-ABIIQ3AL-BZF5Z12H.cjs → quadrantDiagram-ABIIQ3AL-lyExQfuw.cjs} +1 -1
  107. package/dist/{railroadDiagram-RFXS5EU6-BuWP-rUP.js → railroadDiagram-RFXS5EU6-BgW-4T7B.js} +7 -7
  108. package/dist/{railroadDiagram-RFXS5EU6-Cui5Nx7p.cjs → railroadDiagram-RFXS5EU6-u2Ztkufm.cjs} +1 -1
  109. package/dist/{requirementDiagram-TGXJPOKE-DOEubcGx.js → requirementDiagram-TGXJPOKE-BnyCTa79.js} +18 -18
  110. package/dist/{requirementDiagram-TGXJPOKE-C-WJSUrB.cjs → requirementDiagram-TGXJPOKE-Cm9r8e07.cjs} +1 -1
  111. package/dist/{sankeyDiagram-HTMAVEWB-BrD3GLG6.js → sankeyDiagram-HTMAVEWB-Cv3KCrBX.js} +1 -1
  112. package/dist/{sankeyDiagram-HTMAVEWB-CyT8wRcS.cjs → sankeyDiagram-HTMAVEWB-KJ5WdXGw.cjs} +1 -1
  113. package/dist/{sequenceDiagram-DBY2YBRQ-CT6w_sxa.js → sequenceDiagram-DBY2YBRQ-CUa9htwo.js} +3 -3
  114. package/dist/{sequenceDiagram-DBY2YBRQ-DmNBUeEN.cjs → sequenceDiagram-DBY2YBRQ-DYXMeMoq.cjs} +1 -1
  115. package/dist/{sizeCapture-X5ZJPWSS-h_Xsq3-D.cjs → sizeCapture-X5ZJPWSS-C4RUlRk2.cjs} +1 -1
  116. package/dist/{sizeCapture-X5ZJPWSS-Dt-2lcQO.js → sizeCapture-X5ZJPWSS-D0cfhTVe.js} +1 -1
  117. package/dist/{stateDiagram-2N3HPSRC-C9dyCEcu.cjs → stateDiagram-2N3HPSRC-C4DOBTHC.cjs} +1 -1
  118. package/dist/{stateDiagram-2N3HPSRC-CjJrf8oq.js → stateDiagram-2N3HPSRC-CUQCdjYa.js} +10 -10
  119. package/dist/{stateDiagram-v2-6OUMAXLB-BhwjG0NA.cjs → stateDiagram-v2-6OUMAXLB-BK27mYqW.cjs} +1 -1
  120. package/dist/{stateDiagram-v2-6OUMAXLB-APLiC-KL.js → stateDiagram-v2-6OUMAXLB-C1Fb_pKt.js} +2 -2
  121. package/dist/styles/markdown.css +1 -1
  122. package/dist/styles/markdown.standalone.css +1 -1
  123. package/dist/{swimlanes-5IMT3BWC-Dlu3b_xG.js → swimlanes-5IMT3BWC-DUPAete1.js} +313 -313
  124. package/dist/{swimlanes-5IMT3BWC-DRPswRoa.cjs → swimlanes-5IMT3BWC-DZLnPVID.cjs} +1 -1
  125. package/dist/{swimlanesDiagram-G3AALYLV-CX2jbFCF.js → swimlanesDiagram-G3AALYLV-BrpRN3Vb.js} +2 -2
  126. package/dist/{swimlanesDiagram-G3AALYLV-VAEv3KP_.cjs → swimlanesDiagram-G3AALYLV-CMa-ZboO.cjs} +1 -1
  127. package/dist/{timeline-definition-FHXFAJF6-Ct68OfPR.js → timeline-definition-FHXFAJF6-DC2SJZSb.js} +108 -108
  128. package/dist/{timeline-definition-FHXFAJF6-C6xF4zqV.cjs → timeline-definition-FHXFAJF6-wvuHQLus.cjs} +1 -1
  129. package/dist/{vennDiagram-L72KCM5P-CUaYoUAd.cjs → vennDiagram-L72KCM5P-DbIG-wm1.cjs} +1 -1
  130. package/dist/{vennDiagram-L72KCM5P-BfTAjs8X.js → vennDiagram-L72KCM5P-HK22xYss.js} +101 -101
  131. package/dist/{wardleyDiagram-EHGQE667-Cp3kY_DT.cjs → wardleyDiagram-EHGQE667-BN2PkxRg.cjs} +1 -1
  132. package/dist/{wardleyDiagram-EHGQE667-2foz0EAt.js → wardleyDiagram-EHGQE667-JHC6pqAp.js} +85 -85
  133. package/dist/{xychartDiagram-FW5EYKEG-CDkSOK02.cjs → xychartDiagram-FW5EYKEG-CMRlyJDS.cjs} +1 -1
  134. package/dist/{xychartDiagram-FW5EYKEG-B3dGYiSE.js → xychartDiagram-FW5EYKEG-DNLQTD-2.js} +40 -40
  135. package/package.json +11 -11
  136. package/dist/cli.d.ts +0 -1
  137. package/dist/cli.js +0 -115
  138. package/dist/extractHeadings-Dkf-aqDu.cjs +0 -314
  139. package/dist/flowDiagram-23GEKE2U-DwEDOisR.cjs +0 -1
  140. package/dist/flowDiagram-23GEKE2U-aboipivB.js +0 -7
@@ -1,4 +1,4 @@
1
- import { bL as Kt, G as Wt, J as Ht, a9 as Yt, a8 as Xt, K as Zt, O as Jt, _ as w, ai as wt, an as Qt, R as ot, b0 as $t, aA as te, aB as ee, aC as ne, V as se, ae as ie, ak as oe, al as re } from "./extractHeadings-BUjTmniO.js";
1
+ import { bK as Kt, A as Wt, G as Ht, a8 as Yt, a7 as Xt, J as Zt, K as Jt, _ as w, ah as wt, am as Qt, Q as ot, a$ as $t, az as te, aA as ee, aB as ne, U as se, ad as ie, aj as oe, ak as re } from "./extractHeadings-DZi9v6vp.js";
2
2
  const It = (t, n) => Kt(t, "a", -n), _t = 1e-10;
3
3
  function st(t, n) {
4
4
  const s = le(t), e = s.filter((l) => ae(l, t));
@@ -23,7 +23,7 @@ function st(t, n) {
23
23
  let _ = E - M;
24
24
  _ < 0 && (_ += 2 * Math.PI);
25
25
  const S = E - _ / 2;
26
- let g = q(y, {
26
+ let g = U(y, {
27
27
  x: p.x + p.radius * Math.sin(S),
28
28
  y: p.y + p.radius * Math.cos(S)
29
29
  });
@@ -37,7 +37,7 @@ function st(t, n) {
37
37
  t[u].radius < l.radius && (l = t[u]);
38
38
  let f = !1;
39
39
  for (let u = 0; u < t.length; ++u)
40
- if (q(t[u], l) > Math.abs(l.radius - t[u].radius)) {
40
+ if (U(t[u], l) > Math.abs(l.radius - t[u].radius)) {
41
41
  f = !0;
42
42
  break;
43
43
  }
@@ -53,7 +53,7 @@ function st(t, n) {
53
53
  return o /= 2, n && (n.area = i + o, n.arcArea = i, n.polygonArea = o, n.arcs = r, n.innerPoints = e, n.intersectionPoints = s), i + o;
54
54
  }
55
55
  function ae(t, n) {
56
- return n.every((s) => q(t, s) < s.radius + _t);
56
+ return n.every((s) => U(t, s) < s.radius + _t);
57
57
  }
58
58
  function le(t) {
59
59
  const n = [];
@@ -68,7 +68,7 @@ function le(t) {
68
68
  function lt(t, n) {
69
69
  return t * t * Math.acos(1 - n / t) - (t - n) * Math.sqrt(n * (2 * t - n));
70
70
  }
71
- function q(t, n) {
71
+ function U(t, n) {
72
72
  return Math.sqrt((t.x - n.x) * (t.x - n.x) + (t.y - n.y) * (t.y - n.y));
73
73
  }
74
74
  function xt(t, n, s) {
@@ -80,7 +80,7 @@ function xt(t, n, s) {
80
80
  return lt(t, e) + lt(n, i);
81
81
  }
82
82
  function Tt(t, n) {
83
- const s = q(t, n), e = t.radius, i = n.radius;
83
+ const s = U(t, n), e = t.radius, i = n.radius;
84
84
  if (s >= e + i || s <= Math.abs(e - i))
85
85
  return [];
86
86
  const o = (e * e - i * i + s * s) / (2 * s), r = Math.sqrt(e * e - o * o), l = t.x + o * (n.x - t.x) / s, f = t.y + o * (n.y - t.y) / s, u = -(n.y - t.y) * (r / s), a = -(n.x - t.x) * (r / s);
@@ -444,7 +444,7 @@ function tt(t, n) {
444
444
  let i;
445
445
  if (e.sets.length === 2) {
446
446
  const r = t[e.sets[0]], l = t[e.sets[1]];
447
- i = xt(r.radius, l.radius, q(r, l));
447
+ i = xt(r.radius, l.radius, U(r, l));
448
448
  } else
449
449
  i = st(e.sets.map((r) => t[r]));
450
450
  const o = e.weight != null ? e.weight : 1;
@@ -460,7 +460,7 @@ function Ct(t, n) {
460
460
  let i;
461
461
  if (e.sets.length === 2) {
462
462
  const l = t[e.sets[0]], f = t[e.sets[1]];
463
- i = xt(l.radius, f.radius, q(l, f));
463
+ i = xt(l.radius, f.radius, U(l, f));
464
464
  } else
465
465
  i = st(e.sets.map((l) => t[l]));
466
466
  const o = e.weight != null ? e.weight : 1, r = Math.log((i + 1) / (e.size + 1));
@@ -474,7 +474,7 @@ function me(t, n, s) {
474
474
  for (const r of t)
475
475
  r.x -= i, r.y -= o;
476
476
  }
477
- if (t.length === 2 && q(t[0], t[1]) < Math.abs(t[1].radius - t[0].radius) && (t[1].x = t[0].x + t[0].radius - t[1].radius - 1e-10, t[1].y = t[0].y), t.length > 1) {
477
+ if (t.length === 2 && U(t[0], t[1]) < Math.abs(t[1].radius - t[0].radius) && (t[1].x = t[0].x + t[0].radius - t[1].radius - 1e-10, t[1].y = t[0].y), t.length > 1) {
478
478
  const i = Math.atan2(t[1].x, t[1].y) - n, o = Math.cos(i), r = Math.sin(i);
479
479
  for (const l of t) {
480
480
  const f = l.x, u = l.y;
@@ -510,7 +510,7 @@ function be(t) {
510
510
  for (let i = 0; i < t.length; ++i)
511
511
  for (let o = i + 1; o < t.length; ++o) {
512
512
  const r = t[i].radius + t[o].radius;
513
- q(t[i], t[o]) + 1e-10 < r && s(t[o], t[i]);
513
+ U(t[i], t[o]) + 1e-10 < r && s(t[o], t[i]);
514
514
  }
515
515
  const e = /* @__PURE__ */ new Map();
516
516
  for (let i = 0; i < t.length; ++i) {
@@ -530,7 +530,7 @@ function dt(t) {
530
530
  }
531
531
  function Dt(t, n, s) {
532
532
  n == null && (n = Math.PI / 2);
533
- let e = Ft(t).map((u) => Object.assign({}, u));
533
+ let e = jt(t).map((u) => Object.assign({}, u));
534
534
  const i = be(e);
535
535
  for (const u of i) {
536
536
  me(u, n, s);
@@ -565,10 +565,10 @@ function Dt(t, n, s) {
565
565
  let f = 1;
566
566
  for (; f < i.length; )
567
567
  l(i[f], !0, !1), l(i[f + 1], !1, !0), l(i[f + 2], !0, !0), f += 3, o = dt(e);
568
- return Nt(e);
568
+ return Ot(e);
569
569
  }
570
- function Ot(t, n, s, e, i) {
571
- const o = Ft(t);
570
+ function Nt(t, n, s, e, i) {
571
+ const o = jt(t);
572
572
  n -= 2 * e, s -= 2 * e;
573
573
  const { xRange: r, yRange: l } = dt(o);
574
574
  if (r.max === r.min || l.max === l.min)
@@ -580,7 +580,7 @@ function Ot(t, n, s, e, i) {
580
580
  } else
581
581
  f = n / (r.max - r.min), u = s / (l.max - l.min);
582
582
  const a = Math.min(u, f), y = (n - (r.max - r.min) * a) / 2, h = (s - (l.max - l.min) * a) / 2;
583
- return Nt(
583
+ return Ot(
584
584
  o.map((b) => ({
585
585
  radius: a * b.radius,
586
586
  x: e + y + (b.x - r.min) * a,
@@ -589,13 +589,13 @@ function Ot(t, n, s, e, i) {
589
589
  }))
590
590
  );
591
591
  }
592
- function Nt(t) {
592
+ function Ot(t) {
593
593
  const n = {};
594
594
  for (const s of t)
595
595
  n[s.setid] = s;
596
596
  return n;
597
597
  }
598
- function Ft(t) {
598
+ function jt(t) {
599
599
  return Object.keys(t).map((s) => Object.assign(t[s], { setid: s }));
600
600
  }
601
601
  function ve(t = {}) {
@@ -621,45 +621,45 @@ function ve(t = {}) {
621
621
  const C = /* @__PURE__ */ new Set();
622
622
  d.forEach((I) => {
623
623
  I.size == 0 && I.sets.length == 1 && C.add(I.sets[0]);
624
- }), d = d.filter((I) => !I.sets.some((F) => C.has(F)));
624
+ }), d = d.filter((I) => !I.sets.some((j) => C.has(j)));
625
625
  let k = {}, D = {};
626
626
  if (d.length > 0) {
627
627
  let I = m(d, { lossFunction: v, distinct: b });
628
- l && (I = Dt(I, r, h)), k = Ot(I, s, e, i, f), D = Lt(k, d, M);
628
+ l && (I = Dt(I, r, h)), k = Nt(I, s, e, i, f), D = Lt(k, d, M);
629
629
  }
630
- const U = {};
630
+ const q = {};
631
631
  d.forEach((I) => {
632
- I.label && (U[I.sets] = I.label);
632
+ I.label && (q[I.sets] = I.label);
633
633
  });
634
634
  function V(I) {
635
- if (I.sets in U)
636
- return U[I.sets];
635
+ if (I.sets in q)
636
+ return q[I.sets];
637
637
  if (I.sets.length == 1)
638
638
  return "" + I.sets[0];
639
639
  }
640
640
  x.selectAll("svg").data([k]).enter().append("svg");
641
- const N = x.select("svg");
642
- n ? N.attr("viewBox", `0 0 ${s} ${e}`) : N.attr("width", s).attr("height", e);
641
+ const O = x.select("svg");
642
+ n ? O.attr("viewBox", `0 0 ${s} ${e}`) : O.attr("width", s).attr("height", e);
643
643
  const R = {};
644
644
  let T = !1;
645
- N.selectAll(".venn-area path").each(function(I) {
646
- const F = this.getAttribute("d");
647
- I.sets.length == 1 && F && !b && (T = !0, R[I.sets[0]] = Me(F));
645
+ O.selectAll(".venn-area path").each(function(I) {
646
+ const j = this.getAttribute("d");
647
+ I.sets.length == 1 && j && !b && (T = !0, R[I.sets[0]] = Me(j));
648
648
  });
649
649
  function A(I) {
650
- return (F) => {
650
+ return (j) => {
651
651
  const H = I.sets.map((et) => {
652
652
  let Y = R[et], Z = k[et];
653
653
  return Y || (Y = { x: s / 2, y: e / 2, radius: 1 }), Z || (Z = { x: s / 2, y: e / 2, radius: 1 }), {
654
- x: Y.x * (1 - F) + Z.x * F,
655
- y: Y.y * (1 - F) + Z.y * F,
656
- radius: Y.radius * (1 - F) + Z.radius * F
654
+ x: Y.x * (1 - j) + Z.x * j,
655
+ y: Y.y * (1 - j) + Z.y * j,
656
+ radius: Y.radius * (1 - j) + Z.radius * j
657
657
  };
658
658
  });
659
659
  return St(H, p);
660
660
  };
661
661
  }
662
- const G = N.selectAll(".venn-area").data(d, (I) => I.sets), P = G.enter().append("g").attr(
662
+ const G = O.selectAll(".venn-area").data(d, (I) => I.sets), P = G.enter().append("g").attr(
663
663
  "class",
664
664
  (I) => `venn-area venn-${I.sets.length == 1 ? "circle" : "intersection"}${I.colour || I.color ? " venn-coloured" : ""}`
665
665
  ).attr("data-venn-sets", (I) => I.sets.join("_")), B = P.append("path"), L = P.append("text").attr("class", "label").text((I) => V(I)).attr("text-anchor", "middle").attr("dy", ".35em").attr("x", s / 2).attr("y", e / 2);
@@ -668,13 +668,13 @@ function ve(t = {}) {
668
668
  return typeof I.transition == "function" ? I.transition("venn").duration(o) : I;
669
669
  }
670
670
  let z = x;
671
- T && typeof z.transition == "function" ? (z = W(x), z.selectAll("path").attrTween("d", A)) : z.selectAll("path").attr("d", (I) => St(I.sets.map((F) => k[F])), p);
672
- const O = z.selectAll("text").filter((I) => I.sets in D).text((I) => V(I)).attr("x", (I) => Math.floor(D[I.sets].x)).attr("y", (I) => Math.floor(D[I.sets].y));
673
- u && (T ? "on" in O ? O.on("end", rt(k, V)) : O.each("end", rt(k, V)) : O.each(rt(k, V)));
674
- const j = W(G.exit()).remove();
675
- typeof G.transition == "function" && j.selectAll("path").attrTween("d", A);
676
- const X = j.selectAll("text").attr("x", s / 2).attr("y", e / 2);
677
- return y !== null && (L.style("font-size", "0px"), O.style("font-size", y), X.style("font-size", "0px")), { circles: k, textCentres: D, nodes: G, enter: P, update: z, exit: j };
671
+ T && typeof z.transition == "function" ? (z = W(x), z.selectAll("path").attrTween("d", A)) : z.selectAll("path").attr("d", (I) => St(I.sets.map((j) => k[j])), p);
672
+ const N = z.selectAll("text").filter((I) => I.sets in D).text((I) => V(I)).attr("x", (I) => Math.floor(D[I.sets].x)).attr("y", (I) => Math.floor(D[I.sets].y));
673
+ u && (T ? "on" in N ? N.on("end", rt(k, V)) : N.each("end", rt(k, V)) : N.each(rt(k, V)));
674
+ const F = W(G.exit()).remove();
675
+ typeof G.transition == "function" && F.selectAll("path").attrTween("d", A);
676
+ const X = F.selectAll("text").attr("x", s / 2).attr("y", e / 2);
677
+ return y !== null && (L.style("font-size", "0px"), N.style("font-size", y), X.style("font-size", "0px")), { circles: k, textCentres: D, nodes: G, enter: P, update: z, exit: F };
678
678
  }
679
679
  return c.wrap = function(x) {
680
680
  return arguments.length ? (u = x, c) : u;
@@ -738,18 +738,18 @@ function rt(t, n) {
738
738
  };
739
739
  }
740
740
  function at(t, n, s) {
741
- let e = n[0].radius - q(n[0], t);
741
+ let e = n[0].radius - U(n[0], t);
742
742
  for (let i = 1; i < n.length; ++i) {
743
- const o = n[i].radius - q(n[i], t);
743
+ const o = n[i].radius - U(n[i], t);
744
744
  o <= e && (e = o);
745
745
  }
746
746
  for (let i = 0; i < s.length; ++i) {
747
- const o = q(s[i], t) - s[i].radius;
747
+ const o = U(s[i], t) - s[i].radius;
748
748
  o <= e && (e = o);
749
749
  }
750
750
  return e;
751
751
  }
752
- function jt(t, n, s) {
752
+ function Ft(t, n, s) {
753
753
  const e = [];
754
754
  for (const a of t)
755
755
  e.push({ x: a.x, y: a.y }), e.push({ x: a.x + a.radius / 2, y: a.y }), e.push({ x: a.x - a.radius / 2, y: a.y }), e.push({ x: a.x, y: a.y + a.radius / 2 }), e.push({ x: a.x, y: a.y - a.radius / 2 });
@@ -765,12 +765,12 @@ function jt(t, n, s) {
765
765
  ).x, l = { x: s ? 0 : r[0], y: r[1] };
766
766
  let f = !0;
767
767
  for (const a of t)
768
- if (q(l, a) > a.radius) {
768
+ if (U(l, a) > a.radius) {
769
769
  f = !1;
770
770
  break;
771
771
  }
772
772
  for (const a of n)
773
- if (q(l, a) < a.radius) {
773
+ if (U(l, a) < a.radius) {
774
774
  f = !1;
775
775
  break;
776
776
  }
@@ -779,7 +779,7 @@ function jt(t, n, s) {
779
779
  if (t.length == 1)
780
780
  return { x: t[0].x, y: t[0].y };
781
781
  const u = {};
782
- return st(t, u), u.arcs.length === 0 ? { x: 0, y: -1e3, disjoint: !0 } : u.arcs.length == 1 ? { x: u.arcs[0].circle.x, y: u.arcs[0].circle.y } : n.length ? jt(t, []) : Et(u.arcs.map((a) => a.p1));
782
+ return st(t, u), u.arcs.length === 0 ? { x: 0, y: -1e3, disjoint: !0 } : u.arcs.length == 1 ? { x: u.arcs[0].circle.x, y: u.arcs[0].circle.y } : n.length ? Ft(t, []) : Et(u.arcs.map((a) => a.p1));
783
783
  }
784
784
  function ke(t) {
785
785
  const n = {}, s = Object.keys(t);
@@ -788,7 +788,7 @@ function ke(t) {
788
788
  for (let e = 0; e < s.length; e++) {
789
789
  const i = s[e], o = t[i];
790
790
  for (let r = e + 1; r < s.length; ++r) {
791
- const l = s[r], f = t[l], u = q(o, f);
791
+ const l = s[r], f = t[l], u = U(o, f);
792
792
  u + f.radius <= o.radius + 1e-10 ? n[l].push(i) : u + o.radius <= f.radius + 1e-10 && n[i].push(l);
793
793
  }
794
794
  }
@@ -807,7 +807,7 @@ function Lt(t, n, s) {
807
807
  const u = [], a = [];
808
808
  for (let h in t)
809
809
  h in l ? u.push(t[h]) : h in f || a.push(t[h]);
810
- const y = jt(u, a, s);
810
+ const y = Ft(u, a, s);
811
811
  e[r] = y, y.disjoint && n[o].size > 0 && console.log("WARNING: area " + r + " not represented on screen");
812
812
  }
813
813
  return e;
@@ -870,7 +870,7 @@ function Se(t, n = {}) {
870
870
  distinct: h
871
871
  });
872
872
  i && (p = Dt(p, o, r));
873
- const M = Ot(p, l, f, u, a), E = Lt(M, t, y), _ = new Map(
873
+ const M = Nt(p, l, f, u, a), E = Lt(M, t, y), _ = new Map(
874
874
  Object.keys(M).map((m) => [
875
875
  m,
876
876
  {
@@ -1033,7 +1033,7 @@ var gt = (function() {
1033
1033
  }
1034
1034
  }, "parseError"),
1035
1035
  parse: /* @__PURE__ */ w(function(g) {
1036
- var m = this, v = [0], c = [], x = [null], d = [], C = this.table, k = "", D = 0, U = 0, V = 2, N = 1, R = d.slice.call(arguments, 1), T = Object.create(this.lexer), A = { yy: {} };
1036
+ var m = this, v = [0], c = [], x = [null], d = [], C = this.table, k = "", D = 0, q = 0, V = 2, O = 1, R = d.slice.call(arguments, 1), T = Object.create(this.lexer), A = { yy: {} };
1037
1037
  for (var G in this.yy)
1038
1038
  Object.prototype.hasOwnProperty.call(this.yy, G) && (A.yy[G] = this.yy[G]);
1039
1039
  T.setInput(g, A.yy), A.yy.lexer = T, A.yy.parser = this, typeof T.yylloc > "u" && (T.yylloc = {});
@@ -1047,18 +1047,18 @@ var gt = (function() {
1047
1047
  w(L, "popStack");
1048
1048
  function W() {
1049
1049
  var K;
1050
- return K = c.pop() || T.lex() || N, typeof K != "number" && (K instanceof Array && (c = K, K = c.pop()), K = m.symbols_[K] || K), K;
1050
+ return K = c.pop() || T.lex() || O, typeof K != "number" && (K instanceof Array && (c = K, K = c.pop()), K = m.symbols_[K] || K), K;
1051
1051
  }
1052
1052
  w(W, "lex");
1053
- for (var z, O, j, X, I = {}, F, H, et, Y; ; ) {
1054
- if (O = v[v.length - 1], this.defaultActions[O] ? j = this.defaultActions[O] : ((z === null || typeof z > "u") && (z = W()), j = C[O] && C[O][z]), typeof j > "u" || !j.length || !j[0]) {
1053
+ for (var z, N, F, X, I = {}, j, H, et, Y; ; ) {
1054
+ if (N = v[v.length - 1], this.defaultActions[N] ? F = this.defaultActions[N] : ((z === null || typeof z > "u") && (z = W()), F = C[N] && C[N][z]), typeof F > "u" || !F.length || !F[0]) {
1055
1055
  var Z = "";
1056
1056
  Y = [];
1057
- for (F in C[O])
1058
- this.terminals_[F] && F > V && Y.push("'" + this.terminals_[F] + "'");
1057
+ for (j in C[N])
1058
+ this.terminals_[j] && j > V && Y.push("'" + this.terminals_[j] + "'");
1059
1059
  T.showPosition ? Z = "Parse error on line " + (D + 1) + `:
1060
1060
  ` + T.showPosition() + `
1061
- Expecting ` + Y.join(", ") + ", got '" + (this.terminals_[z] || z) + "'" : Z = "Parse error on line " + (D + 1) + ": Unexpected " + (z == N ? "end of input" : "'" + (this.terminals_[z] || z) + "'"), this.parseError(Z, {
1061
+ Expecting ` + Y.join(", ") + ", got '" + (this.terminals_[z] || z) + "'" : Z = "Parse error on line " + (D + 1) + ": Unexpected " + (z == O ? "end of input" : "'" + (this.terminals_[z] || z) + "'"), this.parseError(Z, {
1062
1062
  text: T.match,
1063
1063
  token: this.terminals_[z] || z,
1064
1064
  line: T.yylineno,
@@ -1066,14 +1066,14 @@ Expecting ` + Y.join(", ") + ", got '" + (this.terminals_[z] || z) + "'" : Z = "
1066
1066
  expected: Y
1067
1067
  });
1068
1068
  }
1069
- if (j[0] instanceof Array && j.length > 1)
1070
- throw new Error("Parse Error: multiple actions possible at state: " + O + ", token: " + z);
1071
- switch (j[0]) {
1069
+ if (F[0] instanceof Array && F.length > 1)
1070
+ throw new Error("Parse Error: multiple actions possible at state: " + N + ", token: " + z);
1071
+ switch (F[0]) {
1072
1072
  case 1:
1073
- v.push(z), x.push(T.yytext), d.push(T.yylloc), v.push(j[1]), z = null, U = T.yyleng, k = T.yytext, D = T.yylineno, P = T.yylloc;
1073
+ v.push(z), x.push(T.yytext), d.push(T.yylloc), v.push(F[1]), z = null, q = T.yyleng, k = T.yytext, D = T.yylineno, P = T.yylloc;
1074
1074
  break;
1075
1075
  case 2:
1076
- if (H = this.productions_[j[1]][1], I.$ = x[x.length - H], I._$ = {
1076
+ if (H = this.productions_[F[1]][1], I.$ = x[x.length - H], I._$ = {
1077
1077
  first_line: d[d.length - (H || 1)].first_line,
1078
1078
  last_line: d[d.length - 1].last_line,
1079
1079
  first_column: d[d.length - (H || 1)].first_column,
@@ -1083,15 +1083,15 @@ Expecting ` + Y.join(", ") + ", got '" + (this.terminals_[z] || z) + "'" : Z = "
1083
1083
  d[d.length - 1].range[1]
1084
1084
  ]), X = this.performAction.apply(I, [
1085
1085
  k,
1086
- U,
1086
+ q,
1087
1087
  D,
1088
1088
  A.yy,
1089
- j[1],
1089
+ F[1],
1090
1090
  x,
1091
1091
  d
1092
1092
  ].concat(R)), typeof X < "u")
1093
1093
  return X;
1094
- H && (v = v.slice(0, -1 * H * 2), x = x.slice(0, -1 * H), d = d.slice(0, -1 * H)), v.push(this.productions_[j[1]][0]), x.push(I.$), d.push(I._$), et = C[v[v.length - 2]][v[v.length - 1]], v.push(et);
1094
+ H && (v = v.slice(0, -1 * H * 2), x = x.slice(0, -1 * H), d = d.slice(0, -1 * H)), v.push(this.productions_[F[1]][0]), x.push(I.$), d.push(I._$), et = C[v[v.length - 2]][v[v.length - 1]], v.push(et);
1095
1095
  break;
1096
1096
  case 3:
1097
1097
  return !0;
@@ -1370,11 +1370,11 @@ var we = gt, yt = [], pt = [], mt = [], bt = /* @__PURE__ */ new Set(), vt, kt =
1370
1370
  const s = it(t).filter((e) => !bt.has(e));
1371
1371
  if (s.length > 0)
1372
1372
  throw new Error(`unknown set identifier: ${s.join(", ")}`);
1373
- }, "validateUnionIdentifiers"), De = /* @__PURE__ */ w(() => pt, "getTextData"), Oe = /* @__PURE__ */ w(() => vt, "getCurrentSets"), Ne = /* @__PURE__ */ w(() => kt, "getIndentMode"), Fe = /* @__PURE__ */ w((t) => {
1373
+ }, "validateUnionIdentifiers"), De = /* @__PURE__ */ w(() => pt, "getTextData"), Ne = /* @__PURE__ */ w(() => vt, "getCurrentSets"), Oe = /* @__PURE__ */ w(() => kt, "getIndentMode"), je = /* @__PURE__ */ w((t) => {
1374
1374
  kt = t;
1375
- }, "setIndentMode"), je = re.venn;
1375
+ }, "setIndentMode"), Fe = re.venn;
1376
1376
  function Vt() {
1377
- return oe(je, wt().venn);
1377
+ return oe(Fe, wt().venn);
1378
1378
  }
1379
1379
  w(Vt, "getConfig");
1380
1380
  var Le = /* @__PURE__ */ w(() => {
@@ -1395,9 +1395,9 @@ var Le = /* @__PURE__ */ w(() => {
1395
1395
  validateUnionIdentifiers: Ce,
1396
1396
  getTextData: De,
1397
1397
  getStyleData: Re,
1398
- getCurrentSets: Oe,
1399
- getIndentMode: Ne,
1400
- setIndentMode: Fe
1398
+ getCurrentSets: Ne,
1399
+ getIndentMode: Oe,
1400
+ setIndentMode: je
1401
1401
  }, Be = /* @__PURE__ */ w((t) => `
1402
1402
  .venn-title {
1403
1403
  font-size: 32px;
@@ -1421,7 +1421,7 @@ var Le = /* @__PURE__ */ w(() => {
1421
1421
  color: ${t.vennSetTextColor};
1422
1422
  }
1423
1423
  `, "getStyles"), Ve = Be;
1424
- function qt(t) {
1424
+ function Ut(t) {
1425
1425
  const n = /* @__PURE__ */ new Map();
1426
1426
  for (const s of t) {
1427
1427
  const e = s.targets.join("|"), i = n.get(e);
@@ -1429,8 +1429,8 @@ function qt(t) {
1429
1429
  }
1430
1430
  return n;
1431
1431
  }
1432
- w(qt, "buildStyleByKey");
1433
- var qe = /* @__PURE__ */ w((t, n, s, e) => {
1432
+ w(Ut, "buildStyleByKey");
1433
+ var Ue = /* @__PURE__ */ w((t, n, s, e) => {
1434
1434
  const i = e.db, o = i.getConfig?.(), { themeVariables: r, look: l, handDrawnSeed: f } = wt(), u = l === "handDrawn", a = [
1435
1435
  r.venn1,
1436
1436
  r.venn2,
@@ -1440,7 +1440,7 @@ var qe = /* @__PURE__ */ w((t, n, s, e) => {
1440
1440
  r.venn6,
1441
1441
  r.venn7,
1442
1442
  r.venn8
1443
- ].filter(Boolean), y = i.getDiagramTitle?.(), h = i.getSubsetData(), b = i.getTextData(), p = qt(i.getStyleData()), M = Gt(h), E = o?.width ?? 800, _ = o?.height ?? 450, g = E / 1600, m = y ? 48 * g : 0, v = r.primaryTextColor ?? r.textColor, c = Qt(n);
1443
+ ].filter(Boolean), y = i.getDiagramTitle?.(), h = i.getSubsetData(), b = i.getTextData(), p = Ut(i.getStyleData()), M = Gt(h), E = o?.width ?? 800, _ = o?.height ?? 450, g = E / 1600, m = y ? 48 * g : 0, v = r.primaryTextColor ?? r.textColor, c = Qt(n);
1444
1444
  c.attr("viewBox", `0 0 ${E} ${_}`), y && c.append("text").text(y).attr("class", "venn-title").attr("font-size", `${32 * g}px`).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("x", "50%").attr("y", 32 * g).style("fill", r.vennTitleTextColor || r.titleColor);
1445
1445
  const x = ot(document.createElement("div")), d = ve().width(E).height(_ - m);
1446
1446
  x.datum(M).call(d);
@@ -1453,16 +1453,16 @@ var qe = /* @__PURE__ */ w((t, n, s, e) => {
1453
1453
  const T = Q([...R.data.sets].sort());
1454
1454
  D.set(T, R);
1455
1455
  }
1456
- b.length > 0 && Ut(o, D, x, b, g, p);
1457
- const U = te(r.background || "#f4f4f4");
1456
+ b.length > 0 && qt(o, D, x, b, g, p);
1457
+ const q = te(r.background || "#f4f4f4");
1458
1458
  x.selectAll(".venn-circle").each(function(R, T) {
1459
1459
  const A = ot(this), P = Q([...R.sets].sort()), B = p.get(P), L = B?.fill || a[T % a.length] || r.primaryColor;
1460
1460
  A.classed(`venn-set-${T % 8}`, !0);
1461
- const W = B?.["fill-opacity"] ?? 0.1, z = B?.stroke || L, O = B?.["stroke-width"] || `${5 * g}`;
1461
+ const W = B?.["fill-opacity"] ?? 0.1, z = B?.stroke || L, N = B?.["stroke-width"] || `${5 * g}`;
1462
1462
  if (u && C) {
1463
1463
  const X = D.get(P);
1464
1464
  if (X && X.circles.length > 0) {
1465
- const I = X.circles[0], F = C.circle(I.x, I.y, I.radius * 2, {
1465
+ const I = X.circles[0], j = C.circle(I.x, I.y, I.radius * 2, {
1466
1466
  roughness: 0.7,
1467
1467
  seed: f,
1468
1468
  fill: It(L, 0.7),
@@ -1471,14 +1471,14 @@ var qe = /* @__PURE__ */ w((t, n, s, e) => {
1471
1471
  hachureGap: 8,
1472
1472
  hachureAngle: -41 + T * 60,
1473
1473
  stroke: z,
1474
- strokeWidth: parseFloat(String(O))
1474
+ strokeWidth: parseFloat(String(N))
1475
1475
  });
1476
- A.select("path").remove(), A.node()?.insertBefore(F, A.select("text").node());
1476
+ A.select("path").remove(), A.node()?.insertBefore(j, A.select("text").node());
1477
1477
  }
1478
1478
  } else
1479
- A.select("path").style("fill", L).style("fill-opacity", W).style("stroke", z).style("stroke-width", O).style("stroke-opacity", 0.95);
1480
- const j = B?.color || (U ? ee(L, 30) : ne(L, 30));
1481
- A.select("text").style("font-size", `${48 * g}px`).style("fill", j);
1479
+ A.select("path").style("fill", L).style("fill-opacity", W).style("stroke", z).style("stroke-width", N).style("stroke-opacity", 0.95);
1480
+ const F = B?.color || (q ? ee(L, 30) : ne(L, 30));
1481
+ A.select("text").style("font-size", `${48 * g}px`).style("fill", F);
1482
1482
  }), u && C ? x.selectAll(".venn-intersection").each(function(R) {
1483
1483
  const T = ot(this), G = Q([...R.sets].sort()), P = p.get(G), B = P?.fill;
1484
1484
  if (B) {
@@ -1493,8 +1493,8 @@ var qe = /* @__PURE__ */ w((t, n, s, e) => {
1493
1493
  hachureGap: 6,
1494
1494
  hachureAngle: 60,
1495
1495
  stroke: "none"
1496
- }), O = L.node();
1497
- O?.parentNode?.insertBefore(z, O), L.remove();
1496
+ }), N = L.node();
1497
+ N?.parentNode?.insertBefore(z, N), L.remove();
1498
1498
  }
1499
1499
  } else
1500
1500
  T.select("path").style("fill-opacity", 0);
@@ -1509,9 +1509,9 @@ var qe = /* @__PURE__ */ w((t, n, s, e) => {
1509
1509
  const A = Q([...R.sets].sort());
1510
1510
  return p.get(A)?.fill ?? "transparent";
1511
1511
  }));
1512
- const V = c.append("g").attr("transform", `translate(0, ${m})`), N = x.select("svg").node();
1513
- if (N && "childNodes" in N)
1514
- for (const R of [...N.childNodes])
1512
+ const V = c.append("g").attr("transform", `translate(0, ${m})`), O = x.select("svg").node();
1513
+ if (O && "childNodes" in O)
1514
+ for (const R of [...O.childNodes])
1515
1515
  V.node()?.appendChild(R);
1516
1516
  se(c, _, E, o?.useMaxWidth ?? !0);
1517
1517
  }, "draw");
@@ -1519,7 +1519,7 @@ function Q(t) {
1519
1519
  return t.join("|");
1520
1520
  }
1521
1521
  w(Q, "stableSetsKey");
1522
- function Ut(t, n, s, e, i, o) {
1522
+ function qt(t, n, s, e, i, o) {
1523
1523
  const r = t?.useDebugLayout ?? !1, f = s.select("svg").append("g").attr("class", "venn-text-nodes"), u = /* @__PURE__ */ new Map();
1524
1524
  for (const a of e) {
1525
1525
  const y = Q(a.sets), h = u.get(y);
@@ -1529,23 +1529,23 @@ function Ut(t, n, s, e, i, o) {
1529
1529
  const h = n.get(a);
1530
1530
  if (!h?.text)
1531
1531
  continue;
1532
- const b = h.text.x, p = h.text.y, M = Math.min(...h.circles.map((N) => N.radius)), E = Math.min(
1533
- ...h.circles.map((N) => N.radius - Math.hypot(b - N.x, p - N.y))
1532
+ const b = h.text.x, p = h.text.y, M = Math.min(...h.circles.map((O) => O.radius)), E = Math.min(
1533
+ ...h.circles.map((O) => O.radius - Math.hypot(b - O.x, p - O.y))
1534
1534
  );
1535
1535
  let _ = Number.isFinite(E) ? Math.max(0, E) : 0;
1536
1536
  _ === 0 && Number.isFinite(M) && (_ = M * 0.6);
1537
1537
  const S = f.append("g").attr("class", "venn-text-area").attr("font-size", `${40 * i}px`);
1538
1538
  r && S.append("circle").attr("class", "venn-text-debug-circle").attr("cx", b).attr("cy", p).attr("r", _).attr("fill", "none").attr("stroke", "purple").attr("stroke-width", 1.5 * i).attr("stroke-dasharray", `${6 * i} ${4 * i}`);
1539
- const g = Math.max(80 * i, _ * 2 * 0.95), m = Math.max(60 * i, _ * 2 * 0.95), x = (h.data.label && h.data.label.length > 0 ? Math.min(32 * i, _ * 0.25) : 0) + (y.length <= 2 ? 30 * i : 0), d = b - g / 2, C = p - m / 2 + x, k = Math.max(1, Math.ceil(Math.sqrt(y.length))), D = Math.max(1, Math.ceil(y.length / k)), U = g / k, V = m / D;
1540
- for (const [N, R] of y.entries()) {
1541
- const T = N % k, A = Math.floor(N / k), G = d + U * (T + 0.5), P = C + V * (A + 0.5);
1542
- r && S.append("rect").attr("class", "venn-text-debug-cell").attr("x", d + U * T).attr("y", C + V * A).attr("width", U).attr("height", V).attr("fill", "none").attr("stroke", "teal").attr("stroke-width", 1 * i).attr("stroke-dasharray", `${4 * i} ${3 * i}`);
1543
- const B = U * 0.9, L = V * 0.9, W = S.append("foreignObject").attr("class", "venn-text-node-fo").attr("width", B).attr("height", L).attr("x", G - B / 2).attr("y", P - L / 2).attr("overflow", "visible"), z = o.get(R.id)?.color, O = W.append("xhtml:span").attr("class", "venn-text-node").style("display", "flex").style("width", "100%").style("height", "100%").style("white-space", "normal").style("align-items", "center").style("justify-content", "center").style("text-align", "center").style("overflow-wrap", "normal").style("word-break", "normal").text(R.label ?? R.id);
1544
- z && O.style("color", z);
1539
+ const g = Math.max(80 * i, _ * 2 * 0.95), m = Math.max(60 * i, _ * 2 * 0.95), x = (h.data.label && h.data.label.length > 0 ? Math.min(32 * i, _ * 0.25) : 0) + (y.length <= 2 ? 30 * i : 0), d = b - g / 2, C = p - m / 2 + x, k = Math.max(1, Math.ceil(Math.sqrt(y.length))), D = Math.max(1, Math.ceil(y.length / k)), q = g / k, V = m / D;
1540
+ for (const [O, R] of y.entries()) {
1541
+ const T = O % k, A = Math.floor(O / k), G = d + q * (T + 0.5), P = C + V * (A + 0.5);
1542
+ r && S.append("rect").attr("class", "venn-text-debug-cell").attr("x", d + q * T).attr("y", C + V * A).attr("width", q).attr("height", V).attr("fill", "none").attr("stroke", "teal").attr("stroke-width", 1 * i).attr("stroke-dasharray", `${4 * i} ${3 * i}`);
1543
+ const B = q * 0.9, L = V * 0.9, W = S.append("foreignObject").attr("class", "venn-text-node-fo").attr("width", B).attr("height", L).attr("x", G - B / 2).attr("y", P - L / 2).attr("overflow", "visible"), z = o.get(R.id)?.color, N = W.append("xhtml:span").attr("class", "venn-text-node").style("display", "flex").style("width", "100%").style("height", "100%").style("white-space", "normal").style("align-items", "center").style("justify-content", "center").style("text-align", "center").style("overflow-wrap", "normal").style("word-break", "normal").text(R.label ?? R.id);
1544
+ z && N.style("color", z);
1545
1545
  }
1546
1546
  }
1547
1547
  }
1548
- w(Ut, "renderTextNodes");
1548
+ w(qt, "renderTextNodes");
1549
1549
  function Gt(t) {
1550
1550
  const n = new Set(t.map((i) => [...i.sets].sort().join("|"))), s = new Map(
1551
1551
  t.filter((i) => i.sets.length === 1 && i.size !== void 0).map((i) => [i.sets[0], i.size])
@@ -1567,10 +1567,10 @@ function Gt(t) {
1567
1567
  return e.length > 0 ? [...t, ...e] : t;
1568
1568
  }
1569
1569
  w(Gt, "ensurePairwiseSubsets");
1570
- var Ue = { draw: qe }, Ke = {
1570
+ var qe = { draw: Ue }, Ke = {
1571
1571
  parser: we,
1572
1572
  db: Pe,
1573
- renderer: Ue,
1573
+ renderer: qe,
1574
1574
  styles: Ve
1575
1575
  };
1576
1576
  export {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Pt=require("./chunk-JWPE2WC7-CF8PY84Z.cjs"),f=require("./extractHeadings-Dkf-aqDu.cjs"),Ct=require("./cynefin-VYW2F7L2-MpAliYy9.cjs");var D=f.__name((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),L=f.__name((o,r,e)=>({x:D(r,`${e} evolution`),y:D(o,`${e} visibility`)}),"toCoordinates"),J=f.__name(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),St=f.__name(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Mt=f.__name((o,r)=>{if(Pt.populateCommonDb(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),g=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:g})}if(o.anchors.forEach(e=>{const g=L(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,g.x,g.y,"anchor")}),o.components.forEach(e=>{const g=L(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=e.decorator?.strategy;r.addNode(e.name,e.name,g.x,g.y,"component",a,d,e.inertia,m)}),o.notes.forEach(e=>{const g=L(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,g.x,g.y)}),o.pipelines.forEach(e=>{const g=r.getNode(e.parent);if(!g||typeof g.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=g.y;r.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,y=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,B=D(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(m,d.name,B,a,"pipeline-component",C,y),r.addPipelineComponent(e.parent,m)})}),o.links.forEach(e=>{const g=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=J(e.fromPort)??J(e.toPort);const{flow:d,label:m}=St(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,y=m??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),g,y,a)}),o.evolves.forEach(e=>{const g=r.getNode(e.component);if(g?.y!==void 0){const a=D(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,g.y)}}),o.annotations.length>0){const e=o.annotations[0],g=L(e.x,e.y,"Annotations box");r.setAnnotationsBox(g.x,g.y)}o.annotation.forEach(e=>{const g=L(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:g.x,y:g.y}],e.text)}),o.accelerators.forEach(e=>{const g=L(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,g.x,g.y)}),o.deaccelerators.forEach(e=>{const g=L(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,g.x,g.y)})},"populateDb"),U={parser:{yy:void 0},parse:f.__name(async o=>{const r=await Ct.parse("wardley",o);f.log.debug(r);const e=U.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Mt(r,e)},"parse")},X,_t=(X=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},g={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,g)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const g=this.pipelines.get(r);g&&g.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,g]of this.nodes)if(g.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},f.__name(X,"WardleyBuilder"),X),k=new _t;function K(){return f.getConfig2()["wardley-beta"]}f.__name(K,"getConfig");function Q(o,r,e,g,a,d,m,C,y){k.addNode({id:o,label:r,x:e,y:g,className:a,labelOffsetX:d,labelOffsetY:m,inertia:C,sourceStrategy:y})}f.__name(Q,"addNode");function tt(o,r,e=!1,g,a){k.addLink({source:o,target:r,dashed:e,label:g,flow:a})}f.__name(tt,"addLink");function et(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}f.__name(et,"addTrend");function at(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}f.__name(at,"addAnnotation");function rt(o,r,e){k.addNote({text:o,x:r,y:e})}f.__name(rt,"addNote");function ot(o,r,e){k.addAccelerator({name:o,x:r,y:e})}f.__name(ot,"addAccelerator");function nt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}f.__name(nt,"addDeaccelerator");function st(o,r){k.setAnnotationsBox(o,r)}f.__name(st,"setAnnotationsBox");function it(o,r){k.setSize(o,r)}f.__name(it,"setSize");function dt(o){k.startPipeline(o)}f.__name(dt,"startPipeline");function lt(o,r){k.addPipelineComponent(o,r)}f.__name(lt,"addPipelineComponent");function ct(o){k.setAxes(o)}f.__name(ct,"updateAxes");function pt(o){return k.getNode(o)}f.__name(pt,"getNode");function ft(o){return k.resolveNodeId(o)}f.__name(ft,"resolveNodeId");function ht(){return k.build()}f.__name(ht,"getWardleyData");function gt(){k.clear(),f.clear()}f.__name(gt,"clear");var Nt={getConfig:K,addNode:Q,addLink:tt,addTrend:et,addAnnotation:at,addNote:rt,addAccelerator:ot,addDeaccelerator:nt,setAnnotationsBox:st,setSize:it,startPipeline:dt,addPipelineComponent:lt,updateAxes:ct,getNode:pt,resolveNodeId:ft,getWardleyData:ht,clear:gt,setAccTitle:f.setAccTitle,getAccTitle:f.getAccTitle,setDiagramTitle:f.setDiagramTitle,getDiagramTitle:f.getDiagramTitle,getAccDescription:f.getAccDescription,setAccDescription:f.setAccDescription},Tt=["Genesis","Custom Built","Product","Commodity"],At=f.__name(()=>{const{themeVariables:o}=f.getConfig2();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),Lt=f.__name(()=>{const o=f.getConfig2()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),zt=f.__name((o,r,e,g)=>{f.log.debug(`Rendering Wardley map
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Pt=require("./chunk-JWPE2WC7-CZGO5NQs.cjs"),f=require("./extractHeadings-sSLGzcdt.cjs"),Ct=require("./cynefin-VYW2F7L2-MpAliYy9.cjs");var D=f.__name((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),L=f.__name((o,r,e)=>({x:D(r,`${e} evolution`),y:D(o,`${e} visibility`)}),"toCoordinates"),J=f.__name(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),St=f.__name(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Mt=f.__name((o,r)=>{if(Pt.populateCommonDb(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),g=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:g})}if(o.anchors.forEach(e=>{const g=L(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,g.x,g.y,"anchor")}),o.components.forEach(e=>{const g=L(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=e.decorator?.strategy;r.addNode(e.name,e.name,g.x,g.y,"component",a,d,e.inertia,m)}),o.notes.forEach(e=>{const g=L(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,g.x,g.y)}),o.pipelines.forEach(e=>{const g=r.getNode(e.parent);if(!g||typeof g.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=g.y;r.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,y=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,B=D(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(m,d.name,B,a,"pipeline-component",C,y),r.addPipelineComponent(e.parent,m)})}),o.links.forEach(e=>{const g=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=J(e.fromPort)??J(e.toPort);const{flow:d,label:m}=St(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,y=m??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),g,y,a)}),o.evolves.forEach(e=>{const g=r.getNode(e.component);if(g?.y!==void 0){const a=D(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,g.y)}}),o.annotations.length>0){const e=o.annotations[0],g=L(e.x,e.y,"Annotations box");r.setAnnotationsBox(g.x,g.y)}o.annotation.forEach(e=>{const g=L(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:g.x,y:g.y}],e.text)}),o.accelerators.forEach(e=>{const g=L(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,g.x,g.y)}),o.deaccelerators.forEach(e=>{const g=L(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,g.x,g.y)})},"populateDb"),U={parser:{yy:void 0},parse:f.__name(async o=>{const r=await Ct.parse("wardley",o);f.log.debug(r);const e=U.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Mt(r,e)},"parse")},X,_t=(X=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},g={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,g)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const g=this.pipelines.get(r);g&&g.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,g]of this.nodes)if(g.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},f.__name(X,"WardleyBuilder"),X),k=new _t;function K(){return f.getConfig2()["wardley-beta"]}f.__name(K,"getConfig");function Q(o,r,e,g,a,d,m,C,y){k.addNode({id:o,label:r,x:e,y:g,className:a,labelOffsetX:d,labelOffsetY:m,inertia:C,sourceStrategy:y})}f.__name(Q,"addNode");function tt(o,r,e=!1,g,a){k.addLink({source:o,target:r,dashed:e,label:g,flow:a})}f.__name(tt,"addLink");function et(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}f.__name(et,"addTrend");function at(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}f.__name(at,"addAnnotation");function rt(o,r,e){k.addNote({text:o,x:r,y:e})}f.__name(rt,"addNote");function ot(o,r,e){k.addAccelerator({name:o,x:r,y:e})}f.__name(ot,"addAccelerator");function nt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}f.__name(nt,"addDeaccelerator");function st(o,r){k.setAnnotationsBox(o,r)}f.__name(st,"setAnnotationsBox");function it(o,r){k.setSize(o,r)}f.__name(it,"setSize");function dt(o){k.startPipeline(o)}f.__name(dt,"startPipeline");function lt(o,r){k.addPipelineComponent(o,r)}f.__name(lt,"addPipelineComponent");function ct(o){k.setAxes(o)}f.__name(ct,"updateAxes");function pt(o){return k.getNode(o)}f.__name(pt,"getNode");function ft(o){return k.resolveNodeId(o)}f.__name(ft,"resolveNodeId");function ht(){return k.build()}f.__name(ht,"getWardleyData");function gt(){k.clear(),f.clear()}f.__name(gt,"clear");var Nt={getConfig:K,addNode:Q,addLink:tt,addTrend:et,addAnnotation:at,addNote:rt,addAccelerator:ot,addDeaccelerator:nt,setAnnotationsBox:st,setSize:it,startPipeline:dt,addPipelineComponent:lt,updateAxes:ct,getNode:pt,resolveNodeId:ft,getWardleyData:ht,clear:gt,setAccTitle:f.setAccTitle,getAccTitle:f.getAccTitle,setDiagramTitle:f.setDiagramTitle,getDiagramTitle:f.getDiagramTitle,getAccDescription:f.getAccDescription,setAccDescription:f.setAccDescription},Tt=["Genesis","Custom Built","Product","Commodity"],At=f.__name(()=>{const{themeVariables:o}=f.getConfig2();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),Lt=f.__name(()=>{const o=f.getConfig2()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),zt=f.__name((o,r,e,g)=>{f.log.debug(`Rendering Wardley map
2
2
  `+o);const a=Lt(),d=At(),m=a.nodeRadius*1.6,C=g.db,y=C.getWardleyData(),B=C.getDiagramTitle(),S=y.size?.width??a.width,b=y.size?.height??a.height,E=f.selectSvgElement(r);E.selectAll("*").remove(),f.configureSvgSize(E,b,S,a.useMaxWidth),E.attr("viewBox",`0 0 ${S} ${b}`);const v=E.append("g").attr("class","wardley-map"),G=E.append("defs");G.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),G.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),G.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const Y=S-a.padding*2,I=b-a.padding*2;B&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(B);const N=f.__name(t=>a.padding+t/100*Y,"projectX"),T=f.__name(t=>b-a.padding-t/100*I,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const xt=y.axes.xLabel??"Evolution",yt=y.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+Y/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(xt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+I/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+I/2})`).text(yt);const F=y.axes.stages&&y.axes.stages.length>0?y.axes.stages:Tt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=y.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],h=a.padding+l.start*Y,x=a.padding+l.end*Y,u=(h+x)/2;p>0&&t.append("line").attr("x1",h).attr("x2",h).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",u).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+Y*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-I*n).attr("y2",b-a.padding-I*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(y.nodes.forEach(t=>{c.set(t.id,{x:N(t.x),y:T(t.y),node:t})}),y.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");y.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:y.nodes.find(u=>u.id===x)})).filter(x=>x.pos&&x.node).sort((x,u)=>x.node.x-u.node.x);for(let x=0;x<i.length-1;x++){const u=i[x],w=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",u.pos.x).attr("y1",u.pos.y).attr("x2",w.pos.x).attr("y2",w.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,h=0;if(n.componentIds.forEach(x=>{const u=c.get(x);u&&(p=Math.min(p,u.x),l=Math.max(l,u.x),h=u.y)}),p!==1/0&&l!==-1/0){const u=a.nodeRadius*4,w=h-u/2,P=c.get(n.nodeId);if(P){const _=(p+l)/2;P.x=_,P.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",w).attr("width",l-p+30).attr("height",u).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const j=v.append("g").attr("class","wardley-links"),V=new Map;y.pipelines.forEach(t=>{V.set(t.nodeId,new Set(t.componentIds))});const Z=y.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||V.get(t.target)?.has(t.source)));j.selectAll("line").data(Z).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=y.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,h=n.y-s.y,x=Math.sqrt(l*l+h*h);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=y.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,h=n.y-s.y,x=Math.sqrt(l*l+h*h);return s.y+h/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=y.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,h=s.y-n.y,x=Math.sqrt(l*l+h*h);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=y.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,h=s.y-n.y,x=Math.sqrt(l*l+h*h);return n.y+h/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),j.selectAll("text").data(Z.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,h=Math.sqrt(l*l+p*p),x=8,u=p/h;return i+u*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,h=Math.sqrt(p*p+l*l),x=8,u=-p/h;return i+u*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,h=n.y-s.y,x=Math.sqrt(l*l+h*h),u=8,w=h/x,P=-l/x,_=i+w*u,R=p+P*u;let z=Math.atan2(h,l)*180/Math.PI;return(z>90||z<-90)&&(z+=180),`rotate(${z} ${_} ${R})`}).text(t=>t.label);const ut=v.append("g").attr("class","wardley-trends"),mt=y.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=N(t.targetX),i=T(t.targetY),p=n-s.x,l=i-s.y,h=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,u=h>x?n-p/h*x:n,w=h>x?i-l/h*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:u,adjustedY2:w}}).filter(t=>t!==null);ut.selectAll("line").data(mt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(y.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const A=M.filter(t=>t.sourceStrategy==="market");A.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const q=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(A.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),A.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),A.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),A.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),A.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),A.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?m/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?m:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?m/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?m:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),y.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(y.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:N(i.x),y:T(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),y.annotationsBox){let s=N(y.annotationsBox.x),n=T(y.annotationsBox.y);const i=10,p=16,l=11,h=t.append("g").attr("class","wardley-annotations-box"),x=[...y.annotations].filter(w=>w.text).sort((w,P)=>w.number-P.number),u=[];if(x.forEach((w,P)=>{const _=h.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);u.push(_)}),u.length>0){let w=0,P=0;u.forEach(H=>{const W=H.node(),$t=W.getComputedTextLength();w=Math.max(w,$t);const vt=W.getBBox();P=Math.max(P,vt.height)});const _=w+i*2+105,R=x.length*p+i*2+P/2,z=a.padding,wt=S-a.padding-_,kt=a.padding,bt=b-a.padding-R;s=Math.max(z,Math.min(s,wt)),n=Math.max(kt,Math.min(n,bt)),u.forEach((H,W)=>{H.attr("x",s+i).attr("y",n+i+(W+1)*p)}),h.insert("rect","text").attr("x",s).attr("y",n).attr("width",_).attr("height",R).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(y.notes.length>0){const t=v.append("g").attr("class","wardley-notes");y.notes.forEach(s=>{const n=N(s.x),i=T(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(y.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");y.accelerators.forEach(s=>{const n=N(s.x),i=T(s.y),p=60,l=30,h=20,x=`
3
3
  M ${n} ${i-l/2}
4
4
  L ${n+p-h} ${i-l/2}