@smarter.sh/ui-chat 0.8.0 → 0.9.1

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 (141) hide show
  1. package/README.md +328 -107
  2. package/dist/embed/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  3. package/dist/embed/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  4. package/dist/embed/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  5. package/dist/embed/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  6. package/dist/embed/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  7. package/dist/embed/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  8. package/dist/embed/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  9. package/dist/embed/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  10. package/dist/embed/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  11. package/dist/embed/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  12. package/dist/embed/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  13. package/dist/embed/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  14. package/dist/embed/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  15. package/dist/embed/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  16. package/dist/embed/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  17. package/dist/embed/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  18. package/dist/embed/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  19. package/dist/embed/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  20. package/dist/embed/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  21. package/dist/embed/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  22. package/dist/embed/mermaid/abnfDiagram-VCTEODGH-CGtrctwA.js +89 -0
  23. package/dist/embed/mermaid/arc-DlzgcAgU.js +82 -0
  24. package/dist/embed/mermaid/architecture-7GRP2DOG-D66ObL4C.js +3 -0
  25. package/dist/embed/mermaid/architectureDiagram-5GKGNRK7-CgMNWdVn.js +4148 -0
  26. package/dist/embed/mermaid/array-CApNbSU9.js +6 -0
  27. package/dist/embed/mermaid/blockDiagram-I7D4REHJ-Q2YOF2Nl.js +1922 -0
  28. package/dist/embed/mermaid/c4Diagram-7LVT6UL2-DI7_cX7n.js +3010 -0
  29. package/dist/embed/mermaid/channel-CxRe6Ync.js +5 -0
  30. package/dist/embed/mermaid/chunk-2E4U76K2-DPc-jkQd.js +348 -0
  31. package/dist/embed/mermaid/chunk-2Q5K7J3B-C1pX24ft.js +15 -0
  32. package/dist/embed/mermaid/chunk-4HAMMTFA-DY_JmJA2.js +4188 -0
  33. package/dist/embed/mermaid/chunk-5VM5RSS4-BFskf6Qk.js +5 -0
  34. package/dist/embed/mermaid/chunk-75Z2AOVW-BugNeXEB.js +1330 -0
  35. package/dist/embed/mermaid/chunk-CLGD4ZFX-BOKCMNQY.js +14 -0
  36. package/dist/embed/mermaid/chunk-DU6HZSFF-C09wkxIu.js +3897 -0
  37. package/dist/embed/mermaid/chunk-F27PBJKO-C69L38at.js +61 -0
  38. package/dist/embed/mermaid/chunk-FOHPRMQF-CLLDWcGe.js +21458 -0
  39. package/dist/embed/mermaid/chunk-GMAD6QVW-NxqJJwNT.js +1863 -0
  40. package/dist/embed/mermaid/chunk-GVQU2GXP-D4WoQcNg.js +37 -0
  41. package/dist/embed/mermaid/chunk-IMKFNOWR-DE94S7XC.js +2042 -0
  42. package/dist/embed/mermaid/chunk-JWPE2WC7-BGVSGRTC.js +8 -0
  43. package/dist/embed/mermaid/chunk-L3NEJ4N5-CqdtyK-9.js +245 -0
  44. package/dist/embed/mermaid/chunk-LNGE3PJU-DqC_0r8u.js +1521 -0
  45. package/dist/embed/mermaid/chunk-OSK3NFVY-B1KjtHOy.js +672 -0
  46. package/dist/embed/mermaid/chunk-P2QGCYS3-CP_jp-eQ.js +67 -0
  47. package/dist/embed/mermaid/chunk-POPQ4Y6H-CSwFrYKY.js +26 -0
  48. package/dist/embed/mermaid/chunk-PWAF6VOD-qhXJD1mO.js +275 -0
  49. package/dist/embed/mermaid/chunk-SHT3W25Y-a5ik03bR.js +4183 -0
  50. package/dist/embed/mermaid/chunk-SVP7TREG-67QXjHHx.js +490 -0
  51. package/dist/embed/mermaid/chunk-TICWLB2K-DHg0COuy.js +3357 -0
  52. package/dist/embed/mermaid/chunk-TLUHSLCS-BwEhuf5d.js +59 -0
  53. package/dist/embed/mermaid/chunk-XXDRQBXY-BJjzBm4h.js +9 -0
  54. package/dist/embed/mermaid/chunk-Y2CYZVJY-BAad7w_K.js +12 -0
  55. package/dist/embed/mermaid/classDiagram-ZZMXUADV-BlIPVBOk.js +30 -0
  56. package/dist/embed/mermaid/classDiagram-v2-VYDZK3BY-BavoJkSK.js +30 -0
  57. package/dist/embed/mermaid/cose-bilkent-JH36ORCC-Cx3-7Rca.js +2248 -0
  58. package/dist/embed/mermaid/cynefin-OW5HDTMX-Cfa1-YuM.js +3 -0
  59. package/dist/embed/mermaid/cynefinDiagram-5FMLGOSQ-CsV1I6A_.js +355 -0
  60. package/dist/embed/mermaid/cytoscape.esm-CLcfvFJ6.js +18145 -0
  61. package/dist/embed/mermaid/dagre-COnXXJRS.js +1934 -0
  62. package/dist/embed/mermaid/dagre-GXQ25YYZ-BzZWpDkI.js +425 -0
  63. package/dist/embed/mermaid/defaultLocale-CQ4Nl88y.js +198 -0
  64. package/dist/embed/mermaid/diagram-S7CK7UJ4-CShsH_ul.js +301 -0
  65. package/dist/embed/mermaid/diagram-UQ7AKVKN-Bb0mFpt2.js +214 -0
  66. package/dist/embed/mermaid/diagram-VSXAHHWV-DUq5PKM1.js +432 -0
  67. package/dist/embed/mermaid/diagram-VX7I27RA-Co2uyrw2.js +527 -0
  68. package/dist/embed/mermaid/diagram-Z3DM3KII-CTdPPkZs.js +134 -0
  69. package/dist/embed/mermaid/dist-CjR2JtV-.js +59 -0
  70. package/dist/embed/mermaid/ebnfDiagram-PWID7BFC-CAQNT7Vt.js +100 -0
  71. package/dist/embed/mermaid/erDiagram-RLTQ6QDP-DluYOFtk.js +1966 -0
  72. package/dist/embed/mermaid/eventmodeling-NTZA5JFV-DFSPvGS4.js +3 -0
  73. package/dist/embed/mermaid/flowDiagram-HODETNUW-BKXSV8xL.js +17 -0
  74. package/dist/embed/mermaid/ganttDiagram-EL5Y4UJY-D2BBzcpY.js +3072 -0
  75. package/dist/embed/mermaid/gitGraph-4MIJSDKK-BTHPY7Tg.js +3 -0
  76. package/dist/embed/mermaid/gitGraphDiagram-WWUBYQGX-BzZ3sE3s.js +733 -0
  77. package/dist/embed/mermaid/graphlib-D8JS7ydf.js +1267 -0
  78. package/dist/embed/mermaid/info-A6RAGUB7-4Mm0OyB8.js +3 -0
  79. package/dist/embed/mermaid/infoDiagram-27XIBGKW-DcbKIVvy.js +20 -0
  80. package/dist/embed/mermaid/init-CFNf60QB.js +13 -0
  81. package/dist/embed/mermaid/ishikawaDiagram-5VMMS53U-B6q3rvke.js +719 -0
  82. package/dist/embed/mermaid/journeyDiagram-3NMN7TZE-CDDY2Xma.js +884 -0
  83. package/dist/embed/mermaid/kanban-definition-UXKFOSKX-w7v22sq3.js +976 -0
  84. package/dist/embed/mermaid/katex-BqirFtOb.js +21977 -0
  85. package/dist/embed/mermaid/line-DoUHpRzu.js +34 -0
  86. package/dist/embed/mermaid/linear-CLS335Sc.js +287 -0
  87. package/dist/embed/mermaid/mermaid-parser.core-BoI6HFCg.js +638 -0
  88. package/dist/embed/mermaid/mermaid.js +1092 -0
  89. package/dist/embed/mermaid/mindmap-definition-YA3MSWOX-1bs_tKMD.js +1006 -0
  90. package/dist/embed/mermaid/ordinal-Da0rnhxr.js +65 -0
  91. package/dist/embed/mermaid/packet-AYTQ26CC-BAodtDR3.js +3 -0
  92. package/dist/embed/mermaid/path-hN9ktzbr.js +84 -0
  93. package/dist/embed/mermaid/pegDiagram-XKGWAZYB-DsrQs7Qo.js +94 -0
  94. package/dist/embed/mermaid/pie-WAS4IAKB-Yw-9-2EN.js +3 -0
  95. package/dist/embed/mermaid/pieDiagram-E7YTZNPT-BvkRs6Xl.js +203 -0
  96. package/dist/embed/mermaid/quadrantDiagram-AXDQQJYC-DDSDkbcq.js +2001 -0
  97. package/dist/embed/mermaid/radar-RG4KPBEZ-BtjjaEPe.js +3 -0
  98. package/dist/embed/mermaid/railroad-74A4TZTK-Du7TjeaO.js +3 -0
  99. package/dist/embed/mermaid/railroad-abnf-HS5TGJTU-D3flpty6.js +3 -0
  100. package/dist/embed/mermaid/railroad-ebnf-LZEXJU2U-DWpeYHWC.js +3 -0
  101. package/dist/embed/mermaid/railroad-peg-WCYAUIDC-DKiyz9fh.js +3 -0
  102. package/dist/embed/mermaid/railroadDiagram-O6MQD6OU-T__Cw3ez.js +76 -0
  103. package/dist/embed/mermaid/requirementDiagram-BXWQKSXE-ADir8pgL.js +2224 -0
  104. package/dist/embed/mermaid/rough.esm-XhrPyaQA.js +1361 -0
  105. package/dist/embed/mermaid/sankeyDiagram-P5KCCOFB-YTgoqhmd.js +972 -0
  106. package/dist/embed/mermaid/sequenceDiagram-WJ2MYXX4-Dpn6ph0n.js +4156 -0
  107. package/dist/embed/mermaid/sizeCapture-INFHLROL-C2wlw8KF.js +46 -0
  108. package/dist/embed/mermaid/src-CH4XuqUv.js +2147 -0
  109. package/dist/embed/mermaid/stateDiagram-D77RDMKH-V_8TbftV.js +220 -0
  110. package/dist/embed/mermaid/stateDiagram-v2-MP3YSRHH-us7SNDcU.js +30 -0
  111. package/dist/embed/mermaid/swimlanes-42K2YHIH-wzihXC1V.js +4979 -0
  112. package/dist/embed/mermaid/swimlanesDiagram-VR7AAH4N-BML-4Vp0.js +31 -0
  113. package/dist/embed/mermaid/timeline-definition-24CTP7MA-C3BzP6RA.js +1069 -0
  114. package/dist/embed/mermaid/treeView-Q6P3EWNA-Ba1dLcIR.js +3 -0
  115. package/dist/embed/mermaid/treemap-WGGIJYW6-D9G3ZsOW.js +3 -0
  116. package/dist/embed/mermaid/vennDiagram-4TSXK5OY-Cq1JumSe.js +1880 -0
  117. package/dist/embed/mermaid/wardley-WFR3VGLG-gAtip5-G.js +3 -0
  118. package/dist/embed/mermaid/wardleyDiagram-VM6X3IG4-HtzestuU.js +645 -0
  119. package/dist/embed/mermaid/xychartDiagram-S5SC5T6Z-BE-W0B_D.js +2210 -0
  120. package/dist/embed.js +903 -0
  121. package/dist/embed.js.map +1 -0
  122. package/dist/smarter-chat-library.es.js +1592 -1583
  123. package/dist/smarter-chat-library.es.js.map +1 -1
  124. package/dist/smarter-chat-library.umd.js +43 -43
  125. package/dist/smarter-chat-library.umd.js.map +1 -1
  126. package/dist/types/src/components/SmarterChat/Component.d.ts +1 -1
  127. package/dist/types/src/contract.gen.d.ts +41 -26
  128. package/dist/types/src/embed/EmbedApp.d.ts +10 -0
  129. package/dist/types/src/embed/assets.d.ts +7 -0
  130. package/dist/types/src/embed/autoMount.d.ts +18 -0
  131. package/dist/types/src/embed/css.d.ts +15 -0
  132. package/dist/types/src/embed/element.d.ts +19 -0
  133. package/dist/types/src/embed/index.d.ts +17 -0
  134. package/dist/types/src/embed/mermaid.d.ts +2 -0
  135. package/dist/types/src/embed/mermaidImport.d.ts +1 -0
  136. package/dist/types/src/embed/options.d.ts +69 -0
  137. package/dist/types/src/lib/cookie.d.ts +4 -3
  138. package/dist/types/src/lib/mermaidImport.d.ts +8 -0
  139. package/dist/types/src/types.d.ts +7 -0
  140. package/dist/ui-chat.css +1 -1
  141. package/package.json +10 -4
