@infinilabs/ai-chat 0.0.0 → 0.0.2

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