whipped 0.8.1 → 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-BMFVAmy4.js → index-DZ7I8r_C.js} +41392 -39594
  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 +1 -1
@@ -0,0 +1,1205 @@
1
+ var _a;
2
+ import { g as getDiagramElement } from "./chunk-XXDRQBXY-C4FVmO5r.js";
3
+ import { s as setupViewPortForSVG } from "./chunk-VR4S4FIN-Fgvcluvk.js";
4
+ import { _ as __name, y as getConfig, b as setAccTitle, a as getAccTitle, s as setAccDescription, g as getAccDescription, n as setDiagramTitle, o as getDiagramTitle, c as getConfig2, l as log, p as clear, t as __export, u as getRegisteredLayoutAlgorithm, v as render, x as utils_default } from "./mermaid.core-BRk3IzY2.js";
5
+ import "./index-DZ7I8r_C.js";
6
+ var parser = (function() {
7
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
8
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
9
+ return o2;
10
+ }, "o"), $V0 = [1, 3], $V1 = [1, 4], $V2 = [1, 5], $V3 = [1, 6], $V4 = [5, 6, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 77, 89, 90], $V5 = [1, 22], $V6 = [2, 7], $V7 = [1, 26], $V8 = [1, 27], $V9 = [1, 28], $Va = [1, 29], $Vb = [1, 33], $Vc = [1, 34], $Vd = [1, 35], $Ve = [1, 36], $Vf = [1, 37], $Vg = [1, 38], $Vh = [1, 24], $Vi = [1, 31], $Vj = [1, 32], $Vk = [1, 30], $Vl = [1, 39], $Vm = [1, 40], $Vn = [5, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 77, 89, 90], $Vo = [1, 61], $Vp = [89, 90], $Vq = [5, 8, 9, 11, 13, 21, 22, 23, 24, 27, 29, 41, 42, 43, 44, 45, 46, 54, 61, 63, 72, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90], $Vr = [27, 29], $Vs = [1, 70], $Vt = [1, 71], $Vu = [1, 72], $Vv = [1, 73], $Vw = [1, 74], $Vx = [1, 75], $Vy = [1, 76], $Vz = [1, 83], $VA = [1, 80], $VB = [1, 84], $VC = [1, 85], $VD = [1, 86], $VE = [1, 87], $VF = [1, 88], $VG = [1, 89], $VH = [1, 90], $VI = [1, 91], $VJ = [1, 92], $VK = [5, 8, 9, 11, 13, 21, 22, 23, 24, 27, 41, 42, 43, 44, 45, 46, 54, 72, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90], $VL = [63, 64], $VM = [1, 101], $VN = [5, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 76, 77, 89, 90], $VO = [5, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90], $VP = [1, 110], $VQ = [1, 106], $VR = [1, 107], $VS = [1, 108], $VT = [1, 109], $VU = [1, 111], $VV = [1, 116], $VW = [1, 117], $VX = [1, 114], $VY = [1, 115];
11
+ var parser2 = {
12
+ trace: /* @__PURE__ */ __name(function trace() {
13
+ }, "trace"),
14
+ yy: {},
15
+ symbols_: { "error": 2, "start": 3, "directive": 4, "NEWLINE": 5, "RD": 6, "diagram": 7, "EOF": 8, "acc_title": 9, "acc_title_value": 10, "acc_descr": 11, "acc_descr_value": 12, "acc_descr_multiline_value": 13, "requirementDef": 14, "elementDef": 15, "relationshipDef": 16, "direction": 17, "styleStatement": 18, "classDefStatement": 19, "classStatement": 20, "direction_tb": 21, "direction_bt": 22, "direction_rl": 23, "direction_lr": 24, "requirementType": 25, "requirementName": 26, "STRUCT_START": 27, "requirementBody": 28, "STYLE_SEPARATOR": 29, "idList": 30, "ID": 31, "COLONSEP": 32, "id": 33, "TEXT": 34, "text": 35, "RISK": 36, "riskLevel": 37, "VERIFYMTHD": 38, "verifyType": 39, "STRUCT_STOP": 40, "REQUIREMENT": 41, "FUNCTIONAL_REQUIREMENT": 42, "INTERFACE_REQUIREMENT": 43, "PERFORMANCE_REQUIREMENT": 44, "PHYSICAL_REQUIREMENT": 45, "DESIGN_CONSTRAINT": 46, "LOW_RISK": 47, "MED_RISK": 48, "HIGH_RISK": 49, "VERIFY_ANALYSIS": 50, "VERIFY_DEMONSTRATION": 51, "VERIFY_INSPECTION": 52, "VERIFY_TEST": 53, "ELEMENT": 54, "elementName": 55, "elementBody": 56, "TYPE": 57, "type": 58, "DOCREF": 59, "ref": 60, "END_ARROW_L": 61, "relationship": 62, "LINE": 63, "END_ARROW_R": 64, "CONTAINS": 65, "COPIES": 66, "DERIVES": 67, "SATISFIES": 68, "VERIFIES": 69, "REFINES": 70, "TRACES": 71, "CLASSDEF": 72, "stylesOpt": 73, "CLASS": 74, "ALPHA": 75, "COMMA": 76, "STYLE": 77, "style": 78, "styleComponent": 79, "NUM": 80, "COLON": 81, "UNIT": 82, "SPACE": 83, "BRKT": 84, "PCT": 85, "MINUS": 86, "LABEL": 87, "SEMICOLON": 88, "unqString": 89, "qString": 90, "$accept": 0, "$end": 1 },
16
+ terminals_: { 2: "error", 5: "NEWLINE", 6: "RD", 8: "EOF", 9: "acc_title", 10: "acc_title_value", 11: "acc_descr", 12: "acc_descr_value", 13: "acc_descr_multiline_value", 21: "direction_tb", 22: "direction_bt", 23: "direction_rl", 24: "direction_lr", 27: "STRUCT_START", 29: "STYLE_SEPARATOR", 31: "ID", 32: "COLONSEP", 34: "TEXT", 36: "RISK", 38: "VERIFYMTHD", 40: "STRUCT_STOP", 41: "REQUIREMENT", 42: "FUNCTIONAL_REQUIREMENT", 43: "INTERFACE_REQUIREMENT", 44: "PERFORMANCE_REQUIREMENT", 45: "PHYSICAL_REQUIREMENT", 46: "DESIGN_CONSTRAINT", 47: "LOW_RISK", 48: "MED_RISK", 49: "HIGH_RISK", 50: "VERIFY_ANALYSIS", 51: "VERIFY_DEMONSTRATION", 52: "VERIFY_INSPECTION", 53: "VERIFY_TEST", 54: "ELEMENT", 57: "TYPE", 59: "DOCREF", 61: "END_ARROW_L", 63: "LINE", 64: "END_ARROW_R", 65: "CONTAINS", 66: "COPIES", 67: "DERIVES", 68: "SATISFIES", 69: "VERIFIES", 70: "REFINES", 71: "TRACES", 72: "CLASSDEF", 74: "CLASS", 75: "ALPHA", 76: "COMMA", 77: "STYLE", 80: "NUM", 81: "COLON", 82: "UNIT", 83: "SPACE", 84: "BRKT", 85: "PCT", 86: "MINUS", 87: "LABEL", 88: "SEMICOLON", 89: "unqString", 90: "qString" },
17
+ productions_: [0, [3, 3], [3, 2], [3, 4], [4, 2], [4, 2], [4, 1], [7, 0], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [17, 1], [17, 1], [17, 1], [17, 1], [14, 5], [14, 7], [28, 5], [28, 5], [28, 5], [28, 5], [28, 2], [28, 1], [25, 1], [25, 1], [25, 1], [25, 1], [25, 1], [25, 1], [37, 1], [37, 1], [37, 1], [39, 1], [39, 1], [39, 1], [39, 1], [15, 5], [15, 7], [56, 5], [56, 5], [56, 2], [56, 1], [16, 5], [16, 5], [62, 1], [62, 1], [62, 1], [62, 1], [62, 1], [62, 1], [62, 1], [19, 3], [20, 3], [20, 3], [30, 1], [30, 3], [30, 1], [30, 3], [18, 3], [73, 1], [73, 3], [78, 1], [78, 2], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [26, 1], [26, 1], [33, 1], [33, 1], [35, 1], [35, 1], [55, 1], [55, 1], [58, 1], [58, 1], [60, 1], [60, 1]],
18
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
19
+ var $0 = $$.length - 1;
20
+ switch (yystate) {
21
+ case 4:
22
+ this.$ = $$[$0].trim();
23
+ yy.setAccTitle(this.$);
24
+ break;
25
+ case 5:
26
+ case 6:
27
+ this.$ = $$[$0].trim();
28
+ yy.setAccDescription(this.$);
29
+ break;
30
+ case 7:
31
+ this.$ = [];
32
+ break;
33
+ case 17:
34
+ yy.setDirection("TB");
35
+ break;
36
+ case 18:
37
+ yy.setDirection("BT");
38
+ break;
39
+ case 19:
40
+ yy.setDirection("RL");
41
+ break;
42
+ case 20:
43
+ yy.setDirection("LR");
44
+ break;
45
+ case 21:
46
+ yy.addRequirement($$[$0 - 3], $$[$0 - 4]);
47
+ break;
48
+ case 22:
49
+ yy.addRequirement($$[$0 - 5], $$[$0 - 6]);
50
+ yy.setClass([$$[$0 - 5]], $$[$0 - 3]);
51
+ break;
52
+ case 23:
53
+ yy.setNewReqId($$[$0 - 2]);
54
+ break;
55
+ case 24:
56
+ yy.setNewReqText($$[$0 - 2]);
57
+ break;
58
+ case 25:
59
+ yy.setNewReqRisk($$[$0 - 2]);
60
+ break;
61
+ case 26:
62
+ yy.setNewReqVerifyMethod($$[$0 - 2]);
63
+ break;
64
+ case 29:
65
+ this.$ = yy.RequirementType.REQUIREMENT;
66
+ break;
67
+ case 30:
68
+ this.$ = yy.RequirementType.FUNCTIONAL_REQUIREMENT;
69
+ break;
70
+ case 31:
71
+ this.$ = yy.RequirementType.INTERFACE_REQUIREMENT;
72
+ break;
73
+ case 32:
74
+ this.$ = yy.RequirementType.PERFORMANCE_REQUIREMENT;
75
+ break;
76
+ case 33:
77
+ this.$ = yy.RequirementType.PHYSICAL_REQUIREMENT;
78
+ break;
79
+ case 34:
80
+ this.$ = yy.RequirementType.DESIGN_CONSTRAINT;
81
+ break;
82
+ case 35:
83
+ this.$ = yy.RiskLevel.LOW_RISK;
84
+ break;
85
+ case 36:
86
+ this.$ = yy.RiskLevel.MED_RISK;
87
+ break;
88
+ case 37:
89
+ this.$ = yy.RiskLevel.HIGH_RISK;
90
+ break;
91
+ case 38:
92
+ this.$ = yy.VerifyType.VERIFY_ANALYSIS;
93
+ break;
94
+ case 39:
95
+ this.$ = yy.VerifyType.VERIFY_DEMONSTRATION;
96
+ break;
97
+ case 40:
98
+ this.$ = yy.VerifyType.VERIFY_INSPECTION;
99
+ break;
100
+ case 41:
101
+ this.$ = yy.VerifyType.VERIFY_TEST;
102
+ break;
103
+ case 42:
104
+ yy.addElement($$[$0 - 3]);
105
+ break;
106
+ case 43:
107
+ yy.addElement($$[$0 - 5]);
108
+ yy.setClass([$$[$0 - 5]], $$[$0 - 3]);
109
+ break;
110
+ case 44:
111
+ yy.setNewElementType($$[$0 - 2]);
112
+ break;
113
+ case 45:
114
+ yy.setNewElementDocRef($$[$0 - 2]);
115
+ break;
116
+ case 48:
117
+ yy.addRelationship($$[$0 - 2], $$[$0], $$[$0 - 4]);
118
+ break;
119
+ case 49:
120
+ yy.addRelationship($$[$0 - 2], $$[$0 - 4], $$[$0]);
121
+ break;
122
+ case 50:
123
+ this.$ = yy.Relationships.CONTAINS;
124
+ break;
125
+ case 51:
126
+ this.$ = yy.Relationships.COPIES;
127
+ break;
128
+ case 52:
129
+ this.$ = yy.Relationships.DERIVES;
130
+ break;
131
+ case 53:
132
+ this.$ = yy.Relationships.SATISFIES;
133
+ break;
134
+ case 54:
135
+ this.$ = yy.Relationships.VERIFIES;
136
+ break;
137
+ case 55:
138
+ this.$ = yy.Relationships.REFINES;
139
+ break;
140
+ case 56:
141
+ this.$ = yy.Relationships.TRACES;
142
+ break;
143
+ case 57:
144
+ this.$ = $$[$0 - 2];
145
+ yy.defineClass($$[$0 - 1], $$[$0]);
146
+ break;
147
+ case 58:
148
+ yy.setClass($$[$0 - 1], $$[$0]);
149
+ break;
150
+ case 59:
151
+ yy.setClass([$$[$0 - 2]], $$[$0]);
152
+ break;
153
+ case 60:
154
+ case 62:
155
+ this.$ = [$$[$0]];
156
+ break;
157
+ case 61:
158
+ case 63:
159
+ this.$ = $$[$0 - 2].concat([$$[$0]]);
160
+ break;
161
+ case 64:
162
+ this.$ = $$[$0 - 2];
163
+ yy.setCssStyle($$[$0 - 1], $$[$0]);
164
+ break;
165
+ case 65:
166
+ this.$ = [$$[$0]];
167
+ break;
168
+ case 66:
169
+ $$[$0 - 2].push($$[$0]);
170
+ this.$ = $$[$0 - 2];
171
+ break;
172
+ case 68:
173
+ this.$ = $$[$0 - 1] + $$[$0];
174
+ break;
175
+ }
176
+ }, "anonymous"),
177
+ table: [{ 3: 1, 4: 2, 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 1: [3] }, { 3: 8, 4: 2, 5: [1, 7], 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 5: [1, 9] }, { 10: [1, 10] }, { 12: [1, 11] }, o($V4, [2, 6]), { 3: 12, 4: 2, 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 1: [2, 2] }, { 4: 17, 5: $V5, 7: 13, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, o($V4, [2, 4]), o($V4, [2, 5]), { 1: [2, 1] }, { 8: [1, 41] }, { 4: 17, 5: $V5, 7: 42, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 43, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 44, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 45, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 46, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 47, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 48, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 49, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 50, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 26: 51, 89: [1, 52], 90: [1, 53] }, { 55: 54, 89: [1, 55], 90: [1, 56] }, { 29: [1, 59], 61: [1, 57], 63: [1, 58] }, o($Vn, [2, 17]), o($Vn, [2, 18]), o($Vn, [2, 19]), o($Vn, [2, 20]), { 30: 60, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, { 30: 63, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, { 30: 64, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, o($Vp, [2, 29]), o($Vp, [2, 30]), o($Vp, [2, 31]), o($Vp, [2, 32]), o($Vp, [2, 33]), o($Vp, [2, 34]), o($Vq, [2, 81]), o($Vq, [2, 82]), { 1: [2, 3] }, { 8: [2, 8] }, { 8: [2, 9] }, { 8: [2, 10] }, { 8: [2, 11] }, { 8: [2, 12] }, { 8: [2, 13] }, { 8: [2, 14] }, { 8: [2, 15] }, { 8: [2, 16] }, { 27: [1, 65], 29: [1, 66] }, o($Vr, [2, 79]), o($Vr, [2, 80]), { 27: [1, 67], 29: [1, 68] }, o($Vr, [2, 85]), o($Vr, [2, 86]), { 62: 69, 65: $Vs, 66: $Vt, 67: $Vu, 68: $Vv, 69: $Vw, 70: $Vx, 71: $Vy }, { 62: 77, 65: $Vs, 66: $Vt, 67: $Vu, 68: $Vv, 69: $Vw, 70: $Vx, 71: $Vy }, { 30: 78, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, { 73: 79, 75: $Vz, 76: $VA, 78: 81, 79: 82, 80: $VB, 81: $VC, 82: $VD, 83: $VE, 84: $VF, 85: $VG, 86: $VH, 87: $VI, 88: $VJ }, o($VK, [2, 60]), o($VK, [2, 62]), { 73: 93, 75: $Vz, 76: $VA, 78: 81, 79: 82, 80: $VB, 81: $VC, 82: $VD, 83: $VE, 84: $VF, 85: $VG, 86: $VH, 87: $VI, 88: $VJ }, { 30: 94, 33: 62, 75: $Vo, 76: $VA, 89: $Vl, 90: $Vm }, { 5: [1, 95] }, { 30: 96, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, { 5: [1, 97] }, { 30: 98, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, { 63: [1, 99] }, o($VL, [2, 50]), o($VL, [2, 51]), o($VL, [2, 52]), o($VL, [2, 53]), o($VL, [2, 54]), o($VL, [2, 55]), o($VL, [2, 56]), { 64: [1, 100] }, o($Vn, [2, 59], { 76: $VA }), o($Vn, [2, 64], { 76: $VM }), { 33: 103, 75: [1, 102], 89: $Vl, 90: $Vm }, o($VN, [2, 65], { 79: 104, 75: $Vz, 80: $VB, 81: $VC, 82: $VD, 83: $VE, 84: $VF, 85: $VG, 86: $VH, 87: $VI, 88: $VJ }), o($VO, [2, 67]), o($VO, [2, 69]), o($VO, [2, 70]), o($VO, [2, 71]), o($VO, [2, 72]), o($VO, [2, 73]), o($VO, [2, 74]), o($VO, [2, 75]), o($VO, [2, 76]), o($VO, [2, 77]), o($VO, [2, 78]), o($Vn, [2, 57], { 76: $VM }), o($Vn, [2, 58], { 76: $VA }), { 5: $VP, 28: 105, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 27: [1, 112], 76: $VA }, { 5: $VV, 40: $VW, 56: 113, 57: $VX, 59: $VY }, { 27: [1, 118], 76: $VA }, { 33: 119, 89: $Vl, 90: $Vm }, { 33: 120, 89: $Vl, 90: $Vm }, { 75: $Vz, 78: 121, 79: 82, 80: $VB, 81: $VC, 82: $VD, 83: $VE, 84: $VF, 85: $VG, 86: $VH, 87: $VI, 88: $VJ }, o($VK, [2, 61]), o($VK, [2, 63]), o($VO, [2, 68]), o($Vn, [2, 21]), { 32: [1, 122] }, { 32: [1, 123] }, { 32: [1, 124] }, { 32: [1, 125] }, { 5: $VP, 28: 126, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, o($Vn, [2, 28]), { 5: [1, 127] }, o($Vn, [2, 42]), { 32: [1, 128] }, { 32: [1, 129] }, { 5: $VV, 40: $VW, 56: 130, 57: $VX, 59: $VY }, o($Vn, [2, 47]), { 5: [1, 131] }, o($Vn, [2, 48]), o($Vn, [2, 49]), o($VN, [2, 66], { 79: 104, 75: $Vz, 80: $VB, 81: $VC, 82: $VD, 83: $VE, 84: $VF, 85: $VG, 86: $VH, 87: $VI, 88: $VJ }), { 33: 132, 89: $Vl, 90: $Vm }, { 35: 133, 89: [1, 134], 90: [1, 135] }, { 37: 136, 47: [1, 137], 48: [1, 138], 49: [1, 139] }, { 39: 140, 50: [1, 141], 51: [1, 142], 52: [1, 143], 53: [1, 144] }, o($Vn, [2, 27]), { 5: $VP, 28: 145, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 58: 146, 89: [1, 147], 90: [1, 148] }, { 60: 149, 89: [1, 150], 90: [1, 151] }, o($Vn, [2, 46]), { 5: $VV, 40: $VW, 56: 152, 57: $VX, 59: $VY }, { 5: [1, 153] }, { 5: [1, 154] }, { 5: [2, 83] }, { 5: [2, 84] }, { 5: [1, 155] }, { 5: [2, 35] }, { 5: [2, 36] }, { 5: [2, 37] }, { 5: [1, 156] }, { 5: [2, 38] }, { 5: [2, 39] }, { 5: [2, 40] }, { 5: [2, 41] }, o($Vn, [2, 22]), { 5: [1, 157] }, { 5: [2, 87] }, { 5: [2, 88] }, { 5: [1, 158] }, { 5: [2, 89] }, { 5: [2, 90] }, o($Vn, [2, 43]), { 5: $VP, 28: 159, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 5: $VP, 28: 160, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 5: $VP, 28: 161, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 5: $VP, 28: 162, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 5: $VV, 40: $VW, 56: 163, 57: $VX, 59: $VY }, { 5: $VV, 40: $VW, 56: 164, 57: $VX, 59: $VY }, o($Vn, [2, 23]), o($Vn, [2, 24]), o($Vn, [2, 25]), o($Vn, [2, 26]), o($Vn, [2, 44]), o($Vn, [2, 45])],
178
+ defaultActions: { 8: [2, 2], 12: [2, 1], 41: [2, 3], 42: [2, 8], 43: [2, 9], 44: [2, 10], 45: [2, 11], 46: [2, 12], 47: [2, 13], 48: [2, 14], 49: [2, 15], 50: [2, 16], 134: [2, 83], 135: [2, 84], 137: [2, 35], 138: [2, 36], 139: [2, 37], 141: [2, 38], 142: [2, 39], 143: [2, 40], 144: [2, 41], 147: [2, 87], 148: [2, 88], 150: [2, 89], 151: [2, 90] },
179
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
180
+ if (hash.recoverable) {
181
+ this.trace(str);
182
+ } else {
183
+ var error = new Error(str);
184
+ error.hash = hash;
185
+ throw error;
186
+ }
187
+ }, "parseError"),
188
+ parse: /* @__PURE__ */ __name(function parse(input) {
189
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
190
+ var args = lstack.slice.call(arguments, 1);
191
+ var lexer2 = Object.create(this.lexer);
192
+ var sharedState = { yy: {} };
193
+ for (var k in this.yy) {
194
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
195
+ sharedState.yy[k] = this.yy[k];
196
+ }
197
+ }
198
+ lexer2.setInput(input, sharedState.yy);
199
+ sharedState.yy.lexer = lexer2;
200
+ sharedState.yy.parser = this;
201
+ if (typeof lexer2.yylloc == "undefined") {
202
+ lexer2.yylloc = {};
203
+ }
204
+ var yyloc = lexer2.yylloc;
205
+ lstack.push(yyloc);
206
+ var ranges = lexer2.options && lexer2.options.ranges;
207
+ if (typeof sharedState.yy.parseError === "function") {
208
+ this.parseError = sharedState.yy.parseError;
209
+ } else {
210
+ this.parseError = Object.getPrototypeOf(this).parseError;
211
+ }
212
+ function popStack(n) {
213
+ stack.length = stack.length - 2 * n;
214
+ vstack.length = vstack.length - n;
215
+ lstack.length = lstack.length - n;
216
+ }
217
+ __name(popStack, "popStack");
218
+ function lex() {
219
+ var token;
220
+ token = tstack.pop() || lexer2.lex() || EOF;
221
+ if (typeof token !== "number") {
222
+ if (token instanceof Array) {
223
+ tstack = token;
224
+ token = tstack.pop();
225
+ }
226
+ token = self.symbols_[token] || token;
227
+ }
228
+ return token;
229
+ }
230
+ __name(lex, "lex");
231
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
232
+ while (true) {
233
+ state = stack[stack.length - 1];
234
+ if (this.defaultActions[state]) {
235
+ action = this.defaultActions[state];
236
+ } else {
237
+ if (symbol === null || typeof symbol == "undefined") {
238
+ symbol = lex();
239
+ }
240
+ action = table[state] && table[state][symbol];
241
+ }
242
+ if (typeof action === "undefined" || !action.length || !action[0]) {
243
+ var errStr = "";
244
+ expected = [];
245
+ for (p in table[state]) {
246
+ if (this.terminals_[p] && p > TERROR) {
247
+ expected.push("'" + this.terminals_[p] + "'");
248
+ }
249
+ }
250
+ if (lexer2.showPosition) {
251
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
252
+ } else {
253
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
254
+ }
255
+ this.parseError(errStr, {
256
+ text: lexer2.match,
257
+ token: this.terminals_[symbol] || symbol,
258
+ line: lexer2.yylineno,
259
+ loc: yyloc,
260
+ expected
261
+ });
262
+ }
263
+ if (action[0] instanceof Array && action.length > 1) {
264
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
265
+ }
266
+ switch (action[0]) {
267
+ case 1:
268
+ stack.push(symbol);
269
+ vstack.push(lexer2.yytext);
270
+ lstack.push(lexer2.yylloc);
271
+ stack.push(action[1]);
272
+ symbol = null;
273
+ {
274
+ yyleng = lexer2.yyleng;
275
+ yytext = lexer2.yytext;
276
+ yylineno = lexer2.yylineno;
277
+ yyloc = lexer2.yylloc;
278
+ }
279
+ break;
280
+ case 2:
281
+ len = this.productions_[action[1]][1];
282
+ yyval.$ = vstack[vstack.length - len];
283
+ yyval._$ = {
284
+ first_line: lstack[lstack.length - (len || 1)].first_line,
285
+ last_line: lstack[lstack.length - 1].last_line,
286
+ first_column: lstack[lstack.length - (len || 1)].first_column,
287
+ last_column: lstack[lstack.length - 1].last_column
288
+ };
289
+ if (ranges) {
290
+ yyval._$.range = [
291
+ lstack[lstack.length - (len || 1)].range[0],
292
+ lstack[lstack.length - 1].range[1]
293
+ ];
294
+ }
295
+ r = this.performAction.apply(yyval, [
296
+ yytext,
297
+ yyleng,
298
+ yylineno,
299
+ sharedState.yy,
300
+ action[1],
301
+ vstack,
302
+ lstack
303
+ ].concat(args));
304
+ if (typeof r !== "undefined") {
305
+ return r;
306
+ }
307
+ if (len) {
308
+ stack = stack.slice(0, -1 * len * 2);
309
+ vstack = vstack.slice(0, -1 * len);
310
+ lstack = lstack.slice(0, -1 * len);
311
+ }
312
+ stack.push(this.productions_[action[1]][0]);
313
+ vstack.push(yyval.$);
314
+ lstack.push(yyval._$);
315
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
316
+ stack.push(newState);
317
+ break;
318
+ case 3:
319
+ return true;
320
+ }
321
+ }
322
+ return true;
323
+ }, "parse")
324
+ };
325
+ var lexer = /* @__PURE__ */ (function() {
326
+ var lexer2 = {
327
+ EOF: 1,
328
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
329
+ if (this.yy.parser) {
330
+ this.yy.parser.parseError(str, hash);
331
+ } else {
332
+ throw new Error(str);
333
+ }
334
+ }, "parseError"),
335
+ // resets the lexer, sets new input
336
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
337
+ this.yy = yy || this.yy || {};
338
+ this._input = input;
339
+ this._more = this._backtrack = this.done = false;
340
+ this.yylineno = this.yyleng = 0;
341
+ this.yytext = this.matched = this.match = "";
342
+ this.conditionStack = ["INITIAL"];
343
+ this.yylloc = {
344
+ first_line: 1,
345
+ first_column: 0,
346
+ last_line: 1,
347
+ last_column: 0
348
+ };
349
+ if (this.options.ranges) {
350
+ this.yylloc.range = [0, 0];
351
+ }
352
+ this.offset = 0;
353
+ return this;
354
+ }, "setInput"),
355
+ // consumes and returns one char from the input
356
+ input: /* @__PURE__ */ __name(function() {
357
+ var ch = this._input[0];
358
+ this.yytext += ch;
359
+ this.yyleng++;
360
+ this.offset++;
361
+ this.match += ch;
362
+ this.matched += ch;
363
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
364
+ if (lines) {
365
+ this.yylineno++;
366
+ this.yylloc.last_line++;
367
+ } else {
368
+ this.yylloc.last_column++;
369
+ }
370
+ if (this.options.ranges) {
371
+ this.yylloc.range[1]++;
372
+ }
373
+ this._input = this._input.slice(1);
374
+ return ch;
375
+ }, "input"),
376
+ // unshifts one char (or a string) into the input
377
+ unput: /* @__PURE__ */ __name(function(ch) {
378
+ var len = ch.length;
379
+ var lines = ch.split(/(?:\r\n?|\n)/g);
380
+ this._input = ch + this._input;
381
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
382
+ this.offset -= len;
383
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
384
+ this.match = this.match.substr(0, this.match.length - 1);
385
+ this.matched = this.matched.substr(0, this.matched.length - 1);
386
+ if (lines.length - 1) {
387
+ this.yylineno -= lines.length - 1;
388
+ }
389
+ var r = this.yylloc.range;
390
+ this.yylloc = {
391
+ first_line: this.yylloc.first_line,
392
+ last_line: this.yylineno + 1,
393
+ first_column: this.yylloc.first_column,
394
+ 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
395
+ };
396
+ if (this.options.ranges) {
397
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
398
+ }
399
+ this.yyleng = this.yytext.length;
400
+ return this;
401
+ }, "unput"),
402
+ // When called from action, caches matched text and appends it on next action
403
+ more: /* @__PURE__ */ __name(function() {
404
+ this._more = true;
405
+ return this;
406
+ }, "more"),
407
+ // 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.
408
+ reject: /* @__PURE__ */ __name(function() {
409
+ if (this.options.backtrack_lexer) {
410
+ this._backtrack = true;
411
+ } else {
412
+ 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(), {
413
+ text: "",
414
+ token: null,
415
+ line: this.yylineno
416
+ });
417
+ }
418
+ return this;
419
+ }, "reject"),
420
+ // retain first n characters of the match
421
+ less: /* @__PURE__ */ __name(function(n) {
422
+ this.unput(this.match.slice(n));
423
+ }, "less"),
424
+ // displays already matched input, i.e. for error messages
425
+ pastInput: /* @__PURE__ */ __name(function() {
426
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
427
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
428
+ }, "pastInput"),
429
+ // displays upcoming input, i.e. for error messages
430
+ upcomingInput: /* @__PURE__ */ __name(function() {
431
+ var next = this.match;
432
+ if (next.length < 20) {
433
+ next += this._input.substr(0, 20 - next.length);
434
+ }
435
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
436
+ }, "upcomingInput"),
437
+ // displays the character position where the lexing error occurred, i.e. for error messages
438
+ showPosition: /* @__PURE__ */ __name(function() {
439
+ var pre = this.pastInput();
440
+ var c = new Array(pre.length + 1).join("-");
441
+ return pre + this.upcomingInput() + "\n" + c + "^";
442
+ }, "showPosition"),
443
+ // test the lexed token: return FALSE when not a match, otherwise return token
444
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
445
+ var token, lines, backup;
446
+ if (this.options.backtrack_lexer) {
447
+ backup = {
448
+ yylineno: this.yylineno,
449
+ yylloc: {
450
+ first_line: this.yylloc.first_line,
451
+ last_line: this.last_line,
452
+ first_column: this.yylloc.first_column,
453
+ last_column: this.yylloc.last_column
454
+ },
455
+ yytext: this.yytext,
456
+ match: this.match,
457
+ matches: this.matches,
458
+ matched: this.matched,
459
+ yyleng: this.yyleng,
460
+ offset: this.offset,
461
+ _more: this._more,
462
+ _input: this._input,
463
+ yy: this.yy,
464
+ conditionStack: this.conditionStack.slice(0),
465
+ done: this.done
466
+ };
467
+ if (this.options.ranges) {
468
+ backup.yylloc.range = this.yylloc.range.slice(0);
469
+ }
470
+ }
471
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
472
+ if (lines) {
473
+ this.yylineno += lines.length;
474
+ }
475
+ this.yylloc = {
476
+ first_line: this.yylloc.last_line,
477
+ last_line: this.yylineno + 1,
478
+ first_column: this.yylloc.last_column,
479
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
480
+ };
481
+ this.yytext += match[0];
482
+ this.match += match[0];
483
+ this.matches = match;
484
+ this.yyleng = this.yytext.length;
485
+ if (this.options.ranges) {
486
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
487
+ }
488
+ this._more = false;
489
+ this._backtrack = false;
490
+ this._input = this._input.slice(match[0].length);
491
+ this.matched += match[0];
492
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
493
+ if (this.done && this._input) {
494
+ this.done = false;
495
+ }
496
+ if (token) {
497
+ return token;
498
+ } else if (this._backtrack) {
499
+ for (var k in backup) {
500
+ this[k] = backup[k];
501
+ }
502
+ return false;
503
+ }
504
+ return false;
505
+ }, "test_match"),
506
+ // return next match in input
507
+ next: /* @__PURE__ */ __name(function() {
508
+ if (this.done) {
509
+ return this.EOF;
510
+ }
511
+ if (!this._input) {
512
+ this.done = true;
513
+ }
514
+ var token, match, tempMatch, index;
515
+ if (!this._more) {
516
+ this.yytext = "";
517
+ this.match = "";
518
+ }
519
+ var rules = this._currentRules();
520
+ for (var i = 0; i < rules.length; i++) {
521
+ tempMatch = this._input.match(this.rules[rules[i]]);
522
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
523
+ match = tempMatch;
524
+ index = i;
525
+ if (this.options.backtrack_lexer) {
526
+ token = this.test_match(tempMatch, rules[i]);
527
+ if (token !== false) {
528
+ return token;
529
+ } else if (this._backtrack) {
530
+ match = false;
531
+ continue;
532
+ } else {
533
+ return false;
534
+ }
535
+ } else if (!this.options.flex) {
536
+ break;
537
+ }
538
+ }
539
+ }
540
+ if (match) {
541
+ token = this.test_match(match, rules[index]);
542
+ if (token !== false) {
543
+ return token;
544
+ }
545
+ return false;
546
+ }
547
+ if (this._input === "") {
548
+ return this.EOF;
549
+ } else {
550
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
551
+ text: "",
552
+ token: null,
553
+ line: this.yylineno
554
+ });
555
+ }
556
+ }, "next"),
557
+ // return next match that has a token
558
+ lex: /* @__PURE__ */ __name(function lex() {
559
+ var r = this.next();
560
+ if (r) {
561
+ return r;
562
+ } else {
563
+ return this.lex();
564
+ }
565
+ }, "lex"),
566
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
567
+ begin: /* @__PURE__ */ __name(function begin(condition) {
568
+ this.conditionStack.push(condition);
569
+ }, "begin"),
570
+ // pop the previously active lexer condition state off the condition stack
571
+ popState: /* @__PURE__ */ __name(function popState() {
572
+ var n = this.conditionStack.length - 1;
573
+ if (n > 0) {
574
+ return this.conditionStack.pop();
575
+ } else {
576
+ return this.conditionStack[0];
577
+ }
578
+ }, "popState"),
579
+ // produce the lexer rule set which is active for the currently active lexer condition state
580
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
581
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
582
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
583
+ } else {
584
+ return this.conditions["INITIAL"].rules;
585
+ }
586
+ }, "_currentRules"),
587
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
588
+ topState: /* @__PURE__ */ __name(function topState(n) {
589
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
590
+ if (n >= 0) {
591
+ return this.conditionStack[n];
592
+ } else {
593
+ return "INITIAL";
594
+ }
595
+ }, "topState"),
596
+ // alias for begin(condition)
597
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
598
+ this.begin(condition);
599
+ }, "pushState"),
600
+ // return the number of states currently on the stack
601
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
602
+ return this.conditionStack.length;
603
+ }, "stateStackSize"),
604
+ options: { "case-insensitive": true },
605
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
606
+ switch ($avoiding_name_collisions) {
607
+ case 0:
608
+ return "title";
609
+ case 1:
610
+ this.begin("acc_title");
611
+ return 9;
612
+ case 2:
613
+ this.popState();
614
+ return "acc_title_value";
615
+ case 3:
616
+ this.begin("acc_descr");
617
+ return 11;
618
+ case 4:
619
+ this.popState();
620
+ return "acc_descr_value";
621
+ case 5:
622
+ this.begin("acc_descr_multiline");
623
+ break;
624
+ case 6:
625
+ this.popState();
626
+ break;
627
+ case 7:
628
+ return "acc_descr_multiline_value";
629
+ case 8:
630
+ return 21;
631
+ case 9:
632
+ return 22;
633
+ case 10:
634
+ return 23;
635
+ case 11:
636
+ return 24;
637
+ case 12:
638
+ return 5;
639
+ case 13:
640
+ break;
641
+ case 14:
642
+ break;
643
+ case 15:
644
+ break;
645
+ case 16:
646
+ return 8;
647
+ case 17:
648
+ return 6;
649
+ case 18:
650
+ return 27;
651
+ case 19:
652
+ return 40;
653
+ case 20:
654
+ return 29;
655
+ case 21:
656
+ return 32;
657
+ case 22:
658
+ return 31;
659
+ case 23:
660
+ return 34;
661
+ case 24:
662
+ return 36;
663
+ case 25:
664
+ return 38;
665
+ case 26:
666
+ return 41;
667
+ case 27:
668
+ return 42;
669
+ case 28:
670
+ return 43;
671
+ case 29:
672
+ return 44;
673
+ case 30:
674
+ return 45;
675
+ case 31:
676
+ return 46;
677
+ case 32:
678
+ return 47;
679
+ case 33:
680
+ return 48;
681
+ case 34:
682
+ return 49;
683
+ case 35:
684
+ return 50;
685
+ case 36:
686
+ return 51;
687
+ case 37:
688
+ return 52;
689
+ case 38:
690
+ return 53;
691
+ case 39:
692
+ return 54;
693
+ case 40:
694
+ return 65;
695
+ case 41:
696
+ return 66;
697
+ case 42:
698
+ return 67;
699
+ case 43:
700
+ return 68;
701
+ case 44:
702
+ return 69;
703
+ case 45:
704
+ return 70;
705
+ case 46:
706
+ return 71;
707
+ case 47:
708
+ return 57;
709
+ case 48:
710
+ return 59;
711
+ case 49:
712
+ this.begin("style");
713
+ return 77;
714
+ case 50:
715
+ return 75;
716
+ case 51:
717
+ return 81;
718
+ case 52:
719
+ return 88;
720
+ case 53:
721
+ return "PERCENT";
722
+ case 54:
723
+ return 86;
724
+ case 55:
725
+ return 84;
726
+ case 56:
727
+ break;
728
+ case 57:
729
+ this.begin("string");
730
+ break;
731
+ case 58:
732
+ this.popState();
733
+ break;
734
+ case 59:
735
+ this.begin("style");
736
+ return 72;
737
+ case 60:
738
+ this.begin("style");
739
+ return 74;
740
+ case 61:
741
+ return 61;
742
+ case 62:
743
+ return 64;
744
+ case 63:
745
+ return 63;
746
+ case 64:
747
+ this.begin("string");
748
+ break;
749
+ case 65:
750
+ this.popState();
751
+ break;
752
+ case 66:
753
+ return "qString";
754
+ case 67:
755
+ yy_.yytext = yy_.yytext.trim();
756
+ return 89;
757
+ case 68:
758
+ return 75;
759
+ case 69:
760
+ return 80;
761
+ case 70:
762
+ return 76;
763
+ }
764
+ }, "anonymous"),
765
+ rules: [/^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:(\r?\n)+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:$)/i, /^(?:requirementDiagram\b)/i, /^(?:\{)/i, /^(?:\})/i, /^(?::{3})/i, /^(?::)/i, /^(?:id\b)/i, /^(?:text\b)/i, /^(?:risk\b)/i, /^(?:verifyMethod\b)/i, /^(?:requirement\b)/i, /^(?:functionalRequirement\b)/i, /^(?:interfaceRequirement\b)/i, /^(?:performanceRequirement\b)/i, /^(?:physicalRequirement\b)/i, /^(?:designConstraint\b)/i, /^(?:low\b)/i, /^(?:medium\b)/i, /^(?:high\b)/i, /^(?:analysis\b)/i, /^(?:demonstration\b)/i, /^(?:inspection\b)/i, /^(?:test\b)/i, /^(?:element\b)/i, /^(?:contains\b)/i, /^(?:copies\b)/i, /^(?:derives\b)/i, /^(?:satisfies\b)/i, /^(?:verifies\b)/i, /^(?:refines\b)/i, /^(?:traces\b)/i, /^(?:type\b)/i, /^(?:docref\b)/i, /^(?:style\b)/i, /^(?:\w+)/i, /^(?::)/i, /^(?:;)/i, /^(?:%)/i, /^(?:-)/i, /^(?:#)/i, /^(?: )/i, /^(?:["])/i, /^(?:\n)/i, /^(?:classDef\b)/i, /^(?:class\b)/i, /^(?:<-)/i, /^(?:->)/i, /^(?:-)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i, /^(?:\w+)/i, /^(?:[0-9]+)/i, /^(?:,)/i],
766
+ conditions: { "acc_descr_multiline": { "rules": [6, 7, 68, 69, 70], "inclusive": false }, "acc_descr": { "rules": [4, 68, 69, 70], "inclusive": false }, "acc_title": { "rules": [2, 68, 69, 70], "inclusive": false }, "style": { "rules": [50, 51, 52, 53, 54, 55, 56, 57, 58, 68, 69, 70], "inclusive": false }, "unqString": { "rules": [68, 69, 70], "inclusive": false }, "token": { "rules": [68, 69, 70], "inclusive": false }, "string": { "rules": [65, 66, 68, 69, 70], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 59, 60, 61, 62, 63, 64, 67, 68, 69, 70], "inclusive": true } }
767
+ };
768
+ return lexer2;
769
+ })();
770
+ parser2.lexer = lexer;
771
+ function Parser() {
772
+ this.yy = {};
773
+ }
774
+ __name(Parser, "Parser");
775
+ Parser.prototype = parser2;
776
+ parser2.Parser = Parser;
777
+ return new Parser();
778
+ })();
779
+ parser.parser = parser;
780
+ var requirementDiagram_default = parser;
781
+ var RequirementDB = (_a = class {
782
+ constructor() {
783
+ this.relations = [];
784
+ this.latestRequirement = this.getInitialRequirement();
785
+ this.requirements = /* @__PURE__ */ new Map();
786
+ this.latestElement = this.getInitialElement();
787
+ this.elements = /* @__PURE__ */ new Map();
788
+ this.classes = /* @__PURE__ */ new Map();
789
+ this.direction = "TB";
790
+ this.RequirementType = {
791
+ REQUIREMENT: "Requirement",
792
+ FUNCTIONAL_REQUIREMENT: "Functional Requirement",
793
+ INTERFACE_REQUIREMENT: "Interface Requirement",
794
+ PERFORMANCE_REQUIREMENT: "Performance Requirement",
795
+ PHYSICAL_REQUIREMENT: "Physical Requirement",
796
+ DESIGN_CONSTRAINT: "Design Constraint"
797
+ };
798
+ this.RiskLevel = {
799
+ LOW_RISK: "Low",
800
+ MED_RISK: "Medium",
801
+ HIGH_RISK: "High"
802
+ };
803
+ this.VerifyType = {
804
+ VERIFY_ANALYSIS: "Analysis",
805
+ VERIFY_DEMONSTRATION: "Demonstration",
806
+ VERIFY_INSPECTION: "Inspection",
807
+ VERIFY_TEST: "Test"
808
+ };
809
+ this.Relationships = {
810
+ CONTAINS: "contains",
811
+ COPIES: "copies",
812
+ DERIVES: "derives",
813
+ SATISFIES: "satisfies",
814
+ VERIFIES: "verifies",
815
+ REFINES: "refines",
816
+ TRACES: "traces"
817
+ };
818
+ this.setAccTitle = setAccTitle;
819
+ this.getAccTitle = getAccTitle;
820
+ this.setAccDescription = setAccDescription;
821
+ this.getAccDescription = getAccDescription;
822
+ this.setDiagramTitle = setDiagramTitle;
823
+ this.getDiagramTitle = getDiagramTitle;
824
+ this.getConfig = /* @__PURE__ */ __name(() => getConfig2().requirement, "getConfig");
825
+ this.clear();
826
+ this.setDirection = this.setDirection.bind(this);
827
+ this.addRequirement = this.addRequirement.bind(this);
828
+ this.setNewReqId = this.setNewReqId.bind(this);
829
+ this.setNewReqRisk = this.setNewReqRisk.bind(this);
830
+ this.setNewReqText = this.setNewReqText.bind(this);
831
+ this.setNewReqVerifyMethod = this.setNewReqVerifyMethod.bind(this);
832
+ this.addElement = this.addElement.bind(this);
833
+ this.setNewElementType = this.setNewElementType.bind(this);
834
+ this.setNewElementDocRef = this.setNewElementDocRef.bind(this);
835
+ this.addRelationship = this.addRelationship.bind(this);
836
+ this.setCssStyle = this.setCssStyle.bind(this);
837
+ this.setClass = this.setClass.bind(this);
838
+ this.defineClass = this.defineClass.bind(this);
839
+ this.setAccTitle = this.setAccTitle.bind(this);
840
+ this.setAccDescription = this.setAccDescription.bind(this);
841
+ }
842
+ getDirection() {
843
+ return this.direction;
844
+ }
845
+ setDirection(dir) {
846
+ this.direction = dir;
847
+ }
848
+ resetLatestRequirement() {
849
+ this.latestRequirement = this.getInitialRequirement();
850
+ }
851
+ resetLatestElement() {
852
+ this.latestElement = this.getInitialElement();
853
+ }
854
+ getInitialRequirement() {
855
+ return {
856
+ requirementId: "",
857
+ text: "",
858
+ risk: "",
859
+ verifyMethod: "",
860
+ name: "",
861
+ type: "",
862
+ cssStyles: [],
863
+ classes: ["default"]
864
+ };
865
+ }
866
+ getInitialElement() {
867
+ return {
868
+ name: "",
869
+ type: "",
870
+ docRef: "",
871
+ cssStyles: [],
872
+ classes: ["default"]
873
+ };
874
+ }
875
+ addRequirement(name, type) {
876
+ if (!this.requirements.has(name)) {
877
+ this.requirements.set(name, {
878
+ name,
879
+ type,
880
+ requirementId: this.latestRequirement.requirementId,
881
+ text: this.latestRequirement.text,
882
+ risk: this.latestRequirement.risk,
883
+ verifyMethod: this.latestRequirement.verifyMethod,
884
+ cssStyles: [],
885
+ classes: ["default"]
886
+ });
887
+ }
888
+ this.resetLatestRequirement();
889
+ return this.requirements.get(name);
890
+ }
891
+ getRequirements() {
892
+ return this.requirements;
893
+ }
894
+ setNewReqId(id) {
895
+ if (this.latestRequirement !== void 0) {
896
+ this.latestRequirement.requirementId = id;
897
+ }
898
+ }
899
+ setNewReqText(text) {
900
+ if (this.latestRequirement !== void 0) {
901
+ this.latestRequirement.text = text;
902
+ }
903
+ }
904
+ setNewReqRisk(risk) {
905
+ if (this.latestRequirement !== void 0) {
906
+ this.latestRequirement.risk = risk;
907
+ }
908
+ }
909
+ setNewReqVerifyMethod(verifyMethod) {
910
+ if (this.latestRequirement !== void 0) {
911
+ this.latestRequirement.verifyMethod = verifyMethod;
912
+ }
913
+ }
914
+ addElement(name) {
915
+ if (!this.elements.has(name)) {
916
+ this.elements.set(name, {
917
+ name,
918
+ type: this.latestElement.type,
919
+ docRef: this.latestElement.docRef,
920
+ cssStyles: [],
921
+ classes: ["default"]
922
+ });
923
+ log.info("Added new element: ", name);
924
+ }
925
+ this.resetLatestElement();
926
+ return this.elements.get(name);
927
+ }
928
+ getElements() {
929
+ return this.elements;
930
+ }
931
+ setNewElementType(type) {
932
+ if (this.latestElement !== void 0) {
933
+ this.latestElement.type = type;
934
+ }
935
+ }
936
+ setNewElementDocRef(docRef) {
937
+ if (this.latestElement !== void 0) {
938
+ this.latestElement.docRef = docRef;
939
+ }
940
+ }
941
+ addRelationship(type, src, dst) {
942
+ this.relations.push({
943
+ type,
944
+ src,
945
+ dst
946
+ });
947
+ }
948
+ getRelationships() {
949
+ return this.relations;
950
+ }
951
+ clear() {
952
+ this.relations = [];
953
+ this.resetLatestRequirement();
954
+ this.requirements = /* @__PURE__ */ new Map();
955
+ this.resetLatestElement();
956
+ this.elements = /* @__PURE__ */ new Map();
957
+ this.classes = /* @__PURE__ */ new Map();
958
+ clear();
959
+ }
960
+ setCssStyle(ids, styles) {
961
+ for (const id of ids) {
962
+ const node = this.requirements.get(id) ?? this.elements.get(id);
963
+ if (!styles || !node) {
964
+ return;
965
+ }
966
+ for (const s of styles) {
967
+ if (s.includes(",")) {
968
+ node.cssStyles.push(...s.split(","));
969
+ } else {
970
+ node.cssStyles.push(s);
971
+ }
972
+ }
973
+ }
974
+ }
975
+ setClass(ids, classNames) {
976
+ var _a2;
977
+ for (const id of ids) {
978
+ const node = this.requirements.get(id) ?? this.elements.get(id);
979
+ if (node) {
980
+ for (const _class of classNames) {
981
+ node.classes.push(_class);
982
+ const styles = (_a2 = this.classes.get(_class)) == null ? void 0 : _a2.styles;
983
+ if (styles) {
984
+ node.cssStyles.push(...styles);
985
+ }
986
+ }
987
+ }
988
+ }
989
+ }
990
+ defineClass(ids, style) {
991
+ for (const id of ids) {
992
+ let styleClass = this.classes.get(id);
993
+ if (styleClass === void 0) {
994
+ styleClass = { id, styles: [], textStyles: [] };
995
+ this.classes.set(id, styleClass);
996
+ }
997
+ if (style) {
998
+ style.forEach(function(s) {
999
+ if (/color/.exec(s)) {
1000
+ const newStyle = s.replace("fill", "bgFill");
1001
+ styleClass.textStyles.push(newStyle);
1002
+ }
1003
+ styleClass.styles.push(s);
1004
+ });
1005
+ }
1006
+ this.requirements.forEach((value) => {
1007
+ if (value.classes.includes(id)) {
1008
+ value.cssStyles.push(...style.flatMap((s) => s.split(",")));
1009
+ }
1010
+ });
1011
+ this.elements.forEach((value) => {
1012
+ if (value.classes.includes(id)) {
1013
+ value.cssStyles.push(...style.flatMap((s) => s.split(",")));
1014
+ }
1015
+ });
1016
+ }
1017
+ }
1018
+ getClasses() {
1019
+ return this.classes;
1020
+ }
1021
+ getData() {
1022
+ var _a2, _b, _c, _d;
1023
+ const config = getConfig2();
1024
+ const nodes = [];
1025
+ const edges = [];
1026
+ for (const requirement of this.requirements.values()) {
1027
+ const node = requirement;
1028
+ node.id = requirement.name;
1029
+ node.cssStyles = requirement.cssStyles;
1030
+ node.cssClasses = requirement.classes.join(" ");
1031
+ node.shape = "requirementBox";
1032
+ node.look = config.look;
1033
+ node.colorIndex = nodes.length;
1034
+ nodes.push(node);
1035
+ }
1036
+ for (const element of this.elements.values()) {
1037
+ const node = element;
1038
+ node.shape = "requirementBox";
1039
+ node.look = config.look;
1040
+ node.id = element.name;
1041
+ node.cssStyles = element.cssStyles;
1042
+ node.cssClasses = element.classes.join(" ");
1043
+ node.colorIndex = nodes.length;
1044
+ nodes.push(node);
1045
+ }
1046
+ for (const relation of this.relations) {
1047
+ let counter = 0;
1048
+ const isContains = relation.type === this.Relationships.CONTAINS;
1049
+ const edge = {
1050
+ id: `${relation.src}-${relation.dst}-${counter}`,
1051
+ start: ((_a2 = this.requirements.get(relation.src)) == null ? void 0 : _a2.name) ?? ((_b = this.elements.get(relation.src)) == null ? void 0 : _b.name),
1052
+ end: ((_c = this.requirements.get(relation.dst)) == null ? void 0 : _c.name) ?? ((_d = this.elements.get(relation.dst)) == null ? void 0 : _d.name),
1053
+ label: `&lt;&lt;${relation.type}&gt;&gt;`,
1054
+ classes: "relationshipLine",
1055
+ style: ["fill:none", isContains ? "" : "stroke-dasharray: 10,7"],
1056
+ labelpos: "c",
1057
+ thickness: "normal",
1058
+ type: "normal",
1059
+ pattern: isContains ? "normal" : "dashed",
1060
+ arrowTypeStart: isContains ? "requirement_contains" : "",
1061
+ arrowTypeEnd: isContains ? "" : "requirement_arrow",
1062
+ look: config.look,
1063
+ labelType: "markdown"
1064
+ };
1065
+ edges.push(edge);
1066
+ counter++;
1067
+ }
1068
+ return { nodes, edges, other: {}, config, direction: this.getDirection() };
1069
+ }
1070
+ }, __name(_a, "RequirementDB"), _a);
1071
+ var genColor = /* @__PURE__ */ __name((options) => {
1072
+ const config = getConfig();
1073
+ const { themeVariables, look } = config;
1074
+ const { bkgColorArray, borderColorArray } = themeVariables;
1075
+ if (!(borderColorArray == null ? void 0 : borderColorArray.length)) {
1076
+ return "";
1077
+ }
1078
+ let sections = "";
1079
+ for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1080
+ sections += `
1081
+
1082
+ [data-look="${look}"][data-color-id="color-${i}"].node path {
1083
+ stroke: ${borderColorArray[i]};
1084
+ fill: ${(bkgColorArray == null ? void 0 : bkgColorArray.length) ? bkgColorArray[i] : ""};
1085
+ }
1086
+
1087
+ [data-look="${look}"][data-color-id="color-${i}"].node rect {
1088
+ stroke: ${borderColorArray[i]};
1089
+ fill: ${(bkgColorArray == null ? void 0 : bkgColorArray.length) ? bkgColorArray[i] : ""};
1090
+ }
1091
+ `;
1092
+ }
1093
+ return sections;
1094
+ }, "genColor");
1095
+ var getStyles = /* @__PURE__ */ __name((options) => {
1096
+ const config = getConfig();
1097
+ const { look, themeVariables } = config;
1098
+ const { requirementEdgeLabelBackground } = themeVariables;
1099
+ return `
1100
+ ${genColor(options)}
1101
+ marker {
1102
+ fill: ${options.relationColor};
1103
+ stroke: ${options.relationColor};
1104
+ }
1105
+
1106
+ marker.cross {
1107
+ stroke: ${options.lineColor};
1108
+ }
1109
+
1110
+ svg {
1111
+ font-family: ${options.fontFamily};
1112
+ font-size: ${options.fontSize};
1113
+ }
1114
+
1115
+ .reqBox {
1116
+ fill: ${options.requirementBackground};
1117
+ fill-opacity: 1.0;
1118
+ stroke: ${options.requirementBorderColor};
1119
+ stroke-width: ${options.requirementBorderSize};
1120
+ }
1121
+
1122
+ .reqTitle, .reqLabel{
1123
+ fill: ${options.requirementTextColor};
1124
+ }
1125
+ .reqLabelBox {
1126
+ fill: ${options.relationLabelBackground};
1127
+ fill-opacity: 1.0;
1128
+ }
1129
+
1130
+ .req-title-line {
1131
+ stroke: ${options.requirementBorderColor};
1132
+ stroke-width: ${options.requirementBorderSize};
1133
+ }
1134
+ .relationshipLine {
1135
+ stroke: ${options.relationColor};
1136
+ stroke-width: ${look === "neo" ? options.strokeWidth : "1px"};
1137
+ }
1138
+ .relationshipLabel {
1139
+ fill: ${options.relationLabelColor};
1140
+ }
1141
+ .edgeLabel {
1142
+ background-color: ${options.edgeLabelBackground};
1143
+ }
1144
+ .edgeLabel .label rect {
1145
+ fill: ${options.edgeLabelBackground};
1146
+ }
1147
+ .edgeLabel .label text {
1148
+ fill: ${options.relationLabelColor};
1149
+ }
1150
+ .divider {
1151
+ stroke: ${options.nodeBorder};
1152
+ stroke-width: 1;
1153
+ }
1154
+ .label {
1155
+ font-family: ${options.fontFamily};
1156
+ color: ${options.nodeTextColor || options.textColor};
1157
+ }
1158
+ .label text,span {
1159
+ fill: ${options.nodeTextColor || options.textColor};
1160
+ color: ${options.nodeTextColor || options.textColor};
1161
+ }
1162
+ .labelBkg {
1163
+ background-color: ${requirementEdgeLabelBackground ?? options.edgeLabelBackground};
1164
+ }
1165
+
1166
+ `;
1167
+ }, "getStyles");
1168
+ var styles_default = getStyles;
1169
+ var requirementRenderer_exports = {};
1170
+ __export(requirementRenderer_exports, {
1171
+ draw: () => draw
1172
+ });
1173
+ var draw = /* @__PURE__ */ __name(async function(text, id, _version, diag) {
1174
+ log.info("REF0:");
1175
+ log.info("Drawing requirement diagram (unified)", id);
1176
+ const { securityLevel, state: conf, layout, look } = getConfig2();
1177
+ const data4Layout = diag.db.getData();
1178
+ const svg = getDiagramElement(id, securityLevel);
1179
+ data4Layout.type = diag.type;
1180
+ data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(layout);
1181
+ data4Layout.nodeSpacing = (conf == null ? void 0 : conf.nodeSpacing) ?? 50;
1182
+ data4Layout.rankSpacing = (conf == null ? void 0 : conf.rankSpacing) ?? 50;
1183
+ data4Layout.markers = look === "neo" ? ["requirement_contains_neo", "requirement_arrow_neo"] : ["requirement_contains", "requirement_arrow"];
1184
+ data4Layout.diagramId = id;
1185
+ await render(data4Layout, svg);
1186
+ const padding = 8;
1187
+ utils_default.insertTitle(
1188
+ svg,
1189
+ "requirementDiagramTitleText",
1190
+ (conf == null ? void 0 : conf.titleTopMargin) ?? 25,
1191
+ diag.db.getDiagramTitle()
1192
+ );
1193
+ setupViewPortForSVG(svg, padding, "requirementDiagram", (conf == null ? void 0 : conf.useMaxWidth) ?? true);
1194
+ }, "draw");
1195
+ var diagram = {
1196
+ parser: requirementDiagram_default,
1197
+ get db() {
1198
+ return new RequirementDB();
1199
+ },
1200
+ renderer: requirementRenderer_exports,
1201
+ styles: styles_default
1202
+ };
1203
+ export {
1204
+ diagram
1205
+ };