@layers-app/editor 0.7.45 → 0.7.46

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 (248) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.d.ts +5 -4
  3. package/dist/index.js +3 -3
  4. package/dist/{layers.dO_EcGnI.js → layers.B88sQYuh.js} +1 -1
  5. package/dist/layers.BgMykHnn.js +154 -0
  6. package/dist/{layers.BNRMPVpZ.js → layers.BtvuN20E.js} +8992 -9643
  7. package/dist/{layers.D7AwxDU3.js → layers.Cfvta__C.js} +1 -1
  8. package/dist/{layers.b9B2NY7n.js → layers.CsQlovyR.js} +2191 -1950
  9. package/dist/layers.Ct1ojjl3.js +1 -0
  10. package/dist/{layers.Cqs6IYG7.js → layers.Hq0pIRX3.js} +24 -24
  11. package/dist/layers.JT_kEFH5.js +129 -0
  12. package/dist/{layers.D10qGvZV.js → layers.NW1lST7i.js} +1 -1
  13. package/dist/layers.pwc3O6Es.js +261 -0
  14. package/package.json +2 -2
  15. package/dist/layers.-kgSm_ki.js +0 -1
  16. package/dist/layers.3H8YMnha.js +0 -960
  17. package/dist/layers.52famHy6.js +0 -1
  18. package/dist/layers.5E21elPk.js +0 -11
  19. package/dist/layers.5VXqgOA9.js +0 -1
  20. package/dist/layers.5VwU1GK1.js +0 -1268
  21. package/dist/layers.7JqFgE4-.js +0 -15
  22. package/dist/layers.7RI58uNS.js +0 -189
  23. package/dist/layers.7SpesQUg.js +0 -40
  24. package/dist/layers.7T_XLunz.js +0 -7
  25. package/dist/layers.8yVEuzdp.js +0 -2238
  26. package/dist/layers.9VxE_IU7.js +0 -6
  27. package/dist/layers.9pNaFvaX.js +0 -1
  28. package/dist/layers.AfB9ZNIL.js +0 -41
  29. package/dist/layers.AwYI6tm5.js +0 -39
  30. package/dist/layers.B-gjjpRn.js +0 -4
  31. package/dist/layers.B09AFCqn.js +0 -37
  32. package/dist/layers.B19hGmey.js +0 -1
  33. package/dist/layers.B1GZzJe5.js +0 -9
  34. package/dist/layers.B1MgjnS3.js +0 -129
  35. package/dist/layers.B3D4g2HH.js +0 -1
  36. package/dist/layers.B4--F20o.js +0 -10
  37. package/dist/layers.B47Vqw3v.js +0 -8
  38. package/dist/layers.B7K7JjK6.js +0 -1510
  39. package/dist/layers.B7Ogzw_9.js +0 -8
  40. package/dist/layers.B9DV1y8l.js +0 -437
  41. package/dist/layers.BAnldxOY.js +0 -61
  42. package/dist/layers.BAtv1CM7.js +0 -1
  43. package/dist/layers.BAuuzKLZ.js +0 -8
  44. package/dist/layers.BBkLpECL.js +0 -41
  45. package/dist/layers.BCFFwcHc.js +0 -8
  46. package/dist/layers.BElVFj7p.js +0 -10
  47. package/dist/layers.BHMGJS6y.js +0 -35
  48. package/dist/layers.BI0na45P.js +0 -39
  49. package/dist/layers.BIeVwYKL.js +0 -1
  50. package/dist/layers.BJDrjORS.js +0 -244
  51. package/dist/layers.BLVqWrAY.js +0 -10
  52. package/dist/layers.BLd2spTm.js +0 -1
  53. package/dist/layers.BMdx5wVt.js +0 -1126
  54. package/dist/layers.BPxT8M1-.js +0 -1619
  55. package/dist/layers.BQ47bUTF.js +0 -207
  56. package/dist/layers.BRQk8xaN.js +0 -52
  57. package/dist/layers.BSTBZrFn.js +0 -1
  58. package/dist/layers.BSd2L4Fm.js +0 -1
  59. package/dist/layers.BT4kTHz7.js +0 -51
  60. package/dist/layers.BaqpKN-R.js +0 -4
  61. package/dist/layers.BbCfEXyj.js +0 -55
  62. package/dist/layers.Bd6ZkqZ7.js +0 -40
  63. package/dist/layers.BdSYcWLH.js +0 -373
  64. package/dist/layers.Be33AcY-.js +0 -1
  65. package/dist/layers.BiIBffqS.js +0 -6
  66. package/dist/layers.BijSGz6X.js +0 -1
  67. package/dist/layers.BioO0hx9.js +0 -10
  68. package/dist/layers.BmE6NOAc.js +0 -41
  69. package/dist/layers.BoRU6N6t.js +0 -1225
  70. package/dist/layers.Boa1dqY1.js +0 -1
  71. package/dist/layers.BpilXLfW.js +0 -6
  72. package/dist/layers.BqYphIWO.js +0 -11
  73. package/dist/layers.Bs1NMWU2.js +0 -9
  74. package/dist/layers.BsKvPJTl.js +0 -10
  75. package/dist/layers.BsZCaVRX.js +0 -22
  76. package/dist/layers.BtKfezUO.js +0 -32
  77. package/dist/layers.BuVXf7W5.js +0 -42
  78. package/dist/layers.BwuvbB4R.js +0 -39
  79. package/dist/layers.BxiXm40L.js +0 -2
  80. package/dist/layers.By8sBqwN.js +0 -116
  81. package/dist/layers.BzGZoEEl.js +0 -10
  82. package/dist/layers.BzLeOHKa.js +0 -796
  83. package/dist/layers.Bz_dhG__.js +0 -39
  84. package/dist/layers.C1KqMlKg.js +0 -1
  85. package/dist/layers.C1i1mw5H.js +0 -39
  86. package/dist/layers.C2RYi1R4.js +0 -9
  87. package/dist/layers.C3J_d41Q.js +0 -1
  88. package/dist/layers.C4I8YhJZ.js +0 -5
  89. package/dist/layers.C5qL4bIV.js +0 -205
  90. package/dist/layers.C6aCloZA.js +0 -38
  91. package/dist/layers.C7u0t-7x.js +0 -1286
  92. package/dist/layers.C8_lu5UH.js +0 -23
  93. package/dist/layers.CAAFE7RU.js +0 -139
  94. package/dist/layers.CB2mPEGO.js +0 -1
  95. package/dist/layers.CBcgiYqo.js +0 -4
  96. package/dist/layers.CCDs3V-r.js +0 -8
  97. package/dist/layers.CDLOFVyh.js +0 -38
  98. package/dist/layers.CGbUBRpT.js +0 -271
  99. package/dist/layers.CHZsXQcr.js +0 -1
  100. package/dist/layers.CIugfnNi.js +0 -3
  101. package/dist/layers.CJjG7mfo.js +0 -122
  102. package/dist/layers.CJuRWDaP.js +0 -4
  103. package/dist/layers.CJx3dksh.js +0 -160
  104. package/dist/layers.CKG-SsM4.js +0 -11
  105. package/dist/layers.CKquYTab.js +0 -1
  106. package/dist/layers.CLVteXPI.js +0 -1
  107. package/dist/layers.CMSKPoUf.js +0 -1
  108. package/dist/layers.CMi59Dge.js +0 -10
  109. package/dist/layers.CPPXzJSG.js +0 -36
  110. package/dist/layers.CQZ1lodE.js +0 -7
  111. package/dist/layers.CQzsYN9o.js +0 -35
  112. package/dist/layers.CRHVKIv6.js +0 -6
  113. package/dist/layers.CSf6dhab.js +0 -6
  114. package/dist/layers.CWNyz0df.js +0 -772
  115. package/dist/layers.CZmZZ456.js +0 -1
  116. package/dist/layers.C_-XV7nk.js +0 -84
  117. package/dist/layers.C_IvrzZ3.js +0 -7
  118. package/dist/layers.Ca9pf4pJ.js +0 -76
  119. package/dist/layers.CbY0jZsb.js +0 -32
  120. package/dist/layers.Cc2rZkMQ.js +0 -1
  121. package/dist/layers.Cd9MRGMA.js +0 -7
  122. package/dist/layers.CexInYJw.js +0 -41
  123. package/dist/layers.CfUjnxzs.js +0 -36
  124. package/dist/layers.CfiPo1zZ.js +0 -10
  125. package/dist/layers.CftSz0vc.js +0 -1
  126. package/dist/layers.Cfv_lKzM.js +0 -10
  127. package/dist/layers.CgV5Zdgg.js +0 -41
  128. package/dist/layers.Cho0M3o5.js +0 -9
  129. package/dist/layers.CiGopRcm.js +0 -1
  130. package/dist/layers.Ck8FKMZm.js +0 -1
  131. package/dist/layers.ClN7_yK6.js +0 -5
  132. package/dist/layers.CmzeQrqF.js +0 -1
  133. package/dist/layers.Cnf9xVrU.js +0 -37
  134. package/dist/layers.Cq1FOBBz.js +0 -1089
  135. package/dist/layers.CqVTtuYm.js +0 -6
  136. package/dist/layers.CtVzpEDj.js +0 -6
  137. package/dist/layers.CvxLmsUR.js +0 -794
  138. package/dist/layers.Cx0MLYpT.js +0 -8
  139. package/dist/layers.CxBPsaPO.js +0 -39
  140. package/dist/layers.Cxm8b7tr.js +0 -39
  141. package/dist/layers.CyodKjZl.js +0 -8
  142. package/dist/layers.Cyzu9PKQ.js +0 -1
  143. package/dist/layers.Cz-fKIJ9.js +0 -36
  144. package/dist/layers.CzhydN8y.js +0 -1
  145. package/dist/layers.D-An1dnI.js +0 -14
  146. package/dist/layers.D-gA0YP7.js +0 -323
  147. package/dist/layers.D0q1Ima3.js +0 -8
  148. package/dist/layers.D0zn4_Mx.js +0 -1
  149. package/dist/layers.D2BUdbOP.js +0 -42
  150. package/dist/layers.D3R9NG6l.js +0 -36
  151. package/dist/layers.D4CL9IrO.js +0 -40
  152. package/dist/layers.D4T8fTcj.js +0 -1223
  153. package/dist/layers.D5rUZxAZ.js +0 -7
  154. package/dist/layers.D6_pquAg.js +0 -5
  155. package/dist/layers.D7jGxypv.js +0 -8
  156. package/dist/layers.D8mu5H7D.js +0 -40
  157. package/dist/layers.D9hwmTsT.js +0 -40
  158. package/dist/layers.DD85x_gL.js +0 -70
  159. package/dist/layers.DEafoGBP.js +0 -276
  160. package/dist/layers.DHntpDKc.js +0 -7
  161. package/dist/layers.DLMNg96A.js +0 -38
  162. package/dist/layers.DLofN-Lu.js +0 -8583
  163. package/dist/layers.DLwuMfdd.js +0 -84
  164. package/dist/layers.DMJTlnQs.js +0 -805
  165. package/dist/layers.DMkBISW1.js +0 -1
  166. package/dist/layers.DN9HoVxI.js +0 -18
  167. package/dist/layers.DN_7Oas1.js +0 -1034
  168. package/dist/layers.DO0LV8uH.js +0 -9
  169. package/dist/layers.DOGjj8Tb.js +0 -9
  170. package/dist/layers.DOU0CUz1.js +0 -9
  171. package/dist/layers.DOrgOHBr.js +0 -1
  172. package/dist/layers.DQ9XoPxf.js +0 -35
  173. package/dist/layers.DRJ1C2cQ.js +0 -907
  174. package/dist/layers.DW4YSj_5.js +0 -425
  175. package/dist/layers.DWZOB_8o.js +0 -48149
  176. package/dist/layers.DXraj6Ay.js +0 -806
  177. package/dist/layers.DZ1kwAKl.js +0 -41
  178. package/dist/layers.DZkyZJBC.js +0 -2966
  179. package/dist/layers.DasUia_A.js +0 -96
  180. package/dist/layers.DbLpb0GU.js +0 -5
  181. package/dist/layers.DbaKVP5e.js +0 -1
  182. package/dist/layers.Des3K8ZW.js +0 -257
  183. package/dist/layers.DfNV-1tq.js +0 -1
  184. package/dist/layers.Dg4R4jUk.js +0 -39
  185. package/dist/layers.DiMecbBf.js +0 -213
  186. package/dist/layers.DjUOC4st.js +0 -16
  187. package/dist/layers.Djrk43ut.js +0 -7
  188. package/dist/layers.DkU_CdUC.js +0 -1
  189. package/dist/layers.DmGGgMLi.js +0 -32
  190. package/dist/layers.DmWCogHY.js +0 -9
  191. package/dist/layers.DmrEOz9f.js +0 -40
  192. package/dist/layers.DoRJikzG.js +0 -33
  193. package/dist/layers.DoUFJmIZ.js +0 -2482
  194. package/dist/layers.DpOQ0SWe.js +0 -41
  195. package/dist/layers.DpTLOdAf.js +0 -2
  196. package/dist/layers.Dpx73nZ5.js +0 -37
  197. package/dist/layers.DrjRMlMd.js +0 -504
  198. package/dist/layers.DsfTLYHN.js +0 -295
  199. package/dist/layers.DtKC3G6H.js +0 -40
  200. package/dist/layers.DtOyZMno.js +0 -42
  201. package/dist/layers.Dv9gkxbE.js +0 -8
  202. package/dist/layers.DvK2O2ur.js +0 -21941
  203. package/dist/layers.DxA6ocdw.js +0 -70
  204. package/dist/layers.Dxw5Sd8s.js +0 -223
  205. package/dist/layers.Dy1naDTQ.js +0 -14
  206. package/dist/layers.Dy44TnYE.js +0 -32
  207. package/dist/layers.DyypgoWd.js +0 -39
  208. package/dist/layers.Dzcm8AcP.js +0 -1583
  209. package/dist/layers.F0RyUduP.js +0 -65
  210. package/dist/layers.F544mK7B.js +0 -41
  211. package/dist/layers.GAckqh_M.js +0 -40
  212. package/dist/layers.HUIM9HzL.js +0 -9
  213. package/dist/layers.HfEMdS1b.js +0 -10
  214. package/dist/layers.JWCLFILJ.js +0 -1
  215. package/dist/layers.MIHL5IVH.js +0 -7
  216. package/dist/layers.N0yl3_Na.js +0 -44
  217. package/dist/layers.NWhpAYeJ.js +0 -198
  218. package/dist/layers.Q2Aadwn9.js +0 -42
  219. package/dist/layers.R8mPlCA0.js +0 -261
  220. package/dist/layers.Vof2qGdM.js +0 -1088
  221. package/dist/layers.W_ErWU4y.js +0 -139
  222. package/dist/layers.WlID94Nt.js +0 -6
  223. package/dist/layers.YY1k0HSU.js +0 -1
  224. package/dist/layers.YjzlfOSN.js +0 -84
  225. package/dist/layers.ZX3I648e.js +0 -934
  226. package/dist/layers.b0h5ZBmD.js +0 -61
  227. package/dist/layers.bPp4y4tJ.js +0 -423
  228. package/dist/layers.bXo5QOKy.js +0 -5
  229. package/dist/layers.bkVgdJRL.js +0 -2
  230. package/dist/layers.d6r5nQuW.js +0 -11
  231. package/dist/layers.dl89lGbj.js +0 -33
  232. package/dist/layers.dswX3xs9.js +0 -1
  233. package/dist/layers.efcYaHoV.js +0 -32
  234. package/dist/layers.fLsBww_F.js +0 -1
  235. package/dist/layers.i1FJeF3y.js +0 -37
  236. package/dist/layers.jU6Z3i2q.js +0 -40
  237. package/dist/layers.k6Lqzy4i.js +0 -8
  238. package/dist/layers.lCpg7dOn.js +0 -21
  239. package/dist/layers.nVP4QDpX.js +0 -118
  240. package/dist/layers.obbaq0Iy.js +0 -42
  241. package/dist/layers.ooKeArD_.js +0 -34
  242. package/dist/layers.pXaWfCQn.js +0 -40
  243. package/dist/layers.pYlF8GU4.js +0 -32
  244. package/dist/layers.qhRg6f--.js +0 -11
  245. package/dist/layers.rNCWSOcA.js +0 -7
  246. package/dist/layers.t1lmm4vP.js +0 -13
  247. package/dist/layers.wEFFSFio.js +0 -21620
  248. package/dist/layers.zAXb9NBT.js +0 -9
