@webskill/sdk 0.21.0 → 0.23.0

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 (135) hide show
  1. package/dist/abnfDiagram-O67JEVCF-DtYFjfqO.js +109 -0
  2. package/dist/agent.d.ts +3 -3
  3. package/dist/agent.js +1174 -169
  4. package/dist/{approval-DwN2o2QG.js → approval-7CuZS3Z4.js} +104 -18
  5. package/dist/arc-8U_6NQWm.js +130 -0
  6. package/dist/architecture-7GRP2DOG-RTw1wpAq.js +4 -0
  7. package/dist/architectureDiagram-NJMV4G6O-XmmXrJAK.js +7473 -0
  8. package/dist/array-DQfpQNY8.js +8 -0
  9. package/dist/blockDiagram-BEXU5L5S-D4yjnCD1.js +2582 -0
  10. package/dist/browser.d.ts +455 -49
  11. package/dist/browser.js +2134 -138
  12. package/dist/c4Diagram-YGBWAQC7-BLmA_JSd.js +3668 -0
  13. package/dist/channel-CZxxLrG7.js +9 -0
  14. package/dist/chunk-2Q5K7J3B-Ck03gkFR.js +21 -0
  15. package/dist/chunk-3FUC2YCW-tr6jmbQf.js +530 -0
  16. package/dist/chunk-5DYCD2WN-Bt97YGTd.js +58 -0
  17. package/dist/chunk-5VM5RSS4-BBxa48HL.js +21 -0
  18. package/dist/chunk-6AEJRKK7-JXK89I-O.js +14 -0
  19. package/dist/chunk-742MDFTN-CPmgCGwC.js +466 -0
  20. package/dist/chunk-7INBJB4K-C9jq9o66.js +6552 -0
  21. package/dist/chunk-7M6MHVWA-BrKCWcR1.js +4894 -0
  22. package/dist/chunk-7PRAP22T-BHED6GVs.js +95 -0
  23. package/dist/chunk-DUW6YSOI-DoZj78PO.js +19 -0
  24. package/dist/chunk-FOHPRMQF-Dkbp819z.js +27189 -0
  25. package/dist/chunk-GNY47TPC-Bpvq1T49.js +87 -0
  26. package/dist/chunk-GTNCS2PH-CLmh4I2c.js +686 -0
  27. package/dist/chunk-GWA4HPMP-B6vN3fkL.js +95 -0
  28. package/dist/chunk-J5ZVWO5B-Bi_Pcobw.js +26 -0
  29. package/dist/chunk-JWPE2WC7-D1rC79GS.js +12 -0
  30. package/dist/chunk-LNGE3PJU-D5OIoe3Z.js +2582 -0
  31. package/dist/chunk-MBY4JIJT-C34L7a4f.js +2276 -0
  32. package/dist/chunk-NETBCI7D-Cg84k8N8.js +321 -0
  33. package/dist/chunk-O7XYJQB3-B6K0KOSL.js +8846 -0
  34. package/dist/chunk-UA2S7LBM-DxHM29_K.js +612 -0
  35. package/dist/chunk-WEXAMYUT-Ba6jFWhB.js +33 -0
  36. package/dist/chunk-XXDRQBXY-DPbSy4kg.js +12 -0
  37. package/dist/chunk-Y2CYZVJY-U3QOMqrW.js +15 -0
  38. package/dist/chunk-Z7XXMR3K-oLg1h8F3.js +1038 -0
  39. package/dist/chunk-ZIGJFQKS-DqEFBuHR.js +2215 -0
  40. package/dist/classDiagram-v2-NBCMYWYE-BqnOWIUt.js +3845 -0
  41. package/dist/cose-bilkent-JH36ORCC-C0dTAHVK.js +4270 -0
  42. package/dist/cynefin-OW5HDTMX-B2QvgEQj.js +4 -0
  43. package/dist/cynefinDiagram-VND7K2PF-yAWc6Z3W.js +479 -0
  44. package/dist/cytoscape.esm-C64mRh9B.js +28325 -0
  45. package/dist/dagre-6A5THRUB-D0w2W27v.js +4816 -0
  46. package/dist/defaultLocale-B_EoOkSF.js +249 -0
  47. package/dist/diagram-22UHCM2B-DvgzhUzP.js +6115 -0
  48. package/dist/diagram-3UASUU5V-DWgUB-ef.js +795 -0
  49. package/dist/diagram-ATOU4E4O-P1olqwIs.js +553 -0
  50. package/dist/diagram-CDSNMT55-BUlZuLUe.js +402 -0
  51. package/dist/diagram-MLGK6HIB-6w5qmkGt.js +186 -0
  52. package/dist/diagram-MPIPVDR6-DEFiSo8o.js +289 -0
  53. package/dist/dist-UajCDt3n.js +92 -0
  54. package/dist/ebnfDiagram-ZINNZB2B-CI8liCfR.js +123 -0
  55. package/dist/elk-276RUBZZ-3SvW6OAK.js +90034 -0
  56. package/dist/erDiagram-OPXOYQCR-CPTbKhwP.js +2301 -0
  57. package/dist/eventmodeling-NTZA5JFV-BlyuqGp0.js +4 -0
  58. package/dist/flowDiagram-KWPJA3E3-CcUJ6HbV.js +18 -0
  59. package/dist/ganttDiagram-FUAMR5RP-31UjY0KK.js +3939 -0
  60. package/dist/{toolSource-C9oNuKmr.js → geometry-CRhuySKV.js} +169 -12
  61. package/dist/gitGraph-4MIJSDKK-ChdVlrk7.js +4 -0
  62. package/dist/gitGraphDiagram-X574FWY7-DKuxJymB.js +1153 -0
  63. package/dist/governance.d.ts +22 -4
  64. package/dist/governance.js +100 -10
  65. package/dist/graphlib-tk9gQYuN.js +4194 -0
  66. package/dist/{index-DHopiH_m.d.ts → index-7No55dRb.d.ts} +161 -11
  67. package/dist/{index-B8Tgmpwh.d.ts → index-ShvCB5I9.d.ts} +2 -2
  68. package/dist/{index-CYLt5u4L.d.ts → index-V76_OFj2.d.ts} +789 -21
  69. package/dist/index.d.ts +4 -4
  70. package/dist/index.js +11 -9
  71. package/dist/info-A6RAGUB7-CxRAt9S9.js +4 -0
  72. package/dist/infoDiagram-VRGFBTTK-pRspGfjZ.js +25 -0
  73. package/dist/init-CMOIWdg-.js +16 -0
  74. package/dist/ishikawaDiagram-OU5B5YK6-DKerAPAg.js +975 -0
  75. package/dist/journeyDiagram-ZHPQQLJL-C4MK-YO5.js +1227 -0
  76. package/dist/kanban-definition-PNTS6WVX-BqsZpMXx.js +1244 -0
  77. package/dist/katex-BcRRvyh_.js +26465 -0
  78. package/dist/{kind-DaKqLX2F.js → kind-Dc8x0HWz.js} +54 -7
  79. package/dist/line-LgV8iVMV.js +48 -0
  80. package/dist/linear-BWKR0Tqd.js +393 -0
  81. package/dist/linkedDocument-CZZOl9cO.js +456 -0
  82. package/dist/mcp.d.ts +2 -2
  83. package/dist/{memoryArtifactStore-D6dLeY55.js → memoryArtifactStore-Bs7glPqm.js} +14 -0
  84. package/dist/mermaid-parser.core-pYR5siSx.js +754 -0
  85. package/dist/mermaid.core-DMtwGCHy.js +1756 -0
  86. package/dist/mindmap-definition-NLK3R4M7-CXbD-myG.js +1312 -0
  87. package/dist/node.d.ts +3 -3
  88. package/dist/node.js +12 -5
  89. package/dist/{openUiLibrary-b0i7F_oZ.js → openUiLibrary-B7j3rLrm.js} +1 -1
  90. package/dist/{openUiSpecLang-CLXJEeRU.js → openUiSpecLang-BSYYnjay.js} +1 -1
  91. package/dist/ordinal-CxA6GHQS.js +84 -0
  92. package/dist/packet-AYTQ26CC-BOm08cxl.js +4 -0
  93. package/dist/path-C27Z2Bjv.js +106 -0
  94. package/dist/{pathSecurity-B1owvJAF.js → pathSecurity-CirkQwWP.js} +12 -1
  95. package/dist/pegDiagram-GJSIUBJH-BLGJOewQ.js +115 -0
  96. package/dist/pie-WAS4IAKB-Dvg7glpk.js +4 -0
  97. package/dist/pieDiagram-5QR66LMP-laoaV_PB.js +298 -0
  98. package/dist/quadrantDiagram-O4NWA36T-Db_wFBkT.js +2236 -0
  99. package/dist/radar-RG4KPBEZ-BZDaTu06.js +4 -0
  100. package/dist/railroad-74A4TZTK-C-UhjkOy.js +4 -0
  101. package/dist/railroad-abnf-HS5TGJTU-dUKVA4OS.js +4 -0
  102. package/dist/railroad-ebnf-LZEXJU2U-DzQumk18.js +4 -0
  103. package/dist/railroad-peg-WCYAUIDC-B3vvTWed.js +4 -0
  104. package/dist/railroadDiagram-XR7U4H2S-BY0sTM4X.js +89 -0
  105. package/dist/requirementDiagram-PLB6GJNP-3rkQfEhs.js +2474 -0
  106. package/dist/rough.cjs-AmDd_NQk.js +1395 -0
  107. package/dist/sankeyDiagram-IPEJSGJF-CGAJhyG2.js +3578 -0
  108. package/dist/sequenceDiagram-PO4LG4MO-9FJjFX06.js +5522 -0
  109. package/dist/sizeCapture-INFHLROL-D8PWxdOn.js +56 -0
  110. package/dist/{skill-CAJMsLod.js → skill-WSUDp6A1.js} +1 -1
  111. package/dist/{skillVersionStore-B24Jjjry-BkOk9wI_.d.ts → skillVersionStore-S4_HJ_Fl-Cvy9LqVu.d.ts} +35 -4
  112. package/dist/src-NkhI3UMl.js +2653 -0
  113. package/dist/stateDiagram-v2-GCMORJYK-B0O3wc1-.js +2715 -0
  114. package/dist/swimlanes-2SLR337P-D4EOnrpu.js +6637 -0
  115. package/dist/swimlanesDiagram-TC7HE7FX-BUx29EJ9.js +30 -0
  116. package/dist/testing.d.ts +2 -1
  117. package/dist/testing.js +1 -1
  118. package/dist/timeline-definition-EJHVYXUP-CrgiiB4C.js +1513 -0
  119. package/dist/treeView-Q6P3EWNA-C1by-Gzc.js +4 -0
  120. package/dist/treemap-WGGIJYW6-mC2NZ6ad.js +4 -0
  121. package/dist/{types-BvTV_05--BW8zDuEk.d.ts → types-CpDRZ0rA-BiZBXGm4.d.ts} +66 -8
  122. package/dist/ui-react.d.ts +3 -3
  123. package/dist/ui-react.js +3746 -96
  124. package/dist/ui-vue.d.ts +1 -1
  125. package/dist/ui.d.ts +3 -3
  126. package/dist/ui.js +2 -2
  127. package/dist/usecaseDiagram-POWQR4AR-BUt_TQOY.js +14397 -0
  128. package/dist/vennDiagram-UO4OBE2U-CwXr0wjA.js +2808 -0
  129. package/dist/wardley-WFR3VGLG-CVSYjq_S.js +4 -0
  130. package/dist/wardleyDiagram-VNRHLVJA-Cpfd47dQ.js +874 -0
  131. package/dist/{webSkillApi-Cib6G-94.js → webSkillApi-D5VMUnrv.js} +2 -2
  132. package/dist/{webskillLitCatalog-W06npwej.js → webskillLitCatalog-D5BCiMCU.js} +1 -1
  133. package/dist/xychartDiagram-PMCCYNJV-e1TeVoc6.js +2704 -0
  134. package/package.json +1 -1
  135. package/dist/linkedDocument-C0gj1sMq.js +0 -245
