lowcoder-comps 0.0.7 → 0.0.8

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 (79) hide show
  1. package/icons/icon-chart.svg +15 -0
  2. package/icons/icon-comp-calendar.svg +22 -0
  3. package/index.html +26 -0
  4. package/index.tsx +19 -0
  5. package/jest.config.js +5 -0
  6. package/package/012a06bb.js +34 -0
  7. package/package/06481cb7.js +1060 -0
  8. package/package/0c8b29d5.js +6 -0
  9. package/package/114884df.js +805 -0
  10. package/package/1264ddb2.js +194 -0
  11. package/package/1cee31ec.js +1095 -0
  12. package/package/269c3ba3.js +46662 -0
  13. package/package/2a2c2e55.js +799 -0
  14. package/package/2b3ab1e4.js +98763 -0
  15. package/package/37590a81.js +967 -0
  16. package/package/3cd7980e.js +184 -0
  17. package/package/40112498.js +424 -0
  18. package/package/4b6e1d6f.js +24 -0
  19. package/package/4bc1082b.js +86 -0
  20. package/package/53e49f9b.js +1600 -0
  21. package/package/55bd5c26.js +266 -0
  22. package/package/591684c8.js +2071 -0
  23. package/package/6c000872.js +16 -0
  24. package/package/756addec.js +775 -0
  25. package/package/7668124e.js +8 -0
  26. package/package/79e8eeeb.js +949 -0
  27. package/package/926fbfec.js +91 -0
  28. package/package/945eefb3.js +2665 -0
  29. package/package/a35f148e.js +1228 -0
  30. package/package/a4d12a43.js +175 -0
  31. package/package/a60de5d1.js +804 -0
  32. package/package/a8dde1ea.js +589 -0
  33. package/package/b4148642.js +7 -0
  34. package/package/b7dd22a2.js +847 -0
  35. package/package/d4f3a2c4.js +18046 -0
  36. package/package/e0f479f3.js +91 -0
  37. package/package/eaa160c9.js +341 -0
  38. package/package/f1bfd8b5.js +311 -0
  39. package/package/f1f9ba79.js +900 -0
  40. package/package/fba61f63.js +2868 -0
  41. package/package/icons/icon-chart.svg +15 -0
  42. package/package/icons/icon-comp-calendar.svg +22 -0
  43. package/package/index.js +5 -0
  44. package/package/package.json +73 -0
  45. package/package.json +1 -4
  46. package/src/__test__/allComp.test.tsx +61 -0
  47. package/src/app-env.d.ts +3 -0
  48. package/src/comps/calendarComp/calendarComp.tsx +442 -0
  49. package/src/comps/calendarComp/calendarConstants.tsx +897 -0
  50. package/src/comps/chartComp/chartComp.tsx +249 -0
  51. package/src/comps/chartComp/chartConfigs/barChartConfig.tsx +51 -0
  52. package/src/comps/chartComp/chartConfigs/cartesianAxisConfig.tsx +307 -0
  53. package/src/comps/chartComp/chartConfigs/chartUrls.tsx +6 -0
  54. package/src/comps/chartComp/chartConfigs/legendConfig.tsx +55 -0
  55. package/src/comps/chartComp/chartConfigs/lineChartConfig.tsx +96 -0
  56. package/src/comps/chartComp/chartConfigs/pieChartConfig.tsx +83 -0
  57. package/src/comps/chartComp/chartConfigs/scatterChartConfig.tsx +62 -0
  58. package/src/comps/chartComp/chartConstants.tsx +243 -0
  59. package/src/comps/chartComp/chartPropertyView.tsx +161 -0
  60. package/src/comps/chartComp/chartUtils.ts +240 -0
  61. package/src/comps/chartComp/reactEcharts/core.tsx +187 -0
  62. package/src/comps/chartComp/reactEcharts/index.ts +20 -0
  63. package/src/comps/chartComp/reactEcharts/types.ts +70 -0
  64. package/src/comps/chartComp/seriesComp.tsx +119 -0
  65. package/src/comps/imageEditorComp/imageEditorClass.tsx +52 -0
  66. package/src/comps/imageEditorComp/imageEditorConstants.tsx +109 -0
  67. package/src/comps/imageEditorComp/index.tsx +184 -0
  68. package/src/comps/mermaidComp/index.tsx +44 -0
  69. package/src/comps/mermaidComp/mermaid.tsx +29 -0
  70. package/src/global.ts +1 -0
  71. package/src/i18n/comps/index.tsx +29 -0
  72. package/src/i18n/comps/locales/en.ts +142 -0
  73. package/src/i18n/comps/locales/enObj.tsx +120 -0
  74. package/src/i18n/comps/locales/index.ts +7 -0
  75. package/src/i18n/comps/locales/types.tsx +9 -0
  76. package/src/i18n/comps/locales/zh.ts +4 -0
  77. package/src/i18n/comps/locales/zhObj.tsx +4 -0
  78. package/src/index.ts +11 -0
  79. package/vite.config.js +10 -0
