lowcoder-comps 0.0.31 → 0.0.33

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 (87) hide show
  1. package/00bb478a.js +1102 -0
  2. package/02bef5a4.js +505 -0
  3. package/057d2a44.js +1127 -0
  4. package/0964fcc6.js +34 -0
  5. package/14220e98.js +1276 -0
  6. package/1c074fe4.js +25 -0
  7. package/250a6954.js +804 -0
  8. package/256b619e.js +92 -0
  9. package/2cd27cf0.js +2501 -0
  10. package/2f064957.js +64 -0
  11. package/2ff2c7a6.js +6 -0
  12. package/2ff7471d.js +9 -0
  13. package/30c4916b.js +8 -0
  14. package/36ec7270.js +915 -0
  15. package/38c14832.js +960 -0
  16. package/3ae34bed.js +819 -0
  17. package/3e2939fa.js +237 -0
  18. package/3f5f874f.js +86 -0
  19. package/3fb86fb9.js +447 -0
  20. package/415177f9.js +1579 -0
  21. package/47848c42.js +11636 -0
  22. package/4c6a0ece.js +162535 -0
  23. package/4db8e48b.js +2284 -0
  24. package/531065f1.js +1089 -0
  25. package/5a398ea8.js +881 -0
  26. package/5ab1614c.js +268 -0
  27. package/65bbb6ae.js +1536 -0
  28. package/777cd15c.js +48428 -0
  29. package/7dacfa82.js +220 -0
  30. package/800cf0d0.js +796 -0
  31. package/92e85b65.js +65 -0
  32. package/93e9bd3a.js +391 -0
  33. package/98622dfa.js +16582 -0
  34. package/a2e74e62.js +2967 -0
  35. package/a61c3bd3.js +5 -0
  36. package/b8f48ff4.js +769 -0
  37. package/bd0f5f65.js +319 -0
  38. package/bf4428f5.js +1269 -0
  39. package/cb1972f7.js +455 -0
  40. package/dfc10c94.js +818 -0
  41. package/ed2c9753.js +208 -0
  42. package/ef2833e6.js +927 -0
  43. package/f9637058.js +16 -0
  44. package/f9e72519.js +1284 -0
  45. package/fe063d15.js +19339 -0
  46. package/index.js +5 -0
  47. package/package.json +30 -3
  48. package/README.md +0 -120
  49. package/index.html +0 -26
  50. package/index.tsx +0 -21
  51. package/jest.config.js +0 -6
  52. package/src/__test__/allComp.test.tsx +0 -61
  53. package/src/app-env.d.ts +0 -3
  54. package/src/comps/calendarComp/calendarComp.tsx +0 -633
  55. package/src/comps/calendarComp/calendarConstants.tsx +0 -1048
  56. package/src/comps/calendarComp/errorBoundary.tsx +0 -30
  57. package/src/comps/chartComp/chartComp.tsx +0 -442
  58. package/src/comps/chartComp/chartConfigs/barChartConfig.tsx +0 -51
  59. package/src/comps/chartComp/chartConfigs/cartesianAxisConfig.tsx +0 -307
  60. package/src/comps/chartComp/chartConfigs/chartUrls.tsx +0 -9
  61. package/src/comps/chartComp/chartConfigs/legendConfig.tsx +0 -55
  62. package/src/comps/chartComp/chartConfigs/lineChartConfig.tsx +0 -96
  63. package/src/comps/chartComp/chartConfigs/pieChartConfig.tsx +0 -83
  64. package/src/comps/chartComp/chartConfigs/scatterChartConfig.tsx +0 -62
  65. package/src/comps/chartComp/chartConstants.tsx +0 -299
  66. package/src/comps/chartComp/chartPropertyView.tsx +0 -235
  67. package/src/comps/chartComp/chartUtils.ts +0 -291
  68. package/src/comps/chartComp/reactEcharts/core.tsx +0 -194
  69. package/src/comps/chartComp/reactEcharts/index.ts +0 -21
  70. package/src/comps/chartComp/reactEcharts/types.ts +0 -76
  71. package/src/comps/chartComp/seriesComp.tsx +0 -119
  72. package/src/comps/imageEditorComp/imageEditorClass.tsx +0 -52
  73. package/src/comps/imageEditorComp/imageEditorConstants.tsx +0 -109
  74. package/src/comps/imageEditorComp/index.tsx +0 -184
  75. package/src/comps/mermaidComp/index.tsx +0 -44
  76. package/src/comps/mermaidComp/mermaid.tsx +0 -29
  77. package/src/global.ts +0 -1
  78. package/src/i18n/comps/index.tsx +0 -29
  79. package/src/i18n/comps/locales/en.ts +0 -163
  80. package/src/i18n/comps/locales/enObj.tsx +0 -198
  81. package/src/i18n/comps/locales/index.ts +0 -7
  82. package/src/i18n/comps/locales/types.tsx +0 -10
  83. package/src/i18n/comps/locales/zh.ts +0 -156
  84. package/src/i18n/comps/locales/zhObj.tsx +0 -4
  85. package/src/index.ts +0 -11
  86. package/tsconfig.json +0 -22
  87. package/vite.config.js +0 -10
