@oxide/design-system 1.7.7--canary.fdd8ab6.0 → 1.7.7--canary.fc65d31.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 (130) hide show
  1. package/components/dist/architecture-I3QFYML2-YZWO3N3B.js +14 -0
  2. package/components/dist/architecture-I3QFYML2-YZWO3N3B.js.map +1 -0
  3. package/components/dist/architectureDiagram-UYN6MBPD-HXPGIDN7.js +8846 -0
  4. package/components/dist/architectureDiagram-UYN6MBPD-HXPGIDN7.js.map +1 -0
  5. package/components/dist/blockDiagram-ZHA2E4KO-OAYYKCLF.js +3721 -0
  6. package/components/dist/blockDiagram-ZHA2E4KO-OAYYKCLF.js.map +1 -0
  7. package/components/dist/c4Diagram-6F5ED5ID-TBHFK2XY.js +2599 -0
  8. package/components/dist/c4Diagram-6F5ED5ID-TBHFK2XY.js.map +1 -0
  9. package/components/dist/chunk-2DDKDUUO.js +439 -0
  10. package/components/dist/chunk-2DDKDUUO.js.map +1 -0
  11. package/components/dist/chunk-2NHDMTP7.js +26905 -0
  12. package/components/dist/chunk-2NHDMTP7.js.map +1 -0
  13. package/components/dist/chunk-4IJS44L3.js +22 -0
  14. package/components/dist/chunk-4IJS44L3.js.map +1 -0
  15. package/components/dist/chunk-562WOS3Z.js +1109 -0
  16. package/components/dist/chunk-562WOS3Z.js.map +1 -0
  17. package/components/dist/chunk-6UD2HOKB.js +17082 -0
  18. package/components/dist/chunk-6UD2HOKB.js.map +1 -0
  19. package/components/dist/chunk-76BOQ7BT.js +63 -0
  20. package/components/dist/chunk-76BOQ7BT.js.map +1 -0
  21. package/components/dist/chunk-7I5DT373.js +97 -0
  22. package/components/dist/chunk-7I5DT373.js.map +1 -0
  23. package/components/dist/chunk-BPREMNVP.js +1875 -0
  24. package/components/dist/chunk-BPREMNVP.js.map +1 -0
  25. package/components/dist/chunk-BVYAEHG3.js +122 -0
  26. package/components/dist/chunk-BVYAEHG3.js.map +1 -0
  27. package/components/dist/chunk-BW7DFBOS.js +152 -0
  28. package/components/dist/chunk-BW7DFBOS.js.map +1 -0
  29. package/components/dist/chunk-EZG2MNHW.js +59 -0
  30. package/components/dist/chunk-EZG2MNHW.js.map +1 -0
  31. package/components/dist/chunk-G6QWNAHJ.js +43 -0
  32. package/components/dist/chunk-G6QWNAHJ.js.map +1 -0
  33. package/components/dist/chunk-H72D3HRR.js +1244 -0
  34. package/components/dist/chunk-H72D3HRR.js.map +1 -0
  35. package/components/dist/chunk-K532NZMW.js +46 -0
  36. package/components/dist/chunk-K532NZMW.js.map +1 -0
  37. package/components/dist/chunk-LC3BX2KL.js +25 -0
  38. package/components/dist/chunk-LC3BX2KL.js.map +1 -0
  39. package/components/dist/chunk-LQ2ABR7F.js +5665 -0
  40. package/components/dist/chunk-LQ2ABR7F.js.map +1 -0
  41. package/components/dist/chunk-M6L3MM6K.js +22 -0
  42. package/components/dist/chunk-M6L3MM6K.js.map +1 -0
  43. package/components/dist/chunk-MWA4PRRW.js +122 -0
  44. package/components/dist/chunk-MWA4PRRW.js.map +1 -0
  45. package/components/dist/chunk-ND3FLKHU.js +570 -0
  46. package/components/dist/chunk-ND3FLKHU.js.map +1 -0
  47. package/components/dist/chunk-NIVHLOPB.js +2621 -0
  48. package/components/dist/chunk-NIVHLOPB.js.map +1 -0
  49. package/components/dist/chunk-R6F6FFK7.js +65 -0
  50. package/components/dist/chunk-R6F6FFK7.js.map +1 -0
  51. package/components/dist/chunk-RN5R3L7O.js +2041 -0
  52. package/components/dist/chunk-RN5R3L7O.js.map +1 -0
  53. package/components/dist/chunk-RWDBBMDN.js +10910 -0
  54. package/components/dist/chunk-RWDBBMDN.js.map +1 -0
  55. package/components/dist/chunk-T7HPDS4Z.js +573 -0
  56. package/components/dist/chunk-T7HPDS4Z.js.map +1 -0
  57. package/components/dist/chunk-TG4YEU4Q.js +23 -0
  58. package/components/dist/chunk-TG4YEU4Q.js.map +1 -0
  59. package/components/dist/chunk-U5WCXBW2.js +48 -0
  60. package/components/dist/chunk-U5WCXBW2.js.map +1 -0
  61. package/components/dist/chunk-V6PWN6OH.js +1875 -0
  62. package/components/dist/chunk-V6PWN6OH.js.map +1 -0
  63. package/components/dist/chunk-VLTHNCSD.js +48 -0
  64. package/components/dist/chunk-VLTHNCSD.js.map +1 -0
  65. package/components/dist/chunk-WDK4G4UR.js +2791 -0
  66. package/components/dist/chunk-WDK4G4UR.js.map +1 -0
  67. package/components/dist/chunk-WLVQWTC6.js +77 -0
  68. package/components/dist/chunk-WLVQWTC6.js.map +1 -0
  69. package/components/dist/chunk-YDLS5R4M.js +48 -0
  70. package/components/dist/chunk-YDLS5R4M.js.map +1 -0
  71. package/components/dist/chunk-YGFBWU2Q.js +7 -0
  72. package/components/dist/chunk-YGFBWU2Q.js.map +1 -0
  73. package/components/dist/chunk-ZBL4CWCH.js +2120 -0
  74. package/components/dist/chunk-ZBL4CWCH.js.map +1 -0
  75. package/components/dist/classDiagram-LNE6IOMH-VRQHEQWM.js +40 -0
  76. package/components/dist/classDiagram-LNE6IOMH-VRQHEQWM.js.map +1 -0
  77. package/components/dist/classDiagram-v2-MQ7JQ4JX-5GB4NXXM.js +40 -0
  78. package/components/dist/classDiagram-v2-MQ7JQ4JX-5GB4NXXM.js.map +1 -0
  79. package/components/dist/dagre-4EVJKHTY-XW45LMKR.js +734 -0
  80. package/components/dist/dagre-4EVJKHTY-XW45LMKR.js.map +1 -0
  81. package/components/dist/diagram-QW4FP2JN-J2YMUPB5.js +226 -0
  82. package/components/dist/diagram-QW4FP2JN-J2YMUPB5.js.map +1 -0
  83. package/components/dist/erDiagram-6RL3IURR-HQULDVJI.js +1381 -0
  84. package/components/dist/erDiagram-6RL3IURR-HQULDVJI.js.map +1 -0
  85. package/components/dist/flowDiagram-7ASYPVHJ-2542732I.js +2349 -0
  86. package/components/dist/flowDiagram-7ASYPVHJ-2542732I.js.map +1 -0
  87. package/components/dist/ganttDiagram-NTVNEXSI-V66YQQB3.js +2413 -0
  88. package/components/dist/ganttDiagram-NTVNEXSI-V66YQQB3.js.map +1 -0
  89. package/components/dist/gitGraph-YCYPL57B-AAXPWQN7.js +14 -0
  90. package/components/dist/gitGraph-YCYPL57B-AAXPWQN7.js.map +1 -0
  91. package/components/dist/gitGraphDiagram-NRZ2UAAF-5DU6QMYZ.js +1763 -0
  92. package/components/dist/gitGraphDiagram-NRZ2UAAF-5DU6QMYZ.js.map +1 -0
  93. package/components/dist/index.d.ts +5 -2
  94. package/components/dist/index.js +1729 -126
  95. package/components/dist/index.js.map +1 -1
  96. package/components/dist/info-46DW6VJ7-43TTIEYF.js +14 -0
  97. package/components/dist/info-46DW6VJ7-43TTIEYF.js.map +1 -0
  98. package/components/dist/infoDiagram-A4XQUW5V-UZERSQDI.js +54 -0
  99. package/components/dist/infoDiagram-A4XQUW5V-UZERSQDI.js.map +1 -0
  100. package/components/dist/journeyDiagram-G5WM74LC-RVKMRGRW.js +1244 -0
  101. package/components/dist/journeyDiagram-G5WM74LC-RVKMRGRW.js.map +1 -0
  102. package/components/dist/kanban-definition-QRCXZQQD-NWU5I3TK.js +1119 -0
  103. package/components/dist/kanban-definition-QRCXZQQD-NWU5I3TK.js.map +1 -0
  104. package/components/dist/katex-WNZY3CE5.js +14484 -0
  105. package/components/dist/katex-WNZY3CE5.js.map +1 -0
  106. package/components/dist/mindmap-definition-GWI6TPTV-MISEH6LG.js +6013 -0
  107. package/components/dist/mindmap-definition-GWI6TPTV-MISEH6LG.js.map +1 -0
  108. package/components/dist/packet-W2GHVCYJ-FBZCFIPR.js +14 -0
  109. package/components/dist/packet-W2GHVCYJ-FBZCFIPR.js.map +1 -0
  110. package/components/dist/pie-BEWT4RHE-UFFBBCXM.js +14 -0
  111. package/components/dist/pie-BEWT4RHE-UFFBBCXM.js.map +1 -0
  112. package/components/dist/pieDiagram-YF2LJOPJ-IXEVHPCM.js +223 -0
  113. package/components/dist/pieDiagram-YF2LJOPJ-IXEVHPCM.js.map +1 -0
  114. package/components/dist/quadrantDiagram-OS5C2QUG-MW26UCZV.js +1408 -0
  115. package/components/dist/quadrantDiagram-OS5C2QUG-MW26UCZV.js.map +1 -0
  116. package/components/dist/requirementDiagram-MIRIMTAZ-BX24AAHL.js +1175 -0
  117. package/components/dist/requirementDiagram-MIRIMTAZ-BX24AAHL.js.map +1 -0
  118. package/components/dist/sankeyDiagram-Y46BX6SQ-5RKUGG63.js +1278 -0
  119. package/components/dist/sankeyDiagram-Y46BX6SQ-5RKUGG63.js.map +1 -0
  120. package/components/dist/sequenceDiagram-G6AWOVSC-2T3JBUZ2.js +3529 -0
  121. package/components/dist/sequenceDiagram-G6AWOVSC-2T3JBUZ2.js.map +1 -0
  122. package/components/dist/stateDiagram-MAYHULR4-HZ5EGLPA.js +505 -0
  123. package/components/dist/stateDiagram-MAYHULR4-HZ5EGLPA.js.map +1 -0
  124. package/components/dist/stateDiagram-v2-4JROLMXI-DN2FEZV3.js +40 -0
  125. package/components/dist/stateDiagram-v2-4JROLMXI-DN2FEZV3.js.map +1 -0
  126. package/components/dist/timeline-definition-U7ZMHBDA-GB6AKKW4.js +1260 -0
  127. package/components/dist/timeline-definition-U7ZMHBDA-GB6AKKW4.js.map +1 -0
  128. package/components/dist/xychartDiagram-6QU3TZC5-BFFLEHUP.js +1877 -0
  129. package/components/dist/xychartDiagram-6QU3TZC5-BFFLEHUP.js.map +1 -0
  130. package/package.json +2 -1
