whipped 0.8.0 → 0.9.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 (86) hide show
  1. package/dist/cli.js +1294 -259
  2. package/dist/mcp-server.js +150 -2
  3. package/dist/migrations/014_companion_sessions.sql +34 -0
  4. package/dist/migrations/015_companion_worktree_mode.sql +45 -0
  5. package/dist/migrations/016_companion_plans.sql +22 -0
  6. package/dist/migrations/017_companion_saved_plans.sql +23 -0
  7. package/dist/migrations/018_generalize_plan_session_ref.sql +29 -0
  8. package/dist/migrations/019_rename_plan_to_canvas.sql +20 -0
  9. package/dist/web-ui/assets/abnfDiagram-VRR7QNED-RwOyl_Kz.js +119 -0
  10. package/dist/web-ui/assets/arc-DmDBHE0H.js +131 -0
  11. package/dist/web-ui/assets/architectureDiagram-ZJ3FMSHR-RTwadm6J.js +8821 -0
  12. package/dist/web-ui/assets/blockDiagram-677ZJIJ3-Dvv5uMUE.js +3801 -0
  13. package/dist/web-ui/assets/c4Diagram-LMCZKHZV-bvr9R9cD.js +2479 -0
  14. package/dist/web-ui/assets/channel-BGhlETgZ.js +7 -0
  15. package/dist/web-ui/assets/chunk-2Q5K7J3B-BRq-Qbau.js +17 -0
  16. package/dist/web-ui/assets/chunk-32BRIVSS-Dy1BUZGx.js +116 -0
  17. package/dist/web-ui/assets/chunk-5VM5RSS4-DCUiIwIc.js +19 -0
  18. package/dist/web-ui/assets/chunk-EX3LRPZG-Cg_Vtzwz.js +1996 -0
  19. package/dist/web-ui/assets/chunk-JWPE2WC7-BW4n_ZhH.js +17 -0
  20. package/dist/web-ui/assets/chunk-MOJQB5TN-BykRa615.js +855 -0
  21. package/dist/web-ui/assets/chunk-RYQCIY6F-D4F7oV1d.js +476 -0
  22. package/dist/web-ui/assets/chunk-V7JOEXUC-DD4mm30h.js +2022 -0
  23. package/dist/web-ui/assets/chunk-VR4S4FIN-Fgvcluvk.js +25 -0
  24. package/dist/web-ui/assets/chunk-XXDRQBXY-C4FVmO5r.js +13 -0
  25. package/dist/web-ui/assets/classDiagram-OUVF2IWQ-DD4KIYF1.js +24 -0
  26. package/dist/web-ui/assets/classDiagram-v2-EOCWNBFH-DD4KIYF1.js +24 -0
  27. package/dist/web-ui/assets/cose-bilkent-JH36ORCC-ekFwvYt9.js +4943 -0
  28. package/dist/web-ui/assets/cynefin-VYW2F7L2-DTNV7gvQ.js +31527 -0
  29. package/dist/web-ui/assets/cynefinDiagram-TSTJHNR4-koYialeC.js +454 -0
  30. package/dist/web-ui/assets/cytoscape.esm-CaQ7Fomf.js +30346 -0
  31. package/dist/web-ui/assets/dagre-VKFMJZFB-Do43FV3o.js +526 -0
  32. package/dist/web-ui/assets/defaultLocale-B2RvLBDe.js +206 -0
  33. package/dist/web-ui/assets/diagram-FQU43EPY-D0STdny6.js +636 -0
  34. package/dist/web-ui/assets/diagram-G47NLZAW-D9g6BdZT.js +858 -0
  35. package/dist/web-ui/assets/diagram-NH7WQ7WH-zLW6CAmi.js +212 -0
  36. package/dist/web-ui/assets/diagram-OA4YK3LP-CA5tvsYw.js +492 -0
  37. package/dist/web-ui/assets/diagram-WEI45ONY-CLmYUHR0.js +309 -0
  38. package/dist/web-ui/assets/ebnfDiagram-CCIWWBDH-KkHubBI6.js +139 -0
  39. package/dist/web-ui/assets/erDiagram-Q63AITRT-BJna2u1n.js +1238 -0
  40. package/dist/web-ui/assets/flowDiagram-23GEKE2U-DVJKalah.js +2353 -0
  41. package/dist/web-ui/assets/ganttDiagram-NO4QXBWP-D9HwNV4u.js +3733 -0
  42. package/dist/web-ui/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  43. package/dist/web-ui/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  44. package/dist/web-ui/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  45. package/dist/web-ui/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  46. package/dist/web-ui/assets/geist-mono-cyrillic-ext-wght-normal-I4S5GZfc.woff2 +0 -0
  47. package/dist/web-ui/assets/geist-mono-cyrillic-wght-normal-BmXc_FBt.woff2 +0 -0
  48. package/dist/web-ui/assets/geist-mono-latin-ext-wght-normal-DrnZ1wKl.woff2 +0 -0
  49. package/dist/web-ui/assets/geist-mono-latin-wght-normal-B_7UjwxQ.woff2 +0 -0
  50. package/dist/web-ui/assets/geist-mono-symbols2-wght-normal-GZpp1pK2.woff2 +0 -0
  51. package/dist/web-ui/assets/geist-mono-vietnamese-wght-normal-D8KDMBhC.woff2 +0 -0
  52. package/dist/web-ui/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  53. package/dist/web-ui/assets/gitGraphDiagram-IHSO6WYX-B7wnoO0J.js +1385 -0
  54. package/dist/web-ui/assets/graph-BMLV0goG.js +2042 -0
  55. package/dist/web-ui/assets/{index-CRXPsGTP.css → index-DPjATOCj.css} +800 -1207
  56. package/dist/web-ui/assets/{index-CuGz83Sg.js → index-DZ7I8r_C.js} +41629 -39831
  57. package/dist/web-ui/assets/infoDiagram-FWYZ7A6U-BY6XoiF8.js +32 -0
  58. package/dist/web-ui/assets/init-ZxktEp_H.js +16 -0
  59. package/dist/web-ui/assets/ishikawaDiagram-FXEZZL3T-BaZVnO8j.js +967 -0
  60. package/dist/web-ui/assets/journeyDiagram-5HDEW3XC-CUA6DUAQ.js +1256 -0
  61. package/dist/web-ui/assets/kanban-definition-HUTT4EX6-5W5tiWrd.js +1055 -0
  62. package/dist/web-ui/assets/katex-CqNtglxf.js +14499 -0
  63. package/dist/web-ui/assets/layout-BNmRhaUB.js +2359 -0
  64. package/dist/web-ui/assets/linear-CfvGIyDE.js +340 -0
  65. package/dist/web-ui/assets/map-BEO0Bu8q.js +298 -0
  66. package/dist/web-ui/assets/mermaid.core-BRk3IzY2.js +26639 -0
  67. package/dist/web-ui/assets/mindmap-definition-LN4V7U3C-2GmLg6ou.js +1183 -0
  68. package/dist/web-ui/assets/ordinal-DSZU4PqD.js +76 -0
  69. package/dist/web-ui/assets/pegDiagram-2B236MQR-gTEdrkJg.js +127 -0
  70. package/dist/web-ui/assets/pieDiagram-ENE6RG2P-CYXjIhqC.js +318 -0
  71. package/dist/web-ui/assets/quadrantDiagram-ABIIQ3AL-BStRZxwf.js +1341 -0
  72. package/dist/web-ui/assets/railroadDiagram-RFXS5EU6-btveDRG2.js +93 -0
  73. package/dist/web-ui/assets/requirementDiagram-TGXJPOKE-Cy_155rE.js +1205 -0
  74. package/dist/web-ui/assets/sankeyDiagram-HTMAVEWB-Chtvw3_G.js +1264 -0
  75. package/dist/web-ui/assets/sequenceDiagram-DBY2YBRQ-DDuMVEX1.js +4523 -0
  76. package/dist/web-ui/assets/sizeCapture-X5ZJPWSS-Bylf0o6J.js +64 -0
  77. package/dist/web-ui/assets/stateDiagram-2N3HPSRC-DIzLeR5G.js +453 -0
  78. package/dist/web-ui/assets/stateDiagram-v2-6OUMAXLB-zG_WjT1-.js +23 -0
  79. package/dist/web-ui/assets/swimlanes-5IMT3BWC-TKaCmVta.js +8575 -0
  80. package/dist/web-ui/assets/swimlanesDiagram-G3AALYLV-C5eB3qqS.js +21 -0
  81. package/dist/web-ui/assets/timeline-definition-FHXFAJF6-CC5Ujpcu.js +1606 -0
  82. package/dist/web-ui/assets/vennDiagram-L72KCM5P-DUSVXSYT.js +2523 -0
  83. package/dist/web-ui/assets/wardleyDiagram-EHGQE667-CoP9xn89.js +978 -0
  84. package/dist/web-ui/assets/xychartDiagram-FW5EYKEG-B9FqP_kk.js +1972 -0
  85. package/dist/web-ui/index.html +2 -2
  86. package/package.json +14 -16