@@ -0,0 +1,1513 @@
1
+ import { n as __name, t as __export } from "./chunk-Y2CYZVJY-U3QOMqrW.js";
2
+ import { m as log, p as select_default } from "./src-NkhI3UMl.js";
3
+ import { Y as setupGraphViewbox, a as clear, b as getConfig, it as isDark, nt as lighten, o as commonDb_exports, tt as darken, x as getConfig2 } from "./chunk-O7XYJQB3-B6K0KOSL.js";
4
+ import { t as arc_default } from "./arc-8U_6NQWm.js";
5
+ import { p as parseFontSize } from "./chunk-ZIGJFQKS-DqEFBuHR.js";
6
+ import { t as selectSvgElement } from "./chunk-6AEJRKK7-JXK89I-O.js";
7
+ import { i as isColorTheme, n as colorSlotCount } from "./chunk-J5ZVWO5B-Bi_Pcobw.js";
8
+
9
+ //#region ../../node_modules/.pnpm/mermaid@12.0.0/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-EJHVYXUP.mjs
10
+ var parser = (function() {
11
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
12
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v);
13
+ return o2;
14
+ }, "o"), $V0 = [
15
+ 6,
16
+ 11,
17
+ 13,
18
+ 14,
19
+ 15,
20
+ 17,
21
+ 19,
22
+ 20,
23
+ 23,
24
+ 24
25
+ ], $V1 = [1, 12], $V2 = [1, 13], $V3 = [1, 14], $V4 = [1, 15], $V5 = [1, 16], $V6 = [1, 19], $V7 = [1, 20];
26
+ var parser2 = {
27
+ trace: /* @__PURE__ */ __name(function trace() {}, "trace"),
28
+ yy: {},
29
+ symbols_: {
30
+ "error": 2,
31
+ "start": 3,
32
+ "timeline_header": 4,
33
+ "document": 5,
34
+ "EOF": 6,
35
+ "timeline": 7,
36
+ "timeline_lr": 8,
37
+ "timeline_td": 9,
38
+ "line": 10,
39
+ "SPACE": 11,
40
+ "statement": 12,
41
+ "NEWLINE": 13,
42
+ "title": 14,
43
+ "acc_title": 15,
44
+ "acc_title_value": 16,
45
+ "acc_descr": 17,
46
+ "acc_descr_value": 18,
47
+ "acc_descr_multiline_value": 19,
48
+ "section": 20,
49
+ "period_statement": 21,
50
+ "event_statement": 22,
51
+ "period": 23,
52
+ "event": 24,
53
+ "$accept": 0,
54
+ "$end": 1
55
+ },
56
+ terminals_: {
57
+ 2: "error",
58
+ 6: "EOF",
59
+ 7: "timeline",
60
+ 8: "timeline_lr",
61
+ 9: "timeline_td",
62
+ 11: "SPACE",
63
+ 13: "NEWLINE",
64
+ 14: "title",
65
+ 15: "acc_title",
66
+ 16: "acc_title_value",
67
+ 17: "acc_descr",
68
+ 18: "acc_descr_value",
69
+ 19: "acc_descr_multiline_value",
70
+ 20: "section",
71
+ 23: "period",
72
+ 24: "event"
73
+ },
74
+ productions_: [
75
+ 0,
76
+ [3, 3],
77
+ [4, 1],
78
+ [4, 1],
79
+ [4, 1],
80
+ [5, 0],
81
+ [5, 2],
82
+ [10, 2],
83
+ [10, 1],
84
+ [10, 1],
85
+ [10, 1],
86
+ [12, 1],
87
+ [12, 2],
88
+ [12, 2],
89
+ [12, 1],
90
+ [12, 1],
91
+ [12, 1],
92
+ [12, 1],
93
+ [21, 1],
94
+ [22, 1]
95
+ ],
96
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
97
+ var $0 = $$.length - 1;
98
+ switch (yystate) {
99
+ case 1: return $$[$0 - 1];
100
+ case 3:
101
+ yy.setDirection("LR");
102
+ break;
103
+ case 4:
104
+ yy.setDirection("TD");
105
+ break;
106
+ case 5:
107
+ this.$ = [];
108
+ break;
109
+ case 6:
110
+ $$[$0 - 1].push($$[$0]);
111
+ this.$ = $$[$0 - 1];
112
+ break;
113
+ case 7:
114
+ case 8:
115
+ this.$ = $$[$0];
116
+ break;
117
+ case 9:
118
+ case 10:
119
+ this.$ = [];
120
+ break;
121
+ case 11:
122
+ yy.getCommonDb().setDiagramTitle($$[$0].substr(6));
123
+ this.$ = $$[$0].substr(6);
124
+ break;
125
+ case 12:
126
+ this.$ = $$[$0].trim();
127
+ yy.getCommonDb().setAccTitle(this.$);
128
+ break;
129
+ case 13:
130
+ case 14:
131
+ this.$ = $$[$0].trim();
132
+ yy.getCommonDb().setAccDescription(this.$);
133
+ break;
134
+ case 15:
135
+ yy.addSection($$[$0].substr(8));
136
+ this.$ = $$[$0].substr(8);
137
+ break;
138
+ case 18:
139
+ yy.addTask($$[$0], 0, "");
140
+ this.$ = $$[$0];
141
+ break;
142
+ case 19:
143
+ yy.addEvent($$[$0].substr(2));
144
+ this.$ = $$[$0];
145
+ break;
146
+ }
147
+ }, "anonymous"),
148
+ table: [
149
+ {
150
+ 3: 1,
151
+ 4: 2,
152
+ 7: [1, 3],
153
+ 8: [1, 4],
154
+ 9: [1, 5]
155
+ },
156
+ { 1: [3] },
157
+ o($V0, [2, 5], { 5: 6 }),
158
+ o($V0, [2, 2]),
159
+ o($V0, [2, 3]),
160
+ o($V0, [2, 4]),
161
+ {
162
+ 6: [1, 7],
163
+ 10: 8,
164
+ 11: [1, 9],
165
+ 12: 10,
166
+ 13: [1, 11],
167
+ 14: $V1,
168
+ 15: $V2,
169
+ 17: $V3,
170
+ 19: $V4,
171
+ 20: $V5,
172
+ 21: 17,
173
+ 22: 18,
174
+ 23: $V6,
175
+ 24: $V7
176
+ },
177
+ o($V0, [2, 10], { 1: [2, 1] }),
178
+ o($V0, [2, 6]),
179
+ {
180
+ 12: 21,
181
+ 14: $V1,
182
+ 15: $V2,
183
+ 17: $V3,
184
+ 19: $V4,
185
+ 20: $V5,
186
+ 21: 17,
187
+ 22: 18,
188
+ 23: $V6,
189
+ 24: $V7
190
+ },
191
+ o($V0, [2, 8]),
192
+ o($V0, [2, 9]),
193
+ o($V0, [2, 11]),
194
+ { 16: [1, 22] },
195
+ { 18: [1, 23] },
196
+ o($V0, [2, 14]),
197
+ o($V0, [2, 15]),
198
+ o($V0, [2, 16]),
199
+ o($V0, [2, 17]),
200
+ o($V0, [2, 18]),
201
+ o($V0, [2, 19]),
202
+ o($V0, [2, 7]),
203
+ o($V0, [2, 12]),
204
+ o($V0, [2, 13])
205
+ ],
206
+ defaultActions: {},
207
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
208
+ if (hash.recoverable) this.trace(str);
209
+ else {
210
+ var error = new Error(str);
211
+ error.hash = hash;
212
+ throw error;
213
+ }
214
+ }, "parseError"),
215
+ parse: /* @__PURE__ */ __name(function parse(input) {
216
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
217
+ var args = lstack.slice.call(arguments, 1);
218
+ var lexer2 = Object.create(this.lexer);
219
+ var sharedState = { yy: {} };
220
+ for (var k in this.yy) if (Object.prototype.hasOwnProperty.call(this.yy, k)) sharedState.yy[k] = this.yy[k];
221
+ lexer2.setInput(input, sharedState.yy);
222
+ sharedState.yy.lexer = lexer2;
223
+ sharedState.yy.parser = this;
224
+ if (typeof lexer2.yylloc == "undefined") lexer2.yylloc = {};
225
+ var yyloc = lexer2.yylloc;
226
+ lstack.push(yyloc);
227
+ var ranges = lexer2.options && lexer2.options.ranges;
228
+ if (typeof sharedState.yy.parseError === "function") this.parseError = sharedState.yy.parseError;
229
+ else this.parseError = Object.getPrototypeOf(this).parseError;
230
+ function popStack(n) {
231
+ stack.length = stack.length - 2 * n;
232
+ vstack.length = vstack.length - n;
233
+ lstack.length = lstack.length - n;
234
+ }
235
+ __name(popStack, "popStack");
236
+ function lex() {
237
+ var token = tstack.pop() || lexer2.lex() || EOF;
238
+ if (typeof token !== "number") {
239
+ if (token instanceof Array) {
240
+ tstack = token;
241
+ token = tstack.pop();
242
+ }
243
+ token = self.symbols_[token] || token;
244
+ }
245
+ return token;
246
+ }
247
+ __name(lex, "lex");
248
+ var symbol, preErrorSymbol, state, action, r, yyval = {}, p, len, newState, expected;
249
+ while (true) {
250
+ state = stack[stack.length - 1];
251
+ if (this.defaultActions[state]) action = this.defaultActions[state];
252
+ else {
253
+ if (symbol === null || typeof symbol == "undefined") symbol = lex();
254
+ action = table[state] && table[state][symbol];
255
+ }
256
+ if (typeof action === "undefined" || !action.length || !action[0]) {
257
+ var errStr = "";
258
+ expected = [];
259
+ for (p in table[state]) if (this.terminals_[p] && p > TERROR) expected.push("'" + this.terminals_[p] + "'");
260
+ if (lexer2.showPosition) errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
261
+ else errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
262
+ this.parseError(errStr, {
263
+ text: lexer2.match,
264
+ token: this.terminals_[symbol] || symbol,
265
+ line: lexer2.yylineno,
266
+ loc: yyloc,
267
+ expected
268
+ });
269
+ }
270
+ if (action[0] instanceof Array && action.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
271
+ switch (action[0]) {
272
+ case 1:
273
+ stack.push(symbol);
274
+ vstack.push(lexer2.yytext);
275
+ lstack.push(lexer2.yylloc);
276
+ stack.push(action[1]);
277
+ symbol = null;
278
+ if (!preErrorSymbol) {
279
+ yyleng = lexer2.yyleng;
280
+ yytext = lexer2.yytext;
281
+ yylineno = lexer2.yylineno;
282
+ yyloc = lexer2.yylloc;
283
+ if (recovering > 0) recovering--;
284
+ } else {
285
+ symbol = preErrorSymbol;
286
+ preErrorSymbol = null;
287
+ }
288
+ break;
289
+ case 2:
290
+ len = this.productions_[action[1]][1];
291
+ yyval.$ = vstack[vstack.length - len];
292
+ yyval._$ = {
293
+ first_line: lstack[lstack.length - (len || 1)].first_line,
294
+ last_line: lstack[lstack.length - 1].last_line,
295
+ first_column: lstack[lstack.length - (len || 1)].first_column,
296
+ last_column: lstack[lstack.length - 1].last_column
297
+ };
298
+ if (ranges) yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
299
+ r = this.performAction.apply(yyval, [
300
+ yytext,
301
+ yyleng,
302
+ yylineno,
303
+ sharedState.yy,
304
+ action[1],
305
+ vstack,
306
+ lstack
307
+ ].concat(args));
308
+ if (typeof r !== "undefined") return r;
309
+ if (len) {
310
+ stack = stack.slice(0, -1 * len * 2);
311
+ vstack = vstack.slice(0, -1 * len);
312
+ lstack = lstack.slice(0, -1 * len);
313
+ }
314
+ stack.push(this.productions_[action[1]][0]);
315
+ vstack.push(yyval.$);
316
+ lstack.push(yyval._$);
317
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
318
+ stack.push(newState);
319
+ break;
320
+ case 3: return true;
321
+ }
322
+ }
323
+ return true;
324
+ }, "parse")
325
+ };
326
+ parser2.lexer = /* @__PURE__ */ (function() {
327
+ return {
328
+ EOF: 1,
329
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
330
+ if (this.yy.parser) this.yy.parser.parseError(str, hash);
331
+ else throw new Error(str);
332
+ }, "parseError"),
333
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
334
+ this.yy = yy || this.yy || {};
335
+ this._input = input;
336
+ this._more = this._backtrack = this.done = false;
337
+ this.yylineno = this.yyleng = 0;
338
+ this.yytext = this.matched = this.match = "";
339
+ this.conditionStack = ["INITIAL"];
340
+ this.yylloc = {
341
+ first_line: 1,
342
+ first_column: 0,
343
+ last_line: 1,
344
+ last_column: 0
345
+ };
346
+ if (this.options.ranges) this.yylloc.range = [0, 0];
347
+ this.offset = 0;
348
+ return this;
349
+ }, "setInput"),
350
+ input: /* @__PURE__ */ __name(function() {
351
+ var ch = this._input[0];
352
+ this.yytext += ch;
353
+ this.yyleng++;
354
+ this.offset++;
355
+ this.match += ch;
356
+ this.matched += ch;
357
+ if (ch.match(/(?:\r\n?|\n).*/g)) {
358
+ this.yylineno++;
359
+ this.yylloc.last_line++;
360
+ } else this.yylloc.last_column++;
361
+ if (this.options.ranges) this.yylloc.range[1]++;
362
+ this._input = this._input.slice(1);
363
+ return ch;
364
+ }, "input"),
365
+ unput: /* @__PURE__ */ __name(function(ch) {
366
+ var len = ch.length;
367
+ var lines = ch.split(/(?:\r\n?|\n)/g);
368
+ this._input = ch + this._input;
369
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
370
+ this.offset -= len;
371
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
372
+ this.match = this.match.substr(0, this.match.length - 1);
373
+ this.matched = this.matched.substr(0, this.matched.length - 1);
374
+ if (lines.length - 1) this.yylineno -= lines.length - 1;
375
+ var r = this.yylloc.range;
376
+ this.yylloc = {
377
+ first_line: this.yylloc.first_line,
378
+ last_line: this.yylineno + 1,
379
+ first_column: this.yylloc.first_column,
380
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
381
+ };
382
+ if (this.options.ranges) this.yylloc.range = [r[0], r[0] + this.yyleng - len];
383
+ this.yyleng = this.yytext.length;
384
+ return this;
385
+ }, "unput"),
386
+ more: /* @__PURE__ */ __name(function() {
387
+ this._more = true;
388
+ return this;
389
+ }, "more"),
390
+ reject: /* @__PURE__ */ __name(function() {
391
+ if (this.options.backtrack_lexer) this._backtrack = true;
392
+ else 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).\n" + this.showPosition(), {
393
+ text: "",
394
+ token: null,
395
+ line: this.yylineno
396
+ });
397
+ return this;
398
+ }, "reject"),
399
+ less: /* @__PURE__ */ __name(function(n) {
400
+ this.unput(this.match.slice(n));
401
+ }, "less"),
402
+ pastInput: /* @__PURE__ */ __name(function() {
403
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
404
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
405
+ }, "pastInput"),
406
+ upcomingInput: /* @__PURE__ */ __name(function() {
407
+ var next = this.match;
408
+ if (next.length < 20) next += this._input.substr(0, 20 - next.length);
409
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
410
+ }, "upcomingInput"),
411
+ showPosition: /* @__PURE__ */ __name(function() {
412
+ var pre = this.pastInput();
413
+ var c = new Array(pre.length + 1).join("-");
414
+ return pre + this.upcomingInput() + "\n" + c + "^";
415
+ }, "showPosition"),
416
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
417
+ var token, lines, backup;
418
+ if (this.options.backtrack_lexer) {
419
+ backup = {
420
+ yylineno: this.yylineno,
421
+ yylloc: {
422
+ first_line: this.yylloc.first_line,
423
+ last_line: this.last_line,
424
+ first_column: this.yylloc.first_column,
425
+ last_column: this.yylloc.last_column
426
+ },
427
+ yytext: this.yytext,
428
+ match: this.match,
429
+ matches: this.matches,
430
+ matched: this.matched,
431
+ yyleng: this.yyleng,
432
+ offset: this.offset,
433
+ _more: this._more,
434
+ _input: this._input,
435
+ yy: this.yy,
436
+ conditionStack: this.conditionStack.slice(0),
437
+ done: this.done
438
+ };
439
+ if (this.options.ranges) backup.yylloc.range = this.yylloc.range.slice(0);
440
+ }
441
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
442
+ if (lines) this.yylineno += lines.length;
443
+ this.yylloc = {
444
+ first_line: this.yylloc.last_line,
445
+ last_line: this.yylineno + 1,
446
+ first_column: this.yylloc.last_column,
447
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
448
+ };
449
+ this.yytext += match[0];
450
+ this.match += match[0];
451
+ this.matches = match;
452
+ this.yyleng = this.yytext.length;
453
+ if (this.options.ranges) this.yylloc.range = [this.offset, this.offset += this.yyleng];
454
+ this._more = false;
455
+ this._backtrack = false;
456
+ this._input = this._input.slice(match[0].length);
457
+ this.matched += match[0];
458
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
459
+ if (this.done && this._input) this.done = false;
460
+ if (token) return token;
461
+ else if (this._backtrack) {
462
+ for (var k in backup) this[k] = backup[k];
463
+ return false;
464
+ }
465
+ return false;
466
+ }, "test_match"),
467
+ next: /* @__PURE__ */ __name(function() {
468
+ if (this.done) return this.EOF;
469
+ if (!this._input) this.done = true;
470
+ var token, match, tempMatch, index;
471
+ if (!this._more) {
472
+ this.yytext = "";
473
+ this.match = "";
474
+ }
475
+ var rules = this._currentRules();
476
+ for (var i = 0; i < rules.length; i++) {
477
+ tempMatch = this._input.match(this.rules[rules[i]]);
478
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
479
+ match = tempMatch;
480
+ index = i;
481
+ if (this.options.backtrack_lexer) {
482
+ token = this.test_match(tempMatch, rules[i]);
483
+ if (token !== false) return token;
484
+ else if (this._backtrack) {
485
+ match = false;
486
+ continue;
487
+ } else return false;
488
+ } else if (!this.options.flex) break;
489
+ }
490
+ }
491
+ if (match) {
492
+ token = this.test_match(match, rules[index]);
493
+ if (token !== false) return token;
494
+ return false;
495
+ }
496
+ if (this._input === "") return this.EOF;
497
+ else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
498
+ text: "",
499
+ token: null,
500
+ line: this.yylineno
501
+ });
502
+ }, "next"),
503
+ lex: /* @__PURE__ */ __name(function lex() {
504
+ var r = this.next();
505
+ if (r) return r;
506
+ else return this.lex();
507
+ }, "lex"),
508
+ begin: /* @__PURE__ */ __name(function begin(condition) {
509
+ this.conditionStack.push(condition);
510
+ }, "begin"),
511
+ popState: /* @__PURE__ */ __name(function popState() {
512
+ if (this.conditionStack.length - 1 > 0) return this.conditionStack.pop();
513
+ else return this.conditionStack[0];
514
+ }, "popState"),
515
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
516
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
517
+ else return this.conditions["INITIAL"].rules;
518
+ }, "_currentRules"),
519
+ topState: /* @__PURE__ */ __name(function topState(n) {
520
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
521
+ if (n >= 0) return this.conditionStack[n];
522
+ else return "INITIAL";
523
+ }, "topState"),
524
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
525
+ this.begin(condition);
526
+ }, "pushState"),
527
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
528
+ return this.conditionStack.length;
529
+ }, "stateStackSize"),
530
+ options: { "case-insensitive": true },
531
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
532
+ switch ($avoiding_name_collisions) {
533
+ case 0: break;
534
+ case 1: break;
535
+ case 2: return 13;
536
+ case 3: break;
537
+ case 4: break;
538
+ case 5: return 8;
539
+ case 6: return 9;
540
+ case 7: return 7;
541
+ case 8: return 14;
542
+ case 9:
543
+ this.begin("acc_title");
544
+ return 15;
545
+ case 10:
546
+ this.popState();
547
+ return "acc_title_value";
548
+ case 11:
549
+ this.begin("acc_descr");
550
+ return 17;
551
+ case 12:
552
+ this.popState();
553
+ return "acc_descr_value";
554
+ case 13:
555
+ this.begin("acc_descr_multiline");
556
+ break;
557
+ case 14:
558
+ this.popState();
559
+ break;
560
+ case 15: return "acc_descr_multiline_value";
561
+ case 16: return 20;
562
+ case 17: return 24;
563
+ case 18: return 23;
564
+ case 19: return 6;
565
+ case 20: return "INVALID";
566
+ }
567
+ }, "anonymous"),
568
+ rules: [
569
+ /^(?:%(?!\{)[^\n]*)/i,
570
+ /^(?:[^\}]%%[^\n]*)/i,
571
+ /^(?:[\n]+)/i,
572
+ /^(?:\s+)/i,
573
+ /^(?:#[^\n]*)/i,
574
+ /^(?:timeline[ \t]+LR\b)/i,
575
+ /^(?:timeline[ \t]+TD\b)/i,
576
+ /^(?:timeline\b)/i,
577
+ /^(?:title\s[^\n]+)/i,
578
+ /^(?:accTitle\s*:\s*)/i,
579
+ /^(?:(?!\n||)*[^\n]*)/i,
580
+ /^(?:accDescr\s*:\s*)/i,
581
+ /^(?:(?!\n||)*[^\n]*)/i,
582
+ /^(?:accDescr\s*\{\s*)/i,
583
+ /^(?:[\}])/i,
584
+ /^(?:[^\}]*)/i,
585
+ /^(?:section\s[^:\n]+)/i,
586
+ /^(?::\s(?:[^:\n]|:(?!\s))+)/i,
587
+ /^(?:[^#:\n]+)/i,
588
+ /^(?:$)/i,
589
+ /^(?:.)/i
590
+ ],
591
+ conditions: {
592
+ "acc_descr_multiline": {
593
+ "rules": [14, 15],
594
+ "inclusive": false
595
+ },
596
+ "acc_descr": {
597
+ "rules": [12],
598
+ "inclusive": false
599
+ },
600
+ "acc_title": {
601
+ "rules": [10],
602
+ "inclusive": false
603
+ },
604
+ "INITIAL": {
605
+ "rules": [
606
+ 0,
607
+ 1,
608
+ 2,
609
+ 3,
610
+ 4,
611
+ 5,
612
+ 6,
613
+ 7,
614
+ 8,
615
+ 9,
616
+ 11,
617
+ 13,
618
+ 16,
619
+ 17,
620
+ 18,
621
+ 19,
622
+ 20
623
+ ],
624
+ "inclusive": true
625
+ }
626
+ }
627
+ };
628
+ })();
629
+ function Parser() {
630
+ this.yy = {};
631
+ }
632
+ __name(Parser, "Parser");
633
+ Parser.prototype = parser2;
634
+ parser2.Parser = Parser;
635
+ return new Parser();
636
+ })();
637
+ parser.parser = parser;
638
+ var timeline_default = parser;
639
+ var timelineDb_exports = {};
640
+ __export(timelineDb_exports, {
641
+ addEvent: () => addEvent,
642
+ addSection: () => addSection,
643
+ addTask: () => addTask,
644
+ addTaskOrg: () => addTaskOrg,
645
+ clear: () => clear2,
646
+ default: () => timelineDb_default,
647
+ getCommonDb: () => getCommonDb,
648
+ getDirection: () => getDirection,
649
+ getSections: () => getSections,
650
+ getTasks: () => getTasks,
651
+ setDirection: () => setDirection
652
+ });
653
+ var currentSection = "";
654
+ var currentTaskId = 0;
655
+ var direction = "LR";
656
+ var sections = [];
657
+ var tasks = [];
658
+ var rawTasks = [];
659
+ var getCommonDb = /* @__PURE__ */ __name(() => commonDb_exports, "getCommonDb");
660
+ var clear2 = /* @__PURE__ */ __name(function() {
661
+ sections.length = 0;
662
+ tasks.length = 0;
663
+ currentSection = "";
664
+ rawTasks.length = 0;
665
+ direction = "LR";
666
+ clear();
667
+ }, "clear");
668
+ var setDirection = /* @__PURE__ */ __name(function(dir) {
669
+ direction = dir;
670
+ }, "setDirection");
671
+ var getDirection = /* @__PURE__ */ __name(function() {
672
+ return direction;
673
+ }, "getDirection");
674
+ var addSection = /* @__PURE__ */ __name(function(txt) {
675
+ currentSection = txt;
676
+ sections.push(txt);
677
+ }, "addSection");
678
+ var getSections = /* @__PURE__ */ __name(function() {
679
+ return sections;
680
+ }, "getSections");
681
+ var getTasks = /* @__PURE__ */ __name(function() {
682
+ let allItemsProcessed = compileTasks();
683
+ const maxDepth = 100;
684
+ let iterationCount = 0;
685
+ while (!allItemsProcessed && iterationCount < maxDepth) {
686
+ allItemsProcessed = compileTasks();
687
+ iterationCount++;
688
+ }
689
+ tasks.push(...rawTasks);
690
+ return tasks;
691
+ }, "getTasks");
692
+ var addTask = /* @__PURE__ */ __name(function(period, length, event) {
693
+ const rawTask = {
694
+ id: currentTaskId++,
695
+ section: currentSection,
696
+ type: currentSection,
697
+ task: period,
698
+ score: length ? length : 0,
699
+ events: event ? [event] : []
700
+ };
701
+ rawTasks.push(rawTask);
702
+ }, "addTask");
703
+ var addEvent = /* @__PURE__ */ __name(function(event) {
704
+ rawTasks.find((task) => task.id === currentTaskId - 1).events.push(event);
705
+ }, "addEvent");
706
+ var addTaskOrg = /* @__PURE__ */ __name(function(descr) {
707
+ const newTask = {
708
+ section: currentSection,
709
+ type: currentSection,
710
+ description: descr,
711
+ task: descr,
712
+ classes: []
713
+ };
714
+ tasks.push(newTask);
715
+ }, "addTaskOrg");
716
+ var compileTasks = /* @__PURE__ */ __name(function() {
717
+ const compileTask = /* @__PURE__ */ __name(function(pos) {
718
+ return rawTasks[pos].processed;
719
+ }, "compileTask");
720
+ let allProcessed = true;
721
+ for (const [i, rawTask] of rawTasks.entries()) {
722
+ compileTask(i);
723
+ allProcessed = allProcessed && rawTask.processed;
724
+ }
725
+ return allProcessed;
726
+ }, "compileTasks");
727
+ var timelineDb_default = {
728
+ clear: clear2,
729
+ getCommonDb,
730
+ getDirection,
731
+ setDirection,
732
+ addSection,
733
+ getSections,
734
+ getTasks,
735
+ addTask,
736
+ addTaskOrg,
737
+ addEvent
738
+ };
739
+ var nodeCount = 0;
740
+ var drawRect = /* @__PURE__ */ __name(function(elem, rectData) {
741
+ const rectElem = elem.append("rect");
742
+ rectElem.attr("x", rectData.x);
743
+ rectElem.attr("y", rectData.y);
744
+ rectElem.attr("fill", rectData.fill);
745
+ rectElem.attr("stroke", rectData.stroke);
746
+ rectElem.attr("width", rectData.width);
747
+ rectElem.attr("height", rectData.height);
748
+ rectElem.attr("rx", rectData.rx);
749
+ rectElem.attr("ry", rectData.ry);
750
+ if (rectData.class !== void 0) rectElem.attr("class", rectData.class);
751
+ return rectElem;
752
+ }, "drawRect");
753
+ var drawFace = /* @__PURE__ */ __name(function(element, faceData) {
754
+ const radius = 15;
755
+ const circleElement = element.append("circle").attr("cx", faceData.cx).attr("cy", faceData.cy).attr("class", "face").attr("r", radius).attr("stroke-width", 2).attr("overflow", "visible");
756
+ const face = element.append("g");
757
+ face.append("circle").attr("cx", faceData.cx - radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
758
+ face.append("circle").attr("cx", faceData.cx + radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
759
+ function smile(face2) {
760
+ const arc = arc_default().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
761
+ face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 2) + ")");
762
+ }
763
+ __name(smile, "smile");
764
+ function sad(face2) {
765
+ const arc = arc_default().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
766
+ face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 7) + ")");
767
+ }
768
+ __name(sad, "sad");
769
+ function ambivalent(face2) {
770
+ face2.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", faceData.cx - 5).attr("y1", faceData.cy + 7).attr("x2", faceData.cx + 5).attr("y2", faceData.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
771
+ }
772
+ __name(ambivalent, "ambivalent");
773
+ if (faceData.score > 3) smile(face);
774
+ else if (faceData.score < 3) sad(face);
775
+ else ambivalent(face);
776
+ return circleElement;
777
+ }, "drawFace");
778
+ var drawCircle = /* @__PURE__ */ __name(function(element, circleData) {
779
+ const circleElement = element.append("circle");
780
+ circleElement.attr("cx", circleData.cx);
781
+ circleElement.attr("cy", circleData.cy);
782
+ circleElement.attr("class", "actor-" + circleData.pos);
783
+ circleElement.attr("fill", circleData.fill);
784
+ circleElement.attr("stroke", circleData.stroke);
785
+ circleElement.attr("r", circleData.r);
786
+ if (circleElement.class !== void 0) circleElement.attr("class", circleElement.class);
787
+ if (circleData.title !== void 0) circleElement.append("title").text(circleData.title);
788
+ return circleElement;
789
+ }, "drawCircle");
790
+ var drawText = /* @__PURE__ */ __name(function(elem, textData) {
791
+ const nText = textData.text.replace(/<br\s*\/?>/gi, " ");
792
+ const textElem = elem.append("text");
793
+ textElem.attr("x", textData.x);
794
+ textElem.attr("y", textData.y);
795
+ textElem.attr("class", "legend");
796
+ textElem.style("text-anchor", textData.anchor);
797
+ if (textData.class !== void 0) textElem.attr("class", textData.class);
798
+ const span = textElem.append("tspan");
799
+ span.attr("x", textData.x + textData.textMargin * 2);
800
+ span.text(nText);
801
+ return textElem;
802
+ }, "drawText");
803
+ var drawLabel = /* @__PURE__ */ __name(function(elem, txtObject) {
804
+ function genPoints(x, y, width, height, cut) {
805
+ return x + "," + y + " " + (x + width) + "," + y + " " + (x + width) + "," + (y + height - cut) + " " + (x + width - cut * 1.2) + "," + (y + height) + " " + x + "," + (y + height);
806
+ }
807
+ __name(genPoints, "genPoints");
808
+ const polygon = elem.append("polygon");
809
+ polygon.attr("points", genPoints(txtObject.x, txtObject.y, 50, 20, 7));
810
+ polygon.attr("class", "labelBox");
811
+ txtObject.y = txtObject.y + txtObject.labelMargin;
812
+ txtObject.x = txtObject.x + .5 * txtObject.labelMargin;
813
+ drawText(elem, txtObject);
814
+ }, "drawLabel");
815
+ var drawSection = /* @__PURE__ */ __name(function(elem, section, conf) {
816
+ const g = elem.append("g");
817
+ const rect = getNoteRect();
818
+ rect.x = section.x;
819
+ rect.y = section.y;
820
+ rect.fill = section.fill;
821
+ rect.width = conf.width;
822
+ rect.height = conf.height;
823
+ rect.class = "journey-section section-type-" + section.num;
824
+ rect.rx = 3;
825
+ rect.ry = 3;
826
+ drawRect(g, rect);
827
+ _drawTextCandidateFunc(conf)(section.text, g, rect.x, rect.y, rect.width, rect.height, { class: "journey-section section-type-" + section.num }, conf, section.colour);
828
+ }, "drawSection");
829
+ var taskCount = -1;
830
+ var drawTask = /* @__PURE__ */ __name(function(elem, task, conf, diagramId) {
831
+ const center = task.x + conf.width / 2;
832
+ const g = elem.append("g");
833
+ taskCount++;
834
+ g.append("line").attr("id", diagramId + "-task" + taskCount).attr("x1", center).attr("y1", task.y).attr("x2", center).attr("y2", 450).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666");
835
+ drawFace(g, {
836
+ cx: center,
837
+ cy: 300 + (5 - task.score) * 30,
838
+ score: task.score
839
+ });
840
+ const rect = getNoteRect();
841
+ rect.x = task.x;
842
+ rect.y = task.y;
843
+ rect.fill = task.fill;
844
+ rect.width = conf.width;
845
+ rect.height = conf.height;
846
+ rect.class = "task task-type-" + task.num;
847
+ rect.rx = 3;
848
+ rect.ry = 3;
849
+ drawRect(g, rect);
850
+ _drawTextCandidateFunc(conf)(task.task, g, rect.x, rect.y, rect.width, rect.height, { class: "task" }, conf, task.colour);
851
+ }, "drawTask");
852
+ var drawBackgroundRect = /* @__PURE__ */ __name(function(elem, bounds) {
853
+ drawRect(elem, {
854
+ x: bounds.startx,
855
+ y: bounds.starty,
856
+ width: bounds.stopx - bounds.startx,
857
+ height: bounds.stopy - bounds.starty,
858
+ fill: bounds.fill,
859
+ class: "rect"
860
+ }).lower();
861
+ }, "drawBackgroundRect");
862
+ var getTextObj = /* @__PURE__ */ __name(function() {
863
+ return {
864
+ x: 0,
865
+ y: 0,
866
+ fill: void 0,
867
+ "text-anchor": "start",
868
+ width: 100,
869
+ height: 100,
870
+ textMargin: 0,
871
+ rx: 0,
872
+ ry: 0
873
+ };
874
+ }, "getTextObj");
875
+ var getNoteRect = /* @__PURE__ */ __name(function() {
876
+ return {
877
+ x: 0,
878
+ y: 0,
879
+ width: 100,
880
+ anchor: "start",
881
+ height: 100,
882
+ rx: 0,
883
+ ry: 0
884
+ };
885
+ }, "getNoteRect");
886
+ var _drawTextCandidateFunc = /* @__PURE__ */ (function() {
887
+ function byText(content, g, x, y, width, height, textAttrs, colour) {
888
+ _setTextAttrs(g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content), textAttrs);
889
+ }
890
+ __name(byText, "byText");
891
+ function byTspan(content, g, x, y, width, height, textAttrs, conf, colour) {
892
+ const { taskFontSize, taskFontFamily } = conf;
893
+ const lines = content.split(/<br\s*\/?>/gi);
894
+ for (let i = 0; i < lines.length; i++) {
895
+ const dy = i * taskFontSize - taskFontSize * (lines.length - 1) / 2;
896
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily);
897
+ text.append("tspan").attr("x", x + width / 2).attr("dy", dy).text(lines[i]);
898
+ text.attr("y", y + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
899
+ _setTextAttrs(text, textAttrs);
900
+ }
901
+ }
902
+ __name(byTspan, "byTspan");
903
+ function byFo(content, g, x, y, width, height, textAttrs, conf) {
904
+ const body = g.append("switch");
905
+ const text = body.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
906
+ text.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
907
+ byTspan(content, body, x, y, width, height, textAttrs, conf);
908
+ _setTextAttrs(text, textAttrs);
909
+ }
910
+ __name(byFo, "byFo");
911
+ function _setTextAttrs(toText, fromTextAttrsDict) {
912
+ for (const key in fromTextAttrsDict) if (key in fromTextAttrsDict) toText.attr(key, fromTextAttrsDict[key]);
913
+ }
914
+ __name(_setTextAttrs, "_setTextAttrs");
915
+ return function(conf) {
916
+ return conf.textPlacement === "fo" ? byFo : conf.textPlacement === "old" ? byText : byTspan;
917
+ };
918
+ })();
919
+ var initGraphics = /* @__PURE__ */ __name(function(graphics, id) {
920
+ nodeCount = 0;
921
+ taskCount = -1;
922
+ graphics.append("defs").append("marker").attr("id", id + "-arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");
923
+ }, "initGraphics");
924
+ function wrap(text, width) {
925
+ text.each(function() {
926
+ var text2 = select_default(this), words = text2.text().split(/(\s+|<br>)/).reverse(), word, line = [], lineHeight = 1.1, y = text2.attr("y"), dy = parseFloat(text2.attr("dy")), tspan = text2.text(null).append("tspan").attr("x", 0).attr("y", y).attr("dy", dy + "em");
927
+ for (let j = 0; j < words.length; j++) {
928
+ word = words[words.length - 1 - j];
929
+ line.push(word);
930
+ tspan.text(line.join(" ").trim());
931
+ if (tspan.node().getComputedTextLength() > width || word === "<br>") {
932
+ line.pop();
933
+ tspan.text(line.join(" ").trim());
934
+ if (word === "<br>") line = [""];
935
+ else line = [word];
936
+ tspan = text2.append("tspan").attr("x", 0).attr("y", y).attr("dy", lineHeight + "em").text(word);
937
+ }
938
+ }
939
+ });
940
+ }
941
+ __name(wrap, "wrap");
942
+ var drawNode = /* @__PURE__ */ __name(function(elem, node, fullSection, conf, diagramId, isEvent = false) {
943
+ const { theme, look } = conf;
944
+ const isReduxTheme = theme?.includes("redux");
945
+ const section = fullSection % (conf?.themeVariables?.THEME_COLOR_LIMIT ?? 12) - 1;
946
+ const nodeElem = elem.append("g");
947
+ node.section = section;
948
+ nodeElem.attr("class", (node.class ? node.class + " " : "") + "timeline-node " + ("section-" + section));
949
+ const bkgElem = nodeElem.append("g");
950
+ const textElem = nodeElem.append("g");
951
+ const bbox = textElem.append("text").text(node.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, node.width).node().getBBox();
952
+ const fontSize = conf.fontSize?.replace ? conf.fontSize.replace("px", "") : conf.fontSize;
953
+ node.height = bbox.height + fontSize * 1.1 * .5 + node.padding;
954
+ node.height = Math.max(node.height, node.maxHeight);
955
+ node.width = node.width + 2 * node.padding;
956
+ textElem.attr("transform", "translate(" + node.width / 2 + ", " + node.padding / 2 + ")");
957
+ if (isReduxTheme) textElem.attr("transform", `translate(${node.width / 2}, ${isEvent ? node.padding / 2 + 3 : node.padding})`);
958
+ defaultBkg(bkgElem, node, section, diagramId, conf);
959
+ if (look === "neo") {
960
+ nodeElem.attr("data-look", `neo`);
961
+ if (isReduxTheme) {
962
+ const isDark2 = theme.includes("dark");
963
+ const rootSvg = select_default(elem.node()?.ownerSVGElement ?? elem.node());
964
+ const svgId = rootSvg.attr("id") ?? "";
965
+ const dropShadowId = svgId ? `${svgId}-drop-shadow` : "drop-shadow";
966
+ if (rootSvg.select(`#${dropShadowId}`).empty()) {
967
+ const existingDefs = rootSvg.select("defs");
968
+ (existingDefs.empty() ? rootSvg.append("defs") : existingDefs).append("filter").attr("id", dropShadowId).attr("height", "130%").attr("width", "130%").append("feDropShadow").attr("dx", "4").attr("dy", "4").attr("stdDeviation", 0).attr("flood-opacity", isDark2 ? "0.2" : "0.06").attr("flood-color", isDark2 ? "#FFFFFF" : "#000000");
969
+ }
970
+ }
971
+ }
972
+ return node;
973
+ }, "drawNode");
974
+ var getVirtualNodeHeight = /* @__PURE__ */ __name(function(elem, node, conf) {
975
+ const textElem = elem.append("g");
976
+ const bbox = textElem.append("text").text(node.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, node.width).node().getBBox();
977
+ const fontSize = conf.fontSize?.replace ? conf.fontSize.replace("px", "") : conf.fontSize;
978
+ textElem.remove();
979
+ return bbox.height + fontSize * 1.1 * .5 + node.padding;
980
+ }, "getVirtualNodeHeight");
981
+ var defaultBkg = /* @__PURE__ */ __name(function(elem, node, section, diagramId, config) {
982
+ const { theme } = config;
983
+ const r = theme?.includes("redux") ? 0 : 5;
984
+ const rd = 5;
985
+ const d = r > 0 ? `M0 ${node.height - rd} v${-node.height + 2 * rd} q0,-${r},${r},-${r} h${node.width - 2 * rd} q${r},0,${r},${r} v${node.height - rd} H0 Z` : `M0 ${node.height - rd} v${-(node.height - rd)} h${node.width} v${node.height} H0 Z`;
986
+ elem.append("path").attr("id", diagramId + "-node-" + nodeCount++).attr("class", "node-bkg node-" + node.type).attr("d", d);
987
+ if (!theme?.includes("redux")) elem.append("line").attr("class", "node-line-" + section).attr("x1", 0).attr("y1", node.height).attr("x2", node.width).attr("y2", node.height);
988
+ }, "defaultBkg");
989
+ var svgDraw_default = {
990
+ drawRect,
991
+ drawCircle,
992
+ drawSection,
993
+ drawText,
994
+ drawLabel,
995
+ drawTask,
996
+ drawBackgroundRect,
997
+ getTextObj,
998
+ getNoteRect,
999
+ initGraphics,
1000
+ drawNode,
1001
+ getVirtualNodeHeight
1002
+ };
1003
+ var draw = /* @__PURE__ */ __name(function(text, id, version, diagObj) {
1004
+ const conf = getConfig2();
1005
+ const { look, theme, themeVariables } = conf;
1006
+ const { useGradient, gradientStart, gradientStop } = themeVariables;
1007
+ const LEFT_MARGIN = conf.timeline?.leftMargin ?? 50;
1008
+ log.debug("timeline", diagObj.db);
1009
+ const securityLevel = conf.securityLevel;
1010
+ let sandboxElement;
1011
+ if (securityLevel === "sandbox") sandboxElement = select_default("#i" + id);
1012
+ const svg = (securityLevel === "sandbox" ? select_default(sandboxElement.nodes()[0].contentDocument.body) : select_default("body")).select("#" + id);
1013
+ svg.append("g");
1014
+ const tasks2 = diagObj.db.getTasks();
1015
+ const title = diagObj.db.getCommonDb().getDiagramTitle();
1016
+ log.debug("task", tasks2);
1017
+ svgDraw_default.initGraphics(svg, id);
1018
+ const sections2 = diagObj.db.getSections();
1019
+ log.debug("sections", sections2);
1020
+ let maxSectionHeight = 0;
1021
+ let maxTaskHeight = 0;
1022
+ let depthY = 0;
1023
+ let sectionBeginY = 0;
1024
+ let masterX = 50 + LEFT_MARGIN;
1025
+ let masterY = 50;
1026
+ sectionBeginY = 50;
1027
+ let sectionNumber = 0;
1028
+ let hasSections = true;
1029
+ sections2.forEach(function(section) {
1030
+ const sectionNode = {
1031
+ number: sectionNumber,
1032
+ descr: section,
1033
+ section: sectionNumber,
1034
+ width: 150,
1035
+ padding: 20,
1036
+ maxHeight: maxSectionHeight
1037
+ };
1038
+ const sectionHeight = svgDraw_default.getVirtualNodeHeight(svg, sectionNode, conf);
1039
+ log.debug("sectionHeight before draw", sectionHeight);
1040
+ maxSectionHeight = Math.max(maxSectionHeight, sectionHeight + 20);
1041
+ });
1042
+ let maxEventCount = 0;
1043
+ let maxEventLineLength = 0;
1044
+ log.debug("tasks.length", tasks2.length);
1045
+ for (const [i, task] of tasks2.entries()) {
1046
+ const taskNode = {
1047
+ number: i,
1048
+ descr: task,
1049
+ section: task.section,
1050
+ width: 150,
1051
+ padding: 20,
1052
+ maxHeight: maxTaskHeight
1053
+ };
1054
+ const taskHeight = svgDraw_default.getVirtualNodeHeight(svg, taskNode, conf);
1055
+ log.debug("taskHeight before draw", taskHeight);
1056
+ maxTaskHeight = Math.max(maxTaskHeight, taskHeight + 20);
1057
+ maxEventCount = Math.max(maxEventCount, task.events.length);
1058
+ let maxEventLineLengthTemp = 0;
1059
+ for (const event of task.events) {
1060
+ const eventNode = {
1061
+ descr: event,
1062
+ section: task.section,
1063
+ number: task.section,
1064
+ width: 150,
1065
+ padding: 20,
1066
+ maxHeight: 50
1067
+ };
1068
+ maxEventLineLengthTemp += svgDraw_default.getVirtualNodeHeight(svg, eventNode, conf);
1069
+ }
1070
+ if (task.events.length > 0) maxEventLineLengthTemp += (task.events.length - 1) * 10;
1071
+ maxEventLineLength = Math.max(maxEventLineLength, maxEventLineLengthTemp);
1072
+ }
1073
+ log.debug("maxSectionHeight before draw", maxSectionHeight);
1074
+ log.debug("maxTaskHeight before draw", maxTaskHeight);
1075
+ if (sections2 && sections2.length > 0) sections2.forEach((section) => {
1076
+ const tasksForSection = tasks2.filter((task) => task.section === section);
1077
+ const sectionNode = {
1078
+ number: sectionNumber,
1079
+ descr: section,
1080
+ section: sectionNumber,
1081
+ width: 200 * Math.max(tasksForSection.length, 1) - 50,
1082
+ padding: 20,
1083
+ maxHeight: maxSectionHeight
1084
+ };
1085
+ log.debug("sectionNode", sectionNode);
1086
+ const sectionNodeWrapper = svg.append("g");
1087
+ const node = svgDraw_default.drawNode(sectionNodeWrapper, sectionNode, sectionNumber, conf, id);
1088
+ log.debug("sectionNode output", node);
1089
+ sectionNodeWrapper.attr("transform", `translate(${masterX}, ${sectionBeginY})`);
1090
+ masterY += maxSectionHeight + 50;
1091
+ if (tasksForSection.length > 0) drawTasks(svg, tasksForSection, sectionNumber, masterX, masterY, maxTaskHeight, conf, maxEventCount, maxEventLineLength, maxSectionHeight, false, id);
1092
+ masterX += 200 * Math.max(tasksForSection.length, 1);
1093
+ masterY = sectionBeginY;
1094
+ sectionNumber++;
1095
+ });
1096
+ else {
1097
+ hasSections = false;
1098
+ drawTasks(svg, tasks2, sectionNumber, masterX, masterY, maxTaskHeight, conf, maxEventCount, maxEventLineLength, maxSectionHeight, true, id);
1099
+ }
1100
+ const box = svg.node().getBBox();
1101
+ log.debug("bounds", box);
1102
+ if (title) svg.append("text").text(title).attr("x", look === "neo" ? box.x * 2 + LEFT_MARGIN : box.width / 2 - LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20);
1103
+ depthY = hasSections ? maxSectionHeight + maxTaskHeight + 150 : maxTaskHeight + 100;
1104
+ svg.append("g").attr("class", "lineWrapper").append("line").attr("x1", LEFT_MARGIN).attr("y1", depthY).attr("x2", box.width + 3 * LEFT_MARGIN).attr("y2", depthY).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", `url(#${id}-arrowhead)`);
1105
+ if (look === "neo" && useGradient && theme !== "neutral") {
1106
+ const existingDefs = svg.select("defs");
1107
+ const gradient = (existingDefs.empty() ? svg.append("defs") : existingDefs).append("linearGradient").attr("id", svg.attr("id") + "-gradient").attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
1108
+ gradient.append("stop").attr("offset", "0%").attr("stop-color", gradientStart).attr("stop-opacity", 1);
1109
+ gradient.append("stop").attr("offset", "100%").attr("stop-color", gradientStop).attr("stop-opacity", 1);
1110
+ }
1111
+ setupGraphViewbox(void 0, svg, conf.timeline?.padding ?? 50, conf.timeline?.useMaxWidth ?? false);
1112
+ }, "draw");
1113
+ var drawTasks = /* @__PURE__ */ __name(function(diagram2, tasks2, sectionColor, masterX, masterY, maxTaskHeight, conf, maxEventCount, maxEventLineLength, maxSectionHeight, isWithoutSections, diagramId) {
1114
+ for (const task of tasks2) {
1115
+ const taskNode = {
1116
+ descr: task.task,
1117
+ section: sectionColor,
1118
+ number: sectionColor,
1119
+ width: 150,
1120
+ padding: 20,
1121
+ maxHeight: maxTaskHeight
1122
+ };
1123
+ log.debug("taskNode", taskNode);
1124
+ const taskWrapper = diagram2.append("g").attr("class", "taskWrapper");
1125
+ const taskHeight = svgDraw_default.drawNode(taskWrapper, taskNode, sectionColor, conf, diagramId).height;
1126
+ log.debug("taskHeight after draw", taskHeight);
1127
+ taskWrapper.attr("transform", `translate(${masterX}, ${masterY})`);
1128
+ maxTaskHeight = Math.max(maxTaskHeight, taskHeight);
1129
+ if (task.events) {
1130
+ const lineWrapper = diagram2.append("g").attr("class", "lineWrapper");
1131
+ let lineLength = maxTaskHeight;
1132
+ masterY += 100;
1133
+ lineLength = lineLength + drawEvents(diagram2, task.events, sectionColor, masterX, masterY, conf, diagramId);
1134
+ masterY -= 100;
1135
+ lineWrapper.append("line").attr("x1", masterX + 190 / 2).attr("y1", masterY + maxTaskHeight).attr("x2", masterX + 190 / 2).attr("y2", masterY + maxTaskHeight + 100 + maxEventLineLength + 100).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", `url(#${diagramId}-arrowhead)`).attr("stroke-dasharray", "5,5");
1136
+ }
1137
+ masterX = masterX + 200;
1138
+ if (isWithoutSections && !conf.timeline?.disableMulticolor) sectionColor++;
1139
+ }
1140
+ masterY = masterY - 10;
1141
+ }, "drawTasks");
1142
+ var drawEvents = /* @__PURE__ */ __name(function(diagram2, events, sectionColor, masterX, masterY, conf, diagramId) {
1143
+ let maxEventHeight = 0;
1144
+ const eventBeginY = masterY;
1145
+ masterY = masterY + 100;
1146
+ for (const event of events) {
1147
+ const eventNode = {
1148
+ descr: event,
1149
+ section: sectionColor,
1150
+ number: sectionColor,
1151
+ width: 150,
1152
+ padding: 20,
1153
+ maxHeight: 50
1154
+ };
1155
+ log.debug("eventNode", eventNode);
1156
+ const eventWrapper = diagram2.append("g").attr("class", "eventWrapper");
1157
+ const eventHeight = svgDraw_default.drawNode(eventWrapper, eventNode, sectionColor, conf, diagramId, true).height;
1158
+ maxEventHeight = maxEventHeight + eventHeight;
1159
+ eventWrapper.attr("transform", `translate(${masterX}, ${masterY})`);
1160
+ masterY = masterY + 10 + eventHeight;
1161
+ }
1162
+ masterY = eventBeginY;
1163
+ return maxEventHeight;
1164
+ }, "drawEvents");
1165
+ var timelineRenderer_default = {
1166
+ setConf: /* @__PURE__ */ __name(() => {}, "setConf"),
1167
+ draw
1168
+ };
1169
+ var NODE_WIDTH = 200;
1170
+ var NODE_PADDING = 5;
1171
+ var NODE_TOTAL_WIDTH = NODE_WIDTH + NODE_PADDING * 2;
1172
+ var EVENT_WIDTH = NODE_WIDTH + 100;
1173
+ var EVENT_TOTAL_WIDTH = EVENT_WIDTH + NODE_PADDING * 2;
1174
+ var EVENT_SPACING = 10;
1175
+ var EVENT_VERTICAL_GAP = 0;
1176
+ var SECTION_TASK_GAP = 20;
1177
+ var TASK_AXIS_GAP = 20;
1178
+ var TASK_VERTICAL_GAP = 30;
1179
+ var EVENT_AXIS_GAP = 50;
1180
+ var draw2 = /* @__PURE__ */ __name(function(text, id, version, diagObj) {
1181
+ const conf = getConfig2();
1182
+ const LEFT_MARGIN = conf.timeline?.leftMargin ?? 50;
1183
+ log.debug("timeline", diagObj.db);
1184
+ const svg = selectSvgElement(id);
1185
+ svg.append("g");
1186
+ const tasks2 = diagObj.db.getTasks();
1187
+ const title = diagObj.db.getCommonDb().getDiagramTitle();
1188
+ log.debug("task", tasks2);
1189
+ svgDraw_default.initGraphics(svg);
1190
+ const sections2 = diagObj.db.getSections();
1191
+ log.debug("sections", sections2);
1192
+ let maxSectionHeight = 0;
1193
+ let maxTaskHeight = 0;
1194
+ const masterX = 50 + LEFT_MARGIN;
1195
+ let masterY = 50;
1196
+ const contentTopY = masterY;
1197
+ const sectionBeginX = masterX;
1198
+ const leftWidth = NODE_TOTAL_WIDTH + TASK_AXIS_GAP;
1199
+ const rightWidth = EVENT_TOTAL_WIDTH + EVENT_AXIS_GAP;
1200
+ const axisX = sectionBeginX + leftWidth;
1201
+ let sectionNumber = 0;
1202
+ const hasSections = sections2 && sections2.length > 0;
1203
+ const timelineX = hasSections ? axisX : masterX + leftWidth;
1204
+ const sectionWidth = Math.max(50, leftWidth + rightWidth - NODE_PADDING * 2);
1205
+ sections2.forEach(function(section) {
1206
+ const sectionNode = {
1207
+ number: sectionNumber,
1208
+ descr: section,
1209
+ section: sectionNumber,
1210
+ width: sectionWidth,
1211
+ padding: NODE_PADDING,
1212
+ maxHeight: maxSectionHeight
1213
+ };
1214
+ const sectionHeight = svgDraw_default.getVirtualNodeHeight(svg, sectionNode, conf);
1215
+ log.debug("sectionHeight before draw", sectionHeight);
1216
+ maxSectionHeight = Math.max(maxSectionHeight, sectionHeight);
1217
+ });
1218
+ let maxEventStackHeight = 0;
1219
+ log.debug("tasks.length", tasks2.length);
1220
+ for (const [i, task] of tasks2.entries()) {
1221
+ const taskNode = {
1222
+ number: i,
1223
+ descr: task,
1224
+ section: task.section,
1225
+ width: NODE_WIDTH,
1226
+ padding: NODE_PADDING,
1227
+ maxHeight: maxTaskHeight
1228
+ };
1229
+ const taskHeight = svgDraw_default.getVirtualNodeHeight(svg, taskNode, conf);
1230
+ log.debug("taskHeight before draw", taskHeight);
1231
+ maxTaskHeight = Math.max(maxTaskHeight, taskHeight);
1232
+ let maxEventStackHeightTemp = 0;
1233
+ for (const event of task.events) {
1234
+ const eventNode = {
1235
+ descr: event,
1236
+ section: task.section,
1237
+ number: task.section,
1238
+ width: EVENT_WIDTH,
1239
+ padding: NODE_PADDING,
1240
+ maxHeight: 50
1241
+ };
1242
+ maxEventStackHeightTemp += svgDraw_default.getVirtualNodeHeight(svg, eventNode, conf);
1243
+ }
1244
+ if (task.events.length > 0) maxEventStackHeightTemp += (task.events.length - 1) * EVENT_SPACING;
1245
+ maxEventStackHeight = Math.max(maxEventStackHeight, maxEventStackHeightTemp) + EVENT_VERTICAL_GAP;
1246
+ }
1247
+ log.debug("maxSectionHeight before draw", maxSectionHeight);
1248
+ log.debug("maxTaskHeight before draw", maxTaskHeight);
1249
+ const taskSpacing = Math.max(maxTaskHeight, maxEventStackHeight) + TASK_VERTICAL_GAP;
1250
+ if (hasSections) sections2.forEach((section) => {
1251
+ const tasksForSection = tasks2.filter((task) => task.section === section);
1252
+ const sectionNode = {
1253
+ number: sectionNumber,
1254
+ descr: section,
1255
+ section: sectionNumber,
1256
+ width: sectionWidth,
1257
+ padding: NODE_PADDING,
1258
+ maxHeight: maxSectionHeight
1259
+ };
1260
+ log.debug("sectionNode", sectionNode);
1261
+ const sectionNodeWrapper = svg.append("g");
1262
+ const node = svgDraw_default.drawNode(sectionNodeWrapper, sectionNode, sectionNumber, conf);
1263
+ log.debug("sectionNode output", node);
1264
+ const sectionX = timelineX - leftWidth;
1265
+ sectionNodeWrapper.attr("transform", `translate(${sectionX}, ${masterY})`);
1266
+ const taskStartY = masterY + node.height + SECTION_TASK_GAP;
1267
+ if (tasksForSection.length > 0) drawTasks2(svg, tasksForSection, sectionNumber, timelineX, taskStartY, maxTaskHeight, conf, taskSpacing, false);
1268
+ const taskCount2 = tasksForSection.length;
1269
+ const sectionHeight = node.height + SECTION_TASK_GAP + taskSpacing * Math.max(taskCount2, 1) - (taskCount2 > 0 ? TASK_VERTICAL_GAP * 2 : 0);
1270
+ masterY += sectionHeight;
1271
+ sectionNumber++;
1272
+ });
1273
+ else drawTasks2(svg, tasks2, sectionNumber, timelineX, masterY, maxTaskHeight, conf, taskSpacing, true);
1274
+ let box = svg.node()?.getBBox();
1275
+ if (!box) throw new Error("bbox not found");
1276
+ log.debug("bounds", box);
1277
+ if (title) {
1278
+ svg.append("text").text(title).attr("x", box.width / 2 - LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20);
1279
+ box = svg.node()?.getBBox();
1280
+ if (!box) throw new Error("bbox not found");
1281
+ log.debug("bounds after title", box);
1282
+ }
1283
+ const [fontSize] = parseFontSize(conf.fontSize);
1284
+ const arrowTopOffset = (fontSize ?? 16) * 2;
1285
+ const arrowBottomPadding = (fontSize ?? 16) * .5 + 20;
1286
+ const lineWrapper = svg.append("g").attr("class", "lineWrapper");
1287
+ lineWrapper.append("line").attr("x1", timelineX).attr("y1", contentTopY - arrowTopOffset).attr("x2", timelineX).attr("y2", box.y + box.height + arrowBottomPadding).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)");
1288
+ lineWrapper.lower();
1289
+ setupGraphViewbox(void 0, svg, conf.timeline?.padding ?? 50, conf.timeline?.useMaxWidth ?? false);
1290
+ }, "draw");
1291
+ var drawTasks2 = /* @__PURE__ */ __name(function(diagram2, tasks2, sectionColor, timelineX, masterY, maxTaskHeight, conf, taskSpacing, isWithoutSections) {
1292
+ for (const task of tasks2) {
1293
+ const taskNode = {
1294
+ descr: task.task,
1295
+ section: sectionColor,
1296
+ number: sectionColor,
1297
+ width: NODE_WIDTH,
1298
+ padding: NODE_PADDING,
1299
+ maxHeight: maxTaskHeight
1300
+ };
1301
+ log.debug("taskNode", taskNode);
1302
+ const taskWrapper = diagram2.append("g").attr("class", "taskWrapper");
1303
+ const node = svgDraw_default.drawNode(taskWrapper, taskNode, sectionColor, conf);
1304
+ const taskHeight = node.height;
1305
+ log.debug("taskHeight after draw", taskHeight);
1306
+ const taskX = timelineX - TASK_AXIS_GAP - node.width;
1307
+ taskWrapper.attr("transform", `translate(${taskX}, ${masterY})`);
1308
+ maxTaskHeight = Math.max(maxTaskHeight, taskHeight);
1309
+ if (task.events && task.events.length > 0) {
1310
+ const eventsStartY = masterY;
1311
+ const eventsX = timelineX + EVENT_AXIS_GAP;
1312
+ drawEvents2(diagram2, task.events, sectionColor, timelineX, eventsX, eventsStartY, conf);
1313
+ }
1314
+ masterY = masterY + taskSpacing;
1315
+ if (isWithoutSections && !conf.timeline?.disableMulticolor) sectionColor++;
1316
+ }
1317
+ }, "drawTasks");
1318
+ var drawEvents2 = /* @__PURE__ */ __name(function(diagram2, events, sectionColor, axisX, eventsX, startY, conf) {
1319
+ let currentY = startY;
1320
+ for (const event of events) {
1321
+ const eventNode = {
1322
+ descr: event,
1323
+ section: sectionColor,
1324
+ number: sectionColor,
1325
+ width: EVENT_WIDTH,
1326
+ padding: NODE_PADDING,
1327
+ maxHeight: 0
1328
+ };
1329
+ log.debug("eventNode", eventNode);
1330
+ const eventWrapper = diagram2.append("g").attr("class", "eventWrapper");
1331
+ const eventHeight = svgDraw_default.drawNode(eventWrapper, eventNode, sectionColor, conf).height;
1332
+ eventWrapper.attr("transform", `translate(${eventsX}, ${currentY})`);
1333
+ const lineWrapper = diagram2.append("g").attr("class", "lineWrapper");
1334
+ const lineY = currentY + eventHeight / 2;
1335
+ lineWrapper.append("line").attr("x1", axisX).attr("y1", lineY).attr("x2", eventsX).attr("y2", lineY).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5");
1336
+ currentY = currentY + eventHeight + EVENT_SPACING;
1337
+ }
1338
+ return currentY - startY;
1339
+ }, "drawEvents");
1340
+ var timelineRendererVertical_default = {
1341
+ setConf: /* @__PURE__ */ __name(() => {}, "setConf"),
1342
+ draw: draw2
1343
+ };
1344
+ var genReduxSections = /* @__PURE__ */ __name((options) => {
1345
+ const { theme } = getConfig();
1346
+ const isDarkTheme = theme?.includes("dark");
1347
+ const isColorTheme2 = isColorTheme(theme, options.borderColorArray);
1348
+ const rawSvgId = options.svgId?.replace(/^#/, "") ?? "";
1349
+ const scopedDropShadow = rawSvgId ? `url(#${rawSvgId}-drop-shadow)` : options.dropShadow ?? "none";
1350
+ let sections2 = "";
1351
+ for (let i = 0; i < colorSlotCount(options.THEME_COLOR_LIMIT); i++) {
1352
+ const sw = `${17 - 3 * i}`;
1353
+ const slot = isColorTheme2 ? options.borderColorArray[i % options.borderColorArray.length] : void 0;
1354
+ const color = slot ?? options.mainBkg;
1355
+ const stroke = slot ?? options.nodeBorder;
1356
+ sections2 += `
1357
+ .section-${i - 1} rect,
1358
+ .section-${i - 1} path,
1359
+ .section-${i - 1} circle {
1360
+ fill: ${isDarkTheme && isColorTheme2 ? options.mainBkg : color};
1361
+ stroke: ${stroke};
1362
+ stroke-width: ${options.strokeWidth};
1363
+ filter: ${scopedDropShadow};
1364
+ }
1365
+
1366
+ .section-${i - 1} text {
1367
+ fill: ${options.nodeBorder};
1368
+ font-weight: ${options.fontWeight}
1369
+ }
1370
+
1371
+ .node-icon-${i - 1} {
1372
+ font-size: 40px;
1373
+ color: ${options["cScaleLabel" + i]};
1374
+ }
1375
+
1376
+ .section-edge-${i - 1} {
1377
+ stroke: ${options["cScale" + i]};
1378
+ }
1379
+
1380
+ .edge-depth-${i - 1} {
1381
+ stroke-width: ${sw};
1382
+ }
1383
+
1384
+ .section-${i - 1} line {
1385
+ stroke: ${options["cScaleInv" + i]};
1386
+ stroke-width: 3;
1387
+ }
1388
+
1389
+ .lineWrapper line {
1390
+ stroke: ${options.nodeBorder};
1391
+ stroke-width:${options.strokeWidth}
1392
+ }
1393
+
1394
+ .disabled,
1395
+ .disabled circle,
1396
+ .disabled text {
1397
+ fill: ${options.tertiaryColor ?? "lightgray"};
1398
+ }
1399
+
1400
+ .disabled text {
1401
+ fill: ${options.clusterBorder ?? "#efefef"};
1402
+ }
1403
+ `;
1404
+ }
1405
+ return sections2;
1406
+ }, "genReduxSections");
1407
+ var genSections = /* @__PURE__ */ __name((options) => {
1408
+ let sections2 = "";
1409
+ const colorLimit = colorSlotCount(options.THEME_COLOR_LIMIT);
1410
+ for (let i = 0; i < colorLimit; i++) {
1411
+ options["lineColor" + i] = options["lineColor" + i] ?? options["cScaleInv" + i];
1412
+ if (isDark(options["lineColor" + i])) options["lineColor" + i] = lighten(options["lineColor" + i], 20);
1413
+ else options["lineColor" + i] = darken(options["lineColor" + i], 20);
1414
+ }
1415
+ for (let i = 0; i < colorLimit; i++) {
1416
+ const sw = "" + (17 - 3 * i);
1417
+ sections2 += `
1418
+ .section-${i - 1} rect, .section-${i - 1} path, .section-${i - 1} circle, .section-${i - 1} path {
1419
+ fill: ${options["cScale" + i]};
1420
+ }
1421
+ .section-${i - 1} text {
1422
+ fill: ${options["cScaleLabel" + i]};
1423
+ }
1424
+ .node-icon-${i - 1} {
1425
+ font-size: 40px;
1426
+ color: ${options["cScaleLabel" + i]};
1427
+ }
1428
+ .section-edge-${i - 1}{
1429
+ stroke: ${options["cScale" + i]};
1430
+ }
1431
+ .edge-depth-${i - 1}{
1432
+ stroke-width: ${sw};
1433
+ }
1434
+ .section-${i - 1} line {
1435
+ stroke: ${options["cScaleInv" + i]} ;
1436
+ stroke-width: 3;
1437
+ }
1438
+
1439
+ .lineWrapper line{
1440
+ stroke: ${options["cScaleLabel" + i]} ;
1441
+ }
1442
+
1443
+ .disabled, .disabled circle, .disabled text {
1444
+ fill: ${options.tertiaryColor ?? "lightgray"};
1445
+ }
1446
+ .disabled text {
1447
+ fill: ${options.clusterBorder ?? "#efefef"};
1448
+ }
1449
+ `;
1450
+ }
1451
+ return sections2;
1452
+ }, "genSections");
1453
+ var diagram = {
1454
+ db: timelineDb_exports,
1455
+ renderer: {
1456
+ setConf: /* @__PURE__ */ __name(() => {}, "setConf"),
1457
+ draw: /* @__PURE__ */ __name((text, id, version, diagObj) => {
1458
+ if ((diagObj?.db?.getDirection?.() ?? "LR") === "TD") return timelineRendererVertical_default.draw(text, id, version, diagObj);
1459
+ return timelineRenderer_default.draw(text, id, version, diagObj);
1460
+ }, "draw")
1461
+ },
1462
+ parser: timeline_default,
1463
+ styles: /* @__PURE__ */ __name((options) => {
1464
+ const { theme } = getConfig();
1465
+ const isReduxTheme = theme?.includes("redux");
1466
+ const isNeutralTheme = theme === "neutral";
1467
+ const rawSvgId = options.svgId?.replace(/^#/, "") ?? "";
1468
+ let gradientSections = "";
1469
+ if (options.useGradient && rawSvgId && options.THEME_COLOR_LIMIT && !isNeutralTheme) {
1470
+ const gradientColorLimit = colorSlotCount(options.THEME_COLOR_LIMIT);
1471
+ for (let i = 0; i < gradientColorLimit; i++) gradientSections += `
1472
+ .section-${i - 1}[data-look="neo"] rect,
1473
+ .section-${i - 1}[data-look="neo"] path,
1474
+ .section-${i - 1}[data-look="neo"] circle {
1475
+ fill: ${options.mainBkg};
1476
+ stroke: url(#${rawSvgId}-gradient);
1477
+ stroke-width: 2;
1478
+ }
1479
+ .section-${i - 1}[data-look="neo"] line {
1480
+ stroke: url(#${rawSvgId}-gradient);
1481
+ stroke-width: 2;
1482
+ }`;
1483
+ }
1484
+ return `
1485
+ .edge {
1486
+ stroke-width: 3;
1487
+ }
1488
+ ${isReduxTheme ? genReduxSections(options) : genSections(options)}
1489
+ ${gradientSections}
1490
+ .section-root rect, .section-root path, .section-root circle {
1491
+ fill: ${options.git0};
1492
+ }
1493
+ .section-root text {
1494
+ fill: ${options.gitBranchLabel0};
1495
+ }
1496
+ .icon-container {
1497
+ height:100%;
1498
+ display: flex;
1499
+ justify-content: center;
1500
+ align-items: center;
1501
+ }
1502
+ .edge {
1503
+ fill: none;
1504
+ }
1505
+ .eventWrapper {
1506
+ filter: brightness(120%);
1507
+ }
1508
+ `;
1509
+ }, "getStyles")
1510
+ };
1511
+
1512
+ //#endregion
1513
+ export { diagram };