@omg-dev/app 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist-lib/{ChangelogPage-8lbvM9Pz.js → ChangelogPage-Cjj_DiYL.js} +57 -1
  2. package/dist-lib/{File-B-qYa2zY.js → File-DQRr5F_e.js} +1761 -1826
  3. package/dist-lib/FileEditor-BrI3dfcp.js +6895 -0
  4. package/dist-lib/FileTreePane-J8P-OiHb.js +8413 -0
  5. package/dist-lib/{FileViewer-Clmf04v1.js → FileViewer-DRrfus7c.js} +1 -1
  6. package/dist-lib/{SessionFilesPanel-BKcTU57t.js → SessionFilesPanel-DxVJ43fE.js} +69 -69
  7. package/dist-lib/{TermView-gazV6UMU.js → TermView-B4V-DyD-.js} +521 -530
  8. package/dist-lib/{abnfDiagram-VRR7QNED-Chn1Z_p9.js → abnfDiagram-VRR7QNED-CiXfOnAu.js} +4 -4
  9. package/dist-lib/{arc-B652oHQ-.js → arc-QOMNKQA5.js} +1 -1
  10. package/dist-lib/{architectureDiagram-ZJ3FMSHR-CMatArpz.js → architectureDiagram-ZJ3FMSHR-BcFBTmfD.js} +2059 -2064
  11. package/dist-lib/{blockDiagram-677ZJIJ3-CEOPfI9A.js → blockDiagram-677ZJIJ3-Qj8-RIV3.js} +920 -925
  12. package/dist-lib/{c4Diagram-LMCZKHZV-DcUHrESL.js → c4Diagram-LMCZKHZV-BpinEmj4.js} +598 -593
  13. package/dist-lib/{channel-B5lJFbed.js → channel-D6YHMmF7.js} +1 -1
  14. package/dist-lib/{chat-engine-83mwx0z2.js → chat-engine-CUiDTHFP.js} +1173 -1218
  15. package/dist-lib/chunk-2Q5K7J3B-CFSi414U.js +18 -0
  16. package/dist-lib/{chunk-32BRIVSS-IYmNSvH8.js → chunk-32BRIVSS-DvywQiCk.js} +1 -1
  17. package/dist-lib/{chunk-5VM5RSS4-DO2g-xIj.js → chunk-5VM5RSS4-xd6XuI9Q.js} +1 -1
  18. package/dist-lib/{chunk-BO2N2NFS-kYiI5SD9.js → chunk-BO2N2NFS-BbJdm-59.js} +4892 -4903
  19. package/dist-lib/{chunk-EX3LRPZG-N96wfks9.js → chunk-EX3LRPZG-BLDKx-Yg.js} +507 -514
  20. package/dist-lib/chunk-JWPE2WC7-DnwG7Xzp.js +8 -0
  21. package/dist-lib/chunk-MOJQB5TN-BrENeFT5.js +670 -0
  22. package/dist-lib/chunk-RYQCIY6F-I-J4fVFd.js +313 -0
  23. package/dist-lib/{chunk-V7JOEXUC-DQwf2vkP.js → chunk-V7JOEXUC-Bkakcs1-.js} +458 -453
  24. package/dist-lib/chunk-VR4S4FIN-BDq3jZ0m.js +19 -0
  25. package/dist-lib/{chunk-XXDRQBXY-Ccv4aRcn.js → chunk-XXDRQBXY-DRKeYnrF.js} +1 -1
  26. package/dist-lib/{classDiagram-v2-EOCWNBFH-DOn-rhuL.js → classDiagram-OUVF2IWQ-DISUfvR5.js} +2 -2
  27. package/dist-lib/{classDiagram-OUVF2IWQ-DOn-rhuL.js → classDiagram-v2-EOCWNBFH-DISUfvR5.js} +2 -2
  28. package/dist-lib/{coding-agents-page-8Nf-IuE2.js → coding-agents-page-DtxZ0nbQ.js} +152 -131
  29. package/dist-lib/computer-page-DIJeFOZz.js +8860 -0
  30. package/dist-lib/{cose-bilkent-JH36ORCC-C-tACTrT.js → cose-bilkent-JH36ORCC-DCfmoChv.js} +281 -281
  31. package/dist-lib/{create-BrnHvSDE.js → create-CBk9uwJH.js} +2 -2
  32. package/dist-lib/cynefin-VYW2F7L2-XAY3mHv8.js +24430 -0
  33. package/dist-lib/{cynefinDiagram-TSTJHNR4-Be7CamD2.js → cynefinDiagram-TSTJHNR4-CrgvPEr1.js} +3 -3
  34. package/dist-lib/{cytoscape.esm-B0ledd6M.js → cytoscape.esm-BB6Ga9He.js} +3 -3
  35. package/dist-lib/dagre-VKFMJZFB-CE5k06mJ.js +343 -0
  36. package/dist-lib/{diagram-FQU43EPY-Jg12ow4Z.js → diagram-FQU43EPY-gOcCiJEN.js} +136 -139
  37. package/dist-lib/diagram-G47NLZAW-BVJLfRsd.js +531 -0
  38. package/dist-lib/diagram-NH7WQ7WH-u6QnHasL.js +145 -0
  39. package/dist-lib/diagram-OA4YK3LP-D4Kcl3uM.js +350 -0
  40. package/dist-lib/{diagram-WEI45ONY-D1kKPOc_.js → diagram-WEI45ONY-6a__oIb0.js} +38 -42
  41. package/dist-lib/{ebnfDiagram-CCIWWBDH-BhQWrGMc.js → ebnfDiagram-CCIWWBDH-PXSrB6lG.js} +4 -4
  42. package/dist-lib/{embedded-BmrQsEvQ.js → embedded-PUsgcSTE.js} +13043 -13082
  43. package/dist-lib/{engine-compile-BeDRSL6Y.js → engine-compile-D_stzVMa.js} +2939 -2991
  44. package/dist-lib/{erDiagram-Q63AITRT-D2q6Nmwa.js → erDiagram-Q63AITRT-BbsttUCs.js} +286 -284
  45. package/dist-lib/flowDiagram-23GEKE2U-CX5x3zVA.js +1641 -0
  46. package/dist-lib/{ganttDiagram-NO4QXBWP-C_Lj-cJB.js → ganttDiagram-NO4QXBWP-Bq0aSPs8.js} +2 -2
  47. package/dist-lib/gitGraphDiagram-IHSO6WYX-BjAezjIv.js +815 -0
  48. package/dist-lib/{graph-B68L3K2T.js → graph-DAHC4kPm.js} +2 -2
  49. package/dist-lib/{highlighted-body-OFNGDK62-C2DGVKV8.js → highlighted-body-OFNGDK62-DWhG_ijx.js} +1 -1
  50. package/dist-lib/index-B0neMIbR.js +16520 -0
  51. package/dist-lib/index-BBC0E3Qg.js +4994 -0
  52. package/dist-lib/{index-Dtkd4mEk.js → index-CE7H8LiZ.js} +2 -2
  53. package/dist-lib/{index-DWkBvb-9.js → index-FgVvPpIY.js} +2 -2
  54. package/dist-lib/index.js +1 -1
  55. package/dist-lib/{infoDiagram-FWYZ7A6U-BbUkT0KS.js → infoDiagram-FWYZ7A6U-Bo_FNR91.js} +2 -2
  56. package/dist-lib/ishikawaDiagram-FXEZZL3T-C5bGD-Eb.js +624 -0
  57. package/dist-lib/{journeyDiagram-5HDEW3XC-CgykmVSC.js → journeyDiagram-5HDEW3XC-C8qM7SxF.js} +4 -4
  58. package/dist-lib/kanban-definition-HUTT4EX6-C-EK5Puz.js +724 -0
  59. package/dist-lib/{katex-jHfnQmlp.js → katex-DoRnZ_sp.js} +1 -1
  60. package/dist-lib/{layout-BGrtsiRL.js → layout-DBbo_M5I.js} +2 -2
  61. package/dist-lib/{linear-B5ZSwawJ.js → linear-zGzX0-I0.js} +1 -1
  62. package/dist-lib/{map-hbfFlSln.js → map-DRdzG8Ho.js} +1 -1
  63. package/dist-lib/mermaid-GHXKKRXX-hOE9C3qW.js +4 -0
  64. package/dist-lib/{mindmap-definition-LN4V7U3C-CfhfeEht.js → mindmap-definition-LN4V7U3C-DlVCRx6k.js} +310 -311
  65. package/dist-lib/{pegDiagram-2B236MQR-CYDAJHPF.js → pegDiagram-2B236MQR-DrKNikeG.js} +4 -4
  66. package/dist-lib/{pieDiagram-ENE6RG2P-udKxQm4p.js → pieDiagram-ENE6RG2P-Fm_jc0HL.js} +83 -84
  67. package/dist-lib/quadrantDiagram-ABIIQ3AL-zDRY0VtB.js +1029 -0
  68. package/dist-lib/{railroadDiagram-RFXS5EU6-q0Svkmuy.js → railroadDiagram-RFXS5EU6-BQuFX39y.js} +4 -4
  69. package/dist-lib/{requirementDiagram-TGXJPOKE-tNxRI1gc.js → requirementDiagram-TGXJPOKE-BWwBQZXn.js} +269 -268
  70. package/dist-lib/{resume-session-sheet-Dr_81Gfm.js → resume-session-sheet-DTe_2QtJ.js} +2 -3
  71. package/dist-lib/sankeyDiagram-HTMAVEWB-BjRyuB6L.js +859 -0
  72. package/dist-lib/{sequenceDiagram-DBY2YBRQ-Dvl2_CXL.js → sequenceDiagram-DBY2YBRQ-69pcw_2M.js} +892 -899
  73. package/dist-lib/{session-token-usage-CGhHZ3lT.js → session-token-usage-DY4vFlfs.js} +82 -83
  74. package/dist-lib/{shadow-text-size-CBCTdbYU.js → shadow-text-size-smWA4wIU.js} +1 -2
  75. package/dist-lib/{shipped-page-p3oulUiM.js → shipped-page-B-ruG8li.js} +233 -236
  76. package/dist-lib/sizeCapture-X5ZJPWSS-DqkV8s1N.js +46 -0
  77. package/dist-lib/{stateDiagram-2N3HPSRC-CnWB7HvU.js → stateDiagram-2N3HPSRC-0vE3REl_.js} +4 -4
  78. package/dist-lib/{stateDiagram-v2-6OUMAXLB-DnZ0UI2p.js → stateDiagram-v2-6OUMAXLB-u_56Obsh.js} +2 -2
  79. package/dist-lib/{streamdown-response-Dbn0PKUH.js → streamdown-response-BQy3geXs.js} +290 -297
  80. package/dist-lib/styles.css +1 -1
  81. package/dist-lib/swimlanes-5IMT3BWC-H0raIBd1.js +5332 -0
  82. package/dist-lib/{swimlanesDiagram-G3AALYLV-CKyOeqF_.js → swimlanesDiagram-G3AALYLV-By52HaDu.js} +2 -2
  83. package/dist-lib/timeline-definition-FHXFAJF6-h1LLYUQk.js +1055 -0
  84. package/dist-lib/vennDiagram-L72KCM5P-B4wDw_Kh.js +1578 -0
  85. package/dist-lib/wardleyDiagram-EHGQE667-DLMBGiwD.js +678 -0
  86. package/dist-lib/{xychartDiagram-FW5EYKEG-m3s7caPv.js → xychartDiagram-FW5EYKEG-BHvf5Noj.js} +526 -496
  87. package/package.json +4 -3
  88. package/dist-lib/FileEditor-BIz0qCyW.js +0 -6892
  89. package/dist-lib/FileTreePane-BG2k7gTc.js +0 -8422
  90. package/dist-lib/chunk-2Q5K7J3B-Ex8Ly28R.js +0 -15
  91. package/dist-lib/chunk-JWPE2WC7-DFPBClX_.js +0 -9
  92. package/dist-lib/chunk-MOJQB5TN-dusfI9ob.js +0 -664
  93. package/dist-lib/chunk-RYQCIY6F-fkeERzIG.js +0 -315
  94. package/dist-lib/chunk-VR4S4FIN-hOZG7eF3.js +0 -20
  95. package/dist-lib/cynefin-VYW2F7L2-DQXPWaog.js +0 -23853
  96. package/dist-lib/dagre-VKFMJZFB-BhCjK7XQ.js +0 -346
  97. package/dist-lib/diagram-G47NLZAW-C3_z2t6T.js +0 -530
  98. package/dist-lib/diagram-NH7WQ7WH-DUdK08IT.js +0 -143
  99. package/dist-lib/diagram-OA4YK3LP-TUUyRYY3.js +0 -353
  100. package/dist-lib/flowDiagram-23GEKE2U-DU3S3biU.js +0 -1645
  101. package/dist-lib/gitGraphDiagram-IHSO6WYX-CvGu0XAR.js +0 -828
  102. package/dist-lib/index-DcwavxA1.js +0 -5062
  103. package/dist-lib/index-JkCQXUYs.js +0 -16566
  104. package/dist-lib/ishikawaDiagram-FXEZZL3T-D_Y6Tuyb.js +0 -622
  105. package/dist-lib/kanban-definition-HUTT4EX6-CPFLTskY.js +0 -726
  106. package/dist-lib/mermaid-GHXKKRXX-Ox_2d3uB.js +0 -4
  107. package/dist-lib/quadrantDiagram-ABIIQ3AL-BmDmLczk.js +0 -1025
  108. package/dist-lib/sankeyDiagram-HTMAVEWB-B9Bl7f2P.js +0 -847
  109. package/dist-lib/sizeCapture-X5ZJPWSS-B1EeO3N9.js +0 -47
  110. package/dist-lib/swimlanes-5IMT3BWC-CvqDJcS9.js +0 -5353
  111. package/dist-lib/timeline-definition-FHXFAJF6-b15X0Oru.js +0 -1066
  112. package/dist-lib/vennDiagram-L72KCM5P-C4lh5m77.js +0 -1585
  113. package/dist-lib/wardleyDiagram-EHGQE667-Cev6fT_D.js +0 -684
