@openbkn/workshop 0.2.2-rc.5 → 0.2.2

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 (158) hide show
  1. package/README.md +83 -13
  2. package/component.d.ts +10 -0
  3. package/dist/ActionConfirm-DJ91X3ml.js +236 -0
  4. package/dist/ActionFailure-ZgPt_3B-.js +37 -0
  5. package/dist/AgentChat-CRYai8ge.js +1062 -0
  6. package/dist/AppFormModal-D73ucaHK.js +4282 -0
  7. package/dist/AppListPage-D87piiOw.js +1364 -0
  8. package/dist/AskDrawer-BUMYsRnt.js +38 -0
  9. package/dist/ComputedView-CgYrDbx1.js +3221 -0
  10. package/dist/ConclusionApply-sjGfoEBY.js +153 -0
  11. package/dist/CypherEditor-lus6FA5L.js +485 -0
  12. package/dist/LandingList-6JI6864C.js +230 -0
  13. package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
  14. package/dist/ModelTrial-ClHFGTpQ.js +359 -0
  15. package/dist/PageRenderer-DBd_g6mN.js +85480 -0
  16. package/dist/README-DjRyTQSR.js +76 -0
  17. package/dist/ScenarioApply-DtW_hh47.js +590 -0
  18. package/dist/SimulateForm-C-i08Jjd.js +153 -0
  19. package/dist/Subgraph-CnrkH9AN.js +32586 -0
  20. package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
  21. package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
  22. package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
  23. package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
  24. package/dist/actionButton-DA5CNEzx.js +94 -0
  25. package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
  26. package/dist/agentChat-EoDznd58.js +116 -0
  27. package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
  28. package/dist/alertList-DqditwM8.js +84 -0
  29. package/dist/alertList.en-US-BAXAgltP.js +84 -0
  30. package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
  31. package/dist/asOfSlider-QPvHWUMV.js +83 -0
  32. package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
  33. package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
  34. package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
  35. package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
  36. package/dist/channel-B034hcOF.js +5 -0
  37. package/dist/china-C6m7zXIv.js +9 -0
  38. package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
  39. package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
  40. package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
  41. package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
  42. package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
  43. package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
  44. package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
  45. package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
  46. package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
  47. package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
  48. package/dist/component.d-DFoMKuUv.js +179 -0
  49. package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
  50. package/dist/customComponents-DasaZ6pq.js +4 -0
  51. package/dist/customComponents.en-US-CkabuCXg.js +79 -0
  52. package/dist/customParseFormat-C0uLEpdq.js +182 -0
  53. package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
  54. package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
  55. package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
  56. package/dist/d3-scale-DA8IHmf0.js +1841 -0
  57. package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
  58. package/dist/dateRange-BbkLMg8L.js +79 -0
  59. package/dist/dateRange.en-US-CV12Q02G.js +79 -0
  60. package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
  61. package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
  62. package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
  63. package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
  64. package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
  65. package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
  66. package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
  67. package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
  68. package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
  69. package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
  70. package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
  71. package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
  72. package/dist/eventList-CnsAwfDS.js +115 -0
  73. package/dist/eventList.en-US-Cof3rCLq.js +115 -0
  74. package/dist/eventReport-XS-HegnH.js +76 -0
  75. package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
  76. package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
  77. package/dist/ganttChart-DEeSvTJA.js +77 -0
  78. package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
  79. package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
  80. package/dist/generateCypher-Ch9_lQa6.js +399 -0
  81. package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
  82. package/dist/graph-CKJmgLki.js +1541 -0
  83. package/dist/index-BA-GzCXt.js +441 -0
  84. package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
  85. package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
  86. package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
  87. package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
  88. package/dist/katex-BsrBVQKd.js +11314 -0
  89. package/dist/manifest-BjV1PJ6u.js +41 -0
  90. package/dist/mermaid.core-yQghUlIz.js +17642 -0
  91. package/dist/metricCards-CSb-_cT2.js +104 -0
  92. package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
  93. package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
  94. package/dist/modelTrial-Bvb-RhGt.js +137 -0
  95. package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
  96. package/dist/models-DekiCOuZ.js +6 -0
  97. package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
  98. package/dist/object-metric.service-flZgBMRX.js +233 -0
  99. package/dist/objectDetail-SQUbp4Py.js +117 -0
  100. package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
  101. package/dist/objectList-D99wPtJH.js +97 -0
  102. package/dist/objectList.en-US-PBBNyVLW.js +97 -0
  103. package/dist/objectTable-0jsFFMN3.js +127 -0
  104. package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
  105. package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
  106. package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
  107. package/dist/pivotTable-CHmQw18-.js +102 -0
  108. package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
  109. package/dist/prompt-DYrjlEFr.js +373 -0
  110. package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
  111. package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
  112. package/dist/regionMap-Cme-JyV_.js +128 -0
  113. package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
  114. package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
  115. package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
  116. package/dist/scenarioBar-BV43p7n-.js +122 -0
  117. package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
  118. package/dist/scheduleGantt-CTYO-zYP.js +180 -0
  119. package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
  120. package/dist/searchBox-Ca7w0f_6.js +67 -0
  121. package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
  122. package/dist/segmentedFilter-MhjVcWo0.js +80 -0
  123. package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
  124. package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
  125. package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
  126. package/dist/stageChain-BxBafwjD.js +74 -0
  127. package/dist/stageChain.en-US-CP0G27n8.js +74 -0
  128. package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
  129. package/dist/subgraph-7n4SwliR.js +71 -0
  130. package/dist/subgraph.en-US-BNvY18IW.js +71 -0
  131. package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
  132. package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
  133. package/dist/taskInbox-DGWYeI2b.js +118 -0
  134. package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
  135. package/dist/text-BqSVQKS6.js +78 -0
  136. package/dist/text.en-US-BhAxy_LE.js +78 -0
  137. package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
  138. package/dist/trendChart-BjEeRS5_.js +135 -0
  139. package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
  140. package/dist/useLabData-Df-jEHKs.js +20470 -0
  141. package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
  142. package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
  143. package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
  144. package/dist/workshop-app-DnHNjBqy.js +86038 -0
  145. package/dist/workshop-app.css +1 -0
  146. package/dist/workshop-app.js +4 -0
  147. package/dist/world-Djau1JyJ.js +9 -0
  148. package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
  149. package/dist-cli/workshop.js +341 -218
  150. package/example/host.js +109 -0
  151. package/example/index.html +93 -0
  152. package/example/server.mjs +237 -0
  153. package/index.d.ts +48 -0
  154. package/lib/validate.js +47 -1
  155. package/package.json +17 -5
  156. package/runtime/frame-runtime.js +13 -1
  157. package/workshop-component.js +32 -12
  158. package/workshop.js +2 -0
