@openbkn/workshop 0.2.2-rc.5 → 0.2.2-rc.6
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.
- package/README.md +79 -8
- package/component.d.ts +10 -0
- package/dist/ActionConfirm-DJ91X3ml.js +236 -0
- package/dist/ActionFailure-ZgPt_3B-.js +37 -0
- package/dist/AgentChat-CRYai8ge.js +1062 -0
- package/dist/AppFormModal-D73ucaHK.js +4282 -0
- package/dist/AppListPage-D87piiOw.js +1364 -0
- package/dist/AskDrawer-BUMYsRnt.js +38 -0
- package/dist/ComputedView-CgYrDbx1.js +3221 -0
- package/dist/ConclusionApply-sjGfoEBY.js +153 -0
- package/dist/CypherEditor-lus6FA5L.js +485 -0
- package/dist/LandingList-6JI6864C.js +230 -0
- package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
- package/dist/ModelTrial-ClHFGTpQ.js +359 -0
- package/dist/PageRenderer-DBd_g6mN.js +85480 -0
- package/dist/README-DjRyTQSR.js +76 -0
- package/dist/ScenarioApply-DtW_hh47.js +590 -0
- package/dist/SimulateForm-C-i08Jjd.js +153 -0
- package/dist/Subgraph-CnrkH9AN.js +32586 -0
- package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
- package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
- package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
- package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
- package/dist/actionButton-DA5CNEzx.js +94 -0
- package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
- package/dist/agentChat-EoDznd58.js +116 -0
- package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
- package/dist/alertList-DqditwM8.js +84 -0
- package/dist/alertList.en-US-BAXAgltP.js +84 -0
- package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
- package/dist/asOfSlider-QPvHWUMV.js +83 -0
- package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
- package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
- package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
- package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
- package/dist/channel-B034hcOF.js +5 -0
- package/dist/china-C6m7zXIv.js +9 -0
- package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
- package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
- package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
- package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
- package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
- package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
- package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
- package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
- package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
- package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
- package/dist/component.d-DFoMKuUv.js +179 -0
- package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
- package/dist/customComponents-DasaZ6pq.js +4 -0
- package/dist/customComponents.en-US-CkabuCXg.js +79 -0
- package/dist/customParseFormat-C0uLEpdq.js +182 -0
- package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
- package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
- package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
- package/dist/d3-scale-DA8IHmf0.js +1841 -0
- package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
- package/dist/dateRange-BbkLMg8L.js +79 -0
- package/dist/dateRange.en-US-CV12Q02G.js +79 -0
- package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
- package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
- package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
- package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
- package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
- package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
- package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
- package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
- package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
- package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
- package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
- package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
- package/dist/eventList-CnsAwfDS.js +115 -0
- package/dist/eventList.en-US-Cof3rCLq.js +115 -0
- package/dist/eventReport-XS-HegnH.js +76 -0
- package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
- package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
- package/dist/ganttChart-DEeSvTJA.js +77 -0
- package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
- package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
- package/dist/generateCypher-Ch9_lQa6.js +399 -0
- package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
- package/dist/graph-CKJmgLki.js +1541 -0
- package/dist/index-BA-GzCXt.js +441 -0
- package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
- package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
- package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
- package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
- package/dist/katex-BsrBVQKd.js +11314 -0
- package/dist/manifest-BjV1PJ6u.js +41 -0
- package/dist/mermaid.core-yQghUlIz.js +17642 -0
- package/dist/metricCards-CSb-_cT2.js +104 -0
- package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
- package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
- package/dist/modelTrial-Bvb-RhGt.js +137 -0
- package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
- package/dist/models-DekiCOuZ.js +6 -0
- package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
- package/dist/object-metric.service-flZgBMRX.js +233 -0
- package/dist/objectDetail-SQUbp4Py.js +117 -0
- package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
- package/dist/objectList-D99wPtJH.js +97 -0
- package/dist/objectList.en-US-PBBNyVLW.js +97 -0
- package/dist/objectTable-0jsFFMN3.js +127 -0
- package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
- package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
- package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
- package/dist/pivotTable-CHmQw18-.js +102 -0
- package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
- package/dist/prompt-DYrjlEFr.js +373 -0
- package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
- package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
- package/dist/regionMap-Cme-JyV_.js +128 -0
- package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
- package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
- package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
- package/dist/scenarioBar-BV43p7n-.js +122 -0
- package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
- package/dist/scheduleGantt-CTYO-zYP.js +180 -0
- package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
- package/dist/searchBox-Ca7w0f_6.js +67 -0
- package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
- package/dist/segmentedFilter-MhjVcWo0.js +80 -0
- package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
- package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
- package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
- package/dist/stageChain-BxBafwjD.js +74 -0
- package/dist/stageChain.en-US-CP0G27n8.js +74 -0
- package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
- package/dist/subgraph-7n4SwliR.js +71 -0
- package/dist/subgraph.en-US-BNvY18IW.js +71 -0
- package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
- package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
- package/dist/taskInbox-DGWYeI2b.js +118 -0
- package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
- package/dist/text-BqSVQKS6.js +78 -0
- package/dist/text.en-US-BhAxy_LE.js +78 -0
- package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
- package/dist/trendChart-BjEeRS5_.js +135 -0
- package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
- package/dist/useLabData-Df-jEHKs.js +20470 -0
- package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
- package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
- package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
- package/dist/workshop-app-DnHNjBqy.js +86038 -0
- package/dist/workshop-app.css +1 -0
- package/dist/workshop-app.js +4 -0
- package/dist/world-Djau1JyJ.js +9 -0
- package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
- package/dist-cli/workshop.js +340 -217
- package/example/host.js +109 -0
- package/example/index.html +93 -0
- package/example/server.mjs +237 -0
- package/index.d.ts +48 -0
- package/lib/validate.js +47 -1
- package/package.json +17 -5
- package/runtime/frame-runtime.js +13 -1
- package/workshop-component.js +32 -12
- package/workshop.js +2 -0
|
@@ -0,0 +1,542 @@
|
|
|
1
|
+
import { p as xe } from "./chunk-JWPE2WC7-CDBrSjU7.js";
|
|
2
|
+
import { _ as C, Y as be, O as ae, Q as ee, T as Ce, d as we, l as te, aw as B, k as U, b as Te, a as Le, v as $e, x as Ae, g as Fe, s as _e, R as Ne, ax as Me, D as ke } from "./mermaid.core-yQghUlIz.js";
|
|
3
|
+
import { s as ze } from "./chunk-VQ5W62QI-BiVKc40w.js";
|
|
4
|
+
import { p as Ve } from "./cynefin-EF2NZ3EQ-D7MVnMHu.js";
|
|
5
|
+
import { f as O, o as K } from "./d3-scale-DA8IHmf0.js";
|
|
6
|
+
function De(t) {
|
|
7
|
+
var a = 0, l = t.children, n = l && l.length;
|
|
8
|
+
if (!n) a = 1;
|
|
9
|
+
else for (; --n >= 0; ) a += l[n].value;
|
|
10
|
+
t.value = a;
|
|
11
|
+
}
|
|
12
|
+
function Pe() {
|
|
13
|
+
return this.eachAfter(De);
|
|
14
|
+
}
|
|
15
|
+
function Be(t, a) {
|
|
16
|
+
let l = -1;
|
|
17
|
+
for (const n of this)
|
|
18
|
+
t.call(a, n, ++l, this);
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
function Re(t, a) {
|
|
22
|
+
for (var l = this, n = [l], s, r, h = -1; l = n.pop(); )
|
|
23
|
+
if (t.call(a, l, ++h, this), s = l.children)
|
|
24
|
+
for (r = s.length - 1; r >= 0; --r)
|
|
25
|
+
n.push(s[r]);
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
function Ee(t, a) {
|
|
29
|
+
for (var l = this, n = [l], s = [], r, h, d, f = -1; l = n.pop(); )
|
|
30
|
+
if (s.push(l), r = l.children)
|
|
31
|
+
for (h = 0, d = r.length; h < d; ++h)
|
|
32
|
+
n.push(r[h]);
|
|
33
|
+
for (; l = s.pop(); )
|
|
34
|
+
t.call(a, l, ++f, this);
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
function We(t, a) {
|
|
38
|
+
let l = -1;
|
|
39
|
+
for (const n of this)
|
|
40
|
+
if (t.call(a, n, ++l, this))
|
|
41
|
+
return n;
|
|
42
|
+
}
|
|
43
|
+
function He(t) {
|
|
44
|
+
return this.eachAfter(function(a) {
|
|
45
|
+
for (var l = +t(a.data) || 0, n = a.children, s = n && n.length; --s >= 0; ) l += n[s].value;
|
|
46
|
+
a.value = l;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function Ie(t) {
|
|
50
|
+
return this.eachBefore(function(a) {
|
|
51
|
+
a.children && a.children.sort(t);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function Oe(t) {
|
|
55
|
+
for (var a = this, l = qe(a, t), n = [a]; a !== l; )
|
|
56
|
+
a = a.parent, n.push(a);
|
|
57
|
+
for (var s = n.length; t !== l; )
|
|
58
|
+
n.splice(s, 0, t), t = t.parent;
|
|
59
|
+
return n;
|
|
60
|
+
}
|
|
61
|
+
function qe(t, a) {
|
|
62
|
+
if (t === a) return t;
|
|
63
|
+
var l = t.ancestors(), n = a.ancestors(), s = null;
|
|
64
|
+
for (t = l.pop(), a = n.pop(); t === a; )
|
|
65
|
+
s = t, t = l.pop(), a = n.pop();
|
|
66
|
+
return s;
|
|
67
|
+
}
|
|
68
|
+
function Ge() {
|
|
69
|
+
for (var t = this, a = [t]; t = t.parent; )
|
|
70
|
+
a.push(t);
|
|
71
|
+
return a;
|
|
72
|
+
}
|
|
73
|
+
function Xe() {
|
|
74
|
+
return Array.from(this);
|
|
75
|
+
}
|
|
76
|
+
function Ye() {
|
|
77
|
+
var t = [];
|
|
78
|
+
return this.eachBefore(function(a) {
|
|
79
|
+
a.children || t.push(a);
|
|
80
|
+
}), t;
|
|
81
|
+
}
|
|
82
|
+
function je() {
|
|
83
|
+
var t = this, a = [];
|
|
84
|
+
return t.each(function(l) {
|
|
85
|
+
l !== t && a.push({ source: l.parent, target: l });
|
|
86
|
+
}), a;
|
|
87
|
+
}
|
|
88
|
+
function* Qe() {
|
|
89
|
+
var t = this, a, l = [t], n, s, r;
|
|
90
|
+
do
|
|
91
|
+
for (a = l.reverse(), l = []; t = a.pop(); )
|
|
92
|
+
if (yield t, n = t.children)
|
|
93
|
+
for (s = 0, r = n.length; s < r; ++s)
|
|
94
|
+
l.push(n[s]);
|
|
95
|
+
while (l.length);
|
|
96
|
+
}
|
|
97
|
+
function ne(t, a) {
|
|
98
|
+
t instanceof Map ? (t = [void 0, t], a === void 0 && (a = Je)) : a === void 0 && (a = Ze);
|
|
99
|
+
for (var l = new Y(t), n, s = [l], r, h, d, f; n = s.pop(); )
|
|
100
|
+
if ((h = a(n.data)) && (f = (h = Array.from(h)).length))
|
|
101
|
+
for (n.children = h, d = f - 1; d >= 0; --d)
|
|
102
|
+
s.push(r = h[d] = new Y(h[d])), r.parent = n, r.depth = n.depth + 1;
|
|
103
|
+
return l.eachBefore(et);
|
|
104
|
+
}
|
|
105
|
+
function Ue() {
|
|
106
|
+
return ne(this).eachBefore(Ke);
|
|
107
|
+
}
|
|
108
|
+
function Ze(t) {
|
|
109
|
+
return t.children;
|
|
110
|
+
}
|
|
111
|
+
function Je(t) {
|
|
112
|
+
return Array.isArray(t) ? t[1] : null;
|
|
113
|
+
}
|
|
114
|
+
function Ke(t) {
|
|
115
|
+
t.data.value !== void 0 && (t.value = t.data.value), t.data = t.data.data;
|
|
116
|
+
}
|
|
117
|
+
function et(t) {
|
|
118
|
+
var a = 0;
|
|
119
|
+
do
|
|
120
|
+
t.height = a;
|
|
121
|
+
while ((t = t.parent) && t.height < ++a);
|
|
122
|
+
}
|
|
123
|
+
function Y(t) {
|
|
124
|
+
this.data = t, this.depth = this.height = 0, this.parent = null;
|
|
125
|
+
}
|
|
126
|
+
Y.prototype = ne.prototype = {
|
|
127
|
+
constructor: Y,
|
|
128
|
+
count: Pe,
|
|
129
|
+
each: Be,
|
|
130
|
+
eachAfter: Ee,
|
|
131
|
+
eachBefore: Re,
|
|
132
|
+
find: We,
|
|
133
|
+
sum: He,
|
|
134
|
+
sort: Ie,
|
|
135
|
+
path: Oe,
|
|
136
|
+
ancestors: Ge,
|
|
137
|
+
descendants: Xe,
|
|
138
|
+
leaves: Ye,
|
|
139
|
+
links: je,
|
|
140
|
+
copy: Ue,
|
|
141
|
+
[Symbol.iterator]: Qe
|
|
142
|
+
};
|
|
143
|
+
function tt(t) {
|
|
144
|
+
if (typeof t != "function") throw new Error();
|
|
145
|
+
return t;
|
|
146
|
+
}
|
|
147
|
+
function q() {
|
|
148
|
+
return 0;
|
|
149
|
+
}
|
|
150
|
+
function G(t) {
|
|
151
|
+
return function() {
|
|
152
|
+
return t;
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function at(t) {
|
|
156
|
+
t.x0 = Math.round(t.x0), t.y0 = Math.round(t.y0), t.x1 = Math.round(t.x1), t.y1 = Math.round(t.y1);
|
|
157
|
+
}
|
|
158
|
+
function oe(t, a, l, n, s) {
|
|
159
|
+
for (var r = t.children, h, d = -1, f = r.length, o = t.value && (n - a) / t.value; ++d < f; )
|
|
160
|
+
h = r[d], h.y0 = l, h.y1 = s, h.x0 = a, h.x1 = a += h.value * o;
|
|
161
|
+
}
|
|
162
|
+
Object.create(Y.prototype);
|
|
163
|
+
function ce(t, a, l, n, s) {
|
|
164
|
+
for (var r = t.children, h, d = -1, f = r.length, o = t.value && (s - l) / t.value; ++d < f; )
|
|
165
|
+
h = r[d], h.x0 = a, h.x1 = n, h.y0 = l, h.y1 = l += h.value * o;
|
|
166
|
+
}
|
|
167
|
+
var he = (1 + Math.sqrt(5)) / 2;
|
|
168
|
+
function de(t, a, l, n, s, r) {
|
|
169
|
+
for (var h = [], d = a.children, f, o, u = 0, S = 0, i = d.length, v, x, g = a.value, p, b, _, $, V, W, N; u < i; ) {
|
|
170
|
+
v = s - l, x = r - n;
|
|
171
|
+
do
|
|
172
|
+
p = d[S++].value;
|
|
173
|
+
while (!p && S < i);
|
|
174
|
+
for (b = _ = p, W = Math.max(x / v, v / x) / (g * t), N = p * p * W, V = Math.max(_ / N, N / b); S < i; ++S) {
|
|
175
|
+
if (p += o = d[S].value, o < b && (b = o), o > _ && (_ = o), N = p * p * W, $ = Math.max(_ / N, N / b), $ > V) {
|
|
176
|
+
p -= o;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
V = $;
|
|
180
|
+
}
|
|
181
|
+
h.push(f = { value: p, dice: v < x, children: d.slice(u, S) }), f.dice ? oe(f, l, n, s, g ? n += x * p / g : r) : ce(f, l, n, g ? l += v * p / g : s, r), g -= p, u = S;
|
|
182
|
+
}
|
|
183
|
+
return h;
|
|
184
|
+
}
|
|
185
|
+
var nt = (function t(a) {
|
|
186
|
+
function l(n, s, r, h, d) {
|
|
187
|
+
de(a, n, s, r, h, d);
|
|
188
|
+
}
|
|
189
|
+
return l.ratio = function(n) {
|
|
190
|
+
return t((n = +n) > 1 ? n : 1);
|
|
191
|
+
}, l;
|
|
192
|
+
})(he);
|
|
193
|
+
function lt() {
|
|
194
|
+
var t = nt, a = !1, l = 1, n = 1, s = [0], r = q, h = q, d = q, f = q, o = q;
|
|
195
|
+
function u(i) {
|
|
196
|
+
return i.x0 = i.y0 = 0, i.x1 = l, i.y1 = n, i.eachBefore(S), s = [0], a && i.eachBefore(at), i;
|
|
197
|
+
}
|
|
198
|
+
function S(i) {
|
|
199
|
+
var v = s[i.depth], x = i.x0 + v, g = i.y0 + v, p = i.x1 - v, b = i.y1 - v;
|
|
200
|
+
p < x && (x = p = (x + p) / 2), b < g && (g = b = (g + b) / 2), i.x0 = x, i.y0 = g, i.x1 = p, i.y1 = b, i.children && (v = s[i.depth + 1] = r(i) / 2, x += o(i) - v, g += h(i) - v, p -= d(i) - v, b -= f(i) - v, p < x && (x = p = (x + p) / 2), b < g && (g = b = (g + b) / 2), t(i, x, g, p, b));
|
|
201
|
+
}
|
|
202
|
+
return u.round = function(i) {
|
|
203
|
+
return arguments.length ? (a = !!i, u) : a;
|
|
204
|
+
}, u.size = function(i) {
|
|
205
|
+
return arguments.length ? (l = +i[0], n = +i[1], u) : [l, n];
|
|
206
|
+
}, u.tile = function(i) {
|
|
207
|
+
return arguments.length ? (t = tt(i), u) : t;
|
|
208
|
+
}, u.padding = function(i) {
|
|
209
|
+
return arguments.length ? u.paddingInner(i).paddingOuter(i) : u.paddingInner();
|
|
210
|
+
}, u.paddingInner = function(i) {
|
|
211
|
+
return arguments.length ? (r = typeof i == "function" ? i : G(+i), u) : r;
|
|
212
|
+
}, u.paddingOuter = function(i) {
|
|
213
|
+
return arguments.length ? u.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i) : u.paddingTop();
|
|
214
|
+
}, u.paddingTop = function(i) {
|
|
215
|
+
return arguments.length ? (h = typeof i == "function" ? i : G(+i), u) : h;
|
|
216
|
+
}, u.paddingRight = function(i) {
|
|
217
|
+
return arguments.length ? (d = typeof i == "function" ? i : G(+i), u) : d;
|
|
218
|
+
}, u.paddingBottom = function(i) {
|
|
219
|
+
return arguments.length ? (f = typeof i == "function" ? i : G(+i), u) : f;
|
|
220
|
+
}, u.paddingLeft = function(i) {
|
|
221
|
+
return arguments.length ? (o = typeof i == "function" ? i : G(+i), u) : o;
|
|
222
|
+
}, u;
|
|
223
|
+
}
|
|
224
|
+
(function t(a) {
|
|
225
|
+
function l(n, s, r, h, d) {
|
|
226
|
+
if ((f = n._squarify) && f.ratio === a)
|
|
227
|
+
for (var f, o, u, S, i = -1, v, x = f.length, g = n.value; ++i < x; ) {
|
|
228
|
+
for (o = f[i], u = o.children, S = o.value = 0, v = u.length; S < v; ++S) o.value += u[S].value;
|
|
229
|
+
o.dice ? oe(o, s, r, h, g ? r += (d - r) * o.value / g : d) : ce(o, s, r, g ? s += (h - s) * o.value / g : h, d), g -= o.value;
|
|
230
|
+
}
|
|
231
|
+
else
|
|
232
|
+
n._squarify = f = de(a, n, s, r, h, d), f.ratio = a;
|
|
233
|
+
}
|
|
234
|
+
return l.ratio = function(n) {
|
|
235
|
+
return t((n = +n) > 1 ? n : 1);
|
|
236
|
+
}, l;
|
|
237
|
+
})(he);
|
|
238
|
+
var E, ue = (E = class {
|
|
239
|
+
constructor() {
|
|
240
|
+
this.nodes = [], this.levels = /* @__PURE__ */ new Map(), this.outerNodes = [], this.classes = /* @__PURE__ */ new Map(), this.setAccTitle = Te, this.getAccTitle = Le, this.setDiagramTitle = $e, this.getDiagramTitle = Ae, this.getAccDescription = Fe, this.setAccDescription = _e;
|
|
241
|
+
}
|
|
242
|
+
getNodes() {
|
|
243
|
+
return this.nodes;
|
|
244
|
+
}
|
|
245
|
+
getConfig() {
|
|
246
|
+
const a = Ne, l = ae();
|
|
247
|
+
return ee({
|
|
248
|
+
...a.treemap,
|
|
249
|
+
...l.treemap ?? {}
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
addNode(a, l) {
|
|
253
|
+
this.nodes.push(a), this.levels.set(a, l), l === 0 && (this.outerNodes.push(a), this.root ??= a);
|
|
254
|
+
}
|
|
255
|
+
getRoot() {
|
|
256
|
+
return { name: "", children: this.outerNodes };
|
|
257
|
+
}
|
|
258
|
+
addClass(a, l) {
|
|
259
|
+
const n = this.classes.get(a) ?? { id: a, styles: [], textStyles: [] }, s = l.replace(/\\,/g, "§§§").replace(/,/g, ";").replace(/§§§/g, ",").split(";");
|
|
260
|
+
s && s.forEach((r) => {
|
|
261
|
+
Me(r) && (n?.textStyles ? n.textStyles.push(r) : n.textStyles = [r]), n?.styles ? n.styles.push(r) : n.styles = [r];
|
|
262
|
+
}), this.classes.set(a, n);
|
|
263
|
+
}
|
|
264
|
+
getClasses() {
|
|
265
|
+
return this.classes;
|
|
266
|
+
}
|
|
267
|
+
getStylesForClass(a) {
|
|
268
|
+
return this.classes.get(a)?.styles ?? [];
|
|
269
|
+
}
|
|
270
|
+
clear() {
|
|
271
|
+
ke(), this.nodes = [], this.levels = /* @__PURE__ */ new Map(), this.outerNodes = [], this.classes = /* @__PURE__ */ new Map(), this.root = void 0;
|
|
272
|
+
}
|
|
273
|
+
}, C(E, "TreeMapDB"), E);
|
|
274
|
+
function pe(t) {
|
|
275
|
+
if (!t.length)
|
|
276
|
+
return [];
|
|
277
|
+
const a = [], l = [];
|
|
278
|
+
return t.forEach((n) => {
|
|
279
|
+
const s = {
|
|
280
|
+
name: n.name,
|
|
281
|
+
children: n.type === "Leaf" ? void 0 : []
|
|
282
|
+
};
|
|
283
|
+
for (s.classSelector = n?.classSelector, n?.cssCompiledStyles && (s.cssCompiledStyles = n.cssCompiledStyles), n.type === "Leaf" && n.value !== void 0 && (s.value = n.value); l.length > 0 && l[l.length - 1].level >= n.level; )
|
|
284
|
+
l.pop();
|
|
285
|
+
if (l.length === 0)
|
|
286
|
+
a.push(s);
|
|
287
|
+
else {
|
|
288
|
+
const r = l[l.length - 1].node;
|
|
289
|
+
r.children ? r.children.push(s) : r.children = [s];
|
|
290
|
+
}
|
|
291
|
+
n.type !== "Leaf" && l.push({ node: s, level: n.level });
|
|
292
|
+
}), a;
|
|
293
|
+
}
|
|
294
|
+
C(pe, "buildHierarchy");
|
|
295
|
+
var st = /* @__PURE__ */ C((t, a) => {
|
|
296
|
+
xe(t, a);
|
|
297
|
+
const l = [];
|
|
298
|
+
for (const r of t.TreemapRows ?? [])
|
|
299
|
+
r.$type === "ClassDefStatement" && a.addClass(r.className ?? "", r.styleText ?? "");
|
|
300
|
+
for (const r of t.TreemapRows ?? []) {
|
|
301
|
+
const h = r.item;
|
|
302
|
+
if (!h)
|
|
303
|
+
continue;
|
|
304
|
+
const d = r.indent ? parseInt(r.indent) : 0, f = rt(h), o = h.classSelector ? a.getStylesForClass(h.classSelector) : [], u = o.length > 0 ? o : void 0, S = {
|
|
305
|
+
level: d,
|
|
306
|
+
name: f,
|
|
307
|
+
type: h.$type,
|
|
308
|
+
value: h.value,
|
|
309
|
+
classSelector: h.classSelector,
|
|
310
|
+
cssCompiledStyles: u
|
|
311
|
+
};
|
|
312
|
+
l.push(S);
|
|
313
|
+
}
|
|
314
|
+
const n = pe(l), s = /* @__PURE__ */ C((r, h) => {
|
|
315
|
+
for (const d of r)
|
|
316
|
+
a.addNode(d, h), d.children && d.children.length > 0 && s(d.children, h + 1);
|
|
317
|
+
}, "addNodesRecursively");
|
|
318
|
+
s(n, 0);
|
|
319
|
+
}, "populate"), rt = /* @__PURE__ */ C((t) => t.name ? String(t.name) : "", "getItemName"), fe = {
|
|
320
|
+
// @ts-expect-error - TreeMapDB is not assignable to DiagramDB
|
|
321
|
+
parser: { yy: void 0 },
|
|
322
|
+
parse: /* @__PURE__ */ C(async (t) => {
|
|
323
|
+
try {
|
|
324
|
+
const l = await Ve("treemap", t);
|
|
325
|
+
te.debug("Treemap AST:", l);
|
|
326
|
+
const n = fe.parser?.yy;
|
|
327
|
+
if (!(n instanceof ue))
|
|
328
|
+
throw new Error(
|
|
329
|
+
"parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
|
|
330
|
+
);
|
|
331
|
+
st(l, n);
|
|
332
|
+
} catch (a) {
|
|
333
|
+
throw te.error("Error parsing treemap:", a), a;
|
|
334
|
+
}
|
|
335
|
+
}, "parse")
|
|
336
|
+
}, it = 10, R = 10, X = 25, ot = /* @__PURE__ */ C((t, a, l, n) => {
|
|
337
|
+
const s = n.db, r = s.getConfig(), h = r.padding ?? it, d = s.getDiagramTitle(), f = s.getRoot(), { themeVariables: o } = ae();
|
|
338
|
+
if (!f)
|
|
339
|
+
return;
|
|
340
|
+
const u = d ? 30 : 0, S = Ce(a), i = r.nodeWidth ? r.nodeWidth * R : 960, v = r.nodeHeight ? r.nodeHeight * R : 500, x = i, g = v + u;
|
|
341
|
+
S.attr("viewBox", `0 0 ${x} ${g}`), we(S, g, x, r.useMaxWidth);
|
|
342
|
+
let p;
|
|
343
|
+
try {
|
|
344
|
+
const e = r.valueFormat || ",";
|
|
345
|
+
if (e === "$0,0")
|
|
346
|
+
p = /* @__PURE__ */ C((c) => "$" + O(",")(c), "valueFormat");
|
|
347
|
+
else if (e.startsWith("$") && e.includes(",")) {
|
|
348
|
+
const c = /\.\d+/.exec(e), m = c ? c[0] : "";
|
|
349
|
+
p = /* @__PURE__ */ C((w) => "$" + O("," + m)(w), "valueFormat");
|
|
350
|
+
} else if (e.startsWith("$")) {
|
|
351
|
+
const c = e.substring(1);
|
|
352
|
+
p = /* @__PURE__ */ C((m) => "$" + O(c || "")(m), "valueFormat");
|
|
353
|
+
} else
|
|
354
|
+
p = O(e);
|
|
355
|
+
} catch (e) {
|
|
356
|
+
te.error("Error creating format function:", e), p = O(",");
|
|
357
|
+
}
|
|
358
|
+
const b = K().range([
|
|
359
|
+
"transparent",
|
|
360
|
+
o.cScale0,
|
|
361
|
+
o.cScale1,
|
|
362
|
+
o.cScale2,
|
|
363
|
+
o.cScale3,
|
|
364
|
+
o.cScale4,
|
|
365
|
+
o.cScale5,
|
|
366
|
+
o.cScale6,
|
|
367
|
+
o.cScale7,
|
|
368
|
+
o.cScale8,
|
|
369
|
+
o.cScale9,
|
|
370
|
+
o.cScale10,
|
|
371
|
+
o.cScale11
|
|
372
|
+
]), _ = K().range([
|
|
373
|
+
"transparent",
|
|
374
|
+
o.cScalePeer0,
|
|
375
|
+
o.cScalePeer1,
|
|
376
|
+
o.cScalePeer2,
|
|
377
|
+
o.cScalePeer3,
|
|
378
|
+
o.cScalePeer4,
|
|
379
|
+
o.cScalePeer5,
|
|
380
|
+
o.cScalePeer6,
|
|
381
|
+
o.cScalePeer7,
|
|
382
|
+
o.cScalePeer8,
|
|
383
|
+
o.cScalePeer9,
|
|
384
|
+
o.cScalePeer10,
|
|
385
|
+
o.cScalePeer11
|
|
386
|
+
]), $ = K().range([
|
|
387
|
+
o.cScaleLabel0,
|
|
388
|
+
o.cScaleLabel1,
|
|
389
|
+
o.cScaleLabel2,
|
|
390
|
+
o.cScaleLabel3,
|
|
391
|
+
o.cScaleLabel4,
|
|
392
|
+
o.cScaleLabel5,
|
|
393
|
+
o.cScaleLabel6,
|
|
394
|
+
o.cScaleLabel7,
|
|
395
|
+
o.cScaleLabel8,
|
|
396
|
+
o.cScaleLabel9,
|
|
397
|
+
o.cScaleLabel10,
|
|
398
|
+
o.cScaleLabel11
|
|
399
|
+
]);
|
|
400
|
+
d && S.append("text").attr("x", x / 2).attr("y", u / 2).attr("class", "treemapTitle").attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(d);
|
|
401
|
+
const V = S.append("g").attr("transform", `translate(0, ${u})`).attr("class", "treemapContainer"), W = ne(f).sum((e) => e.value ?? 0).sort((e, c) => (c.value ?? 0) - (e.value ?? 0)), le = lt().size([i, v]).paddingTop(
|
|
402
|
+
(e) => e.children && e.children.length > 0 ? X + R : 0
|
|
403
|
+
).paddingInner(h).paddingLeft((e) => e.children && e.children.length > 0 ? R : 0).paddingRight((e) => e.children && e.children.length > 0 ? R : 0).paddingBottom((e) => e.children && e.children.length > 0 ? R : 0).round(!0)(W), me = le.descendants().filter((e) => e.children && e.children.length > 0), H = V.selectAll(".treemapSection").data(me).enter().append("g").attr("class", "treemapSection").attr("transform", (e) => `translate(${e.x0},${e.y0})`);
|
|
404
|
+
H.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", X).attr("class", "treemapSectionHeader").attr("fill", "none").attr("fill-opacity", 0.6).attr("stroke-width", 0.6).attr("style", (e) => e.depth === 0 ? "display: none;" : ""), H.append("clipPath").attr("id", (e, c) => `clip-section-${a}-${c}`).append("rect").attr("width", (e) => Math.max(0, e.x1 - e.x0 - 12)).attr("height", X), H.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", (e) => e.y1 - e.y0).attr("class", (e, c) => `treemapSection section${c}`).attr("fill", (e) => b(e.data.name)).attr("fill-opacity", 0.6).attr("stroke", (e) => _(e.data.name)).attr("stroke-width", 2).attr("stroke-opacity", 0.4).attr("style", (e) => {
|
|
405
|
+
if (e.depth === 0)
|
|
406
|
+
return "display: none;";
|
|
407
|
+
const c = B({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
408
|
+
return c.nodeStyles + ";" + c.borderStyles.join(";");
|
|
409
|
+
}), H.append("text").attr("class", "treemapSectionLabel").attr("x", 6).attr("y", X / 2).attr("dominant-baseline", "middle").text((e) => e.depth === 0 ? "" : e.data.name).attr("font-weight", "bold").attr("clip-path", (e, c) => `url(#clip-section-${a}-${c})`).attr("style", (e) => {
|
|
410
|
+
if (e.depth === 0)
|
|
411
|
+
return "display: none;";
|
|
412
|
+
const c = "dominant-baseline: middle; font-size: 12px; fill:" + $(e.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", m = B({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
413
|
+
return c + m.labelStyles.replace("color:", "fill:");
|
|
414
|
+
}).each(function(e) {
|
|
415
|
+
if (e.depth === 0)
|
|
416
|
+
return;
|
|
417
|
+
const c = U(this), m = e.data.name;
|
|
418
|
+
c.text(m);
|
|
419
|
+
const w = e.x1 - e.x0, L = 6;
|
|
420
|
+
let T;
|
|
421
|
+
r.showValues !== !1 && e.value ? T = w - 10 - 30 - 10 - L : T = w - L - 6;
|
|
422
|
+
const y = Math.max(15, T), M = c.node();
|
|
423
|
+
if (M.getComputedTextLength() > y) {
|
|
424
|
+
let z = m;
|
|
425
|
+
for (; z.length > 0; ) {
|
|
426
|
+
if (z = m.substring(0, z.length - 1), z.length === 0) {
|
|
427
|
+
c.text("..."), M.getComputedTextLength() > y && c.text("");
|
|
428
|
+
break;
|
|
429
|
+
}
|
|
430
|
+
if (c.text(z + "..."), M.getComputedTextLength() <= y)
|
|
431
|
+
break;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}), r.showValues !== !1 && H.append("text").attr("class", "treemapSectionValue").attr("x", (e) => e.x1 - e.x0 - 10).attr("y", X / 2).attr("text-anchor", "end").attr("dominant-baseline", "middle").text((e) => e.value ? p(e.value) : "").attr("font-style", "italic").attr("style", (e) => {
|
|
435
|
+
if (e.depth === 0)
|
|
436
|
+
return "display: none;";
|
|
437
|
+
const c = "text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:" + $(e.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", m = B({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
438
|
+
return c + m.labelStyles.replace("color:", "fill:");
|
|
439
|
+
});
|
|
440
|
+
const se = le.leaves(), A = se.length > 20, ge = A ? 16 : 38, j = A ? 14 : 28, D = A ? 4 : 8, I = A ? 4 : 6, Z = A ? 2 : 4, re = A ? 8 : 10, J = A ? 1 : 2, Q = V.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class", (e, c) => `treemapNode treemapLeafGroup leaf${c}${e.data.classSelector ? ` ${e.data.classSelector}` : ""}x`).attr("transform", (e) => `translate(${e.x0},${e.y0})`);
|
|
441
|
+
Q.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", (e) => e.y1 - e.y0).attr("class", "treemapLeaf").attr("fill", (e) => e.parent ? b(e.parent.data.name) : b(e.data.name)).attr("style", (e) => B({ cssCompiledStyles: e.data.cssCompiledStyles }).nodeStyles).attr("fill-opacity", 0.3).attr("stroke", (e) => e.parent ? b(e.parent.data.name) : b(e.data.name)).attr("stroke-width", 3), Q.append("clipPath").attr("id", (e, c) => `clip-${a}-${c}`).append("rect").attr("width", (e) => Math.max(0, e.x1 - e.x0 - 4)).attr("height", (e) => Math.max(0, e.y1 - e.y0 - 4)), Q.append("text").attr("class", "treemapLabel").attr("x", (e) => (e.x1 - e.x0) / 2).attr("y", (e) => (e.y1 - e.y0) / 2).attr("style", (e) => {
|
|
442
|
+
const c = `text-anchor: middle; dominant-baseline: middle; font-size: ${ge}px;fill:` + $(e.data.name) + ";", m = B({ cssCompiledStyles: e.data.cssCompiledStyles });
|
|
443
|
+
return c + m.labelStyles.replace("color:", "fill:");
|
|
444
|
+
}).attr("clip-path", (e, c) => `url(#clip-${a}-${c})`).text((e) => e.data.name).each(function(e) {
|
|
445
|
+
const c = U(this), m = e.x1 - e.x0, w = e.y1 - e.y0, L = c.node(), T = m - 2 * Z, P = w - 2 * Z;
|
|
446
|
+
if (T < re || P < re) {
|
|
447
|
+
c.style("display", "none");
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
let y = parseInt(c.style("font-size"), 10);
|
|
451
|
+
const M = 0.6;
|
|
452
|
+
for (; L.getComputedTextLength() > T && y > D; )
|
|
453
|
+
y--, c.style("font-size", `${y}px`);
|
|
454
|
+
let F = Math.max(
|
|
455
|
+
I,
|
|
456
|
+
Math.min(j, Math.round(y * M))
|
|
457
|
+
), k = y + J + F;
|
|
458
|
+
for (; k > P && y > D && (y--, F = Math.max(
|
|
459
|
+
I,
|
|
460
|
+
Math.min(j, Math.round(y * M))
|
|
461
|
+
), !(F < I && y === D)); )
|
|
462
|
+
c.style("font-size", `${y}px`), k = y + J + F;
|
|
463
|
+
c.style("font-size", `${y}px`), A ? (y < D || P < D) && c.style("display", "none") : (L.getComputedTextLength() > T || y < D || P < y) && c.style("display", "none");
|
|
464
|
+
}), r.showValues !== !1 && Q.append("text").attr("class", "treemapValue").attr("x", (c) => (c.x1 - c.x0) / 2).attr("y", function(c) {
|
|
465
|
+
return (c.y1 - c.y0) / 2;
|
|
466
|
+
}).attr("style", (c) => {
|
|
467
|
+
const m = `text-anchor: middle; dominant-baseline: hanging; font-size: ${j}px;fill:` + $(c.data.name) + ";", w = B({ cssCompiledStyles: c.data.cssCompiledStyles });
|
|
468
|
+
return m + w.labelStyles.replace("color:", "fill:");
|
|
469
|
+
}).attr("clip-path", (c, m) => `url(#clip-${a}-${m})`).text((c) => c.value ? p(c.value) : "").each(function(c) {
|
|
470
|
+
const m = U(this), w = this.parentNode;
|
|
471
|
+
if (!w) {
|
|
472
|
+
m.style("display", "none");
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
const L = U(w).select(".treemapLabel");
|
|
476
|
+
if (L.empty() || L.style("display") === "none") {
|
|
477
|
+
m.style("display", "none");
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
const T = parseFloat(L.style("font-size")), y = Math.max(
|
|
481
|
+
I,
|
|
482
|
+
Math.min(j, Math.round(T * 0.6))
|
|
483
|
+
);
|
|
484
|
+
m.style("font-size", `${y}px`);
|
|
485
|
+
const F = (c.y1 - c.y0) / 2 + T / 2 + J;
|
|
486
|
+
m.attr("y", F);
|
|
487
|
+
const k = c.x1 - c.x0, ie = c.y1 - c.y0 - 4, ve = k - 2 * Z;
|
|
488
|
+
m.node().getComputedTextLength() > ve || F + y > ie || y < I ? m.style("display", "none") : m.style("display", null);
|
|
489
|
+
});
|
|
490
|
+
const ye = r.diagramPadding ?? 8;
|
|
491
|
+
ze(S, ye, "flowchart", r?.useMaxWidth || !1);
|
|
492
|
+
}, "draw"), ct = /* @__PURE__ */ C(function(t, a) {
|
|
493
|
+
return a.db.getClasses();
|
|
494
|
+
}, "getClasses"), ht = { draw: ot, getClasses: ct }, dt = {
|
|
495
|
+
sectionStrokeColor: "black",
|
|
496
|
+
sectionStrokeWidth: "1",
|
|
497
|
+
sectionFillColor: "#efefef",
|
|
498
|
+
leafStrokeColor: "black",
|
|
499
|
+
leafStrokeWidth: "1",
|
|
500
|
+
leafFillColor: "#efefef",
|
|
501
|
+
labelFontSize: "12px",
|
|
502
|
+
valueFontSize: "10px",
|
|
503
|
+
titleFontSize: "14px"
|
|
504
|
+
}, ut = /* @__PURE__ */ C(({
|
|
505
|
+
treemap: t
|
|
506
|
+
} = {}) => {
|
|
507
|
+
const a = be(), l = ae(), n = ee(a, l.themeVariables), s = ee(dt, t), r = s.titleColor ?? n.titleColor, h = s.labelColor ?? n.textColor, d = s.valueColor ?? n.textColor;
|
|
508
|
+
return `
|
|
509
|
+
.treemapNode.section {
|
|
510
|
+
stroke: ${s.sectionStrokeColor};
|
|
511
|
+
stroke-width: ${s.sectionStrokeWidth};
|
|
512
|
+
fill: ${s.sectionFillColor};
|
|
513
|
+
}
|
|
514
|
+
.treemapNode.leaf {
|
|
515
|
+
stroke: ${s.leafStrokeColor};
|
|
516
|
+
stroke-width: ${s.leafStrokeWidth};
|
|
517
|
+
fill: ${s.leafFillColor};
|
|
518
|
+
}
|
|
519
|
+
.treemapLabel {
|
|
520
|
+
fill: ${h};
|
|
521
|
+
font-size: ${s.labelFontSize};
|
|
522
|
+
}
|
|
523
|
+
.treemapValue {
|
|
524
|
+
fill: ${d};
|
|
525
|
+
font-size: ${s.valueFontSize};
|
|
526
|
+
}
|
|
527
|
+
.treemapTitle {
|
|
528
|
+
fill: ${r};
|
|
529
|
+
font-size: ${s.titleFontSize};
|
|
530
|
+
}
|
|
531
|
+
`;
|
|
532
|
+
}, "getStyles"), pt = ut, xt = {
|
|
533
|
+
parser: fe,
|
|
534
|
+
get db() {
|
|
535
|
+
return new ue();
|
|
536
|
+
},
|
|
537
|
+
renderer: ht,
|
|
538
|
+
styles: pt
|
|
539
|
+
};
|
|
540
|
+
export {
|
|
541
|
+
xt as diagram
|
|
542
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { p as z } from "./chunk-JWPE2WC7-CDBrSjU7.js";
|
|
2
|
+
import { _ as f, Q as B, T as E, d as F, l as $, b as P, a as A, v as W, x as _, g as N, s as L, O as M, R as O, D as Y } from "./mermaid.core-yQghUlIz.js";
|
|
3
|
+
import { p as I } from "./cynefin-EF2NZ3EQ-D7MVnMHu.js";
|
|
4
|
+
var j = O.packet, b, C = (b = class {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.packet = [], this.setAccTitle = P, this.getAccTitle = A, this.setDiagramTitle = W, this.getDiagramTitle = _, this.getAccDescription = N, this.setAccDescription = L;
|
|
7
|
+
}
|
|
8
|
+
getConfig() {
|
|
9
|
+
const t = B({
|
|
10
|
+
...j,
|
|
11
|
+
...M().packet
|
|
12
|
+
});
|
|
13
|
+
return t.showBits && (t.paddingY += 10), t;
|
|
14
|
+
}
|
|
15
|
+
getPacket() {
|
|
16
|
+
return this.packet;
|
|
17
|
+
}
|
|
18
|
+
pushWord(t) {
|
|
19
|
+
t.length > 0 && this.packet.push(t);
|
|
20
|
+
}
|
|
21
|
+
clear() {
|
|
22
|
+
Y(), this.packet = [];
|
|
23
|
+
}
|
|
24
|
+
}, f(b, "PacketDB"), b), G = 1e4, H = /* @__PURE__ */ f((e, t) => {
|
|
25
|
+
z(e, t);
|
|
26
|
+
let r = -1, s = [], i = 1;
|
|
27
|
+
const { bitsPerRow: l } = t.getConfig();
|
|
28
|
+
for (let { start: a, end: o, bits: d, label: g } of e.blocks) {
|
|
29
|
+
if (a !== void 0 && o !== void 0 && o < a)
|
|
30
|
+
throw new Error(`Packet block ${a} - ${o} is invalid. End must be greater than start.`);
|
|
31
|
+
if (a ??= r + 1, a !== r + 1)
|
|
32
|
+
throw new Error(
|
|
33
|
+
`Packet block ${a} - ${o ?? a} is not contiguous. It should start from ${r + 1}.`
|
|
34
|
+
);
|
|
35
|
+
if (d === 0)
|
|
36
|
+
throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);
|
|
37
|
+
for (o ??= a + (d ?? 1) - 1, d ??= o - a + 1, r = o, $.debug(`Packet block ${a} - ${r} with label ${g}`); s.length <= l + 1 && t.getPacket().length < G; ) {
|
|
38
|
+
const [c, p] = K({ start: a, end: o, bits: d, label: g }, i, l);
|
|
39
|
+
if (s.push(c), c.end + 1 === i * l && (t.pushWord(s), s = [], i++), !p)
|
|
40
|
+
break;
|
|
41
|
+
({ start: a, end: o, bits: d, label: g } = p);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
t.pushWord(s);
|
|
45
|
+
}, "populate"), K = /* @__PURE__ */ f((e, t, r) => {
|
|
46
|
+
if (e.start === void 0)
|
|
47
|
+
throw new Error("start should have been set during first phase");
|
|
48
|
+
if (e.end === void 0)
|
|
49
|
+
throw new Error("end should have been set during first phase");
|
|
50
|
+
if (e.start > e.end)
|
|
51
|
+
throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);
|
|
52
|
+
if (e.end + 1 <= t * r)
|
|
53
|
+
return [e, void 0];
|
|
54
|
+
const s = t * r - 1, i = t * r;
|
|
55
|
+
return [
|
|
56
|
+
{
|
|
57
|
+
start: e.start,
|
|
58
|
+
end: s,
|
|
59
|
+
label: e.label,
|
|
60
|
+
bits: s - e.start
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
start: i,
|
|
64
|
+
end: e.end,
|
|
65
|
+
label: e.label,
|
|
66
|
+
bits: e.end - i
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
}, "getNextFittingBlock"), S = {
|
|
70
|
+
// @ts-expect-error - PacketDB is not assignable to DiagramDB
|
|
71
|
+
parser: { yy: void 0 },
|
|
72
|
+
parse: /* @__PURE__ */ f(async (e) => {
|
|
73
|
+
const t = await I("packet", e), r = S.parser?.yy;
|
|
74
|
+
if (!(r instanceof C))
|
|
75
|
+
throw new Error(
|
|
76
|
+
"parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
|
|
77
|
+
);
|
|
78
|
+
$.debug(t), H(t, r);
|
|
79
|
+
}, "parse")
|
|
80
|
+
}, Q = /* @__PURE__ */ f((e, t, r, s) => {
|
|
81
|
+
const i = s.db, l = i.getConfig(), { rowHeight: a, paddingY: o, bitWidth: d, bitsPerRow: g } = l, c = i.getPacket(), p = i.getDiagramTitle(), m = a + o, n = m * (c.length + 1) - (p ? 0 : a), h = d * g + 2, k = E(t);
|
|
82
|
+
k.attr("viewBox", `0 0 ${h} ${n}`), F(k, n, h, l.useMaxWidth);
|
|
83
|
+
for (const [x, u] of c.entries())
|
|
84
|
+
R(k, u, x, l);
|
|
85
|
+
k.append("text").text(p).attr("x", h / 2).attr("y", n - m / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
|
|
86
|
+
}, "draw"), R = /* @__PURE__ */ f((e, t, r, {
|
|
87
|
+
rowHeight: s,
|
|
88
|
+
paddingX: i,
|
|
89
|
+
paddingY: l,
|
|
90
|
+
bitWidth: a,
|
|
91
|
+
bitsPerRow: o,
|
|
92
|
+
showBits: d,
|
|
93
|
+
bitOrder: g
|
|
94
|
+
}) => {
|
|
95
|
+
const c = e.append("g"), p = r * (s + l) + l, m = g === "descending";
|
|
96
|
+
for (const n of t) {
|
|
97
|
+
const h = n.end - n.start + 1, k = n.start % o, u = (m ? o - k - h : k) * a + 1, w = h * a - i;
|
|
98
|
+
if (c.append("rect").attr("x", u).attr("y", p).attr("width", w).attr("height", s).attr("class", "packetBlock"), c.append("text").attr("x", u + w / 2).attr("y", p + s / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(n.label), !d)
|
|
99
|
+
continue;
|
|
100
|
+
const [D, T] = m ? [n.end, n.start] : [n.start, n.end], v = h === 1, y = p - 2;
|
|
101
|
+
c.append("text").attr("x", u + (v ? w / 2 : 0)).attr("y", y).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", v ? "middle" : "start").text(D), v || c.append("text").attr("x", u + w).attr("y", y).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(T);
|
|
102
|
+
}
|
|
103
|
+
}, "drawWord"), U = { draw: Q }, X = {
|
|
104
|
+
byteFontSize: "10px",
|
|
105
|
+
startByteColor: "black",
|
|
106
|
+
endByteColor: "black",
|
|
107
|
+
labelColor: "black",
|
|
108
|
+
labelFontSize: "12px",
|
|
109
|
+
titleColor: "black",
|
|
110
|
+
titleFontSize: "14px",
|
|
111
|
+
blockStrokeColor: "black",
|
|
112
|
+
blockStrokeWidth: "1",
|
|
113
|
+
blockFillColor: "#efefef"
|
|
114
|
+
}, q = /* @__PURE__ */ f(({ packet: e } = {}) => {
|
|
115
|
+
const t = B(X, e);
|
|
116
|
+
return `
|
|
117
|
+
.packetByte {
|
|
118
|
+
font-size: ${t.byteFontSize};
|
|
119
|
+
}
|
|
120
|
+
.packetByte.start {
|
|
121
|
+
fill: ${t.startByteColor};
|
|
122
|
+
}
|
|
123
|
+
.packetByte.end {
|
|
124
|
+
fill: ${t.endByteColor};
|
|
125
|
+
}
|
|
126
|
+
.packetLabel {
|
|
127
|
+
fill: ${t.labelColor};
|
|
128
|
+
font-size: ${t.labelFontSize};
|
|
129
|
+
}
|
|
130
|
+
.packetTitle {
|
|
131
|
+
fill: ${t.titleColor};
|
|
132
|
+
font-size: ${t.titleFontSize};
|
|
133
|
+
}
|
|
134
|
+
.packetBlock {
|
|
135
|
+
stroke: ${t.blockStrokeColor};
|
|
136
|
+
stroke-width: ${t.blockStrokeWidth};
|
|
137
|
+
fill: ${t.blockFillColor};
|
|
138
|
+
}
|
|
139
|
+
`;
|
|
140
|
+
}, "styles"), tt = {
|
|
141
|
+
parser: S,
|
|
142
|
+
get db() {
|
|
143
|
+
return new C();
|
|
144
|
+
},
|
|
145
|
+
renderer: U,
|
|
146
|
+
styles: q
|
|
147
|
+
};
|
|
148
|
+
export {
|
|
149
|
+
tt as diagram
|
|
150
|
+
};
|