@@ -0,0 +1,775 @@
1
+ import { c as ve, s as Fe, g as Me, b as Pe, a as Ye, m as Ue, l as xe, z as Be, h as oe, i as Qe, k as Te } from "./2b3ab1e4.js";
2
+ import { G as He, l as We } from "./945eefb3.js";
3
+ import { l as Ke } from "./012a06bb.js";
4
+ import "./0c8b29d5.js";
5
+ import "./e0f479f3.js";
6
+ var he = function() {
7
+ var e = function(q, r, s, l) {
8
+ for (s = s || {}, l = q.length; l--; s[q[l]] = r)
9
+ ;
10
+ return s;
11
+ }, t = [1, 3], a = [1, 5], c = [1, 6], d = [1, 7], u = [1, 8], p = [5, 6, 8, 14, 16, 18, 19, 40, 41, 42, 43, 44, 45, 53, 71, 72], h = [1, 22], o = [2, 13], g = [1, 26], R = [1, 27], v = [1, 28], S = [1, 29], T = [1, 30], x = [1, 31], A = [1, 24], N = [1, 32], w = [1, 33], pe = [1, 36], F = [71, 72], _e = [5, 8, 14, 16, 18, 19, 40, 41, 42, 43, 44, 45, 53, 60, 62, 71, 72], fe = [1, 56], ye = [1, 57], ge = [1, 58], Ee = [1, 59], Re = [1, 60], me = [1, 61], Ie = [1, 62], O = [62, 63], M = [1, 74], P = [1, 70], Y = [1, 71], U = [1, 72], B = [1, 73], Q = [1, 75], j = [1, 79], X = [1, 80], J = [1, 77], Z = [1, 78], m = [5, 8, 14, 16, 18, 19, 40, 41, 42, 43, 44, 45, 53, 71, 72], re = {
12
+ trace: function() {
13
+ },
14
+ yy: {},
15
+ symbols_: { error: 2, start: 3, directive: 4, NEWLINE: 5, RD: 6, diagram: 7, EOF: 8, openDirective: 9, typeDirective: 10, closeDirective: 11, ":": 12, argDirective: 13, acc_title: 14, acc_title_value: 15, acc_descr: 16, acc_descr_value: 17, acc_descr_multiline_value: 18, open_directive: 19, type_directive: 20, arg_directive: 21, close_directive: 22, requirementDef: 23, elementDef: 24, relationshipDef: 25, requirementType: 26, requirementName: 27, STRUCT_START: 28, requirementBody: 29, ID: 30, COLONSEP: 31, id: 32, TEXT: 33, text: 34, RISK: 35, riskLevel: 36, VERIFYMTHD: 37, verifyType: 38, STRUCT_STOP: 39, REQUIREMENT: 40, FUNCTIONAL_REQUIREMENT: 41, INTERFACE_REQUIREMENT: 42, PERFORMANCE_REQUIREMENT: 43, PHYSICAL_REQUIREMENT: 44, DESIGN_CONSTRAINT: 45, LOW_RISK: 46, MED_RISK: 47, HIGH_RISK: 48, VERIFY_ANALYSIS: 49, VERIFY_DEMONSTRATION: 50, VERIFY_INSPECTION: 51, VERIFY_TEST: 52, ELEMENT: 53, elementName: 54, elementBody: 55, TYPE: 56, type: 57, DOCREF: 58, ref: 59, END_ARROW_L: 60, relationship: 61, LINE: 62, END_ARROW_R: 63, CONTAINS: 64, COPIES: 65, DERIVES: 66, SATISFIES: 67, VERIFIES: 68, REFINES: 69, TRACES: 70, unqString: 71, qString: 72, $accept: 0, $end: 1 },
16
+ terminals_: { 2: "error", 5: "NEWLINE", 6: "RD", 8: "EOF", 12: ":", 14: "acc_title", 15: "acc_title_value", 16: "acc_descr", 17: "acc_descr_value", 18: "acc_descr_multiline_value", 19: "open_directive", 20: "type_directive", 21: "arg_directive", 22: "close_directive", 28: "STRUCT_START", 30: "ID", 31: "COLONSEP", 33: "TEXT", 35: "RISK", 37: "VERIFYMTHD", 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", 56: "TYPE", 58: "DOCREF", 60: "END_ARROW_L", 62: "LINE", 63: "END_ARROW_R", 64: "CONTAINS", 65: "COPIES", 66: "DERIVES", 67: "SATISFIES", 68: "VERIFIES", 69: "REFINES", 70: "TRACES", 71: "unqString", 72: "qString" },
17
+ productions_: [0, [3, 3], [3, 2], [3, 4], [4, 3], [4, 5], [4, 2], [4, 2], [4, 1], [9, 1], [10, 1], [13, 1], [11, 1], [7, 0], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [23, 5], [29, 5], [29, 5], [29, 5], [29, 5], [29, 2], [29, 1], [26, 1], [26, 1], [26, 1], [26, 1], [26, 1], [26, 1], [36, 1], [36, 1], [36, 1], [38, 1], [38, 1], [38, 1], [38, 1], [24, 5], [55, 5], [55, 5], [55, 2], [55, 1], [25, 5], [25, 5], [61, 1], [61, 1], [61, 1], [61, 1], [61, 1], [61, 1], [61, 1], [27, 1], [27, 1], [32, 1], [32, 1], [34, 1], [34, 1], [54, 1], [54, 1], [57, 1], [57, 1], [59, 1], [59, 1]],
18
+ performAction: function(r, s, l, i, f, n, K) {
19
+ var _ = n.length - 1;
20
+ switch (f) {
21
+ case 6:
22
+ this.$ = n[_].trim(), i.setAccTitle(this.$);
23
+ break;
24
+ case 7:
25
+ case 8:
26
+ this.$ = n[_].trim(), i.setAccDescription(this.$);
27
+ break;
28
+ case 9:
29
+ i.parseDirective("%%{", "open_directive");
30
+ break;
31
+ case 10:
32
+ i.parseDirective(n[_], "type_directive");
33
+ break;
34
+ case 11:
35
+ n[_] = n[_].trim().replace(/'/g, '"'), i.parseDirective(n[_], "arg_directive");
36
+ break;
37
+ case 12:
38
+ i.parseDirective("}%%", "close_directive", "pie");
39
+ break;
40
+ case 13:
41
+ this.$ = [];
42
+ break;
43
+ case 19:
44
+ i.addRequirement(n[_ - 3], n[_ - 4]);
45
+ break;
46
+ case 20:
47
+ i.setNewReqId(n[_ - 2]);
48
+ break;
49
+ case 21:
50
+ i.setNewReqText(n[_ - 2]);
51
+ break;
52
+ case 22:
53
+ i.setNewReqRisk(n[_ - 2]);
54
+ break;
55
+ case 23:
56
+ i.setNewReqVerifyMethod(n[_ - 2]);
57
+ break;
58
+ case 26:
59
+ this.$ = i.RequirementType.REQUIREMENT;
60
+ break;
61
+ case 27:
62
+ this.$ = i.RequirementType.FUNCTIONAL_REQUIREMENT;
63
+ break;
64
+ case 28:
65
+ this.$ = i.RequirementType.INTERFACE_REQUIREMENT;
66
+ break;
67
+ case 29:
68
+ this.$ = i.RequirementType.PERFORMANCE_REQUIREMENT;
69
+ break;
70
+ case 30:
71
+ this.$ = i.RequirementType.PHYSICAL_REQUIREMENT;
72
+ break;
73
+ case 31:
74
+ this.$ = i.RequirementType.DESIGN_CONSTRAINT;
75
+ break;
76
+ case 32:
77
+ this.$ = i.RiskLevel.LOW_RISK;
78
+ break;
79
+ case 33:
80
+ this.$ = i.RiskLevel.MED_RISK;
81
+ break;
82
+ case 34:
83
+ this.$ = i.RiskLevel.HIGH_RISK;
84
+ break;
85
+ case 35:
86
+ this.$ = i.VerifyType.VERIFY_ANALYSIS;
87
+ break;
88
+ case 36:
89
+ this.$ = i.VerifyType.VERIFY_DEMONSTRATION;
90
+ break;
91
+ case 37:
92
+ this.$ = i.VerifyType.VERIFY_INSPECTION;
93
+ break;
94
+ case 38:
95
+ this.$ = i.VerifyType.VERIFY_TEST;
96
+ break;
97
+ case 39:
98
+ i.addElement(n[_ - 3]);
99
+ break;
100
+ case 40:
101
+ i.setNewElementType(n[_ - 2]);
102
+ break;
103
+ case 41:
104
+ i.setNewElementDocRef(n[_ - 2]);
105
+ break;
106
+ case 44:
107
+ i.addRelationship(n[_ - 2], n[_], n[_ - 4]);
108
+ break;
109
+ case 45:
110
+ i.addRelationship(n[_ - 2], n[_ - 4], n[_]);
111
+ break;
112
+ case 46:
113
+ this.$ = i.Relationships.CONTAINS;
114
+ break;
115
+ case 47:
116
+ this.$ = i.Relationships.COPIES;
117
+ break;
118
+ case 48:
119
+ this.$ = i.Relationships.DERIVES;
120
+ break;
121
+ case 49:
122
+ this.$ = i.Relationships.SATISFIES;
123
+ break;
124
+ case 50:
125
+ this.$ = i.Relationships.VERIFIES;
126
+ break;
127
+ case 51:
128
+ this.$ = i.Relationships.REFINES;
129
+ break;
130
+ case 52:
131
+ this.$ = i.Relationships.TRACES;
132
+ break;
133
+ }
134
+ },
135
+ table: [{ 3: 1, 4: 2, 6: t, 9: 4, 14: a, 16: c, 18: d, 19: u }, { 1: [3] }, { 3: 10, 4: 2, 5: [1, 9], 6: t, 9: 4, 14: a, 16: c, 18: d, 19: u }, { 5: [1, 11] }, { 10: 12, 20: [1, 13] }, { 15: [1, 14] }, { 17: [1, 15] }, e(p, [2, 8]), { 20: [2, 9] }, { 3: 16, 4: 2, 6: t, 9: 4, 14: a, 16: c, 18: d, 19: u }, { 1: [2, 2] }, { 4: 21, 5: h, 7: 17, 8: o, 9: 4, 14: a, 16: c, 18: d, 19: u, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: g, 41: R, 42: v, 43: S, 44: T, 45: x, 53: A, 71: N, 72: w }, { 11: 34, 12: [1, 35], 22: pe }, e([12, 22], [2, 10]), e(p, [2, 6]), e(p, [2, 7]), { 1: [2, 1] }, { 8: [1, 37] }, { 4: 21, 5: h, 7: 38, 8: o, 9: 4, 14: a, 16: c, 18: d, 19: u, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: g, 41: R, 42: v, 43: S, 44: T, 45: x, 53: A, 71: N, 72: w }, { 4: 21, 5: h, 7: 39, 8: o, 9: 4, 14: a, 16: c, 18: d, 19: u, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: g, 41: R, 42: v, 43: S, 44: T, 45: x, 53: A, 71: N, 72: w }, { 4: 21, 5: h, 7: 40, 8: o, 9: 4, 14: a, 16: c, 18: d, 19: u, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: g, 41: R, 42: v, 43: S, 44: T, 45: x, 53: A, 71: N, 72: w }, { 4: 21, 5: h, 7: 41, 8: o, 9: 4, 14: a, 16: c, 18: d, 19: u, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: g, 41: R, 42: v, 43: S, 44: T, 45: x, 53: A, 71: N, 72: w }, { 4: 21, 5: h, 7: 42, 8: o, 9: 4, 14: a, 16: c, 18: d, 19: u, 23: 18, 24: 19, 25: 20, 26: 23, 32: 25, 40: g, 41: R, 42: v, 43: S, 44: T, 45: x, 53: A, 71: N, 72: w }, { 27: 43, 71: [1, 44], 72: [1, 45] }, { 54: 46, 71: [1, 47], 72: [1, 48] }, { 60: [1, 49], 62: [1, 50] }, e(F, [2, 26]), e(F, [2, 27]), e(F, [2, 28]), e(F, [2, 29]), e(F, [2, 30]), e(F, [2, 31]), e(_e, [2, 55]), e(_e, [2, 56]), e(p, [2, 4]), { 13: 51, 21: [1, 52] }, e(p, [2, 12]), { 1: [2, 3] }, { 8: [2, 14] }, { 8: [2, 15] }, { 8: [2, 16] }, { 8: [2, 17] }, { 8: [2, 18] }, { 28: [1, 53] }, { 28: [2, 53] }, { 28: [2, 54] }, { 28: [1, 54] }, { 28: [2, 59] }, { 28: [2, 60] }, { 61: 55, 64: fe, 65: ye, 66: ge, 67: Ee, 68: Re, 69: me, 70: Ie }, { 61: 63, 64: fe, 65: ye, 66: ge, 67: Ee, 68: Re, 69: me, 70: Ie }, { 11: 64, 22: pe }, { 22: [2, 11] }, { 5: [1, 65] }, { 5: [1, 66] }, { 62: [1, 67] }, e(O, [2, 46]), e(O, [2, 47]), e(O, [2, 48]), e(O, [2, 49]), e(O, [2, 50]), e(O, [2, 51]), e(O, [2, 52]), { 63: [1, 68] }, e(p, [2, 5]), { 5: M, 29: 69, 30: P, 33: Y, 35: U, 37: B, 39: Q }, { 5: j, 39: X, 55: 76, 56: J, 58: Z }, { 32: 81, 71: N, 72: w }, { 32: 82, 71: N, 72: w }, e(m, [2, 19]), { 31: [1, 83] }, { 31: [1, 84] }, { 31: [1, 85] }, { 31: [1, 86] }, { 5: M, 29: 87, 30: P, 33: Y, 35: U, 37: B, 39: Q }, e(m, [2, 25]), e(m, [2, 39]), { 31: [1, 88] }, { 31: [1, 89] }, { 5: j, 39: X, 55: 90, 56: J, 58: Z }, e(m, [2, 43]), e(m, [2, 44]), e(m, [2, 45]), { 32: 91, 71: N, 72: w }, { 34: 92, 71: [1, 93], 72: [1, 94] }, { 36: 95, 46: [1, 96], 47: [1, 97], 48: [1, 98] }, { 38: 99, 49: [1, 100], 50: [1, 101], 51: [1, 102], 52: [1, 103] }, e(m, [2, 24]), { 57: 104, 71: [1, 105], 72: [1, 106] }, { 59: 107, 71: [1, 108], 72: [1, 109] }, e(m, [2, 42]), { 5: [1, 110] }, { 5: [1, 111] }, { 5: [2, 57] }, { 5: [2, 58] }, { 5: [1, 112] }, { 5: [2, 32] }, { 5: [2, 33] }, { 5: [2, 34] }, { 5: [1, 113] }, { 5: [2, 35] }, { 5: [2, 36] }, { 5: [2, 37] }, { 5: [2, 38] }, { 5: [1, 114] }, { 5: [2, 61] }, { 5: [2, 62] }, { 5: [1, 115] }, { 5: [2, 63] }, { 5: [2, 64] }, { 5: M, 29: 116, 30: P, 33: Y, 35: U, 37: B, 39: Q }, { 5: M, 29: 117, 30: P, 33: Y, 35: U, 37: B, 39: Q }, { 5: M, 29: 118, 30: P, 33: Y, 35: U, 37: B, 39: Q }, { 5: M, 29: 119, 30: P, 33: Y, 35: U, 37: B, 39: Q }, { 5: j, 39: X, 55: 120, 56: J, 58: Z }, { 5: j, 39: X, 55: 121, 56: J, 58: Z }, e(m, [2, 20]), e(m, [2, 21]), e(m, [2, 22]), e(m, [2, 23]), e(m, [2, 40]), e(m, [2, 41])],
136
+ defaultActions: { 8: [2, 9], 10: [2, 2], 16: [2, 1], 37: [2, 3], 38: [2, 14], 39: [2, 15], 40: [2, 16], 41: [2, 17], 42: [2, 18], 44: [2, 53], 45: [2, 54], 47: [2, 59], 48: [2, 60], 52: [2, 11], 93: [2, 57], 94: [2, 58], 96: [2, 32], 97: [2, 33], 98: [2, 34], 100: [2, 35], 101: [2, 36], 102: [2, 37], 103: [2, 38], 105: [2, 61], 106: [2, 62], 108: [2, 63], 109: [2, 64] },
137
+ parseError: function(r, s) {
138
+ if (s.recoverable)
139
+ this.trace(r);
140
+ else {
141
+ var l = new Error(r);
142
+ throw l.hash = s, l;
143
+ }
144
+ },
145
+ parse: function(r) {
146
+ var s = this, l = [0], i = [], f = [null], n = [], K = this.table, _ = "", ee = 0, be = 0, Le = 2, ke = 1, Oe = n.slice.call(arguments, 1), E = Object.create(this.lexer), C = { yy: {} };
147
+ for (var se in this.yy)
148
+ Object.prototype.hasOwnProperty.call(this.yy, se) && (C.yy[se] = this.yy[se]);
149
+ E.setInput(r, C.yy), C.yy.lexer = E, C.yy.parser = this, typeof E.yylloc == "undefined" && (E.yylloc = {});
150
+ var ae = E.yylloc;
151
+ n.push(ae);
152
+ var Ce = E.options && E.options.ranges;
153
+ typeof C.yy.parseError == "function" ? this.parseError = C.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
154
+ function De() {
155
+ var $;
156
+ return $ = i.pop() || E.lex() || ke, typeof $ != "number" && ($ instanceof Array && (i = $, $ = i.pop()), $ = s.symbols_[$] || $), $;
157
+ }
158
+ for (var I, D, k, le, H = {}, te, V, Se, ie; ; ) {
159
+ if (D = l[l.length - 1], this.defaultActions[D] ? k = this.defaultActions[D] : ((I === null || typeof I == "undefined") && (I = De()), k = K[D] && K[D][I]), typeof k == "undefined" || !k.length || !k[0]) {
160
+ var ce = "";
161
+ ie = [];
162
+ for (te in K[D])
163
+ this.terminals_[te] && te > Le && ie.push("'" + this.terminals_[te] + "'");
164
+ E.showPosition ? ce = "Parse error on line " + (ee + 1) + `:
165
+ ` + E.showPosition() + `
166
+ Expecting ` + ie.join(", ") + ", got '" + (this.terminals_[I] || I) + "'" : ce = "Parse error on line " + (ee + 1) + ": Unexpected " + (I == ke ? "end of input" : "'" + (this.terminals_[I] || I) + "'"), this.parseError(ce, {
167
+ text: E.match,
168
+ token: this.terminals_[I] || I,
169
+ line: E.yylineno,
170
+ loc: ae,
171
+ expected: ie
172
+ });
173
+ }
174
+ if (k[0] instanceof Array && k.length > 1)
175
+ throw new Error("Parse Error: multiple actions possible at state: " + D + ", token: " + I);
176
+ switch (k[0]) {
177
+ case 1:
178
+ l.push(I), f.push(E.yytext), n.push(E.yylloc), l.push(k[1]), I = null, be = E.yyleng, _ = E.yytext, ee = E.yylineno, ae = E.yylloc;
179
+ break;
180
+ case 2:
181
+ if (V = this.productions_[k[1]][1], H.$ = f[f.length - V], H._$ = {
182
+ first_line: n[n.length - (V || 1)].first_line,
183
+ last_line: n[n.length - 1].last_line,
184
+ first_column: n[n.length - (V || 1)].first_column,
185
+ last_column: n[n.length - 1].last_column
186
+ }, Ce && (H._$.range = [
187
+ n[n.length - (V || 1)].range[0],
188
+ n[n.length - 1].range[1]
189
+ ]), le = this.performAction.apply(H, [
190
+ _,
191
+ be,
192
+ ee,
193
+ C.yy,
194
+ k[1],
195
+ f,
196
+ n
197
+ ].concat(Oe)), typeof le != "undefined")
198
+ return le;
199
+ V && (l = l.slice(0, -1 * V * 2), f = f.slice(0, -1 * V), n = n.slice(0, -1 * V)), l.push(this.productions_[k[1]][0]), f.push(H.$), n.push(H._$), Se = K[l[l.length - 2]][l[l.length - 1]], l.push(Se);
200
+ break;
201
+ case 3:
202
+ return !0;
203
+ }
204
+ }
205
+ return !0;
206
+ }
207
+ }, qe = function() {
208
+ var q = {
209
+ EOF: 1,
210
+ parseError: function(s, l) {
211
+ if (this.yy.parser)
212
+ this.yy.parser.parseError(s, l);
213
+ else
214
+ throw new Error(s);
215
+ },
216
+ setInput: function(r, s) {
217
+ return this.yy = s || this.yy || {}, this._input = r, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
218
+ first_line: 1,
219
+ first_column: 0,
220
+ last_line: 1,
221
+ last_column: 0
222
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
223
+ },
224
+ input: function() {
225
+ var r = this._input[0];
226
+ this.yytext += r, this.yyleng++, this.offset++, this.match += r, this.matched += r;
227
+ var s = r.match(/(?:\r\n?|\n).*/g);
228
+ return s ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), r;
229
+ },
230
+ unput: function(r) {
231
+ var s = r.length, l = r.split(/(?:\r\n?|\n)/g);
232
+ this._input = r + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - s), this.offset -= s;
233
+ var i = this.match.split(/(?:\r\n?|\n)/g);
234
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), l.length - 1 && (this.yylineno -= l.length - 1);
235
+ var f = this.yylloc.range;
236
+ return this.yylloc = {
237
+ first_line: this.yylloc.first_line,
238
+ last_line: this.yylineno + 1,
239
+ first_column: this.yylloc.first_column,
240
+ last_column: l ? (l.length === i.length ? this.yylloc.first_column : 0) + i[i.length - l.length].length - l[0].length : this.yylloc.first_column - s
241
+ }, this.options.ranges && (this.yylloc.range = [f[0], f[0] + this.yyleng - s]), this.yyleng = this.yytext.length, this;
242
+ },
243
+ more: function() {
244
+ return this._more = !0, this;
245
+ },
246
+ reject: function() {
247
+ if (this.options.backtrack_lexer)
248
+ this._backtrack = !0;
249
+ else
250
+ 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).
251
+ ` + this.showPosition(), {
252
+ text: "",
253
+ token: null,
254
+ line: this.yylineno
255
+ });
256
+ return this;
257
+ },
258
+ less: function(r) {
259
+ this.unput(this.match.slice(r));
260
+ },
261
+ pastInput: function() {
262
+ var r = this.matched.substr(0, this.matched.length - this.match.length);
263
+ return (r.length > 20 ? "..." : "") + r.substr(-20).replace(/\n/g, "");
264
+ },
265
+ upcomingInput: function() {
266
+ var r = this.match;
267
+ return r.length < 20 && (r += this._input.substr(0, 20 - r.length)), (r.substr(0, 20) + (r.length > 20 ? "..." : "")).replace(/\n/g, "");
268
+ },
269
+ showPosition: function() {
270
+ var r = this.pastInput(), s = new Array(r.length + 1).join("-");
271
+ return r + this.upcomingInput() + `
272
+ ` + s + "^";
273
+ },
274
+ test_match: function(r, s) {
275
+ var l, i, f;
276
+ if (this.options.backtrack_lexer && (f = {
277
+ yylineno: this.yylineno,
278
+ yylloc: {
279
+ first_line: this.yylloc.first_line,
280
+ last_line: this.last_line,
281
+ first_column: this.yylloc.first_column,
282
+ last_column: this.yylloc.last_column
283
+ },
284
+ yytext: this.yytext,
285
+ match: this.match,
286
+ matches: this.matches,
287
+ matched: this.matched,
288
+ yyleng: this.yyleng,
289
+ offset: this.offset,
290
+ _more: this._more,
291
+ _input: this._input,
292
+ yy: this.yy,
293
+ conditionStack: this.conditionStack.slice(0),
294
+ done: this.done
295
+ }, this.options.ranges && (f.yylloc.range = this.yylloc.range.slice(0))), i = r[0].match(/(?:\r\n?|\n).*/g), i && (this.yylineno += i.length), this.yylloc = {
296
+ first_line: this.yylloc.last_line,
297
+ last_line: this.yylineno + 1,
298
+ first_column: this.yylloc.last_column,
299
+ last_column: i ? i[i.length - 1].length - i[i.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + r[0].length
300
+ }, this.yytext += r[0], this.match += r[0], this.matches = r, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(r[0].length), this.matched += r[0], l = this.performAction.call(this, this.yy, this, s, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), l)
301
+ return l;
302
+ if (this._backtrack) {
303
+ for (var n in f)
304
+ this[n] = f[n];
305
+ return !1;
306
+ }
307
+ return !1;
308
+ },
309
+ next: function() {
310
+ if (this.done)
311
+ return this.EOF;
312
+ this._input || (this.done = !0);
313
+ var r, s, l, i;
314
+ this._more || (this.yytext = "", this.match = "");
315
+ for (var f = this._currentRules(), n = 0; n < f.length; n++)
316
+ if (l = this._input.match(this.rules[f[n]]), l && (!s || l[0].length > s[0].length)) {
317
+ if (s = l, i = n, this.options.backtrack_lexer) {
318
+ if (r = this.test_match(l, f[n]), r !== !1)
319
+ return r;
320
+ if (this._backtrack) {
321
+ s = !1;
322
+ continue;
323
+ } else
324
+ return !1;
325
+ } else if (!this.options.flex)
326
+ break;
327
+ }
328
+ return s ? (r = this.test_match(s, f[i]), r !== !1 ? r : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
329
+ ` + this.showPosition(), {
330
+ text: "",
331
+ token: null,
332
+ line: this.yylineno
333
+ });
334
+ },
335
+ lex: function() {
336
+ var s = this.next();
337
+ return s || this.lex();
338
+ },
339
+ begin: function(s) {
340
+ this.conditionStack.push(s);
341
+ },
342
+ popState: function() {
343
+ var s = this.conditionStack.length - 1;
344
+ return s > 0 ? this.conditionStack.pop() : this.conditionStack[0];
345
+ },
346
+ _currentRules: function() {
347
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
348
+ },
349
+ topState: function(s) {
350
+ return s = this.conditionStack.length - 1 - Math.abs(s || 0), s >= 0 ? this.conditionStack[s] : "INITIAL";
351
+ },
352
+ pushState: function(s) {
353
+ this.begin(s);
354
+ },
355
+ stateStackSize: function() {
356
+ return this.conditionStack.length;
357
+ },
358
+ options: { "case-insensitive": !0 },
359
+ performAction: function(s, l, i, f) {
360
+ switch (i) {
361
+ case 0:
362
+ return this.begin("open_directive"), 19;
363
+ case 1:
364
+ return this.begin("type_directive"), 20;
365
+ case 2:
366
+ return this.popState(), this.begin("arg_directive"), 12;
367
+ case 3:
368
+ return this.popState(), this.popState(), 22;
369
+ case 4:
370
+ return 21;
371
+ case 5:
372
+ return "title";
373
+ case 6:
374
+ return this.begin("acc_title"), 14;
375
+ case 7:
376
+ return this.popState(), "acc_title_value";
377
+ case 8:
378
+ return this.begin("acc_descr"), 16;
379
+ case 9:
380
+ return this.popState(), "acc_descr_value";
381
+ case 10:
382
+ this.begin("acc_descr_multiline");
383
+ break;
384
+ case 11:
385
+ this.popState();
386
+ break;
387
+ case 12:
388
+ return "acc_descr_multiline_value";
389
+ case 13:
390
+ return 5;
391
+ case 14:
392
+ break;
393
+ case 15:
394
+ break;
395
+ case 16:
396
+ break;
397
+ case 17:
398
+ return 8;
399
+ case 18:
400
+ return 6;
401
+ case 19:
402
+ return 28;
403
+ case 20:
404
+ return 39;
405
+ case 21:
406
+ return 31;
407
+ case 22:
408
+ return 30;
409
+ case 23:
410
+ return 33;
411
+ case 24:
412
+ return 35;
413
+ case 25:
414
+ return 37;
415
+ case 26:
416
+ return 40;
417
+ case 27:
418
+ return 41;
419
+ case 28:
420
+ return 42;
421
+ case 29:
422
+ return 43;
423
+ case 30:
424
+ return 44;
425
+ case 31:
426
+ return 45;
427
+ case 32:
428
+ return 46;
429
+ case 33:
430
+ return 47;
431
+ case 34:
432
+ return 48;
433
+ case 35:
434
+ return 49;
435
+ case 36:
436
+ return 50;
437
+ case 37:
438
+ return 51;
439
+ case 38:
440
+ return 52;
441
+ case 39:
442
+ return 53;
443
+ case 40:
444
+ return 64;
445
+ case 41:
446
+ return 65;
447
+ case 42:
448
+ return 66;
449
+ case 43:
450
+ return 67;
451
+ case 44:
452
+ return 68;
453
+ case 45:
454
+ return 69;
455
+ case 46:
456
+ return 70;
457
+ case 47:
458
+ return 56;
459
+ case 48:
460
+ return 58;
461
+ case 49:
462
+ return 60;
463
+ case 50:
464
+ return 63;
465
+ case 51:
466
+ return 62;
467
+ case 52:
468
+ this.begin("string");
469
+ break;
470
+ case 53:
471
+ this.popState();
472
+ break;
473
+ case 54:
474
+ return "qString";
475
+ case 55:
476
+ return l.yytext = l.yytext.trim(), 71;
477
+ }
478
+ },
479
+ rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:(\r?\n)+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:$)/i, /^(?:requirementDiagram\b)/i, /^(?:\{)/i, /^(?:\})/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, /^(?:<-)/i, /^(?:->)/i, /^(?:-)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[\w][^\r\n\{\<\>\-\=]*)/i],
480
+ conditions: { acc_descr_multiline: { rules: [11, 12], inclusive: !1 }, acc_descr: { rules: [9], inclusive: !1 }, acc_title: { rules: [7], inclusive: !1 }, close_directive: { rules: [], inclusive: !1 }, arg_directive: { rules: [3, 4], inclusive: !1 }, type_directive: { rules: [2, 3], inclusive: !1 }, open_directive: { rules: [1], inclusive: !1 }, unqString: { rules: [], inclusive: !1 }, token: { rules: [], inclusive: !1 }, string: { rules: [53, 54], inclusive: !1 }, INITIAL: { rules: [0, 5, 6, 8, 10, 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, 50, 51, 52, 55], inclusive: !0 } }
481
+ };
482
+ return q;
483
+ }();
484
+ re.lexer = qe;
485
+ function ne() {
486
+ this.yy = {};
487
+ }
488
+ return ne.prototype = re, re.Parser = ne, new ne();
489
+ }();
490
+ he.parser = he;
491
+ const Ge = he;
492
+ let de = [], b = {}, G = {}, L = {}, z = {};
493
+ const ze = {
494
+ REQUIREMENT: "Requirement",
495
+ FUNCTIONAL_REQUIREMENT: "Functional Requirement",
496
+ INTERFACE_REQUIREMENT: "Interface Requirement",
497
+ PERFORMANCE_REQUIREMENT: "Performance Requirement",
498
+ PHYSICAL_REQUIREMENT: "Physical Requirement",
499
+ DESIGN_CONSTRAINT: "Design Constraint"
500
+ }, je = {
501
+ LOW_RISK: "Low",
502
+ MED_RISK: "Medium",
503
+ HIGH_RISK: "High"
504
+ }, Xe = {
505
+ VERIFY_ANALYSIS: "Analysis",
506
+ VERIFY_DEMONSTRATION: "Demonstration",
507
+ VERIFY_INSPECTION: "Inspection",
508
+ VERIFY_TEST: "Test"
509
+ }, Je = {
510
+ CONTAINS: "contains",
511
+ COPIES: "copies",
512
+ DERIVES: "derives",
513
+ SATISFIES: "satisfies",
514
+ VERIFIES: "verifies",
515
+ REFINES: "refines",
516
+ TRACES: "traces"
517
+ }, Ze = function(e, t, a) {
518
+ Ue.parseDirective(this, e, t, a);
519
+ }, et = (e, t) => (G[e] === void 0 && (G[e] = {
520
+ name: e,
521
+ type: t,
522
+ id: b.id,
523
+ text: b.text,
524
+ risk: b.risk,
525
+ verifyMethod: b.verifyMethod
526
+ }), b = {}, G[e]), tt = () => G, it = (e) => {
527
+ b !== void 0 && (b.id = e);
528
+ }, rt = (e) => {
529
+ b !== void 0 && (b.text = e);
530
+ }, nt = (e) => {
531
+ b !== void 0 && (b.risk = e);
532
+ }, st = (e) => {
533
+ b !== void 0 && (b.verifyMethod = e);
534
+ }, at = (e) => (z[e] === void 0 && (z[e] = {
535
+ name: e,
536
+ type: L.type,
537
+ docRef: L.docRef
538
+ }, xe.info("Added new requirement: ", e)), L = {}, z[e]), lt = () => z, ct = (e) => {
539
+ L !== void 0 && (L.type = e);
540
+ }, ot = (e) => {
541
+ L !== void 0 && (L.docRef = e);
542
+ }, ht = (e, t, a) => {
543
+ de.push({
544
+ type: e,
545
+ src: t,
546
+ dst: a
547
+ });
548
+ }, ut = () => de, dt = () => {
549
+ de = [], b = {}, G = {}, L = {}, z = {}, Be();
550
+ }, pt = {
551
+ RequirementType: ze,
552
+ RiskLevel: je,
553
+ VerifyType: Xe,
554
+ Relationships: Je,
555
+ parseDirective: Ze,
556
+ getConfig: () => ve().req,
557
+ addRequirement: et,
558
+ getRequirements: tt,
559
+ setNewReqId: it,
560
+ setNewReqText: rt,
561
+ setNewReqRisk: nt,
562
+ setNewReqVerifyMethod: st,
563
+ setAccTitle: Fe,
564
+ getAccTitle: Me,
565
+ setAccDescription: Pe,
566
+ getAccDescription: Ye,
567
+ addElement: at,
568
+ getElements: lt,
569
+ setNewElementType: ct,
570
+ setNewElementDocRef: ot,
571
+ addRelationship: ht,
572
+ getRelationships: ut,
573
+ clear: dt
574
+ }, _t = (e) => `
575
+
576
+ marker {
577
+ fill: ${e.relationColor};
578
+ stroke: ${e.relationColor};
579
+ }
580
+
581
+ marker.cross {
582
+ stroke: ${e.lineColor};
583
+ }
584
+
585
+ svg {
586
+ font-family: ${e.fontFamily};
587
+ font-size: ${e.fontSize};
588
+ }
589
+
590
+ .reqBox {
591
+ fill: ${e.requirementBackground};
592
+ fill-opacity: 100%;
593
+ stroke: ${e.requirementBorderColor};
594
+ stroke-width: ${e.requirementBorderSize};
595
+ }
596
+
597
+ .reqTitle, .reqLabel{
598
+ fill: ${e.requirementTextColor};
599
+ }
600
+ .reqLabelBox {
601
+ fill: ${e.relationLabelBackground};
602
+ fill-opacity: 100%;
603
+ }
604
+
605
+ .req-title-line {
606
+ stroke: ${e.requirementBorderColor};
607
+ stroke-width: ${e.requirementBorderSize};
608
+ }
609
+ .relationshipLine {
610
+ stroke: ${e.relationColor};
611
+ stroke-width: 1;
612
+ }
613
+ .relationshipLabel {
614
+ fill: ${e.relationLabelColor};
615
+ }
616
+
617
+ `, ft = _t, ue = {
618
+ CONTAINS: "contains",
619
+ ARROW: "arrow"
620
+ }, yt = (e, t) => {
621
+ let a = e.append("defs").append("marker").attr("id", ue.CONTAINS + "_line_ending").attr("refX", 0).attr("refY", t.line_height / 2).attr("markerWidth", t.line_height).attr("markerHeight", t.line_height).attr("orient", "auto").append("g");
622
+ a.append("circle").attr("cx", t.line_height / 2).attr("cy", t.line_height / 2).attr("r", t.line_height / 2).attr("fill", "none"), a.append("line").attr("x1", 0).attr("x2", t.line_height).attr("y1", t.line_height / 2).attr("y2", t.line_height / 2).attr("stroke-width", 1), a.append("line").attr("y1", 0).attr("y2", t.line_height).attr("x1", t.line_height / 2).attr("x2", t.line_height / 2).attr("stroke-width", 1), e.append("defs").append("marker").attr("id", ue.ARROW + "_line_ending").attr("refX", t.line_height).attr("refY", 0.5 * t.line_height).attr("markerWidth", t.line_height).attr("markerHeight", t.line_height).attr("orient", "auto").append("path").attr(
623
+ "d",
624
+ `M0,0
625
+ L${t.line_height},${t.line_height / 2}
626
+ M${t.line_height},${t.line_height / 2}
627
+ L0,${t.line_height}`
628
+ ).attr("stroke-width", 1);
629
+ }, Ae = {
630
+ ReqMarkers: ue,
631
+ insertLineEndings: yt
632
+ };
633
+ let y = {}, Ne = 0;
634
+ const we = (e, t) => e.insert("rect", "#" + t).attr("class", "req reqBox").attr("x", 0).attr("y", 0).attr("width", y.rect_min_width + "px").attr("height", y.rect_min_height + "px"), Ve = (e, t, a) => {
635
+ let c = y.rect_min_width / 2, d = e.append("text").attr("class", "req reqLabel reqTitle").attr("id", t).attr("x", c).attr("y", y.rect_padding).attr("dominant-baseline", "hanging"), u = 0;
636
+ a.forEach((g) => {
637
+ u == 0 ? d.append("tspan").attr("text-anchor", "middle").attr("x", y.rect_min_width / 2).attr("dy", 0).text(g) : d.append("tspan").attr("text-anchor", "middle").attr("x", y.rect_min_width / 2).attr("dy", y.line_height * 0.75).text(g), u++;
638
+ });
639
+ let p = 1.5 * y.rect_padding, h = u * y.line_height * 0.75, o = p + h;
640
+ return e.append("line").attr("class", "req-title-line").attr("x1", "0").attr("x2", y.rect_min_width).attr("y1", o).attr("y2", o), {
641
+ titleNode: d,
642
+ y: o
643
+ };
644
+ }, $e = (e, t, a, c) => {
645
+ let d = e.append("text").attr("class", "req reqLabel").attr("id", t).attr("x", y.rect_padding).attr("y", c).attr("dominant-baseline", "hanging"), u = 0;
646
+ const p = 30;
647
+ let h = [];
648
+ return a.forEach((o) => {
649
+ let g = o.length;
650
+ for (; g > p && u < 3; ) {
651
+ let R = o.substring(0, p);
652
+ o = o.substring(p, o.length), g = o.length, h[h.length] = R, u++;
653
+ }
654
+ if (u == 3) {
655
+ let R = h[h.length - 1];
656
+ h[h.length - 1] = R.substring(0, R.length - 4) + "...";
657
+ } else
658
+ h[h.length] = o;
659
+ u = 0;
660
+ }), h.forEach((o) => {
661
+ d.append("tspan").attr("x", y.rect_padding).attr("dy", y.line_height).text(o);
662
+ }), d;
663
+ }, gt = (e, t, a, c) => {
664
+ const d = t.node().getTotalLength(), u = t.node().getPointAtLength(d * 0.5), p = "rel" + Ne;
665
+ Ne++;
666
+ const o = e.append("text").attr("class", "req relationshipLabel").attr("id", p).attr("x", u.x).attr("y", u.y).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(c).node().getBBox();
667
+ e.insert("rect", "#" + p).attr("class", "req reqLabelBox").attr("x", u.x - o.width / 2).attr("y", u.y - o.height / 2).attr("width", o.width).attr("height", o.height).attr("fill", "white").attr("fill-opacity", "85%");
668
+ }, Et = function(e, t, a, c, d) {
669
+ const u = a.edge(W(t.src), W(t.dst)), p = Ke().x(function(o) {
670
+ return o.x;
671
+ }).y(function(o) {
672
+ return o.y;
673
+ }), h = e.insert("path", "#" + c).attr("class", "er relationshipLine").attr("d", p(u.points)).attr("fill", "none");
674
+ t.type == d.db.Relationships.CONTAINS ? h.attr(
675
+ "marker-start",
676
+ "url(" + Te.getUrl(y.arrowMarkerAbsolute) + "#" + t.type + "_line_ending)"
677
+ ) : (h.attr("stroke-dasharray", "10,7"), h.attr(
678
+ "marker-end",
679
+ "url(" + Te.getUrl(y.arrowMarkerAbsolute) + "#" + Ae.ReqMarkers.ARROW + "_line_ending)"
680
+ )), gt(e, h, y, `<<${t.type}>>`);
681
+ }, Rt = (e, t, a) => {
682
+ Object.keys(e).forEach((c) => {
683
+ let d = e[c];
684
+ c = W(c), xe.info("Added new requirement: ", c);
685
+ const u = a.append("g").attr("id", c), p = "req-" + c, h = we(u, p);
686
+ let o = Ve(u, c + "_title", [
687
+ `<<${d.type}>>`,
688
+ `${d.name}`
689
+ ]);
690
+ $e(
691
+ u,
692
+ c + "_body",
693
+ [
694
+ `Id: ${d.id}`,
695
+ `Text: ${d.text}`,
696
+ `Risk: ${d.risk}`,
697
+ `Verification: ${d.verifyMethod}`
698
+ ],
699
+ o.y
700
+ );
701
+ const g = h.node().getBBox();
702
+ t.setNode(c, {
703
+ width: g.width,
704
+ height: g.height,
705
+ shape: "rect",
706
+ id: c
707
+ });
708
+ });
709
+ }, mt = (e, t, a) => {
710
+ Object.keys(e).forEach((c) => {
711
+ let d = e[c];
712
+ const u = W(c), p = a.append("g").attr("id", u), h = "element-" + u, o = we(p, h);
713
+ let g = Ve(p, h + "_title", ["<<Element>>", `${c}`]);
714
+ $e(
715
+ p,
716
+ h + "_body",
717
+ [`Type: ${d.type || "Not Specified"}`, `Doc Ref: ${d.docRef || "None"}`],
718
+ g.y
719
+ );
720
+ const R = o.node().getBBox();
721
+ t.setNode(u, {
722
+ width: R.width,
723
+ height: R.height,
724
+ shape: "rect",
725
+ id: u
726
+ });
727
+ });
728
+ }, It = (e, t) => (e.forEach(function(a) {
729
+ let c = W(a.src), d = W(a.dst);
730
+ t.setEdge(c, d, { relationship: a });
731
+ }), e), bt = function(e, t) {
732
+ t.nodes().forEach(function(a) {
733
+ a !== void 0 && t.node(a) !== void 0 && (e.select("#" + a), e.select("#" + a).attr(
734
+ "transform",
735
+ "translate(" + (t.node(a).x - t.node(a).width / 2) + "," + (t.node(a).y - t.node(a).height / 2) + " )"
736
+ ));
737
+ });
738
+ }, W = (e) => e.replace(/\s/g, "").replace(/\./g, "_"), kt = (e, t, a, c) => {
739
+ y = ve().requirement, c.db.clear(), c.parser.parse(e);
740
+ const d = y.securityLevel;
741
+ let u;
742
+ d === "sandbox" && (u = oe("#i" + t));
743
+ const h = (d === "sandbox" ? oe(u.nodes()[0].contentDocument.body) : oe("body")).select(`[id='${t}']`);
744
+ Ae.insertLineEndings(h, y);
745
+ const o = new He({
746
+ multigraph: !1,
747
+ compound: !1,
748
+ directed: !0
749
+ }).setGraph({
750
+ rankdir: y.layoutDirection,
751
+ marginx: 20,
752
+ marginy: 20,
753
+ nodesep: 100,
754
+ edgesep: 100,
755
+ ranksep: 100
756
+ }).setDefaultEdgeLabel(function() {
757
+ return {};
758
+ });
759
+ let g = c.db.getRequirements(), R = c.db.getElements(), v = c.db.getRelationships();
760
+ Rt(g, o, h), mt(R, o, h), It(v, o), We(o), bt(h, o), v.forEach(function(N) {
761
+ Et(h, N, o, t, c);
762
+ });
763
+ const S = y.rect_padding, T = h.node().getBBox(), x = T.width + S * 2, A = T.height + S * 2;
764
+ Qe(h, A, x, y.useMaxWidth), h.attr("viewBox", `${T.x - S} ${T.y - S} ${x} ${A}`);
765
+ }, St = {
766
+ draw: kt
767
+ }, wt = {
768
+ parser: Ge,
769
+ db: pt,
770
+ renderer: St,
771
+ styles: ft
772
+ };
773
+ export {
774
+ wt as diagram
775
+ };