@@ -0,0 +1,8 @@
1
+ import { n as e } from "./chunk-Y2CYZVJY-BAad7w_K.js";
2
+ //#region ../../node_modules/mermaid/dist/chunks/mermaid.core/chunk-JWPE2WC7.mjs
3
+ function t(e, t) {
4
+ e.accDescr && t.setAccDescription?.(e.accDescr), e.accTitle && t.setAccTitle?.(e.accTitle), e.title && t.setDiagramTitle?.(e.title);
5
+ }
6
+ e(t, "populateCommonDb");
7
+ //#endregion
8
+ export { t };
@@ -0,0 +1,245 @@
1
+ import { m as e, p as t } from "./src-CH4XuqUv.js";
2
+ import { n } from "./chunk-Y2CYZVJY-BAad7w_K.js";
3
+ import { T as r, g as i, x as a } from "./chunk-DU6HZSFF-C09wkxIu.js";
4
+ import { a as o, i as s } from "./chunk-P2QGCYS3-CP_jp-eQ.js";
5
+ import { n as c } from "./chunk-GMAD6QVW-NxqJJwNT.js";
6
+ import { t as l } from "./rough.esm-XhrPyaQA.js";
7
+ import { n as u, r as d, t as f } from "./chunk-4HAMMTFA-DY_JmJA2.js";
8
+ import { n as p } from "./chunk-GVQU2GXP-D4WoQcNg.js";
9
+ //#region ../../node_modules/mermaid/dist/chunks/mermaid.core/chunk-L3NEJ4N5.mjs
10
+ var m = /* @__PURE__ */ n(async (n, r) => {
11
+ let u = a(), { themeVariables: f, handDrawnSeed: p } = u, { clusterBkg: m, clusterBorder: h } = f, g = h, { labelStyles: _, nodeStyles: v, borderStyles: y, backgroundStyles: b } = s(r), x = n.insert("g").attr("class", "cluster swimlane " + (r.cssClasses || "")).attr("id", r.id).attr("data-id", r.id).attr("data-et", "cluster").attr("data-look", r.look), S = i(u.flowchart.htmlLabels), C = r.direction === "LR", w = x.insert("g").attr("class", "cluster-label swimlane-label"), T = await c(w, r.label, {
12
+ style: r.labelStyle,
13
+ useHtmlLabels: S,
14
+ isNode: !0,
15
+ width: r.width
16
+ }), E = T.getBBox();
17
+ if (S) {
18
+ let e = T.children[0], n = t(T);
19
+ E = e.getBoundingClientRect(), n.attr("width", E.width), n.attr("height", E.height);
20
+ }
21
+ let D = r.padding ?? 0, O = r.width <= E.width + D ? E.width + D : r.width;
22
+ r.diff = r.width <= E.width + D ? (O - r.width) / 2 - D : -D;
23
+ let k = r.height, A = r.y - k / 2, j = r.y + k / 2, M = r.x - O / 2, N = r.swimlaneContentTop === void 0 ? A + k / 3 : r.swimlaneContentTop, P = C ? 4 : 0, F = E.height + 2 * P, I, L;
24
+ if (C) {
25
+ let e = Math.max(F, E.height + 2 * P), t = M + e, n = Math.max(0, O - e);
26
+ if (r.look === "handDrawn") {
27
+ let i = l.svg(x), a = o(r, {
28
+ roughness: .7,
29
+ fill: m,
30
+ stroke: g,
31
+ fillWeight: 3,
32
+ seed: p
33
+ }), s = o(r, {
34
+ roughness: .7,
35
+ fill: "none",
36
+ stroke: g,
37
+ seed: p
38
+ }), c = i.rectangle(M, A, e, k, a);
39
+ I = x.insert(() => c, ":first-child");
40
+ let u = i.rectangle(t, A, n, k, s);
41
+ L = x.insert(() => u, ":first-child"), I.select("path:nth-child(2)").attr("style", y.join(";")), I.select("path").attr("style", b.join(";").replace("fill", "stroke"));
42
+ } else I = x.insert("rect", ":first-child"), L = x.insert("rect", ":first-child"), I.attr("class", "swimlane-title").attr("style", v).attr("x", M).attr("y", A).attr("width", e).attr("height", k).attr("fill", m).attr("stroke", g), L.attr("class", "swimlane-body").attr("style", v).attr("x", t).attr("y", A).attr("width", n).attr("height", k).attr("fill", "none").attr("stroke", g);
43
+ let i = M + e / 2, a = r.y;
44
+ w.attr("transform", `translate(${i}, ${a}) rotate(-90) translate(${-E.width / 2}, ${-E.height / 2})`);
45
+ } else {
46
+ let e = Math.max(0, N - A), t = Math.min(F, e), n = A + t, i = Math.max(0, j - n), a = r.x - O / 2;
47
+ if (r.look === "handDrawn") {
48
+ let e = l.svg(x), s = o(r, {
49
+ roughness: .7,
50
+ fill: m,
51
+ stroke: g,
52
+ fillWeight: 3,
53
+ seed: p
54
+ }), c = o(r, {
55
+ roughness: .7,
56
+ fill: "none",
57
+ stroke: g,
58
+ seed: p
59
+ }), u = e.rectangle(a, A, O, t, s);
60
+ I = x.insert(() => u, ":first-child");
61
+ let d = e.rectangle(a, n, O, i, c);
62
+ L = x.insert(() => d, ":first-child"), I.select("path:nth-child(2)").attr("style", y.join(";")), I.select("path").attr("style", b.join(";").replace("fill", "stroke"));
63
+ } else I = x.insert("rect", ":first-child"), L = x.insert("rect", ":first-child"), I.attr("class", "swimlane-title").attr("style", v).attr("x", a).attr("y", A).attr("width", O).attr("height", t).attr("fill", m).attr("stroke", g), L.attr("class", "swimlane-body").attr("style", v).attr("x", a).attr("y", n).attr("width", O).attr("height", i).attr("fill", "none").attr("stroke", g);
64
+ let s = r.x - E.width / 2, c = A + (t - E.height) / 2;
65
+ w.attr("transform", `translate(${s}, ${c})`);
66
+ }
67
+ if (e.trace("Swimlane data ", r, JSON.stringify(r)), _) {
68
+ let e = w.select("span");
69
+ e && e.attr("style", _);
70
+ }
71
+ return r.offsetX = 0, r.width = O, r.height = k, r.offsetY = E.height - D / 2, r.intersect = function(e) {
72
+ return d(r, e);
73
+ }, {
74
+ cluster: x,
75
+ labelBBox: E
76
+ };
77
+ }, "swimlane"), h = /* @__PURE__ */ n(async (n, i) => {
78
+ e.info("Creating subgraph rect for ", i.id, i);
79
+ let m = a(), { themeVariables: h, handDrawnSeed: g } = m, { clusterBkg: _, clusterBorder: v } = h, { labelStyles: y, nodeStyles: b, borderStyles: x, backgroundStyles: S } = s(i), C = n.insert("g").attr("class", "cluster " + i.cssClasses).attr("id", i.domId).attr("data-look", i.look), w = r(m), T = C.insert("g").attr("class", "cluster-label "), E;
80
+ E = i.labelType === "markdown" ? await c(T, i.label, {
81
+ style: i.labelStyle,
82
+ useHtmlLabels: w,
83
+ isNode: !0,
84
+ width: i.width
85
+ }) : await f(T, i.label, i.labelStyle || "", !1, !0);
86
+ let D = E.getBBox();
87
+ if (r(m)) {
88
+ let e = E.children[0], n = t(E);
89
+ D = e.getBoundingClientRect(), n.attr("width", D.width), n.attr("height", D.height);
90
+ }
91
+ let O = i.width <= D.width + i.padding ? D.width + i.padding : i.width;
92
+ i.diff = i.width <= D.width + i.padding ? (O - i.width) / 2 - i.padding : -i.padding;
93
+ let k = i.height, A = i.x - O / 2, j = i.y - k / 2;
94
+ e.trace("Data ", i, JSON.stringify(i));
95
+ let M;
96
+ if (i.look === "handDrawn") {
97
+ let t = l.svg(C), n = o(i, {
98
+ roughness: .7,
99
+ fill: _,
100
+ stroke: v,
101
+ fillWeight: 3,
102
+ seed: g
103
+ }), r = t.path(u(A, j, O, k, 0), n);
104
+ M = C.insert(() => (e.debug("Rough node insert CXC", r), r), ":first-child"), M.select("path:nth-child(2)").attr("style", x.join(";")), M.select("path").attr("style", S.join(";").replace("fill", "stroke"));
105
+ } else M = C.insert("rect", ":first-child"), M.attr("style", b).attr("rx", i.rx).attr("ry", i.ry).attr("x", A).attr("y", j).attr("width", O).attr("height", k);
106
+ let { subGraphTitleTopMargin: N } = p(m);
107
+ if (T.attr("transform", `translate(${i.x - D.width / 2}, ${i.y - i.height / 2 + N})`), y) {
108
+ let e = T.select("span");
109
+ e && e.attr("style", y);
110
+ }
111
+ let P = M.node().getBBox();
112
+ return i.offsetX = 0, i.width = P.width, i.height = P.height, i.offsetY = D.height - i.padding / 2, i.intersect = function(e) {
113
+ return d(i, e);
114
+ }, {
115
+ cluster: C,
116
+ labelBBox: D
117
+ };
118
+ }, "rect"), g = {
119
+ rect: h,
120
+ squareRect: h,
121
+ roundedWithTitle: /* @__PURE__ */ n(async (e, n) => {
122
+ let i = a(), { themeVariables: o, handDrawnSeed: s } = i, { altBackground: c, compositeBackground: p, compositeTitleBackground: m, nodeBorder: h } = o, g = e.insert("g").attr("class", n.cssClasses).attr("id", n.domId).attr("data-id", n.id).attr("data-look", n.look), _ = g.insert("g", ":first-child"), v = g.insert("g").attr("class", "cluster-label"), y = g.append("rect"), b = await f(v, n.label, n.labelStyle, void 0, !0), x = b.getBBox();
123
+ if (r(i)) {
124
+ let e = b.children[0], n = t(b);
125
+ x = e.getBoundingClientRect(), n.attr("width", x.width), n.attr("height", x.height);
126
+ }
127
+ let S = 0 * n.padding, C = S / 2, w = (n.width <= x.width + n.padding ? x.width + n.padding : n.width) + S;
128
+ n.diff = n.width <= x.width + n.padding ? (w - n.width) / 2 - n.padding : -n.padding;
129
+ let T = n.height + S, E = n.height + S - x.height - 6, D = n.x - w / 2, O = n.y - T / 2;
130
+ n.width = w;
131
+ let k = n.y - n.height / 2 - C + x.height + 2, A;
132
+ if (n.look === "handDrawn") {
133
+ let e = n.cssClasses.includes("statediagram-cluster-alt"), t = l.svg(g), r = n.rx || n.ry ? t.path(u(D, O, w, T, 10), {
134
+ roughness: .7,
135
+ fill: m,
136
+ fillStyle: "solid",
137
+ stroke: h,
138
+ seed: s
139
+ }) : t.rectangle(D, O, w, T, { seed: s });
140
+ A = g.insert(() => r, ":first-child");
141
+ let i = t.rectangle(D, k, w, E, {
142
+ fill: e ? c : p,
143
+ fillStyle: e ? "hachure" : "solid",
144
+ stroke: h,
145
+ seed: s
146
+ });
147
+ A = g.insert(() => r, ":first-child"), y = g.insert(() => i);
148
+ } else A = _.insert("rect", ":first-child"), A.attr("class", "outer").attr("x", D).attr("y", O).attr("width", w).attr("height", T).attr("data-look", n.look), y.attr("class", "inner").attr("x", D).attr("y", k).attr("width", w).attr("height", E);
149
+ return v.attr("transform", `translate(${n.x - x.width / 2}, ${O + 1 - (r(i) ? 0 : 3)})`), n.height = A.node().getBBox().height, n.offsetX = 0, n.offsetY = x.height - n.padding / 2, n.labelBBox = x, n.intersect = function(e) {
150
+ return d(n, e);
151
+ }, {
152
+ cluster: g,
153
+ labelBBox: x
154
+ };
155
+ }, "roundedWithTitle"),
156
+ noteGroup: /* @__PURE__ */ n((e, t) => {
157
+ let n = e.insert("g").attr("class", "note-cluster").attr("id", t.domId), r = n.insert("rect", ":first-child"), i = 0 * t.padding, a = i / 2;
158
+ r.attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - t.width / 2 - a).attr("y", t.y - t.height / 2 - a).attr("width", t.width + i).attr("height", t.height + i).attr("fill", "none");
159
+ let o = r.node().getBBox();
160
+ return t.width = o.width, t.height = o.height, t.intersect = function(e) {
161
+ return d(t, e);
162
+ }, {
163
+ cluster: n,
164
+ labelBBox: {
165
+ width: 0,
166
+ height: 0
167
+ }
168
+ };
169
+ }, "noteGroup"),
170
+ divider: /* @__PURE__ */ n((e, t) => {
171
+ let { themeVariables: n, handDrawnSeed: r } = a(), { nodeBorder: i } = n, o = e.insert("g").attr("class", t.cssClasses).attr("id", t.domId).attr("data-look", t.look), s = o.insert("g", ":first-child"), c = 0 * t.padding, u = t.width + c;
172
+ t.diff = -t.padding;
173
+ let f = t.height + c, p = t.x - u / 2, m = t.y - f / 2;
174
+ t.width = u;
175
+ let h;
176
+ if (t.look === "handDrawn") {
177
+ let e = l.svg(o).rectangle(p, m, u, f, {
178
+ fill: "lightgrey",
179
+ roughness: .5,
180
+ strokeLineDash: [5],
181
+ stroke: i,
182
+ seed: r
183
+ });
184
+ h = o.insert(() => e, ":first-child");
185
+ } else {
186
+ h = s.insert("rect", ":first-child");
187
+ let e = "outer";
188
+ e = (t.look, "divider"), h.attr("class", e).attr("x", p).attr("y", m).attr("width", u).attr("height", f).attr("data-look", t.look);
189
+ }
190
+ return t.height = h.node().getBBox().height, t.offsetX = 0, t.offsetY = 0, t.intersect = function(e) {
191
+ return d(t, e);
192
+ }, {
193
+ cluster: o,
194
+ labelBBox: {}
195
+ };
196
+ }, "divider"),
197
+ kanbanSection: /* @__PURE__ */ n(async (n, i) => {
198
+ e.info("Creating subgraph rect for ", i.id, i);
199
+ let f = a(), { themeVariables: m, handDrawnSeed: h } = f, { clusterBkg: g, clusterBorder: _ } = m, { labelStyles: v, nodeStyles: y, borderStyles: b, backgroundStyles: x } = s(i), S = n.insert("g").attr("class", "cluster " + i.cssClasses).attr("id", i.domId).attr("data-look", i.look), C = r(f), w = S.insert("g").attr("class", "cluster-label "), T = await c(w, i.label, {
200
+ style: i.labelStyle,
201
+ useHtmlLabels: C,
202
+ isNode: !0,
203
+ width: i.width
204
+ }), E = T.getBBox();
205
+ if (r(f)) {
206
+ let e = T.children[0], n = t(T);
207
+ E = e.getBoundingClientRect(), n.attr("width", E.width), n.attr("height", E.height);
208
+ }
209
+ let D = i.width <= E.width + i.padding ? E.width + i.padding : i.width;
210
+ i.diff = i.width <= E.width + i.padding ? (D - i.width) / 2 - i.padding : -i.padding;
211
+ let O = i.height, k = i.x - D / 2, A = i.y - O / 2;
212
+ e.trace("Data ", i, JSON.stringify(i));
213
+ let j;
214
+ if (i.look === "handDrawn") {
215
+ let t = l.svg(S), n = o(i, {
216
+ roughness: .7,
217
+ fill: g,
218
+ stroke: _,
219
+ fillWeight: 4,
220
+ seed: h
221
+ }), r = t.path(u(k, A, D, O, i.rx), n);
222
+ j = S.insert(() => (e.debug("Rough node insert CXC", r), r), ":first-child"), j.select("path:nth-child(2)").attr("style", b.join(";")), j.select("path").attr("style", x.join(";").replace("fill", "stroke"));
223
+ } else j = S.insert("rect", ":first-child"), j.attr("style", y).attr("rx", i.rx).attr("ry", i.ry).attr("x", k).attr("y", A).attr("width", D).attr("height", O);
224
+ let { subGraphTitleTopMargin: M } = p(f);
225
+ if (w.attr("transform", `translate(${i.x - E.width / 2}, ${i.y - i.height / 2 + M})`), v) {
226
+ let e = w.select("span");
227
+ e && e.attr("style", v);
228
+ }
229
+ let N = j.node().getBBox();
230
+ return i.offsetX = 0, i.width = N.width, i.height = N.height, i.offsetY = E.height - i.padding / 2, i.intersect = function(e) {
231
+ return d(i, e);
232
+ }, {
233
+ cluster: S,
234
+ labelBBox: E
235
+ };
236
+ }, "kanbanSection"),
237
+ swimlane: m
238
+ }, _ = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ n(async (e, t) => {
239
+ let n = await g[t.shape || "rect"](e, t);
240
+ return _.set(t.id, n), n;
241
+ }, "insertCluster"), y = /* @__PURE__ */ n(() => {
242
+ _ = /* @__PURE__ */ new Map();
243
+ }, "clear");
244
+ //#endregion
245
+ export { v as n, y as t };