@@ -0,0 +1,1341 @@
1
+ var _a, _b;
2
+ import { s as setAccDescription, g as getAccDescription, o as getDiagramTitle, n as setDiagramTitle, a as getAccTitle, b as setAccTitle, _ as __name, c as getConfig2, l as log, d as select, e as configureSvgSize, p as clear, B as defaultConfig_default, i as sanitizeText, E as getThemeVariables3 } from "./mermaid.core-BRk3IzY2.js";
3
+ import { l as linear } from "./linear-CfvGIyDE.js";
4
+ import "./index-DZ7I8r_C.js";
5
+ import "./init-ZxktEp_H.js";
6
+ import "./defaultLocale-B2RvLBDe.js";
7
+ var parser = (function() {
8
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
9
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
10
+ return o2;
11
+ }, "o"), $V0 = [1, 3], $V1 = [1, 4], $V2 = [1, 5], $V3 = [1, 6], $V4 = [1, 7], $V5 = [1, 4, 5, 10, 12, 13, 14, 15, 18, 25, 35, 37, 39, 41, 42, 48, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 63, 64, 65, 66, 67], $V6 = [1, 4, 5, 10, 12, 13, 14, 15, 18, 25, 28, 35, 37, 39, 41, 42, 48, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 63, 64, 65, 66, 67], $V7 = [55, 56, 57], $V8 = [2, 36], $V9 = [1, 37], $Va = [1, 36], $Vb = [1, 38], $Vc = [1, 35], $Vd = [1, 43], $Ve = [1, 41], $Vf = [1, 45], $Vg = [1, 14], $Vh = [1, 23], $Vi = [1, 18], $Vj = [1, 19], $Vk = [1, 20], $Vl = [1, 21], $Vm = [1, 22], $Vn = [1, 24], $Vo = [1, 25], $Vp = [1, 26], $Vq = [1, 27], $Vr = [1, 28], $Vs = [1, 29], $Vt = [1, 32], $Vu = [1, 33], $Vv = [1, 34], $Vw = [1, 39], $Vx = [1, 40], $Vy = [1, 42], $Vz = [1, 44], $VA = [1, 63], $VB = [1, 62], $VC = [4, 5, 8, 10, 12, 13, 14, 15, 18, 44, 47, 49, 55, 56, 57, 63, 64, 65, 66, 67], $VD = [1, 66], $VE = [1, 67], $VF = [1, 68], $VG = [1, 69], $VH = [1, 70], $VI = [1, 71], $VJ = [1, 72], $VK = [1, 73], $VL = [1, 74], $VM = [1, 75], $VN = [1, 76], $VO = [1, 77], $VP = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18], $VQ = [1, 91], $VR = [1, 92], $VS = [1, 93], $VT = [1, 100], $VU = [1, 94], $VV = [1, 97], $VW = [1, 95], $VX = [1, 96], $VY = [1, 98], $VZ = [1, 99], $V_ = [1, 103], $V$ = [10, 55, 56, 57], $V01 = [4, 5, 6, 8, 10, 11, 13, 17, 18, 19, 20, 55, 56, 57];
12
+ var parser2 = {
13
+ trace: /* @__PURE__ */ __name(function trace() {
14
+ }, "trace"),
15
+ yy: {},
16
+ symbols_: { "error": 2, "idStringToken": 3, "ALPHA": 4, "NUM": 5, "NODE_STRING": 6, "DOWN": 7, "MINUS": 8, "DEFAULT": 9, "COMMA": 10, "COLON": 11, "AMP": 12, "BRKT": 13, "MULT": 14, "UNICODE_TEXT": 15, "styleComponent": 16, "UNIT": 17, "SPACE": 18, "STYLE": 19, "PCT": 20, "idString": 21, "style": 22, "stylesOpt": 23, "classDefStatement": 24, "CLASSDEF": 25, "start": 26, "eol": 27, "QUADRANT": 28, "document": 29, "line": 30, "statement": 31, "axisDetails": 32, "quadrantDetails": 33, "points": 34, "title": 35, "title_value": 36, "acc_title": 37, "acc_title_value": 38, "acc_descr": 39, "acc_descr_value": 40, "acc_descr_multiline_value": 41, "section": 42, "text": 43, "point_start": 44, "point_x": 45, "point_y": 46, "class_name": 47, "X-AXIS": 48, "AXIS-TEXT-DELIMITER": 49, "Y-AXIS": 50, "QUADRANT_1": 51, "QUADRANT_2": 52, "QUADRANT_3": 53, "QUADRANT_4": 54, "NEWLINE": 55, "SEMI": 56, "EOF": 57, "alphaNumToken": 58, "textNoTagsToken": 59, "STR": 60, "MD_STR": 61, "alphaNum": 62, "PUNCTUATION": 63, "PLUS": 64, "EQUALS": 65, "DOT": 66, "UNDERSCORE": 67, "$accept": 0, "$end": 1 },
17
+ terminals_: { 2: "error", 4: "ALPHA", 5: "NUM", 6: "NODE_STRING", 7: "DOWN", 8: "MINUS", 9: "DEFAULT", 10: "COMMA", 11: "COLON", 12: "AMP", 13: "BRKT", 14: "MULT", 15: "UNICODE_TEXT", 17: "UNIT", 18: "SPACE", 19: "STYLE", 20: "PCT", 25: "CLASSDEF", 28: "QUADRANT", 35: "title", 36: "title_value", 37: "acc_title", 38: "acc_title_value", 39: "acc_descr", 40: "acc_descr_value", 41: "acc_descr_multiline_value", 42: "section", 44: "point_start", 45: "point_x", 46: "point_y", 47: "class_name", 48: "X-AXIS", 49: "AXIS-TEXT-DELIMITER", 50: "Y-AXIS", 51: "QUADRANT_1", 52: "QUADRANT_2", 53: "QUADRANT_3", 54: "QUADRANT_4", 55: "NEWLINE", 56: "SEMI", 57: "EOF", 60: "STR", 61: "MD_STR", 63: "PUNCTUATION", 64: "PLUS", 65: "EQUALS", 66: "DOT", 67: "UNDERSCORE" },
18
+ productions_: [0, [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [21, 1], [21, 2], [22, 1], [22, 2], [23, 1], [23, 3], [24, 5], [26, 2], [26, 2], [26, 2], [29, 0], [29, 2], [30, 2], [31, 0], [31, 1], [31, 2], [31, 1], [31, 1], [31, 1], [31, 2], [31, 2], [31, 2], [31, 1], [31, 1], [34, 4], [34, 5], [34, 5], [34, 6], [32, 4], [32, 3], [32, 2], [32, 4], [32, 3], [32, 2], [33, 2], [33, 2], [33, 2], [33, 2], [27, 1], [27, 1], [27, 1], [43, 1], [43, 2], [43, 1], [43, 1], [62, 1], [62, 2], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [59, 1], [59, 1], [59, 1]],
19
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
20
+ var $0 = $$.length - 1;
21
+ switch (yystate) {
22
+ case 23:
23
+ this.$ = $$[$0];
24
+ break;
25
+ case 24:
26
+ this.$ = $$[$0 - 1] + "" + $$[$0];
27
+ break;
28
+ case 26:
29
+ this.$ = $$[$0 - 1] + $$[$0];
30
+ break;
31
+ case 27:
32
+ this.$ = [$$[$0].trim()];
33
+ break;
34
+ case 28:
35
+ $$[$0 - 2].push($$[$0].trim());
36
+ this.$ = $$[$0 - 2];
37
+ break;
38
+ case 29:
39
+ this.$ = $$[$0 - 4];
40
+ yy.addClass($$[$0 - 2], $$[$0]);
41
+ break;
42
+ case 37:
43
+ this.$ = [];
44
+ break;
45
+ case 42:
46
+ this.$ = $$[$0].trim();
47
+ yy.setDiagramTitle(this.$);
48
+ break;
49
+ case 43:
50
+ this.$ = $$[$0].trim();
51
+ yy.setAccTitle(this.$);
52
+ break;
53
+ case 44:
54
+ case 45:
55
+ this.$ = $$[$0].trim();
56
+ yy.setAccDescription(this.$);
57
+ break;
58
+ case 46:
59
+ yy.addSection($$[$0].substr(8));
60
+ this.$ = $$[$0].substr(8);
61
+ break;
62
+ case 47:
63
+ yy.addPoint($$[$0 - 3], "", $$[$0 - 1], $$[$0], []);
64
+ break;
65
+ case 48:
66
+ yy.addPoint($$[$0 - 4], $$[$0 - 3], $$[$0 - 1], $$[$0], []);
67
+ break;
68
+ case 49:
69
+ yy.addPoint($$[$0 - 4], "", $$[$0 - 2], $$[$0 - 1], $$[$0]);
70
+ break;
71
+ case 50:
72
+ yy.addPoint($$[$0 - 5], $$[$0 - 4], $$[$0 - 2], $$[$0 - 1], $$[$0]);
73
+ break;
74
+ case 51:
75
+ yy.setXAxisLeftText($$[$0 - 2]);
76
+ yy.setXAxisRightText($$[$0]);
77
+ break;
78
+ case 52:
79
+ $$[$0 - 1].text += " ⟶ ";
80
+ yy.setXAxisLeftText($$[$0 - 1]);
81
+ break;
82
+ case 53:
83
+ yy.setXAxisLeftText($$[$0]);
84
+ break;
85
+ case 54:
86
+ yy.setYAxisBottomText($$[$0 - 2]);
87
+ yy.setYAxisTopText($$[$0]);
88
+ break;
89
+ case 55:
90
+ $$[$0 - 1].text += " ⟶ ";
91
+ yy.setYAxisBottomText($$[$0 - 1]);
92
+ break;
93
+ case 56:
94
+ yy.setYAxisBottomText($$[$0]);
95
+ break;
96
+ case 57:
97
+ yy.setQuadrant1Text($$[$0]);
98
+ break;
99
+ case 58:
100
+ yy.setQuadrant2Text($$[$0]);
101
+ break;
102
+ case 59:
103
+ yy.setQuadrant3Text($$[$0]);
104
+ break;
105
+ case 60:
106
+ yy.setQuadrant4Text($$[$0]);
107
+ break;
108
+ case 64:
109
+ this.$ = { text: $$[$0], type: "text" };
110
+ break;
111
+ case 65:
112
+ this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type };
113
+ break;
114
+ case 66:
115
+ this.$ = { text: $$[$0], type: "text" };
116
+ break;
117
+ case 67:
118
+ this.$ = { text: $$[$0], type: "markdown" };
119
+ break;
120
+ case 68:
121
+ this.$ = $$[$0];
122
+ break;
123
+ case 69:
124
+ this.$ = $$[$0 - 1] + "" + $$[$0];
125
+ break;
126
+ }
127
+ }, "anonymous"),
128
+ table: [{ 18: $V0, 26: 1, 27: 2, 28: $V1, 55: $V2, 56: $V3, 57: $V4 }, { 1: [3] }, { 18: $V0, 26: 8, 27: 2, 28: $V1, 55: $V2, 56: $V3, 57: $V4 }, { 18: $V0, 26: 9, 27: 2, 28: $V1, 55: $V2, 56: $V3, 57: $V4 }, o($V5, [2, 33], { 29: 10 }), o($V6, [2, 61]), o($V6, [2, 62]), o($V6, [2, 63]), { 1: [2, 30] }, { 1: [2, 31] }, o($V7, $V8, { 30: 11, 31: 12, 24: 13, 32: 15, 33: 16, 34: 17, 43: 30, 58: 31, 1: [2, 32], 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 18: $Vg, 25: $Vh, 35: $Vi, 37: $Vj, 39: $Vk, 41: $Vl, 42: $Vm, 48: $Vn, 50: $Vo, 51: $Vp, 52: $Vq, 53: $Vr, 54: $Vs, 60: $Vt, 61: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }), o($V5, [2, 34]), { 27: 46, 55: $V2, 56: $V3, 57: $V4 }, o($V7, [2, 37]), o($V7, $V8, { 24: 13, 32: 15, 33: 16, 34: 17, 43: 30, 58: 31, 31: 47, 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 18: $Vg, 25: $Vh, 35: $Vi, 37: $Vj, 39: $Vk, 41: $Vl, 42: $Vm, 48: $Vn, 50: $Vo, 51: $Vp, 52: $Vq, 53: $Vr, 54: $Vs, 60: $Vt, 61: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }), o($V7, [2, 39]), o($V7, [2, 40]), o($V7, [2, 41]), { 36: [1, 48] }, { 38: [1, 49] }, { 40: [1, 50] }, o($V7, [2, 45]), o($V7, [2, 46]), { 18: [1, 51] }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 43: 52, 58: 31, 60: $Vt, 61: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 43: 53, 58: 31, 60: $Vt, 61: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 43: 54, 58: 31, 60: $Vt, 61: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 43: 55, 58: 31, 60: $Vt, 61: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 43: 56, 58: 31, 60: $Vt, 61: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 43: 57, 58: 31, 60: $Vt, 61: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }, { 4: $V9, 5: $Va, 8: $VA, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 18: $VB, 44: [1, 58], 47: [1, 59], 58: 61, 59: 60, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }, o($VC, [2, 64]), o($VC, [2, 66]), o($VC, [2, 67]), o($VC, [2, 70]), o($VC, [2, 71]), o($VC, [2, 72]), o($VC, [2, 73]), o($VC, [2, 74]), o($VC, [2, 75]), o($VC, [2, 76]), o($VC, [2, 77]), o($VC, [2, 78]), o($VC, [2, 79]), o($VC, [2, 80]), o($VC, [2, 81]), o($V5, [2, 35]), o($V7, [2, 38]), o($V7, [2, 42]), o($V7, [2, 43]), o($V7, [2, 44]), { 3: 65, 4: $VD, 5: $VE, 6: $VF, 7: $VG, 8: $VH, 9: $VI, 10: $VJ, 11: $VK, 12: $VL, 13: $VM, 14: $VN, 15: $VO, 21: 64 }, o($V7, [2, 53], { 59: 60, 58: 61, 4: $V9, 5: $Va, 8: $VA, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 18: $VB, 49: [1, 78], 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }), o($V7, [2, 56], { 59: 60, 58: 61, 4: $V9, 5: $Va, 8: $VA, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 18: $VB, 49: [1, 79], 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }), o($V7, [2, 57], { 59: 60, 58: 61, 4: $V9, 5: $Va, 8: $VA, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 18: $VB, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }), o($V7, [2, 58], { 59: 60, 58: 61, 4: $V9, 5: $Va, 8: $VA, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 18: $VB, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }), o($V7, [2, 59], { 59: 60, 58: 61, 4: $V9, 5: $Va, 8: $VA, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 18: $VB, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }), o($V7, [2, 60], { 59: 60, 58: 61, 4: $V9, 5: $Va, 8: $VA, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 18: $VB, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }), { 45: [1, 80] }, { 44: [1, 81] }, o($VC, [2, 65]), o($VC, [2, 82]), o($VC, [2, 83]), o($VC, [2, 84]), { 3: 83, 4: $VD, 5: $VE, 6: $VF, 7: $VG, 8: $VH, 9: $VI, 10: $VJ, 11: $VK, 12: $VL, 13: $VM, 14: $VN, 15: $VO, 18: [1, 82] }, o($VP, [2, 23]), o($VP, [2, 1]), o($VP, [2, 2]), o($VP, [2, 3]), o($VP, [2, 4]), o($VP, [2, 5]), o($VP, [2, 6]), o($VP, [2, 7]), o($VP, [2, 8]), o($VP, [2, 9]), o($VP, [2, 10]), o($VP, [2, 11]), o($VP, [2, 12]), o($V7, [2, 52], { 58: 31, 43: 84, 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 60: $Vt, 61: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }), o($V7, [2, 55], { 58: 31, 43: 85, 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 60: $Vt, 61: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }), { 46: [1, 86] }, { 45: [1, 87] }, { 4: $VQ, 5: $VR, 6: $VS, 8: $VT, 11: $VU, 13: $VV, 16: 90, 17: $VW, 18: $VX, 19: $VY, 20: $VZ, 22: 89, 23: 88 }, o($VP, [2, 24]), o($V7, [2, 51], { 59: 60, 58: 61, 4: $V9, 5: $Va, 8: $VA, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 18: $VB, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }), o($V7, [2, 54], { 59: 60, 58: 61, 4: $V9, 5: $Va, 8: $VA, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 15: $Vf, 18: $VB, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz }), o($V7, [2, 47], { 22: 89, 16: 90, 23: 101, 4: $VQ, 5: $VR, 6: $VS, 8: $VT, 11: $VU, 13: $VV, 17: $VW, 18: $VX, 19: $VY, 20: $VZ }), { 46: [1, 102] }, o($V7, [2, 29], { 10: $V_ }), o($V$, [2, 27], { 16: 104, 4: $VQ, 5: $VR, 6: $VS, 8: $VT, 11: $VU, 13: $VV, 17: $VW, 18: $VX, 19: $VY, 20: $VZ }), o($V01, [2, 25]), o($V01, [2, 13]), o($V01, [2, 14]), o($V01, [2, 15]), o($V01, [2, 16]), o($V01, [2, 17]), o($V01, [2, 18]), o($V01, [2, 19]), o($V01, [2, 20]), o($V01, [2, 21]), o($V01, [2, 22]), o($V7, [2, 49], { 10: $V_ }), o($V7, [2, 48], { 22: 89, 16: 90, 23: 105, 4: $VQ, 5: $VR, 6: $VS, 8: $VT, 11: $VU, 13: $VV, 17: $VW, 18: $VX, 19: $VY, 20: $VZ }), { 4: $VQ, 5: $VR, 6: $VS, 8: $VT, 11: $VU, 13: $VV, 16: 90, 17: $VW, 18: $VX, 19: $VY, 20: $VZ, 22: 106 }, o($V01, [2, 26]), o($V7, [2, 50], { 10: $V_ }), o($V$, [2, 28], { 16: 104, 4: $VQ, 5: $VR, 6: $VS, 8: $VT, 11: $VU, 13: $VV, 17: $VW, 18: $VX, 19: $VY, 20: $VZ })],
129
+ defaultActions: { 8: [2, 30], 9: [2, 31] },
130
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
131
+ if (hash.recoverable) {
132
+ this.trace(str);
133
+ } else {
134
+ var error = new Error(str);
135
+ error.hash = hash;
136
+ throw error;
137
+ }
138
+ }, "parseError"),
139
+ parse: /* @__PURE__ */ __name(function parse(input) {
140
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
141
+ var args = lstack.slice.call(arguments, 1);
142
+ var lexer2 = Object.create(this.lexer);
143
+ var sharedState = { yy: {} };
144
+ for (var k in this.yy) {
145
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
146
+ sharedState.yy[k] = this.yy[k];
147
+ }
148
+ }
149
+ lexer2.setInput(input, sharedState.yy);
150
+ sharedState.yy.lexer = lexer2;
151
+ sharedState.yy.parser = this;
152
+ if (typeof lexer2.yylloc == "undefined") {
153
+ lexer2.yylloc = {};
154
+ }
155
+ var yyloc = lexer2.yylloc;
156
+ lstack.push(yyloc);
157
+ var ranges = lexer2.options && lexer2.options.ranges;
158
+ if (typeof sharedState.yy.parseError === "function") {
159
+ this.parseError = sharedState.yy.parseError;
160
+ } else {
161
+ this.parseError = Object.getPrototypeOf(this).parseError;
162
+ }
163
+ function popStack(n) {
164
+ stack.length = stack.length - 2 * n;
165
+ vstack.length = vstack.length - n;
166
+ lstack.length = lstack.length - n;
167
+ }
168
+ __name(popStack, "popStack");
169
+ function lex() {
170
+ var token;
171
+ token = tstack.pop() || lexer2.lex() || EOF;
172
+ if (typeof token !== "number") {
173
+ if (token instanceof Array) {
174
+ tstack = token;
175
+ token = tstack.pop();
176
+ }
177
+ token = self.symbols_[token] || token;
178
+ }
179
+ return token;
180
+ }
181
+ __name(lex, "lex");
182
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
183
+ while (true) {
184
+ state = stack[stack.length - 1];
185
+ if (this.defaultActions[state]) {
186
+ action = this.defaultActions[state];
187
+ } else {
188
+ if (symbol === null || typeof symbol == "undefined") {
189
+ symbol = lex();
190
+ }
191
+ action = table[state] && table[state][symbol];
192
+ }
193
+ if (typeof action === "undefined" || !action.length || !action[0]) {
194
+ var errStr = "";
195
+ expected = [];
196
+ for (p in table[state]) {
197
+ if (this.terminals_[p] && p > TERROR) {
198
+ expected.push("'" + this.terminals_[p] + "'");
199
+ }
200
+ }
201
+ if (lexer2.showPosition) {
202
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
203
+ } else {
204
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
205
+ }
206
+ this.parseError(errStr, {
207
+ text: lexer2.match,
208
+ token: this.terminals_[symbol] || symbol,
209
+ line: lexer2.yylineno,
210
+ loc: yyloc,
211
+ expected
212
+ });
213
+ }
214
+ if (action[0] instanceof Array && action.length > 1) {
215
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
216
+ }
217
+ switch (action[0]) {
218
+ case 1:
219
+ stack.push(symbol);
220
+ vstack.push(lexer2.yytext);
221
+ lstack.push(lexer2.yylloc);
222
+ stack.push(action[1]);
223
+ symbol = null;
224
+ {
225
+ yyleng = lexer2.yyleng;
226
+ yytext = lexer2.yytext;
227
+ yylineno = lexer2.yylineno;
228
+ yyloc = lexer2.yylloc;
229
+ }
230
+ break;
231
+ case 2:
232
+ len = this.productions_[action[1]][1];
233
+ yyval.$ = vstack[vstack.length - len];
234
+ yyval._$ = {
235
+ first_line: lstack[lstack.length - (len || 1)].first_line,
236
+ last_line: lstack[lstack.length - 1].last_line,
237
+ first_column: lstack[lstack.length - (len || 1)].first_column,
238
+ last_column: lstack[lstack.length - 1].last_column
239
+ };
240
+ if (ranges) {
241
+ yyval._$.range = [
242
+ lstack[lstack.length - (len || 1)].range[0],
243
+ lstack[lstack.length - 1].range[1]
244
+ ];
245
+ }
246
+ r = this.performAction.apply(yyval, [
247
+ yytext,
248
+ yyleng,
249
+ yylineno,
250
+ sharedState.yy,
251
+ action[1],
252
+ vstack,
253
+ lstack
254
+ ].concat(args));
255
+ if (typeof r !== "undefined") {
256
+ return r;
257
+ }
258
+ if (len) {
259
+ stack = stack.slice(0, -1 * len * 2);
260
+ vstack = vstack.slice(0, -1 * len);
261
+ lstack = lstack.slice(0, -1 * len);
262
+ }
263
+ stack.push(this.productions_[action[1]][0]);
264
+ vstack.push(yyval.$);
265
+ lstack.push(yyval._$);
266
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
267
+ stack.push(newState);
268
+ break;
269
+ case 3:
270
+ return true;
271
+ }
272
+ }
273
+ return true;
274
+ }, "parse")
275
+ };
276
+ var lexer = /* @__PURE__ */ (function() {
277
+ var lexer2 = {
278
+ EOF: 1,
279
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
280
+ if (this.yy.parser) {
281
+ this.yy.parser.parseError(str, hash);
282
+ } else {
283
+ throw new Error(str);
284
+ }
285
+ }, "parseError"),
286
+ // resets the lexer, sets new input
287
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
288
+ this.yy = yy || this.yy || {};
289
+ this._input = input;
290
+ this._more = this._backtrack = this.done = false;
291
+ this.yylineno = this.yyleng = 0;
292
+ this.yytext = this.matched = this.match = "";
293
+ this.conditionStack = ["INITIAL"];
294
+ this.yylloc = {
295
+ first_line: 1,
296
+ first_column: 0,
297
+ last_line: 1,
298
+ last_column: 0
299
+ };
300
+ if (this.options.ranges) {
301
+ this.yylloc.range = [0, 0];
302
+ }
303
+ this.offset = 0;
304
+ return this;
305
+ }, "setInput"),
306
+ // consumes and returns one char from the input
307
+ input: /* @__PURE__ */ __name(function() {
308
+ var ch = this._input[0];
309
+ this.yytext += ch;
310
+ this.yyleng++;
311
+ this.offset++;
312
+ this.match += ch;
313
+ this.matched += ch;
314
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
315
+ if (lines) {
316
+ this.yylineno++;
317
+ this.yylloc.last_line++;
318
+ } else {
319
+ this.yylloc.last_column++;
320
+ }
321
+ if (this.options.ranges) {
322
+ this.yylloc.range[1]++;
323
+ }
324
+ this._input = this._input.slice(1);
325
+ return ch;
326
+ }, "input"),
327
+ // unshifts one char (or a string) into the input
328
+ unput: /* @__PURE__ */ __name(function(ch) {
329
+ var len = ch.length;
330
+ var lines = ch.split(/(?:\r\n?|\n)/g);
331
+ this._input = ch + this._input;
332
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
333
+ this.offset -= len;
334
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
335
+ this.match = this.match.substr(0, this.match.length - 1);
336
+ this.matched = this.matched.substr(0, this.matched.length - 1);
337
+ if (lines.length - 1) {
338
+ this.yylineno -= lines.length - 1;
339
+ }
340
+ var r = this.yylloc.range;
341
+ this.yylloc = {
342
+ first_line: this.yylloc.first_line,
343
+ last_line: this.yylineno + 1,
344
+ first_column: this.yylloc.first_column,
345
+ 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
346
+ };
347
+ if (this.options.ranges) {
348
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
349
+ }
350
+ this.yyleng = this.yytext.length;
351
+ return this;
352
+ }, "unput"),
353
+ // When called from action, caches matched text and appends it on next action
354
+ more: /* @__PURE__ */ __name(function() {
355
+ this._more = true;
356
+ return this;
357
+ }, "more"),
358
+ // 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.
359
+ reject: /* @__PURE__ */ __name(function() {
360
+ if (this.options.backtrack_lexer) {
361
+ this._backtrack = true;
362
+ } else {
363
+ 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(), {
364
+ text: "",
365
+ token: null,
366
+ line: this.yylineno
367
+ });
368
+ }
369
+ return this;
370
+ }, "reject"),
371
+ // retain first n characters of the match
372
+ less: /* @__PURE__ */ __name(function(n) {
373
+ this.unput(this.match.slice(n));
374
+ }, "less"),
375
+ // displays already matched input, i.e. for error messages
376
+ pastInput: /* @__PURE__ */ __name(function() {
377
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
378
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
379
+ }, "pastInput"),
380
+ // displays upcoming input, i.e. for error messages
381
+ upcomingInput: /* @__PURE__ */ __name(function() {
382
+ var next = this.match;
383
+ if (next.length < 20) {
384
+ next += this._input.substr(0, 20 - next.length);
385
+ }
386
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
387
+ }, "upcomingInput"),
388
+ // displays the character position where the lexing error occurred, i.e. for error messages
389
+ showPosition: /* @__PURE__ */ __name(function() {
390
+ var pre = this.pastInput();
391
+ var c = new Array(pre.length + 1).join("-");
392
+ return pre + this.upcomingInput() + "\n" + c + "^";
393
+ }, "showPosition"),
394
+ // test the lexed token: return FALSE when not a match, otherwise return token
395
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
396
+ var token, lines, backup;
397
+ if (this.options.backtrack_lexer) {
398
+ backup = {
399
+ yylineno: this.yylineno,
400
+ yylloc: {
401
+ first_line: this.yylloc.first_line,
402
+ last_line: this.last_line,
403
+ first_column: this.yylloc.first_column,
404
+ last_column: this.yylloc.last_column
405
+ },
406
+ yytext: this.yytext,
407
+ match: this.match,
408
+ matches: this.matches,
409
+ matched: this.matched,
410
+ yyleng: this.yyleng,
411
+ offset: this.offset,
412
+ _more: this._more,
413
+ _input: this._input,
414
+ yy: this.yy,
415
+ conditionStack: this.conditionStack.slice(0),
416
+ done: this.done
417
+ };
418
+ if (this.options.ranges) {
419
+ backup.yylloc.range = this.yylloc.range.slice(0);
420
+ }
421
+ }
422
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
423
+ if (lines) {
424
+ this.yylineno += lines.length;
425
+ }
426
+ this.yylloc = {
427
+ first_line: this.yylloc.last_line,
428
+ last_line: this.yylineno + 1,
429
+ first_column: this.yylloc.last_column,
430
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
431
+ };
432
+ this.yytext += match[0];
433
+ this.match += match[0];
434
+ this.matches = match;
435
+ this.yyleng = this.yytext.length;
436
+ if (this.options.ranges) {
437
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
438
+ }
439
+ this._more = false;
440
+ this._backtrack = false;
441
+ this._input = this._input.slice(match[0].length);
442
+ this.matched += match[0];
443
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
444
+ if (this.done && this._input) {
445
+ this.done = false;
446
+ }
447
+ if (token) {
448
+ return token;
449
+ } else if (this._backtrack) {
450
+ for (var k in backup) {
451
+ this[k] = backup[k];
452
+ }
453
+ return false;
454
+ }
455
+ return false;
456
+ }, "test_match"),
457
+ // return next match in input
458
+ next: /* @__PURE__ */ __name(function() {
459
+ if (this.done) {
460
+ return this.EOF;
461
+ }
462
+ if (!this._input) {
463
+ this.done = true;
464
+ }
465
+ var token, match, tempMatch, index;
466
+ if (!this._more) {
467
+ this.yytext = "";
468
+ this.match = "";
469
+ }
470
+ var rules = this._currentRules();
471
+ for (var i = 0; i < rules.length; i++) {
472
+ tempMatch = this._input.match(this.rules[rules[i]]);
473
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
474
+ match = tempMatch;
475
+ index = i;
476
+ if (this.options.backtrack_lexer) {
477
+ token = this.test_match(tempMatch, rules[i]);
478
+ if (token !== false) {
479
+ return token;
480
+ } else if (this._backtrack) {
481
+ match = false;
482
+ continue;
483
+ } else {
484
+ return false;
485
+ }
486
+ } else if (!this.options.flex) {
487
+ break;
488
+ }
489
+ }
490
+ }
491
+ if (match) {
492
+ token = this.test_match(match, rules[index]);
493
+ if (token !== false) {
494
+ return token;
495
+ }
496
+ return false;
497
+ }
498
+ if (this._input === "") {
499
+ return this.EOF;
500
+ } else {
501
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
502
+ text: "",
503
+ token: null,
504
+ line: this.yylineno
505
+ });
506
+ }
507
+ }, "next"),
508
+ // return next match that has a token
509
+ lex: /* @__PURE__ */ __name(function lex() {
510
+ var r = this.next();
511
+ if (r) {
512
+ return r;
513
+ } else {
514
+ return this.lex();
515
+ }
516
+ }, "lex"),
517
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
518
+ begin: /* @__PURE__ */ __name(function begin(condition) {
519
+ this.conditionStack.push(condition);
520
+ }, "begin"),
521
+ // pop the previously active lexer condition state off the condition stack
522
+ popState: /* @__PURE__ */ __name(function popState() {
523
+ var n = this.conditionStack.length - 1;
524
+ if (n > 0) {
525
+ return this.conditionStack.pop();
526
+ } else {
527
+ return this.conditionStack[0];
528
+ }
529
+ }, "popState"),
530
+ // produce the lexer rule set which is active for the currently active lexer condition state
531
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
532
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
533
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
534
+ } else {
535
+ return this.conditions["INITIAL"].rules;
536
+ }
537
+ }, "_currentRules"),
538
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
539
+ topState: /* @__PURE__ */ __name(function topState(n) {
540
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
541
+ if (n >= 0) {
542
+ return this.conditionStack[n];
543
+ } else {
544
+ return "INITIAL";
545
+ }
546
+ }, "topState"),
547
+ // alias for begin(condition)
548
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
549
+ this.begin(condition);
550
+ }, "pushState"),
551
+ // return the number of states currently on the stack
552
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
553
+ return this.conditionStack.length;
554
+ }, "stateStackSize"),
555
+ options: { "case-insensitive": true },
556
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
557
+ switch ($avoiding_name_collisions) {
558
+ case 0:
559
+ break;
560
+ case 1:
561
+ break;
562
+ case 2:
563
+ return 55;
564
+ case 3:
565
+ break;
566
+ case 4:
567
+ this.begin("title");
568
+ return 35;
569
+ case 5:
570
+ this.popState();
571
+ return "title_value";
572
+ case 6:
573
+ this.begin("acc_title");
574
+ return 37;
575
+ case 7:
576
+ this.popState();
577
+ return "acc_title_value";
578
+ case 8:
579
+ this.begin("acc_descr");
580
+ return 39;
581
+ case 9:
582
+ this.popState();
583
+ return "acc_descr_value";
584
+ case 10:
585
+ this.begin("acc_descr_multiline");
586
+ break;
587
+ case 11:
588
+ this.popState();
589
+ break;
590
+ case 12:
591
+ return "acc_descr_multiline_value";
592
+ case 13:
593
+ return 48;
594
+ case 14:
595
+ return 50;
596
+ case 15:
597
+ return 49;
598
+ case 16:
599
+ return 51;
600
+ case 17:
601
+ return 52;
602
+ case 18:
603
+ return 53;
604
+ case 19:
605
+ return 54;
606
+ case 20:
607
+ return 25;
608
+ case 21:
609
+ this.begin("md_string");
610
+ break;
611
+ case 22:
612
+ return "MD_STR";
613
+ case 23:
614
+ this.popState();
615
+ break;
616
+ case 24:
617
+ this.begin("string");
618
+ break;
619
+ case 25:
620
+ this.popState();
621
+ break;
622
+ case 26:
623
+ return "STR";
624
+ case 27:
625
+ this.begin("class_name");
626
+ break;
627
+ case 28:
628
+ this.popState();
629
+ return 47;
630
+ case 29:
631
+ this.begin("point_start");
632
+ return 44;
633
+ case 30:
634
+ this.begin("point_x");
635
+ return 45;
636
+ case 31:
637
+ this.popState();
638
+ break;
639
+ case 32:
640
+ this.popState();
641
+ this.begin("point_y");
642
+ break;
643
+ case 33:
644
+ this.popState();
645
+ return 46;
646
+ case 34:
647
+ return 28;
648
+ case 35:
649
+ return 4;
650
+ case 36:
651
+ return 15;
652
+ case 37:
653
+ return 11;
654
+ case 38:
655
+ return 64;
656
+ case 39:
657
+ return 10;
658
+ case 40:
659
+ return 65;
660
+ case 41:
661
+ return 65;
662
+ case 42:
663
+ return 14;
664
+ case 43:
665
+ return 13;
666
+ case 44:
667
+ return 67;
668
+ case 45:
669
+ return 66;
670
+ case 46:
671
+ return 12;
672
+ case 47:
673
+ return 8;
674
+ case 48:
675
+ return 5;
676
+ case 49:
677
+ return 18;
678
+ case 50:
679
+ return 56;
680
+ case 51:
681
+ return 63;
682
+ case 52:
683
+ return 57;
684
+ }
685
+ }, "anonymous"),
686
+ rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?: *x-axis *)/i, /^(?: *y-axis *)/i, /^(?: *--+> *)/i, /^(?: *quadrant-1 *)/i, /^(?: *quadrant-2 *)/i, /^(?: *quadrant-3 *)/i, /^(?: *quadrant-4 *)/i, /^(?:classDef\b)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?::::)/i, /^(?:^\w+)/i, /^(?:\s*:\s*\[\s*)/i, /^(?:(1)|(0(.\d+)?))/i, /^(?:\s*\] *)/i, /^(?:\s*,\s*)/i, /^(?:(1)|(0(.\d+)?))/i, /^(?: *quadrantChart *)/i, /^(?:[A-Za-z]+)/i, /^(?:[^\x00-\x7F]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s)/i, /^(?:;)/i, /^(?:[!"#$%&'*+,-.`?\\_/])/i, /^(?:$)/i],
687
+ conditions: { "class_name": { "rules": [28], "inclusive": false }, "point_y": { "rules": [33], "inclusive": false }, "point_x": { "rules": [32], "inclusive": false }, "point_start": { "rules": [30, 31], "inclusive": false }, "acc_descr_multiline": { "rules": [11, 12], "inclusive": false }, "acc_descr": { "rules": [9], "inclusive": false }, "acc_title": { "rules": [7], "inclusive": false }, "title": { "rules": [5], "inclusive": false }, "md_string": { "rules": [22, 23], "inclusive": false }, "string": { "rules": [25, 26], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 27, 29, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52], "inclusive": true } }
688
+ };
689
+ return lexer2;
690
+ })();
691
+ parser2.lexer = lexer;
692
+ function Parser() {
693
+ this.yy = {};
694
+ }
695
+ __name(Parser, "Parser");
696
+ Parser.prototype = parser2;
697
+ parser2.Parser = Parser;
698
+ return new Parser();
699
+ })();
700
+ parser.parser = parser;
701
+ var quadrant_default = parser;
702
+ var defaultThemeVariables = getThemeVariables3();
703
+ var QuadrantBuilder = (_a = class {
704
+ constructor() {
705
+ this.classes = /* @__PURE__ */ new Map();
706
+ this.config = this.getDefaultConfig();
707
+ this.themeConfig = this.getDefaultThemeConfig();
708
+ this.data = this.getDefaultData();
709
+ }
710
+ getDefaultData() {
711
+ return {
712
+ titleText: "",
713
+ quadrant1Text: "",
714
+ quadrant2Text: "",
715
+ quadrant3Text: "",
716
+ quadrant4Text: "",
717
+ xAxisLeftText: "",
718
+ xAxisRightText: "",
719
+ yAxisBottomText: "",
720
+ yAxisTopText: "",
721
+ points: []
722
+ };
723
+ }
724
+ getDefaultConfig() {
725
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
726
+ return {
727
+ showXAxis: true,
728
+ showYAxis: true,
729
+ showTitle: true,
730
+ chartHeight: ((_a2 = defaultConfig_default.quadrantChart) == null ? void 0 : _a2.chartWidth) || 500,
731
+ chartWidth: ((_b2 = defaultConfig_default.quadrantChart) == null ? void 0 : _b2.chartHeight) || 500,
732
+ titlePadding: ((_c = defaultConfig_default.quadrantChart) == null ? void 0 : _c.titlePadding) || 10,
733
+ titleFontSize: ((_d = defaultConfig_default.quadrantChart) == null ? void 0 : _d.titleFontSize) || 20,
734
+ quadrantPadding: ((_e = defaultConfig_default.quadrantChart) == null ? void 0 : _e.quadrantPadding) || 5,
735
+ xAxisLabelPadding: ((_f = defaultConfig_default.quadrantChart) == null ? void 0 : _f.xAxisLabelPadding) || 5,
736
+ yAxisLabelPadding: ((_g = defaultConfig_default.quadrantChart) == null ? void 0 : _g.yAxisLabelPadding) || 5,
737
+ xAxisLabelFontSize: ((_h = defaultConfig_default.quadrantChart) == null ? void 0 : _h.xAxisLabelFontSize) || 16,
738
+ yAxisLabelFontSize: ((_i = defaultConfig_default.quadrantChart) == null ? void 0 : _i.yAxisLabelFontSize) || 16,
739
+ quadrantLabelFontSize: ((_j = defaultConfig_default.quadrantChart) == null ? void 0 : _j.quadrantLabelFontSize) || 16,
740
+ quadrantTextTopPadding: ((_k = defaultConfig_default.quadrantChart) == null ? void 0 : _k.quadrantTextTopPadding) || 5,
741
+ pointTextPadding: ((_l = defaultConfig_default.quadrantChart) == null ? void 0 : _l.pointTextPadding) || 5,
742
+ pointLabelFontSize: ((_m = defaultConfig_default.quadrantChart) == null ? void 0 : _m.pointLabelFontSize) || 12,
743
+ pointRadius: ((_n = defaultConfig_default.quadrantChart) == null ? void 0 : _n.pointRadius) || 5,
744
+ xAxisPosition: ((_o = defaultConfig_default.quadrantChart) == null ? void 0 : _o.xAxisPosition) || "top",
745
+ yAxisPosition: ((_p = defaultConfig_default.quadrantChart) == null ? void 0 : _p.yAxisPosition) || "left",
746
+ quadrantInternalBorderStrokeWidth: ((_q = defaultConfig_default.quadrantChart) == null ? void 0 : _q.quadrantInternalBorderStrokeWidth) || 1,
747
+ quadrantExternalBorderStrokeWidth: ((_r = defaultConfig_default.quadrantChart) == null ? void 0 : _r.quadrantExternalBorderStrokeWidth) || 2
748
+ };
749
+ }
750
+ getDefaultThemeConfig() {
751
+ return {
752
+ quadrant1Fill: defaultThemeVariables.quadrant1Fill,
753
+ quadrant2Fill: defaultThemeVariables.quadrant2Fill,
754
+ quadrant3Fill: defaultThemeVariables.quadrant3Fill,
755
+ quadrant4Fill: defaultThemeVariables.quadrant4Fill,
756
+ quadrant1TextFill: defaultThemeVariables.quadrant1TextFill,
757
+ quadrant2TextFill: defaultThemeVariables.quadrant2TextFill,
758
+ quadrant3TextFill: defaultThemeVariables.quadrant3TextFill,
759
+ quadrant4TextFill: defaultThemeVariables.quadrant4TextFill,
760
+ quadrantPointFill: defaultThemeVariables.quadrantPointFill,
761
+ quadrantPointTextFill: defaultThemeVariables.quadrantPointTextFill,
762
+ quadrantXAxisTextFill: defaultThemeVariables.quadrantXAxisTextFill,
763
+ quadrantYAxisTextFill: defaultThemeVariables.quadrantYAxisTextFill,
764
+ quadrantTitleFill: defaultThemeVariables.quadrantTitleFill,
765
+ quadrantInternalBorderStrokeFill: defaultThemeVariables.quadrantInternalBorderStrokeFill,
766
+ quadrantExternalBorderStrokeFill: defaultThemeVariables.quadrantExternalBorderStrokeFill
767
+ };
768
+ }
769
+ clear() {
770
+ this.config = this.getDefaultConfig();
771
+ this.themeConfig = this.getDefaultThemeConfig();
772
+ this.data = this.getDefaultData();
773
+ this.classes = /* @__PURE__ */ new Map();
774
+ log.info("clear called");
775
+ }
776
+ setData(data) {
777
+ this.data = { ...this.data, ...data };
778
+ }
779
+ addPoints(points) {
780
+ this.data.points = [...points, ...this.data.points];
781
+ }
782
+ addClass(className, styles) {
783
+ this.classes.set(className, styles);
784
+ }
785
+ setConfig(config) {
786
+ log.trace("setConfig called with: ", config);
787
+ this.config = { ...this.config, ...config };
788
+ }
789
+ setThemeConfig(themeConfig) {
790
+ log.trace("setThemeConfig called with: ", themeConfig);
791
+ this.themeConfig = { ...this.themeConfig, ...themeConfig };
792
+ }
793
+ calculateSpace(xAxisPosition, showXAxis, showYAxis, showTitle) {
794
+ const xAxisSpaceCalculation = this.config.xAxisLabelPadding * 2 + this.config.xAxisLabelFontSize;
795
+ const xAxisSpace = {
796
+ top: xAxisPosition === "top" && showXAxis ? xAxisSpaceCalculation : 0,
797
+ bottom: xAxisPosition === "bottom" && showXAxis ? xAxisSpaceCalculation : 0
798
+ };
799
+ const yAxisSpaceCalculation = this.config.yAxisLabelPadding * 2 + this.config.yAxisLabelFontSize;
800
+ const yAxisSpace = {
801
+ left: this.config.yAxisPosition === "left" && showYAxis ? yAxisSpaceCalculation : 0,
802
+ right: this.config.yAxisPosition === "right" && showYAxis ? yAxisSpaceCalculation : 0
803
+ };
804
+ const titleSpaceCalculation = this.config.titleFontSize + this.config.titlePadding * 2;
805
+ const titleSpace = {
806
+ top: showTitle ? titleSpaceCalculation : 0
807
+ };
808
+ const quadrantLeft = this.config.quadrantPadding + yAxisSpace.left;
809
+ const quadrantTop = this.config.quadrantPadding + xAxisSpace.top + titleSpace.top;
810
+ const quadrantWidth = this.config.chartWidth - this.config.quadrantPadding * 2 - yAxisSpace.left - yAxisSpace.right;
811
+ const quadrantHeight = this.config.chartHeight - this.config.quadrantPadding * 2 - xAxisSpace.top - xAxisSpace.bottom - titleSpace.top;
812
+ const quadrantHalfWidth = quadrantWidth / 2;
813
+ const quadrantHalfHeight = quadrantHeight / 2;
814
+ const quadrantSpace = {
815
+ quadrantLeft,
816
+ quadrantTop,
817
+ quadrantWidth,
818
+ quadrantHalfWidth,
819
+ quadrantHeight,
820
+ quadrantHalfHeight
821
+ };
822
+ return {
823
+ xAxisSpace,
824
+ yAxisSpace,
825
+ titleSpace,
826
+ quadrantSpace
827
+ };
828
+ }
829
+ getAxisLabels(xAxisPosition, showXAxis, showYAxis, spaceData) {
830
+ const { quadrantSpace, titleSpace } = spaceData;
831
+ const {
832
+ quadrantHalfHeight,
833
+ quadrantHeight,
834
+ quadrantLeft,
835
+ quadrantHalfWidth,
836
+ quadrantTop,
837
+ quadrantWidth
838
+ } = quadrantSpace;
839
+ const drawXAxisLabelsInMiddle = Boolean(this.data.xAxisRightText);
840
+ const drawYAxisLabelsInMiddle = Boolean(this.data.yAxisTopText);
841
+ const axisLabels = [];
842
+ if (this.data.xAxisLeftText && showXAxis) {
843
+ axisLabels.push({
844
+ text: this.data.xAxisLeftText,
845
+ fill: this.themeConfig.quadrantXAxisTextFill,
846
+ x: quadrantLeft + (drawXAxisLabelsInMiddle ? quadrantHalfWidth / 2 : 0),
847
+ y: xAxisPosition === "top" ? this.config.xAxisLabelPadding + titleSpace.top : this.config.xAxisLabelPadding + quadrantTop + quadrantHeight + this.config.quadrantPadding,
848
+ fontSize: this.config.xAxisLabelFontSize,
849
+ verticalPos: drawXAxisLabelsInMiddle ? "center" : "left",
850
+ horizontalPos: "top",
851
+ rotation: 0
852
+ });
853
+ }
854
+ if (this.data.xAxisRightText && showXAxis) {
855
+ axisLabels.push({
856
+ text: this.data.xAxisRightText,
857
+ fill: this.themeConfig.quadrantXAxisTextFill,
858
+ x: quadrantLeft + quadrantHalfWidth + (drawXAxisLabelsInMiddle ? quadrantHalfWidth / 2 : 0),
859
+ y: xAxisPosition === "top" ? this.config.xAxisLabelPadding + titleSpace.top : this.config.xAxisLabelPadding + quadrantTop + quadrantHeight + this.config.quadrantPadding,
860
+ fontSize: this.config.xAxisLabelFontSize,
861
+ verticalPos: drawXAxisLabelsInMiddle ? "center" : "left",
862
+ horizontalPos: "top",
863
+ rotation: 0
864
+ });
865
+ }
866
+ if (this.data.yAxisBottomText && showYAxis) {
867
+ axisLabels.push({
868
+ text: this.data.yAxisBottomText,
869
+ fill: this.themeConfig.quadrantYAxisTextFill,
870
+ x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + quadrantLeft + quadrantWidth + this.config.quadrantPadding,
871
+ y: quadrantTop + quadrantHeight - (drawYAxisLabelsInMiddle ? quadrantHalfHeight / 2 : 0),
872
+ fontSize: this.config.yAxisLabelFontSize,
873
+ verticalPos: drawYAxisLabelsInMiddle ? "center" : "left",
874
+ horizontalPos: "top",
875
+ rotation: -90
876
+ });
877
+ }
878
+ if (this.data.yAxisTopText && showYAxis) {
879
+ axisLabels.push({
880
+ text: this.data.yAxisTopText,
881
+ fill: this.themeConfig.quadrantYAxisTextFill,
882
+ x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + quadrantLeft + quadrantWidth + this.config.quadrantPadding,
883
+ y: quadrantTop + quadrantHalfHeight - (drawYAxisLabelsInMiddle ? quadrantHalfHeight / 2 : 0),
884
+ fontSize: this.config.yAxisLabelFontSize,
885
+ verticalPos: drawYAxisLabelsInMiddle ? "center" : "left",
886
+ horizontalPos: "top",
887
+ rotation: -90
888
+ });
889
+ }
890
+ return axisLabels;
891
+ }
892
+ getQuadrants(spaceData) {
893
+ const { quadrantSpace } = spaceData;
894
+ const { quadrantHalfHeight, quadrantLeft, quadrantHalfWidth, quadrantTop } = quadrantSpace;
895
+ const quadrants = [
896
+ {
897
+ text: {
898
+ text: this.data.quadrant1Text,
899
+ fill: this.themeConfig.quadrant1TextFill,
900
+ x: 0,
901
+ y: 0,
902
+ fontSize: this.config.quadrantLabelFontSize,
903
+ verticalPos: "center",
904
+ horizontalPos: "middle",
905
+ rotation: 0
906
+ },
907
+ x: quadrantLeft + quadrantHalfWidth,
908
+ y: quadrantTop,
909
+ width: quadrantHalfWidth,
910
+ height: quadrantHalfHeight,
911
+ fill: this.themeConfig.quadrant1Fill
912
+ },
913
+ {
914
+ text: {
915
+ text: this.data.quadrant2Text,
916
+ fill: this.themeConfig.quadrant2TextFill,
917
+ x: 0,
918
+ y: 0,
919
+ fontSize: this.config.quadrantLabelFontSize,
920
+ verticalPos: "center",
921
+ horizontalPos: "middle",
922
+ rotation: 0
923
+ },
924
+ x: quadrantLeft,
925
+ y: quadrantTop,
926
+ width: quadrantHalfWidth,
927
+ height: quadrantHalfHeight,
928
+ fill: this.themeConfig.quadrant2Fill
929
+ },
930
+ {
931
+ text: {
932
+ text: this.data.quadrant3Text,
933
+ fill: this.themeConfig.quadrant3TextFill,
934
+ x: 0,
935
+ y: 0,
936
+ fontSize: this.config.quadrantLabelFontSize,
937
+ verticalPos: "center",
938
+ horizontalPos: "middle",
939
+ rotation: 0
940
+ },
941
+ x: quadrantLeft,
942
+ y: quadrantTop + quadrantHalfHeight,
943
+ width: quadrantHalfWidth,
944
+ height: quadrantHalfHeight,
945
+ fill: this.themeConfig.quadrant3Fill
946
+ },
947
+ {
948
+ text: {
949
+ text: this.data.quadrant4Text,
950
+ fill: this.themeConfig.quadrant4TextFill,
951
+ x: 0,
952
+ y: 0,
953
+ fontSize: this.config.quadrantLabelFontSize,
954
+ verticalPos: "center",
955
+ horizontalPos: "middle",
956
+ rotation: 0
957
+ },
958
+ x: quadrantLeft + quadrantHalfWidth,
959
+ y: quadrantTop + quadrantHalfHeight,
960
+ width: quadrantHalfWidth,
961
+ height: quadrantHalfHeight,
962
+ fill: this.themeConfig.quadrant4Fill
963
+ }
964
+ ];
965
+ for (const quadrant of quadrants) {
966
+ quadrant.text.x = quadrant.x + quadrant.width / 2;
967
+ if (this.data.points.length === 0) {
968
+ quadrant.text.y = quadrant.y + quadrant.height / 2;
969
+ quadrant.text.horizontalPos = "middle";
970
+ } else {
971
+ quadrant.text.y = quadrant.y + this.config.quadrantTextTopPadding;
972
+ quadrant.text.horizontalPos = "top";
973
+ }
974
+ }
975
+ return quadrants;
976
+ }
977
+ getQuadrantPoints(spaceData) {
978
+ const { quadrantSpace } = spaceData;
979
+ const { quadrantHeight, quadrantLeft, quadrantTop, quadrantWidth } = quadrantSpace;
980
+ const xAxis = linear().domain([0, 1]).range([quadrantLeft, quadrantWidth + quadrantLeft]);
981
+ const yAxis = linear().domain([0, 1]).range([quadrantHeight + quadrantTop, quadrantTop]);
982
+ const points = this.data.points.map((point) => {
983
+ const classStyles = this.classes.get(point.className);
984
+ if (classStyles) {
985
+ point = { ...classStyles, ...point };
986
+ }
987
+ const props = {
988
+ x: xAxis(point.x),
989
+ y: yAxis(point.y),
990
+ fill: point.color ?? this.themeConfig.quadrantPointFill,
991
+ radius: point.radius ?? this.config.pointRadius,
992
+ text: {
993
+ text: point.text,
994
+ fill: this.themeConfig.quadrantPointTextFill,
995
+ x: xAxis(point.x),
996
+ y: yAxis(point.y) + this.config.pointTextPadding,
997
+ verticalPos: "center",
998
+ horizontalPos: "top",
999
+ fontSize: this.config.pointLabelFontSize,
1000
+ rotation: 0
1001
+ },
1002
+ strokeColor: point.strokeColor ?? this.themeConfig.quadrantPointFill,
1003
+ strokeWidth: point.strokeWidth ?? "0px"
1004
+ };
1005
+ return props;
1006
+ });
1007
+ return points;
1008
+ }
1009
+ getBorders(spaceData) {
1010
+ const halfExternalBorderWidth = this.config.quadrantExternalBorderStrokeWidth / 2;
1011
+ const { quadrantSpace } = spaceData;
1012
+ const {
1013
+ quadrantHalfHeight,
1014
+ quadrantHeight,
1015
+ quadrantLeft,
1016
+ quadrantHalfWidth,
1017
+ quadrantTop,
1018
+ quadrantWidth
1019
+ } = quadrantSpace;
1020
+ const borderLines = [
1021
+ // top border
1022
+ {
1023
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
1024
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
1025
+ x1: quadrantLeft - halfExternalBorderWidth,
1026
+ y1: quadrantTop,
1027
+ x2: quadrantLeft + quadrantWidth + halfExternalBorderWidth,
1028
+ y2: quadrantTop
1029
+ },
1030
+ // right border
1031
+ {
1032
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
1033
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
1034
+ x1: quadrantLeft + quadrantWidth,
1035
+ y1: quadrantTop + halfExternalBorderWidth,
1036
+ x2: quadrantLeft + quadrantWidth,
1037
+ y2: quadrantTop + quadrantHeight - halfExternalBorderWidth
1038
+ },
1039
+ // bottom border
1040
+ {
1041
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
1042
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
1043
+ x1: quadrantLeft - halfExternalBorderWidth,
1044
+ y1: quadrantTop + quadrantHeight,
1045
+ x2: quadrantLeft + quadrantWidth + halfExternalBorderWidth,
1046
+ y2: quadrantTop + quadrantHeight
1047
+ },
1048
+ // left border
1049
+ {
1050
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
1051
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
1052
+ x1: quadrantLeft,
1053
+ y1: quadrantTop + halfExternalBorderWidth,
1054
+ x2: quadrantLeft,
1055
+ y2: quadrantTop + quadrantHeight - halfExternalBorderWidth
1056
+ },
1057
+ // vertical inner border
1058
+ {
1059
+ strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
1060
+ strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
1061
+ x1: quadrantLeft + quadrantHalfWidth,
1062
+ y1: quadrantTop + halfExternalBorderWidth,
1063
+ x2: quadrantLeft + quadrantHalfWidth,
1064
+ y2: quadrantTop + quadrantHeight - halfExternalBorderWidth
1065
+ },
1066
+ // horizontal inner border
1067
+ {
1068
+ strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
1069
+ strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
1070
+ x1: quadrantLeft + halfExternalBorderWidth,
1071
+ y1: quadrantTop + quadrantHalfHeight,
1072
+ x2: quadrantLeft + quadrantWidth - halfExternalBorderWidth,
1073
+ y2: quadrantTop + quadrantHalfHeight
1074
+ }
1075
+ ];
1076
+ return borderLines;
1077
+ }
1078
+ getTitle(showTitle) {
1079
+ if (showTitle) {
1080
+ return {
1081
+ text: this.data.titleText,
1082
+ fill: this.themeConfig.quadrantTitleFill,
1083
+ fontSize: this.config.titleFontSize,
1084
+ horizontalPos: "top",
1085
+ verticalPos: "center",
1086
+ rotation: 0,
1087
+ y: this.config.titlePadding,
1088
+ x: this.config.chartWidth / 2
1089
+ };
1090
+ }
1091
+ return;
1092
+ }
1093
+ build() {
1094
+ const showXAxis = this.config.showXAxis && !!(this.data.xAxisLeftText || this.data.xAxisRightText);
1095
+ const showYAxis = this.config.showYAxis && !!(this.data.yAxisTopText || this.data.yAxisBottomText);
1096
+ const showTitle = this.config.showTitle && !!this.data.titleText;
1097
+ const xAxisPosition = this.data.points.length > 0 ? "bottom" : this.config.xAxisPosition;
1098
+ const calculatedSpace = this.calculateSpace(xAxisPosition, showXAxis, showYAxis, showTitle);
1099
+ return {
1100
+ points: this.getQuadrantPoints(calculatedSpace),
1101
+ quadrants: this.getQuadrants(calculatedSpace),
1102
+ axisLabels: this.getAxisLabels(xAxisPosition, showXAxis, showYAxis, calculatedSpace),
1103
+ borderLines: this.getBorders(calculatedSpace),
1104
+ title: this.getTitle(showTitle)
1105
+ };
1106
+ }
1107
+ }, __name(_a, "QuadrantBuilder"), _a);
1108
+ var InvalidStyleError = (_b = class extends Error {
1109
+ constructor(style, value, type) {
1110
+ super(`value for ${style} ${value} is invalid, please use a valid ${type}`);
1111
+ this.name = "InvalidStyleError";
1112
+ }
1113
+ }, __name(_b, "InvalidStyleError"), _b);
1114
+ function validateHexCode(value) {
1115
+ return !/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(value);
1116
+ }
1117
+ __name(validateHexCode, "validateHexCode");
1118
+ function validateNumber(value) {
1119
+ return !/^\d+$/.test(value);
1120
+ }
1121
+ __name(validateNumber, "validateNumber");
1122
+ function validateSizeInPixels(value) {
1123
+ return !/^\d+px$/.test(value);
1124
+ }
1125
+ __name(validateSizeInPixels, "validateSizeInPixels");
1126
+ function textSanitizer(text) {
1127
+ return sanitizeText(text.trim(), getConfig2());
1128
+ }
1129
+ __name(textSanitizer, "textSanitizer");
1130
+ var quadrantBuilder = new QuadrantBuilder();
1131
+ function setQuadrant1Text(textObj) {
1132
+ quadrantBuilder.setData({ quadrant1Text: textSanitizer(textObj.text) });
1133
+ }
1134
+ __name(setQuadrant1Text, "setQuadrant1Text");
1135
+ function setQuadrant2Text(textObj) {
1136
+ quadrantBuilder.setData({ quadrant2Text: textSanitizer(textObj.text) });
1137
+ }
1138
+ __name(setQuadrant2Text, "setQuadrant2Text");
1139
+ function setQuadrant3Text(textObj) {
1140
+ quadrantBuilder.setData({ quadrant3Text: textSanitizer(textObj.text) });
1141
+ }
1142
+ __name(setQuadrant3Text, "setQuadrant3Text");
1143
+ function setQuadrant4Text(textObj) {
1144
+ quadrantBuilder.setData({ quadrant4Text: textSanitizer(textObj.text) });
1145
+ }
1146
+ __name(setQuadrant4Text, "setQuadrant4Text");
1147
+ function setXAxisLeftText(textObj) {
1148
+ quadrantBuilder.setData({ xAxisLeftText: textSanitizer(textObj.text) });
1149
+ }
1150
+ __name(setXAxisLeftText, "setXAxisLeftText");
1151
+ function setXAxisRightText(textObj) {
1152
+ quadrantBuilder.setData({ xAxisRightText: textSanitizer(textObj.text) });
1153
+ }
1154
+ __name(setXAxisRightText, "setXAxisRightText");
1155
+ function setYAxisTopText(textObj) {
1156
+ quadrantBuilder.setData({ yAxisTopText: textSanitizer(textObj.text) });
1157
+ }
1158
+ __name(setYAxisTopText, "setYAxisTopText");
1159
+ function setYAxisBottomText(textObj) {
1160
+ quadrantBuilder.setData({ yAxisBottomText: textSanitizer(textObj.text) });
1161
+ }
1162
+ __name(setYAxisBottomText, "setYAxisBottomText");
1163
+ function parseStyles(styles) {
1164
+ const stylesObject = {};
1165
+ for (const style of styles) {
1166
+ const [key, value] = style.trim().split(/\s*:\s*/);
1167
+ if (key === "radius") {
1168
+ if (validateNumber(value)) {
1169
+ throw new InvalidStyleError(key, value, "number");
1170
+ }
1171
+ stylesObject.radius = parseInt(value);
1172
+ } else if (key === "color") {
1173
+ if (validateHexCode(value)) {
1174
+ throw new InvalidStyleError(key, value, "hex code");
1175
+ }
1176
+ stylesObject.color = value;
1177
+ } else if (key === "stroke-color") {
1178
+ if (validateHexCode(value)) {
1179
+ throw new InvalidStyleError(key, value, "hex code");
1180
+ }
1181
+ stylesObject.strokeColor = value;
1182
+ } else if (key === "stroke-width") {
1183
+ if (validateSizeInPixels(value)) {
1184
+ throw new InvalidStyleError(key, value, "number of pixels (eg. 10px)");
1185
+ }
1186
+ stylesObject.strokeWidth = value;
1187
+ } else {
1188
+ throw new Error(`style named ${key} is not supported.`);
1189
+ }
1190
+ }
1191
+ return stylesObject;
1192
+ }
1193
+ __name(parseStyles, "parseStyles");
1194
+ function addPoint(textObj, className, x, y, styles) {
1195
+ const stylesObject = parseStyles(styles);
1196
+ quadrantBuilder.addPoints([
1197
+ {
1198
+ x,
1199
+ y,
1200
+ text: textSanitizer(textObj.text),
1201
+ className,
1202
+ ...stylesObject
1203
+ }
1204
+ ]);
1205
+ }
1206
+ __name(addPoint, "addPoint");
1207
+ function addClass(className, styles) {
1208
+ quadrantBuilder.addClass(className, parseStyles(styles));
1209
+ }
1210
+ __name(addClass, "addClass");
1211
+ function setWidth(width) {
1212
+ quadrantBuilder.setConfig({ chartWidth: width });
1213
+ }
1214
+ __name(setWidth, "setWidth");
1215
+ function setHeight(height) {
1216
+ quadrantBuilder.setConfig({ chartHeight: height });
1217
+ }
1218
+ __name(setHeight, "setHeight");
1219
+ function getQuadrantData() {
1220
+ const config = getConfig2();
1221
+ const { themeVariables, quadrantChart: quadrantChartConfig } = config;
1222
+ if (quadrantChartConfig) {
1223
+ quadrantBuilder.setConfig(quadrantChartConfig);
1224
+ }
1225
+ quadrantBuilder.setThemeConfig({
1226
+ quadrant1Fill: themeVariables.quadrant1Fill,
1227
+ quadrant2Fill: themeVariables.quadrant2Fill,
1228
+ quadrant3Fill: themeVariables.quadrant3Fill,
1229
+ quadrant4Fill: themeVariables.quadrant4Fill,
1230
+ quadrant1TextFill: themeVariables.quadrant1TextFill,
1231
+ quadrant2TextFill: themeVariables.quadrant2TextFill,
1232
+ quadrant3TextFill: themeVariables.quadrant3TextFill,
1233
+ quadrant4TextFill: themeVariables.quadrant4TextFill,
1234
+ quadrantPointFill: themeVariables.quadrantPointFill,
1235
+ quadrantPointTextFill: themeVariables.quadrantPointTextFill,
1236
+ quadrantXAxisTextFill: themeVariables.quadrantXAxisTextFill,
1237
+ quadrantYAxisTextFill: themeVariables.quadrantYAxisTextFill,
1238
+ quadrantExternalBorderStrokeFill: themeVariables.quadrantExternalBorderStrokeFill,
1239
+ quadrantInternalBorderStrokeFill: themeVariables.quadrantInternalBorderStrokeFill,
1240
+ quadrantTitleFill: themeVariables.quadrantTitleFill
1241
+ });
1242
+ quadrantBuilder.setData({ titleText: getDiagramTitle() });
1243
+ return quadrantBuilder.build();
1244
+ }
1245
+ __name(getQuadrantData, "getQuadrantData");
1246
+ var clear2 = /* @__PURE__ */ __name(function() {
1247
+ quadrantBuilder.clear();
1248
+ clear();
1249
+ }, "clear");
1250
+ var quadrantDb_default = {
1251
+ setWidth,
1252
+ setHeight,
1253
+ setQuadrant1Text,
1254
+ setQuadrant2Text,
1255
+ setQuadrant3Text,
1256
+ setQuadrant4Text,
1257
+ setXAxisLeftText,
1258
+ setXAxisRightText,
1259
+ setYAxisTopText,
1260
+ setYAxisBottomText,
1261
+ parseStyles,
1262
+ addPoint,
1263
+ addClass,
1264
+ getQuadrantData,
1265
+ clear: clear2,
1266
+ setAccTitle,
1267
+ getAccTitle,
1268
+ setDiagramTitle,
1269
+ getDiagramTitle,
1270
+ getAccDescription,
1271
+ setAccDescription
1272
+ };
1273
+ var draw = /* @__PURE__ */ __name((txt, id, _version, diagObj) => {
1274
+ var _a2, _b2, _c;
1275
+ function getDominantBaseLine(horizontalPos) {
1276
+ return horizontalPos === "top" ? "hanging" : "middle";
1277
+ }
1278
+ __name(getDominantBaseLine, "getDominantBaseLine");
1279
+ function getTextAnchor(verticalPos) {
1280
+ return verticalPos === "left" ? "start" : "middle";
1281
+ }
1282
+ __name(getTextAnchor, "getTextAnchor");
1283
+ function getTransformation(data) {
1284
+ return `translate(${data.x}, ${data.y}) rotate(${data.rotation || 0})`;
1285
+ }
1286
+ __name(getTransformation, "getTransformation");
1287
+ const conf = getConfig2();
1288
+ log.debug("Rendering quadrant chart\n" + txt);
1289
+ const securityLevel = conf.securityLevel;
1290
+ let sandboxElement;
1291
+ if (securityLevel === "sandbox") {
1292
+ sandboxElement = select("#i" + id);
1293
+ }
1294
+ const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
1295
+ const svg = root.select(`[id="${id}"]`);
1296
+ const group = svg.append("g").attr("class", "main");
1297
+ const width = ((_a2 = conf.quadrantChart) == null ? void 0 : _a2.chartWidth) ?? 500;
1298
+ const height = ((_b2 = conf.quadrantChart) == null ? void 0 : _b2.chartHeight) ?? 500;
1299
+ configureSvgSize(svg, height, width, ((_c = conf.quadrantChart) == null ? void 0 : _c.useMaxWidth) ?? true);
1300
+ svg.attr("viewBox", "0 0 " + width + " " + height);
1301
+ diagObj.db.setHeight(height);
1302
+ diagObj.db.setWidth(width);
1303
+ const quadrantData = diagObj.db.getQuadrantData();
1304
+ const quadrantsGroup = group.append("g").attr("class", "quadrants");
1305
+ const borderGroup = group.append("g").attr("class", "border");
1306
+ const dataPointGroup = group.append("g").attr("class", "data-points");
1307
+ const labelGroup = group.append("g").attr("class", "labels");
1308
+ const titleGroup = group.append("g").attr("class", "title");
1309
+ if (quadrantData.title) {
1310
+ titleGroup.append("text").attr("x", 0).attr("y", 0).attr("fill", quadrantData.title.fill).attr("font-size", quadrantData.title.fontSize).attr("dominant-baseline", getDominantBaseLine(quadrantData.title.horizontalPos)).attr("text-anchor", getTextAnchor(quadrantData.title.verticalPos)).attr("transform", getTransformation(quadrantData.title)).text(quadrantData.title.text);
1311
+ }
1312
+ if (quadrantData.borderLines) {
1313
+ borderGroup.selectAll("line").data(quadrantData.borderLines).enter().append("line").attr("x1", (data) => data.x1).attr("y1", (data) => data.y1).attr("x2", (data) => data.x2).attr("y2", (data) => data.y2).style("stroke", (data) => data.strokeFill).style("stroke-width", (data) => data.strokeWidth);
1314
+ }
1315
+ const quadrants = quadrantsGroup.selectAll("g.quadrant").data(quadrantData.quadrants).enter().append("g").attr("class", "quadrant");
1316
+ quadrants.append("rect").attr("x", (data) => data.x).attr("y", (data) => data.y).attr("width", (data) => data.width).attr("height", (data) => data.height).attr("fill", (data) => data.fill);
1317
+ quadrants.append("text").attr("x", 0).attr("y", 0).attr("fill", (data) => data.text.fill).attr("font-size", (data) => data.text.fontSize).attr(
1318
+ "dominant-baseline",
1319
+ (data) => getDominantBaseLine(data.text.horizontalPos)
1320
+ ).attr("text-anchor", (data) => getTextAnchor(data.text.verticalPos)).attr("transform", (data) => getTransformation(data.text)).text((data) => data.text.text);
1321
+ const labels = labelGroup.selectAll("g.label").data(quadrantData.axisLabels).enter().append("g").attr("class", "label");
1322
+ labels.append("text").attr("x", 0).attr("y", 0).text((data) => data.text).attr("fill", (data) => data.fill).attr("font-size", (data) => data.fontSize).attr("dominant-baseline", (data) => getDominantBaseLine(data.horizontalPos)).attr("text-anchor", (data) => getTextAnchor(data.verticalPos)).attr("transform", (data) => getTransformation(data));
1323
+ const dataPoints = dataPointGroup.selectAll("g.data-point").data(quadrantData.points).enter().append("g").attr("class", "data-point");
1324
+ dataPoints.append("circle").attr("cx", (data) => data.x).attr("cy", (data) => data.y).attr("r", (data) => data.radius).attr("fill", (data) => data.fill).attr("stroke", (data) => data.strokeColor).attr("stroke-width", (data) => data.strokeWidth);
1325
+ dataPoints.append("text").attr("x", 0).attr("y", 0).text((data) => data.text.text).attr("fill", (data) => data.text.fill).attr("font-size", (data) => data.text.fontSize).attr(
1326
+ "dominant-baseline",
1327
+ (data) => getDominantBaseLine(data.text.horizontalPos)
1328
+ ).attr("text-anchor", (data) => getTextAnchor(data.text.verticalPos)).attr("transform", (data) => getTransformation(data.text));
1329
+ }, "draw");
1330
+ var quadrantRenderer_default = {
1331
+ draw
1332
+ };
1333
+ var diagram = {
1334
+ parser: quadrant_default,
1335
+ db: quadrantDb_default,
1336
+ renderer: quadrantRenderer_default,
1337
+ styles: /* @__PURE__ */ __name(() => "", "styles")
1338
+ };
1339
+ export {
1340
+ diagram
1341
+ };