@readme/markdown 7.7.1 → 7.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/871.js DELETED
@@ -1,1533 +0,0 @@
1
- "use strict";
2
- (self["webpackChunk_readme_markdown"] = self["webpackChunk_readme_markdown"] || []).push([[871],{
3
-
4
- /***/ 1871:
5
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6
-
7
-
8
- // EXPORTS
9
- __webpack_require__.d(__webpack_exports__, {
10
- diagram: () => (/* binding */ diagram)
11
- });
12
-
13
- // EXTERNAL MODULE: ./node_modules/mermaid/dist/chunks/mermaid.core/chunk-TLUHKHBO.mjs
14
- var chunk_TLUHKHBO = __webpack_require__(2843);
15
- // EXTERNAL MODULE: ./node_modules/mermaid/dist/chunks/mermaid.core/chunk-S24QXQKS.mjs + 3 modules
16
- var chunk_S24QXQKS = __webpack_require__(6322);
17
- // EXTERNAL MODULE: ./node_modules/dagre-d3-es/src/graphlib/index.js
18
- var graphlib = __webpack_require__(4416);
19
- // EXTERNAL MODULE: ./node_modules/d3/src/index.js + 193 modules
20
- var src = __webpack_require__(8066);
21
- // EXTERNAL MODULE: ./node_modules/dagre-d3-es/src/dagre/index.js + 62 modules
22
- var dagre = __webpack_require__(995);
23
- ;// CONCATENATED MODULE: ./node_modules/mermaid/node_modules/uuid/dist/esm-browser/stringify.js
24
-
25
- /**
26
- * Convert array of 16 byte values to UUID string format of the form:
27
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
28
- */
29
-
30
- const byteToHex = [];
31
-
32
- for (let i = 0; i < 256; ++i) {
33
- byteToHex.push((i + 0x100).toString(16).slice(1));
34
- }
35
-
36
- function unsafeStringify(arr, offset = 0) {
37
- // Note: Be careful editing this code! It's been tuned for performance
38
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
39
- return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
40
- }
41
-
42
- function stringify(arr, offset = 0) {
43
- const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
44
- // of the following:
45
- // - One or more input array values don't map to a hex octet (leading to
46
- // "undefined" in the uuid)
47
- // - Invalid input values for the RFC `version` or `variant` fields
48
-
49
- if (!validate(uuid)) {
50
- throw TypeError('Stringified UUID is invalid');
51
- }
52
-
53
- return uuid;
54
- }
55
-
56
- /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
57
- ;// CONCATENATED MODULE: ./node_modules/mermaid/node_modules/uuid/dist/esm-browser/regex.js
58
- /* harmony default export */ const regex = (/^(?:[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);
59
- ;// CONCATENATED MODULE: ./node_modules/mermaid/node_modules/uuid/dist/esm-browser/validate.js
60
-
61
-
62
- function validate_validate(uuid) {
63
- return typeof uuid === 'string' && regex.test(uuid);
64
- }
65
-
66
- /* harmony default export */ const esm_browser_validate = (validate_validate);
67
- ;// CONCATENATED MODULE: ./node_modules/mermaid/node_modules/uuid/dist/esm-browser/parse.js
68
-
69
-
70
- function parse(uuid) {
71
- if (!esm_browser_validate(uuid)) {
72
- throw TypeError('Invalid UUID');
73
- }
74
-
75
- let v;
76
- const arr = new Uint8Array(16); // Parse ########-....-....-....-............
77
-
78
- arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
79
- arr[1] = v >>> 16 & 0xff;
80
- arr[2] = v >>> 8 & 0xff;
81
- arr[3] = v & 0xff; // Parse ........-####-....-....-............
82
-
83
- arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
84
- arr[5] = v & 0xff; // Parse ........-....-####-....-............
85
-
86
- arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
87
- arr[7] = v & 0xff; // Parse ........-....-....-####-............
88
-
89
- arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
90
- arr[9] = v & 0xff; // Parse ........-....-....-....-############
91
- // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
92
-
93
- arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
94
- arr[11] = v / 0x100000000 & 0xff;
95
- arr[12] = v >>> 24 & 0xff;
96
- arr[13] = v >>> 16 & 0xff;
97
- arr[14] = v >>> 8 & 0xff;
98
- arr[15] = v & 0xff;
99
- return arr;
100
- }
101
-
102
- /* harmony default export */ const esm_browser_parse = (parse);
103
- ;// CONCATENATED MODULE: ./node_modules/mermaid/node_modules/uuid/dist/esm-browser/v35.js
104
-
105
-
106
-
107
- function stringToBytes(str) {
108
- str = unescape(encodeURIComponent(str)); // UTF8 escape
109
-
110
- const bytes = [];
111
-
112
- for (let i = 0; i < str.length; ++i) {
113
- bytes.push(str.charCodeAt(i));
114
- }
115
-
116
- return bytes;
117
- }
118
-
119
- const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
120
- const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
121
- function v35(name, version, hashfunc) {
122
- function generateUUID(value, namespace, buf, offset) {
123
- var _namespace;
124
-
125
- if (typeof value === 'string') {
126
- value = stringToBytes(value);
127
- }
128
-
129
- if (typeof namespace === 'string') {
130
- namespace = esm_browser_parse(namespace);
131
- }
132
-
133
- if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
134
- throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
135
- } // Compute hash of namespace and value, Per 4.3
136
- // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
137
- // hashfunc([...namespace, ... value])`
138
-
139
-
140
- let bytes = new Uint8Array(16 + value.length);
141
- bytes.set(namespace);
142
- bytes.set(value, namespace.length);
143
- bytes = hashfunc(bytes);
144
- bytes[6] = bytes[6] & 0x0f | version;
145
- bytes[8] = bytes[8] & 0x3f | 0x80;
146
-
147
- if (buf) {
148
- offset = offset || 0;
149
-
150
- for (let i = 0; i < 16; ++i) {
151
- buf[offset + i] = bytes[i];
152
- }
153
-
154
- return buf;
155
- }
156
-
157
- return unsafeStringify(bytes);
158
- } // Function#name is not settable on some platforms (#270)
159
-
160
-
161
- try {
162
- generateUUID.name = name; // eslint-disable-next-line no-empty
163
- } catch (err) {} // For CommonJS default export support
164
-
165
-
166
- generateUUID.DNS = DNS;
167
- generateUUID.URL = URL;
168
- return generateUUID;
169
- }
170
- ;// CONCATENATED MODULE: ./node_modules/mermaid/node_modules/uuid/dist/esm-browser/sha1.js
171
- // Adapted from Chris Veness' SHA1 code at
172
- // http://www.movable-type.co.uk/scripts/sha1.html
173
- function f(s, x, y, z) {
174
- switch (s) {
175
- case 0:
176
- return x & y ^ ~x & z;
177
-
178
- case 1:
179
- return x ^ y ^ z;
180
-
181
- case 2:
182
- return x & y ^ x & z ^ y & z;
183
-
184
- case 3:
185
- return x ^ y ^ z;
186
- }
187
- }
188
-
189
- function ROTL(x, n) {
190
- return x << n | x >>> 32 - n;
191
- }
192
-
193
- function sha1(bytes) {
194
- const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
195
- const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
196
-
197
- if (typeof bytes === 'string') {
198
- const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
199
-
200
- bytes = [];
201
-
202
- for (let i = 0; i < msg.length; ++i) {
203
- bytes.push(msg.charCodeAt(i));
204
- }
205
- } else if (!Array.isArray(bytes)) {
206
- // Convert Array-like to Array
207
- bytes = Array.prototype.slice.call(bytes);
208
- }
209
-
210
- bytes.push(0x80);
211
- const l = bytes.length / 4 + 2;
212
- const N = Math.ceil(l / 16);
213
- const M = new Array(N);
214
-
215
- for (let i = 0; i < N; ++i) {
216
- const arr = new Uint32Array(16);
217
-
218
- for (let j = 0; j < 16; ++j) {
219
- arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];
220
- }
221
-
222
- M[i] = arr;
223
- }
224
-
225
- M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
226
- M[N - 1][14] = Math.floor(M[N - 1][14]);
227
- M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
228
-
229
- for (let i = 0; i < N; ++i) {
230
- const W = new Uint32Array(80);
231
-
232
- for (let t = 0; t < 16; ++t) {
233
- W[t] = M[i][t];
234
- }
235
-
236
- for (let t = 16; t < 80; ++t) {
237
- W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
238
- }
239
-
240
- let a = H[0];
241
- let b = H[1];
242
- let c = H[2];
243
- let d = H[3];
244
- let e = H[4];
245
-
246
- for (let t = 0; t < 80; ++t) {
247
- const s = Math.floor(t / 20);
248
- const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
249
- e = d;
250
- d = c;
251
- c = ROTL(b, 30) >>> 0;
252
- b = a;
253
- a = T;
254
- }
255
-
256
- H[0] = H[0] + a >>> 0;
257
- H[1] = H[1] + b >>> 0;
258
- H[2] = H[2] + c >>> 0;
259
- H[3] = H[3] + d >>> 0;
260
- H[4] = H[4] + e >>> 0;
261
- }
262
-
263
- return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];
264
- }
265
-
266
- /* harmony default export */ const esm_browser_sha1 = (sha1);
267
- ;// CONCATENATED MODULE: ./node_modules/mermaid/node_modules/uuid/dist/esm-browser/v5.js
268
-
269
-
270
- const v5 = v35('v5', 0x50, esm_browser_sha1);
271
- /* harmony default export */ const esm_browser_v5 = (v5);
272
- ;// CONCATENATED MODULE: ./node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-DKC2X5TE.mjs
273
-
274
-
275
-
276
- // src/diagrams/er/parser/erDiagram.jison
277
- var parser = function() {
278
- var o = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(k, v, o2, l) {
279
- for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
280
- return o2;
281
- }, "o"), $V0 = [6, 8, 10, 20, 22, 24, 26, 27, 28], $V1 = [1, 10], $V2 = [1, 11], $V3 = [1, 12], $V4 = [1, 13], $V5 = [1, 14], $V6 = [1, 15], $V7 = [1, 21], $V8 = [1, 22], $V9 = [1, 23], $Va = [1, 24], $Vb = [1, 25], $Vc = [6, 8, 10, 13, 15, 18, 19, 20, 22, 24, 26, 27, 28, 41, 42, 43, 44, 45], $Vd = [1, 34], $Ve = [27, 28, 46, 47], $Vf = [41, 42, 43, 44, 45], $Vg = [17, 34], $Vh = [1, 54], $Vi = [1, 53], $Vj = [17, 34, 36, 38];
282
- var parser2 = {
283
- trace: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function trace() {
284
- }, "trace"),
285
- yy: {},
286
- 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 },
287
- 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" },
288
- 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]],
289
- performAction: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
290
- var $0 = $$.length - 1;
291
- switch (yystate) {
292
- case 1:
293
- break;
294
- case 2:
295
- this.$ = [];
296
- break;
297
- case 3:
298
- $$[$0 - 1].push($$[$0]);
299
- this.$ = $$[$0 - 1];
300
- break;
301
- case 4:
302
- case 5:
303
- this.$ = $$[$0];
304
- break;
305
- case 6:
306
- case 7:
307
- this.$ = [];
308
- break;
309
- case 8:
310
- yy.addEntity($$[$0 - 4]);
311
- yy.addEntity($$[$0 - 2]);
312
- yy.addRelationship($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 3]);
313
- break;
314
- case 9:
315
- yy.addEntity($$[$0 - 3]);
316
- yy.addAttributes($$[$0 - 3], $$[$0 - 1]);
317
- break;
318
- case 10:
319
- yy.addEntity($$[$0 - 2]);
320
- break;
321
- case 11:
322
- yy.addEntity($$[$0]);
323
- break;
324
- case 12:
325
- yy.addEntity($$[$0 - 6], $$[$0 - 4]);
326
- yy.addAttributes($$[$0 - 6], $$[$0 - 1]);
327
- break;
328
- case 13:
329
- yy.addEntity($$[$0 - 5], $$[$0 - 3]);
330
- break;
331
- case 14:
332
- yy.addEntity($$[$0 - 3], $$[$0 - 1]);
333
- break;
334
- case 15:
335
- case 16:
336
- this.$ = $$[$0].trim();
337
- yy.setAccTitle(this.$);
338
- break;
339
- case 17:
340
- case 18:
341
- this.$ = $$[$0].trim();
342
- yy.setAccDescription(this.$);
343
- break;
344
- case 19:
345
- case 43:
346
- this.$ = $$[$0];
347
- break;
348
- case 20:
349
- case 41:
350
- case 42:
351
- this.$ = $$[$0].replace(/"/g, "");
352
- break;
353
- case 21:
354
- case 29:
355
- this.$ = [$$[$0]];
356
- break;
357
- case 22:
358
- $$[$0].push($$[$0 - 1]);
359
- this.$ = $$[$0];
360
- break;
361
- case 23:
362
- this.$ = { attributeType: $$[$0 - 1], attributeName: $$[$0] };
363
- break;
364
- case 24:
365
- this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeKeyTypeList: $$[$0] };
366
- break;
367
- case 25:
368
- this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeComment: $$[$0] };
369
- break;
370
- case 26:
371
- this.$ = { attributeType: $$[$0 - 3], attributeName: $$[$0 - 2], attributeKeyTypeList: $$[$0 - 1], attributeComment: $$[$0] };
372
- break;
373
- case 27:
374
- case 28:
375
- case 31:
376
- this.$ = $$[$0];
377
- break;
378
- case 30:
379
- $$[$0 - 2].push($$[$0]);
380
- this.$ = $$[$0 - 2];
381
- break;
382
- case 32:
383
- this.$ = $$[$0].replace(/"/g, "");
384
- break;
385
- case 33:
386
- this.$ = { cardA: $$[$0], relType: $$[$0 - 1], cardB: $$[$0 - 2] };
387
- break;
388
- case 34:
389
- this.$ = yy.Cardinality.ZERO_OR_ONE;
390
- break;
391
- case 35:
392
- this.$ = yy.Cardinality.ZERO_OR_MORE;
393
- break;
394
- case 36:
395
- this.$ = yy.Cardinality.ONE_OR_MORE;
396
- break;
397
- case 37:
398
- this.$ = yy.Cardinality.ONLY_ONE;
399
- break;
400
- case 38:
401
- this.$ = yy.Cardinality.MD_PARENT;
402
- break;
403
- case 39:
404
- this.$ = yy.Identification.NON_IDENTIFYING;
405
- break;
406
- case 40:
407
- this.$ = yy.Identification.IDENTIFYING;
408
- break;
409
- }
410
- }, "anonymous"),
411
- table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 9, 20: $V1, 22: $V2, 24: $V3, 26: $V4, 27: $V5, 28: $V6 }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 16, 11: 9, 20: $V1, 22: $V2, 24: $V3, 26: $V4, 27: $V5, 28: $V6 }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 11], { 12: 17, 39: 20, 15: [1, 18], 18: [1, 19], 41: $V7, 42: $V8, 43: $V9, 44: $Va, 45: $Vb }), { 21: [1, 26] }, { 23: [1, 27] }, { 25: [1, 28] }, o($V0, [2, 18]), o($Vc, [2, 19]), o($Vc, [2, 20]), o($V0, [2, 4]), { 11: 29, 27: $V5, 28: $V6 }, { 16: 30, 17: [1, 31], 29: 32, 30: 33, 34: $Vd }, { 11: 35, 27: $V5, 28: $V6 }, { 40: 36, 46: [1, 37], 47: [1, 38] }, o($Ve, [2, 34]), o($Ve, [2, 35]), o($Ve, [2, 36]), o($Ve, [2, 37]), o($Ve, [2, 38]), o($V0, [2, 15]), o($V0, [2, 16]), o($V0, [2, 17]), { 13: [1, 39] }, { 17: [1, 40] }, o($V0, [2, 10]), { 16: 41, 17: [2, 21], 29: 32, 30: 33, 34: $Vd }, { 31: 42, 34: [1, 43] }, { 34: [2, 27] }, { 19: [1, 44] }, { 39: 45, 41: $V7, 42: $V8, 43: $V9, 44: $Va, 45: $Vb }, o($Vf, [2, 39]), o($Vf, [2, 40]), { 14: 46, 27: [1, 49], 28: [1, 48], 48: [1, 47] }, o($V0, [2, 9]), { 17: [2, 22] }, o($Vg, [2, 23], { 32: 50, 33: 51, 35: 52, 37: $Vh, 38: $Vi }), o([17, 34, 37, 38], [2, 28]), o($V0, [2, 14], { 15: [1, 55] }), o([27, 28], [2, 33]), o($V0, [2, 8]), o($V0, [2, 41]), o($V0, [2, 42]), o($V0, [2, 43]), o($Vg, [2, 24], { 33: 56, 36: [1, 57], 38: $Vi }), o($Vg, [2, 25]), o($Vj, [2, 29]), o($Vg, [2, 32]), o($Vj, [2, 31]), { 16: 58, 17: [1, 59], 29: 32, 30: 33, 34: $Vd }, o($Vg, [2, 26]), { 35: 60, 37: $Vh }, { 17: [1, 61] }, o($V0, [2, 13]), o($Vj, [2, 30]), o($V0, [2, 12])],
412
- defaultActions: { 34: [2, 27], 41: [2, 22] },
413
- parseError: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function parseError(str, hash) {
414
- if (hash.recoverable) {
415
- this.trace(str);
416
- } else {
417
- var error = new Error(str);
418
- error.hash = hash;
419
- throw error;
420
- }
421
- }, "parseError"),
422
- parse: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function parse(input) {
423
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
424
- var args = lstack.slice.call(arguments, 1);
425
- var lexer2 = Object.create(this.lexer);
426
- var sharedState = { yy: {} };
427
- for (var k in this.yy) {
428
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
429
- sharedState.yy[k] = this.yy[k];
430
- }
431
- }
432
- lexer2.setInput(input, sharedState.yy);
433
- sharedState.yy.lexer = lexer2;
434
- sharedState.yy.parser = this;
435
- if (typeof lexer2.yylloc == "undefined") {
436
- lexer2.yylloc = {};
437
- }
438
- var yyloc = lexer2.yylloc;
439
- lstack.push(yyloc);
440
- var ranges = lexer2.options && lexer2.options.ranges;
441
- if (typeof sharedState.yy.parseError === "function") {
442
- this.parseError = sharedState.yy.parseError;
443
- } else {
444
- this.parseError = Object.getPrototypeOf(this).parseError;
445
- }
446
- function popStack(n) {
447
- stack.length = stack.length - 2 * n;
448
- vstack.length = vstack.length - n;
449
- lstack.length = lstack.length - n;
450
- }
451
- (0,chunk_S24QXQKS/* __name */.K2)(popStack, "popStack");
452
- function lex() {
453
- var token;
454
- token = tstack.pop() || lexer2.lex() || EOF;
455
- if (typeof token !== "number") {
456
- if (token instanceof Array) {
457
- tstack = token;
458
- token = tstack.pop();
459
- }
460
- token = self.symbols_[token] || token;
461
- }
462
- return token;
463
- }
464
- (0,chunk_S24QXQKS/* __name */.K2)(lex, "lex");
465
- var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
466
- while (true) {
467
- state = stack[stack.length - 1];
468
- if (this.defaultActions[state]) {
469
- action = this.defaultActions[state];
470
- } else {
471
- if (symbol === null || typeof symbol == "undefined") {
472
- symbol = lex();
473
- }
474
- action = table[state] && table[state][symbol];
475
- }
476
- if (typeof action === "undefined" || !action.length || !action[0]) {
477
- var errStr = "";
478
- expected = [];
479
- for (p in table[state]) {
480
- if (this.terminals_[p] && p > TERROR) {
481
- expected.push("'" + this.terminals_[p] + "'");
482
- }
483
- }
484
- if (lexer2.showPosition) {
485
- errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
486
- } else {
487
- errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
488
- }
489
- this.parseError(errStr, {
490
- text: lexer2.match,
491
- token: this.terminals_[symbol] || symbol,
492
- line: lexer2.yylineno,
493
- loc: yyloc,
494
- expected
495
- });
496
- }
497
- if (action[0] instanceof Array && action.length > 1) {
498
- throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
499
- }
500
- switch (action[0]) {
501
- case 1:
502
- stack.push(symbol);
503
- vstack.push(lexer2.yytext);
504
- lstack.push(lexer2.yylloc);
505
- stack.push(action[1]);
506
- symbol = null;
507
- if (!preErrorSymbol) {
508
- yyleng = lexer2.yyleng;
509
- yytext = lexer2.yytext;
510
- yylineno = lexer2.yylineno;
511
- yyloc = lexer2.yylloc;
512
- if (recovering > 0) {
513
- recovering--;
514
- }
515
- } else {
516
- symbol = preErrorSymbol;
517
- preErrorSymbol = null;
518
- }
519
- break;
520
- case 2:
521
- len = this.productions_[action[1]][1];
522
- yyval.$ = vstack[vstack.length - len];
523
- yyval._$ = {
524
- first_line: lstack[lstack.length - (len || 1)].first_line,
525
- last_line: lstack[lstack.length - 1].last_line,
526
- first_column: lstack[lstack.length - (len || 1)].first_column,
527
- last_column: lstack[lstack.length - 1].last_column
528
- };
529
- if (ranges) {
530
- yyval._$.range = [
531
- lstack[lstack.length - (len || 1)].range[0],
532
- lstack[lstack.length - 1].range[1]
533
- ];
534
- }
535
- r = this.performAction.apply(yyval, [
536
- yytext,
537
- yyleng,
538
- yylineno,
539
- sharedState.yy,
540
- action[1],
541
- vstack,
542
- lstack
543
- ].concat(args));
544
- if (typeof r !== "undefined") {
545
- return r;
546
- }
547
- if (len) {
548
- stack = stack.slice(0, -1 * len * 2);
549
- vstack = vstack.slice(0, -1 * len);
550
- lstack = lstack.slice(0, -1 * len);
551
- }
552
- stack.push(this.productions_[action[1]][0]);
553
- vstack.push(yyval.$);
554
- lstack.push(yyval._$);
555
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
556
- stack.push(newState);
557
- break;
558
- case 3:
559
- return true;
560
- }
561
- }
562
- return true;
563
- }, "parse")
564
- };
565
- var lexer = /* @__PURE__ */ function() {
566
- var lexer2 = {
567
- EOF: 1,
568
- parseError: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function parseError(str, hash) {
569
- if (this.yy.parser) {
570
- this.yy.parser.parseError(str, hash);
571
- } else {
572
- throw new Error(str);
573
- }
574
- }, "parseError"),
575
- // resets the lexer, sets new input
576
- setInput: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(input, yy) {
577
- this.yy = yy || this.yy || {};
578
- this._input = input;
579
- this._more = this._backtrack = this.done = false;
580
- this.yylineno = this.yyleng = 0;
581
- this.yytext = this.matched = this.match = "";
582
- this.conditionStack = ["INITIAL"];
583
- this.yylloc = {
584
- first_line: 1,
585
- first_column: 0,
586
- last_line: 1,
587
- last_column: 0
588
- };
589
- if (this.options.ranges) {
590
- this.yylloc.range = [0, 0];
591
- }
592
- this.offset = 0;
593
- return this;
594
- }, "setInput"),
595
- // consumes and returns one char from the input
596
- input: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function() {
597
- var ch = this._input[0];
598
- this.yytext += ch;
599
- this.yyleng++;
600
- this.offset++;
601
- this.match += ch;
602
- this.matched += ch;
603
- var lines = ch.match(/(?:\r\n?|\n).*/g);
604
- if (lines) {
605
- this.yylineno++;
606
- this.yylloc.last_line++;
607
- } else {
608
- this.yylloc.last_column++;
609
- }
610
- if (this.options.ranges) {
611
- this.yylloc.range[1]++;
612
- }
613
- this._input = this._input.slice(1);
614
- return ch;
615
- }, "input"),
616
- // unshifts one char (or a string) into the input
617
- unput: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(ch) {
618
- var len = ch.length;
619
- var lines = ch.split(/(?:\r\n?|\n)/g);
620
- this._input = ch + this._input;
621
- this.yytext = this.yytext.substr(0, this.yytext.length - len);
622
- this.offset -= len;
623
- var oldLines = this.match.split(/(?:\r\n?|\n)/g);
624
- this.match = this.match.substr(0, this.match.length - 1);
625
- this.matched = this.matched.substr(0, this.matched.length - 1);
626
- if (lines.length - 1) {
627
- this.yylineno -= lines.length - 1;
628
- }
629
- var r = this.yylloc.range;
630
- this.yylloc = {
631
- first_line: this.yylloc.first_line,
632
- last_line: this.yylineno + 1,
633
- first_column: this.yylloc.first_column,
634
- last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
635
- };
636
- if (this.options.ranges) {
637
- this.yylloc.range = [r[0], r[0] + this.yyleng - len];
638
- }
639
- this.yyleng = this.yytext.length;
640
- return this;
641
- }, "unput"),
642
- // When called from action, caches matched text and appends it on next action
643
- more: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function() {
644
- this._more = true;
645
- return this;
646
- }, "more"),
647
- // 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.
648
- reject: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function() {
649
- if (this.options.backtrack_lexer) {
650
- this._backtrack = true;
651
- } else {
652
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
653
- text: "",
654
- token: null,
655
- line: this.yylineno
656
- });
657
- }
658
- return this;
659
- }, "reject"),
660
- // retain first n characters of the match
661
- less: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(n) {
662
- this.unput(this.match.slice(n));
663
- }, "less"),
664
- // displays already matched input, i.e. for error messages
665
- pastInput: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function() {
666
- var past = this.matched.substr(0, this.matched.length - this.match.length);
667
- return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
668
- }, "pastInput"),
669
- // displays upcoming input, i.e. for error messages
670
- upcomingInput: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function() {
671
- var next = this.match;
672
- if (next.length < 20) {
673
- next += this._input.substr(0, 20 - next.length);
674
- }
675
- return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
676
- }, "upcomingInput"),
677
- // displays the character position where the lexing error occurred, i.e. for error messages
678
- showPosition: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function() {
679
- var pre = this.pastInput();
680
- var c = new Array(pre.length + 1).join("-");
681
- return pre + this.upcomingInput() + "\n" + c + "^";
682
- }, "showPosition"),
683
- // test the lexed token: return FALSE when not a match, otherwise return token
684
- test_match: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(match, indexed_rule) {
685
- var token, lines, backup;
686
- if (this.options.backtrack_lexer) {
687
- backup = {
688
- yylineno: this.yylineno,
689
- yylloc: {
690
- first_line: this.yylloc.first_line,
691
- last_line: this.last_line,
692
- first_column: this.yylloc.first_column,
693
- last_column: this.yylloc.last_column
694
- },
695
- yytext: this.yytext,
696
- match: this.match,
697
- matches: this.matches,
698
- matched: this.matched,
699
- yyleng: this.yyleng,
700
- offset: this.offset,
701
- _more: this._more,
702
- _input: this._input,
703
- yy: this.yy,
704
- conditionStack: this.conditionStack.slice(0),
705
- done: this.done
706
- };
707
- if (this.options.ranges) {
708
- backup.yylloc.range = this.yylloc.range.slice(0);
709
- }
710
- }
711
- lines = match[0].match(/(?:\r\n?|\n).*/g);
712
- if (lines) {
713
- this.yylineno += lines.length;
714
- }
715
- this.yylloc = {
716
- first_line: this.yylloc.last_line,
717
- last_line: this.yylineno + 1,
718
- first_column: this.yylloc.last_column,
719
- last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
720
- };
721
- this.yytext += match[0];
722
- this.match += match[0];
723
- this.matches = match;
724
- this.yyleng = this.yytext.length;
725
- if (this.options.ranges) {
726
- this.yylloc.range = [this.offset, this.offset += this.yyleng];
727
- }
728
- this._more = false;
729
- this._backtrack = false;
730
- this._input = this._input.slice(match[0].length);
731
- this.matched += match[0];
732
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
733
- if (this.done && this._input) {
734
- this.done = false;
735
- }
736
- if (token) {
737
- return token;
738
- } else if (this._backtrack) {
739
- for (var k in backup) {
740
- this[k] = backup[k];
741
- }
742
- return false;
743
- }
744
- return false;
745
- }, "test_match"),
746
- // return next match in input
747
- next: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function() {
748
- if (this.done) {
749
- return this.EOF;
750
- }
751
- if (!this._input) {
752
- this.done = true;
753
- }
754
- var token, match, tempMatch, index;
755
- if (!this._more) {
756
- this.yytext = "";
757
- this.match = "";
758
- }
759
- var rules = this._currentRules();
760
- for (var i = 0; i < rules.length; i++) {
761
- tempMatch = this._input.match(this.rules[rules[i]]);
762
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
763
- match = tempMatch;
764
- index = i;
765
- if (this.options.backtrack_lexer) {
766
- token = this.test_match(tempMatch, rules[i]);
767
- if (token !== false) {
768
- return token;
769
- } else if (this._backtrack) {
770
- match = false;
771
- continue;
772
- } else {
773
- return false;
774
- }
775
- } else if (!this.options.flex) {
776
- break;
777
- }
778
- }
779
- }
780
- if (match) {
781
- token = this.test_match(match, rules[index]);
782
- if (token !== false) {
783
- return token;
784
- }
785
- return false;
786
- }
787
- if (this._input === "") {
788
- return this.EOF;
789
- } else {
790
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
791
- text: "",
792
- token: null,
793
- line: this.yylineno
794
- });
795
- }
796
- }, "next"),
797
- // return next match that has a token
798
- lex: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function lex() {
799
- var r = this.next();
800
- if (r) {
801
- return r;
802
- } else {
803
- return this.lex();
804
- }
805
- }, "lex"),
806
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
807
- begin: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function begin(condition) {
808
- this.conditionStack.push(condition);
809
- }, "begin"),
810
- // pop the previously active lexer condition state off the condition stack
811
- popState: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function popState() {
812
- var n = this.conditionStack.length - 1;
813
- if (n > 0) {
814
- return this.conditionStack.pop();
815
- } else {
816
- return this.conditionStack[0];
817
- }
818
- }, "popState"),
819
- // produce the lexer rule set which is active for the currently active lexer condition state
820
- _currentRules: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function _currentRules() {
821
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
822
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
823
- } else {
824
- return this.conditions["INITIAL"].rules;
825
- }
826
- }, "_currentRules"),
827
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
828
- topState: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function topState(n) {
829
- n = this.conditionStack.length - 1 - Math.abs(n || 0);
830
- if (n >= 0) {
831
- return this.conditionStack[n];
832
- } else {
833
- return "INITIAL";
834
- }
835
- }, "topState"),
836
- // alias for begin(condition)
837
- pushState: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function pushState(condition) {
838
- this.begin(condition);
839
- }, "pushState"),
840
- // return the number of states currently on the stack
841
- stateStackSize: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function stateStackSize() {
842
- return this.conditionStack.length;
843
- }, "stateStackSize"),
844
- options: { "case-insensitive": true },
845
- performAction: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
846
- var YYSTATE = YY_START;
847
- switch ($avoiding_name_collisions) {
848
- case 0:
849
- this.begin("acc_title");
850
- return 22;
851
- break;
852
- case 1:
853
- this.popState();
854
- return "acc_title_value";
855
- break;
856
- case 2:
857
- this.begin("acc_descr");
858
- return 24;
859
- break;
860
- case 3:
861
- this.popState();
862
- return "acc_descr_value";
863
- break;
864
- case 4:
865
- this.begin("acc_descr_multiline");
866
- break;
867
- case 5:
868
- this.popState();
869
- break;
870
- case 6:
871
- return "acc_descr_multiline_value";
872
- break;
873
- case 7:
874
- return 10;
875
- break;
876
- case 8:
877
- break;
878
- case 9:
879
- return 8;
880
- break;
881
- case 10:
882
- return 28;
883
- break;
884
- case 11:
885
- return 48;
886
- break;
887
- case 12:
888
- return 4;
889
- break;
890
- case 13:
891
- this.begin("block");
892
- return 15;
893
- break;
894
- case 14:
895
- return 36;
896
- break;
897
- case 15:
898
- break;
899
- case 16:
900
- return 37;
901
- break;
902
- case 17:
903
- return 34;
904
- break;
905
- case 18:
906
- return 34;
907
- break;
908
- case 19:
909
- return 38;
910
- break;
911
- case 20:
912
- break;
913
- case 21:
914
- this.popState();
915
- return 17;
916
- break;
917
- case 22:
918
- return yy_.yytext[0];
919
- break;
920
- case 23:
921
- return 18;
922
- break;
923
- case 24:
924
- return 19;
925
- break;
926
- case 25:
927
- return 41;
928
- break;
929
- case 26:
930
- return 43;
931
- break;
932
- case 27:
933
- return 43;
934
- break;
935
- case 28:
936
- return 43;
937
- break;
938
- case 29:
939
- return 41;
940
- break;
941
- case 30:
942
- return 41;
943
- break;
944
- case 31:
945
- return 42;
946
- break;
947
- case 32:
948
- return 42;
949
- break;
950
- case 33:
951
- return 42;
952
- break;
953
- case 34:
954
- return 42;
955
- break;
956
- case 35:
957
- return 42;
958
- break;
959
- case 36:
960
- return 43;
961
- break;
962
- case 37:
963
- return 42;
964
- break;
965
- case 38:
966
- return 43;
967
- break;
968
- case 39:
969
- return 44;
970
- break;
971
- case 40:
972
- return 44;
973
- break;
974
- case 41:
975
- return 44;
976
- break;
977
- case 42:
978
- return 44;
979
- break;
980
- case 43:
981
- return 41;
982
- break;
983
- case 44:
984
- return 42;
985
- break;
986
- case 45:
987
- return 43;
988
- break;
989
- case 46:
990
- return 45;
991
- break;
992
- case 47:
993
- return 46;
994
- break;
995
- case 48:
996
- return 47;
997
- break;
998
- case 49:
999
- return 47;
1000
- break;
1001
- case 50:
1002
- return 46;
1003
- break;
1004
- case 51:
1005
- return 46;
1006
- break;
1007
- case 52:
1008
- return 46;
1009
- break;
1010
- case 53:
1011
- return 27;
1012
- break;
1013
- case 54:
1014
- return yy_.yytext[0];
1015
- break;
1016
- case 55:
1017
- return 6;
1018
- break;
1019
- }
1020
- }, "anonymous"),
1021
- 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],
1022
- conditions: { "acc_descr_multiline": { "rules": [5, 6], "inclusive": false }, "acc_descr": { "rules": [3], "inclusive": false }, "acc_title": { "rules": [1], "inclusive": false }, "block": { "rules": [14, 15, 16, 17, 18, 19, 20, 21, 22], "inclusive": false }, "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": true } }
1023
- };
1024
- return lexer2;
1025
- }();
1026
- parser2.lexer = lexer;
1027
- function Parser() {
1028
- this.yy = {};
1029
- }
1030
- (0,chunk_S24QXQKS/* __name */.K2)(Parser, "Parser");
1031
- Parser.prototype = parser2;
1032
- parser2.Parser = Parser;
1033
- return new Parser();
1034
- }();
1035
- parser.parser = parser;
1036
- var erDiagram_default = parser;
1037
-
1038
- // src/diagrams/er/erDb.js
1039
- var entities = /* @__PURE__ */ new Map();
1040
- var relationships = [];
1041
- var Cardinality = {
1042
- ZERO_OR_ONE: "ZERO_OR_ONE",
1043
- ZERO_OR_MORE: "ZERO_OR_MORE",
1044
- ONE_OR_MORE: "ONE_OR_MORE",
1045
- ONLY_ONE: "ONLY_ONE",
1046
- MD_PARENT: "MD_PARENT"
1047
- };
1048
- var Identification = {
1049
- NON_IDENTIFYING: "NON_IDENTIFYING",
1050
- IDENTIFYING: "IDENTIFYING"
1051
- };
1052
- var addEntity = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(name, alias = void 0) {
1053
- if (!entities.has(name)) {
1054
- entities.set(name, { attributes: [], alias });
1055
- chunk_S24QXQKS/* log */.Rm.info("Added new entity :", name);
1056
- } else if (!entities.get(name).alias && alias) {
1057
- entities.get(name).alias = alias;
1058
- chunk_S24QXQKS/* log */.Rm.info(`Add alias '${alias}' to entity '${name}'`);
1059
- }
1060
- return entities.get(name);
1061
- }, "addEntity");
1062
- var getEntities = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(() => entities, "getEntities");
1063
- var addAttributes = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(entityName, attribs) {
1064
- let entity = addEntity(entityName);
1065
- let i;
1066
- for (i = attribs.length - 1; i >= 0; i--) {
1067
- entity.attributes.push(attribs[i]);
1068
- chunk_S24QXQKS/* log */.Rm.debug("Added attribute ", attribs[i].attributeName);
1069
- }
1070
- }, "addAttributes");
1071
- var addRelationship = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(entA, rolA, entB, rSpec) {
1072
- let rel = {
1073
- entityA: entA,
1074
- roleA: rolA,
1075
- entityB: entB,
1076
- relSpec: rSpec
1077
- };
1078
- relationships.push(rel);
1079
- chunk_S24QXQKS/* log */.Rm.debug("Added new relationship :", rel);
1080
- }, "addRelationship");
1081
- var getRelationships = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(() => relationships, "getRelationships");
1082
- var clear2 = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function() {
1083
- entities = /* @__PURE__ */ new Map();
1084
- relationships = [];
1085
- (0,chunk_S24QXQKS/* clear */.IU)();
1086
- }, "clear");
1087
- var erDb_default = {
1088
- Cardinality,
1089
- Identification,
1090
- getConfig: /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(() => (0,chunk_S24QXQKS/* getConfig2 */.D7)().er, "getConfig"),
1091
- addEntity,
1092
- addAttributes,
1093
- getEntities,
1094
- addRelationship,
1095
- getRelationships,
1096
- clear: clear2,
1097
- setAccTitle: chunk_S24QXQKS/* setAccTitle */.SV,
1098
- getAccTitle: chunk_S24QXQKS/* getAccTitle */.iN,
1099
- setAccDescription: chunk_S24QXQKS/* setAccDescription */.EI,
1100
- getAccDescription: chunk_S24QXQKS/* getAccDescription */.m7,
1101
- setDiagramTitle: chunk_S24QXQKS/* setDiagramTitle */.ke,
1102
- getDiagramTitle: chunk_S24QXQKS/* getDiagramTitle */.ab
1103
- };
1104
-
1105
- // src/diagrams/er/erRenderer.js
1106
-
1107
-
1108
-
1109
-
1110
- // src/diagrams/er/erMarkers.js
1111
- var ERMarkers = {
1112
- ONLY_ONE_START: "ONLY_ONE_START",
1113
- ONLY_ONE_END: "ONLY_ONE_END",
1114
- ZERO_OR_ONE_START: "ZERO_OR_ONE_START",
1115
- ZERO_OR_ONE_END: "ZERO_OR_ONE_END",
1116
- ONE_OR_MORE_START: "ONE_OR_MORE_START",
1117
- ONE_OR_MORE_END: "ONE_OR_MORE_END",
1118
- ZERO_OR_MORE_START: "ZERO_OR_MORE_START",
1119
- ZERO_OR_MORE_END: "ZERO_OR_MORE_END",
1120
- MD_PARENT_END: "MD_PARENT_END",
1121
- MD_PARENT_START: "MD_PARENT_START"
1122
- };
1123
- var insertMarkers = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(elem, conf2) {
1124
- let marker;
1125
- elem.append("defs").append("marker").attr("id", ERMarkers.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");
1126
- elem.append("defs").append("marker").attr("id", ERMarkers.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");
1127
- elem.append("defs").append("marker").attr("id", ERMarkers.ONLY_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M9,0 L9,18 M15,0 L15,18");
1128
- elem.append("defs").append("marker").attr("id", ERMarkers.ONLY_ONE_END).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M3,0 L3,18 M9,0 L9,18");
1129
- marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_ONE_START).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
1130
- marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6);
1131
- marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M9,0 L9,18");
1132
- marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_ONE_END).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
1133
- marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6);
1134
- marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M21,0 L21,18");
1135
- elem.append("defs").append("marker").attr("id", ERMarkers.ONE_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27");
1136
- elem.append("defs").append("marker").attr("id", ERMarkers.ONE_OR_MORE_END).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18");
1137
- marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_MORE_START).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
1138
- marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6);
1139
- marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18");
1140
- marker = elem.append("defs").append("marker").attr("id", ERMarkers.ZERO_OR_MORE_END).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
1141
- marker.append("circle").attr("stroke", conf2.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6);
1142
- marker.append("path").attr("stroke", conf2.stroke).attr("fill", "none").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
1143
- return;
1144
- }, "insertMarkers");
1145
- var erMarkers_default = {
1146
- ERMarkers,
1147
- insertMarkers
1148
- };
1149
-
1150
- // src/diagrams/er/erRenderer.js
1151
-
1152
- var BAD_ID_CHARS_REGEXP = /[^\dA-Za-z](\W)*/g;
1153
- var conf = {};
1154
- var entityNameIds = /* @__PURE__ */ new Map();
1155
- var setConf = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(cnf) {
1156
- const keys = Object.keys(cnf);
1157
- for (const key of keys) {
1158
- conf[key] = cnf[key];
1159
- }
1160
- }, "setConf");
1161
- var drawAttributes = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)((groupNode, entityTextNode, attributes) => {
1162
- const heightPadding = conf.entityPadding / 3;
1163
- const widthPadding = conf.entityPadding / 3;
1164
- const attrFontSize = conf.fontSize * 0.85;
1165
- const labelBBox = entityTextNode.node().getBBox();
1166
- const attributeNodes = [];
1167
- let hasKeyType = false;
1168
- let hasComment = false;
1169
- let maxTypeWidth = 0;
1170
- let maxNameWidth = 0;
1171
- let maxKeyWidth = 0;
1172
- let maxCommentWidth = 0;
1173
- let cumulativeHeight = labelBBox.height + heightPadding * 2;
1174
- let attrNum = 1;
1175
- attributes.forEach((item) => {
1176
- if (item.attributeKeyTypeList !== void 0 && item.attributeKeyTypeList.length > 0) {
1177
- hasKeyType = true;
1178
- }
1179
- if (item.attributeComment !== void 0) {
1180
- hasComment = true;
1181
- }
1182
- });
1183
- attributes.forEach((item) => {
1184
- const attrPrefix = `${entityTextNode.node().id}-attr-${attrNum}`;
1185
- let nodeHeight = 0;
1186
- const attributeType = (0,chunk_S24QXQKS/* parseGenericTypes */.QO)(item.attributeType);
1187
- const typeNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-type`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", (0,chunk_S24QXQKS/* getConfig2 */.D7)().fontFamily).style("font-size", attrFontSize + "px").text(attributeType);
1188
- const nameNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-name`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", (0,chunk_S24QXQKS/* getConfig2 */.D7)().fontFamily).style("font-size", attrFontSize + "px").text(item.attributeName);
1189
- const attributeNode = {};
1190
- attributeNode.tn = typeNode;
1191
- attributeNode.nn = nameNode;
1192
- const typeBBox = typeNode.node().getBBox();
1193
- const nameBBox = nameNode.node().getBBox();
1194
- maxTypeWidth = Math.max(maxTypeWidth, typeBBox.width);
1195
- maxNameWidth = Math.max(maxNameWidth, nameBBox.width);
1196
- nodeHeight = Math.max(typeBBox.height, nameBBox.height);
1197
- if (hasKeyType) {
1198
- const keyTypeNodeText = item.attributeKeyTypeList !== void 0 ? item.attributeKeyTypeList.join(",") : "";
1199
- const keyTypeNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-key`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", (0,chunk_S24QXQKS/* getConfig2 */.D7)().fontFamily).style("font-size", attrFontSize + "px").text(keyTypeNodeText);
1200
- attributeNode.kn = keyTypeNode;
1201
- const keyTypeBBox = keyTypeNode.node().getBBox();
1202
- maxKeyWidth = Math.max(maxKeyWidth, keyTypeBBox.width);
1203
- nodeHeight = Math.max(nodeHeight, keyTypeBBox.height);
1204
- }
1205
- if (hasComment) {
1206
- const commentNode = groupNode.append("text").classed("er entityLabel", true).attr("id", `${attrPrefix}-comment`).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "left").style("font-family", (0,chunk_S24QXQKS/* getConfig2 */.D7)().fontFamily).style("font-size", attrFontSize + "px").text(item.attributeComment || "");
1207
- attributeNode.cn = commentNode;
1208
- const commentNodeBBox = commentNode.node().getBBox();
1209
- maxCommentWidth = Math.max(maxCommentWidth, commentNodeBBox.width);
1210
- nodeHeight = Math.max(nodeHeight, commentNodeBBox.height);
1211
- }
1212
- attributeNode.height = nodeHeight;
1213
- attributeNodes.push(attributeNode);
1214
- cumulativeHeight += nodeHeight + heightPadding * 2;
1215
- attrNum += 1;
1216
- });
1217
- let widthPaddingFactor = 4;
1218
- if (hasKeyType) {
1219
- widthPaddingFactor += 2;
1220
- }
1221
- if (hasComment) {
1222
- widthPaddingFactor += 2;
1223
- }
1224
- const maxWidth = maxTypeWidth + maxNameWidth + maxKeyWidth + maxCommentWidth;
1225
- const bBox = {
1226
- width: Math.max(
1227
- conf.minEntityWidth,
1228
- Math.max(
1229
- labelBBox.width + conf.entityPadding * 2,
1230
- maxWidth + widthPadding * widthPaddingFactor
1231
- )
1232
- ),
1233
- height: attributes.length > 0 ? cumulativeHeight : Math.max(conf.minEntityHeight, labelBBox.height + conf.entityPadding * 2)
1234
- };
1235
- if (attributes.length > 0) {
1236
- const spareColumnWidth = Math.max(
1237
- 0,
1238
- (bBox.width - maxWidth - widthPadding * widthPaddingFactor) / (widthPaddingFactor / 2)
1239
- );
1240
- entityTextNode.attr(
1241
- "transform",
1242
- "translate(" + bBox.width / 2 + "," + (heightPadding + labelBBox.height / 2) + ")"
1243
- );
1244
- let heightOffset = labelBBox.height + heightPadding * 2;
1245
- let attribStyle = "attributeBoxOdd";
1246
- attributeNodes.forEach((attributeNode) => {
1247
- const alignY = heightOffset + heightPadding + attributeNode.height / 2;
1248
- attributeNode.tn.attr("transform", "translate(" + widthPadding + "," + alignY + ")");
1249
- const typeRect = groupNode.insert("rect", "#" + attributeNode.tn.node().id).classed(`er ${attribStyle}`, true).attr("x", 0).attr("y", heightOffset).attr("width", maxTypeWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2);
1250
- const nameXOffset = parseFloat(typeRect.attr("x")) + parseFloat(typeRect.attr("width"));
1251
- attributeNode.nn.attr(
1252
- "transform",
1253
- "translate(" + (nameXOffset + widthPadding) + "," + alignY + ")"
1254
- );
1255
- const nameRect = groupNode.insert("rect", "#" + attributeNode.nn.node().id).classed(`er ${attribStyle}`, true).attr("x", nameXOffset).attr("y", heightOffset).attr("width", maxNameWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2);
1256
- let keyTypeAndCommentXOffset = parseFloat(nameRect.attr("x")) + parseFloat(nameRect.attr("width"));
1257
- if (hasKeyType) {
1258
- attributeNode.kn.attr(
1259
- "transform",
1260
- "translate(" + (keyTypeAndCommentXOffset + widthPadding) + "," + alignY + ")"
1261
- );
1262
- const keyTypeRect = groupNode.insert("rect", "#" + attributeNode.kn.node().id).classed(`er ${attribStyle}`, true).attr("x", keyTypeAndCommentXOffset).attr("y", heightOffset).attr("width", maxKeyWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2);
1263
- keyTypeAndCommentXOffset = parseFloat(keyTypeRect.attr("x")) + parseFloat(keyTypeRect.attr("width"));
1264
- }
1265
- if (hasComment) {
1266
- attributeNode.cn.attr(
1267
- "transform",
1268
- "translate(" + (keyTypeAndCommentXOffset + widthPadding) + "," + alignY + ")"
1269
- );
1270
- groupNode.insert("rect", "#" + attributeNode.cn.node().id).classed(`er ${attribStyle}`, "true").attr("x", keyTypeAndCommentXOffset).attr("y", heightOffset).attr("width", maxCommentWidth + widthPadding * 2 + spareColumnWidth).attr("height", attributeNode.height + heightPadding * 2);
1271
- }
1272
- heightOffset += attributeNode.height + heightPadding * 2;
1273
- attribStyle = attribStyle === "attributeBoxOdd" ? "attributeBoxEven" : "attributeBoxOdd";
1274
- });
1275
- } else {
1276
- bBox.height = Math.max(conf.minEntityHeight, cumulativeHeight);
1277
- entityTextNode.attr("transform", "translate(" + bBox.width / 2 + "," + bBox.height / 2 + ")");
1278
- }
1279
- return bBox;
1280
- }, "drawAttributes");
1281
- var drawEntities = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(svgNode, entities2, graph) {
1282
- const keys = [...entities2.keys()];
1283
- let firstOne;
1284
- keys.forEach(function(entityName) {
1285
- const entityId = generateId(entityName, "entity");
1286
- entityNameIds.set(entityName, entityId);
1287
- const groupNode = svgNode.append("g").attr("id", entityId);
1288
- firstOne = firstOne === void 0 ? entityId : firstOne;
1289
- const textId = "text-" + entityId;
1290
- const textNode = groupNode.append("text").classed("er entityLabel", true).attr("id", textId).attr("x", 0).attr("y", 0).style("dominant-baseline", "middle").style("text-anchor", "middle").style("font-family", (0,chunk_S24QXQKS/* getConfig2 */.D7)().fontFamily).style("font-size", conf.fontSize + "px").text(entities2.get(entityName).alias ?? entityName);
1291
- const { width: entityWidth, height: entityHeight } = drawAttributes(
1292
- groupNode,
1293
- textNode,
1294
- entities2.get(entityName).attributes
1295
- );
1296
- const rectNode = groupNode.insert("rect", "#" + textId).classed("er entityBox", true).attr("x", 0).attr("y", 0).attr("width", entityWidth).attr("height", entityHeight);
1297
- const rectBBox = rectNode.node().getBBox();
1298
- graph.setNode(entityId, {
1299
- width: rectBBox.width,
1300
- height: rectBBox.height,
1301
- shape: "rect",
1302
- id: entityId
1303
- });
1304
- });
1305
- return firstOne;
1306
- }, "drawEntities");
1307
- var adjustEntities = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(svgNode, graph) {
1308
- graph.nodes().forEach(function(v) {
1309
- if (v !== void 0 && graph.node(v) !== void 0) {
1310
- svgNode.select("#" + v).attr(
1311
- "transform",
1312
- "translate(" + (graph.node(v).x - graph.node(v).width / 2) + "," + (graph.node(v).y - graph.node(v).height / 2) + " )"
1313
- );
1314
- }
1315
- });
1316
- }, "adjustEntities");
1317
- var getEdgeName = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(rel) {
1318
- return (rel.entityA + rel.roleA + rel.entityB).replace(/\s/g, "");
1319
- }, "getEdgeName");
1320
- var addRelationships = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(relationships2, g) {
1321
- relationships2.forEach(function(r) {
1322
- g.setEdge(
1323
- entityNameIds.get(r.entityA),
1324
- entityNameIds.get(r.entityB),
1325
- { relationship: r },
1326
- getEdgeName(r)
1327
- );
1328
- });
1329
- return relationships2;
1330
- }, "addRelationships");
1331
- var relCnt = 0;
1332
- var drawRelationshipFromLayout = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(svg, rel, g, insert, diagObj) {
1333
- relCnt++;
1334
- const edge = g.edge(
1335
- entityNameIds.get(rel.entityA),
1336
- entityNameIds.get(rel.entityB),
1337
- getEdgeName(rel)
1338
- );
1339
- const lineFunction = (0,src/* line */.n8j)().x(function(d) {
1340
- return d.x;
1341
- }).y(function(d) {
1342
- return d.y;
1343
- }).curve(src/* curveBasis */.qrM);
1344
- const svgPath = svg.insert("path", "#" + insert).classed("er relationshipLine", true).attr("d", lineFunction(edge.points)).style("stroke", conf.stroke).style("fill", "none");
1345
- if (rel.relSpec.relType === diagObj.db.Identification.NON_IDENTIFYING) {
1346
- svgPath.attr("stroke-dasharray", "8,8");
1347
- }
1348
- let url = "";
1349
- if (conf.arrowMarkerAbsolute) {
1350
- url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
1351
- url = url.replace(/\(/g, "\\(");
1352
- url = url.replace(/\)/g, "\\)");
1353
- }
1354
- switch (rel.relSpec.cardA) {
1355
- case diagObj.db.Cardinality.ZERO_OR_ONE:
1356
- svgPath.attr("marker-end", "url(" + url + "#" + erMarkers_default.ERMarkers.ZERO_OR_ONE_END + ")");
1357
- break;
1358
- case diagObj.db.Cardinality.ZERO_OR_MORE:
1359
- svgPath.attr("marker-end", "url(" + url + "#" + erMarkers_default.ERMarkers.ZERO_OR_MORE_END + ")");
1360
- break;
1361
- case diagObj.db.Cardinality.ONE_OR_MORE:
1362
- svgPath.attr("marker-end", "url(" + url + "#" + erMarkers_default.ERMarkers.ONE_OR_MORE_END + ")");
1363
- break;
1364
- case diagObj.db.Cardinality.ONLY_ONE:
1365
- svgPath.attr("marker-end", "url(" + url + "#" + erMarkers_default.ERMarkers.ONLY_ONE_END + ")");
1366
- break;
1367
- case diagObj.db.Cardinality.MD_PARENT:
1368
- svgPath.attr("marker-end", "url(" + url + "#" + erMarkers_default.ERMarkers.MD_PARENT_END + ")");
1369
- break;
1370
- }
1371
- switch (rel.relSpec.cardB) {
1372
- case diagObj.db.Cardinality.ZERO_OR_ONE:
1373
- svgPath.attr(
1374
- "marker-start",
1375
- "url(" + url + "#" + erMarkers_default.ERMarkers.ZERO_OR_ONE_START + ")"
1376
- );
1377
- break;
1378
- case diagObj.db.Cardinality.ZERO_OR_MORE:
1379
- svgPath.attr(
1380
- "marker-start",
1381
- "url(" + url + "#" + erMarkers_default.ERMarkers.ZERO_OR_MORE_START + ")"
1382
- );
1383
- break;
1384
- case diagObj.db.Cardinality.ONE_OR_MORE:
1385
- svgPath.attr(
1386
- "marker-start",
1387
- "url(" + url + "#" + erMarkers_default.ERMarkers.ONE_OR_MORE_START + ")"
1388
- );
1389
- break;
1390
- case diagObj.db.Cardinality.ONLY_ONE:
1391
- svgPath.attr("marker-start", "url(" + url + "#" + erMarkers_default.ERMarkers.ONLY_ONE_START + ")");
1392
- break;
1393
- case diagObj.db.Cardinality.MD_PARENT:
1394
- svgPath.attr("marker-start", "url(" + url + "#" + erMarkers_default.ERMarkers.MD_PARENT_START + ")");
1395
- break;
1396
- }
1397
- const len = svgPath.node().getTotalLength();
1398
- const labelPoint = svgPath.node().getPointAtLength(len * 0.5);
1399
- const labelId = "rel" + relCnt;
1400
- const labelText = rel.roleA.split(/<br ?\/>/g);
1401
- const labelNode = svg.append("text").classed("er relationshipLabel", true).attr("id", labelId).attr("x", labelPoint.x).attr("y", labelPoint.y).style("text-anchor", "middle").style("dominant-baseline", "middle").style("font-family", (0,chunk_S24QXQKS/* getConfig2 */.D7)().fontFamily).style("font-size", conf.fontSize + "px");
1402
- if (labelText.length == 1) {
1403
- labelNode.text(rel.roleA);
1404
- } else {
1405
- const firstShift = -(labelText.length - 1) * 0.5;
1406
- labelText.forEach((txt, i) => {
1407
- labelNode.append("tspan").attr("x", labelPoint.x).attr("dy", `${i === 0 ? firstShift : 1}em`).text(txt);
1408
- });
1409
- }
1410
- const labelBBox = labelNode.node().getBBox();
1411
- svg.insert("rect", "#" + labelId).classed("er relationshipLabelBox", true).attr("x", labelPoint.x - labelBBox.width / 2).attr("y", labelPoint.y - labelBBox.height / 2).attr("width", labelBBox.width).attr("height", labelBBox.height);
1412
- }, "drawRelationshipFromLayout");
1413
- var draw = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)(function(text, id, _version, diagObj) {
1414
- conf = (0,chunk_S24QXQKS/* getConfig2 */.D7)().er;
1415
- chunk_S24QXQKS/* log */.Rm.info("Drawing ER diagram");
1416
- const securityLevel = (0,chunk_S24QXQKS/* getConfig2 */.D7)().securityLevel;
1417
- let sandboxElement;
1418
- if (securityLevel === "sandbox") {
1419
- sandboxElement = (0,src/* select */.Ltv)("#i" + id);
1420
- }
1421
- const root = securityLevel === "sandbox" ? (0,src/* select */.Ltv)(sandboxElement.nodes()[0].contentDocument.body) : (0,src/* select */.Ltv)("body");
1422
- const svg = root.select(`[id='${id}']`);
1423
- erMarkers_default.insertMarkers(svg, conf);
1424
- let g;
1425
- g = new graphlib/* Graph */.T({
1426
- multigraph: true,
1427
- directed: true,
1428
- compound: false
1429
- }).setGraph({
1430
- rankdir: conf.layoutDirection,
1431
- marginx: 20,
1432
- marginy: 20,
1433
- nodesep: 100,
1434
- edgesep: 100,
1435
- ranksep: 100
1436
- }).setDefaultEdgeLabel(function() {
1437
- return {};
1438
- });
1439
- const firstEntity = drawEntities(svg, diagObj.db.getEntities(), g);
1440
- const relationships2 = addRelationships(diagObj.db.getRelationships(), g);
1441
- (0,dagre/* layout */.Zp)(g);
1442
- adjustEntities(svg, g);
1443
- relationships2.forEach(function(rel) {
1444
- drawRelationshipFromLayout(svg, rel, g, firstEntity, diagObj);
1445
- });
1446
- const padding = conf.diagramPadding;
1447
- chunk_TLUHKHBO/* utils_default */._K.insertTitle(svg, "entityTitleText", conf.titleTopMargin, diagObj.db.getDiagramTitle());
1448
- const svgBounds = svg.node().getBBox();
1449
- const width = svgBounds.width + padding * 2;
1450
- const height = svgBounds.height + padding * 2;
1451
- (0,chunk_S24QXQKS/* configureSvgSize */.a$)(svg, height, width, conf.useMaxWidth);
1452
- svg.attr("viewBox", `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`);
1453
- }, "draw");
1454
- var MERMAID_ERDIAGRAM_UUID = "28e9f9db-3c8d-5aa5-9faf-44286ae5937c";
1455
- function generateId(str = "", prefix = "") {
1456
- const simplifiedStr = str.replace(BAD_ID_CHARS_REGEXP, "");
1457
- return `${strWithHyphen(prefix)}${strWithHyphen(simplifiedStr)}${esm_browser_v5(
1458
- str,
1459
- MERMAID_ERDIAGRAM_UUID
1460
- )}`;
1461
- }
1462
- (0,chunk_S24QXQKS/* __name */.K2)(generateId, "generateId");
1463
- function strWithHyphen(str = "") {
1464
- return str.length > 0 ? `${str}-` : "";
1465
- }
1466
- (0,chunk_S24QXQKS/* __name */.K2)(strWithHyphen, "strWithHyphen");
1467
- var erRenderer_default = {
1468
- setConf,
1469
- draw
1470
- };
1471
-
1472
- // src/diagrams/er/styles.js
1473
- var getStyles = /* @__PURE__ */ (0,chunk_S24QXQKS/* __name */.K2)((options) => `
1474
- .entityBox {
1475
- fill: ${options.mainBkg};
1476
- stroke: ${options.nodeBorder};
1477
- }
1478
-
1479
- .attributeBoxOdd {
1480
- fill: ${options.attributeBackgroundColorOdd};
1481
- stroke: ${options.nodeBorder};
1482
- }
1483
-
1484
- .attributeBoxEven {
1485
- fill: ${options.attributeBackgroundColorEven};
1486
- stroke: ${options.nodeBorder};
1487
- }
1488
-
1489
- .relationshipLabelBox {
1490
- fill: ${options.tertiaryColor};
1491
- opacity: 0.7;
1492
- background-color: ${options.tertiaryColor};
1493
- rect {
1494
- opacity: 0.5;
1495
- }
1496
- }
1497
-
1498
- .relationshipLine {
1499
- stroke: ${options.lineColor};
1500
- }
1501
-
1502
- .entityTitleText {
1503
- text-anchor: middle;
1504
- font-size: 18px;
1505
- fill: ${options.textColor};
1506
- }
1507
- #MD_PARENT_START {
1508
- fill: #f5f5f5 !important;
1509
- stroke: ${options.lineColor} !important;
1510
- stroke-width: 1;
1511
- }
1512
- #MD_PARENT_END {
1513
- fill: #f5f5f5 !important;
1514
- stroke: ${options.lineColor} !important;
1515
- stroke-width: 1;
1516
- }
1517
-
1518
- `, "getStyles");
1519
- var styles_default = getStyles;
1520
-
1521
- // src/diagrams/er/erDiagram.ts
1522
- var diagram = {
1523
- parser: erDiagram_default,
1524
- db: erDb_default,
1525
- renderer: erRenderer_default,
1526
- styles: styles_default
1527
- };
1528
-
1529
-
1530
-
1531
- /***/ })
1532
-
1533
- }]);