@@ -0,0 +1,678 @@
1
+ import { p as St } from "./chunk-JWPE2WC7-DnwG7Xzp.js";
2
+ import { s as Mt, g as Nt, p as zt, o as Lt, a as Tt, b as At, _ as u, W as Xt, z as Et, B as U, l as K, F as Yt, e as It, q as Bt, c as j } from "./index-B0neMIbR.js";
3
+ import { p as Ft } from "./cynefin-VYW2F7L2-XAY3mHv8.js";
4
+ var D = /* @__PURE__ */ u((e, n) => {
5
+ const r = e <= 1 ? e * 100 : e;
6
+ if (r < 0 || r > 100)
7
+ throw new Error(
8
+ `${n} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`
9
+ );
10
+ return r;
11
+ }, "toPercent"), A = /* @__PURE__ */ u((e, n, r) => ({
12
+ x: D(n, `${r} evolution`),
13
+ y: D(e, `${r} visibility`)
14
+ }), "toCoordinates"), J = /* @__PURE__ */ u((e) => {
15
+ if (e) {
16
+ if (e === "+<>")
17
+ return "bidirectional";
18
+ if (e === "+<")
19
+ return "backward";
20
+ if (e === "+>")
21
+ return "forward";
22
+ }
23
+ }, "getFlowFromPort"), Rt = /* @__PURE__ */ u((e) => {
24
+ if (!e?.startsWith("+"))
25
+ return {};
26
+ const r = /^\+'([^']*)'/.exec(e)?.[1];
27
+ return e.includes("<>") ? { flow: "bidirectional", label: r } : e.includes("<") ? { flow: "backward", label: r } : e.includes(">") ? { flow: "forward", label: r } : { label: r };
28
+ }, "extractFlowFromArrow"), Ot = /* @__PURE__ */ u((e, n) => {
29
+ if (St(e, n), e.size && n.setSize(e.size.width, e.size.height), e.evolution) {
30
+ const r = e.evolution.stages.map((a) => a.secondName ? `${a.name.trim()} / ${a.secondName.trim()}` : a.name.trim()), x = e.evolution.stages.filter((a) => a.boundary !== void 0).map((a) => a.boundary);
31
+ n.updateAxes({ stages: r, stageBoundaries: x });
32
+ }
33
+ if (e.anchors.forEach((r) => {
34
+ const x = A(r.visibility, r.evolution, `Anchor "${r.name}"`);
35
+ n.addNode(r.name, r.name, x.x, x.y, "anchor");
36
+ }), e.components.forEach((r) => {
37
+ const x = A(
38
+ r.visibility,
39
+ r.evolution,
40
+ `Component "${r.name}"`
41
+ ), a = r.label ? (r.label.negX ? -1 : 1) * r.label.offsetX : void 0, d = r.label ? (r.label.negY ? -1 : 1) * r.label.offsetY : void 0, w = r.decorator?.strategy;
42
+ n.addNode(
43
+ r.name,
44
+ r.name,
45
+ x.x,
46
+ x.y,
47
+ "component",
48
+ a,
49
+ d,
50
+ r.inertia,
51
+ w
52
+ );
53
+ }), e.notes.forEach((r) => {
54
+ const x = A(r.visibility, r.evolution, `Note "${r.text}"`);
55
+ n.addNote(r.text, x.x, x.y);
56
+ }), e.pipelines.forEach((r) => {
57
+ const x = n.getNode(r.parent);
58
+ if (!x || typeof x.y != "number")
59
+ throw new Error(
60
+ `Pipeline "${r.parent}" must reference an existing component with coordinates.`
61
+ );
62
+ const a = x.y;
63
+ n.startPipeline(r.parent), r.components.forEach((d) => {
64
+ const w = `${r.parent}_${d.name}`, C = d.label ? (d.label.negX ? -1 : 1) * d.label.offsetX : void 0, g = d.label ? (d.label.negY ? -1 : 1) * d.label.offsetY : void 0, F = D(d.evolution, `Pipeline component "${d.name}" evolution`);
65
+ n.addNode(
66
+ w,
67
+ d.name,
68
+ F,
69
+ a,
70
+ "pipeline-component",
71
+ C,
72
+ g
73
+ ), n.addPipelineComponent(r.parent, w);
74
+ });
75
+ }), e.links.forEach((r) => {
76
+ const x = !!r.arrow && (r.arrow.includes("-.->") || r.arrow.includes(".-."));
77
+ let a = J(r.fromPort) ?? J(r.toPort);
78
+ const { flow: d, label: w } = Rt(r.arrow);
79
+ !a && d && (a = d);
80
+ const C = r.linkLabel, g = w ?? C;
81
+ n.addLink(n.resolveNodeId(r.from), n.resolveNodeId(r.to), x, g, a);
82
+ }), e.evolves.forEach((r) => {
83
+ const x = n.getNode(r.component);
84
+ if (x?.y !== void 0) {
85
+ const a = D(r.target, `Evolve target for "${r.component}"`);
86
+ n.addTrend(r.component, a, x.y);
87
+ }
88
+ }), e.annotations.length > 0) {
89
+ const r = e.annotations[0], x = A(r.x, r.y, "Annotations box");
90
+ n.setAnnotationsBox(x.x, x.y);
91
+ }
92
+ e.annotation.forEach((r) => {
93
+ const x = A(r.x, r.y, `Annotation ${r.number}`);
94
+ n.addAnnotation(r.number, [{ x: x.x, y: x.y }], r.text);
95
+ }), e.accelerators.forEach((r) => {
96
+ const x = A(r.x, r.y, `Accelerator "${r.name}"`);
97
+ n.addAccelerator(r.name, x.x, x.y);
98
+ }), e.deaccelerators.forEach((r) => {
99
+ const x = A(
100
+ r.x,
101
+ r.y,
102
+ `Deaccelerator "${r.name}"`
103
+ );
104
+ n.addDeaccelerator(r.name, x.x, x.y);
105
+ });
106
+ }, "populateDb"), Q = {
107
+ parser: {
108
+ // @ts-expect-error - WardleyDB is not assignable to DiagramDB
109
+ yy: void 0
110
+ },
111
+ parse: /* @__PURE__ */ u(async (e) => {
112
+ const n = await Ft("wardley", e);
113
+ K.debug(n);
114
+ const r = Q.parser?.yy;
115
+ if (!r || typeof r.addNode != "function")
116
+ throw new Error(
117
+ "parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
118
+ );
119
+ Ot(n, r);
120
+ }, "parse")
121
+ }, Wt = class {
122
+ constructor() {
123
+ this.nodes = /* @__PURE__ */ new Map(), this.links = [], this.trends = /* @__PURE__ */ new Map(), this.pipelines = /* @__PURE__ */ new Map(), this.annotations = [], this.notes = [], this.accelerators = [], this.deaccelerators = [], this.axes = {};
124
+ }
125
+ static {
126
+ u(this, "WardleyBuilder");
127
+ }
128
+ addNode(e) {
129
+ const n = this.nodes.get(e.id) ?? { id: e.id, label: e.label }, r = {
130
+ ...n,
131
+ ...e,
132
+ className: e.className ?? n.className,
133
+ labelOffsetX: e.labelOffsetX ?? n.labelOffsetX,
134
+ labelOffsetY: e.labelOffsetY ?? n.labelOffsetY
135
+ };
136
+ this.nodes.set(e.id, r);
137
+ }
138
+ addLink(e) {
139
+ this.links.push(e);
140
+ }
141
+ addTrend(e) {
142
+ this.trends.set(e.nodeId, e);
143
+ }
144
+ startPipeline(e) {
145
+ this.pipelines.set(e, { nodeId: e, componentIds: [] });
146
+ const n = this.nodes.get(e);
147
+ n && (n.isPipelineParent = !0);
148
+ }
149
+ addPipelineComponent(e, n) {
150
+ const r = this.pipelines.get(e);
151
+ r && r.componentIds.push(n);
152
+ const x = this.nodes.get(n);
153
+ x && (x.inPipeline = !0);
154
+ }
155
+ addAnnotation(e) {
156
+ this.annotations.push(e);
157
+ }
158
+ addNote(e) {
159
+ this.notes.push(e);
160
+ }
161
+ addAccelerator(e) {
162
+ this.accelerators.push(e);
163
+ }
164
+ addDeaccelerator(e) {
165
+ this.deaccelerators.push(e);
166
+ }
167
+ setAnnotationsBox(e, n) {
168
+ this.annotationsBox = { x: e, y: n };
169
+ }
170
+ setAxes(e) {
171
+ this.axes = {
172
+ ...this.axes,
173
+ ...e
174
+ };
175
+ }
176
+ setSize(e, n) {
177
+ this.size = { width: e, height: n };
178
+ }
179
+ getNode(e) {
180
+ return this.nodes.get(e);
181
+ }
182
+ /**
183
+ * Resolve a name to a node ID. Tries exact ID match first,
184
+ * then falls back to finding a node whose label matches the name
185
+ * (handles pipeline components which have synthetic IDs like "Parent_Child").
186
+ */
187
+ resolveNodeId(e) {
188
+ if (this.nodes.has(e))
189
+ return e;
190
+ for (const [n, r] of this.nodes)
191
+ if (r.label === e)
192
+ return n;
193
+ return e;
194
+ }
195
+ build() {
196
+ const e = [];
197
+ for (const n of this.nodes.values()) {
198
+ if (typeof n.x != "number" || typeof n.y != "number")
199
+ throw new Error(`Node "${n.label}" is missing coordinates`);
200
+ e.push(n);
201
+ }
202
+ return {
203
+ nodes: e,
204
+ links: [...this.links],
205
+ trends: [...this.trends.values()],
206
+ pipelines: [...this.pipelines.values()],
207
+ annotations: [...this.annotations],
208
+ notes: [...this.notes],
209
+ accelerators: [...this.accelerators],
210
+ deaccelerators: [...this.deaccelerators],
211
+ annotationsBox: this.annotationsBox,
212
+ axes: { ...this.axes },
213
+ size: this.size
214
+ };
215
+ }
216
+ clear() {
217
+ this.nodes.clear(), this.links = [], this.trends.clear(), this.pipelines.clear(), this.annotations = [], this.notes = [], this.accelerators = [], this.deaccelerators = [], this.annotationsBox = void 0, this.axes = {}, this.size = void 0;
218
+ }
219
+ }, k = new Wt();
220
+ function tt() {
221
+ return j()["wardley-beta"];
222
+ }
223
+ u(tt, "getConfig");
224
+ function et(e, n, r, x, a, d, w, C, g) {
225
+ k.addNode({
226
+ id: e,
227
+ label: n,
228
+ x: r,
229
+ y: x,
230
+ className: a,
231
+ labelOffsetX: d,
232
+ labelOffsetY: w,
233
+ inertia: C,
234
+ sourceStrategy: g
235
+ });
236
+ }
237
+ u(et, "addNode");
238
+ function at(e, n, r = !1, x, a) {
239
+ k.addLink({
240
+ source: e,
241
+ target: n,
242
+ dashed: r,
243
+ label: x,
244
+ flow: a
245
+ });
246
+ }
247
+ u(at, "addLink");
248
+ function rt(e, n, r) {
249
+ k.addTrend({ nodeId: e, targetX: n, targetY: r });
250
+ }
251
+ u(rt, "addTrend");
252
+ function ot(e, n, r) {
253
+ k.addAnnotation({
254
+ number: e,
255
+ coordinates: n,
256
+ text: r
257
+ });
258
+ }
259
+ u(ot, "addAnnotation");
260
+ function nt(e, n, r) {
261
+ k.addNote({
262
+ text: e,
263
+ x: n,
264
+ y: r
265
+ });
266
+ }
267
+ u(nt, "addNote");
268
+ function st(e, n, r) {
269
+ k.addAccelerator({
270
+ name: e,
271
+ x: n,
272
+ y: r
273
+ });
274
+ }
275
+ u(st, "addAccelerator");
276
+ function it(e, n, r) {
277
+ k.addDeaccelerator({
278
+ name: e,
279
+ x: n,
280
+ y: r
281
+ });
282
+ }
283
+ u(it, "addDeaccelerator");
284
+ function dt(e, n) {
285
+ k.setAnnotationsBox(e, n);
286
+ }
287
+ u(dt, "setAnnotationsBox");
288
+ function lt(e, n) {
289
+ k.setSize(e, n);
290
+ }
291
+ u(lt, "setSize");
292
+ function ct(e) {
293
+ k.startPipeline(e);
294
+ }
295
+ u(ct, "startPipeline");
296
+ function pt(e, n) {
297
+ k.addPipelineComponent(e, n);
298
+ }
299
+ u(pt, "addPipelineComponent");
300
+ function ft(e) {
301
+ k.setAxes(e);
302
+ }
303
+ u(ft, "updateAxes");
304
+ function ht(e) {
305
+ return k.getNode(e);
306
+ }
307
+ u(ht, "getNode");
308
+ function xt(e) {
309
+ return k.resolveNodeId(e);
310
+ }
311
+ u(xt, "resolveNodeId");
312
+ function gt() {
313
+ return k.build();
314
+ }
315
+ u(gt, "getWardleyData");
316
+ function yt() {
317
+ k.clear(), Bt();
318
+ }
319
+ u(yt, "clear");
320
+ var Dt = {
321
+ getConfig: tt,
322
+ addNode: et,
323
+ addLink: at,
324
+ addTrend: rt,
325
+ addAnnotation: ot,
326
+ addNote: nt,
327
+ addAccelerator: st,
328
+ addDeaccelerator: it,
329
+ setAnnotationsBox: dt,
330
+ setSize: lt,
331
+ startPipeline: ct,
332
+ addPipelineComponent: pt,
333
+ updateAxes: ft,
334
+ getNode: ht,
335
+ resolveNodeId: xt,
336
+ getWardleyData: gt,
337
+ clear: yt,
338
+ setAccTitle: At,
339
+ getAccTitle: Tt,
340
+ setDiagramTitle: Lt,
341
+ getDiagramTitle: zt,
342
+ getAccDescription: Nt,
343
+ setAccDescription: Mt
344
+ }, Gt = ["Genesis", "Custom Built", "Product", "Commodity"], qt = /* @__PURE__ */ u(() => {
345
+ const { themeVariables: e } = j();
346
+ return {
347
+ backgroundColor: e.wardley?.backgroundColor ?? e.background ?? "#fff",
348
+ axisColor: e.wardley?.axisColor ?? "#000",
349
+ axisTextColor: e.wardley?.axisTextColor ?? e.primaryTextColor ?? "#222",
350
+ gridColor: e.wardley?.gridColor ?? "rgba(100, 100, 100, 0.2)",
351
+ componentFill: e.wardley?.componentFill ?? "#fff",
352
+ componentStroke: e.wardley?.componentStroke ?? "#000",
353
+ componentLabelColor: e.wardley?.componentLabelColor ?? e.primaryTextColor ?? "#222",
354
+ linkStroke: e.wardley?.linkStroke ?? "#000",
355
+ evolutionStroke: e.wardley?.evolutionStroke ?? "#dc3545",
356
+ annotationStroke: e.wardley?.annotationStroke ?? "#000",
357
+ annotationTextColor: e.wardley?.annotationTextColor ?? e.primaryTextColor ?? "#222",
358
+ annotationFill: e.wardley?.annotationFill ?? e.background ?? "#fff"
359
+ };
360
+ }, "getTheme"), Ht = /* @__PURE__ */ u(() => {
361
+ const e = j()["wardley-beta"];
362
+ return {
363
+ width: e?.width ?? 900,
364
+ height: e?.height ?? 600,
365
+ padding: e?.padding ?? 48,
366
+ nodeRadius: e?.nodeRadius ?? 6,
367
+ nodeLabelOffset: e?.nodeLabelOffset ?? 8,
368
+ axisFontSize: e?.axisFontSize ?? 12,
369
+ labelFontSize: e?.labelFontSize ?? 10,
370
+ showGrid: e?.showGrid ?? !1,
371
+ useMaxWidth: e?.useMaxWidth ?? !0
372
+ };
373
+ }, "getConfigValues"), jt = /* @__PURE__ */ u((e, n, r, x) => {
374
+ K.debug(`Rendering Wardley map
375
+ ` + e);
376
+ const a = Ht(), d = qt(), w = a.nodeRadius * 1.6, C = x.db, g = C.getWardleyData(), F = C.getDiagramTitle(), S = g.size?.width ?? a.width, b = g.size?.height ?? a.height, E = Yt(n);
377
+ E.selectAll("*").remove(), It(E, b, S, a.useMaxWidth), E.attr("viewBox", `0 0 ${S} ${b}`);
378
+ const v = E.append("g").attr("class", "wardley-map"), G = E.append("defs");
379
+ G.append("marker").attr("id", `arrow-${n}`).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerWidth", 6).attr("markerHeight", 6).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("fill", d.evolutionStroke).attr("stroke", "none"), G.append("marker").attr("id", `link-arrow-end-${n}`).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerWidth", 5).attr("markerHeight", 5).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("fill", d.linkStroke).attr("stroke", "none"), G.append("marker").attr("id", `link-arrow-start-${n}`).attr("viewBox", "0 0 10 10").attr("refX", 1).attr("refY", 5).attr("markerWidth", 5).attr("markerHeight", 5).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z").attr("fill", d.linkStroke).attr("stroke", "none"), v.append("rect").attr("class", "wardley-background").attr("width", S).attr("height", b).attr("fill", d.backgroundColor);
380
+ const Y = S - a.padding * 2, I = b - a.padding * 2;
381
+ F && v.append("text").attr("class", "wardley-title").attr("x", S / 2).attr("y", a.padding / 2).attr("fill", d.axisTextColor).attr("font-size", a.axisFontSize * 1.05).attr("font-weight", "bold").attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(F);
382
+ const z = /* @__PURE__ */ u((t) => a.padding + t / 100 * Y, "projectX"), L = /* @__PURE__ */ u((t) => b - a.padding - t / 100 * I, "projectY"), R = v.append("g").attr("class", "wardley-axes");
383
+ R.append("line").attr("x1", a.padding).attr("x2", S - a.padding).attr("y1", b - a.padding).attr("y2", b - a.padding).attr("stroke", d.axisColor).attr("stroke-width", 1), R.append("line").attr("x1", a.padding).attr("x2", a.padding).attr("y1", a.padding).attr("y2", b - a.padding).attr("stroke", d.axisColor).attr("stroke-width", 1);
384
+ const ut = g.axes.xLabel ?? "Evolution", wt = g.axes.yLabel ?? "Visibility";
385
+ R.append("text").attr("class", "wardley-axis-label wardley-axis-label-x").attr("x", a.padding + Y / 2).attr("y", b - a.padding / 4).attr("fill", d.axisTextColor).attr("font-size", a.axisFontSize).attr("font-weight", "bold").attr("text-anchor", "middle").text(ut), R.append("text").attr("class", "wardley-axis-label wardley-axis-label-y").attr("x", a.padding / 3).attr("y", a.padding + I / 2).attr("fill", d.axisTextColor).attr("font-size", a.axisFontSize).attr("font-weight", "bold").attr("text-anchor", "middle").attr(
386
+ "transform",
387
+ `rotate(-90 ${a.padding / 3} ${a.padding + I / 2})`
388
+ ).text(wt);
389
+ const B = g.axes.stages && g.axes.stages.length > 0 ? g.axes.stages : Gt;
390
+ if (B.length > 0) {
391
+ const t = v.append("g").attr("class", "wardley-stages"), s = g.axes.stageBoundaries, o = [];
392
+ if (s && s.length === B.length) {
393
+ let i = 0;
394
+ s.forEach((p) => {
395
+ o.push({ start: i, end: p }), i = p;
396
+ });
397
+ } else {
398
+ const i = 1 / B.length;
399
+ B.forEach((p, l) => {
400
+ o.push({
401
+ start: l * i,
402
+ end: (l + 1) * i
403
+ });
404
+ });
405
+ }
406
+ B.forEach((i, p) => {
407
+ const l = o[p], f = a.padding + l.start * Y, h = a.padding + l.end * Y, y = (f + h) / 2;
408
+ p > 0 && t.append("line").attr("x1", f).attr("x2", f).attr("y1", a.padding).attr("y2", b - a.padding).attr("stroke", "#000").attr("stroke-width", 1).attr("stroke-dasharray", "5 5").attr("opacity", 0.8), t.append("text").attr("class", "wardley-stage-label").attr("x", y).attr("y", b - a.padding / 1.5).attr("fill", d.axisTextColor).attr("font-size", a.axisFontSize - 2).attr("text-anchor", "middle").text(i);
409
+ });
410
+ }
411
+ if (a.showGrid) {
412
+ const t = v.append("g").attr("class", "wardley-grid");
413
+ for (let s = 1; s < 4; s++) {
414
+ const o = s / 4, i = a.padding + Y * o;
415
+ t.append("line").attr("x1", i).attr("x2", i).attr("y1", a.padding).attr("y2", b - a.padding).attr("stroke", d.gridColor).attr("stroke-dasharray", "2 6"), t.append("line").attr("x1", a.padding).attr("x2", S - a.padding).attr("y1", b - a.padding - I * o).attr("y2", b - a.padding - I * o).attr("stroke", d.gridColor).attr("stroke-dasharray", "2 6");
416
+ }
417
+ }
418
+ const c = /* @__PURE__ */ new Map();
419
+ if (g.nodes.forEach((t) => {
420
+ c.set(t.id, {
421
+ x: z(t.x),
422
+ y: L(t.y),
423
+ node: t
424
+ });
425
+ }), g.pipelines.length > 0) {
426
+ const t = v.append("g").attr("class", "wardley-pipelines"), s = v.append("g").attr("class", "wardley-pipeline-links");
427
+ g.pipelines.forEach((o) => {
428
+ if (o.componentIds.length === 0)
429
+ return;
430
+ const i = o.componentIds.map((h) => ({ id: h, pos: c.get(h), node: g.nodes.find((y) => y.id === h) })).filter((h) => h.pos && h.node).sort((h, y) => h.node.x - y.node.x);
431
+ for (let h = 0; h < i.length - 1; h++) {
432
+ const y = i[h], m = i[h + 1];
433
+ s.append("line").attr("class", "wardley-pipeline-evolution-link").attr("x1", y.pos.x).attr("y1", y.pos.y).attr("x2", m.pos.x).attr("y2", m.pos.y).attr("stroke", d.linkStroke).attr("stroke-width", 1).attr("stroke-dasharray", "4 4");
434
+ }
435
+ let p = 1 / 0, l = -1 / 0, f = 0;
436
+ if (o.componentIds.forEach((h) => {
437
+ const y = c.get(h);
438
+ y && (p = Math.min(p, y.x), l = Math.max(l, y.x), f = y.y);
439
+ }), p !== 1 / 0 && l !== -1 / 0) {
440
+ const y = a.nodeRadius * 4, m = f - y / 2, P = c.get(o.nodeId);
441
+ if (P) {
442
+ const N = (p + l) / 2;
443
+ P.x = N, P.y = m - w / 6;
444
+ }
445
+ t.append("rect").attr("class", "wardley-pipeline-box").attr("x", p - 15).attr("y", m).attr("width", l - p + 30).attr("height", y).attr("fill", "none").attr("stroke", d.axisColor).attr("stroke-width", 1.5).attr("rx", 4).attr("ry", 4);
446
+ }
447
+ });
448
+ }
449
+ const V = v.append("g").attr("class", "wardley-links"), _ = /* @__PURE__ */ new Map();
450
+ g.pipelines.forEach((t) => {
451
+ _.set(t.nodeId, new Set(t.componentIds));
452
+ });
453
+ const Z = g.links.filter((t) => !(!c.has(t.source) || !c.has(t.target) || _.get(t.target)?.has(t.source)));
454
+ V.selectAll("line").data(Z).enter().append("line").attr("class", (t) => `wardley-link${t.dashed ? " wardley-link--dashed" : ""}`).attr("x1", (t) => {
455
+ const s = c.get(t.source), o = c.get(t.target), p = g.nodes.find((y) => y.id === t.source).isPipelineParent ? w / Math.sqrt(2) : a.nodeRadius, l = o.x - s.x, f = o.y - s.y, h = Math.sqrt(l * l + f * f);
456
+ return s.x + l / h * p;
457
+ }).attr("y1", (t) => {
458
+ const s = c.get(t.source), o = c.get(t.target), p = g.nodes.find((y) => y.id === t.source).isPipelineParent ? w / Math.sqrt(2) : a.nodeRadius, l = o.x - s.x, f = o.y - s.y, h = Math.sqrt(l * l + f * f);
459
+ return s.y + f / h * p;
460
+ }).attr("x2", (t) => {
461
+ const s = c.get(t.source), o = c.get(t.target), p = g.nodes.find((y) => y.id === t.target).isPipelineParent ? w / Math.sqrt(2) : a.nodeRadius, l = s.x - o.x, f = s.y - o.y, h = Math.sqrt(l * l + f * f);
462
+ return o.x + l / h * p;
463
+ }).attr("y2", (t) => {
464
+ const s = c.get(t.source), o = c.get(t.target), p = g.nodes.find((y) => y.id === t.target).isPipelineParent ? w / Math.sqrt(2) : a.nodeRadius, l = s.x - o.x, f = s.y - o.y, h = Math.sqrt(l * l + f * f);
465
+ return o.y + f / h * p;
466
+ }).attr("stroke", d.linkStroke).attr("stroke-width", 1).attr("stroke-dasharray", (t) => t.dashed ? "6 6" : null).attr("marker-end", (t) => t.flow === "forward" || t.flow === "bidirectional" ? `url(#link-arrow-end-${n})` : null).attr("marker-start", (t) => t.flow === "backward" || t.flow === "bidirectional" ? `url(#link-arrow-start-${n})` : null), V.selectAll("text").data(Z.filter((t) => t.label)).enter().append("text").attr("class", "wardley-link-label").attr("x", (t) => {
467
+ const s = c.get(t.source), o = c.get(t.target), i = (s.x + o.x) / 2, p = o.y - s.y, l = o.x - s.x, f = Math.sqrt(l * l + p * p), h = 8, y = p / f;
468
+ return i + y * h;
469
+ }).attr("y", (t) => {
470
+ const s = c.get(t.source), o = c.get(t.target), i = (s.y + o.y) / 2, p = o.x - s.x, l = o.y - s.y, f = Math.sqrt(p * p + l * l), h = 8, y = -p / f;
471
+ return i + y * h;
472
+ }).attr("fill", d.axisTextColor).attr("font-size", a.labelFontSize).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("transform", (t) => {
473
+ const s = c.get(t.source), o = c.get(t.target), i = (s.x + o.x) / 2, p = (s.y + o.y) / 2, l = o.x - s.x, f = o.y - s.y, h = Math.sqrt(l * l + f * f), y = 8, m = f / h, P = -l / h, N = i + m * y, O = p + P * y;
474
+ let X = Math.atan2(f, l) * 180 / Math.PI;
475
+ return (X > 90 || X < -90) && (X += 180), `rotate(${X} ${N} ${O})`;
476
+ }).text((t) => t.label);
477
+ const mt = v.append("g").attr("class", "wardley-trends"), kt = g.trends.map((t) => {
478
+ const s = c.get(t.nodeId);
479
+ if (!s)
480
+ return null;
481
+ const o = z(t.targetX), i = L(t.targetY), p = o - s.x, l = i - s.y, f = Math.sqrt(p * p + l * l), h = a.nodeRadius + 2, y = f > h ? o - p / f * h : o, m = f > h ? i - l / f * h : i;
482
+ return {
483
+ origin: s,
484
+ targetX: o,
485
+ targetY: i,
486
+ adjustedX2: y,
487
+ adjustedY2: m
488
+ };
489
+ }).filter((t) => t !== null);
490
+ mt.selectAll("line").data(kt).enter().append("line").attr("class", "wardley-trend").attr("x1", (t) => t.origin.x).attr("y1", (t) => t.origin.y).attr("x2", (t) => t.adjustedX2).attr("y2", (t) => t.adjustedY2).attr("stroke", d.evolutionStroke).attr("stroke-width", 1).attr("stroke-dasharray", "4 4").attr("marker-end", `url(#arrow-${n})`);
491
+ const M = v.append("g").attr("class", "wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr(
492
+ "class",
493
+ (t) => ["wardley-node", t.className ? `wardley-node--${t.className}` : ""].filter(Boolean).join(" ")
494
+ );
495
+ M.filter((t) => t.sourceStrategy === "outsource").append("circle").attr("class", "wardley-outsource-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", a.nodeRadius * 2).attr("fill", "#666").attr("stroke", d.componentStroke).attr("stroke-width", 1), M.filter((t) => t.sourceStrategy === "buy").append("circle").attr("class", "wardley-buy-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", a.nodeRadius * 2).attr("fill", "#ccc").attr("stroke", d.componentStroke).attr("stroke-width", 1), M.filter((t) => t.sourceStrategy === "build").append("circle").attr("class", "wardley-build-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", a.nodeRadius * 2).attr("fill", "#eee").attr("stroke", "#000").attr("stroke-width", 1);
496
+ const T = M.filter((t) => t.sourceStrategy === "market");
497
+ T.append("circle").attr("class", "wardley-market-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", a.nodeRadius * 2).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 1), M.filter(
498
+ (t) => !t.isPipelineParent && t.sourceStrategy !== "market" && t.className !== "anchor"
499
+ ).append("circle").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", a.nodeRadius).attr("fill", d.componentFill).attr("stroke", d.componentStroke).attr("stroke-width", 1);
500
+ const q = a.nodeRadius * 0.7, $ = a.nodeRadius * 1.2;
501
+ if (T.append("line").attr("class", "wardley-market-line").attr("x1", (t) => c.get(t.id).x).attr("y1", (t) => c.get(t.id).y - $).attr("x2", (t) => c.get(t.id).x - $ * Math.cos(Math.PI / 6)).attr("y2", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("stroke", d.componentStroke).attr("stroke-width", 1), T.append("line").attr("class", "wardley-market-line").attr("x1", (t) => c.get(t.id).x - $ * Math.cos(Math.PI / 6)).attr("y1", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("x2", (t) => c.get(t.id).x + $ * Math.cos(Math.PI / 6)).attr("y2", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("stroke", d.componentStroke).attr("stroke-width", 1), T.append("line").attr("class", "wardley-market-line").attr("x1", (t) => c.get(t.id).x + $ * Math.cos(Math.PI / 6)).attr("y1", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("x2", (t) => c.get(t.id).x).attr("y2", (t) => c.get(t.id).y - $).attr("stroke", d.componentStroke).attr("stroke-width", 1), T.append("circle").attr("class", "wardley-market-dot").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y - $).attr("r", q).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 2), T.append("circle").attr("class", "wardley-market-dot").attr("cx", (t) => c.get(t.id).x - $ * Math.cos(Math.PI / 6)).attr("cy", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("r", q).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 2), T.append("circle").attr("class", "wardley-market-dot").attr("cx", (t) => c.get(t.id).x + $ * Math.cos(Math.PI / 6)).attr("cy", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("r", q).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 2), M.filter((t) => t.isPipelineParent === !0).append("rect").attr("x", (t) => c.get(t.id).x - w / 2).attr("y", (t) => c.get(t.id).y - w / 2).attr("width", w).attr("height", w).attr("fill", d.componentFill).attr("stroke", d.componentStroke).attr("stroke-width", 1), M.filter((t) => t.inertia === !0).append("line").attr("class", "wardley-inertia").attr("x1", (t) => {
502
+ const s = c.get(t.id);
503
+ let o = t.isPipelineParent ? w / 2 + 15 : a.nodeRadius + 15;
504
+ return t.sourceStrategy && (o += a.nodeRadius + 10), s.x + o;
505
+ }).attr("y1", (t) => {
506
+ const s = c.get(t.id), o = t.isPipelineParent ? w : a.nodeRadius * 2;
507
+ return s.y - o / 2;
508
+ }).attr("x2", (t) => {
509
+ const s = c.get(t.id);
510
+ let o = t.isPipelineParent ? w / 2 + 15 : a.nodeRadius + 15;
511
+ return t.sourceStrategy && (o += a.nodeRadius + 10), s.x + o;
512
+ }).attr("y2", (t) => {
513
+ const s = c.get(t.id), o = t.isPipelineParent ? w : a.nodeRadius * 2;
514
+ return s.y + o / 2;
515
+ }).attr("stroke", d.componentStroke).attr("stroke-width", 6), M.append("text").attr("x", (t) => {
516
+ const s = c.get(t.id);
517
+ if (t.className === "anchor")
518
+ return t.labelOffsetX !== void 0 ? s.x + t.labelOffsetX : s.x;
519
+ let o = a.nodeLabelOffset;
520
+ t.sourceStrategy && t.labelOffsetX === void 0 && (o += 10);
521
+ const i = t.labelOffsetX ?? o;
522
+ return s.x + i;
523
+ }).attr("y", (t) => {
524
+ const s = c.get(t.id);
525
+ if (t.className === "anchor")
526
+ return t.labelOffsetY !== void 0 ? s.y + t.labelOffsetY : s.y - 3;
527
+ let o = -a.nodeLabelOffset;
528
+ t.sourceStrategy && t.labelOffsetY === void 0 && (o -= 10);
529
+ const i = t.labelOffsetY ?? o;
530
+ return s.y + i;
531
+ }).attr("class", "wardley-node-label").attr("fill", (t) => t.className === "evolved" ? d.evolutionStroke : t.className === "anchor" ? "#000" : d.componentLabelColor).attr("font-size", a.labelFontSize).attr("font-weight", (t) => t.className === "anchor" ? "bold" : "normal").attr("text-anchor", (t) => t.className === "anchor" ? "middle" : "start").attr("dominant-baseline", (t) => t.className === "anchor" ? "middle" : "auto").text((t) => t.label), g.annotations.length > 0) {
532
+ const t = v.append("g").attr("class", "wardley-annotations");
533
+ if (g.annotations.forEach((s) => {
534
+ const o = s.coordinates.map((i) => ({
535
+ x: z(i.x),
536
+ y: L(i.y)
537
+ }));
538
+ if (o.length > 1)
539
+ for (let i = 0; i < o.length - 1; i++)
540
+ t.append("line").attr("class", "wardley-annotation-line").attr("x1", o[i].x).attr("y1", o[i].y).attr("x2", o[i + 1].x).attr("y2", o[i + 1].y).attr("stroke", d.axisColor).attr("stroke-width", 1.5).attr("stroke-dasharray", "4 4");
541
+ o.forEach((i) => {
542
+ const p = t.append("g").attr("class", "wardley-annotation");
543
+ p.append("circle").attr("cx", i.x).attr("cy", i.y).attr("r", 10).attr("fill", "white").attr("stroke", d.axisColor).attr("stroke-width", 1.5), p.append("text").attr("x", i.x).attr("y", i.y).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", 10).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(s.number);
544
+ });
545
+ }), g.annotationsBox) {
546
+ let s = z(g.annotationsBox.x), o = L(g.annotationsBox.y);
547
+ const i = 10, p = 16, l = 11, f = t.append("g").attr("class", "wardley-annotations-box"), h = [...g.annotations].filter((m) => m.text).sort((m, P) => m.number - P.number), y = [];
548
+ if (h.forEach((m, P) => {
549
+ const N = f.append("text").attr("x", s + i).attr("y", o + i + (P + 1) * p).attr("font-size", l).attr("fill", d.axisTextColor).attr("text-anchor", "start").attr("dominant-baseline", "middle").text(`${m.number}. ${m.text}`);
550
+ y.push(N);
551
+ }), y.length > 0) {
552
+ let m = 0, P = 0;
553
+ y.forEach((H) => {
554
+ const W = H.node(), Pt = W.getComputedTextLength();
555
+ m = Math.max(m, Pt);
556
+ const Ct = W.getBBox();
557
+ P = Math.max(P, Ct.height);
558
+ });
559
+ const N = m + i * 2 + 105, O = h.length * p + i * 2 + P / 2, X = a.padding, bt = S - a.padding - N, $t = a.padding, vt = b - a.padding - O;
560
+ s = Math.max(X, Math.min(s, bt)), o = Math.max($t, Math.min(o, vt)), y.forEach((H, W) => {
561
+ H.attr("x", s + i).attr("y", o + i + (W + 1) * p);
562
+ }), f.insert("rect", "text").attr("x", s).attr("y", o).attr("width", N).attr("height", O).attr("fill", "white").attr("stroke", d.axisColor).attr("stroke-width", 1.5).attr("rx", 4).attr("ry", 4);
563
+ }
564
+ }
565
+ }
566
+ if (g.notes.length > 0) {
567
+ const t = v.append("g").attr("class", "wardley-notes");
568
+ g.notes.forEach((s) => {
569
+ const o = z(s.x), i = L(s.y);
570
+ t.append("text").attr("x", o).attr("y", i).attr("text-anchor", "start").attr("font-size", 11).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(s.text);
571
+ });
572
+ }
573
+ if (g.accelerators.length > 0) {
574
+ const t = v.append("g").attr("class", "wardley-accelerators");
575
+ g.accelerators.forEach((s) => {
576
+ const o = z(s.x), i = L(s.y), p = 60, l = 30, f = 20, h = `
577
+ M ${o} ${i - l / 2}
578
+ L ${o + p - f} ${i - l / 2}
579
+ L ${o + p - f} ${i - l / 2 - 8}
580
+ L ${o + p} ${i}
581
+ L ${o + p - f} ${i + l / 2 + 8}
582
+ L ${o + p - f} ${i + l / 2}
583
+ L ${o} ${i + l / 2}
584
+ Z
585
+ `;
586
+ t.append("path").attr("d", h).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 1), t.append("text").attr("x", o + p / 2).attr("y", i + l / 2 + 15).attr("text-anchor", "middle").attr("font-size", 10).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(s.name);
587
+ });
588
+ }
589
+ if (g.deaccelerators.length > 0) {
590
+ const t = v.append("g").attr("class", "wardley-deaccelerators");
591
+ g.deaccelerators.forEach((s) => {
592
+ const o = z(s.x), i = L(s.y), p = 60, l = 30, f = 20, h = `
593
+ M ${o + p} ${i - l / 2}
594
+ L ${o + f} ${i - l / 2}
595
+ L ${o + f} ${i - l / 2 - 8}
596
+ L ${o} ${i}
597
+ L ${o + f} ${i + l / 2 + 8}
598
+ L ${o + f} ${i + l / 2}
599
+ L ${o + p} ${i + l / 2}
600
+ Z
601
+ `;
602
+ t.append("path").attr("d", h).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 1), t.append("text").attr("x", o + p / 2).attr("y", i + l / 2 + 15).attr("text-anchor", "middle").attr("font-size", 10).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(s.name);
603
+ });
604
+ }
605
+ }, "draw"), Vt = {
606
+ draw: jt
607
+ }, _t = /* @__PURE__ */ u(({
608
+ wardley: e
609
+ } = {}) => {
610
+ const n = Xt(), r = Et(), x = U(n, r.themeVariables), a = U(x.wardley, e);
611
+ return `
612
+ .wardley-background {
613
+ fill: ${a.backgroundColor};
614
+ }
615
+ .wardley-axes line, .wardley-axes path {
616
+ stroke: ${a.axisColor};
617
+ }
618
+ .wardley-axis-label {
619
+ fill: ${a.axisTextColor};
620
+ }
621
+ .wardley-stage-label {
622
+ fill: ${a.axisTextColor};
623
+ }
624
+ .wardley-grid line {
625
+ stroke: ${a.gridColor};
626
+ }
627
+ .wardley-node circle {
628
+ fill: ${a.componentFill};
629
+ stroke: ${a.componentStroke};
630
+ }
631
+ .wardley-node-label {
632
+ fill: ${a.componentLabelColor};
633
+ }
634
+ .wardley-link {
635
+ stroke: ${a.linkStroke};
636
+ }
637
+ .wardley-link--dashed {
638
+ stroke-dasharray: 4 4;
639
+ }
640
+ .wardley-link-label {
641
+ fill: ${a.axisTextColor};
642
+ }
643
+ .wardley-trend line {
644
+ stroke: ${a.evolutionStroke};
645
+ }
646
+ .wardley-annotation-line {
647
+ stroke: ${a.annotationStroke};
648
+ }
649
+ .wardley-annotation circle {
650
+ fill: ${a.annotationFill};
651
+ stroke: ${a.annotationStroke};
652
+ }
653
+ .wardley-annotation text {
654
+ fill: ${a.annotationTextColor};
655
+ }
656
+ .wardley-annotations-box rect {
657
+ fill: ${a.annotationFill};
658
+ stroke: ${a.annotationStroke};
659
+ }
660
+ .wardley-annotations-box text {
661
+ fill: ${a.annotationTextColor};
662
+ }
663
+ .wardley-pipeline-box {
664
+ stroke: ${a.componentStroke};
665
+ }
666
+ .wardley-notes text {
667
+ fill: ${a.axisTextColor};
668
+ }
669
+ `;
670
+ }, "styles"), Qt = {
671
+ parser: Q,
672
+ db: Dt,
673
+ renderer: Vt,
674
+ styles: _t
675
+ };
676
+ export {
677
+ Qt as diagram
678
+ };