@@ -1,794 +0,0 @@
1
- import { f as $, p as St } from "./layers.BMdx5wVt.js";
2
- import { d as x, a0 as G, l as M, g as D, Y as Lt, _ as V, $ as W, t as Z, V as tt, j as et } from "./layers.DLofN-Lu.js";
3
- import * as rt from "lodash-es";
4
- import { pick as _t, defaults as I } from "lodash-es";
5
- import { l as Et } from "./layers.D4T8fTcj.js";
6
- import { G as Tt } from "./layers.BJDrjORS.js";
7
- import { b as T, c as at, i as nt, d as _, e as st, g as it, f as Nt, a as At, s as Pt } from "./layers.B9DV1y8l.js";
8
- import { l as Ct } from "./layers.dl89lGbj.js";
9
- import "./layers.wEFFSFio.js";
10
- import "lodash-es/memoize.js";
11
- import "lodash-es/merge.js";
12
- import "lodash-es/isEmpty.js";
13
- function It(r) {
14
- if (!r.ok) throw new Error(r.status + " " + r.statusText);
15
- return r.text();
16
- }
17
- function Bt(r, e) {
18
- return fetch(r, e).then(It);
19
- }
20
- function Mt(r) {
21
- return (e, t) => Bt(e, t).then((n) => new DOMParser().parseFromString(n, r));
22
- }
23
- var Dt = Mt("image/svg+xml"), z = {
24
- normal: Gt,
25
- vee: Ot,
26
- undirected: Ut
27
- };
28
- function Rt(r) {
29
- z = r;
30
- }
31
- function Gt(r, e, t, n) {
32
- var a = r.append("marker").attr("id", e).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"), s = a.append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").style("stroke-width", 1).style("stroke-dasharray", "1,0");
33
- T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
34
- }
35
- function Ot(r, e, t, n) {
36
- var a = r.append("marker").attr("id", e).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"), s = a.append("path").attr("d", "M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width", 1).style("stroke-dasharray", "1,0");
37
- T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
38
- }
39
- function Ut(r, e, t, n) {
40
- var a = r.append("marker").attr("id", e).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"), s = a.append("path").attr("d", "M 0 5 L 10 5").style("stroke-width", 1).style("stroke-dasharray", "1,0");
41
- T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
42
- }
43
- function $t(r, e) {
44
- var t = r;
45
- return t.node().appendChild(e.label), T(t, e.labelStyle), t;
46
- }
47
- function Wt(r, e) {
48
- for (var t = r.append("text"), n = Vt(e.label).split(`
49
- `), a = 0; a < n.length; a++)
50
- t.append("tspan").attr("xml:space", "preserve").attr("dy", "1em").attr("x", "1").text(n[a]);
51
- return T(t, e.labelStyle), t;
52
- }
53
- function Vt(r) {
54
- for (var e = "", t = !1, n, a = 0; a < r.length; ++a)
55
- if (n = r[a], t) {
56
- switch (n) {
57
- case "n":
58
- e += `
59
- `;
60
- break;
61
- default:
62
- e += n;
63
- }
64
- t = !1;
65
- } else n === "\\" ? t = !0 : e += n;
66
- return e;
67
- }
68
- function q(r, e, t) {
69
- var n = e.label, a = r.append("g");
70
- e.labelType === "svg" ? $t(a, e) : typeof n != "string" || e.labelType === "html" ? at(a, e) : Wt(a, e);
71
- var s = a.node().getBBox(), i;
72
- switch (t) {
73
- case "top":
74
- i = -e.height / 2;
75
- break;
76
- case "bottom":
77
- i = e.height / 2 - s.height;
78
- break;
79
- default:
80
- i = -s.height / 2;
81
- }
82
- return a.attr("transform", "translate(" + -s.width / 2 + "," + i + ")"), a;
83
- }
84
- var Y = function(r, e) {
85
- var t = e.nodes().filter(function(s) {
86
- return nt(e, s);
87
- }), n = r.selectAll("g.cluster").data(t, function(s) {
88
- return s;
89
- });
90
- _(n.exit(), e).style("opacity", 0).remove();
91
- var a = n.enter().append("g").attr("class", "cluster").attr("id", function(s) {
92
- var i = e.node(s);
93
- return i.id;
94
- }).style("opacity", 0).each(function(s) {
95
- var i = e.node(s), o = x(this);
96
- x(this).append("rect");
97
- var c = o.append("g").attr("class", "label");
98
- q(c, i, i.clusterLabelPos);
99
- });
100
- return n = n.merge(a), n = _(n, e).style("opacity", 1), n.selectAll("rect").each(function(s) {
101
- var i = e.node(s), o = x(this);
102
- T(o, i.style);
103
- }), n;
104
- };
105
- function zt(r) {
106
- Y = r;
107
- }
108
- let H = function(r, e) {
109
- var t = r.selectAll("g.edgeLabel").data(e.edges(), function(a) {
110
- return st(a);
111
- }).classed("update", !0);
112
- t.exit().remove(), t.enter().append("g").classed("edgeLabel", !0).style("opacity", 0), t = r.selectAll("g.edgeLabel"), t.each(function(a) {
113
- var s = x(this);
114
- s.select(".label").remove();
115
- var i = e.edge(a), o = q(s, e.edge(a), 0).classed("label", !0), c = o.node().getBBox();
116
- i.labelId && o.attr("id", i.labelId), Object.prototype.hasOwnProperty.call(i, "width") || (i.width = c.width), Object.prototype.hasOwnProperty.call(i, "height") || (i.height = c.height);
117
- });
118
- var n;
119
- return t.exit ? n = t.exit() : n = t.selectAll(null), _(n, e).style("opacity", 0).remove(), t;
120
- };
121
- function Yt(r) {
122
- H = r;
123
- }
124
- function K(r, e) {
125
- return r.intersect(e);
126
- }
127
- var X = function(r, e, t) {
128
- var n = r.selectAll("g.edgePath").data(e.edges(), function(i) {
129
- return st(i);
130
- }).classed("update", !0), a = qt(n, e);
131
- Qt(n, e);
132
- var s = n.merge !== void 0 ? n.merge(a) : n;
133
- return _(s, e).style("opacity", 1), s.each(function(i) {
134
- var o = x(this), c = e.edge(i);
135
- c.elem = this, c.id && o.attr("id", c.id), it(
136
- o,
137
- c.class,
138
- (o.classed("update") ? "update " : "") + "edgePath"
139
- );
140
- }), s.selectAll("path.path").each(function(i) {
141
- var o = e.edge(i);
142
- o.arrowheadId = rt.uniqueId("arrowhead");
143
- var c = x(this).attr("marker-end", function() {
144
- return "url(" + Xt(location.href, o.arrowheadId) + ")";
145
- }).style("fill", "none");
146
- _(c, e).attr("d", function(d) {
147
- return Ft(e, d);
148
- }), T(c, o.style);
149
- }), s.selectAll("defs *").remove(), s.selectAll("defs").each(function(i) {
150
- var o = e.edge(i), c = t[o.arrowhead];
151
- c(x(this), o.arrowheadId, o, "arrowhead");
152
- }), s;
153
- };
154
- function Ht(r) {
155
- X = r;
156
- }
157
- function Xt(r, e) {
158
- var t = r.split("#")[0];
159
- return t + "#" + e;
160
- }
161
- function Ft(r, e) {
162
- var t = r.edge(e), n = r.node(e.v), a = r.node(e.w), s = t.points.slice(1, t.points.length - 1);
163
- return s.unshift(K(n, s[0])), s.push(K(a, s[s.length - 1])), ot(t, s);
164
- }
165
- function ot(r, e) {
166
- var t = (Ct || Dt.line)().x(function(n) {
167
- return n.x;
168
- }).y(function(n) {
169
- return n.y;
170
- });
171
- return (t.curve || t.interpolate)(r.curve), t(e);
172
- }
173
- function jt(r) {
174
- var e = r.getBBox(), t = r.ownerSVGElement.getScreenCTM().inverse().multiply(r.getScreenCTM()).translate(e.width / 2, e.height / 2);
175
- return { x: t.e, y: t.f };
176
- }
177
- function qt(r, e) {
178
- var t = r.enter().append("g").attr("class", "edgePath").style("opacity", 0);
179
- return t.append("path").attr("class", "path").attr("d", function(n) {
180
- var a = e.edge(n), s = e.node(n.v).elem, i = rt.range(a.points.length).map(function() {
181
- return jt(s);
182
- });
183
- return ot(a, i);
184
- }), t.append("defs"), t;
185
- }
186
- function Qt(r, e) {
187
- var t = r.exit();
188
- _(t, e).style("opacity", 0).remove();
189
- }
190
- var F = function(r, e, t) {
191
- var n = e.nodes().filter(function(i) {
192
- return !nt(e, i);
193
- }), a = r.selectAll("g.node").data(n, function(i) {
194
- return i;
195
- }).classed("update", !0);
196
- a.exit().remove(), a.enter().append("g").attr("class", "node").style("opacity", 0), a = r.selectAll("g.node"), a.each(function(i) {
197
- var o = e.node(i), c = x(this);
198
- it(
199
- c,
200
- o.class,
201
- (c.classed("update") ? "update " : "") + "node"
202
- ), c.select("g.label").remove();
203
- var d = c.append("g").attr("class", "label"), l = q(d, o), y = t[o.shape], h = _t(l.node().getBBox(), "width", "height");
204
- o.elem = this, o.id && c.attr("id", o.id), o.labelId && d.attr("id", o.labelId), Object.prototype.hasOwnProperty.call(o, "width") && (h.width = o.width), Object.prototype.hasOwnProperty.call(o, "height") && (h.height = o.height), h.width += o.paddingLeft + o.paddingRight, h.height += o.paddingTop + o.paddingBottom, d.attr(
205
- "transform",
206
- "translate(" + (o.paddingLeft - o.paddingRight) / 2 + "," + (o.paddingTop - o.paddingBottom) / 2 + ")"
207
- );
208
- var u = x(this);
209
- u.select(".label-container").remove();
210
- var f = y(u, h, o).classed("label-container", !0);
211
- T(f, o.style);
212
- var g = f.node().getBBox();
213
- o.width = g.width, o.height = g.height;
214
- });
215
- var s;
216
- return a.exit ? s = a.exit() : s = a.selectAll(null), _(s, e).style("opacity", 0).remove(), a;
217
- };
218
- function Kt(r) {
219
- F = r;
220
- }
221
- function Jt(r, e) {
222
- var t = r.filter(function() {
223
- return !x(this).classed("update");
224
- });
225
- function n(a) {
226
- var s = e.node(a);
227
- return "translate(" + s.x + "," + s.y + ")";
228
- }
229
- t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n), _(t.selectAll("rect"), e).attr("width", function(a) {
230
- return e.node(a).width;
231
- }).attr("height", function(a) {
232
- return e.node(a).height;
233
- }).attr("x", function(a) {
234
- var s = e.node(a);
235
- return -s.width / 2;
236
- }).attr("y", function(a) {
237
- var s = e.node(a);
238
- return -s.height / 2;
239
- });
240
- }
241
- function Zt(r, e) {
242
- var t = r.filter(function() {
243
- return !x(this).classed("update");
244
- });
245
- function n(a) {
246
- var s = e.edge(a);
247
- return Object.prototype.hasOwnProperty.call(s, "x") ? "translate(" + s.x + "," + s.y + ")" : "";
248
- }
249
- t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n);
250
- }
251
- function te(r, e) {
252
- var t = r.filter(function() {
253
- return !x(this).classed("update");
254
- });
255
- function n(a) {
256
- var s = e.node(a);
257
- return "translate(" + s.x + "," + s.y + ")";
258
- }
259
- t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n);
260
- }
261
- function lt(r, e, t, n) {
262
- var a = r.x, s = r.y, i = a - n.x, o = s - n.y, c = Math.sqrt(e * e * o * o + t * t * i * i), d = Math.abs(e * t * i / c);
263
- n.x < a && (d = -d);
264
- var l = Math.abs(e * t * o / c);
265
- return n.y < s && (l = -l), { x: a + d, y: s + l };
266
- }
267
- function ee(r, e, t) {
268
- return lt(r, e, e, t);
269
- }
270
- function re(r, e, t, n) {
271
- var a, s, i, o, c, d, l, y, h, u, f, g, p, v, k;
272
- if (a = e.y - r.y, i = r.x - e.x, c = e.x * r.y - r.x * e.y, h = a * t.x + i * t.y + c, u = a * n.x + i * n.y + c, !(h !== 0 && u !== 0 && J(h, u)) && (s = n.y - t.y, o = t.x - n.x, d = n.x * t.y - t.x * n.y, l = s * r.x + o * r.y + d, y = s * e.x + o * e.y + d, !(l !== 0 && y !== 0 && J(l, y)) && (f = a * o - s * i, f !== 0)))
273
- return g = Math.abs(f / 2), p = i * d - o * c, v = p < 0 ? (p - g) / f : (p + g) / f, p = s * c - a * d, k = p < 0 ? (p - g) / f : (p + g) / f, { x: v, y: k };
274
- }
275
- function J(r, e) {
276
- return r * e > 0;
277
- }
278
- function E(r, e, t) {
279
- var n = r.x, a = r.y, s = [], i = Number.POSITIVE_INFINITY, o = Number.POSITIVE_INFINITY;
280
- e.forEach(function(f) {
281
- i = Math.min(i, f.x), o = Math.min(o, f.y);
282
- });
283
- for (var c = n - r.width / 2 - i, d = a - r.height / 2 - o, l = 0; l < e.length; l++) {
284
- var y = e[l], h = e[l < e.length - 1 ? l + 1 : 0], u = re(
285
- r,
286
- t,
287
- { x: c + y.x, y: d + y.y },
288
- { x: c + h.x, y: d + h.y }
289
- );
290
- u && s.push(u);
291
- }
292
- return s.length ? (s.length > 1 && s.sort(function(f, g) {
293
- var p = f.x - t.x, v = f.y - t.y, k = Math.sqrt(p * p + v * v), P = g.x - t.x, L = g.y - t.y, O = Math.sqrt(P * P + L * L);
294
- return k < O ? -1 : k === O ? 0 : 1;
295
- }), s[0]) : (console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", r), r);
296
- }
297
- function Q(r, e) {
298
- var t = r.x, n = r.y, a = e.x - t, s = e.y - n, i = r.width / 2, o = r.height / 2, c, d;
299
- return Math.abs(s) * i > Math.abs(a) * o ? (s < 0 && (o = -o), c = s === 0 ? 0 : o * a / s, d = o) : (a < 0 && (i = -i), c = i, d = a === 0 ? 0 : i * s / a), { x: t + c, y: n + d };
300
- }
301
- var j = {
302
- rect: ne,
303
- ellipse: se,
304
- circle: ie,
305
- diamond: oe
306
- };
307
- function ae(r) {
308
- j = r;
309
- }
310
- function ne(r, e, t) {
311
- var n = r.insert("rect", ":first-child").attr("rx", t.rx).attr("ry", t.ry).attr("x", -e.width / 2).attr("y", -e.height / 2).attr("width", e.width).attr("height", e.height);
312
- return t.intersect = function(a) {
313
- return Q(t, a);
314
- }, n;
315
- }
316
- function se(r, e, t) {
317
- var n = e.width / 2, a = e.height / 2, s = r.insert("ellipse", ":first-child").attr("x", -e.width / 2).attr("y", -e.height / 2).attr("rx", n).attr("ry", a);
318
- return t.intersect = function(i) {
319
- return lt(t, n, a, i);
320
- }, s;
321
- }
322
- function ie(r, e, t) {
323
- var n = Math.max(e.width, e.height) / 2, a = r.insert("circle", ":first-child").attr("x", -e.width / 2).attr("y", -e.height / 2).attr("r", n);
324
- return t.intersect = function(s) {
325
- return ee(t, n, s);
326
- }, a;
327
- }
328
- function oe(r, e, t) {
329
- var n = e.width * Math.SQRT2 / 2, a = e.height * Math.SQRT2 / 2, s = [
330
- { x: 0, y: -a },
331
- { x: -n, y: 0 },
332
- { x: 0, y: a },
333
- { x: n, y: 0 }
334
- ], i = r.insert("polygon", ":first-child").attr(
335
- "points",
336
- s.map(function(o) {
337
- return o.x + "," + o.y;
338
- }).join(" ")
339
- );
340
- return t.intersect = function(o) {
341
- return E(t, s, o);
342
- }, i;
343
- }
344
- function le() {
345
- var r = function(e, t) {
346
- he(t);
347
- var n = B(e, "output"), a = B(n, "clusters"), s = B(n, "edgePaths"), i = H(B(n, "edgeLabels"), t), o = F(B(n, "nodes"), t, j);
348
- Et(t), te(o, t), Zt(i, t), X(s, t, z);
349
- var c = Y(a, t);
350
- Jt(c, t), ue(t);
351
- };
352
- return r.createNodes = function(e) {
353
- return arguments.length ? (Kt(e), r) : F;
354
- }, r.createClusters = function(e) {
355
- return arguments.length ? (zt(e), r) : Y;
356
- }, r.createEdgeLabels = function(e) {
357
- return arguments.length ? (Yt(e), r) : H;
358
- }, r.createEdgePaths = function(e) {
359
- return arguments.length ? (Ht(e), r) : X;
360
- }, r.shapes = function(e) {
361
- return arguments.length ? (ae(e), r) : j;
362
- }, r.arrows = function(e) {
363
- return arguments.length ? (Rt(e), r) : z;
364
- }, r;
365
- }
366
- var ce = {
367
- paddingLeft: 10,
368
- paddingRight: 10,
369
- paddingTop: 10,
370
- paddingBottom: 10,
371
- rx: 0,
372
- ry: 0,
373
- shape: "rect"
374
- }, de = {
375
- arrowhead: "normal",
376
- curve: G
377
- };
378
- function he(r) {
379
- r.nodes().forEach((e) => {
380
- const t = r.node(e);
381
- !Object.prototype.hasOwnProperty.call(t, "label") && !r.children(e).length && (t.label = e), Object.prototype.hasOwnProperty.call(t, "paddingX") && I(t, {
382
- paddingLeft: t.paddingX,
383
- paddingRight: t.paddingX
384
- }), Object.prototype.hasOwnProperty.call(t, "paddingY") && I(t, {
385
- paddingTop: t.paddingY,
386
- paddingBottom: t.paddingY
387
- }), Object.prototype.hasOwnProperty.call(t, "padding") && I(t, {
388
- paddingLeft: t.padding,
389
- paddingRight: t.padding,
390
- paddingTop: t.padding,
391
- paddingBottom: t.padding
392
- }), I(t, ce), ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"].forEach((n) => {
393
- t[n] = Number(t[n]);
394
- }), Object.prototype.hasOwnProperty.call(t, "width") && (t._prevWidth = t.width), Object.prototype.hasOwnProperty.call(t, "height") && (t._prevHeight = t.height);
395
- }), r.edges().forEach(function(e) {
396
- var t = r.edge(e);
397
- Object.prototype.hasOwnProperty.call(t, "label") || (t.label = ""), I(t, de);
398
- });
399
- }
400
- function ue(r) {
401
- r.nodes().forEach((e) => {
402
- var t = r.node(e);
403
- Object.prototype.hasOwnProperty.call(t, "_prevWidth") ? t.width = t._prevWidth : delete t.width, Object.prototype.hasOwnProperty.call(t, "_prevHeight") ? t.height = t._prevHeight : delete t.height, delete t._prevWidth, delete t._prevHeight;
404
- });
405
- }
406
- function B(r, e) {
407
- var t = r.select("g." + e);
408
- return t.empty() && (t = r.append("g").attr("class", e)), t;
409
- }
410
- function ct(r, e, t) {
411
- const n = e.width, a = e.height, s = (n + a) * 0.9, i = [
412
- { x: s / 2, y: 0 },
413
- { x: s, y: -s / 2 },
414
- { x: s / 2, y: -s },
415
- { x: 0, y: -s / 2 }
416
- ], o = N(r, s, s, i);
417
- return t.intersect = function(c) {
418
- return E(t, i, c);
419
- }, o;
420
- }
421
- function dt(r, e, t) {
422
- const a = e.height, s = a / 4, i = e.width + 2 * s, o = [
423
- { x: s, y: 0 },
424
- { x: i - s, y: 0 },
425
- { x: i, y: -a / 2 },
426
- { x: i - s, y: -a },
427
- { x: s, y: -a },
428
- { x: 0, y: -a / 2 }
429
- ], c = N(r, i, a, o);
430
- return t.intersect = function(d) {
431
- return E(t, o, d);
432
- }, c;
433
- }
434
- function ht(r, e, t) {
435
- const n = e.width, a = e.height, s = [
436
- { x: -a / 2, y: 0 },
437
- { x: n, y: 0 },
438
- { x: n, y: -a },
439
- { x: -a / 2, y: -a },
440
- { x: 0, y: -a / 2 }
441
- ], i = N(r, n, a, s);
442
- return t.intersect = function(o) {
443
- return E(t, s, o);
444
- }, i;
445
- }
446
- function ut(r, e, t) {
447
- const n = e.width, a = e.height, s = [
448
- { x: -2 * a / 6, y: 0 },
449
- { x: n - a / 6, y: 0 },
450
- { x: n + 2 * a / 6, y: -a },
451
- { x: a / 6, y: -a }
452
- ], i = N(r, n, a, s);
453
- return t.intersect = function(o) {
454
- return E(t, s, o);
455
- }, i;
456
- }
457
- function pt(r, e, t) {
458
- const n = e.width, a = e.height, s = [
459
- { x: 2 * a / 6, y: 0 },
460
- { x: n + a / 6, y: 0 },
461
- { x: n - 2 * a / 6, y: -a },
462
- { x: -a / 6, y: -a }
463
- ], i = N(r, n, a, s);
464
- return t.intersect = function(o) {
465
- return E(t, s, o);
466
- }, i;
467
- }
468
- function ft(r, e, t) {
469
- const n = e.width, a = e.height, s = [
470
- { x: -2 * a / 6, y: 0 },
471
- { x: n + 2 * a / 6, y: 0 },
472
- { x: n - a / 6, y: -a },
473
- { x: a / 6, y: -a }
474
- ], i = N(r, n, a, s);
475
- return t.intersect = function(o) {
476
- return E(t, s, o);
477
- }, i;
478
- }
479
- function yt(r, e, t) {
480
- const n = e.width, a = e.height, s = [
481
- { x: a / 6, y: 0 },
482
- { x: n - a / 6, y: 0 },
483
- { x: n + 2 * a / 6, y: -a },
484
- { x: -2 * a / 6, y: -a }
485
- ], i = N(r, n, a, s);
486
- return t.intersect = function(o) {
487
- return E(t, s, o);
488
- }, i;
489
- }
490
- function vt(r, e, t) {
491
- const n = e.width, a = e.height, s = [
492
- { x: 0, y: 0 },
493
- { x: n + a / 2, y: 0 },
494
- { x: n, y: -a / 2 },
495
- { x: n + a / 2, y: -a },
496
- { x: 0, y: -a }
497
- ], i = N(r, n, a, s);
498
- return t.intersect = function(o) {
499
- return E(t, s, o);
500
- }, i;
501
- }
502
- function gt(r, e, t) {
503
- const n = e.height, a = e.width + n / 4, s = r.insert("rect", ":first-child").attr("rx", n / 2).attr("ry", n / 2).attr("x", -a / 2).attr("y", -n / 2).attr("width", a).attr("height", n);
504
- return t.intersect = function(i) {
505
- return Q(t, i);
506
- }, s;
507
- }
508
- function wt(r, e, t) {
509
- const n = e.width, a = e.height, s = [
510
- { x: 0, y: 0 },
511
- { x: n, y: 0 },
512
- { x: n, y: -a },
513
- { x: 0, y: -a },
514
- { x: 0, y: 0 },
515
- { x: -8, y: 0 },
516
- { x: n + 8, y: 0 },
517
- { x: n + 8, y: -a },
518
- { x: -8, y: -a },
519
- { x: -8, y: 0 }
520
- ], i = N(r, n, a, s);
521
- return t.intersect = function(o) {
522
- return E(t, s, o);
523
- }, i;
524
- }
525
- function mt(r, e, t) {
526
- const n = e.width, a = n / 2, s = a / (2.5 + n / 50), i = e.height + s, o = "M 0," + s + " a " + a + "," + s + " 0,0,0 " + n + " 0 a " + a + "," + s + " 0,0,0 " + -n + " 0 l 0," + i + " a " + a + "," + s + " 0,0,0 " + n + " 0 l 0," + -i, c = r.attr("label-offset-y", s).insert("path", ":first-child").attr("d", o).attr("transform", "translate(" + -n / 2 + "," + -(i / 2 + s) + ")");
527
- return t.intersect = function(d) {
528
- const l = Q(t, d), y = l.x - t.x;
529
- if (a != 0 && (Math.abs(y) < t.width / 2 || Math.abs(y) == t.width / 2 && Math.abs(l.y - t.y) > t.height / 2 - s)) {
530
- let h = s * s * (1 - y * y / (a * a));
531
- h != 0 && (h = Math.sqrt(h)), h = s - h, d.y - t.y > 0 && (h = -h), l.y += h;
532
- }
533
- return l;
534
- }, c;
535
- }
536
- function pe(r) {
537
- r.shapes().question = ct, r.shapes().hexagon = dt, r.shapes().stadium = gt, r.shapes().subroutine = wt, r.shapes().cylinder = mt, r.shapes().rect_left_inv_arrow = ht, r.shapes().lean_right = ut, r.shapes().lean_left = pt, r.shapes().trapezoid = ft, r.shapes().inv_trapezoid = yt, r.shapes().rect_right_inv_arrow = vt;
538
- }
539
- function fe(r) {
540
- r({ question: ct }), r({ hexagon: dt }), r({ stadium: gt }), r({ subroutine: wt }), r({ cylinder: mt }), r({ rect_left_inv_arrow: ht }), r({ lean_right: ut }), r({ lean_left: pt }), r({ trapezoid: ft }), r({ inv_trapezoid: yt }), r({ rect_right_inv_arrow: vt });
541
- }
542
- function N(r, e, t, n) {
543
- return r.insert("polygon", ":first-child").attr(
544
- "points",
545
- n.map(function(a) {
546
- return a.x + "," + a.y;
547
- }).join(" ")
548
- ).attr("transform", "translate(" + -e / 2 + "," + t / 2 + ")");
549
- }
550
- const ye = {
551
- addToRender: pe,
552
- addToRenderV2: fe
553
- }, xt = {}, ve = function(r) {
554
- const e = Object.keys(r);
555
- for (const t of e)
556
- xt[t] = r[t];
557
- }, bt = async function(r, e, t, n, a, s) {
558
- const i = n ? n.select(`[id="${t}"]`) : x(`[id="${t}"]`), o = a || document, c = Object.keys(r);
559
- for (const d of c) {
560
- const l = r[d];
561
- let y = "default";
562
- l.classes.length > 0 && (y = l.classes.join(" "));
563
- const h = V(l.styles);
564
- let u = l.text !== void 0 ? l.text : l.id, f;
565
- if (Z(D().flowchart.htmlLabels)) {
566
- const v = {
567
- label: await tt(
568
- u.replace(
569
- /fa[blrs]?:fa-[\w-]+/g,
570
- // cspell:disable-line
571
- (k) => `<i class='${k.replace(":", " ")}'></i>`
572
- ),
573
- D()
574
- )
575
- };
576
- f = at(i, v).node(), f.parentNode.removeChild(f);
577
- } else {
578
- const v = o.createElementNS("http://www.w3.org/2000/svg", "text");
579
- v.setAttribute("style", h.labelStyle.replace("color:", "fill:"));
580
- const k = u.split(et.lineBreakRegex);
581
- for (const P of k) {
582
- const L = o.createElementNS("http://www.w3.org/2000/svg", "tspan");
583
- L.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), L.setAttribute("dy", "1em"), L.setAttribute("x", "1"), L.textContent = P, v.appendChild(L);
584
- }
585
- f = v;
586
- }
587
- let g = 0, p = "";
588
- switch (l.type) {
589
- case "round":
590
- g = 5, p = "rect";
591
- break;
592
- case "square":
593
- p = "rect";
594
- break;
595
- case "diamond":
596
- p = "question";
597
- break;
598
- case "hexagon":
599
- p = "hexagon";
600
- break;
601
- case "odd":
602
- p = "rect_left_inv_arrow";
603
- break;
604
- case "lean_right":
605
- p = "lean_right";
606
- break;
607
- case "lean_left":
608
- p = "lean_left";
609
- break;
610
- case "trapezoid":
611
- p = "trapezoid";
612
- break;
613
- case "inv_trapezoid":
614
- p = "inv_trapezoid";
615
- break;
616
- case "odd_right":
617
- p = "rect_left_inv_arrow";
618
- break;
619
- case "circle":
620
- p = "circle";
621
- break;
622
- case "ellipse":
623
- p = "ellipse";
624
- break;
625
- case "stadium":
626
- p = "stadium";
627
- break;
628
- case "subroutine":
629
- p = "subroutine";
630
- break;
631
- case "cylinder":
632
- p = "cylinder";
633
- break;
634
- case "group":
635
- p = "rect";
636
- break;
637
- default:
638
- p = "rect";
639
- }
640
- M.warn("Adding node", l.id, l.domId), e.setNode(s.db.lookUpDomId(l.id), {
641
- labelType: "svg",
642
- labelStyle: h.labelStyle,
643
- shape: p,
644
- label: f,
645
- rx: g,
646
- ry: g,
647
- class: y,
648
- style: h.style,
649
- id: s.db.lookUpDomId(l.id)
650
- });
651
- }
652
- }, kt = async function(r, e, t) {
653
- let n = 0, a, s;
654
- if (r.defaultStyle !== void 0) {
655
- const i = V(r.defaultStyle);
656
- a = i.style, s = i.labelStyle;
657
- }
658
- for (const i of r) {
659
- n++;
660
- const o = "L-" + i.start + "-" + i.end, c = "LS-" + i.start, d = "LE-" + i.end, l = {};
661
- i.type === "arrow_open" ? l.arrowhead = "none" : l.arrowhead = "normal";
662
- let y = "", h = "";
663
- if (i.style !== void 0) {
664
- const u = V(i.style);
665
- y = u.style, h = u.labelStyle;
666
- } else
667
- switch (i.stroke) {
668
- case "normal":
669
- y = "fill:none", a !== void 0 && (y = a), s !== void 0 && (h = s);
670
- break;
671
- case "dotted":
672
- y = "fill:none;stroke-width:2px;stroke-dasharray:3;";
673
- break;
674
- case "thick":
675
- y = " stroke-width: 3.5px;fill:none";
676
- break;
677
- }
678
- l.style = y, l.labelStyle = h, i.interpolate !== void 0 ? l.curve = W(i.interpolate, G) : r.defaultInterpolate !== void 0 ? l.curve = W(r.defaultInterpolate, G) : l.curve = W(xt.curve, G), i.text === void 0 ? i.style !== void 0 && (l.arrowheadStyle = "fill: #333") : (l.arrowheadStyle = "fill: #333", l.labelpos = "c", Z(D().flowchart.htmlLabels) ? (l.labelType = "html", l.label = `<span id="L-${o}" class="edgeLabel L-${c}' L-${d}" style="${l.labelStyle}">${await tt(
679
- i.text.replace(
680
- /fa[blrs]?:fa-[\w-]+/g,
681
- // cspell:disable-line
682
- (u) => `<i class='${u.replace(":", " ")}'></i>`
683
- ),
684
- D()
685
- )}</span>`) : (l.labelType = "text", l.label = i.text.replace(et.lineBreakRegex, `
686
- `), i.style === void 0 && (l.style = l.style || "stroke: #333; stroke-width: 1.5px;fill:none"), l.labelStyle = l.labelStyle.replace("color:", "fill:"))), l.id = o, l.class = c + " " + d, l.minlen = i.length || 1, e.setEdge(t.db.lookUpDomId(i.start), t.db.lookUpDomId(i.end), l, n);
687
- }
688
- }, ge = function(r, e) {
689
- return M.info("Extracting classes"), e.db.getClasses();
690
- }, we = async function(r, e, t, n) {
691
- M.info("Drawing flowchart");
692
- const { securityLevel: a, flowchart: s } = D();
693
- let i;
694
- a === "sandbox" && (i = x("#i" + e));
695
- const o = a === "sandbox" ? x(i.nodes()[0].contentDocument.body) : x("body"), c = a === "sandbox" ? i.nodes()[0].contentDocument : document;
696
- let d = n.db.getDirection();
697
- d === void 0 && (d = "TD");
698
- const l = s.nodeSpacing || 50, y = s.rankSpacing || 50, h = new Tt({
699
- multigraph: !0,
700
- compound: !0
701
- }).setGraph({
702
- rankdir: d,
703
- nodesep: l,
704
- ranksep: y,
705
- marginx: 8,
706
- marginy: 8
707
- }).setDefaultEdgeLabel(function() {
708
- return {};
709
- });
710
- let u;
711
- const f = n.db.getSubGraphs();
712
- for (let w = f.length - 1; w >= 0; w--)
713
- u = f[w], n.db.addVertex(u.id, u.title, "group", void 0, u.classes);
714
- const g = n.db.getVertices();
715
- M.warn("Get vertices", g);
716
- const p = n.db.getEdges();
717
- let v = 0;
718
- for (v = f.length - 1; v >= 0; v--) {
719
- u = f[v], Pt("cluster").append("text");
720
- for (let w = 0; w < u.nodes.length; w++)
721
- M.warn(
722
- "Setting subgraph",
723
- u.nodes[w],
724
- n.db.lookUpDomId(u.nodes[w]),
725
- n.db.lookUpDomId(u.id)
726
- ), h.setParent(n.db.lookUpDomId(u.nodes[w]), n.db.lookUpDomId(u.id));
727
- }
728
- await bt(g, h, e, o, c, n), await kt(p, h, n);
729
- const k = new le();
730
- ye.addToRender(k), k.arrows().none = function(b, S, m, C) {
731
- const A = b.append("marker").attr("id", S).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto").append("path").attr("d", "M 0 0 L 0 0 L 0 0 z");
732
- T(A, m[C + "Style"]);
733
- }, k.arrows().normal = function(b, S) {
734
- b.append("marker").attr("id", S).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowheadPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
735
- };
736
- const P = o.select(`[id="${e}"]`), L = o.select("#" + e + " g");
737
- for (k(L, h), L.selectAll("g.node").attr("title", function() {
738
- return n.db.getTooltip(this.id);
739
- }), n.db.indexNodes("subGraph" + v), v = 0; v < f.length; v++)
740
- if (u = f[v], u.title !== "undefined") {
741
- const w = c.querySelectorAll(
742
- "#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"] rect'
743
- ), b = c.querySelectorAll(
744
- "#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"]'
745
- ), S = w[0].x.baseVal.value, m = w[0].y.baseVal.value, C = w[0].width.baseVal.value, A = x(b[0]).select(".label");
746
- A.attr("transform", `translate(${S + C / 2}, ${m + 14})`), A.attr("id", e + "Text");
747
- for (let U = 0; U < u.classes.length; U++)
748
- b[0].classList.add(u.classes[U]);
749
- }
750
- if (!s.htmlLabels) {
751
- const w = c.querySelectorAll('[id="' + e + '"] .edgeLabel .label');
752
- for (const b of w) {
753
- const S = b.getBBox(), m = c.createElementNS("http://www.w3.org/2000/svg", "rect");
754
- m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width", S.width), m.setAttribute("height", S.height), b.insertBefore(m, b.firstChild);
755
- }
756
- }
757
- Lt(h, P, s.diagramPadding, s.useMaxWidth), Object.keys(g).forEach(function(w) {
758
- const b = g[w];
759
- if (b.link) {
760
- const S = o.select("#" + e + ' [id="' + n.db.lookUpDomId(w) + '"]');
761
- if (S) {
762
- const m = c.createElementNS("http://www.w3.org/2000/svg", "a");
763
- m.setAttributeNS("http://www.w3.org/2000/svg", "class", b.classes.join(" ")), m.setAttributeNS("http://www.w3.org/2000/svg", "href", b.link), m.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), a === "sandbox" ? m.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : b.linkTarget && m.setAttributeNS("http://www.w3.org/2000/svg", "target", b.linkTarget);
764
- const C = S.insert(function() {
765
- return m;
766
- }, ":first-child"), R = S.select(".label-container");
767
- R && C.append(function() {
768
- return R.node();
769
- });
770
- const A = S.select(".label");
771
- A && C.append(function() {
772
- return A.node();
773
- });
774
- }
775
- }
776
- });
777
- }, me = {
778
- setConf: ve,
779
- addVertices: bt,
780
- addEdges: kt,
781
- getClasses: ge,
782
- draw: we
783
- }, Ce = {
784
- parser: St,
785
- db: $,
786
- renderer: At,
787
- styles: Nt,
788
- init: (r) => {
789
- r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute, me.setConf(r.flowchart), $.clear(), $.setGen("gen-1");
790
- }
791
- };
792
- export {
793
- Ce as diagram
794
- };