@schmitech/chatbot-widget 0.5.3 → 0.5.4

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