@@ -0,0 +1,1579 @@
1
+ import { b0 as Wt, s as Kt, g as Ht, x as Yt, v as Xt, a as Zt, b as Qt, _ as w, O as wt, T as Jt, k as ot, ai as $t, a7 as te, a8 as ee, a9 as ne, d as se, D as ie, Q as oe, R as re } from "./mermaid.core-yQghUlIz.js";
2
+ import "./dayjs.min-DZ-YV8Mv.js";
3
+ const It = (t, n) => Wt(t, "a", -n), _t = 1e-10;
4
+ function st(t, n) {
5
+ const s = le(t), e = s.filter((l) => ae(l, t));
6
+ let i = 0, o = 0;
7
+ const r = [];
8
+ if (e.length > 1) {
9
+ const l = Et(e);
10
+ for (let u = 0; u < e.length; ++u) {
11
+ const a = e[u];
12
+ a.angle = Math.atan2(a.x - l.x, a.y - l.y);
13
+ }
14
+ e.sort((u, a) => a.angle - u.angle);
15
+ let f = e[e.length - 1];
16
+ for (let u = 0; u < e.length; ++u) {
17
+ const a = e[u];
18
+ o += (f.x + a.x) * (a.y - f.y);
19
+ const y = { x: (a.x + f.x) / 2, y: (a.y + f.y) / 2 };
20
+ let h = null;
21
+ for (let b = 0; b < a.parentIndex.length; ++b)
22
+ if (f.parentIndex.includes(a.parentIndex[b])) {
23
+ const p = t[a.parentIndex[b]], M = Math.atan2(a.x - p.x, a.y - p.y), E = Math.atan2(f.x - p.x, f.y - p.y);
24
+ let _ = E - M;
25
+ _ < 0 && (_ += 2 * Math.PI);
26
+ const S = E - _ / 2;
27
+ let g = q(y, {
28
+ x: p.x + p.radius * Math.sin(S),
29
+ y: p.y + p.radius * Math.cos(S)
30
+ });
31
+ g > p.radius * 2 && (g = p.radius * 2), (h == null || h.width > g) && (h = { circle: p, width: g, p1: a, p2: f, large: g > p.radius, sweep: !0 });
32
+ }
33
+ h != null && (r.push(h), i += lt(h.circle.radius, h.width), f = a);
34
+ }
35
+ } else {
36
+ let l = t[0];
37
+ for (let u = 1; u < t.length; ++u)
38
+ t[u].radius < l.radius && (l = t[u]);
39
+ let f = !1;
40
+ for (let u = 0; u < t.length; ++u)
41
+ if (q(t[u], l) > Math.abs(l.radius - t[u].radius)) {
42
+ f = !0;
43
+ break;
44
+ }
45
+ f ? i = o = 0 : (i = l.radius * l.radius * Math.PI, r.push({
46
+ circle: l,
47
+ p1: { x: l.x, y: l.y + l.radius },
48
+ p2: { x: l.x - _t, y: l.y + l.radius },
49
+ width: l.radius * 2,
50
+ large: !0,
51
+ sweep: !0
52
+ }));
53
+ }
54
+ 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;
55
+ }
56
+ function ae(t, n) {
57
+ return n.every((s) => q(t, s) < s.radius + _t);
58
+ }
59
+ function le(t) {
60
+ const n = [];
61
+ for (let s = 0; s < t.length; ++s)
62
+ for (let e = s + 1; e < t.length; ++e) {
63
+ const i = Tt(t[s], t[e]);
64
+ for (const o of i)
65
+ o.parentIndex = [s, e], n.push(o);
66
+ }
67
+ return n;
68
+ }
69
+ function lt(t, n) {
70
+ return t * t * Math.acos(1 - n / t) - (t - n) * Math.sqrt(n * (2 * t - n));
71
+ }
72
+ function q(t, n) {
73
+ return Math.sqrt((t.x - n.x) * (t.x - n.x) + (t.y - n.y) * (t.y - n.y));
74
+ }
75
+ function xt(t, n, s) {
76
+ if (s >= t + n)
77
+ return 0;
78
+ if (s <= Math.abs(t - n))
79
+ return Math.PI * Math.min(t, n) * Math.min(t, n);
80
+ const e = t - (s * s - n * n + t * t) / (2 * s), i = n - (s * s - t * t + n * n) / (2 * s);
81
+ return lt(t, e) + lt(n, i);
82
+ }
83
+ function Tt(t, n) {
84
+ const s = q(t, n), e = t.radius, i = n.radius;
85
+ if (s >= e + i || s <= Math.abs(e - i))
86
+ return [];
87
+ 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);
88
+ return [
89
+ { x: l + u, y: f - a },
90
+ { x: l - u, y: f + a }
91
+ ];
92
+ }
93
+ function Et(t) {
94
+ const n = { x: 0, y: 0 };
95
+ for (const s of t)
96
+ n.x += s.x, n.y += s.y;
97
+ return n.x /= t.length, n.y /= t.length, n;
98
+ }
99
+ function ce(t, n, s, e) {
100
+ e = e || {};
101
+ const i = e.maxIterations || 100, o = e.tolerance || 1e-10, r = t(n), l = t(s);
102
+ let f = s - n;
103
+ if (r * l > 0)
104
+ throw "Initial bisect points must have opposite signs";
105
+ if (r === 0) return n;
106
+ if (l === 0) return s;
107
+ for (let u = 0; u < i; ++u) {
108
+ f /= 2;
109
+ const a = n + f, y = t(a);
110
+ if (y * r >= 0 && (n = a), Math.abs(f) < o || y === 0)
111
+ return a;
112
+ }
113
+ return n + f;
114
+ }
115
+ function ct(t) {
116
+ const n = new Array(t);
117
+ for (let s = 0; s < t; ++s)
118
+ n[s] = 0;
119
+ return n;
120
+ }
121
+ function Mt(t, n) {
122
+ return ct(t).map(() => ct(n));
123
+ }
124
+ function $(t, n) {
125
+ let s = 0;
126
+ for (let e = 0; e < t.length; ++e)
127
+ s += t[e] * n[e];
128
+ return s;
129
+ }
130
+ function ut(t) {
131
+ return Math.sqrt($(t, t));
132
+ }
133
+ function ft(t, n, s) {
134
+ for (let e = 0; e < n.length; ++e)
135
+ t[e] = n[e] * s;
136
+ }
137
+ function Z(t, n, s, e, i) {
138
+ for (let o = 0; o < t.length; ++o)
139
+ t[o] = n * s[o] + e * i[o];
140
+ }
141
+ function zt(t, n, s) {
142
+ s = s || {};
143
+ const e = s.maxIterations || n.length * 200, i = s.nonZeroDelta || 1.05, o = s.zeroDelta || 1e-3, r = s.minErrorDelta || 1e-6, l = s.minErrorDelta || 1e-5, f = s.rho !== void 0 ? s.rho : 1, u = s.chi !== void 0 ? s.chi : 2, a = s.psi !== void 0 ? s.psi : -0.5, y = s.sigma !== void 0 ? s.sigma : 0.5;
144
+ let h;
145
+ const b = n.length, p = new Array(b + 1);
146
+ p[0] = n, p[0].fx = t(n), p[0].id = 0;
147
+ for (let v = 0; v < b; ++v) {
148
+ const c = n.slice();
149
+ c[v] = c[v] ? c[v] * i : o, p[v + 1] = c, p[v + 1].fx = t(c), p[v + 1].id = v + 1;
150
+ }
151
+ function M(v) {
152
+ for (let c = 0; c < v.length; c++)
153
+ p[b][c] = v[c];
154
+ p[b].fx = v.fx;
155
+ }
156
+ const E = (v, c) => v.fx - c.fx, _ = n.slice(), S = n.slice(), g = n.slice(), m = n.slice();
157
+ for (let v = 0; v < e; ++v) {
158
+ if (p.sort(E), s.history) {
159
+ const x = p.map((d) => {
160
+ const C = d.slice();
161
+ return C.fx = d.fx, C.id = d.id, C;
162
+ });
163
+ x.sort((d, C) => d.id - C.id), s.history.push({
164
+ x: p[0].slice(),
165
+ fx: p[0].fx,
166
+ simplex: x
167
+ });
168
+ }
169
+ h = 0;
170
+ for (let x = 0; x < b; ++x)
171
+ h = Math.max(h, Math.abs(p[0][x] - p[1][x]));
172
+ if (Math.abs(p[0].fx - p[b].fx) < r && h < l)
173
+ break;
174
+ for (let x = 0; x < b; ++x) {
175
+ _[x] = 0;
176
+ for (let d = 0; d < b; ++d)
177
+ _[x] += p[d][x];
178
+ _[x] /= b;
179
+ }
180
+ const c = p[b];
181
+ if (Z(S, 1 + f, _, -f, c), S.fx = t(S), S.fx < p[0].fx)
182
+ Z(m, 1 + u, _, -u, c), m.fx = t(m), m.fx < S.fx ? M(m) : M(S);
183
+ else if (S.fx >= p[b - 1].fx) {
184
+ let x = !1;
185
+ if (S.fx > c.fx ? (Z(g, 1 + a, _, -a, c), g.fx = t(g), g.fx < c.fx ? M(g) : x = !0) : (Z(g, 1 - a * f, _, a * f, c), g.fx = t(g), g.fx < S.fx ? M(g) : x = !0), x) {
186
+ if (y >= 1) break;
187
+ for (let d = 1; d < p.length; ++d)
188
+ Z(p[d], 1 - y, p[0], y, p[d]), p[d].fx = t(p[d]);
189
+ }
190
+ } else
191
+ M(S);
192
+ }
193
+ return p.sort(E), { fx: p[0].fx, x: p[0] };
194
+ }
195
+ function ue(t, n, s, e, i, o, r) {
196
+ const l = s.fx, f = $(s.fxprime, n);
197
+ let u = l, a = l, y = f, h = 0;
198
+ i = i || 1, o = o || 1e-6, r = r || 0.1;
199
+ function b(p, M, E) {
200
+ for (let _ = 0; _ < 16; ++_)
201
+ if (i = (p + M) / 2, Z(e.x, 1, s.x, i, n), u = e.fx = t(e.x, e.fxprime), y = $(e.fxprime, n), u > l + o * i * f || u >= E)
202
+ M = i;
203
+ else {
204
+ if (Math.abs(y) <= -r * f)
205
+ return i;
206
+ y * (M - p) >= 0 && (M = p), p = i, E = u;
207
+ }
208
+ return 0;
209
+ }
210
+ for (let p = 0; p < 10; ++p) {
211
+ if (Z(e.x, 1, s.x, i, n), u = e.fx = t(e.x, e.fxprime), y = $(e.fxprime, n), u > l + o * i * f || p && u >= a)
212
+ return b(h, i, a);
213
+ if (Math.abs(y) <= -r * f)
214
+ return i;
215
+ if (y >= 0)
216
+ return b(i, h, u);
217
+ a = u, h = i, i *= 2;
218
+ }
219
+ return i;
220
+ }
221
+ function fe(t, n, s) {
222
+ let e = { x: n.slice(), fx: 0, fxprime: n.slice() }, i = { x: n.slice(), fx: 0, fxprime: n.slice() };
223
+ const o = n.slice();
224
+ let r, l, f = 1, u;
225
+ s = s || {}, u = s.maxIterations || n.length * 20, e.fx = t(e.x, e.fxprime), r = e.fxprime.slice(), ft(r, e.fxprime, -1);
226
+ for (let a = 0; a < u; ++a) {
227
+ if (f = ue(t, r, e, i, f), s.history && s.history.push({
228
+ x: e.x.slice(),
229
+ fx: e.fx,
230
+ fxprime: e.fxprime.slice(),
231
+ alpha: f
232
+ }), !f)
233
+ ft(r, e.fxprime, -1);
234
+ else {
235
+ Z(o, 1, i.fxprime, -1, e.fxprime);
236
+ const y = $(e.fxprime, e.fxprime), h = Math.max(0, $(o, i.fxprime) / y);
237
+ Z(r, h, r, -1, i.fxprime), l = e, e = i, i = l;
238
+ }
239
+ if (ut(e.fxprime) <= 1e-5)
240
+ break;
241
+ }
242
+ return s.history && s.history.push({
243
+ x: e.x.slice(),
244
+ fx: e.fx,
245
+ fxprime: e.fxprime.slice(),
246
+ alpha: f
247
+ }), e;
248
+ }
249
+ function At(t, n = {}) {
250
+ n.maxIterations = n.maxIterations || 500;
251
+ const s = n.initialLayout || xe, e = n.lossFunction || tt, i = he(t, n), o = s(i, n), r = Object.keys(o), l = [];
252
+ for (const a of r)
253
+ l.push(o[a].x), l.push(o[a].y);
254
+ const u = zt(
255
+ (a) => {
256
+ const y = {};
257
+ for (let h = 0; h < r.length; ++h) {
258
+ const b = r[h];
259
+ y[b] = {
260
+ x: a[2 * h],
261
+ y: a[2 * h + 1],
262
+ radius: o[b].radius
263
+ // size : circles[setid].size
264
+ };
265
+ }
266
+ return e(y, i);
267
+ },
268
+ l,
269
+ n
270
+ ).x;
271
+ for (let a = 0; a < r.length; ++a) {
272
+ const y = r[a];
273
+ o[y].x = u[2 * a], o[y].y = u[2 * a + 1];
274
+ }
275
+ return o;
276
+ }
277
+ const Rt = 1e-10;
278
+ function ht(t, n, s) {
279
+ return Math.min(t, n) * Math.min(t, n) * Math.PI <= s + Rt ? Math.abs(t - n) : ce((e) => xt(t, n, e) - s, 0, t + n);
280
+ }
281
+ function he(t, n = {}) {
282
+ const s = n.distinct, e = t.map((l) => Object.assign({}, l));
283
+ function i(l) {
284
+ return l.join(";");
285
+ }
286
+ if (s) {
287
+ const l = /* @__PURE__ */ new Map();
288
+ for (const f of e)
289
+ for (let u = 0; u < f.sets.length; u++) {
290
+ const a = String(f.sets[u]);
291
+ l.set(a, f.size + (l.get(a) || 0));
292
+ for (let y = u + 1; y < f.sets.length; y++) {
293
+ const h = String(f.sets[y]), b = `${a};${h}`, p = `${h};${a}`;
294
+ l.set(b, f.size + (l.get(b) || 0)), l.set(p, f.size + (l.get(p) || 0));
295
+ }
296
+ }
297
+ for (const f of e)
298
+ f.sets.length < 3 && (f.size = l.get(i(f.sets)));
299
+ }
300
+ const o = [], r = /* @__PURE__ */ new Set();
301
+ for (const l of e)
302
+ if (l.sets.length === 1)
303
+ o.push(l.sets[0]);
304
+ else if (l.sets.length === 2) {
305
+ const f = l.sets[0], u = l.sets[1];
306
+ r.add(i(l.sets)), r.add(i([u, f]));
307
+ }
308
+ o.sort((l, f) => l === f ? 0 : l < f ? -1 : 1);
309
+ for (let l = 0; l < o.length; ++l) {
310
+ const f = o[l];
311
+ for (let u = l + 1; u < o.length; ++u) {
312
+ const a = o[u];
313
+ r.has(i([f, a])) || e.push({ sets: [f, a], size: 0 });
314
+ }
315
+ }
316
+ return e;
317
+ }
318
+ function de(t, n, s) {
319
+ const e = Mt(n.length, n.length), i = Mt(n.length, n.length);
320
+ return t.filter((o) => o.sets.length === 2).forEach((o) => {
321
+ const r = s[o.sets[0]], l = s[o.sets[1]], f = Math.sqrt(n[r].size / Math.PI), u = Math.sqrt(n[l].size / Math.PI), a = ht(f, u, o.size);
322
+ e[r][l] = e[l][r] = a;
323
+ let y = 0;
324
+ o.size + 1e-10 >= Math.min(n[r].size, n[l].size) ? y = 1 : o.size <= 1e-10 && (y = -1), i[r][l] = i[l][r] = y;
325
+ }), { distances: e, constraints: i };
326
+ }
327
+ function ge(t, n, s, e) {
328
+ for (let o = 0; o < n.length; ++o)
329
+ n[o] = 0;
330
+ let i = 0;
331
+ for (let o = 0; o < s.length; ++o) {
332
+ const r = t[2 * o], l = t[2 * o + 1];
333
+ for (let f = o + 1; f < s.length; ++f) {
334
+ const u = t[2 * f], a = t[2 * f + 1], y = s[o][f], h = e[o][f], b = (u - r) * (u - r) + (a - l) * (a - l), p = Math.sqrt(b), M = b - y * y;
335
+ h > 0 && p <= y || h < 0 && p >= y || (i += 2 * M * M, n[2 * o] += 4 * M * (r - u), n[2 * o + 1] += 4 * M * (l - a), n[2 * f] += 4 * M * (u - r), n[2 * f + 1] += 4 * M * (a - l));
336
+ }
337
+ }
338
+ return i;
339
+ }
340
+ function xe(t, n = {}) {
341
+ let s = pe(t, n);
342
+ const e = n.lossFunction || tt;
343
+ if (t.length >= 8) {
344
+ const i = ye(t, n), o = e(i, t), r = e(s, t);
345
+ o + 1e-8 < r && (s = i);
346
+ }
347
+ return s;
348
+ }
349
+ function ye(t, n = {}) {
350
+ const s = n.restarts || 10, e = [], i = {};
351
+ for (const h of t)
352
+ h.sets.length === 1 && (i[h.sets[0]] = e.length, e.push(h));
353
+ let { distances: o, constraints: r } = de(t, e, i);
354
+ const l = ut(o.map(ut)) / o.length;
355
+ o = o.map((h) => h.map((b) => b / l));
356
+ const f = (h, b) => ge(h, b, o, r);
357
+ let u = null;
358
+ for (let h = 0; h < s; ++h) {
359
+ const b = ct(o.length * 2).map(Math.random), p = fe(f, b, n);
360
+ (!u || p.fx < u.fx) && (u = p);
361
+ }
362
+ const a = u.x, y = {};
363
+ for (let h = 0; h < e.length; ++h) {
364
+ const b = e[h];
365
+ y[b.sets[0]] = {
366
+ x: a[2 * h] * l,
367
+ y: a[2 * h + 1] * l,
368
+ radius: Math.sqrt(b.size / Math.PI)
369
+ };
370
+ }
371
+ if (n.history)
372
+ for (const h of n.history)
373
+ ft(h.x, l);
374
+ return y;
375
+ }
376
+ function pe(t, n) {
377
+ const s = n && n.lossFunction ? n.lossFunction : tt, e = {}, i = {};
378
+ for (const y of t)
379
+ if (y.sets.length === 1) {
380
+ const h = y.sets[0];
381
+ e[h] = {
382
+ x: 1e10,
383
+ y: 1e10,
384
+ rowid: e.length,
385
+ size: y.size,
386
+ radius: Math.sqrt(y.size / Math.PI)
387
+ }, i[h] = [];
388
+ }
389
+ t = t.filter((y) => y.sets.length === 2);
390
+ for (const y of t) {
391
+ let h = y.weight != null ? y.weight : 1;
392
+ const b = y.sets[0], p = y.sets[1];
393
+ y.size + Rt >= Math.min(e[b].size, e[p].size) && (h = 0), i[b].push({ set: p, size: y.size, weight: h }), i[p].push({ set: b, size: y.size, weight: h });
394
+ }
395
+ const o = [];
396
+ Object.keys(i).forEach((y) => {
397
+ let h = 0;
398
+ for (let b = 0; b < i[y].length; ++b)
399
+ h += i[y][b].size * i[y][b].weight;
400
+ o.push({ set: y, size: h });
401
+ });
402
+ function r(y, h) {
403
+ return h.size - y.size;
404
+ }
405
+ o.sort(r);
406
+ const l = {};
407
+ function f(y) {
408
+ return y.set in l;
409
+ }
410
+ function u(y, h) {
411
+ e[h].x = y.x, e[h].y = y.y, l[h] = !0;
412
+ }
413
+ u({ x: 0, y: 0 }, o[0].set);
414
+ for (let y = 1; y < o.length; ++y) {
415
+ const h = o[y].set, b = i[h].filter(f), p = e[h];
416
+ if (b.sort(r), b.length === 0)
417
+ throw "ERROR: missing pairwise overlap information";
418
+ const M = [];
419
+ for (var a = 0; a < b.length; ++a) {
420
+ const S = e[b[a].set], g = ht(p.radius, S.radius, b[a].size);
421
+ M.push({ x: S.x + g, y: S.y }), M.push({ x: S.x - g, y: S.y }), M.push({ y: S.y + g, x: S.x }), M.push({ y: S.y - g, x: S.x });
422
+ for (let m = a + 1; m < b.length; ++m) {
423
+ const v = e[b[m].set], c = ht(p.radius, v.radius, b[m].size), x = Tt(
424
+ { x: S.x, y: S.y, radius: g },
425
+ { x: v.x, y: v.y, radius: c }
426
+ );
427
+ M.push(...x);
428
+ }
429
+ }
430
+ let E = 1e50, _ = M[0];
431
+ for (const S of M) {
432
+ e[h].x = S.x, e[h].y = S.y;
433
+ const g = s(e, t);
434
+ g < E && (E = g, _ = S);
435
+ }
436
+ u(_, h);
437
+ }
438
+ return e;
439
+ }
440
+ function tt(t, n) {
441
+ let s = 0;
442
+ for (const e of n) {
443
+ if (e.sets.length === 1)
444
+ continue;
445
+ let i;
446
+ if (e.sets.length === 2) {
447
+ const r = t[e.sets[0]], l = t[e.sets[1]];
448
+ i = xt(r.radius, l.radius, q(r, l));
449
+ } else
450
+ i = st(e.sets.map((r) => t[r]));
451
+ const o = e.weight != null ? e.weight : 1;
452
+ s += o * (i - e.size) * (i - e.size);
453
+ }
454
+ return s;
455
+ }
456
+ function Ct(t, n) {
457
+ let s = 0;
458
+ for (const e of n) {
459
+ if (e.sets.length === 1)
460
+ continue;
461
+ let i;
462
+ if (e.sets.length === 2) {
463
+ const l = t[e.sets[0]], f = t[e.sets[1]];
464
+ i = xt(l.radius, f.radius, q(l, f));
465
+ } else
466
+ i = st(e.sets.map((l) => t[l]));
467
+ const o = e.weight != null ? e.weight : 1, r = Math.log((i + 1) / (e.size + 1));
468
+ s += o * r * r;
469
+ }
470
+ return s;
471
+ }
472
+ function me(t, n, s) {
473
+ if (s == null ? t.sort((i, o) => o.radius - i.radius) : t.sort(s), t.length > 0) {
474
+ const i = t[0].x, o = t[0].y;
475
+ for (const r of t)
476
+ r.x -= i, r.y -= o;
477
+ }
478
+ 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) {
479
+ const i = Math.atan2(t[1].x, t[1].y) - n, o = Math.cos(i), r = Math.sin(i);
480
+ for (const l of t) {
481
+ const f = l.x, u = l.y;
482
+ l.x = o * f - r * u, l.y = r * f + o * u;
483
+ }
484
+ }
485
+ if (t.length > 2) {
486
+ let i = Math.atan2(t[2].x, t[2].y) - n;
487
+ for (; i < 0; )
488
+ i += 2 * Math.PI;
489
+ for (; i > 2 * Math.PI; )
490
+ i -= 2 * Math.PI;
491
+ if (i > Math.PI) {
492
+ const o = t[1].y / (1e-10 + t[1].x);
493
+ for (const r of t) {
494
+ var e = (r.x + o * r.y) / (1 + o * o);
495
+ r.x = 2 * e - r.x, r.y = 2 * e * o - r.y;
496
+ }
497
+ }
498
+ }
499
+ }
500
+ function be(t) {
501
+ t.forEach((i) => {
502
+ i.parent = i;
503
+ });
504
+ function n(i) {
505
+ return i.parent !== i && (i.parent = n(i.parent)), i.parent;
506
+ }
507
+ function s(i, o) {
508
+ const r = n(i), l = n(o);
509
+ r.parent = l;
510
+ }
511
+ for (let i = 0; i < t.length; ++i)
512
+ for (let o = i + 1; o < t.length; ++o) {
513
+ const r = t[i].radius + t[o].radius;
514
+ q(t[i], t[o]) + 1e-10 < r && s(t[o], t[i]);
515
+ }
516
+ const e = /* @__PURE__ */ new Map();
517
+ for (let i = 0; i < t.length; ++i) {
518
+ const o = n(t[i]).parent.setid;
519
+ e.has(o) || e.set(o, []), e.get(o).push(t[i]);
520
+ }
521
+ return t.forEach((i) => {
522
+ delete i.parent;
523
+ }), Array.from(e.values());
524
+ }
525
+ function dt(t) {
526
+ const n = (s) => {
527
+ const e = t.reduce((o, r) => Math.max(o, r[s] + r.radius), Number.NEGATIVE_INFINITY), i = t.reduce((o, r) => Math.min(o, r[s] - r.radius), Number.POSITIVE_INFINITY);
528
+ return { max: e, min: i };
529
+ };
530
+ return { xRange: n("x"), yRange: n("y") };
531
+ }
532
+ function Dt(t, n, s) {
533
+ n == null && (n = Math.PI / 2);
534
+ let e = Ft(t).map((u) => Object.assign({}, u));
535
+ const i = be(e);
536
+ for (const u of i) {
537
+ me(u, n, s);
538
+ const a = dt(u);
539
+ u.size = (a.xRange.max - a.xRange.min) * (a.yRange.max - a.yRange.min), u.bounds = a;
540
+ }
541
+ i.sort((u, a) => a.size - u.size), e = i[0];
542
+ let o = e.bounds;
543
+ const r = (o.xRange.max - o.xRange.min) / 50;
544
+ function l(u, a, y) {
545
+ if (!u)
546
+ return;
547
+ const h = u.bounds;
548
+ let b, p;
549
+ if (a)
550
+ b = o.xRange.max - h.xRange.min + r;
551
+ else {
552
+ b = o.xRange.max - h.xRange.max;
553
+ const M = (h.xRange.max - h.xRange.min) / 2 - (o.xRange.max - o.xRange.min) / 2;
554
+ M < 0 && (b += M);
555
+ }
556
+ if (y)
557
+ p = o.yRange.max - h.yRange.min + r;
558
+ else {
559
+ p = o.yRange.max - h.yRange.max;
560
+ const M = (h.yRange.max - h.yRange.min) / 2 - (o.yRange.max - o.yRange.min) / 2;
561
+ M < 0 && (p += M);
562
+ }
563
+ for (const M of u)
564
+ M.x += b, M.y += p, e.push(M);
565
+ }
566
+ let f = 1;
567
+ for (; f < i.length; )
568
+ l(i[f], !0, !1), l(i[f + 1], !1, !0), l(i[f + 2], !0, !0), f += 3, o = dt(e);
569
+ return Nt(e);
570
+ }
571
+ function Ot(t, n, s, e, i) {
572
+ const o = Ft(t);
573
+ n -= 2 * e, s -= 2 * e;
574
+ const { xRange: r, yRange: l } = dt(o);
575
+ if (r.max === r.min || l.max === l.min)
576
+ return console.log("not scaling solution: zero size detected"), t;
577
+ let f, u;
578
+ if (i) {
579
+ const b = Math.sqrt(i / Math.PI) * 2;
580
+ f = n / b, u = s / b;
581
+ } else
582
+ f = n / (r.max - r.min), u = s / (l.max - l.min);
583
+ const a = Math.min(u, f), y = (n - (r.max - r.min) * a) / 2, h = (s - (l.max - l.min) * a) / 2;
584
+ return Nt(
585
+ o.map((b) => ({
586
+ radius: a * b.radius,
587
+ x: e + y + (b.x - r.min) * a,
588
+ y: e + h + (b.y - l.min) * a,
589
+ setid: b.setid
590
+ }))
591
+ );
592
+ }
593
+ function Nt(t) {
594
+ const n = {};
595
+ for (const s of t)
596
+ n[s.setid] = s;
597
+ return n;
598
+ }
599
+ function Ft(t) {
600
+ return Object.keys(t).map((s) => Object.assign(t[s], { setid: s }));
601
+ }
602
+ function ve(t = {}) {
603
+ let n = !1, s = 600, e = 350, i = 15, o = 1e3, r = Math.PI / 2, l = !0, f = null, u = !0, a = !0, y = null, h = null, b = !1, p = null, M = t && t.symmetricalTextCentre ? t.symmetricalTextCentre : !1, E = {}, _ = t && t.colourScheme ? t.colourScheme : t && t.colorScheme ? t.colorScheme : [
604
+ "#1f77b4",
605
+ "#ff7f0e",
606
+ "#2ca02c",
607
+ "#d62728",
608
+ "#9467bd",
609
+ "#8c564b",
610
+ "#e377c2",
611
+ "#7f7f7f",
612
+ "#bcbd22",
613
+ "#17becf"
614
+ ], S = 0, g = function(x) {
615
+ if (x in E)
616
+ return E[x];
617
+ var d = E[x] = _[S];
618
+ return S += 1, S >= _.length && (S = 0), d;
619
+ }, m = At, v = tt;
620
+ function c(x) {
621
+ let d = x.datum();
622
+ const C = /* @__PURE__ */ new Set();
623
+ d.forEach((I) => {
624
+ I.size == 0 && I.sets.length == 1 && C.add(I.sets[0]);
625
+ }), d = d.filter((I) => !I.sets.some((O) => C.has(O)));
626
+ let k = {}, D = {};
627
+ if (d.length > 0) {
628
+ let I = m(d, { lossFunction: v, distinct: b });
629
+ l && (I = Dt(I, r, h)), k = Ot(I, s, e, i, f), D = Lt(k, d, M);
630
+ }
631
+ const U = {};
632
+ d.forEach((I) => {
633
+ I.label && (U[I.sets] = I.label);
634
+ });
635
+ function V(I) {
636
+ if (I.sets in U)
637
+ return U[I.sets];
638
+ if (I.sets.length == 1)
639
+ return "" + I.sets[0];
640
+ }
641
+ x.selectAll("svg").data([k]).enter().append("svg");
642
+ const F = x.select("svg");
643
+ n ? F.attr("viewBox", `0 0 ${s} ${e}`) : F.attr("width", s).attr("height", e);
644
+ const R = {};
645
+ let T = !1;
646
+ F.selectAll(".venn-area path").each(function(I) {
647
+ const O = this.getAttribute("d");
648
+ I.sets.length == 1 && O && !b && (T = !0, R[I.sets[0]] = Me(O));
649
+ });
650
+ function A(I) {
651
+ return (O) => {
652
+ const K = I.sets.map((et) => {
653
+ let Y = R[et], X = k[et];
654
+ return Y || (Y = { x: s / 2, y: e / 2, radius: 1 }), X || (X = { x: s / 2, y: e / 2, radius: 1 }), {
655
+ x: Y.x * (1 - O) + X.x * O,
656
+ y: Y.y * (1 - O) + X.y * O,
657
+ radius: Y.radius * (1 - O) + X.radius * O
658
+ };
659
+ });
660
+ return St(K, p);
661
+ };
662
+ }
663
+ const G = F.selectAll(".venn-area").data(d, (I) => I.sets), P = G.enter().append("g").attr(
664
+ "class",
665
+ (I) => `venn-area venn-${I.sets.length == 1 ? "circle" : "intersection"}${I.colour || I.color ? " venn-coloured" : ""}`
666
+ ).attr("data-venn-sets", (I) => I.sets.join("_")), B = P.append("path"), W = 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);
667
+ a && (B.style("fill-opacity", "0").filter((I) => I.sets.length == 1).style("fill", (I) => I.colour ? I.colour : I.color ? I.color : g(I.sets)).style("fill-opacity", ".25"), W.style("fill", (I) => I.colour || I.color ? "#FFF" : t.textFill ? t.textFill : I.sets.length == 1 ? g(I.sets) : "#444"));
668
+ function L(I) {
669
+ return typeof I.transition == "function" ? I.transition("venn").duration(o) : I;
670
+ }
671
+ let z = x;
672
+ T && typeof z.transition == "function" ? (z = L(x), z.selectAll("path").attrTween("d", A)) : z.selectAll("path").attr("d", (I) => St(I.sets.map((O) => k[O])), p);
673
+ 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));
674
+ u && (T ? "on" in N ? N.on("end", rt(k, V)) : N.each("end", rt(k, V)) : N.each(rt(k, V)));
675
+ const j = L(G.exit()).remove();
676
+ typeof G.transition == "function" && j.selectAll("path").attrTween("d", A);
677
+ const J = j.selectAll("text").attr("x", s / 2).attr("y", e / 2);
678
+ return y !== null && (W.style("font-size", "0px"), N.style("font-size", y), J.style("font-size", "0px")), { circles: k, textCentres: D, nodes: G, enter: P, update: z, exit: j };
679
+ }
680
+ return c.wrap = function(x) {
681
+ return arguments.length ? (u = x, c) : u;
682
+ }, c.useViewBox = function() {
683
+ return n = !0, c;
684
+ }, c.width = function(x) {
685
+ return arguments.length ? (s = x, c) : s;
686
+ }, c.height = function(x) {
687
+ return arguments.length ? (e = x, c) : e;
688
+ }, c.padding = function(x) {
689
+ return arguments.length ? (i = x, c) : i;
690
+ }, c.distinct = function(x) {
691
+ return arguments.length ? (b = x, c) : b;
692
+ }, c.colours = function(x) {
693
+ return arguments.length ? (g = x, c) : g;
694
+ }, c.colors = function(x) {
695
+ return arguments.length ? (g = x, c) : g;
696
+ }, c.fontSize = function(x) {
697
+ return arguments.length ? (y = x, c) : y;
698
+ }, c.round = function(x) {
699
+ return arguments.length ? (p = x, c) : p;
700
+ }, c.duration = function(x) {
701
+ return arguments.length ? (o = x, c) : o;
702
+ }, c.layoutFunction = function(x) {
703
+ return arguments.length ? (m = x, c) : m;
704
+ }, c.normalize = function(x) {
705
+ return arguments.length ? (l = x, c) : l;
706
+ }, c.scaleToFit = function(x) {
707
+ return arguments.length ? (f = x, c) : f;
708
+ }, c.styled = function(x) {
709
+ return arguments.length ? (a = x, c) : a;
710
+ }, c.orientation = function(x) {
711
+ return arguments.length ? (r = x, c) : r;
712
+ }, c.orientationOrder = function(x) {
713
+ return arguments.length ? (h = x, c) : h;
714
+ }, c.lossFunction = function(x) {
715
+ return arguments.length ? (v = x === "default" ? tt : x === "logRatio" ? Ct : x, c) : v;
716
+ }, c;
717
+ }
718
+ function rt(t, n) {
719
+ return function(s) {
720
+ const e = this, i = t[s.sets[0]].radius || 50, o = n(s) || "", r = o.split(/\s+/).reverse(), f = (o.length + r.length) / 3;
721
+ let u = r.pop(), a = [u], y = 0;
722
+ const h = 1.1;
723
+ e.textContent = null;
724
+ const b = [];
725
+ function p(g) {
726
+ const m = e.ownerDocument.createElementNS(e.namespaceURI, "tspan");
727
+ return m.textContent = g, b.push(m), e.append(m), m;
728
+ }
729
+ let M = p(u);
730
+ for (; u = r.pop(), !!u; ) {
731
+ a.push(u);
732
+ const g = a.join(" ");
733
+ M.textContent = g, g.length > f && M.getComputedTextLength() > i && (a.pop(), M.textContent = a.join(" "), a = [u], M = p(u), y++);
734
+ }
735
+ const E = 0.35 - y * h / 2, _ = e.getAttribute("x"), S = e.getAttribute("y");
736
+ b.forEach((g, m) => {
737
+ g.setAttribute("x", _), g.setAttribute("y", S), g.setAttribute("dy", `${E + m * h}em`);
738
+ });
739
+ };
740
+ }
741
+ function at(t, n, s) {
742
+ let e = n[0].radius - q(n[0], t);
743
+ for (let i = 1; i < n.length; ++i) {
744
+ const o = n[i].radius - q(n[i], t);
745
+ o <= e && (e = o);
746
+ }
747
+ for (let i = 0; i < s.length; ++i) {
748
+ const o = q(s[i], t) - s[i].radius;
749
+ o <= e && (e = o);
750
+ }
751
+ return e;
752
+ }
753
+ function jt(t, n, s) {
754
+ const e = [];
755
+ for (const a of t)
756
+ 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 });
757
+ let i = e[0], o = at(e[0], t, n);
758
+ for (let a = 1; a < e.length; ++a) {
759
+ const y = at(e[a], t, n);
760
+ y >= o && (i = e[a], o = y);
761
+ }
762
+ const r = zt(
763
+ (a) => -1 * at({ x: a[0], y: a[1] }, t, n),
764
+ [i.x, i.y],
765
+ { maxIterations: 500, minErrorDelta: 1e-10 }
766
+ ).x, l = { x: s ? 0 : r[0], y: r[1] };
767
+ let f = !0;
768
+ for (const a of t)
769
+ if (q(l, a) > a.radius) {
770
+ f = !1;
771
+ break;
772
+ }
773
+ for (const a of n)
774
+ if (q(l, a) < a.radius) {
775
+ f = !1;
776
+ break;
777
+ }
778
+ if (f)
779
+ return l;
780
+ if (t.length == 1)
781
+ return { x: t[0].x, y: t[0].y };
782
+ const u = {};
783
+ 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));
784
+ }
785
+ function ke(t) {
786
+ const n = {}, s = Object.keys(t);
787
+ for (const e of s)
788
+ n[e] = [];
789
+ for (let e = 0; e < s.length; e++) {
790
+ const i = s[e], o = t[i];
791
+ for (let r = e + 1; r < s.length; ++r) {
792
+ const l = s[r], f = t[l], u = q(o, f);
793
+ u + f.radius <= o.radius + 1e-10 ? n[l].push(i) : u + o.radius <= f.radius + 1e-10 && n[i].push(l);
794
+ }
795
+ }
796
+ return n;
797
+ }
798
+ function Lt(t, n, s) {
799
+ const e = {}, i = ke(t);
800
+ for (let o = 0; o < n.length; ++o) {
801
+ const r = n[o].sets, l = {}, f = {};
802
+ for (let h = 0; h < r.length; ++h) {
803
+ l[r[h]] = !0;
804
+ const b = i[r[h]];
805
+ for (let p = 0; p < b.length; ++p)
806
+ f[b[p]] = !0;
807
+ }
808
+ const u = [], a = [];
809
+ for (let h in t)
810
+ h in l ? u.push(t[h]) : h in f || a.push(t[h]);
811
+ const y = jt(u, a, s);
812
+ e[r] = y, y.disjoint && n[o].size > 0 && console.log("WARNING: area " + r + " not represented on screen");
813
+ }
814
+ return e;
815
+ }
816
+ function Ie(t, n, s) {
817
+ const e = [];
818
+ return e.push(`
819
+ M`, t, n), e.push(`
820
+ m`, -s, 0), e.push(`
821
+ a`, s, s, 0, 1, 0, s * 2, 0), e.push(`
822
+ a`, s, s, 0, 1, 0, -s * 2, 0), e.join(" ");
823
+ }
824
+ function Me(t) {
825
+ const n = t.split(" ");
826
+ return { x: Number.parseFloat(n[1]), y: Number.parseFloat(n[2]), radius: -Number.parseFloat(n[4]) };
827
+ }
828
+ function Pt(t) {
829
+ if (t.length === 0)
830
+ return [];
831
+ const n = {};
832
+ return st(t, n), n.arcs;
833
+ }
834
+ function Bt(t, n) {
835
+ if (t.length === 0)
836
+ return "M 0 0";
837
+ const s = Math.pow(10, n || 0), e = n != null ? (o) => Math.round(o * s) / s : (o) => o;
838
+ if (t.length == 1) {
839
+ const o = t[0].circle;
840
+ return Ie(e(o.x), e(o.y), e(o.radius));
841
+ }
842
+ const i = [`
843
+ M`, e(t[0].p2.x), e(t[0].p2.y)];
844
+ for (const o of t) {
845
+ const r = e(o.circle.radius);
846
+ i.push(`
847
+ A`, r, r, 0, o.large ? 1 : 0, o.sweep ? 1 : 0, e(o.p1.x), e(o.p1.y));
848
+ }
849
+ return i.join(" ");
850
+ }
851
+ function St(t, n) {
852
+ return Bt(Pt(t), n);
853
+ }
854
+ function Se(t, n = {}) {
855
+ const {
856
+ lossFunction: s,
857
+ layoutFunction: e = At,
858
+ normalize: i = !0,
859
+ orientation: o = Math.PI / 2,
860
+ orientationOrder: r,
861
+ width: l = 600,
862
+ height: f = 350,
863
+ padding: u = 15,
864
+ scaleToFit: a = !1,
865
+ symmetricalTextCentre: y = !1,
866
+ distinct: h,
867
+ round: b = 2
868
+ } = n;
869
+ let p = e(t, {
870
+ lossFunction: s === "default" || !s ? tt : s === "logRatio" ? Ct : s,
871
+ distinct: h
872
+ });
873
+ i && (p = Dt(p, o, r));
874
+ const M = Ot(p, l, f, u, a), E = Lt(M, t, y), _ = new Map(
875
+ Object.keys(M).map((m) => [
876
+ m,
877
+ {
878
+ set: m,
879
+ x: M[m].x,
880
+ y: M[m].y,
881
+ radius: M[m].radius
882
+ }
883
+ ])
884
+ ), S = t.map((m) => {
885
+ const v = m.sets.map((d) => _.get(d)), c = Pt(v), x = Bt(c, b);
886
+ return { circles: v, arcs: c, path: x, area: m, has: new Set(m.sets) };
887
+ });
888
+ function g(m) {
889
+ let v = "";
890
+ for (const c of S)
891
+ c.has.size > m.length && m.every((x) => c.has.has(x)) && (v += " " + c.path);
892
+ return v;
893
+ }
894
+ return S.map(({ circles: m, arcs: v, path: c, area: x }) => ({
895
+ data: x,
896
+ text: E[x.sets],
897
+ circles: m,
898
+ arcs: v,
899
+ path: c,
900
+ distinctPath: c + g(x.sets)
901
+ }));
902
+ }
903
+ var gt = (function() {
904
+ var t = /* @__PURE__ */ w(function(S, g, m, v) {
905
+ for (m = m || {}, v = S.length; v--; m[S[v]] = g) ;
906
+ return m;
907
+ }, "o"), n = [5, 8], s = [7, 8, 11, 12, 17, 19, 22, 24], e = [1, 17], i = [1, 18], o = [7, 8, 11, 12, 14, 15, 16, 17, 19, 20, 21, 22, 24, 27], r = [1, 31], l = [1, 39], f = [7, 8, 11, 12, 17, 19, 22, 24, 27], u = [1, 57], a = [1, 56], y = [1, 58], h = [1, 59], b = [1, 60], p = [7, 8, 11, 12, 16, 17, 19, 20, 22, 24, 27, 31, 32, 33], M = {
908
+ trace: /* @__PURE__ */ w(function() {
909
+ }, "trace"),
910
+ yy: {},
911
+ symbols_: { error: 2, start: 3, optNewlines: 4, VENN: 5, document: 6, EOF: 7, NEWLINE: 8, line: 9, statement: 10, TITLE: 11, SET: 12, identifier: 13, BRACKET_LABEL: 14, COLON: 15, NUMERIC: 16, UNION: 17, identifierList: 18, TEXT: 19, IDENTIFIER: 20, STRING: 21, INDENT_TEXT: 22, indentedTextTail: 23, STYLE: 24, stylesOpt: 25, styleField: 26, COMMA: 27, styleValue: 28, valueTokens: 29, valueToken: 30, HEXCOLOR: 31, RGBCOLOR: 32, RGBACOLOR: 33, $accept: 0, $end: 1 },
912
+ terminals_: { 2: "error", 5: "VENN", 7: "EOF", 8: "NEWLINE", 11: "TITLE", 12: "SET", 14: "BRACKET_LABEL", 15: "COLON", 16: "NUMERIC", 17: "UNION", 19: "TEXT", 20: "IDENTIFIER", 21: "STRING", 22: "INDENT_TEXT", 24: "STYLE", 27: "COMMA", 31: "HEXCOLOR", 32: "RGBCOLOR", 33: "RGBACOLOR" },
913
+ productions_: [0, [3, 4], [4, 0], [4, 2], [6, 0], [6, 2], [9, 1], [9, 1], [10, 1], [10, 2], [10, 3], [10, 4], [10, 5], [10, 2], [10, 3], [10, 4], [10, 5], [10, 3], [10, 3], [10, 3], [10, 4], [10, 4], [10, 2], [10, 3], [23, 1], [23, 1], [23, 1], [23, 2], [23, 2], [25, 1], [25, 3], [26, 3], [28, 1], [28, 1], [29, 1], [29, 2], [30, 1], [30, 1], [30, 1], [30, 1], [30, 1], [18, 1], [18, 3], [13, 1], [13, 1]],
914
+ performAction: /* @__PURE__ */ w(function(g, m, v, c, x, d, C) {
915
+ var k = d.length - 1;
916
+ switch (x) {
917
+ case 1:
918
+ return d[k - 1];
919
+ case 2:
920
+ case 3:
921
+ case 4:
922
+ this.$ = [];
923
+ break;
924
+ case 5:
925
+ d[k - 1].push(d[k]), this.$ = d[k - 1];
926
+ break;
927
+ case 6:
928
+ this.$ = [];
929
+ break;
930
+ case 7:
931
+ case 22:
932
+ case 32:
933
+ case 36:
934
+ case 37:
935
+ case 38:
936
+ case 39:
937
+ case 40:
938
+ this.$ = d[k];
939
+ break;
940
+ case 8:
941
+ c.setDiagramTitle(d[k].substr(6)), this.$ = d[k].substr(6);
942
+ break;
943
+ case 9:
944
+ c.addSubsetData([d[k]], void 0, void 0), c.setIndentMode && c.setIndentMode(!0);
945
+ break;
946
+ case 10:
947
+ c.addSubsetData([d[k - 1]], d[k], void 0), c.setIndentMode && c.setIndentMode(!0);
948
+ break;
949
+ case 11:
950
+ c.addSubsetData([d[k - 2]], void 0, parseFloat(d[k])), c.setIndentMode && c.setIndentMode(!0);
951
+ break;
952
+ case 12:
953
+ c.addSubsetData([d[k - 3]], d[k - 2], parseFloat(d[k])), c.setIndentMode && c.setIndentMode(!0);
954
+ break;
955
+ case 13:
956
+ if (d[k].length < 2)
957
+ throw new Error("union requires multiple identifiers");
958
+ c.validateUnionIdentifiers && c.validateUnionIdentifiers(d[k]), c.addSubsetData(d[k], void 0, void 0), c.setIndentMode && c.setIndentMode(!0);
959
+ break;
960
+ case 14:
961
+ if (d[k - 1].length < 2)
962
+ throw new Error("union requires multiple identifiers");
963
+ c.validateUnionIdentifiers && c.validateUnionIdentifiers(d[k - 1]), c.addSubsetData(d[k - 1], d[k], void 0), c.setIndentMode && c.setIndentMode(!0);
964
+ break;
965
+ case 15:
966
+ if (d[k - 2].length < 2)
967
+ throw new Error("union requires multiple identifiers");
968
+ c.validateUnionIdentifiers && c.validateUnionIdentifiers(d[k - 2]), c.addSubsetData(d[k - 2], void 0, parseFloat(d[k])), c.setIndentMode && c.setIndentMode(!0);
969
+ break;
970
+ case 16:
971
+ if (d[k - 3].length < 2)
972
+ throw new Error("union requires multiple identifiers");
973
+ c.validateUnionIdentifiers && c.validateUnionIdentifiers(d[k - 3]), c.addSubsetData(d[k - 3], d[k - 2], parseFloat(d[k])), c.setIndentMode && c.setIndentMode(!0);
974
+ break;
975
+ case 17:
976
+ case 18:
977
+ case 19:
978
+ c.addTextData(d[k - 1], d[k], void 0);
979
+ break;
980
+ case 20:
981
+ case 21:
982
+ c.addTextData(d[k - 2], d[k - 1], d[k]);
983
+ break;
984
+ case 23:
985
+ c.addStyleData(d[k - 1], d[k]);
986
+ break;
987
+ case 24:
988
+ case 25:
989
+ case 26:
990
+ var D = c.getCurrentSets();
991
+ if (!D) throw new Error("text requires set");
992
+ c.addTextData(D, d[k], void 0);
993
+ break;
994
+ case 27:
995
+ case 28:
996
+ var D = c.getCurrentSets();
997
+ if (!D) throw new Error("text requires set");
998
+ c.addTextData(D, d[k - 1], d[k]);
999
+ break;
1000
+ case 29:
1001
+ case 41:
1002
+ this.$ = [d[k]];
1003
+ break;
1004
+ case 30:
1005
+ case 42:
1006
+ this.$ = [...d[k - 2], d[k]];
1007
+ break;
1008
+ case 31:
1009
+ this.$ = [d[k - 2], d[k]];
1010
+ break;
1011
+ case 33:
1012
+ this.$ = d[k].join(" ");
1013
+ break;
1014
+ case 34:
1015
+ this.$ = [d[k]];
1016
+ break;
1017
+ case 35:
1018
+ d[k - 1].push(d[k]), this.$ = d[k - 1];
1019
+ break;
1020
+ case 43:
1021
+ case 44:
1022
+ this.$ = d[k];
1023
+ break;
1024
+ }
1025
+ }, "anonymous"),
1026
+ table: [t(n, [2, 2], { 3: 1, 4: 2 }), { 1: [3] }, { 5: [1, 3], 8: [1, 4] }, t(s, [2, 4], { 6: 5 }), t(n, [2, 3]), { 7: [1, 6], 8: [1, 8], 9: 7, 10: 9, 11: [1, 10], 12: [1, 11], 17: [1, 12], 19: [1, 13], 22: [1, 14], 24: [1, 15] }, { 1: [2, 1] }, t(s, [2, 5]), t(s, [2, 6]), t(s, [2, 7]), t(s, [2, 8]), { 13: 16, 20: e, 21: i }, { 13: 20, 18: 19, 20: e, 21: i }, { 13: 20, 18: 21, 20: e, 21: i }, { 16: [1, 25], 20: [1, 23], 21: [1, 24], 23: 22 }, { 13: 20, 18: 26, 20: e, 21: i }, t(s, [2, 9], { 14: [1, 27], 15: [1, 28] }), t(o, [2, 43]), t(o, [2, 44]), t(s, [2, 13], { 14: [1, 29], 15: [1, 30], 27: r }), t(o, [2, 41]), { 16: [1, 34], 20: [1, 32], 21: [1, 33], 27: r }, t(s, [2, 22]), t(s, [2, 24], { 14: [1, 35] }), t(s, [2, 25], { 14: [1, 36] }), t(s, [2, 26]), { 20: l, 25: 37, 26: 38, 27: r }, t(s, [2, 10], { 15: [1, 40] }), { 16: [1, 41] }, t(s, [2, 14], { 15: [1, 42] }), { 16: [1, 43] }, { 13: 44, 20: e, 21: i }, t(s, [2, 17], { 14: [1, 45] }), t(s, [2, 18], { 14: [1, 46] }), t(s, [2, 19]), t(s, [2, 27]), t(s, [2, 28]), t(s, [2, 23], { 27: [1, 47] }), t(f, [2, 29]), { 15: [1, 48] }, { 16: [1, 49] }, t(s, [2, 11]), { 16: [1, 50] }, t(s, [2, 15]), t(o, [2, 42]), t(s, [2, 20]), t(s, [2, 21]), { 20: l, 26: 51 }, { 16: u, 20: a, 21: [1, 53], 28: 52, 29: 54, 30: 55, 31: y, 32: h, 33: b }, t(s, [2, 12]), t(s, [2, 16]), t(f, [2, 30]), t(f, [2, 31]), t(f, [2, 32]), t(f, [2, 33], { 30: 61, 16: u, 20: a, 31: y, 32: h, 33: b }), t(p, [2, 34]), t(p, [2, 36]), t(p, [2, 37]), t(p, [2, 38]), t(p, [2, 39]), t(p, [2, 40]), t(p, [2, 35])],
1027
+ defaultActions: { 6: [2, 1] },
1028
+ parseError: /* @__PURE__ */ w(function(g, m) {
1029
+ if (m.recoverable)
1030
+ this.trace(g);
1031
+ else {
1032
+ var v = new Error(g);
1033
+ throw v.hash = m, v;
1034
+ }
1035
+ }, "parseError"),
1036
+ parse: /* @__PURE__ */ w(function(g) {
1037
+ var m = this, v = [0], c = [], x = [null], d = [], C = this.table, k = "", D = 0, U = 0, V = 2, F = 1, R = d.slice.call(arguments, 1), T = Object.create(this.lexer), A = { yy: {} };
1038
+ for (var G in this.yy)
1039
+ Object.prototype.hasOwnProperty.call(this.yy, G) && (A.yy[G] = this.yy[G]);
1040
+ T.setInput(g, A.yy), A.yy.lexer = T, A.yy.parser = this, typeof T.yylloc > "u" && (T.yylloc = {});
1041
+ var P = T.yylloc;
1042
+ d.push(P);
1043
+ var B = T.options && T.options.ranges;
1044
+ typeof A.yy.parseError == "function" ? this.parseError = A.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
1045
+ function W(H) {
1046
+ v.length = v.length - 2 * H, x.length = x.length - H, d.length = d.length - H;
1047
+ }
1048
+ w(W, "popStack");
1049
+ function L() {
1050
+ var H;
1051
+ return H = c.pop() || T.lex() || F, typeof H != "number" && (H instanceof Array && (c = H, H = c.pop()), H = m.symbols_[H] || H), H;
1052
+ }
1053
+ w(L, "lex");
1054
+ for (var z, N, j, J, I = {}, O, K, et, Y; ; ) {
1055
+ if (N = v[v.length - 1], this.defaultActions[N] ? j = this.defaultActions[N] : ((z === null || typeof z > "u") && (z = L()), j = C[N] && C[N][z]), typeof j > "u" || !j.length || !j[0]) {
1056
+ var X = "";
1057
+ Y = [];
1058
+ for (O in C[N])
1059
+ this.terminals_[O] && O > V && Y.push("'" + this.terminals_[O] + "'");
1060
+ T.showPosition ? X = "Parse error on line " + (D + 1) + `:
1061
+ ` + T.showPosition() + `
1062
+ Expecting ` + Y.join(", ") + ", got '" + (this.terminals_[z] || z) + "'" : X = "Parse error on line " + (D + 1) + ": Unexpected " + (z == F ? "end of input" : "'" + (this.terminals_[z] || z) + "'"), this.parseError(X, {
1063
+ text: T.match,
1064
+ token: this.terminals_[z] || z,
1065
+ line: T.yylineno,
1066
+ loc: P,
1067
+ expected: Y
1068
+ });
1069
+ }
1070
+ if (j[0] instanceof Array && j.length > 1)
1071
+ throw new Error("Parse Error: multiple actions possible at state: " + N + ", token: " + z);
1072
+ switch (j[0]) {
1073
+ case 1:
1074
+ 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;
1075
+ break;
1076
+ case 2:
1077
+ if (K = this.productions_[j[1]][1], I.$ = x[x.length - K], I._$ = {
1078
+ first_line: d[d.length - (K || 1)].first_line,
1079
+ last_line: d[d.length - 1].last_line,
1080
+ first_column: d[d.length - (K || 1)].first_column,
1081
+ last_column: d[d.length - 1].last_column
1082
+ }, B && (I._$.range = [
1083
+ d[d.length - (K || 1)].range[0],
1084
+ d[d.length - 1].range[1]
1085
+ ]), J = this.performAction.apply(I, [
1086
+ k,
1087
+ U,
1088
+ D,
1089
+ A.yy,
1090
+ j[1],
1091
+ x,
1092
+ d
1093
+ ].concat(R)), typeof J < "u")
1094
+ return J;
1095
+ K && (v = v.slice(0, -1 * K * 2), x = x.slice(0, -1 * K), d = d.slice(0, -1 * K)), 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);
1096
+ break;
1097
+ case 3:
1098
+ return !0;
1099
+ }
1100
+ }
1101
+ return !0;
1102
+ }, "parse")
1103
+ }, E = /* @__PURE__ */ (function() {
1104
+ var S = {
1105
+ EOF: 1,
1106
+ parseError: /* @__PURE__ */ w(function(m, v) {
1107
+ if (this.yy.parser)
1108
+ this.yy.parser.parseError(m, v);
1109
+ else
1110
+ throw new Error(m);
1111
+ }, "parseError"),
1112
+ // resets the lexer, sets new input
1113
+ setInput: /* @__PURE__ */ w(function(g, m) {
1114
+ return this.yy = m || this.yy || {}, this._input = g, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
1115
+ first_line: 1,
1116
+ first_column: 0,
1117
+ last_line: 1,
1118
+ last_column: 0
1119
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
1120
+ }, "setInput"),
1121
+ // consumes and returns one char from the input
1122
+ input: /* @__PURE__ */ w(function() {
1123
+ var g = this._input[0];
1124
+ this.yytext += g, this.yyleng++, this.offset++, this.match += g, this.matched += g;
1125
+ var m = g.match(/(?:\r\n?|\n).*/g);
1126
+ return m ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), g;
1127
+ }, "input"),
1128
+ // unshifts one char (or a string) into the input
1129
+ unput: /* @__PURE__ */ w(function(g) {
1130
+ var m = g.length, v = g.split(/(?:\r\n?|\n)/g);
1131
+ this._input = g + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - m), this.offset -= m;
1132
+ var c = this.match.split(/(?:\r\n?|\n)/g);
1133
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), v.length - 1 && (this.yylineno -= v.length - 1);
1134
+ var x = this.yylloc.range;
1135
+ return this.yylloc = {
1136
+ first_line: this.yylloc.first_line,
1137
+ last_line: this.yylineno + 1,
1138
+ first_column: this.yylloc.first_column,
1139
+ last_column: v ? (v.length === c.length ? this.yylloc.first_column : 0) + c[c.length - v.length].length - v[0].length : this.yylloc.first_column - m
1140
+ }, this.options.ranges && (this.yylloc.range = [x[0], x[0] + this.yyleng - m]), this.yyleng = this.yytext.length, this;
1141
+ }, "unput"),
1142
+ // When called from action, caches matched text and appends it on next action
1143
+ more: /* @__PURE__ */ w(function() {
1144
+ return this._more = !0, this;
1145
+ }, "more"),
1146
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
1147
+ reject: /* @__PURE__ */ w(function() {
1148
+ if (this.options.backtrack_lexer)
1149
+ this._backtrack = !0;
1150
+ else
1151
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
1152
+ ` + this.showPosition(), {
1153
+ text: "",
1154
+ token: null,
1155
+ line: this.yylineno
1156
+ });
1157
+ return this;
1158
+ }, "reject"),
1159
+ // retain first n characters of the match
1160
+ less: /* @__PURE__ */ w(function(g) {
1161
+ this.unput(this.match.slice(g));
1162
+ }, "less"),
1163
+ // displays already matched input, i.e. for error messages
1164
+ pastInput: /* @__PURE__ */ w(function() {
1165
+ var g = this.matched.substr(0, this.matched.length - this.match.length);
1166
+ return (g.length > 20 ? "..." : "") + g.substr(-20).replace(/\n/g, "");
1167
+ }, "pastInput"),
1168
+ // displays upcoming input, i.e. for error messages
1169
+ upcomingInput: /* @__PURE__ */ w(function() {
1170
+ var g = this.match;
1171
+ return g.length < 20 && (g += this._input.substr(0, 20 - g.length)), (g.substr(0, 20) + (g.length > 20 ? "..." : "")).replace(/\n/g, "");
1172
+ }, "upcomingInput"),
1173
+ // displays the character position where the lexing error occurred, i.e. for error messages
1174
+ showPosition: /* @__PURE__ */ w(function() {
1175
+ var g = this.pastInput(), m = new Array(g.length + 1).join("-");
1176
+ return g + this.upcomingInput() + `
1177
+ ` + m + "^";
1178
+ }, "showPosition"),
1179
+ // test the lexed token: return FALSE when not a match, otherwise return token
1180
+ test_match: /* @__PURE__ */ w(function(g, m) {
1181
+ var v, c, x;
1182
+ if (this.options.backtrack_lexer && (x = {
1183
+ yylineno: this.yylineno,
1184
+ yylloc: {
1185
+ first_line: this.yylloc.first_line,
1186
+ last_line: this.last_line,
1187
+ first_column: this.yylloc.first_column,
1188
+ last_column: this.yylloc.last_column
1189
+ },
1190
+ yytext: this.yytext,
1191
+ match: this.match,
1192
+ matches: this.matches,
1193
+ matched: this.matched,
1194
+ yyleng: this.yyleng,
1195
+ offset: this.offset,
1196
+ _more: this._more,
1197
+ _input: this._input,
1198
+ yy: this.yy,
1199
+ conditionStack: this.conditionStack.slice(0),
1200
+ done: this.done
1201
+ }, this.options.ranges && (x.yylloc.range = this.yylloc.range.slice(0))), c = g[0].match(/(?:\r\n?|\n).*/g), c && (this.yylineno += c.length), this.yylloc = {
1202
+ first_line: this.yylloc.last_line,
1203
+ last_line: this.yylineno + 1,
1204
+ first_column: this.yylloc.last_column,
1205
+ last_column: c ? c[c.length - 1].length - c[c.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + g[0].length
1206
+ }, this.yytext += g[0], this.match += g[0], this.matches = g, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(g[0].length), this.matched += g[0], v = this.performAction.call(this, this.yy, this, m, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), v)
1207
+ return v;
1208
+ if (this._backtrack) {
1209
+ for (var d in x)
1210
+ this[d] = x[d];
1211
+ return !1;
1212
+ }
1213
+ return !1;
1214
+ }, "test_match"),
1215
+ // return next match in input
1216
+ next: /* @__PURE__ */ w(function() {
1217
+ if (this.done)
1218
+ return this.EOF;
1219
+ this._input || (this.done = !0);
1220
+ var g, m, v, c;
1221
+ this._more || (this.yytext = "", this.match = "");
1222
+ for (var x = this._currentRules(), d = 0; d < x.length; d++)
1223
+ if (v = this._input.match(this.rules[x[d]]), v && (!m || v[0].length > m[0].length)) {
1224
+ if (m = v, c = d, this.options.backtrack_lexer) {
1225
+ if (g = this.test_match(v, x[d]), g !== !1)
1226
+ return g;
1227
+ if (this._backtrack) {
1228
+ m = !1;
1229
+ continue;
1230
+ } else
1231
+ return !1;
1232
+ } else if (!this.options.flex)
1233
+ break;
1234
+ }
1235
+ return m ? (g = this.test_match(m, x[c]), g !== !1 ? g : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
1236
+ ` + this.showPosition(), {
1237
+ text: "",
1238
+ token: null,
1239
+ line: this.yylineno
1240
+ });
1241
+ }, "next"),
1242
+ // return next match that has a token
1243
+ lex: /* @__PURE__ */ w(function() {
1244
+ var m = this.next();
1245
+ return m || this.lex();
1246
+ }, "lex"),
1247
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
1248
+ begin: /* @__PURE__ */ w(function(m) {
1249
+ this.conditionStack.push(m);
1250
+ }, "begin"),
1251
+ // pop the previously active lexer condition state off the condition stack
1252
+ popState: /* @__PURE__ */ w(function() {
1253
+ var m = this.conditionStack.length - 1;
1254
+ return m > 0 ? this.conditionStack.pop() : this.conditionStack[0];
1255
+ }, "popState"),
1256
+ // produce the lexer rule set which is active for the currently active lexer condition state
1257
+ _currentRules: /* @__PURE__ */ w(function() {
1258
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
1259
+ }, "_currentRules"),
1260
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
1261
+ topState: /* @__PURE__ */ w(function(m) {
1262
+ return m = this.conditionStack.length - 1 - Math.abs(m || 0), m >= 0 ? this.conditionStack[m] : "INITIAL";
1263
+ }, "topState"),
1264
+ // alias for begin(condition)
1265
+ pushState: /* @__PURE__ */ w(function(m) {
1266
+ this.begin(m);
1267
+ }, "pushState"),
1268
+ // return the number of states currently on the stack
1269
+ stateStackSize: /* @__PURE__ */ w(function() {
1270
+ return this.conditionStack.length;
1271
+ }, "stateStackSize"),
1272
+ options: { "case-insensitive": !0 },
1273
+ performAction: /* @__PURE__ */ w(function(m, v, c, x) {
1274
+ switch (c) {
1275
+ case 0:
1276
+ break;
1277
+ case 1:
1278
+ break;
1279
+ case 2:
1280
+ break;
1281
+ case 3:
1282
+ if (m.getIndentMode && m.getIndentMode())
1283
+ return m.consumeIndentText = !0, this.begin("INITIAL"), 22;
1284
+ break;
1285
+ case 4:
1286
+ break;
1287
+ case 5:
1288
+ m.setIndentMode && m.setIndentMode(!1), this.begin("INITIAL"), this.unput(v.yytext);
1289
+ break;
1290
+ case 6:
1291
+ return this.begin("bol"), 8;
1292
+ case 7:
1293
+ break;
1294
+ case 8:
1295
+ break;
1296
+ case 9:
1297
+ return 7;
1298
+ case 10:
1299
+ return 11;
1300
+ case 11:
1301
+ return 5;
1302
+ case 12:
1303
+ return 12;
1304
+ case 13:
1305
+ return 17;
1306
+ case 14:
1307
+ if (m.consumeIndentText)
1308
+ m.consumeIndentText = !1;
1309
+ else
1310
+ return 19;
1311
+ break;
1312
+ case 15:
1313
+ return 24;
1314
+ case 16:
1315
+ return v.yytext = v.yytext.slice(2, -2), 14;
1316
+ case 17:
1317
+ return v.yytext = v.yytext.slice(1, -1).trim(), 14;
1318
+ case 18:
1319
+ return 16;
1320
+ case 19:
1321
+ return 31;
1322
+ case 20:
1323
+ return 33;
1324
+ case 21:
1325
+ return 32;
1326
+ case 22:
1327
+ return 20;
1328
+ case 23:
1329
+ return 21;
1330
+ case 24:
1331
+ return 27;
1332
+ case 25:
1333
+ return 15;
1334
+ }
1335
+ }, "anonymous"),
1336
+ rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[ \t]+(?=[\n\r]))/i, /^(?:[ \t]+(?=text\b))/i, /^(?:[ \t]+)/i, /^(?:[^ \t\n\r])/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:[ \t]+)/i, /^(?:$)/i, /^(?:title\s[^#\n;]+)/i, /^(?:venn-beta\b)/i, /^(?:set\b)/i, /^(?:union\b)/i, /^(?:text\b)/i, /^(?:style\b)/i, /^(?:\["[^\"]*"\])/i, /^(?:\[[^\]\"]+\])/i, /^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i, /^(?:#[0-9a-fA-F]{3,8})/i, /^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i, /^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i, /^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i, /^(?:"[^\"]*")/i, /^(?:,)/i, /^(?::)/i],
1337
+ conditions: { bol: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25], inclusive: !0 }, INITIAL: { rules: [0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25], inclusive: !0 } }
1338
+ };
1339
+ return S;
1340
+ })();
1341
+ M.lexer = E;
1342
+ function _() {
1343
+ this.yy = {};
1344
+ }
1345
+ return w(_, "Parser"), _.prototype = M, M.Parser = _, new _();
1346
+ })();
1347
+ gt.parser = gt;
1348
+ var we = gt, yt = [], pt = [], mt = [], bt = /* @__PURE__ */ new Set(), vt, kt = !1, _e = /* @__PURE__ */ w((t, n, s) => {
1349
+ const e = it(t).sort(), i = s ?? 10 / Math.pow(t.length, 2);
1350
+ vt = e, e.length === 1 && bt.add(e[0]), yt.push({
1351
+ sets: e,
1352
+ size: i,
1353
+ label: n ? nt(n) : void 0
1354
+ });
1355
+ }, "addSubsetData"), Te = /* @__PURE__ */ w(() => yt, "getSubsetData"), nt = /* @__PURE__ */ w((t) => {
1356
+ const n = t.trim();
1357
+ return n.length >= 2 && n.startsWith('"') && n.endsWith('"') ? n.slice(1, -1) : n;
1358
+ }, "normalizeText"), Ee = /* @__PURE__ */ w((t) => t && nt(t), "normalizeStyleValue"), ze = /* @__PURE__ */ w((t, n, s) => {
1359
+ const e = nt(n);
1360
+ pt.push({
1361
+ sets: it(t).sort(),
1362
+ id: e,
1363
+ label: s ? nt(s) : void 0
1364
+ });
1365
+ }, "addTextData"), Ae = /* @__PURE__ */ w((t, n) => {
1366
+ const s = it(t).sort(), e = {};
1367
+ for (const [i, o] of n)
1368
+ e[i] = Ee(o) ?? o;
1369
+ mt.push({ targets: s, styles: e });
1370
+ }, "addStyleData"), Re = /* @__PURE__ */ w(() => mt, "getStyleData"), it = /* @__PURE__ */ w((t) => t.map((n) => nt(n)), "normalizeIdentifierList"), Ce = /* @__PURE__ */ w((t) => {
1371
+ const s = it(t).filter((e) => !bt.has(e));
1372
+ if (s.length > 0)
1373
+ throw new Error(`unknown set identifier: ${s.join(", ")}`);
1374
+ }, "validateUnionIdentifiers"), De = /* @__PURE__ */ w(() => pt, "getTextData"), Oe = /* @__PURE__ */ w(() => vt, "getCurrentSets"), Ne = /* @__PURE__ */ w(() => kt, "getIndentMode"), Fe = /* @__PURE__ */ w((t) => {
1375
+ kt = t;
1376
+ }, "setIndentMode"), je = re.venn;
1377
+ function Vt() {
1378
+ return oe(je, wt().venn);
1379
+ }
1380
+ w(Vt, "getConfig");
1381
+ var Le = /* @__PURE__ */ w(() => {
1382
+ ie(), yt.length = 0, pt.length = 0, mt.length = 0, bt.clear(), vt = void 0, kt = !1;
1383
+ }, "customClear"), Pe = {
1384
+ getConfig: Vt,
1385
+ clear: Le,
1386
+ setAccTitle: Qt,
1387
+ getAccTitle: Zt,
1388
+ setDiagramTitle: Xt,
1389
+ getDiagramTitle: Yt,
1390
+ getAccDescription: Ht,
1391
+ setAccDescription: Kt,
1392
+ addSubsetData: _e,
1393
+ getSubsetData: Te,
1394
+ addTextData: ze,
1395
+ addStyleData: Ae,
1396
+ validateUnionIdentifiers: Ce,
1397
+ getTextData: De,
1398
+ getStyleData: Re,
1399
+ getCurrentSets: Oe,
1400
+ getIndentMode: Ne,
1401
+ setIndentMode: Fe
1402
+ }, Be = /* @__PURE__ */ w((t) => `
1403
+ .venn-title {
1404
+ font-size: 32px;
1405
+ fill: ${t.vennTitleTextColor};
1406
+ font-family: ${t.fontFamily};
1407
+ }
1408
+
1409
+ .venn-circle text {
1410
+ font-size: 48px;
1411
+ font-family: ${t.fontFamily};
1412
+ }
1413
+
1414
+ .venn-intersection text {
1415
+ font-size: 48px;
1416
+ fill: ${t.vennSetTextColor};
1417
+ font-family: ${t.fontFamily};
1418
+ }
1419
+
1420
+ .venn-text-node {
1421
+ font-family: ${t.fontFamily};
1422
+ color: ${t.vennSetTextColor};
1423
+ }
1424
+ `, "getStyles"), Ve = Be;
1425
+ function qt(t) {
1426
+ const n = /* @__PURE__ */ new Map();
1427
+ for (const s of t) {
1428
+ const e = s.targets.join("|"), i = n.get(e);
1429
+ i ? Object.assign(i, s.styles) : n.set(e, { ...s.styles });
1430
+ }
1431
+ return n;
1432
+ }
1433
+ w(qt, "buildStyleByKey");
1434
+ var qe = /* @__PURE__ */ w((t, n, s, e) => {
1435
+ const i = e.db, o = i.getConfig?.(), { themeVariables: r, look: l, handDrawnSeed: f } = wt(), u = l === "handDrawn", a = [
1436
+ r.venn1,
1437
+ r.venn2,
1438
+ r.venn3,
1439
+ r.venn4,
1440
+ r.venn5,
1441
+ r.venn6,
1442
+ r.venn7,
1443
+ r.venn8
1444
+ ].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 = Jt(n);
1445
+ 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);
1446
+ const x = ot(document.createElement("div")), d = ve().width(E).height(_ - m);
1447
+ x.datum(M).call(d);
1448
+ const C = u ? $t.svg(x.select("svg").node()) : void 0, k = Se(M, {
1449
+ width: E,
1450
+ height: _ - m,
1451
+ padding: o?.padding ?? 15
1452
+ }), D = /* @__PURE__ */ new Map();
1453
+ for (const R of k) {
1454
+ const T = Q([...R.data.sets].sort());
1455
+ D.set(T, R);
1456
+ }
1457
+ b.length > 0 && Ut(o, D, x, b, g, p);
1458
+ const U = te(r.background || "#f4f4f4");
1459
+ x.selectAll(".venn-circle").each(function(R, T) {
1460
+ const A = ot(this), P = Q([...R.sets].sort()), B = p.get(P), W = a.length > 0 ? a[T % a.length] : void 0, L = B?.fill || W || r.primaryColor;
1461
+ A.classed(`venn-set-${T % 8}`, !0);
1462
+ const z = B?.["fill-opacity"] ?? 0.1, N = B?.stroke || L, j = B?.["stroke-width"] || `${5 * g}`;
1463
+ if (u && C) {
1464
+ const I = D.get(P);
1465
+ if (I && I.circles.length > 0) {
1466
+ const O = I.circles[0], K = C.circle(O.x, O.y, O.radius * 2, {
1467
+ roughness: 0.7,
1468
+ seed: f,
1469
+ fill: It(L, 0.7),
1470
+ fillStyle: "hachure",
1471
+ fillWeight: 2,
1472
+ hachureGap: 8,
1473
+ hachureAngle: -41 + T * 60,
1474
+ stroke: N,
1475
+ strokeWidth: parseFloat(String(j))
1476
+ });
1477
+ A.select("path").remove(), A.node()?.insertBefore(K, A.select("text").node());
1478
+ }
1479
+ } else
1480
+ A.select("path").style("fill", L).style("fill-opacity", z).style("stroke", N).style("stroke-width", j).style("stroke-opacity", 0.95);
1481
+ const J = B?.color || (U ? ee(L, 30) : ne(L, 30));
1482
+ A.select("text").style("font-size", `${48 * g}px`).style("fill", J);
1483
+ }), u && C ? x.selectAll(".venn-intersection").each(function(R) {
1484
+ const T = ot(this), G = Q([...R.sets].sort()), P = p.get(G), B = P?.fill;
1485
+ if (B) {
1486
+ const W = T.select("path"), L = W.attr("d");
1487
+ if (L) {
1488
+ const z = C.path(L, {
1489
+ roughness: 0.7,
1490
+ seed: f,
1491
+ fill: It(B, 0.3),
1492
+ fillStyle: "cross-hatch",
1493
+ fillWeight: 2,
1494
+ hachureGap: 6,
1495
+ hachureAngle: 60,
1496
+ stroke: "none"
1497
+ }), N = W.node();
1498
+ N?.parentNode?.insertBefore(z, N), W.remove();
1499
+ }
1500
+ } else
1501
+ T.select("path").style("fill-opacity", 0);
1502
+ T.select("text").style("font-size", `${48 * g}px`).style("fill", P?.color ?? r.vennSetTextColor ?? v);
1503
+ }) : (x.selectAll(".venn-intersection text").style("font-size", `${48 * g}px`).style("fill", (R) => {
1504
+ const A = Q([...R.sets].sort());
1505
+ return p.get(A)?.color ?? r.vennSetTextColor ?? v;
1506
+ }), x.selectAll(".venn-intersection path").style("fill-opacity", (R) => {
1507
+ const A = Q([...R.sets].sort());
1508
+ return p.get(A)?.fill ? 1 : 0;
1509
+ }).style("fill", (R) => {
1510
+ const A = Q([...R.sets].sort());
1511
+ return p.get(A)?.fill ?? "transparent";
1512
+ }));
1513
+ const V = c.append("g").attr("transform", `translate(0, ${m})`), F = x.select("svg").node();
1514
+ if (F && "childNodes" in F)
1515
+ for (const R of [...F.childNodes])
1516
+ V.node()?.appendChild(R);
1517
+ se(c, _, E, o?.useMaxWidth ?? !0);
1518
+ }, "draw");
1519
+ function Q(t) {
1520
+ return t.join("|");
1521
+ }
1522
+ w(Q, "stableSetsKey");
1523
+ function Ut(t, n, s, e, i, o) {
1524
+ const r = t?.useDebugLayout ?? !1, f = s.select("svg").append("g").attr("class", "venn-text-nodes"), u = /* @__PURE__ */ new Map();
1525
+ for (const a of e) {
1526
+ const y = Q(a.sets), h = u.get(y);
1527
+ h ? h.push(a) : u.set(y, [a]);
1528
+ }
1529
+ for (const [a, y] of u.entries()) {
1530
+ const h = n.get(a);
1531
+ if (!h?.text)
1532
+ continue;
1533
+ const b = h.text.x, p = h.text.y, M = Math.min(...h.circles.map((F) => F.radius)), E = Math.min(
1534
+ ...h.circles.map((F) => F.radius - Math.hypot(b - F.x, p - F.y))
1535
+ );
1536
+ let _ = Number.isFinite(E) ? Math.max(0, E) : 0;
1537
+ _ === 0 && Number.isFinite(M) && (_ = M * 0.6);
1538
+ const S = f.append("g").attr("class", "venn-text-area").attr("font-size", `${40 * i}px`);
1539
+ 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}`);
1540
+ 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;
1541
+ for (const [F, R] of y.entries()) {
1542
+ const T = F % k, A = Math.floor(F / k), G = d + U * (T + 0.5), P = C + V * (A + 0.5);
1543
+ 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}`);
1544
+ const B = U * 0.9, W = V * 0.9, L = S.append("foreignObject").attr("class", "venn-text-node-fo").attr("width", B).attr("height", W).attr("x", G - B / 2).attr("y", P - W / 2).attr("overflow", "visible"), z = o.get(R.id)?.color, N = L.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);
1545
+ z && N.style("color", z);
1546
+ }
1547
+ }
1548
+ }
1549
+ w(Ut, "renderTextNodes");
1550
+ function Gt(t) {
1551
+ const n = new Set(t.map((i) => [...i.sets].sort().join("|"))), s = new Map(
1552
+ t.filter((i) => i.sets.length === 1 && i.size !== void 0).map((i) => [i.sets[0], i.size])
1553
+ ), e = [];
1554
+ for (const i of t) {
1555
+ if (i.sets.length < 3)
1556
+ continue;
1557
+ const o = [...i.sets].sort();
1558
+ for (let r = 0; r < o.length - 1; r++)
1559
+ for (let l = r + 1; l < o.length; l++) {
1560
+ const f = [o[r], o[l]], u = f.join("|");
1561
+ if (!n.has(u)) {
1562
+ n.add(u);
1563
+ const a = s.get(f[0]), y = s.get(f[1]), h = a !== void 0 && y !== void 0 ? Math.min(a, y) / 4 : 2.5;
1564
+ e.push({ sets: f, size: h, label: "" });
1565
+ }
1566
+ }
1567
+ }
1568
+ return e.length > 0 ? [...t, ...e] : t;
1569
+ }
1570
+ w(Gt, "ensurePairwiseSubsets");
1571
+ var Ue = { draw: qe }, Ke = {
1572
+ parser: we,
1573
+ db: Pe,
1574
+ renderer: Ue,
1575
+ styles: Ve
1576
+ };
1577
+ export {
1578
+ Ke as diagram
1579
+ };