@@ -0,0 +1,1244 @@
1
+ import {
2
+ drawBackgroundRect,
3
+ drawRect,
4
+ drawText,
5
+ getNoteRect
6
+ } from "./chunk-MWA4PRRW.js";
7
+ import "./chunk-7I5DT373.js";
8
+ import {
9
+ __name,
10
+ arc_default,
11
+ clear,
12
+ configureSvgSize,
13
+ getAccDescription,
14
+ getAccTitle,
15
+ getConfig2,
16
+ getDiagramTitle,
17
+ select_default,
18
+ setAccDescription,
19
+ setAccTitle,
20
+ setDiagramTitle
21
+ } from "./chunk-RWDBBMDN.js";
22
+ import "./chunk-K532NZMW.js";
23
+
24
+ // node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-G5WM74LC.mjs
25
+ var parser = function() {
26
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
27
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
28
+ ;
29
+ return o2;
30
+ }, "o"), $V0 = [6, 8, 10, 11, 12, 14, 16, 17, 18], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12], $V5 = [1, 13], $V6 = [1, 14];
31
+ var parser2 = {
32
+ trace: /* @__PURE__ */ __name(function trace() {
33
+ }, "trace"),
34
+ yy: {},
35
+ symbols_: { "error": 2, "start": 3, "journey": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NEWLINE": 10, "title": 11, "acc_title": 12, "acc_title_value": 13, "acc_descr": 14, "acc_descr_value": 15, "acc_descr_multiline_value": 16, "section": 17, "taskName": 18, "taskData": 19, "$accept": 0, "$end": 1 },
36
+ terminals_: { 2: "error", 4: "journey", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 11: "title", 12: "acc_title", 13: "acc_title_value", 14: "acc_descr", 15: "acc_descr_value", 16: "acc_descr_multiline_value", 17: "section", 18: "taskName", 19: "taskData" },
37
+ productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2]],
38
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
39
+ var $0 = $$.length - 1;
40
+ switch (yystate) {
41
+ case 1:
42
+ return $$[$0 - 1];
43
+ break;
44
+ case 2:
45
+ this.$ = [];
46
+ break;
47
+ case 3:
48
+ $$[$0 - 1].push($$[$0]);
49
+ this.$ = $$[$0 - 1];
50
+ break;
51
+ case 4:
52
+ case 5:
53
+ this.$ = $$[$0];
54
+ break;
55
+ case 6:
56
+ case 7:
57
+ this.$ = [];
58
+ break;
59
+ case 8:
60
+ yy.setDiagramTitle($$[$0].substr(6));
61
+ this.$ = $$[$0].substr(6);
62
+ break;
63
+ case 9:
64
+ this.$ = $$[$0].trim();
65
+ yy.setAccTitle(this.$);
66
+ break;
67
+ case 10:
68
+ case 11:
69
+ this.$ = $$[$0].trim();
70
+ yy.setAccDescription(this.$);
71
+ break;
72
+ case 12:
73
+ yy.addSection($$[$0].substr(8));
74
+ this.$ = $$[$0].substr(8);
75
+ break;
76
+ case 13:
77
+ yy.addTask($$[$0 - 1], $$[$0]);
78
+ this.$ = "task";
79
+ break;
80
+ }
81
+ }, "anonymous"),
82
+ table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: $V1, 12: $V2, 14: $V3, 16: $V4, 17: $V5, 18: $V6 }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 15, 11: $V1, 12: $V2, 14: $V3, 16: $V4, 17: $V5, 18: $V6 }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 8]), { 13: [1, 16] }, { 15: [1, 17] }, o($V0, [2, 11]), o($V0, [2, 12]), { 19: [1, 18] }, o($V0, [2, 4]), o($V0, [2, 9]), o($V0, [2, 10]), o($V0, [2, 13])],
83
+ defaultActions: {},
84
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
85
+ if (hash.recoverable) {
86
+ this.trace(str);
87
+ } else {
88
+ var error = new Error(str);
89
+ error.hash = hash;
90
+ throw error;
91
+ }
92
+ }, "parseError"),
93
+ parse: /* @__PURE__ */ __name(function parse(input) {
94
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
95
+ var args = lstack.slice.call(arguments, 1);
96
+ var lexer2 = Object.create(this.lexer);
97
+ var sharedState = { yy: {} };
98
+ for (var k in this.yy) {
99
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
100
+ sharedState.yy[k] = this.yy[k];
101
+ }
102
+ }
103
+ lexer2.setInput(input, sharedState.yy);
104
+ sharedState.yy.lexer = lexer2;
105
+ sharedState.yy.parser = this;
106
+ if (typeof lexer2.yylloc == "undefined") {
107
+ lexer2.yylloc = {};
108
+ }
109
+ var yyloc = lexer2.yylloc;
110
+ lstack.push(yyloc);
111
+ var ranges = lexer2.options && lexer2.options.ranges;
112
+ if (typeof sharedState.yy.parseError === "function") {
113
+ this.parseError = sharedState.yy.parseError;
114
+ } else {
115
+ this.parseError = Object.getPrototypeOf(this).parseError;
116
+ }
117
+ function popStack(n) {
118
+ stack.length = stack.length - 2 * n;
119
+ vstack.length = vstack.length - n;
120
+ lstack.length = lstack.length - n;
121
+ }
122
+ __name(popStack, "popStack");
123
+ function lex() {
124
+ var token;
125
+ token = tstack.pop() || lexer2.lex() || EOF;
126
+ if (typeof token !== "number") {
127
+ if (token instanceof Array) {
128
+ tstack = token;
129
+ token = tstack.pop();
130
+ }
131
+ token = self.symbols_[token] || token;
132
+ }
133
+ return token;
134
+ }
135
+ __name(lex, "lex");
136
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
137
+ while (true) {
138
+ state = stack[stack.length - 1];
139
+ if (this.defaultActions[state]) {
140
+ action = this.defaultActions[state];
141
+ } else {
142
+ if (symbol === null || typeof symbol == "undefined") {
143
+ symbol = lex();
144
+ }
145
+ action = table[state] && table[state][symbol];
146
+ }
147
+ if (typeof action === "undefined" || !action.length || !action[0]) {
148
+ var errStr = "";
149
+ expected = [];
150
+ for (p in table[state]) {
151
+ if (this.terminals_[p] && p > TERROR) {
152
+ expected.push("'" + this.terminals_[p] + "'");
153
+ }
154
+ }
155
+ if (lexer2.showPosition) {
156
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
157
+ } else {
158
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
159
+ }
160
+ this.parseError(errStr, {
161
+ text: lexer2.match,
162
+ token: this.terminals_[symbol] || symbol,
163
+ line: lexer2.yylineno,
164
+ loc: yyloc,
165
+ expected
166
+ });
167
+ }
168
+ if (action[0] instanceof Array && action.length > 1) {
169
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
170
+ }
171
+ switch (action[0]) {
172
+ case 1:
173
+ stack.push(symbol);
174
+ vstack.push(lexer2.yytext);
175
+ lstack.push(lexer2.yylloc);
176
+ stack.push(action[1]);
177
+ symbol = null;
178
+ if (!preErrorSymbol) {
179
+ yyleng = lexer2.yyleng;
180
+ yytext = lexer2.yytext;
181
+ yylineno = lexer2.yylineno;
182
+ yyloc = lexer2.yylloc;
183
+ if (recovering > 0) {
184
+ recovering--;
185
+ }
186
+ } else {
187
+ symbol = preErrorSymbol;
188
+ preErrorSymbol = null;
189
+ }
190
+ break;
191
+ case 2:
192
+ len = this.productions_[action[1]][1];
193
+ yyval.$ = vstack[vstack.length - len];
194
+ yyval._$ = {
195
+ first_line: lstack[lstack.length - (len || 1)].first_line,
196
+ last_line: lstack[lstack.length - 1].last_line,
197
+ first_column: lstack[lstack.length - (len || 1)].first_column,
198
+ last_column: lstack[lstack.length - 1].last_column
199
+ };
200
+ if (ranges) {
201
+ yyval._$.range = [
202
+ lstack[lstack.length - (len || 1)].range[0],
203
+ lstack[lstack.length - 1].range[1]
204
+ ];
205
+ }
206
+ r = this.performAction.apply(yyval, [
207
+ yytext,
208
+ yyleng,
209
+ yylineno,
210
+ sharedState.yy,
211
+ action[1],
212
+ vstack,
213
+ lstack
214
+ ].concat(args));
215
+ if (typeof r !== "undefined") {
216
+ return r;
217
+ }
218
+ if (len) {
219
+ stack = stack.slice(0, -1 * len * 2);
220
+ vstack = vstack.slice(0, -1 * len);
221
+ lstack = lstack.slice(0, -1 * len);
222
+ }
223
+ stack.push(this.productions_[action[1]][0]);
224
+ vstack.push(yyval.$);
225
+ lstack.push(yyval._$);
226
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
227
+ stack.push(newState);
228
+ break;
229
+ case 3:
230
+ return true;
231
+ }
232
+ }
233
+ return true;
234
+ }, "parse")
235
+ };
236
+ var lexer = /* @__PURE__ */ function() {
237
+ var lexer2 = {
238
+ EOF: 1,
239
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
240
+ if (this.yy.parser) {
241
+ this.yy.parser.parseError(str, hash);
242
+ } else {
243
+ throw new Error(str);
244
+ }
245
+ }, "parseError"),
246
+ // resets the lexer, sets new input
247
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
248
+ this.yy = yy || this.yy || {};
249
+ this._input = input;
250
+ this._more = this._backtrack = this.done = false;
251
+ this.yylineno = this.yyleng = 0;
252
+ this.yytext = this.matched = this.match = "";
253
+ this.conditionStack = ["INITIAL"];
254
+ this.yylloc = {
255
+ first_line: 1,
256
+ first_column: 0,
257
+ last_line: 1,
258
+ last_column: 0
259
+ };
260
+ if (this.options.ranges) {
261
+ this.yylloc.range = [0, 0];
262
+ }
263
+ this.offset = 0;
264
+ return this;
265
+ }, "setInput"),
266
+ // consumes and returns one char from the input
267
+ input: /* @__PURE__ */ __name(function() {
268
+ var ch = this._input[0];
269
+ this.yytext += ch;
270
+ this.yyleng++;
271
+ this.offset++;
272
+ this.match += ch;
273
+ this.matched += ch;
274
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
275
+ if (lines) {
276
+ this.yylineno++;
277
+ this.yylloc.last_line++;
278
+ } else {
279
+ this.yylloc.last_column++;
280
+ }
281
+ if (this.options.ranges) {
282
+ this.yylloc.range[1]++;
283
+ }
284
+ this._input = this._input.slice(1);
285
+ return ch;
286
+ }, "input"),
287
+ // unshifts one char (or a string) into the input
288
+ unput: /* @__PURE__ */ __name(function(ch) {
289
+ var len = ch.length;
290
+ var lines = ch.split(/(?:\r\n?|\n)/g);
291
+ this._input = ch + this._input;
292
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
293
+ this.offset -= len;
294
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
295
+ this.match = this.match.substr(0, this.match.length - 1);
296
+ this.matched = this.matched.substr(0, this.matched.length - 1);
297
+ if (lines.length - 1) {
298
+ this.yylineno -= lines.length - 1;
299
+ }
300
+ var r = this.yylloc.range;
301
+ this.yylloc = {
302
+ first_line: this.yylloc.first_line,
303
+ last_line: this.yylineno + 1,
304
+ first_column: this.yylloc.first_column,
305
+ 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
306
+ };
307
+ if (this.options.ranges) {
308
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
309
+ }
310
+ this.yyleng = this.yytext.length;
311
+ return this;
312
+ }, "unput"),
313
+ // When called from action, caches matched text and appends it on next action
314
+ more: /* @__PURE__ */ __name(function() {
315
+ this._more = true;
316
+ return this;
317
+ }, "more"),
318
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
319
+ reject: /* @__PURE__ */ __name(function() {
320
+ if (this.options.backtrack_lexer) {
321
+ this._backtrack = true;
322
+ } else {
323
+ 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(), {
324
+ text: "",
325
+ token: null,
326
+ line: this.yylineno
327
+ });
328
+ }
329
+ return this;
330
+ }, "reject"),
331
+ // retain first n characters of the match
332
+ less: /* @__PURE__ */ __name(function(n) {
333
+ this.unput(this.match.slice(n));
334
+ }, "less"),
335
+ // displays already matched input, i.e. for error messages
336
+ pastInput: /* @__PURE__ */ __name(function() {
337
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
338
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
339
+ }, "pastInput"),
340
+ // displays upcoming input, i.e. for error messages
341
+ upcomingInput: /* @__PURE__ */ __name(function() {
342
+ var next = this.match;
343
+ if (next.length < 20) {
344
+ next += this._input.substr(0, 20 - next.length);
345
+ }
346
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
347
+ }, "upcomingInput"),
348
+ // displays the character position where the lexing error occurred, i.e. for error messages
349
+ showPosition: /* @__PURE__ */ __name(function() {
350
+ var pre = this.pastInput();
351
+ var c = new Array(pre.length + 1).join("-");
352
+ return pre + this.upcomingInput() + "\n" + c + "^";
353
+ }, "showPosition"),
354
+ // test the lexed token: return FALSE when not a match, otherwise return token
355
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
356
+ var token, lines, backup;
357
+ if (this.options.backtrack_lexer) {
358
+ backup = {
359
+ yylineno: this.yylineno,
360
+ yylloc: {
361
+ first_line: this.yylloc.first_line,
362
+ last_line: this.last_line,
363
+ first_column: this.yylloc.first_column,
364
+ last_column: this.yylloc.last_column
365
+ },
366
+ yytext: this.yytext,
367
+ match: this.match,
368
+ matches: this.matches,
369
+ matched: this.matched,
370
+ yyleng: this.yyleng,
371
+ offset: this.offset,
372
+ _more: this._more,
373
+ _input: this._input,
374
+ yy: this.yy,
375
+ conditionStack: this.conditionStack.slice(0),
376
+ done: this.done
377
+ };
378
+ if (this.options.ranges) {
379
+ backup.yylloc.range = this.yylloc.range.slice(0);
380
+ }
381
+ }
382
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
383
+ if (lines) {
384
+ this.yylineno += lines.length;
385
+ }
386
+ this.yylloc = {
387
+ first_line: this.yylloc.last_line,
388
+ last_line: this.yylineno + 1,
389
+ first_column: this.yylloc.last_column,
390
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
391
+ };
392
+ this.yytext += match[0];
393
+ this.match += match[0];
394
+ this.matches = match;
395
+ this.yyleng = this.yytext.length;
396
+ if (this.options.ranges) {
397
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
398
+ }
399
+ this._more = false;
400
+ this._backtrack = false;
401
+ this._input = this._input.slice(match[0].length);
402
+ this.matched += match[0];
403
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
404
+ if (this.done && this._input) {
405
+ this.done = false;
406
+ }
407
+ if (token) {
408
+ return token;
409
+ } else if (this._backtrack) {
410
+ for (var k in backup) {
411
+ this[k] = backup[k];
412
+ }
413
+ return false;
414
+ }
415
+ return false;
416
+ }, "test_match"),
417
+ // return next match in input
418
+ next: /* @__PURE__ */ __name(function() {
419
+ if (this.done) {
420
+ return this.EOF;
421
+ }
422
+ if (!this._input) {
423
+ this.done = true;
424
+ }
425
+ var token, match, tempMatch, index;
426
+ if (!this._more) {
427
+ this.yytext = "";
428
+ this.match = "";
429
+ }
430
+ var rules = this._currentRules();
431
+ for (var i = 0; i < rules.length; i++) {
432
+ tempMatch = this._input.match(this.rules[rules[i]]);
433
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
434
+ match = tempMatch;
435
+ index = i;
436
+ if (this.options.backtrack_lexer) {
437
+ token = this.test_match(tempMatch, rules[i]);
438
+ if (token !== false) {
439
+ return token;
440
+ } else if (this._backtrack) {
441
+ match = false;
442
+ continue;
443
+ } else {
444
+ return false;
445
+ }
446
+ } else if (!this.options.flex) {
447
+ break;
448
+ }
449
+ }
450
+ }
451
+ if (match) {
452
+ token = this.test_match(match, rules[index]);
453
+ if (token !== false) {
454
+ return token;
455
+ }
456
+ return false;
457
+ }
458
+ if (this._input === "") {
459
+ return this.EOF;
460
+ } else {
461
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
462
+ text: "",
463
+ token: null,
464
+ line: this.yylineno
465
+ });
466
+ }
467
+ }, "next"),
468
+ // return next match that has a token
469
+ lex: /* @__PURE__ */ __name(function lex() {
470
+ var r = this.next();
471
+ if (r) {
472
+ return r;
473
+ } else {
474
+ return this.lex();
475
+ }
476
+ }, "lex"),
477
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
478
+ begin: /* @__PURE__ */ __name(function begin(condition) {
479
+ this.conditionStack.push(condition);
480
+ }, "begin"),
481
+ // pop the previously active lexer condition state off the condition stack
482
+ popState: /* @__PURE__ */ __name(function popState() {
483
+ var n = this.conditionStack.length - 1;
484
+ if (n > 0) {
485
+ return this.conditionStack.pop();
486
+ } else {
487
+ return this.conditionStack[0];
488
+ }
489
+ }, "popState"),
490
+ // produce the lexer rule set which is active for the currently active lexer condition state
491
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
492
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
493
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
494
+ } else {
495
+ return this.conditions["INITIAL"].rules;
496
+ }
497
+ }, "_currentRules"),
498
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
499
+ topState: /* @__PURE__ */ __name(function topState(n) {
500
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
501
+ if (n >= 0) {
502
+ return this.conditionStack[n];
503
+ } else {
504
+ return "INITIAL";
505
+ }
506
+ }, "topState"),
507
+ // alias for begin(condition)
508
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
509
+ this.begin(condition);
510
+ }, "pushState"),
511
+ // return the number of states currently on the stack
512
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
513
+ return this.conditionStack.length;
514
+ }, "stateStackSize"),
515
+ options: { "case-insensitive": true },
516
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
517
+ var YYSTATE = YY_START;
518
+ switch ($avoiding_name_collisions) {
519
+ case 0:
520
+ break;
521
+ case 1:
522
+ break;
523
+ case 2:
524
+ return 10;
525
+ break;
526
+ case 3:
527
+ break;
528
+ case 4:
529
+ break;
530
+ case 5:
531
+ return 4;
532
+ break;
533
+ case 6:
534
+ return 11;
535
+ break;
536
+ case 7:
537
+ this.begin("acc_title");
538
+ return 12;
539
+ break;
540
+ case 8:
541
+ this.popState();
542
+ return "acc_title_value";
543
+ break;
544
+ case 9:
545
+ this.begin("acc_descr");
546
+ return 14;
547
+ break;
548
+ case 10:
549
+ this.popState();
550
+ return "acc_descr_value";
551
+ break;
552
+ case 11:
553
+ this.begin("acc_descr_multiline");
554
+ break;
555
+ case 12:
556
+ this.popState();
557
+ break;
558
+ case 13:
559
+ return "acc_descr_multiline_value";
560
+ break;
561
+ case 14:
562
+ return 17;
563
+ break;
564
+ case 15:
565
+ return 18;
566
+ break;
567
+ case 16:
568
+ return 19;
569
+ break;
570
+ case 17:
571
+ return ":";
572
+ break;
573
+ case 18:
574
+ return 6;
575
+ break;
576
+ case 19:
577
+ return "INVALID";
578
+ break;
579
+ }
580
+ }, "anonymous"),
581
+ rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:journey\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^#:\n;]+)/i, /^(?:[^#:\n;]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i],
582
+ conditions: { "acc_descr_multiline": { "rules": [12, 13], "inclusive": false }, "acc_descr": { "rules": [10], "inclusive": false }, "acc_title": { "rules": [8], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19], "inclusive": true } }
583
+ };
584
+ return lexer2;
585
+ }();
586
+ parser2.lexer = lexer;
587
+ function Parser() {
588
+ this.yy = {};
589
+ }
590
+ __name(Parser, "Parser");
591
+ Parser.prototype = parser2;
592
+ parser2.Parser = Parser;
593
+ return new Parser();
594
+ }();
595
+ parser.parser = parser;
596
+ var journey_default = parser;
597
+ var currentSection = "";
598
+ var sections = [];
599
+ var tasks = [];
600
+ var rawTasks = [];
601
+ var clear2 = /* @__PURE__ */ __name(function() {
602
+ sections.length = 0;
603
+ tasks.length = 0;
604
+ currentSection = "";
605
+ rawTasks.length = 0;
606
+ clear();
607
+ }, "clear");
608
+ var addSection = /* @__PURE__ */ __name(function(txt) {
609
+ currentSection = txt;
610
+ sections.push(txt);
611
+ }, "addSection");
612
+ var getSections = /* @__PURE__ */ __name(function() {
613
+ return sections;
614
+ }, "getSections");
615
+ var getTasks = /* @__PURE__ */ __name(function() {
616
+ let allItemsProcessed = compileTasks();
617
+ const maxDepth = 100;
618
+ let iterationCount = 0;
619
+ while (!allItemsProcessed && iterationCount < maxDepth) {
620
+ allItemsProcessed = compileTasks();
621
+ iterationCount++;
622
+ }
623
+ tasks.push(...rawTasks);
624
+ return tasks;
625
+ }, "getTasks");
626
+ var updateActors = /* @__PURE__ */ __name(function() {
627
+ const tempActors = [];
628
+ tasks.forEach((task) => {
629
+ if (task.people) {
630
+ tempActors.push(...task.people);
631
+ }
632
+ });
633
+ const unique = new Set(tempActors);
634
+ return [...unique].sort();
635
+ }, "updateActors");
636
+ var addTask = /* @__PURE__ */ __name(function(descr, taskData) {
637
+ const pieces = taskData.substr(1).split(":");
638
+ let score = 0;
639
+ let peeps = [];
640
+ if (pieces.length === 1) {
641
+ score = Number(pieces[0]);
642
+ peeps = [];
643
+ } else {
644
+ score = Number(pieces[0]);
645
+ peeps = pieces[1].split(",");
646
+ }
647
+ const peopleList = peeps.map((s) => s.trim());
648
+ const rawTask = {
649
+ section: currentSection,
650
+ type: currentSection,
651
+ people: peopleList,
652
+ task: descr,
653
+ score
654
+ };
655
+ rawTasks.push(rawTask);
656
+ }, "addTask");
657
+ var addTaskOrg = /* @__PURE__ */ __name(function(descr) {
658
+ const newTask = {
659
+ section: currentSection,
660
+ type: currentSection,
661
+ description: descr,
662
+ task: descr,
663
+ classes: []
664
+ };
665
+ tasks.push(newTask);
666
+ }, "addTaskOrg");
667
+ var compileTasks = /* @__PURE__ */ __name(function() {
668
+ const compileTask = /* @__PURE__ */ __name(function(pos) {
669
+ return rawTasks[pos].processed;
670
+ }, "compileTask");
671
+ let allProcessed = true;
672
+ for (const [i, rawTask] of rawTasks.entries()) {
673
+ compileTask(i);
674
+ allProcessed = allProcessed && rawTask.processed;
675
+ }
676
+ return allProcessed;
677
+ }, "compileTasks");
678
+ var getActors = /* @__PURE__ */ __name(function() {
679
+ return updateActors();
680
+ }, "getActors");
681
+ var journeyDb_default = {
682
+ getConfig: /* @__PURE__ */ __name(() => getConfig2().journey, "getConfig"),
683
+ clear: clear2,
684
+ setDiagramTitle,
685
+ getDiagramTitle,
686
+ setAccTitle,
687
+ getAccTitle,
688
+ setAccDescription,
689
+ getAccDescription,
690
+ addSection,
691
+ getSections,
692
+ getTasks,
693
+ addTask,
694
+ addTaskOrg,
695
+ getActors
696
+ };
697
+ var getStyles = /* @__PURE__ */ __name((options) => `.label {
698
+ font-family: 'trebuchet ms', verdana, arial, sans-serif;
699
+ font-family: var(--mermaid-font-family);
700
+ color: ${options.textColor};
701
+ }
702
+ .mouth {
703
+ stroke: #666;
704
+ }
705
+
706
+ line {
707
+ stroke: ${options.textColor}
708
+ }
709
+
710
+ .legend {
711
+ fill: ${options.textColor};
712
+ }
713
+
714
+ .label text {
715
+ fill: #333;
716
+ }
717
+ .label {
718
+ color: ${options.textColor}
719
+ }
720
+
721
+ .face {
722
+ ${options.faceColor ? `fill: ${options.faceColor}` : "fill: #FFF8DC"};
723
+ stroke: #999;
724
+ }
725
+
726
+ .node rect,
727
+ .node circle,
728
+ .node ellipse,
729
+ .node polygon,
730
+ .node path {
731
+ fill: ${options.mainBkg};
732
+ stroke: ${options.nodeBorder};
733
+ stroke-width: 1px;
734
+ }
735
+
736
+ .node .label {
737
+ text-align: center;
738
+ }
739
+ .node.clickable {
740
+ cursor: pointer;
741
+ }
742
+
743
+ .arrowheadPath {
744
+ fill: ${options.arrowheadColor};
745
+ }
746
+
747
+ .edgePath .path {
748
+ stroke: ${options.lineColor};
749
+ stroke-width: 1.5px;
750
+ }
751
+
752
+ .flowchart-link {
753
+ stroke: ${options.lineColor};
754
+ fill: none;
755
+ }
756
+
757
+ .edgeLabel {
758
+ background-color: ${options.edgeLabelBackground};
759
+ rect {
760
+ opacity: 0.5;
761
+ }
762
+ text-align: center;
763
+ }
764
+
765
+ .cluster rect {
766
+ }
767
+
768
+ .cluster text {
769
+ fill: ${options.titleColor};
770
+ }
771
+
772
+ div.mermaidTooltip {
773
+ position: absolute;
774
+ text-align: center;
775
+ max-width: 200px;
776
+ padding: 2px;
777
+ font-family: 'trebuchet ms', verdana, arial, sans-serif;
778
+ font-family: var(--mermaid-font-family);
779
+ font-size: 12px;
780
+ background: ${options.tertiaryColor};
781
+ border: 1px solid ${options.border2};
782
+ border-radius: 2px;
783
+ pointer-events: none;
784
+ z-index: 100;
785
+ }
786
+
787
+ .task-type-0, .section-type-0 {
788
+ ${options.fillType0 ? `fill: ${options.fillType0}` : ""};
789
+ }
790
+ .task-type-1, .section-type-1 {
791
+ ${options.fillType0 ? `fill: ${options.fillType1}` : ""};
792
+ }
793
+ .task-type-2, .section-type-2 {
794
+ ${options.fillType0 ? `fill: ${options.fillType2}` : ""};
795
+ }
796
+ .task-type-3, .section-type-3 {
797
+ ${options.fillType0 ? `fill: ${options.fillType3}` : ""};
798
+ }
799
+ .task-type-4, .section-type-4 {
800
+ ${options.fillType0 ? `fill: ${options.fillType4}` : ""};
801
+ }
802
+ .task-type-5, .section-type-5 {
803
+ ${options.fillType0 ? `fill: ${options.fillType5}` : ""};
804
+ }
805
+ .task-type-6, .section-type-6 {
806
+ ${options.fillType0 ? `fill: ${options.fillType6}` : ""};
807
+ }
808
+ .task-type-7, .section-type-7 {
809
+ ${options.fillType0 ? `fill: ${options.fillType7}` : ""};
810
+ }
811
+
812
+ .actor-0 {
813
+ ${options.actor0 ? `fill: ${options.actor0}` : ""};
814
+ }
815
+ .actor-1 {
816
+ ${options.actor1 ? `fill: ${options.actor1}` : ""};
817
+ }
818
+ .actor-2 {
819
+ ${options.actor2 ? `fill: ${options.actor2}` : ""};
820
+ }
821
+ .actor-3 {
822
+ ${options.actor3 ? `fill: ${options.actor3}` : ""};
823
+ }
824
+ .actor-4 {
825
+ ${options.actor4 ? `fill: ${options.actor4}` : ""};
826
+ }
827
+ .actor-5 {
828
+ ${options.actor5 ? `fill: ${options.actor5}` : ""};
829
+ }
830
+ `, "getStyles");
831
+ var styles_default = getStyles;
832
+ var drawRect2 = /* @__PURE__ */ __name(function(elem, rectData) {
833
+ return drawRect(elem, rectData);
834
+ }, "drawRect");
835
+ var drawFace = /* @__PURE__ */ __name(function(element, faceData) {
836
+ const radius = 15;
837
+ 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");
838
+ const face = element.append("g");
839
+ 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");
840
+ 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");
841
+ function smile(face2) {
842
+ const arc = arc_default().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
843
+ face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 2) + ")");
844
+ }
845
+ __name(smile, "smile");
846
+ function sad(face2) {
847
+ const arc = arc_default().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
848
+ face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 7) + ")");
849
+ }
850
+ __name(sad, "sad");
851
+ function ambivalent(face2) {
852
+ 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");
853
+ }
854
+ __name(ambivalent, "ambivalent");
855
+ if (faceData.score > 3) {
856
+ smile(face);
857
+ } else if (faceData.score < 3) {
858
+ sad(face);
859
+ } else {
860
+ ambivalent(face);
861
+ }
862
+ return circleElement;
863
+ }, "drawFace");
864
+ var drawCircle = /* @__PURE__ */ __name(function(element, circleData) {
865
+ const circleElement = element.append("circle");
866
+ circleElement.attr("cx", circleData.cx);
867
+ circleElement.attr("cy", circleData.cy);
868
+ circleElement.attr("class", "actor-" + circleData.pos);
869
+ circleElement.attr("fill", circleData.fill);
870
+ circleElement.attr("stroke", circleData.stroke);
871
+ circleElement.attr("r", circleData.r);
872
+ if (circleElement.class !== void 0) {
873
+ circleElement.attr("class", circleElement.class);
874
+ }
875
+ if (circleData.title !== void 0) {
876
+ circleElement.append("title").text(circleData.title);
877
+ }
878
+ return circleElement;
879
+ }, "drawCircle");
880
+ var drawText2 = /* @__PURE__ */ __name(function(elem, textData) {
881
+ return drawText(elem, textData);
882
+ }, "drawText");
883
+ var drawLabel = /* @__PURE__ */ __name(function(elem, txtObject) {
884
+ function genPoints(x, y, width, height, cut) {
885
+ return x + "," + y + " " + (x + width) + "," + y + " " + (x + width) + "," + (y + height - cut) + " " + (x + width - cut * 1.2) + "," + (y + height) + " " + x + "," + (y + height);
886
+ }
887
+ __name(genPoints, "genPoints");
888
+ const polygon = elem.append("polygon");
889
+ polygon.attr("points", genPoints(txtObject.x, txtObject.y, 50, 20, 7));
890
+ polygon.attr("class", "labelBox");
891
+ txtObject.y = txtObject.y + txtObject.labelMargin;
892
+ txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;
893
+ drawText2(elem, txtObject);
894
+ }, "drawLabel");
895
+ var drawSection = /* @__PURE__ */ __name(function(elem, section, conf2) {
896
+ const g = elem.append("g");
897
+ const rect = getNoteRect();
898
+ rect.x = section.x;
899
+ rect.y = section.y;
900
+ rect.fill = section.fill;
901
+ rect.width = conf2.width * section.taskCount + // width of the tasks
902
+ conf2.diagramMarginX * (section.taskCount - 1);
903
+ rect.height = conf2.height;
904
+ rect.class = "journey-section section-type-" + section.num;
905
+ rect.rx = 3;
906
+ rect.ry = 3;
907
+ drawRect2(g, rect);
908
+ _drawTextCandidateFunc(conf2)(
909
+ section.text,
910
+ g,
911
+ rect.x,
912
+ rect.y,
913
+ rect.width,
914
+ rect.height,
915
+ { class: "journey-section section-type-" + section.num },
916
+ conf2,
917
+ section.colour
918
+ );
919
+ }, "drawSection");
920
+ var taskCount = -1;
921
+ var drawTask = /* @__PURE__ */ __name(function(elem, task, conf2) {
922
+ const center = task.x + conf2.width / 2;
923
+ const g = elem.append("g");
924
+ taskCount++;
925
+ const maxHeight = 300 + 5 * 30;
926
+ g.append("line").attr("id", "task" + taskCount).attr("x1", center).attr("y1", task.y).attr("x2", center).attr("y2", maxHeight).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666");
927
+ drawFace(g, {
928
+ cx: center,
929
+ cy: 300 + (5 - task.score) * 30,
930
+ score: task.score
931
+ });
932
+ const rect = getNoteRect();
933
+ rect.x = task.x;
934
+ rect.y = task.y;
935
+ rect.fill = task.fill;
936
+ rect.width = conf2.width;
937
+ rect.height = conf2.height;
938
+ rect.class = "task task-type-" + task.num;
939
+ rect.rx = 3;
940
+ rect.ry = 3;
941
+ drawRect2(g, rect);
942
+ let xPos = task.x + 14;
943
+ task.people.forEach((person) => {
944
+ const colour = task.actors[person].color;
945
+ const circle = {
946
+ cx: xPos,
947
+ cy: task.y,
948
+ r: 7,
949
+ fill: colour,
950
+ stroke: "#000",
951
+ title: person,
952
+ pos: task.actors[person].position
953
+ };
954
+ drawCircle(g, circle);
955
+ xPos += 10;
956
+ });
957
+ _drawTextCandidateFunc(conf2)(
958
+ task.task,
959
+ g,
960
+ rect.x,
961
+ rect.y,
962
+ rect.width,
963
+ rect.height,
964
+ { class: "task" },
965
+ conf2,
966
+ task.colour
967
+ );
968
+ }, "drawTask");
969
+ var drawBackgroundRect2 = /* @__PURE__ */ __name(function(elem, bounds2) {
970
+ drawBackgroundRect(elem, bounds2);
971
+ }, "drawBackgroundRect");
972
+ var _drawTextCandidateFunc = /* @__PURE__ */ function() {
973
+ function byText(content, g, x, y, width, height, textAttrs, colour) {
974
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content);
975
+ _setTextAttrs(text, textAttrs);
976
+ }
977
+ __name(byText, "byText");
978
+ function byTspan(content, g, x, y, width, height, textAttrs, conf2, colour) {
979
+ const { taskFontSize, taskFontFamily } = conf2;
980
+ const lines = content.split(/<br\s*\/?>/gi);
981
+ for (let i = 0; i < lines.length; i++) {
982
+ const dy = i * taskFontSize - taskFontSize * (lines.length - 1) / 2;
983
+ 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);
984
+ text.append("tspan").attr("x", x + width / 2).attr("dy", dy).text(lines[i]);
985
+ text.attr("y", y + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
986
+ _setTextAttrs(text, textAttrs);
987
+ }
988
+ }
989
+ __name(byTspan, "byTspan");
990
+ function byFo(content, g, x, y, width, height, textAttrs, conf2) {
991
+ const body = g.append("switch");
992
+ const f = body.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height).attr("position", "fixed");
993
+ const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
994
+ text.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
995
+ byTspan(content, body, x, y, width, height, textAttrs, conf2);
996
+ _setTextAttrs(text, textAttrs);
997
+ }
998
+ __name(byFo, "byFo");
999
+ function _setTextAttrs(toText, fromTextAttrsDict) {
1000
+ for (const key in fromTextAttrsDict) {
1001
+ if (key in fromTextAttrsDict) {
1002
+ toText.attr(key, fromTextAttrsDict[key]);
1003
+ }
1004
+ }
1005
+ }
1006
+ __name(_setTextAttrs, "_setTextAttrs");
1007
+ return function(conf2) {
1008
+ return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan;
1009
+ };
1010
+ }();
1011
+ var initGraphics = /* @__PURE__ */ __name(function(graphics) {
1012
+ graphics.append("defs").append("marker").attr("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");
1013
+ }, "initGraphics");
1014
+ var svgDraw_default = {
1015
+ drawRect: drawRect2,
1016
+ drawCircle,
1017
+ drawSection,
1018
+ drawText: drawText2,
1019
+ drawLabel,
1020
+ drawTask,
1021
+ drawBackgroundRect: drawBackgroundRect2,
1022
+ initGraphics
1023
+ };
1024
+ var setConf = /* @__PURE__ */ __name(function(cnf) {
1025
+ const keys = Object.keys(cnf);
1026
+ keys.forEach(function(key) {
1027
+ conf[key] = cnf[key];
1028
+ });
1029
+ }, "setConf");
1030
+ var actors = {};
1031
+ function drawActorLegend(diagram2) {
1032
+ const conf2 = getConfig2().journey;
1033
+ let yPos = 60;
1034
+ Object.keys(actors).forEach((person) => {
1035
+ const colour = actors[person].color;
1036
+ const circleData = {
1037
+ cx: 20,
1038
+ cy: yPos,
1039
+ r: 7,
1040
+ fill: colour,
1041
+ stroke: "#000",
1042
+ pos: actors[person].position
1043
+ };
1044
+ svgDraw_default.drawCircle(diagram2, circleData);
1045
+ const labelData = {
1046
+ x: 40,
1047
+ y: yPos + 7,
1048
+ fill: "#666",
1049
+ text: person,
1050
+ textMargin: conf2.boxTextMargin | 5
1051
+ };
1052
+ svgDraw_default.drawText(diagram2, labelData);
1053
+ yPos += 20;
1054
+ });
1055
+ }
1056
+ __name(drawActorLegend, "drawActorLegend");
1057
+ var conf = getConfig2().journey;
1058
+ var LEFT_MARGIN = conf.leftMargin;
1059
+ var draw = /* @__PURE__ */ __name(function(text, id, version, diagObj) {
1060
+ const conf2 = getConfig2().journey;
1061
+ const securityLevel = getConfig2().securityLevel;
1062
+ let sandboxElement;
1063
+ if (securityLevel === "sandbox") {
1064
+ sandboxElement = select_default("#i" + id);
1065
+ }
1066
+ const root = securityLevel === "sandbox" ? select_default(sandboxElement.nodes()[0].contentDocument.body) : select_default("body");
1067
+ bounds.init();
1068
+ const diagram2 = root.select("#" + id);
1069
+ svgDraw_default.initGraphics(diagram2);
1070
+ const tasks2 = diagObj.db.getTasks();
1071
+ const title = diagObj.db.getDiagramTitle();
1072
+ const actorNames = diagObj.db.getActors();
1073
+ for (const member in actors) {
1074
+ delete actors[member];
1075
+ }
1076
+ let actorPos = 0;
1077
+ actorNames.forEach((actorName) => {
1078
+ actors[actorName] = {
1079
+ color: conf2.actorColours[actorPos % conf2.actorColours.length],
1080
+ position: actorPos
1081
+ };
1082
+ actorPos++;
1083
+ });
1084
+ drawActorLegend(diagram2);
1085
+ bounds.insert(0, 0, LEFT_MARGIN, Object.keys(actors).length * 50);
1086
+ drawTasks(diagram2, tasks2, 0);
1087
+ const box = bounds.getBounds();
1088
+ if (title) {
1089
+ diagram2.append("text").text(title).attr("x", LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 25);
1090
+ }
1091
+ const height = box.stopy - box.starty + 2 * conf2.diagramMarginY;
1092
+ const width = LEFT_MARGIN + box.stopx + 2 * conf2.diagramMarginX;
1093
+ configureSvgSize(diagram2, height, width, conf2.useMaxWidth);
1094
+ diagram2.append("line").attr("x1", LEFT_MARGIN).attr("y1", conf2.height * 4).attr("x2", width - LEFT_MARGIN - 4).attr("y2", conf2.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)");
1095
+ const extraVertForTitle = title ? 70 : 0;
1096
+ diagram2.attr("viewBox", `${box.startx} -25 ${width} ${height + extraVertForTitle}`);
1097
+ diagram2.attr("preserveAspectRatio", "xMinYMin meet");
1098
+ diagram2.attr("height", height + extraVertForTitle + 25);
1099
+ }, "draw");
1100
+ var bounds = {
1101
+ data: {
1102
+ startx: void 0,
1103
+ stopx: void 0,
1104
+ starty: void 0,
1105
+ stopy: void 0
1106
+ },
1107
+ verticalPos: 0,
1108
+ sequenceItems: [],
1109
+ init: /* @__PURE__ */ __name(function() {
1110
+ this.sequenceItems = [];
1111
+ this.data = {
1112
+ startx: void 0,
1113
+ stopx: void 0,
1114
+ starty: void 0,
1115
+ stopy: void 0
1116
+ };
1117
+ this.verticalPos = 0;
1118
+ }, "init"),
1119
+ updateVal: /* @__PURE__ */ __name(function(obj, key, val, fun) {
1120
+ if (obj[key] === void 0) {
1121
+ obj[key] = val;
1122
+ } else {
1123
+ obj[key] = fun(val, obj[key]);
1124
+ }
1125
+ }, "updateVal"),
1126
+ updateBounds: /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) {
1127
+ const conf2 = getConfig2().journey;
1128
+ const _self = this;
1129
+ let cnt = 0;
1130
+ function updateFn(type) {
1131
+ return /* @__PURE__ */ __name(function updateItemBounds(item) {
1132
+ cnt++;
1133
+ const n = _self.sequenceItems.length - cnt + 1;
1134
+ _self.updateVal(item, "starty", starty - n * conf2.boxMargin, Math.min);
1135
+ _self.updateVal(item, "stopy", stopy + n * conf2.boxMargin, Math.max);
1136
+ _self.updateVal(bounds.data, "startx", startx - n * conf2.boxMargin, Math.min);
1137
+ _self.updateVal(bounds.data, "stopx", stopx + n * conf2.boxMargin, Math.max);
1138
+ if (!(type === "activation")) {
1139
+ _self.updateVal(item, "startx", startx - n * conf2.boxMargin, Math.min);
1140
+ _self.updateVal(item, "stopx", stopx + n * conf2.boxMargin, Math.max);
1141
+ _self.updateVal(bounds.data, "starty", starty - n * conf2.boxMargin, Math.min);
1142
+ _self.updateVal(bounds.data, "stopy", stopy + n * conf2.boxMargin, Math.max);
1143
+ }
1144
+ }, "updateItemBounds");
1145
+ }
1146
+ __name(updateFn, "updateFn");
1147
+ this.sequenceItems.forEach(updateFn());
1148
+ }, "updateBounds"),
1149
+ insert: /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) {
1150
+ const _startx = Math.min(startx, stopx);
1151
+ const _stopx = Math.max(startx, stopx);
1152
+ const _starty = Math.min(starty, stopy);
1153
+ const _stopy = Math.max(starty, stopy);
1154
+ this.updateVal(bounds.data, "startx", _startx, Math.min);
1155
+ this.updateVal(bounds.data, "starty", _starty, Math.min);
1156
+ this.updateVal(bounds.data, "stopx", _stopx, Math.max);
1157
+ this.updateVal(bounds.data, "stopy", _stopy, Math.max);
1158
+ this.updateBounds(_startx, _starty, _stopx, _stopy);
1159
+ }, "insert"),
1160
+ bumpVerticalPos: /* @__PURE__ */ __name(function(bump) {
1161
+ this.verticalPos = this.verticalPos + bump;
1162
+ this.data.stopy = this.verticalPos;
1163
+ }, "bumpVerticalPos"),
1164
+ getVerticalPos: /* @__PURE__ */ __name(function() {
1165
+ return this.verticalPos;
1166
+ }, "getVerticalPos"),
1167
+ getBounds: /* @__PURE__ */ __name(function() {
1168
+ return this.data;
1169
+ }, "getBounds")
1170
+ };
1171
+ var fills = conf.sectionFills;
1172
+ var textColours = conf.sectionColours;
1173
+ var drawTasks = /* @__PURE__ */ __name(function(diagram2, tasks2, verticalPos) {
1174
+ const conf2 = getConfig2().journey;
1175
+ let lastSection = "";
1176
+ const sectionVHeight = conf2.height * 2 + conf2.diagramMarginY;
1177
+ const taskPos = verticalPos + sectionVHeight;
1178
+ let sectionNumber = 0;
1179
+ let fill = "#CCC";
1180
+ let colour = "black";
1181
+ let num = 0;
1182
+ for (const [i, task] of tasks2.entries()) {
1183
+ if (lastSection !== task.section) {
1184
+ fill = fills[sectionNumber % fills.length];
1185
+ num = sectionNumber % fills.length;
1186
+ colour = textColours[sectionNumber % textColours.length];
1187
+ let taskInSectionCount = 0;
1188
+ const currentSection2 = task.section;
1189
+ for (let taskIndex = i; taskIndex < tasks2.length; taskIndex++) {
1190
+ if (tasks2[taskIndex].section == currentSection2) {
1191
+ taskInSectionCount = taskInSectionCount + 1;
1192
+ } else {
1193
+ break;
1194
+ }
1195
+ }
1196
+ const section = {
1197
+ x: i * conf2.taskMargin + i * conf2.width + LEFT_MARGIN,
1198
+ y: 50,
1199
+ text: task.section,
1200
+ fill,
1201
+ num,
1202
+ colour,
1203
+ taskCount: taskInSectionCount
1204
+ };
1205
+ svgDraw_default.drawSection(diagram2, section, conf2);
1206
+ lastSection = task.section;
1207
+ sectionNumber++;
1208
+ }
1209
+ const taskActors = task.people.reduce((acc, actorName) => {
1210
+ if (actors[actorName]) {
1211
+ acc[actorName] = actors[actorName];
1212
+ }
1213
+ return acc;
1214
+ }, {});
1215
+ task.x = i * conf2.taskMargin + i * conf2.width + LEFT_MARGIN;
1216
+ task.y = taskPos;
1217
+ task.width = conf2.diagramMarginX;
1218
+ task.height = conf2.diagramMarginY;
1219
+ task.colour = colour;
1220
+ task.fill = fill;
1221
+ task.num = num;
1222
+ task.actors = taskActors;
1223
+ svgDraw_default.drawTask(diagram2, task, conf2);
1224
+ bounds.insert(task.x, task.y, task.x + task.width + conf2.taskMargin, 300 + 5 * 30);
1225
+ }
1226
+ }, "drawTasks");
1227
+ var journeyRenderer_default = {
1228
+ setConf,
1229
+ draw
1230
+ };
1231
+ var diagram = {
1232
+ parser: journey_default,
1233
+ db: journeyDb_default,
1234
+ renderer: journeyRenderer_default,
1235
+ styles: styles_default,
1236
+ init: /* @__PURE__ */ __name((cnf) => {
1237
+ journeyRenderer_default.setConf(cnf.journey);
1238
+ journeyDb_default.clear();
1239
+ }, "init")
1240
+ };
1241
+ export {
1242
+ diagram
1243
+ };
1244
+ //# sourceMappingURL=journeyDiagram-G5WM74LC-RVKMRGRW.js.map