package/ef2833e6.js ADDED
@@ -0,0 +1,927 @@
1
+ import { E as _t, e as Y, s as Et, a as mt, d as gt, b as kt, F as xt, G as Rt, l as K, H as Ot, j as et, C as bt, k as Nt, I as Tt, J as At } from "./4c6a0ece.js";
2
+ import { G as Mt } from "./5a398ea8.js";
3
+ import { l as It } from "./65bbb6ae.js";
4
+ import { l as wt } from "./0964fcc6.js";
5
+ import "./2ff2c7a6.js";
6
+ import "./256b619e.js";
7
+ const St = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
8
+ function Dt(t) {
9
+ return typeof t == "string" && St.test(t);
10
+ }
11
+ function vt(t) {
12
+ if (!Dt(t))
13
+ throw TypeError("Invalid UUID");
14
+ let r;
15
+ const e = new Uint8Array(16);
16
+ return e[0] = (r = parseInt(t.slice(0, 8), 16)) >>> 24, e[1] = r >>> 16 & 255, e[2] = r >>> 8 & 255, e[3] = r & 255, e[4] = (r = parseInt(t.slice(9, 13), 16)) >>> 8, e[5] = r & 255, e[6] = (r = parseInt(t.slice(14, 18), 16)) >>> 8, e[7] = r & 255, e[8] = (r = parseInt(t.slice(19, 23), 16)) >>> 8, e[9] = r & 255, e[10] = (r = parseInt(t.slice(24, 36), 16)) / 1099511627776 & 255, e[11] = r / 4294967296 & 255, e[12] = r >>> 24 & 255, e[13] = r >>> 16 & 255, e[14] = r >>> 8 & 255, e[15] = r & 255, e;
17
+ }
18
+ function Lt(t) {
19
+ t = unescape(encodeURIComponent(t));
20
+ const r = [];
21
+ for (let e = 0; e < t.length; ++e)
22
+ r.push(t.charCodeAt(e));
23
+ return r;
24
+ }
25
+ const Bt = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", Ct = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
26
+ function Pt(t, r, e) {
27
+ function f(l, p, u, o) {
28
+ var h;
29
+ if (typeof l == "string" && (l = Lt(l)), typeof p == "string" && (p = vt(p)), ((h = p) === null || h === void 0 ? void 0 : h.length) !== 16)
30
+ throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
31
+ let _ = new Uint8Array(16 + l.length);
32
+ if (_.set(p), _.set(l, p.length), _ = e(_), _[6] = _[6] & 15 | r, _[8] = _[8] & 63 | 128, u) {
33
+ o = o || 0;
34
+ for (let m = 0; m < 16; ++m)
35
+ u[o + m] = _[m];
36
+ return u;
37
+ }
38
+ return _t(_);
39
+ }
40
+ try {
41
+ f.name = t;
42
+ } catch (l) {
43
+ }
44
+ return f.DNS = Bt, f.URL = Ct, f;
45
+ }
46
+ function Yt(t, r, e, f) {
47
+ switch (t) {
48
+ case 0:
49
+ return r & e ^ ~r & f;
50
+ case 1:
51
+ return r ^ e ^ f;
52
+ case 2:
53
+ return r & e ^ r & f ^ e & f;
54
+ case 3:
55
+ return r ^ e ^ f;
56
+ }
57
+ }
58
+ function rt(t, r) {
59
+ return t << r | t >>> 32 - r;
60
+ }
61
+ function Zt(t) {
62
+ const r = [1518500249, 1859775393, 2400959708, 3395469782], e = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
63
+ if (typeof t == "string") {
64
+ const u = unescape(encodeURIComponent(t));
65
+ t = [];
66
+ for (let o = 0; o < u.length; ++o)
67
+ t.push(u.charCodeAt(o));
68
+ } else
69
+ Array.isArray(t) || (t = Array.prototype.slice.call(t));
70
+ t.push(128);
71
+ const f = t.length / 4 + 2, l = Math.ceil(f / 16), p = new Array(l);
72
+ for (let u = 0; u < l; ++u) {
73
+ const o = new Uint32Array(16);
74
+ for (let h = 0; h < 16; ++h)
75
+ o[h] = t[u * 64 + h * 4] << 24 | t[u * 64 + h * 4 + 1] << 16 | t[u * 64 + h * 4 + 2] << 8 | t[u * 64 + h * 4 + 3];
76
+ p[u] = o;
77
+ }
78
+ p[l - 1][14] = (t.length - 1) * 8 / Math.pow(2, 32), p[l - 1][14] = Math.floor(p[l - 1][14]), p[l - 1][15] = (t.length - 1) * 8 & 4294967295;
79
+ for (let u = 0; u < l; ++u) {
80
+ const o = new Uint32Array(80);
81
+ for (let y = 0; y < 16; ++y)
82
+ o[y] = p[u][y];
83
+ for (let y = 16; y < 80; ++y)
84
+ o[y] = rt(o[y - 3] ^ o[y - 8] ^ o[y - 14] ^ o[y - 16], 1);
85
+ let h = e[0], _ = e[1], m = e[2], g = e[3], R = e[4];
86
+ for (let y = 0; y < 80; ++y) {
87
+ const k = Math.floor(y / 20), w = rt(h, 5) + Yt(k, _, m, g) + R + r[k] + o[y] >>> 0;
88
+ R = g, g = m, m = rt(_, 30) >>> 0, _ = h, h = w;
89
+ }
90
+ e[0] = e[0] + h >>> 0, e[1] = e[1] + _ >>> 0, e[2] = e[2] + m >>> 0, e[3] = e[3] + g >>> 0, e[4] = e[4] + R >>> 0;
91
+ }
92
+ return [e[0] >> 24 & 255, e[0] >> 16 & 255, e[0] >> 8 & 255, e[0] & 255, e[1] >> 24 & 255, e[1] >> 16 & 255, e[1] >> 8 & 255, e[1] & 255, e[2] >> 24 & 255, e[2] >> 16 & 255, e[2] >> 8 & 255, e[2] & 255, e[3] >> 24 & 255, e[3] >> 16 & 255, e[3] >> 8 & 255, e[3] & 255, e[4] >> 24 & 255, e[4] >> 16 & 255, e[4] >> 8 & 255, e[4] & 255];
93
+ }
94
+ const Ft = Pt("v5", 80, Zt), Wt = Ft;
95
+ var at = function() {
96
+ var t = function(M, i, n, c) {
97
+ for (n = n || {}, c = M.length; c--; n[M[c]] = i)
98
+ ;
99
+ return n;
100
+ }, r = [6, 8, 10, 20, 22, 24, 26, 27, 28], e = [1, 10], f = [1, 11], l = [1, 12], p = [1, 13], u = [1, 14], o = [1, 15], h = [1, 21], _ = [1, 22], m = [1, 23], g = [1, 24], R = [1, 25], y = [6, 8, 10, 13, 15, 18, 19, 20, 22, 24, 26, 27, 28, 41, 42, 43, 44, 45], k = [1, 34], w = [27, 28, 46, 47], Z = [41, 42, 43, 44, 45], F = [17, 34], B = [1, 54], T = [1, 53], A = [17, 34, 36, 38], O = {
101
+ trace: function() {
102
+ },
103
+ yy: {},
104
+ symbols_: { error: 2, start: 3, ER_DIAGRAM: 4, document: 5, EOF: 6, line: 7, SPACE: 8, statement: 9, NEWLINE: 10, entityName: 11, relSpec: 12, ":": 13, role: 14, BLOCK_START: 15, attributes: 16, BLOCK_STOP: 17, SQS: 18, SQE: 19, title: 20, title_value: 21, acc_title: 22, acc_title_value: 23, acc_descr: 24, acc_descr_value: 25, acc_descr_multiline_value: 26, ALPHANUM: 27, ENTITY_NAME: 28, attribute: 29, attributeType: 30, attributeName: 31, attributeKeyTypeList: 32, attributeComment: 33, ATTRIBUTE_WORD: 34, attributeKeyType: 35, COMMA: 36, ATTRIBUTE_KEY: 37, COMMENT: 38, cardinality: 39, relType: 40, ZERO_OR_ONE: 41, ZERO_OR_MORE: 42, ONE_OR_MORE: 43, ONLY_ONE: 44, MD_PARENT: 45, NON_IDENTIFYING: 46, IDENTIFYING: 47, WORD: 48, $accept: 0, $end: 1 },
105
+ terminals_: { 2: "error", 4: "ER_DIAGRAM", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 13: ":", 15: "BLOCK_START", 17: "BLOCK_STOP", 18: "SQS", 19: "SQE", 20: "title", 21: "title_value", 22: "acc_title", 23: "acc_title_value", 24: "acc_descr", 25: "acc_descr_value", 26: "acc_descr_multiline_value", 27: "ALPHANUM", 28: "ENTITY_NAME", 34: "ATTRIBUTE_WORD", 36: "COMMA", 37: "ATTRIBUTE_KEY", 38: "COMMENT", 41: "ZERO_OR_ONE", 42: "ZERO_OR_MORE", 43: "ONE_OR_MORE", 44: "ONLY_ONE", 45: "MD_PARENT", 46: "NON_IDENTIFYING", 47: "IDENTIFYING", 48: "WORD" },
106
+ productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 5], [9, 4], [9, 3], [9, 1], [9, 7], [9, 6], [9, 4], [9, 2], [9, 2], [9, 2], [9, 1], [11, 1], [11, 1], [16, 1], [16, 2], [29, 2], [29, 3], [29, 3], [29, 4], [30, 1], [31, 1], [32, 1], [32, 3], [35, 1], [33, 1], [12, 3], [39, 1], [39, 1], [39, 1], [39, 1], [39, 1], [40, 1], [40, 1], [14, 1], [14, 1], [14, 1]],
107
+ performAction: function(i, n, c, d, E, a, z) {
108
+ var s = a.length - 1;
109
+ switch (E) {
110
+ case 1:
111
+ break;
112
+ case 2:
113
+ this.$ = [];
114
+ break;
115
+ case 3:
116
+ a[s - 1].push(a[s]), this.$ = a[s - 1];
117
+ break;
118
+ case 4:
119
+ case 5:
120
+ this.$ = a[s];
121
+ break;
122
+ case 6:
123
+ case 7:
124
+ this.$ = [];
125
+ break;
126
+ case 8:
127
+ d.addEntity(a[s - 4]), d.addEntity(a[s - 2]), d.addRelationship(a[s - 4], a[s], a[s - 2], a[s - 3]);
128
+ break;
129
+ case 9:
130
+ d.addEntity(a[s - 3]), d.addAttributes(a[s - 3], a[s - 1]);
131
+ break;
132
+ case 10:
133
+ d.addEntity(a[s - 2]);
134
+ break;
135
+ case 11:
136
+ d.addEntity(a[s]);
137
+ break;
138
+ case 12:
139
+ d.addEntity(a[s - 6], a[s - 4]), d.addAttributes(a[s - 6], a[s - 1]);
140
+ break;
141
+ case 13:
142
+ d.addEntity(a[s - 5], a[s - 3]);
143
+ break;
144
+ case 14:
145
+ d.addEntity(a[s - 3], a[s - 1]);
146
+ break;
147
+ case 15:
148
+ case 16:
149
+ this.$ = a[s].trim(), d.setAccTitle(this.$);
150
+ break;
151
+ case 17:
152
+ case 18:
153
+ this.$ = a[s].trim(), d.setAccDescription(this.$);
154
+ break;
155
+ case 19:
156
+ case 43:
157
+ this.$ = a[s];
158
+ break;
159
+ case 20:
160
+ case 41:
161
+ case 42:
162
+ this.$ = a[s].replace(/"/g, "");
163
+ break;
164
+ case 21:
165
+ case 29:
166
+ this.$ = [a[s]];
167
+ break;
168
+ case 22:
169
+ a[s].push(a[s - 1]), this.$ = a[s];
170
+ break;
171
+ case 23:
172
+ this.$ = { attributeType: a[s - 1], attributeName: a[s] };
173
+ break;
174
+ case 24:
175
+ this.$ = { attributeType: a[s - 2], attributeName: a[s - 1], attributeKeyTypeList: a[s] };
176
+ break;
177
+ case 25:
178
+ this.$ = { attributeType: a[s - 2], attributeName: a[s - 1], attributeComment: a[s] };
179
+ break;
180
+ case 26:
181
+ this.$ = { attributeType: a[s - 3], attributeName: a[s - 2], attributeKeyTypeList: a[s - 1], attributeComment: a[s] };
182
+ break;
183
+ case 27:
184
+ case 28:
185
+ case 31:
186
+ this.$ = a[s];
187
+ break;
188
+ case 30:
189
+ a[s - 2].push(a[s]), this.$ = a[s - 2];
190
+ break;
191
+ case 32:
192
+ this.$ = a[s].replace(/"/g, "");
193
+ break;
194
+ case 33:
195
+ this.$ = { cardA: a[s], relType: a[s - 1], cardB: a[s - 2] };
196
+ break;
197
+ case 34:
198
+ this.$ = d.Cardinality.ZERO_OR_ONE;
199
+ break;
200
+ case 35:
201
+ this.$ = d.Cardinality.ZERO_OR_MORE;
202
+ break;
203
+ case 36:
204
+ this.$ = d.Cardinality.ONE_OR_MORE;
205
+ break;
206
+ case 37:
207
+ this.$ = d.Cardinality.ONLY_ONE;
208
+ break;
209
+ case 38:
210
+ this.$ = d.Cardinality.MD_PARENT;
211
+ break;
212
+ case 39:
213
+ this.$ = d.Identification.NON_IDENTIFYING;
214
+ break;
215
+ case 40:
216
+ this.$ = d.Identification.IDENTIFYING;
217
+ break;
218
+ }
219
+ },
220
+ table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, t(r, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 9, 20: e, 22: f, 24: l, 26: p, 27: u, 28: o }, t(r, [2, 7], { 1: [2, 1] }), t(r, [2, 3]), { 9: 16, 11: 9, 20: e, 22: f, 24: l, 26: p, 27: u, 28: o }, t(r, [2, 5]), t(r, [2, 6]), t(r, [2, 11], { 12: 17, 39: 20, 15: [1, 18], 18: [1, 19], 41: h, 42: _, 43: m, 44: g, 45: R }), { 21: [1, 26] }, { 23: [1, 27] }, { 25: [1, 28] }, t(r, [2, 18]), t(y, [2, 19]), t(y, [2, 20]), t(r, [2, 4]), { 11: 29, 27: u, 28: o }, { 16: 30, 17: [1, 31], 29: 32, 30: 33, 34: k }, { 11: 35, 27: u, 28: o }, { 40: 36, 46: [1, 37], 47: [1, 38] }, t(w, [2, 34]), t(w, [2, 35]), t(w, [2, 36]), t(w, [2, 37]), t(w, [2, 38]), t(r, [2, 15]), t(r, [2, 16]), t(r, [2, 17]), { 13: [1, 39] }, { 17: [1, 40] }, t(r, [2, 10]), { 16: 41, 17: [2, 21], 29: 32, 30: 33, 34: k }, { 31: 42, 34: [1, 43] }, { 34: [2, 27] }, { 19: [1, 44] }, { 39: 45, 41: h, 42: _, 43: m, 44: g, 45: R }, t(Z, [2, 39]), t(Z, [2, 40]), { 14: 46, 27: [1, 49], 28: [1, 48], 48: [1, 47] }, t(r, [2, 9]), { 17: [2, 22] }, t(F, [2, 23], { 32: 50, 33: 51, 35: 52, 37: B, 38: T }), t([17, 34, 37, 38], [2, 28]), t(r, [2, 14], { 15: [1, 55] }), t([27, 28], [2, 33]), t(r, [2, 8]), t(r, [2, 41]), t(r, [2, 42]), t(r, [2, 43]), t(F, [2, 24], { 33: 56, 36: [1, 57], 38: T }), t(F, [2, 25]), t(A, [2, 29]), t(F, [2, 32]), t(A, [2, 31]), { 16: 58, 17: [1, 59], 29: 32, 30: 33, 34: k }, t(F, [2, 26]), { 35: 60, 37: B }, { 17: [1, 61] }, t(r, [2, 13]), t(A, [2, 30]), t(r, [2, 12])],
221
+ defaultActions: { 34: [2, 27], 41: [2, 22] },
222
+ parseError: function(i, n) {
223
+ if (n.recoverable)
224
+ this.trace(i);
225
+ else {
226
+ var c = new Error(i);
227
+ throw c.hash = n, c;
228
+ }
229
+ },
230
+ parse: function(i) {
231
+ var n = this, c = [0], d = [], E = [null], a = [], z = this.table, s = "", X = 0, nt = 0, ft = 2, st = 1, ut = a.slice.call(arguments, 1), N = Object.create(this.lexer), U = { yy: {} };
232
+ for (var J in this.yy)
233
+ Object.prototype.hasOwnProperty.call(this.yy, J) && (U.yy[J] = this.yy[J]);
234
+ N.setInput(i, U.yy), U.yy.lexer = N, U.yy.parser = this, typeof N.yylloc == "undefined" && (N.yylloc = {});
235
+ var q = N.yylloc;
236
+ a.push(q);
237
+ var yt = N.options && N.options.ranges;
238
+ typeof U.yy.parseError == "function" ? this.parseError = U.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
239
+ function pt() {
240
+ var P;
241
+ return P = d.pop() || N.lex() || st, typeof P != "number" && (P instanceof Array && (d = P, P = d.pop()), P = n.symbols_[P] || P), P;
242
+ }
243
+ for (var I, G, S, $, H = {}, Q, C, ot, j; ; ) {
244
+ if (G = c[c.length - 1], this.defaultActions[G] ? S = this.defaultActions[G] : ((I === null || typeof I == "undefined") && (I = pt()), S = z[G] && z[G][I]), typeof S == "undefined" || !S.length || !S[0]) {
245
+ var tt = "";
246
+ j = [];
247
+ for (Q in z[G])
248
+ this.terminals_[Q] && Q > ft && j.push("'" + this.terminals_[Q] + "'");
249
+ N.showPosition ? tt = "Parse error on line " + (X + 1) + `:
250
+ ` + N.showPosition() + `
251
+ Expecting ` + j.join(", ") + ", got '" + (this.terminals_[I] || I) + "'" : tt = "Parse error on line " + (X + 1) + ": Unexpected " + (I == st ? "end of input" : "'" + (this.terminals_[I] || I) + "'"), this.parseError(tt, {
252
+ text: N.match,
253
+ token: this.terminals_[I] || I,
254
+ line: N.yylineno,
255
+ loc: q,
256
+ expected: j
257
+ });
258
+ }
259
+ if (S[0] instanceof Array && S.length > 1)
260
+ throw new Error("Parse Error: multiple actions possible at state: " + G + ", token: " + I);
261
+ switch (S[0]) {
262
+ case 1:
263
+ c.push(I), E.push(N.yytext), a.push(N.yylloc), c.push(S[1]), I = null, nt = N.yyleng, s = N.yytext, X = N.yylineno, q = N.yylloc;
264
+ break;
265
+ case 2:
266
+ if (C = this.productions_[S[1]][1], H.$ = E[E.length - C], H._$ = {
267
+ first_line: a[a.length - (C || 1)].first_line,
268
+ last_line: a[a.length - 1].last_line,
269
+ first_column: a[a.length - (C || 1)].first_column,
270
+ last_column: a[a.length - 1].last_column
271
+ }, yt && (H._$.range = [
272
+ a[a.length - (C || 1)].range[0],
273
+ a[a.length - 1].range[1]
274
+ ]), $ = this.performAction.apply(H, [
275
+ s,
276
+ nt,
277
+ X,
278
+ U.yy,
279
+ S[1],
280
+ E,
281
+ a
282
+ ].concat(ut)), typeof $ != "undefined")
283
+ return $;
284
+ C && (c = c.slice(0, -1 * C * 2), E = E.slice(0, -1 * C), a = a.slice(0, -1 * C)), c.push(this.productions_[S[1]][0]), E.push(H.$), a.push(H._$), ot = z[c[c.length - 2]][c[c.length - 1]], c.push(ot);
285
+ break;
286
+ case 3:
287
+ return !0;
288
+ }
289
+ }
290
+ return !0;
291
+ }
292
+ }, b = function() {
293
+ var M = {
294
+ EOF: 1,
295
+ parseError: function(n, c) {
296
+ if (this.yy.parser)
297
+ this.yy.parser.parseError(n, c);
298
+ else
299
+ throw new Error(n);
300
+ },
301
+ // resets the lexer, sets new input
302
+ setInput: function(i, n) {
303
+ return this.yy = n || this.yy || {}, this._input = i, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
304
+ first_line: 1,
305
+ first_column: 0,
306
+ last_line: 1,
307
+ last_column: 0
308
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
309
+ },
310
+ // consumes and returns one char from the input
311
+ input: function() {
312
+ var i = this._input[0];
313
+ this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i;
314
+ var n = i.match(/(?:\r\n?|\n).*/g);
315
+ return n ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), i;
316
+ },
317
+ // unshifts one char (or a string) into the input
318
+ unput: function(i) {
319
+ var n = i.length, c = i.split(/(?:\r\n?|\n)/g);
320
+ this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - n), this.offset -= n;
321
+ var d = this.match.split(/(?:\r\n?|\n)/g);
322
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), c.length - 1 && (this.yylineno -= c.length - 1);
323
+ var E = this.yylloc.range;
324
+ return this.yylloc = {
325
+ first_line: this.yylloc.first_line,
326
+ last_line: this.yylineno + 1,
327
+ first_column: this.yylloc.first_column,
328
+ last_column: c ? (c.length === d.length ? this.yylloc.first_column : 0) + d[d.length - c.length].length - c[0].length : this.yylloc.first_column - n
329
+ }, this.options.ranges && (this.yylloc.range = [E[0], E[0] + this.yyleng - n]), this.yyleng = this.yytext.length, this;
330
+ },
331
+ // When called from action, caches matched text and appends it on next action
332
+ more: function() {
333
+ return this._more = !0, this;
334
+ },
335
+ // 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.
336
+ reject: function() {
337
+ if (this.options.backtrack_lexer)
338
+ this._backtrack = !0;
339
+ else
340
+ 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).
341
+ ` + this.showPosition(), {
342
+ text: "",
343
+ token: null,
344
+ line: this.yylineno
345
+ });
346
+ return this;
347
+ },
348
+ // retain first n characters of the match
349
+ less: function(i) {
350
+ this.unput(this.match.slice(i));
351
+ },
352
+ // displays already matched input, i.e. for error messages
353
+ pastInput: function() {
354
+ var i = this.matched.substr(0, this.matched.length - this.match.length);
355
+ return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, "");
356
+ },
357
+ // displays upcoming input, i.e. for error messages
358
+ upcomingInput: function() {
359
+ var i = this.match;
360
+ return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, "");
361
+ },
362
+ // displays the character position where the lexing error occurred, i.e. for error messages
363
+ showPosition: function() {
364
+ var i = this.pastInput(), n = new Array(i.length + 1).join("-");
365
+ return i + this.upcomingInput() + `
366
+ ` + n + "^";
367
+ },
368
+ // test the lexed token: return FALSE when not a match, otherwise return token
369
+ test_match: function(i, n) {
370
+ var c, d, E;
371
+ if (this.options.backtrack_lexer && (E = {
372
+ yylineno: this.yylineno,
373
+ yylloc: {
374
+ first_line: this.yylloc.first_line,
375
+ last_line: this.last_line,
376
+ first_column: this.yylloc.first_column,
377
+ last_column: this.yylloc.last_column
378
+ },
379
+ yytext: this.yytext,
380
+ match: this.match,
381
+ matches: this.matches,
382
+ matched: this.matched,
383
+ yyleng: this.yyleng,
384
+ offset: this.offset,
385
+ _more: this._more,
386
+ _input: this._input,
387
+ yy: this.yy,
388
+ conditionStack: this.conditionStack.slice(0),
389
+ done: this.done
390
+ }, this.options.ranges && (E.yylloc.range = this.yylloc.range.slice(0))), d = i[0].match(/(?:\r\n?|\n).*/g), d && (this.yylineno += d.length), this.yylloc = {
391
+ first_line: this.yylloc.last_line,
392
+ last_line: this.yylineno + 1,
393
+ first_column: this.yylloc.last_column,
394
+ last_column: d ? d[d.length - 1].length - d[d.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length
395
+ }, this.yytext += i[0], this.match += i[0], this.matches = i, 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(i[0].length), this.matched += i[0], c = this.performAction.call(this, this.yy, this, n, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), c)
396
+ return c;
397
+ if (this._backtrack) {
398
+ for (var a in E)
399
+ this[a] = E[a];
400
+ return !1;
401
+ }
402
+ return !1;
403
+ },
404
+ // return next match in input
405
+ next: function() {
406
+ if (this.done)
407
+ return this.EOF;
408
+ this._input || (this.done = !0);
409
+ var i, n, c, d;
410
+ this._more || (this.yytext = "", this.match = "");
411
+ for (var E = this._currentRules(), a = 0; a < E.length; a++)
412
+ if (c = this._input.match(this.rules[E[a]]), c && (!n || c[0].length > n[0].length)) {
413
+ if (n = c, d = a, this.options.backtrack_lexer) {
414
+ if (i = this.test_match(c, E[a]), i !== !1)
415
+ return i;
416
+ if (this._backtrack) {
417
+ n = !1;
418
+ continue;
419
+ } else
420
+ return !1;
421
+ } else if (!this.options.flex)
422
+ break;
423
+ }
424
+ return n ? (i = this.test_match(n, E[d]), i !== !1 ? i : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
425
+ ` + this.showPosition(), {
426
+ text: "",
427
+ token: null,
428
+ line: this.yylineno
429
+ });
430
+ },
431
+ // return next match that has a token
432
+ lex: function() {
433
+ var n = this.next();
434
+ return n || this.lex();
435
+ },
436
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
437
+ begin: function(n) {
438
+ this.conditionStack.push(n);
439
+ },
440
+ // pop the previously active lexer condition state off the condition stack
441
+ popState: function() {
442
+ var n = this.conditionStack.length - 1;
443
+ return n > 0 ? this.conditionStack.pop() : this.conditionStack[0];
444
+ },
445
+ // produce the lexer rule set which is active for the currently active lexer condition state
446
+ _currentRules: function() {
447
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
448
+ },
449
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
450
+ topState: function(n) {
451
+ return n = this.conditionStack.length - 1 - Math.abs(n || 0), n >= 0 ? this.conditionStack[n] : "INITIAL";
452
+ },
453
+ // alias for begin(condition)
454
+ pushState: function(n) {
455
+ this.begin(n);
456
+ },
457
+ // return the number of states currently on the stack
458
+ stateStackSize: function() {
459
+ return this.conditionStack.length;
460
+ },
461
+ options: { "case-insensitive": !0 },
462
+ performAction: function(n, c, d, E) {
463
+ switch (d) {
464
+ case 0:
465
+ return this.begin("acc_title"), 22;
466
+ case 1:
467
+ return this.popState(), "acc_title_value";
468
+ case 2:
469
+ return this.begin("acc_descr"), 24;
470
+ case 3:
471
+ return this.popState(), "acc_descr_value";
472
+ case 4:
473
+ this.begin("acc_descr_multiline");
474
+ break;
475
+ case 5:
476
+ this.popState();
477
+ break;
478
+ case 6:
479
+ return "acc_descr_multiline_value";
480
+ case 7:
481
+ return 10;
482
+ case 8:
483
+ break;
484
+ case 9:
485
+ return 8;
486
+ case 10:
487
+ return 28;
488
+ case 11:
489
+ return 48;
490
+ case 12:
491
+ return 4;
492
+ case 13:
493
+ return this.begin("block"), 15;
494
+ case 14:
495
+ return 36;
496
+ case 15:
497
+ break;
498
+ case 16:
499
+ return 37;
500
+ case 17:
501
+ return 34;
502
+ case 18:
503
+ return 34;
504
+ case 19:
505
+ return 38;
506
+ case 20:
507
+ break;
508
+ case 21:
509
+ return this.popState(), 17;
510
+ case 22:
511
+ return c.yytext[0];
512
+ case 23:
513
+ return 18;
514
+ case 24:
515
+ return 19;
516
+ case 25:
517
+ return 41;
518
+ case 26:
519
+ return 43;
520
+ case 27:
521
+ return 43;
522
+ case 28:
523
+ return 43;
524
+ case 29:
525
+ return 41;
526
+ case 30:
527
+ return 41;
528
+ case 31:
529
+ return 42;
530
+ case 32:
531
+ return 42;
532
+ case 33:
533
+ return 42;
534
+ case 34:
535
+ return 42;
536
+ case 35:
537
+ return 42;
538
+ case 36:
539
+ return 43;
540
+ case 37:
541
+ return 42;
542
+ case 38:
543
+ return 43;
544
+ case 39:
545
+ return 44;
546
+ case 40:
547
+ return 44;
548
+ case 41:
549
+ return 44;
550
+ case 42:
551
+ return 44;
552
+ case 43:
553
+ return 41;
554
+ case 44:
555
+ return 42;
556
+ case 45:
557
+ return 43;
558
+ case 46:
559
+ return 45;
560
+ case 47:
561
+ return 46;
562
+ case 48:
563
+ return 47;
564
+ case 49:
565
+ return 47;
566
+ case 50:
567
+ return 46;
568
+ case 51:
569
+ return 46;
570
+ case 52:
571
+ return 46;
572
+ case 53:
573
+ return 27;
574
+ case 54:
575
+ return c.yytext[0];
576
+ case 55:
577
+ return 6;
578
+ }
579
+ },
580
+ rules: [/^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:[\s]+)/i, /^(?:"[^"%\r\n\v\b\\]+")/i, /^(?:"[^"]*")/i, /^(?:erDiagram\b)/i, /^(?:\{)/i, /^(?:,)/i, /^(?:\s+)/i, /^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i, /^(?:(.*?)[~](.*?)*[~])/i, /^(?:[\*A-Za-z_][A-Za-z0-9\-_\[\]\(\)]*)/i, /^(?:"[^"]*")/i, /^(?:[\n]+)/i, /^(?:\})/i, /^(?:.)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:one or zero\b)/i, /^(?:one or more\b)/i, /^(?:one or many\b)/i, /^(?:1\+)/i, /^(?:\|o\b)/i, /^(?:zero or one\b)/i, /^(?:zero or more\b)/i, /^(?:zero or many\b)/i, /^(?:0\+)/i, /^(?:\}o\b)/i, /^(?:many\(0\))/i, /^(?:many\(1\))/i, /^(?:many\b)/i, /^(?:\}\|)/i, /^(?:one\b)/i, /^(?:only one\b)/i, /^(?:1\b)/i, /^(?:\|\|)/i, /^(?:o\|)/i, /^(?:o\{)/i, /^(?:\|\{)/i, /^(?:\s*u\b)/i, /^(?:\.\.)/i, /^(?:--)/i, /^(?:to\b)/i, /^(?:optionally to\b)/i, /^(?:\.-)/i, /^(?:-\.)/i, /^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i, /^(?:.)/i, /^(?:$)/i],
581
+ conditions: { acc_descr_multiline: { rules: [5, 6], inclusive: !1 }, acc_descr: { rules: [3], inclusive: !1 }, acc_title: { rules: [1], inclusive: !1 }, block: { rules: [14, 15, 16, 17, 18, 19, 20, 21, 22], inclusive: !1 }, INITIAL: { rules: [0, 2, 4, 7, 8, 9, 10, 11, 12, 13, 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, 53, 54, 55], inclusive: !0 } }
582
+ };
583
+ return M;
584
+ }();
585
+ O.lexer = b;
586
+ function D() {
587
+ this.yy = {};
588
+ }
589
+ return D.prototype = O, O.Parser = D, new D();
590
+ }();
591
+ at.parser = at;
592
+ const Ut = at;
593
+ let W = {}, it = [];
594
+ const Gt = {
595
+ ZERO_OR_ONE: "ZERO_OR_ONE",
596
+ ZERO_OR_MORE: "ZERO_OR_MORE",
597
+ ONE_OR_MORE: "ONE_OR_MORE",
598
+ ONLY_ONE: "ONLY_ONE",
599
+ MD_PARENT: "MD_PARENT"
600
+ }, Ht = {
601
+ NON_IDENTIFYING: "NON_IDENTIFYING",
602
+ IDENTIFYING: "IDENTIFYING"
603
+ }, ht = function(t, r = void 0) {
604
+ return W[t] === void 0 ? (W[t] = { attributes: [], alias: r }, K.info("Added new entity :", t)) : W[t] && !W[t].alias && r && (W[t].alias = r, K.info(`Add alias '${r}' to entity '${t}'`)), W[t];
605
+ }, zt = () => W, Kt = function(t, r) {
606
+ let e = ht(t), f;
607
+ for (f = r.length - 1; f >= 0; f--)
608
+ e.attributes.push(r[f]), K.debug("Added attribute ", r[f].attributeName);
609
+ }, Vt = function(t, r, e, f) {
610
+ let l = {
611
+ entityA: t,
612
+ roleA: r,
613
+ entityB: e,
614
+ relSpec: f
615
+ };
616
+ it.push(l), K.debug("Added new relationship :", l);
617
+ }, Xt = () => it, Qt = function() {
618
+ W = {}, it = [], Ot();
619
+ }, jt = {
620
+ Cardinality: Gt,
621
+ Identification: Ht,
622
+ getConfig: () => Y().er,
623
+ addEntity: ht,
624
+ addAttributes: Kt,
625
+ getEntities: zt,
626
+ addRelationship: Vt,
627
+ getRelationships: Xt,
628
+ clear: Qt,
629
+ setAccTitle: Et,
630
+ getAccTitle: mt,
631
+ setAccDescription: gt,
632
+ getAccDescription: kt,
633
+ setDiagramTitle: xt,
634
+ getDiagramTitle: Rt
635
+ }, v = {
636
+ ONLY_ONE_START: "ONLY_ONE_START",
637
+ ONLY_ONE_END: "ONLY_ONE_END",
638
+ ZERO_OR_ONE_START: "ZERO_OR_ONE_START",
639
+ ZERO_OR_ONE_END: "ZERO_OR_ONE_END",
640
+ ONE_OR_MORE_START: "ONE_OR_MORE_START",
641
+ ONE_OR_MORE_END: "ONE_OR_MORE_END",
642
+ ZERO_OR_MORE_START: "ZERO_OR_MORE_START",
643
+ ZERO_OR_MORE_END: "ZERO_OR_MORE_END",
644
+ MD_PARENT_END: "MD_PARENT_END",
645
+ MD_PARENT_START: "MD_PARENT_START"
646
+ }, Jt = function(t, r) {
647
+ let e;
648
+ t.append("defs").append("marker").attr("id", v.MD_PARENT_START).attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), t.append("defs").append("marker").attr("id", v.MD_PARENT_END).attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), t.append("defs").append("marker").attr("id", v.ONLY_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M9,0 L9,18 M15,0 L15,18"), t.append("defs").append("marker").attr("id", v.ONLY_ONE_END).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M3,0 L3,18 M9,0 L9,18"), e = t.append("defs").append("marker").attr("id", v.ZERO_OR_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto"), e.append("circle").attr("stroke", r.stroke).attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6), e.append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M9,0 L9,18"), e = t.append("defs").append("marker").attr("id", v.ZERO_OR_ONE_END).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto"), e.append("circle").attr("stroke", r.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6), e.append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M21,0 L21,18"), t.append("defs").append("marker").attr("id", v.ONE_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"), t.append("defs").append("marker").attr("id", v.ONE_OR_MORE_END).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"), e = t.append("defs").append("marker").attr("id", v.ZERO_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto"), e.append("circle").attr("stroke", r.stroke).attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6), e.append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18"), e = t.append("defs").append("marker").attr("id", v.ZERO_OR_MORE_END).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto"), e.append("circle").attr("stroke", r.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6), e.append("path").attr("stroke", r.stroke).attr("fill", "none").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
649
+ }, L = {
650
+ ERMarkers: v,
651
+ insertMarkers: Jt
652
+ }, qt = /[^\dA-Za-z](\W)*/g;
653
+ let x = {}, V = /* @__PURE__ */ new Map();
654
+ const $t = function(t) {
655
+ const r = Object.keys(t);
656
+ for (const e of r)
657
+ x[e] = t[e];
658
+ }, te = (t, r, e) => {
659
+ const f = x.entityPadding / 3, l = x.entityPadding / 3, p = x.fontSize * 0.85, u = r.node().getBBox(), o = [];
660
+ let h = !1, _ = !1, m = 0, g = 0, R = 0, y = 0, k = u.height + f * 2, w = 1;
661
+ e.forEach((T) => {
662
+ T.attributeKeyTypeList !== void 0 && T.attributeKeyTypeList.length > 0 && (h = !0), T.attributeComment !== void 0 && (_ = !0);
663
+ }), e.forEach((T) => {
664
+ const A = `${r.node().id}-attr-${w}`;
665
+ let O = 0;
666
+ const b = At(T.attributeType), D = t.append("text").classed("er entityLabel", !0).attr("id", `${A}-type`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", Y().fontFamily).style("font-size", p + "px").text(b), M = t.append("text").classed("er entityLabel", !0).attr("id", `${A}-name`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", Y().fontFamily).style("font-size", p + "px").text(T.attributeName), i = {};
667
+ i.tn = D, i.nn = M;
668
+ const n = D.node().getBBox(), c = M.node().getBBox();
669
+ if (m = Math.max(m, n.width), g = Math.max(g, c.width), O = Math.max(n.height, c.height), h) {
670
+ const d = T.attributeKeyTypeList !== void 0 ? T.attributeKeyTypeList.join(",") : "", E = t.append("text").classed("er entityLabel", !0).attr("id", `${A}-key`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", Y().fontFamily).style("font-size", p + "px").text(d);
671
+ i.kn = E;
672
+ const a = E.node().getBBox();
673
+ R = Math.max(R, a.width), O = Math.max(O, a.height);
674
+ }
675
+ if (_) {
676
+ const d = t.append("text").classed("er entityLabel", !0).attr("id", `${A}-comment`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", Y().fontFamily).style("font-size", p + "px").text(T.attributeComment || "");
677
+ i.cn = d;
678
+ const E = d.node().getBBox();
679
+ y = Math.max(y, E.width), O = Math.max(O, E.height);
680
+ }
681
+ i.height = O, o.push(i), k += O + f * 2, w += 1;
682
+ });
683
+ let Z = 4;
684
+ h && (Z += 2), _ && (Z += 2);
685
+ const F = m + g + R + y, B = {
686
+ width: Math.max(
687
+ x.minEntityWidth,
688
+ Math.max(
689
+ u.width + x.entityPadding * 2,
690
+ F + l * Z
691
+ )
692
+ ),
693
+ height: e.length > 0 ? k : Math.max(x.minEntityHeight, u.height + x.entityPadding * 2)
694
+ };
695
+ if (e.length > 0) {
696
+ const T = Math.max(
697
+ 0,
698
+ (B.width - F - l * Z) / (Z / 2)
699
+ );
700
+ r.attr(
701
+ "transform",
702
+ "translate(" + B.width / 2 + "," + (f + u.height / 2) + ")"
703
+ );
704
+ let A = u.height + f * 2, O = "attributeBoxOdd";
705
+ o.forEach((b) => {
706
+ const D = A + f + b.height / 2;
707
+ b.tn.attr("transform", "translate(" + l + "," + D + ")");
708
+ const M = t.insert("rect", "#" + b.tn.node().id).classed(`er ${O}`, !0).attr("x", 0).attr("y", A).attr("width", m + l * 2 + T).attr("height", b.height + f * 2), i = parseFloat(M.attr("x")) + parseFloat(M.attr("width"));
709
+ b.nn.attr(
710
+ "transform",
711
+ "translate(" + (i + l) + "," + D + ")"
712
+ );
713
+ const n = t.insert("rect", "#" + b.nn.node().id).classed(`er ${O}`, !0).attr("x", i).attr("y", A).attr("width", g + l * 2 + T).attr("height", b.height + f * 2);
714
+ let c = parseFloat(n.attr("x")) + parseFloat(n.attr("width"));
715
+ if (h) {
716
+ b.kn.attr(
717
+ "transform",
718
+ "translate(" + (c + l) + "," + D + ")"
719
+ );
720
+ const d = t.insert("rect", "#" + b.kn.node().id).classed(`er ${O}`, !0).attr("x", c).attr("y", A).attr("width", R + l * 2 + T).attr("height", b.height + f * 2);
721
+ c = parseFloat(d.attr("x")) + parseFloat(d.attr("width"));
722
+ }
723
+ _ && (b.cn.attr(
724
+ "transform",
725
+ "translate(" + (c + l) + "," + D + ")"
726
+ ), t.insert("rect", "#" + b.cn.node().id).classed(`er ${O}`, "true").attr("x", c).attr("y", A).attr("width", y + l * 2 + T).attr("height", b.height + f * 2)), A += b.height + f * 2, O = O === "attributeBoxOdd" ? "attributeBoxEven" : "attributeBoxOdd";
727
+ });
728
+ } else
729
+ B.height = Math.max(x.minEntityHeight, k), r.attr("transform", "translate(" + B.width / 2 + "," + B.height / 2 + ")");
730
+ return B;
731
+ }, ee = function(t, r, e) {
732
+ const f = Object.keys(r);
733
+ let l;
734
+ return f.forEach(function(p) {
735
+ var k;
736
+ const u = oe(p, "entity");
737
+ V.set(p, u);
738
+ const o = t.append("g").attr("id", u);
739
+ l = l === void 0 ? u : l;
740
+ const h = "text-" + u, _ = o.append("text").classed("er entityLabel", !0).attr("id", h).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "middle").style("font-family", Y().fontFamily).style("font-size", x.fontSize + "px").text((k = r[p].alias) != null ? k : p), { width: m, height: g } = te(
741
+ o,
742
+ _,
743
+ r[p].attributes
744
+ ), y = o.insert("rect", "#" + h).classed("er entityBox", !0).attr("x", 0).attr("y", 0).attr("width", m).attr("height", g).node().getBBox();
745
+ e.setNode(u, {
746
+ width: y.width,
747
+ height: y.height,
748
+ shape: "rect",
749
+ id: u
750
+ });
751
+ }), l;
752
+ }, re = function(t, r) {
753
+ r.nodes().forEach(function(e) {
754
+ e !== void 0 && r.node(e) !== void 0 && t.select("#" + e).attr(
755
+ "transform",
756
+ "translate(" + (r.node(e).x - r.node(e).width / 2) + "," + (r.node(e).y - r.node(e).height / 2) + " )"
757
+ );
758
+ });
759
+ }, dt = function(t) {
760
+ return (t.entityA + t.roleA + t.entityB).replace(/\s/g, "");
761
+ }, ae = function(t, r) {
762
+ return t.forEach(function(e) {
763
+ r.setEdge(
764
+ V.get(e.entityA),
765
+ V.get(e.entityB),
766
+ { relationship: e },
767
+ dt(e)
768
+ );
769
+ }), t;
770
+ };
771
+ let lt = 0;
772
+ const ie = function(t, r, e, f, l) {
773
+ lt++;
774
+ const p = e.edge(
775
+ V.get(r.entityA),
776
+ V.get(r.entityB),
777
+ dt(r)
778
+ ), u = wt().x(function(k) {
779
+ return k.x;
780
+ }).y(function(k) {
781
+ return k.y;
782
+ }).curve(Tt), o = t.insert("path", "#" + f).classed("er relationshipLine", !0).attr("d", u(p.points)).style("stroke", x.stroke).style("fill", "none");
783
+ r.relSpec.relType === l.db.Identification.NON_IDENTIFYING && o.attr("stroke-dasharray", "8,8");
784
+ let h = "";
785
+ switch (x.arrowMarkerAbsolute && (h = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, h = h.replace(/\(/g, "\\("), h = h.replace(/\)/g, "\\)")), r.relSpec.cardA) {
786
+ case l.db.Cardinality.ZERO_OR_ONE:
787
+ o.attr("marker-end", "url(" + h + "#" + L.ERMarkers.ZERO_OR_ONE_END + ")");
788
+ break;
789
+ case l.db.Cardinality.ZERO_OR_MORE:
790
+ o.attr("marker-end", "url(" + h + "#" + L.ERMarkers.ZERO_OR_MORE_END + ")");
791
+ break;
792
+ case l.db.Cardinality.ONE_OR_MORE:
793
+ o.attr("marker-end", "url(" + h + "#" + L.ERMarkers.ONE_OR_MORE_END + ")");
794
+ break;
795
+ case l.db.Cardinality.ONLY_ONE:
796
+ o.attr("marker-end", "url(" + h + "#" + L.ERMarkers.ONLY_ONE_END + ")");
797
+ break;
798
+ case l.db.Cardinality.MD_PARENT:
799
+ o.attr("marker-end", "url(" + h + "#" + L.ERMarkers.MD_PARENT_END + ")");
800
+ break;
801
+ }
802
+ switch (r.relSpec.cardB) {
803
+ case l.db.Cardinality.ZERO_OR_ONE:
804
+ o.attr(
805
+ "marker-start",
806
+ "url(" + h + "#" + L.ERMarkers.ZERO_OR_ONE_START + ")"
807
+ );
808
+ break;
809
+ case l.db.Cardinality.ZERO_OR_MORE:
810
+ o.attr(
811
+ "marker-start",
812
+ "url(" + h + "#" + L.ERMarkers.ZERO_OR_MORE_START + ")"
813
+ );
814
+ break;
815
+ case l.db.Cardinality.ONE_OR_MORE:
816
+ o.attr(
817
+ "marker-start",
818
+ "url(" + h + "#" + L.ERMarkers.ONE_OR_MORE_START + ")"
819
+ );
820
+ break;
821
+ case l.db.Cardinality.ONLY_ONE:
822
+ o.attr("marker-start", "url(" + h + "#" + L.ERMarkers.ONLY_ONE_START + ")");
823
+ break;
824
+ case l.db.Cardinality.MD_PARENT:
825
+ o.attr("marker-start", "url(" + h + "#" + L.ERMarkers.MD_PARENT_START + ")");
826
+ break;
827
+ }
828
+ const _ = o.node().getTotalLength(), m = o.node().getPointAtLength(_ * 0.5), g = "rel" + lt, y = t.append("text").classed("er relationshipLabel", !0).attr("id", g).attr("x", m.x).attr("y", m.y).style("text-anchor", "middle").style("dominant-baseline", "middle").style("font-family", Y().fontFamily).style("font-size", x.fontSize + "px").text(r.roleA).node().getBBox();
829
+ t.insert("rect", "#" + g).classed("er relationshipLabelBox", !0).attr("x", m.x - y.width / 2).attr("y", m.y - y.height / 2).attr("width", y.width).attr("height", y.height);
830
+ }, ne = function(t, r, e, f) {
831
+ x = Y().er, K.info("Drawing ER diagram");
832
+ const l = Y().securityLevel;
833
+ let p;
834
+ l === "sandbox" && (p = et("#i" + r));
835
+ const o = (l === "sandbox" ? et(p.nodes()[0].contentDocument.body) : et("body")).select(`[id='${r}']`);
836
+ L.insertMarkers(o, x);
837
+ let h;
838
+ h = new Mt({
839
+ multigraph: !0,
840
+ directed: !0,
841
+ compound: !1
842
+ }).setGraph({
843
+ rankdir: x.layoutDirection,
844
+ marginx: 20,
845
+ marginy: 20,
846
+ nodesep: 100,
847
+ edgesep: 100,
848
+ ranksep: 100
849
+ }).setDefaultEdgeLabel(function() {
850
+ return {};
851
+ });
852
+ const _ = ee(o, f.db.getEntities(), h), m = ae(f.db.getRelationships(), h);
853
+ It(h), re(o, h), m.forEach(function(w) {
854
+ ie(o, w, h, _, f);
855
+ });
856
+ const g = x.diagramPadding;
857
+ bt.insertTitle(o, "entityTitleText", x.titleTopMargin, f.db.getDiagramTitle());
858
+ const R = o.node().getBBox(), y = R.width + g * 2, k = R.height + g * 2;
859
+ Nt(o, k, y, x.useMaxWidth), o.attr("viewBox", `${R.x - g} ${R.y - g} ${y} ${k}`);
860
+ }, se = "28e9f9db-3c8d-5aa5-9faf-44286ae5937c";
861
+ function oe(t = "", r = "") {
862
+ const e = t.replace(qt, "");
863
+ return `${ct(r)}${ct(e)}${Wt(
864
+ t,
865
+ se
866
+ )}`;
867
+ }
868
+ function ct(t = "") {
869
+ return t.length > 0 ? `${t}-` : "";
870
+ }
871
+ const le = {
872
+ setConf: $t,
873
+ draw: ne
874
+ }, ce = (t) => `
875
+ .entityBox {
876
+ fill: ${t.mainBkg};
877
+ stroke: ${t.nodeBorder};
878
+ }
879
+
880
+ .attributeBoxOdd {
881
+ fill: ${t.attributeBackgroundColorOdd};
882
+ stroke: ${t.nodeBorder};
883
+ }
884
+
885
+ .attributeBoxEven {
886
+ fill: ${t.attributeBackgroundColorEven};
887
+ stroke: ${t.nodeBorder};
888
+ }
889
+
890
+ .relationshipLabelBox {
891
+ fill: ${t.tertiaryColor};
892
+ opacity: 0.7;
893
+ background-color: ${t.tertiaryColor};
894
+ rect {
895
+ opacity: 0.5;
896
+ }
897
+ }
898
+
899
+ .relationshipLine {
900
+ stroke: ${t.lineColor};
901
+ }
902
+
903
+ .entityTitleText {
904
+ text-anchor: middle;
905
+ font-size: 18px;
906
+ fill: ${t.textColor};
907
+ }
908
+ #MD_PARENT_START {
909
+ fill: #f5f5f5 !important;
910
+ stroke: ${t.lineColor} !important;
911
+ stroke-width: 1;
912
+ }
913
+ #MD_PARENT_END {
914
+ fill: #f5f5f5 !important;
915
+ stroke: ${t.lineColor} !important;
916
+ stroke-width: 1;
917
+ }
918
+
919
+ `, he = ce, Ee = {
920
+ parser: Ut,
921
+ db: jt,
922
+ renderer: le,
923
+ styles: he
924
+ };
925
+ export {
926
+ Ee as diagram
927
+ };