@draftably/editor 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -5
- package/dist/assets/{engine.worker-DmHew5f6.js → engine.worker-DwN9io_m.js} +2765 -2722
- package/dist/element.js +1 -1
- package/dist/index.js +19553 -2
- package/dist/types/src/components/controls.d.ts +8 -5
- package/dist/types/src/state/canvas-commands.d.ts +169 -0
- package/dist/types/src/state/canvas-keyboard.d.ts +15 -0
- package/dist/types/src/state/links.d.ts +4 -1
- package/dist/types/src/state/workspace.d.ts +3 -0
- package/package.json +1 -1
- package/dist/assets/import-d2.worker-CnXfFXoa.js +0 -5395
- package/dist/chunks/abnfDiagram-WEYOIA3C-llcpthp5.js +0 -87
- package/dist/chunks/arc-rJj0TtXf.js +0 -83
- package/dist/chunks/architectureDiagram-ZHVYKT53-CfiXg0Lk.js +0 -4781
- package/dist/chunks/blockDiagram-RJAE7QA3-CO-14jWz.js +0 -1440
- package/dist/chunks/browser-iNhbPsGc.js +0 -40
- package/dist/chunks/c4Diagram-XDPPPE54-DYKuxA4n.js +0 -1524
- package/dist/chunks/channel-qMvPU6eH.js +0 -5
- package/dist/chunks/chunk-2E7WHVMD-BEZwsFS3.js +0 -670
- package/dist/chunks/chunk-2Q5K7J3B-gqtzQ8ux.js +0 -18
- package/dist/chunks/chunk-4EMNKR2T-MC54CXVe.js +0 -262
- package/dist/chunks/chunk-55XCU76K-DkZUAaqC.js +0 -68
- package/dist/chunks/chunk-5VM5RSS4-CaKe4sjM.js +0 -19
- package/dist/chunks/chunk-JWPE2WC7-CnAFS2xF.js +0 -8
- package/dist/chunks/chunk-VQ5W62QI-CXRv7FiX.js +0 -19
- package/dist/chunks/chunk-XXDRQBXY-B-AMQgD2.js +0 -8
- package/dist/chunks/chunk-ZCHMQSOR-BALpdc3g.js +0 -451
- package/dist/chunks/classDiagram-v2-4MYWR3UA-wPjgJTg4.js +0 -1570
- package/dist/chunks/cose-bilkent-JH36ORCC-Bbh5ggBc.js +0 -2608
- package/dist/chunks/cynefin-EF2NZ3EQ-Bt6b88hY.js +0 -22361
- package/dist/chunks/cynefinDiagram-WF24UDRP-BHWZvxoF.js +0 -299
- package/dist/chunks/cytoscape.esm-CRsF_JA3.js +0 -18791
- package/dist/chunks/dagre-NK4GIZVX-Cz37yPrT.js +0 -2157
- package/dist/chunks/defaultLocale-BgPVtth8.js +0 -171
- package/dist/chunks/diagram-CBK3MWTC-Q2R6FJ0B.js +0 -531
- package/dist/chunks/diagram-I5XIIV2D-a2Kdu_wA.js +0 -153
- package/dist/chunks/diagram-ODIL2UCW-DTWXxcOn.js +0 -346
- package/dist/chunks/diagram-PFBEJUXE-DIAQQ5KX.js +0 -480
- package/dist/chunks/diagram-RJA3I4VV-BPD0GghS.js +0 -219
- package/dist/chunks/diagram-TYUNFSNR-BmdkONfG.js +0 -2586
- package/dist/chunks/dot-importer-B23jwEkx.js +0 -1547
- package/dist/chunks/ebnfDiagram-V4P3TTPT-C5IKvYlb.js +0 -109
- package/dist/chunks/elk-QONTBCTQ-CtdQFvh2.js +0 -49229
- package/dist/chunks/erDiagram-KYQIGQAA-5wguK9Dx.js +0 -1064
- package/dist/chunks/flowDiagram-IUGLLWBU-BijvFPku.js +0 -1771
- package/dist/chunks/ganttDiagram-R7GPNTJY-BaqGPz-O.js +0 -2729
- package/dist/chunks/gitGraphDiagram-PDYL7XHY-DZfMGyHE.js +0 -815
- package/dist/chunks/graph-CKJmgLki.js +0 -1541
- package/dist/chunks/import-core-C-I1wGfw.js +0 -145
- package/dist/chunks/infoDiagram-MVDRKAX5-C2vH_59e.js +0 -24
- package/dist/chunks/init-DjUOC4st.js +0 -16
- package/dist/chunks/ishikawaDiagram-HPEHV2GE-q149MFlV.js +0 -624
- package/dist/chunks/journeyDiagram-BOSHW7O7-D-2Z3VtR.js +0 -834
- package/dist/chunks/kanban-definition-FNSA4HC5-wvAjV5ub.js +0 -724
- package/dist/chunks/katex-BsrBVQKd.js +0 -11314
- package/dist/chunks/linear-4t7D_ros.js +0 -259
- package/dist/chunks/mermaid-facade-BoLWBerE.js +0 -289
- package/dist/chunks/mermaid-importer-Cgx1IhmR.js +0 -478
- package/dist/chunks/mermaid.core-DXv6D2Sm.js +0 -19244
- package/dist/chunks/mindmap-definition-6OY57UG3-r9wTKul_.js +0 -837
- package/dist/chunks/mount-C1Xk_GQz.js +0 -22131
- package/dist/chunks/ordinal-DfAQgscy.js +0 -61
- package/dist/chunks/pegDiagram-ECIUJNBX-CmKlFWiP.js +0 -95
- package/dist/chunks/pieDiagram-GNMPY74T-DNTw_qan.js +0 -208
- package/dist/chunks/quadrantDiagram-D57K4MC3-CT_tvVub.js +0 -1029
- package/dist/chunks/railroadDiagram-Y72NRBL7-C5TUvZBe.js +0 -77
- package/dist/chunks/requirementDiagram-EQYSW5RA-C_c65aCa.js +0 -889
- package/dist/chunks/sankeyDiagram-SY24JHO5-CKcbizM1.js +0 -859
- package/dist/chunks/sequenceDiagram-BLEHNHQU-GpVnHOjf.js +0 -2972
- package/dist/chunks/sizeCapture-INFHLROL-CToN3JSu.js +0 -46
- package/dist/chunks/stateDiagram-v2-A6IESKWZ-rJYd2FfM.js +0 -1520
- package/dist/chunks/swimlanes-B3ENRKFQ-C7w5pfxG.js +0 -4991
- package/dist/chunks/swimlanesDiagram-AYQRV4AK-BpGY_bvE.js +0 -13
- package/dist/chunks/timeline-definition-JXYKGLGB-ChKFPBKc.js +0 -1058
- package/dist/chunks/usecaseDiagram-WPOLBNNX-skXH8Dcu.js +0 -7945
- package/dist/chunks/vennDiagram-Q3Y3IDCW-C5KknmJf.js +0 -1578
- package/dist/chunks/wardleyDiagram-IVAIDKWA-DY4Lkfpu.js +0 -678
- package/dist/chunks/xychartDiagram-4URNHDU4-BHScsL7h.js +0 -1536
- package/dist/types/src/import/browser.d.ts +0 -3
- package/dist/types/src/import/detect.d.ts +0 -31
- package/dist/types/src/import/dot-importer.d.ts +0 -3
- package/dist/types/src/import/import-core.d.ts +0 -105
- package/dist/types/src/import/mermaid-facade.d.ts +0 -120
- package/dist/types/src/import/mermaid-importer.d.ts +0 -4
- package/dist/types/src/import/mermaid-sequence.d.ts +0 -8
- package/dist/types/src/import/scratch.d.ts +0 -3
- package/dist/types/src/lib/source-hash.d.ts +0 -7
- package/dist/types/src/model/candidates.d.ts +0 -53
- package/dist/types/src/model/examples.d.ts +0 -15
- package/dist/types/src/model/label-hits.d.ts +0 -27
- package/dist/types/src/model/static-scene.d.ts +0 -15
- package/dist/types/src/state/commands.d.ts +0 -529
- package/dist/types/src/state/comparison.d.ts +0 -151
- package/dist/types/src/state/files.d.ts +0 -61
- package/dist/types/src/state/keyboard.d.ts +0 -6
- package/dist/types/src/state/launch.d.ts +0 -61
- package/dist/types/src/state/ui.d.ts +0 -39
|
@@ -1,1064 +0,0 @@
|
|
|
1
|
-
import { g as zt } from "./chunk-XXDRQBXY-B-AMQgD2.js";
|
|
2
|
-
import { s as Ut } from "./chunk-VQ5W62QI-CXRv7FiX.js";
|
|
3
|
-
import { _ as p, H as St, b as Kt, a as Zt, s as jt, g as qt, q as Wt, t as Ht, c as $, l as M, m as Qt, A as Xt, y as Jt, C as $t, D as te, E as ee, I as se, G as ie, K as re, p as ne, r as ae, k as oe, u as ce } from "./mermaid.core-DXv6D2Sm.js";
|
|
4
|
-
import { c as le } from "./channel-qMvPU6eH.js";
|
|
5
|
-
var Tt = (function() {
|
|
6
|
-
var e = /* @__PURE__ */ p(function(V, n, o, u) {
|
|
7
|
-
for (o = o || {}, u = V.length; u--; o[V[u]] = n) ;
|
|
8
|
-
return o;
|
|
9
|
-
}, "o"), a = [6, 9, 21, 23, 25, 27, 34, 37, 38, 39, 40, 41, 43, 46, 47, 51, 53, 54, 55], h = [2, 2], r = [1, 7], c = [1, 9], f = [1, 10], k = [1, 11], b = [1, 12], m = [1, 30], d = [1, 23], g = [1, 24], O = [1, 25], B = [1, 26], Y = [1, 27], E = [1, 19], A = [1, 28], U = [1, 29], N = [1, 20], I = [1, 18], R = [1, 21], v = [1, 22], Ct = [2, 6], l = [6, 9, 21, 23, 25, 27, 33, 34, 37, 38, 39, 40, 41, 43, 46, 47, 51, 53, 54, 55], ut = [1, 36], dt = [1, 37], pt = [1, 38], ft = [1, 39], bt = [1, 40], K = [6, 9, 12, 14, 16, 19, 20, 21, 23, 25, 27, 33, 34, 37, 38, 39, 40, 41, 43, 46, 47, 50, 51, 53, 54, 55, 69, 70, 71, 72, 73], D = [1, 46], L = [1, 47], Z = [1, 57], j = [43, 51, 53, 54, 55, 74, 75], q = [1, 70], W = [1, 68], w = [1, 65], H = [1, 69], Q = [1, 71], tt = [6, 9, 12, 16, 21, 23, 25, 27, 33, 34, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 51, 52, 53, 54, 55, 69, 70, 71, 72, 73], et = [1, 78], st = [1, 77], it = [1, 76], Ot = [69, 70, 71, 72, 73], Nt = [1, 91], xt = [6, 9, 45, 50], P = [6, 9, 12, 44, 45, 50, 51, 52], rt = [1, 101], nt = [1, 100], at = [1, 99], X = [18, 61], At = [1, 110], It = [1, 109], Rt = [20, 43, 51, 53, 54, 55], gt = [18, 61, 64, 66], yt = {
|
|
10
|
-
trace: /* @__PURE__ */ p(function() {
|
|
11
|
-
}, "trace"),
|
|
12
|
-
yy: {},
|
|
13
|
-
symbols_: { error: 2, start: 3, ER_DIAGRAM: 4, document: 5, EOF: 6, line: 7, statement: 8, NEWLINE: 9, entityName: 10, relSpec: 11, COLON: 12, role: 13, STYLE_SEPARATOR: 14, idList: 15, BLOCK_START: 16, attributes: 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, direction: 28, classDefStatement: 29, classStatement: 30, styleStatement: 31, subgraphHeader: 32, END: 33, SUBGRAPH: 34, separator: 35, subgraphTitle: 36, direction_tb: 37, direction_bt: 38, direction_rl: 39, direction_lr: 40, CLASSDEF: 41, stylesOpt: 42, UNICODE_TEXT: 43, STYLE_TEXT: 44, COMMA: 45, CLASS: 46, STYLE: 47, style: 48, styleComponent: 49, SEMI: 50, NUM: 51, BRKT: 52, ENTITY_NAME: 53, DECIMAL_NUM: 54, ENTITY_ONE: 55, attribute: 56, attributeType: 57, attributeName: 58, attributeKeyTypeList: 59, attributeComment: 60, ATTRIBUTE_WORD: 61, "?": 62, attributeKeyType: 63, ",": 64, ATTRIBUTE_KEY: 65, COMMENT: 66, cardinality: 67, relType: 68, ZERO_OR_ONE: 69, ZERO_OR_MORE: 70, ONE_OR_MORE: 71, ONLY_ONE: 72, MD_PARENT: 73, NON_IDENTIFYING: 74, IDENTIFYING: 75, WORD: 76, $accept: 0, $end: 1 },
|
|
14
|
-
terminals_: { 2: "error", 4: "ER_DIAGRAM", 6: "EOF", 9: "NEWLINE", 12: "COLON", 14: "STYLE_SEPARATOR", 16: "BLOCK_START", 18: "BLOCK_STOP", 19: "SQS", 20: "SQE", 21: "title", 22: "title_value", 23: "acc_title", 24: "acc_title_value", 25: "acc_descr", 26: "acc_descr_value", 27: "acc_descr_multiline_value", 33: "END", 34: "SUBGRAPH", 37: "direction_tb", 38: "direction_bt", 39: "direction_rl", 40: "direction_lr", 41: "CLASSDEF", 43: "UNICODE_TEXT", 44: "STYLE_TEXT", 45: "COMMA", 46: "CLASS", 47: "STYLE", 50: "SEMI", 51: "NUM", 52: "BRKT", 53: "ENTITY_NAME", 54: "DECIMAL_NUM", 55: "ENTITY_ONE", 61: "ATTRIBUTE_WORD", 62: "?", 64: ",", 65: "ATTRIBUTE_KEY", 66: "COMMENT", 69: "ZERO_OR_ONE", 70: "ZERO_OR_MORE", 71: "ONE_OR_MORE", 72: "ONLY_ONE", 73: "MD_PARENT", 74: "NON_IDENTIFYING", 75: "IDENTIFYING", 76: "WORD" },
|
|
15
|
-
productions_: [0, [3, 3], [5, 0], [5, 2], [7, 1], [7, 1], [7, 1], [8, 5], [8, 9], [8, 7], [8, 7], [8, 4], [8, 6], [8, 3], [8, 5], [8, 1], [8, 3], [8, 7], [8, 9], [8, 6], [8, 8], [8, 4], [8, 6], [8, 2], [8, 2], [8, 2], [8, 1], [8, 1], [8, 1], [8, 1], [8, 1], [8, 3], [32, 3], [32, 6], [36, 1], [36, 2], [28, 1], [28, 1], [28, 1], [28, 1], [29, 4], [15, 1], [15, 1], [15, 3], [15, 3], [30, 3], [31, 4], [42, 1], [42, 3], [48, 1], [48, 2], [35, 1], [35, 1], [35, 1], [49, 1], [49, 1], [49, 1], [49, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [17, 1], [17, 2], [56, 2], [56, 3], [56, 3], [56, 4], [57, 1], [57, 2], [58, 1], [59, 1], [59, 3], [63, 1], [60, 1], [11, 3], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [68, 1], [68, 1], [13, 1], [13, 1], [13, 1]],
|
|
16
|
-
performAction: /* @__PURE__ */ p(function(n, o, u, i, y, t, J) {
|
|
17
|
-
var s = t.length - 1;
|
|
18
|
-
switch (y) {
|
|
19
|
-
case 1:
|
|
20
|
-
break;
|
|
21
|
-
case 2:
|
|
22
|
-
this.$ = [];
|
|
23
|
-
break;
|
|
24
|
-
case 3:
|
|
25
|
-
this.$ = t[s - 1].concat(t[s]);
|
|
26
|
-
break;
|
|
27
|
-
case 4:
|
|
28
|
-
this.$ = t[s];
|
|
29
|
-
break;
|
|
30
|
-
case 5:
|
|
31
|
-
case 6:
|
|
32
|
-
this.$ = [];
|
|
33
|
-
break;
|
|
34
|
-
case 7:
|
|
35
|
-
i.addEntity(t[s - 4]), i.addEntity(t[s - 2]), i.addRelationship(t[s - 4], t[s], t[s - 2], t[s - 3]), this.$ = [t[s - 4], t[s - 2]];
|
|
36
|
-
break;
|
|
37
|
-
case 8:
|
|
38
|
-
i.addEntity(t[s - 8]), i.addEntity(t[s - 4]), i.addRelationship(t[s - 8], t[s], t[s - 4], t[s - 5]), i.setClass([t[s - 8]], t[s - 6]), i.setClass([t[s - 4]], t[s - 2]), this.$ = [t[s - 8], t[s - 4]];
|
|
39
|
-
break;
|
|
40
|
-
case 9:
|
|
41
|
-
i.addEntity(t[s - 6]), i.addEntity(t[s - 2]), i.addRelationship(t[s - 6], t[s], t[s - 2], t[s - 3]), i.setClass([t[s - 6]], t[s - 4]), this.$ = [t[s - 6], t[s - 2]];
|
|
42
|
-
break;
|
|
43
|
-
case 10:
|
|
44
|
-
i.addEntity(t[s - 6]), i.addEntity(t[s - 4]), i.addRelationship(t[s - 6], t[s], t[s - 4], t[s - 5]), i.setClass([t[s - 4]], t[s - 2]), this.$ = [t[s - 6], t[s - 4]];
|
|
45
|
-
break;
|
|
46
|
-
case 11:
|
|
47
|
-
i.addEntity(t[s - 3]), i.addAttributes(t[s - 3], t[s - 1]), this.$ = [t[s - 3]];
|
|
48
|
-
break;
|
|
49
|
-
case 12:
|
|
50
|
-
i.addEntity(t[s - 5]), i.addAttributes(t[s - 5], t[s - 1]), i.setClass([t[s - 5]], t[s - 3]), this.$ = [t[s - 5]];
|
|
51
|
-
break;
|
|
52
|
-
case 13:
|
|
53
|
-
i.addEntity(t[s - 2]), this.$ = [t[s - 2]];
|
|
54
|
-
break;
|
|
55
|
-
case 14:
|
|
56
|
-
i.addEntity(t[s - 4]), i.setClass([t[s - 4]], t[s - 2]), this.$ = [t[s - 4]];
|
|
57
|
-
break;
|
|
58
|
-
case 15:
|
|
59
|
-
i.addEntity(t[s]), this.$ = [t[s]];
|
|
60
|
-
break;
|
|
61
|
-
case 16:
|
|
62
|
-
i.addEntity(t[s - 2]), i.setClass([t[s - 2]], t[s]), this.$ = [t[s - 2]];
|
|
63
|
-
break;
|
|
64
|
-
case 17:
|
|
65
|
-
i.addEntity(t[s - 6], t[s - 4]), i.addAttributes(t[s - 6], t[s - 1]), this.$ = [t[s - 6]];
|
|
66
|
-
break;
|
|
67
|
-
case 18:
|
|
68
|
-
i.addEntity(t[s - 8], t[s - 6]), i.addAttributes(t[s - 8], t[s - 1]), i.setClass([t[s - 8]], t[s - 3]), this.$ = [t[s - 8]];
|
|
69
|
-
break;
|
|
70
|
-
case 19:
|
|
71
|
-
i.addEntity(t[s - 5], t[s - 3]), this.$ = [t[s - 5]];
|
|
72
|
-
break;
|
|
73
|
-
case 20:
|
|
74
|
-
i.addEntity(t[s - 7], t[s - 5]), i.setClass([t[s - 7]], t[s - 2]), this.$ = [t[s - 7]];
|
|
75
|
-
break;
|
|
76
|
-
case 21:
|
|
77
|
-
i.addEntity(t[s - 3], t[s - 1]);
|
|
78
|
-
break;
|
|
79
|
-
case 22:
|
|
80
|
-
i.addEntity(t[s - 5], t[s - 3]), i.setClass([t[s - 5]], t[s]);
|
|
81
|
-
break;
|
|
82
|
-
case 23:
|
|
83
|
-
case 24:
|
|
84
|
-
this.$ = t[s].trim(), i.setAccTitle(this.$);
|
|
85
|
-
break;
|
|
86
|
-
case 25:
|
|
87
|
-
case 26:
|
|
88
|
-
this.$ = t[s].trim(), i.setAccDescription(this.$);
|
|
89
|
-
break;
|
|
90
|
-
case 27:
|
|
91
|
-
i.subgraphDepth ? this.$ = t[s] : (i.setDirection(t[s].value), this.$ = []);
|
|
92
|
-
break;
|
|
93
|
-
case 31:
|
|
94
|
-
i.subgraphDepth = (i.subgraphDepth || 1) - 1, this.$ = i.addSubGraph({ text: t[s - 2].id }, t[s - 1], { text: t[s - 2].text });
|
|
95
|
-
break;
|
|
96
|
-
case 32:
|
|
97
|
-
i.subgraphDepth = (i.subgraphDepth || 0) + 1, this.$ = { id: t[s - 1], text: t[s - 1] };
|
|
98
|
-
break;
|
|
99
|
-
case 33:
|
|
100
|
-
i.subgraphDepth = (i.subgraphDepth || 0) + 1, this.$ = { id: t[s - 4], text: t[s - 2] };
|
|
101
|
-
break;
|
|
102
|
-
case 34:
|
|
103
|
-
case 59:
|
|
104
|
-
case 60:
|
|
105
|
-
case 61:
|
|
106
|
-
case 62:
|
|
107
|
-
case 86:
|
|
108
|
-
this.$ = t[s];
|
|
109
|
-
break;
|
|
110
|
-
case 35:
|
|
111
|
-
this.$ = t[s - 1] + " " + t[s];
|
|
112
|
-
break;
|
|
113
|
-
case 36:
|
|
114
|
-
this.$ = { stmt: "dir", value: "TB" };
|
|
115
|
-
break;
|
|
116
|
-
case 37:
|
|
117
|
-
this.$ = { stmt: "dir", value: "BT" };
|
|
118
|
-
break;
|
|
119
|
-
case 38:
|
|
120
|
-
this.$ = { stmt: "dir", value: "RL" };
|
|
121
|
-
break;
|
|
122
|
-
case 39:
|
|
123
|
-
this.$ = { stmt: "dir", value: "LR" };
|
|
124
|
-
break;
|
|
125
|
-
case 40:
|
|
126
|
-
this.$ = t[s - 3], i.addClass(t[s - 2], t[s - 1]);
|
|
127
|
-
break;
|
|
128
|
-
case 41:
|
|
129
|
-
case 42:
|
|
130
|
-
case 63:
|
|
131
|
-
case 72:
|
|
132
|
-
this.$ = [t[s]];
|
|
133
|
-
break;
|
|
134
|
-
case 43:
|
|
135
|
-
case 44:
|
|
136
|
-
this.$ = t[s - 2].concat([t[s]]);
|
|
137
|
-
break;
|
|
138
|
-
case 45:
|
|
139
|
-
this.$ = t[s - 2], i.setClass(t[s - 1], t[s]);
|
|
140
|
-
break;
|
|
141
|
-
case 46:
|
|
142
|
-
this.$ = t[s - 3], i.addCssStyles(t[s - 2], t[s - 1]);
|
|
143
|
-
break;
|
|
144
|
-
case 47:
|
|
145
|
-
this.$ = [t[s]];
|
|
146
|
-
break;
|
|
147
|
-
case 48:
|
|
148
|
-
t[s - 2].push(t[s]), this.$ = t[s - 2];
|
|
149
|
-
break;
|
|
150
|
-
case 50:
|
|
151
|
-
this.$ = t[s - 1] + t[s];
|
|
152
|
-
break;
|
|
153
|
-
case 58:
|
|
154
|
-
case 84:
|
|
155
|
-
case 85:
|
|
156
|
-
this.$ = t[s].replace(/"/g, "");
|
|
157
|
-
break;
|
|
158
|
-
case 64:
|
|
159
|
-
t[s].push(t[s - 1]), this.$ = t[s];
|
|
160
|
-
break;
|
|
161
|
-
case 65:
|
|
162
|
-
this.$ = { type: t[s - 1], name: t[s] };
|
|
163
|
-
break;
|
|
164
|
-
case 66:
|
|
165
|
-
this.$ = { type: t[s - 2], name: t[s - 1], keys: t[s] };
|
|
166
|
-
break;
|
|
167
|
-
case 67:
|
|
168
|
-
this.$ = { type: t[s - 2], name: t[s - 1], comment: t[s] };
|
|
169
|
-
break;
|
|
170
|
-
case 68:
|
|
171
|
-
this.$ = { type: t[s - 3], name: t[s - 2], keys: t[s - 1], comment: t[s] };
|
|
172
|
-
break;
|
|
173
|
-
case 69:
|
|
174
|
-
case 71:
|
|
175
|
-
case 74:
|
|
176
|
-
this.$ = t[s];
|
|
177
|
-
break;
|
|
178
|
-
case 70:
|
|
179
|
-
this.$ = t[s - 1] + t[s];
|
|
180
|
-
break;
|
|
181
|
-
case 73:
|
|
182
|
-
t[s - 2].push(t[s]), this.$ = t[s - 2];
|
|
183
|
-
break;
|
|
184
|
-
case 75:
|
|
185
|
-
this.$ = t[s].replace(/"/g, "");
|
|
186
|
-
break;
|
|
187
|
-
case 76:
|
|
188
|
-
this.$ = { cardA: t[s], relType: t[s - 1], cardB: t[s - 2] };
|
|
189
|
-
break;
|
|
190
|
-
case 77:
|
|
191
|
-
this.$ = i.Cardinality.ZERO_OR_ONE;
|
|
192
|
-
break;
|
|
193
|
-
case 78:
|
|
194
|
-
this.$ = i.Cardinality.ZERO_OR_MORE;
|
|
195
|
-
break;
|
|
196
|
-
case 79:
|
|
197
|
-
this.$ = i.Cardinality.ONE_OR_MORE;
|
|
198
|
-
break;
|
|
199
|
-
case 80:
|
|
200
|
-
this.$ = i.Cardinality.ONLY_ONE;
|
|
201
|
-
break;
|
|
202
|
-
case 81:
|
|
203
|
-
this.$ = i.Cardinality.MD_PARENT;
|
|
204
|
-
break;
|
|
205
|
-
case 82:
|
|
206
|
-
this.$ = i.Identification.NON_IDENTIFYING;
|
|
207
|
-
break;
|
|
208
|
-
case 83:
|
|
209
|
-
this.$ = i.Identification.IDENTIFYING;
|
|
210
|
-
break;
|
|
211
|
-
}
|
|
212
|
-
}, "anonymous"),
|
|
213
|
-
table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, e(a, h, { 5: 3 }), { 6: [1, 4], 7: 5, 8: 6, 9: r, 10: 8, 21: c, 23: f, 25: k, 27: b, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 34: m, 37: d, 38: g, 39: O, 40: B, 41: Y, 43: E, 46: A, 47: U, 51: N, 53: I, 54: R, 55: v }, e(a, Ct, { 1: [2, 1] }), e(l, [2, 3]), e(l, [2, 4]), e(l, [2, 5]), e(l, [2, 15], { 11: 31, 67: 35, 14: [1, 32], 16: [1, 33], 19: [1, 34], 69: ut, 70: dt, 71: pt, 72: ft, 73: bt }), { 22: [1, 41] }, { 24: [1, 42] }, { 26: [1, 43] }, e(l, [2, 26]), e(l, [2, 27]), e(l, [2, 28]), e(l, [2, 29]), e(l, [2, 30]), e(l, h, { 5: 44 }), e(K, [2, 58]), e(K, [2, 59]), e(K, [2, 60]), e(K, [2, 61]), e(K, [2, 62]), e(l, [2, 36]), e(l, [2, 37]), e(l, [2, 38]), e(l, [2, 39]), { 15: 45, 43: D, 44: L }, { 15: 48, 43: D, 44: L }, { 15: 49, 43: D, 44: L }, { 10: 50, 43: E, 51: N, 53: I, 54: R, 55: v }, { 10: 51, 43: E, 51: N, 53: I, 54: R, 55: v }, { 15: 52, 43: D, 44: L }, { 17: 53, 18: [1, 54], 56: 55, 57: 56, 61: Z }, { 10: 58, 43: E, 51: N, 53: I, 54: R, 55: v }, { 68: 59, 74: [1, 60], 75: [1, 61] }, e(j, [2, 77]), e(j, [2, 78]), e(j, [2, 79]), e(j, [2, 80]), e(j, [2, 81]), e(l, [2, 23]), e(l, [2, 24]), e(l, [2, 25]), { 6: [1, 63], 7: 5, 8: 6, 9: r, 10: 8, 21: c, 23: f, 25: k, 27: b, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: [1, 62], 34: m, 37: d, 38: g, 39: O, 40: B, 41: Y, 43: E, 46: A, 47: U, 51: N, 53: I, 54: R, 55: v }, { 12: q, 42: 64, 44: W, 45: w, 48: 66, 49: 67, 51: H, 52: Q }, e(tt, [2, 41]), e(tt, [2, 42]), { 15: 72, 43: D, 44: L, 45: w }, { 12: q, 42: 73, 44: W, 45: w, 48: 66, 49: 67, 51: H, 52: Q }, { 6: et, 9: st, 19: [1, 75], 35: 74, 50: it }, { 12: [1, 79], 14: [1, 80] }, e(l, [2, 16], { 67: 35, 11: 81, 16: [1, 82], 45: w, 69: ut, 70: dt, 71: pt, 72: ft, 73: bt }), { 18: [1, 83] }, e(l, [2, 13]), { 17: 84, 18: [2, 63], 56: 55, 57: 56, 61: Z }, { 58: 85, 61: [1, 86] }, { 61: [2, 69], 62: [1, 87] }, { 20: [1, 88] }, { 67: 89, 69: ut, 70: dt, 71: pt, 72: ft, 73: bt }, e(Ot, [2, 82]), e(Ot, [2, 83]), e(l, [2, 31]), e(l, Ct), { 6: et, 9: st, 35: 90, 45: Nt, 50: it }, { 43: [1, 92], 44: [1, 93] }, e(xt, [2, 47], { 49: 94, 12: q, 44: W, 51: H, 52: Q }), e(P, [2, 49]), e(P, [2, 54]), e(P, [2, 55]), e(P, [2, 56]), e(P, [2, 57]), e(l, [2, 45], { 45: w }), { 6: et, 9: st, 35: 95, 45: Nt, 50: it }, e(l, [2, 32]), { 10: 97, 36: 96, 43: E, 51: N, 53: I, 54: R, 55: v }, e(l, [2, 51]), e(l, [2, 52]), e(l, [2, 53]), { 13: 98, 43: rt, 53: nt, 76: at }, { 15: 102, 43: D, 44: L }, { 10: 103, 43: E, 51: N, 53: I, 54: R, 55: v }, { 17: 104, 18: [1, 105], 56: 55, 57: 56, 61: Z }, e(l, [2, 11]), { 18: [2, 64] }, e(X, [2, 65], { 59: 106, 60: 107, 63: 108, 65: At, 66: It }), e([18, 61, 65, 66], [2, 71]), { 61: [2, 70] }, e(l, [2, 21], { 14: [1, 112], 16: [1, 111] }), e([43, 51, 53, 54, 55], [2, 76]), e(l, [2, 40]), { 12: q, 44: W, 48: 113, 49: 67, 51: H, 52: Q }, e(tt, [2, 43]), e(tt, [2, 44]), e(P, [2, 50]), e(l, [2, 46]), { 10: 115, 20: [1, 114], 43: E, 51: N, 53: I, 54: R, 55: v }, e(Rt, [2, 34]), e(l, [2, 7]), e(l, [2, 84]), e(l, [2, 85]), e(l, [2, 86]), { 12: [1, 116], 45: w }, { 12: [1, 118], 14: [1, 117] }, { 18: [1, 119] }, e(l, [2, 14]), e(X, [2, 66], { 60: 120, 64: [1, 121], 66: It }), e(X, [2, 67]), e(gt, [2, 72]), e(X, [2, 75]), e(gt, [2, 74]), { 17: 122, 18: [1, 123], 56: 55, 57: 56, 61: Z }, { 15: 124, 43: D, 44: L }, e(xt, [2, 48], { 49: 94, 12: q, 44: W, 51: H, 52: Q }), { 6: et, 9: st, 35: 125, 50: it }, e(Rt, [2, 35]), { 13: 126, 43: rt, 53: nt, 76: at }, { 15: 127, 43: D, 44: L }, { 13: 128, 43: rt, 53: nt, 76: at }, e(l, [2, 12]), e(X, [2, 68]), { 63: 129, 65: At }, { 18: [1, 130] }, e(l, [2, 19]), e(l, [2, 22], { 16: [1, 131], 45: w }), e(l, [2, 33]), e(l, [2, 10]), { 12: [1, 132], 45: w }, e(l, [2, 9]), e(gt, [2, 73]), e(l, [2, 17]), { 17: 133, 18: [1, 134], 56: 55, 57: 56, 61: Z }, { 13: 135, 43: rt, 53: nt, 76: at }, { 18: [1, 136] }, e(l, [2, 20]), e(l, [2, 8]), e(l, [2, 18])],
|
|
214
|
-
defaultActions: { 84: [2, 64], 87: [2, 70] },
|
|
215
|
-
parseError: /* @__PURE__ */ p(function(n, o) {
|
|
216
|
-
if (o.recoverable)
|
|
217
|
-
this.trace(n);
|
|
218
|
-
else {
|
|
219
|
-
var u = new Error(n);
|
|
220
|
-
throw u.hash = o, u;
|
|
221
|
-
}
|
|
222
|
-
}, "parseError"),
|
|
223
|
-
parse: /* @__PURE__ */ p(function(n) {
|
|
224
|
-
var o = this, u = [0], i = [], y = [null], t = [], J = this.table, s = "", ct = 0, vt = 0, Gt = 2, Dt = 1, Ft = t.slice.call(arguments, 1), _ = Object.create(this.lexer), G = { yy: {} };
|
|
225
|
-
for (var _t in this.yy)
|
|
226
|
-
Object.prototype.hasOwnProperty.call(this.yy, _t) && (G.yy[_t] = this.yy[_t]);
|
|
227
|
-
_.setInput(n, G.yy), G.yy.lexer = _, G.yy.parser = this, typeof _.yylloc > "u" && (_.yylloc = {});
|
|
228
|
-
var kt = _.yylloc;
|
|
229
|
-
t.push(kt);
|
|
230
|
-
var Yt = _.options && _.options.ranges;
|
|
231
|
-
typeof G.yy.parseError == "function" ? this.parseError = G.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
232
|
-
function Pt(T) {
|
|
233
|
-
u.length = u.length - 2 * T, y.length = y.length - T, t.length = t.length - T;
|
|
234
|
-
}
|
|
235
|
-
p(Pt, "popStack");
|
|
236
|
-
function Lt() {
|
|
237
|
-
var T;
|
|
238
|
-
return T = i.pop() || _.lex() || Dt, typeof T != "number" && (T instanceof Array && (i = T, T = i.pop()), T = o.symbols_[T] || T), T;
|
|
239
|
-
}
|
|
240
|
-
p(Lt, "lex");
|
|
241
|
-
for (var S, F, C, mt, z = {}, lt, x, wt, ht; ; ) {
|
|
242
|
-
if (F = u[u.length - 1], this.defaultActions[F] ? C = this.defaultActions[F] : ((S === null || typeof S > "u") && (S = Lt()), C = J[F] && J[F][S]), typeof C > "u" || !C.length || !C[0]) {
|
|
243
|
-
var Et = "";
|
|
244
|
-
ht = [];
|
|
245
|
-
for (lt in J[F])
|
|
246
|
-
this.terminals_[lt] && lt > Gt && ht.push("'" + this.terminals_[lt] + "'");
|
|
247
|
-
_.showPosition ? Et = "Parse error on line " + (ct + 1) + `:
|
|
248
|
-
` + _.showPosition() + `
|
|
249
|
-
Expecting ` + ht.join(", ") + ", got '" + (this.terminals_[S] || S) + "'" : Et = "Parse error on line " + (ct + 1) + ": Unexpected " + (S == Dt ? "end of input" : "'" + (this.terminals_[S] || S) + "'"), this.parseError(Et, {
|
|
250
|
-
text: _.match,
|
|
251
|
-
token: this.terminals_[S] || S,
|
|
252
|
-
line: _.yylineno,
|
|
253
|
-
loc: kt,
|
|
254
|
-
expected: ht
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
if (C[0] instanceof Array && C.length > 1)
|
|
258
|
-
throw new Error("Parse Error: multiple actions possible at state: " + F + ", token: " + S);
|
|
259
|
-
switch (C[0]) {
|
|
260
|
-
case 1:
|
|
261
|
-
u.push(S), y.push(_.yytext), t.push(_.yylloc), u.push(C[1]), S = null, vt = _.yyleng, s = _.yytext, ct = _.yylineno, kt = _.yylloc;
|
|
262
|
-
break;
|
|
263
|
-
case 2:
|
|
264
|
-
if (x = this.productions_[C[1]][1], z.$ = y[y.length - x], z._$ = {
|
|
265
|
-
first_line: t[t.length - (x || 1)].first_line,
|
|
266
|
-
last_line: t[t.length - 1].last_line,
|
|
267
|
-
first_column: t[t.length - (x || 1)].first_column,
|
|
268
|
-
last_column: t[t.length - 1].last_column
|
|
269
|
-
}, Yt && (z._$.range = [
|
|
270
|
-
t[t.length - (x || 1)].range[0],
|
|
271
|
-
t[t.length - 1].range[1]
|
|
272
|
-
]), mt = this.performAction.apply(z, [
|
|
273
|
-
s,
|
|
274
|
-
vt,
|
|
275
|
-
ct,
|
|
276
|
-
G.yy,
|
|
277
|
-
C[1],
|
|
278
|
-
y,
|
|
279
|
-
t
|
|
280
|
-
].concat(Ft)), typeof mt < "u")
|
|
281
|
-
return mt;
|
|
282
|
-
x && (u = u.slice(0, -1 * x * 2), y = y.slice(0, -1 * x), t = t.slice(0, -1 * x)), u.push(this.productions_[C[1]][0]), y.push(z.$), t.push(z._$), wt = J[u[u.length - 2]][u[u.length - 1]], u.push(wt);
|
|
283
|
-
break;
|
|
284
|
-
case 3:
|
|
285
|
-
return !0;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return !0;
|
|
289
|
-
}, "parse")
|
|
290
|
-
}, Bt = /* @__PURE__ */ (function() {
|
|
291
|
-
var V = {
|
|
292
|
-
EOF: 1,
|
|
293
|
-
parseError: /* @__PURE__ */ p(function(o, u) {
|
|
294
|
-
if (this.yy.parser)
|
|
295
|
-
this.yy.parser.parseError(o, u);
|
|
296
|
-
else
|
|
297
|
-
throw new Error(o);
|
|
298
|
-
}, "parseError"),
|
|
299
|
-
// resets the lexer, sets new input
|
|
300
|
-
setInput: /* @__PURE__ */ p(function(n, o) {
|
|
301
|
-
return this.yy = o || this.yy || {}, this._input = n, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
|
302
|
-
first_line: 1,
|
|
303
|
-
first_column: 0,
|
|
304
|
-
last_line: 1,
|
|
305
|
-
last_column: 0
|
|
306
|
-
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
307
|
-
}, "setInput"),
|
|
308
|
-
// consumes and returns one char from the input
|
|
309
|
-
input: /* @__PURE__ */ p(function() {
|
|
310
|
-
var n = this._input[0];
|
|
311
|
-
this.yytext += n, this.yyleng++, this.offset++, this.match += n, this.matched += n;
|
|
312
|
-
var o = n.match(/(?:\r\n?|\n).*/g);
|
|
313
|
-
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), n;
|
|
314
|
-
}, "input"),
|
|
315
|
-
// unshifts one char (or a string) into the input
|
|
316
|
-
unput: /* @__PURE__ */ p(function(n) {
|
|
317
|
-
var o = n.length, u = n.split(/(?:\r\n?|\n)/g);
|
|
318
|
-
this._input = n + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - o), this.offset -= o;
|
|
319
|
-
var i = this.match.split(/(?:\r\n?|\n)/g);
|
|
320
|
-
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), u.length - 1 && (this.yylineno -= u.length - 1);
|
|
321
|
-
var y = this.yylloc.range;
|
|
322
|
-
return this.yylloc = {
|
|
323
|
-
first_line: this.yylloc.first_line,
|
|
324
|
-
last_line: this.yylineno + 1,
|
|
325
|
-
first_column: this.yylloc.first_column,
|
|
326
|
-
last_column: u ? (u.length === i.length ? this.yylloc.first_column : 0) + i[i.length - u.length].length - u[0].length : this.yylloc.first_column - o
|
|
327
|
-
}, this.options.ranges && (this.yylloc.range = [y[0], y[0] + this.yyleng - o]), this.yyleng = this.yytext.length, this;
|
|
328
|
-
}, "unput"),
|
|
329
|
-
// When called from action, caches matched text and appends it on next action
|
|
330
|
-
more: /* @__PURE__ */ p(function() {
|
|
331
|
-
return this._more = !0, this;
|
|
332
|
-
}, "more"),
|
|
333
|
-
// 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.
|
|
334
|
-
reject: /* @__PURE__ */ p(function() {
|
|
335
|
-
if (this.options.backtrack_lexer)
|
|
336
|
-
this._backtrack = !0;
|
|
337
|
-
else
|
|
338
|
-
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).
|
|
339
|
-
` + this.showPosition(), {
|
|
340
|
-
text: "",
|
|
341
|
-
token: null,
|
|
342
|
-
line: this.yylineno
|
|
343
|
-
});
|
|
344
|
-
return this;
|
|
345
|
-
}, "reject"),
|
|
346
|
-
// retain first n characters of the match
|
|
347
|
-
less: /* @__PURE__ */ p(function(n) {
|
|
348
|
-
this.unput(this.match.slice(n));
|
|
349
|
-
}, "less"),
|
|
350
|
-
// displays already matched input, i.e. for error messages
|
|
351
|
-
pastInput: /* @__PURE__ */ p(function() {
|
|
352
|
-
var n = this.matched.substr(0, this.matched.length - this.match.length);
|
|
353
|
-
return (n.length > 20 ? "..." : "") + n.substr(-20).replace(/\n/g, "");
|
|
354
|
-
}, "pastInput"),
|
|
355
|
-
// displays upcoming input, i.e. for error messages
|
|
356
|
-
upcomingInput: /* @__PURE__ */ p(function() {
|
|
357
|
-
var n = this.match;
|
|
358
|
-
return n.length < 20 && (n += this._input.substr(0, 20 - n.length)), (n.substr(0, 20) + (n.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
359
|
-
}, "upcomingInput"),
|
|
360
|
-
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
361
|
-
showPosition: /* @__PURE__ */ p(function() {
|
|
362
|
-
var n = this.pastInput(), o = new Array(n.length + 1).join("-");
|
|
363
|
-
return n + this.upcomingInput() + `
|
|
364
|
-
` + o + "^";
|
|
365
|
-
}, "showPosition"),
|
|
366
|
-
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
367
|
-
test_match: /* @__PURE__ */ p(function(n, o) {
|
|
368
|
-
var u, i, y;
|
|
369
|
-
if (this.options.backtrack_lexer && (y = {
|
|
370
|
-
yylineno: this.yylineno,
|
|
371
|
-
yylloc: {
|
|
372
|
-
first_line: this.yylloc.first_line,
|
|
373
|
-
last_line: this.last_line,
|
|
374
|
-
first_column: this.yylloc.first_column,
|
|
375
|
-
last_column: this.yylloc.last_column
|
|
376
|
-
},
|
|
377
|
-
yytext: this.yytext,
|
|
378
|
-
match: this.match,
|
|
379
|
-
matches: this.matches,
|
|
380
|
-
matched: this.matched,
|
|
381
|
-
yyleng: this.yyleng,
|
|
382
|
-
offset: this.offset,
|
|
383
|
-
_more: this._more,
|
|
384
|
-
_input: this._input,
|
|
385
|
-
yy: this.yy,
|
|
386
|
-
conditionStack: this.conditionStack.slice(0),
|
|
387
|
-
done: this.done
|
|
388
|
-
}, this.options.ranges && (y.yylloc.range = this.yylloc.range.slice(0))), i = n[0].match(/(?:\r\n?|\n).*/g), i && (this.yylineno += i.length), this.yylloc = {
|
|
389
|
-
first_line: this.yylloc.last_line,
|
|
390
|
-
last_line: this.yylineno + 1,
|
|
391
|
-
first_column: this.yylloc.last_column,
|
|
392
|
-
last_column: i ? i[i.length - 1].length - i[i.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + n[0].length
|
|
393
|
-
}, this.yytext += n[0], this.match += n[0], this.matches = n, 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(n[0].length), this.matched += n[0], u = this.performAction.call(this, this.yy, this, o, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), u)
|
|
394
|
-
return u;
|
|
395
|
-
if (this._backtrack) {
|
|
396
|
-
for (var t in y)
|
|
397
|
-
this[t] = y[t];
|
|
398
|
-
return !1;
|
|
399
|
-
}
|
|
400
|
-
return !1;
|
|
401
|
-
}, "test_match"),
|
|
402
|
-
// return next match in input
|
|
403
|
-
next: /* @__PURE__ */ p(function() {
|
|
404
|
-
if (this.done)
|
|
405
|
-
return this.EOF;
|
|
406
|
-
this._input || (this.done = !0);
|
|
407
|
-
var n, o, u, i;
|
|
408
|
-
this._more || (this.yytext = "", this.match = "");
|
|
409
|
-
for (var y = this._currentRules(), t = 0; t < y.length; t++)
|
|
410
|
-
if (u = this._input.match(this.rules[y[t]]), u && (!o || u[0].length > o[0].length)) {
|
|
411
|
-
if (o = u, i = t, this.options.backtrack_lexer) {
|
|
412
|
-
if (n = this.test_match(u, y[t]), n !== !1)
|
|
413
|
-
return n;
|
|
414
|
-
if (this._backtrack) {
|
|
415
|
-
o = !1;
|
|
416
|
-
continue;
|
|
417
|
-
} else
|
|
418
|
-
return !1;
|
|
419
|
-
} else if (!this.options.flex)
|
|
420
|
-
break;
|
|
421
|
-
}
|
|
422
|
-
return o ? (n = this.test_match(o, y[i]), n !== !1 ? n : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
423
|
-
` + this.showPosition(), {
|
|
424
|
-
text: "",
|
|
425
|
-
token: null,
|
|
426
|
-
line: this.yylineno
|
|
427
|
-
});
|
|
428
|
-
}, "next"),
|
|
429
|
-
// return next match that has a token
|
|
430
|
-
lex: /* @__PURE__ */ p(function() {
|
|
431
|
-
var o = this.next();
|
|
432
|
-
return o || this.lex();
|
|
433
|
-
}, "lex"),
|
|
434
|
-
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
435
|
-
begin: /* @__PURE__ */ p(function(o) {
|
|
436
|
-
this.conditionStack.push(o);
|
|
437
|
-
}, "begin"),
|
|
438
|
-
// pop the previously active lexer condition state off the condition stack
|
|
439
|
-
popState: /* @__PURE__ */ p(function() {
|
|
440
|
-
var o = this.conditionStack.length - 1;
|
|
441
|
-
return o > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
442
|
-
}, "popState"),
|
|
443
|
-
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
444
|
-
_currentRules: /* @__PURE__ */ p(function() {
|
|
445
|
-
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
446
|
-
}, "_currentRules"),
|
|
447
|
-
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
448
|
-
topState: /* @__PURE__ */ p(function(o) {
|
|
449
|
-
return o = this.conditionStack.length - 1 - Math.abs(o || 0), o >= 0 ? this.conditionStack[o] : "INITIAL";
|
|
450
|
-
}, "topState"),
|
|
451
|
-
// alias for begin(condition)
|
|
452
|
-
pushState: /* @__PURE__ */ p(function(o) {
|
|
453
|
-
this.begin(o);
|
|
454
|
-
}, "pushState"),
|
|
455
|
-
// return the number of states currently on the stack
|
|
456
|
-
stateStackSize: /* @__PURE__ */ p(function() {
|
|
457
|
-
return this.conditionStack.length;
|
|
458
|
-
}, "stateStackSize"),
|
|
459
|
-
options: { "case-insensitive": !0 },
|
|
460
|
-
performAction: /* @__PURE__ */ p(function(o, u, i, y) {
|
|
461
|
-
switch (i) {
|
|
462
|
-
case 0:
|
|
463
|
-
return this.begin("acc_title"), 23;
|
|
464
|
-
case 1:
|
|
465
|
-
return this.popState(), "acc_title_value";
|
|
466
|
-
case 2:
|
|
467
|
-
return this.begin("acc_descr"), 25;
|
|
468
|
-
case 3:
|
|
469
|
-
return this.popState(), "acc_descr_value";
|
|
470
|
-
case 4:
|
|
471
|
-
this.begin("acc_descr_multiline");
|
|
472
|
-
break;
|
|
473
|
-
case 5:
|
|
474
|
-
this.popState();
|
|
475
|
-
break;
|
|
476
|
-
case 6:
|
|
477
|
-
return "acc_descr_multiline_value";
|
|
478
|
-
case 7:
|
|
479
|
-
return 37;
|
|
480
|
-
case 8:
|
|
481
|
-
return 38;
|
|
482
|
-
case 9:
|
|
483
|
-
return 39;
|
|
484
|
-
case 10:
|
|
485
|
-
return 40;
|
|
486
|
-
case 11:
|
|
487
|
-
break;
|
|
488
|
-
case 12:
|
|
489
|
-
return 9;
|
|
490
|
-
case 13:
|
|
491
|
-
return 53;
|
|
492
|
-
case 14:
|
|
493
|
-
return 76;
|
|
494
|
-
case 15:
|
|
495
|
-
return 4;
|
|
496
|
-
case 16:
|
|
497
|
-
return this.begin("block"), 16;
|
|
498
|
-
case 17:
|
|
499
|
-
return 52;
|
|
500
|
-
case 18:
|
|
501
|
-
return 52;
|
|
502
|
-
case 19:
|
|
503
|
-
return 45;
|
|
504
|
-
case 20:
|
|
505
|
-
return 14;
|
|
506
|
-
case 21:
|
|
507
|
-
return 12;
|
|
508
|
-
case 22:
|
|
509
|
-
break;
|
|
510
|
-
case 23:
|
|
511
|
-
return 65;
|
|
512
|
-
case 24:
|
|
513
|
-
return 61;
|
|
514
|
-
case 25:
|
|
515
|
-
return 61;
|
|
516
|
-
case 26:
|
|
517
|
-
this.begin("block_bq");
|
|
518
|
-
break;
|
|
519
|
-
case 27:
|
|
520
|
-
return 61;
|
|
521
|
-
case 28:
|
|
522
|
-
this.popState();
|
|
523
|
-
break;
|
|
524
|
-
case 29:
|
|
525
|
-
return 66;
|
|
526
|
-
case 30:
|
|
527
|
-
break;
|
|
528
|
-
case 31:
|
|
529
|
-
return this.popState(), 18;
|
|
530
|
-
case 32:
|
|
531
|
-
return u.yytext[0];
|
|
532
|
-
case 33:
|
|
533
|
-
return 19;
|
|
534
|
-
case 34:
|
|
535
|
-
return 20;
|
|
536
|
-
case 35:
|
|
537
|
-
return this.begin("style"), 47;
|
|
538
|
-
case 36:
|
|
539
|
-
return this.popState(), 9;
|
|
540
|
-
case 37:
|
|
541
|
-
break;
|
|
542
|
-
case 38:
|
|
543
|
-
return 12;
|
|
544
|
-
case 39:
|
|
545
|
-
return 45;
|
|
546
|
-
case 40:
|
|
547
|
-
return 52;
|
|
548
|
-
case 41:
|
|
549
|
-
return this.begin("style"), 41;
|
|
550
|
-
case 42:
|
|
551
|
-
return 46;
|
|
552
|
-
case 43:
|
|
553
|
-
return 34;
|
|
554
|
-
case 44:
|
|
555
|
-
return 33;
|
|
556
|
-
case 45:
|
|
557
|
-
return 69;
|
|
558
|
-
case 46:
|
|
559
|
-
return 71;
|
|
560
|
-
case 47:
|
|
561
|
-
return 71;
|
|
562
|
-
case 48:
|
|
563
|
-
return 71;
|
|
564
|
-
case 49:
|
|
565
|
-
return 69;
|
|
566
|
-
case 50:
|
|
567
|
-
return 69;
|
|
568
|
-
case 51:
|
|
569
|
-
return 70;
|
|
570
|
-
case 52:
|
|
571
|
-
return 70;
|
|
572
|
-
case 53:
|
|
573
|
-
return 70;
|
|
574
|
-
case 54:
|
|
575
|
-
return 70;
|
|
576
|
-
case 55:
|
|
577
|
-
return 70;
|
|
578
|
-
case 56:
|
|
579
|
-
return 71;
|
|
580
|
-
case 57:
|
|
581
|
-
return 70;
|
|
582
|
-
case 58:
|
|
583
|
-
return 71;
|
|
584
|
-
case 59:
|
|
585
|
-
return 72;
|
|
586
|
-
case 60:
|
|
587
|
-
return 72;
|
|
588
|
-
case 61:
|
|
589
|
-
return 54;
|
|
590
|
-
case 62:
|
|
591
|
-
return 72;
|
|
592
|
-
case 63:
|
|
593
|
-
return 72;
|
|
594
|
-
case 64:
|
|
595
|
-
return 72;
|
|
596
|
-
case 65:
|
|
597
|
-
return 55;
|
|
598
|
-
case 66:
|
|
599
|
-
return 51;
|
|
600
|
-
case 67:
|
|
601
|
-
return 72;
|
|
602
|
-
case 68:
|
|
603
|
-
return 69;
|
|
604
|
-
case 69:
|
|
605
|
-
return 70;
|
|
606
|
-
case 70:
|
|
607
|
-
return 71;
|
|
608
|
-
case 71:
|
|
609
|
-
return 73;
|
|
610
|
-
case 72:
|
|
611
|
-
return 74;
|
|
612
|
-
case 73:
|
|
613
|
-
return 75;
|
|
614
|
-
case 74:
|
|
615
|
-
return 75;
|
|
616
|
-
case 75:
|
|
617
|
-
return 74;
|
|
618
|
-
case 76:
|
|
619
|
-
return 74;
|
|
620
|
-
case 77:
|
|
621
|
-
return 74;
|
|
622
|
-
case 78:
|
|
623
|
-
return 44;
|
|
624
|
-
case 79:
|
|
625
|
-
return 50;
|
|
626
|
-
case 80:
|
|
627
|
-
return 43;
|
|
628
|
-
case 81:
|
|
629
|
-
return u.yytext[0];
|
|
630
|
-
case 82:
|
|
631
|
-
return 6;
|
|
632
|
-
}
|
|
633
|
-
}, "anonymous"),
|
|
634
|
-
rules: [/^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:[ \t\r]+)/i, /^(?:[\n]+)/i, /^(?:"[^"%\r\n\v\b\\]+")/i, /^(?:"[^"]*")/i, /^(?:erDiagram\b)/i, /^(?:\{)/i, /^(?:#)/i, /^(?:#)/i, /^(?:,)/i, /^(?::::)/i, /^(?::)/i, /^(?:\s+)/i, /^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i, /^(?:([^\s]*)[~].*[~]([^\s]*))/i, /^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i, /^(?:[`])/i, /^(?:[^`]+)/i, /^(?:[`])/i, /^(?:"[^"]*")/i, /^(?:[\n]+)/i, /^(?:\})/i, /^(?:.)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:style\b)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?::)/i, /^(?:,)/i, /^(?:#)/i, /^(?:classDef\b)/i, /^(?:class\b)/i, /^(?:subgraph\b)/i, /^(?:end\b\s*)/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, /^(?:[0-9]+\.[0-9]+)/i, /^(?:1(?=\s+[A-Za-z_"']))/i, /^(?:1(?=\s+[0-9]))/i, /^(?:1(?=(--|\.\.|\.-|-\.)))/i, /^(?:1\b)/i, /^(?:[0-9]+)/i, /^(?:\|\|)/i, /^(?:o\|)/i, /^(?:o\{)/i, /^(?:\|\{)/i, /^(?:u(?=[\.\-\|]))/i, /^(?:\.\.)/i, /^(?:--)/i, /^(?:to\b)/i, /^(?:optionally to\b)/i, /^(?:\.-)/i, /^(?:-\.)/i, /^(?:([^\x00-\x7F]|\w|-|\*)+)/i, /^(?:;)/i, /^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i, /^(?:.)/i, /^(?:$)/i],
|
|
635
|
-
conditions: { style: { rules: [36, 37, 38, 39, 40, 78, 79], inclusive: !1 }, acc_descr_multiline: { rules: [5, 6], inclusive: !1 }, acc_descr: { rules: [3], inclusive: !1 }, acc_title: { rules: [1], inclusive: !1 }, block_bq: { rules: [27, 28], inclusive: !1 }, block: { rules: [22, 23, 24, 25, 26, 29, 30, 31, 32], inclusive: !1 }, INITIAL: { rules: [0, 2, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 33, 34, 35, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82], inclusive: !0 } }
|
|
636
|
-
};
|
|
637
|
-
return V;
|
|
638
|
-
})();
|
|
639
|
-
yt.lexer = Bt;
|
|
640
|
-
function ot() {
|
|
641
|
-
this.yy = {};
|
|
642
|
-
}
|
|
643
|
-
return p(ot, "Parser"), ot.prototype = yt, yt.Parser = ot, new ot();
|
|
644
|
-
})();
|
|
645
|
-
Tt.parser = Tt;
|
|
646
|
-
var he = Tt, ue = class {
|
|
647
|
-
constructor() {
|
|
648
|
-
this.entities = /* @__PURE__ */ new Map(), this.relationships = [], this.classes = /* @__PURE__ */ new Map(), this.subgraphDepth = 0, this.subGraphs = [], this.subGraphLookup = /* @__PURE__ */ new Map(), this.subCount = 0, this.direction = "TB", this.Cardinality = {
|
|
649
|
-
ZERO_OR_ONE: "ZERO_OR_ONE",
|
|
650
|
-
ZERO_OR_MORE: "ZERO_OR_MORE",
|
|
651
|
-
ONE_OR_MORE: "ONE_OR_MORE",
|
|
652
|
-
ONLY_ONE: "ONLY_ONE",
|
|
653
|
-
MD_PARENT: "MD_PARENT"
|
|
654
|
-
}, this.Identification = {
|
|
655
|
-
NON_IDENTIFYING: "NON_IDENTIFYING",
|
|
656
|
-
IDENTIFYING: "IDENTIFYING"
|
|
657
|
-
}, this.setAccTitle = Kt, this.getAccTitle = Zt, this.setAccDescription = jt, this.getAccDescription = qt, this.setDiagramTitle = Wt, this.getDiagramTitle = Ht, this.getConfig = /* @__PURE__ */ p(() => $().er, "getConfig"), this.clear(), this.addEntity = this.addEntity.bind(this), this.addAttributes = this.addAttributes.bind(this), this.addRelationship = this.addRelationship.bind(this), this.setDirection = this.setDirection.bind(this), this.addCssStyles = this.addCssStyles.bind(this), this.addClass = this.addClass.bind(this), this.setClass = this.setClass.bind(this), this.setAccTitle = this.setAccTitle.bind(this), this.setAccDescription = this.setAccDescription.bind(this), this.addSubGraph = this.addSubGraph.bind(this);
|
|
658
|
-
}
|
|
659
|
-
static {
|
|
660
|
-
p(this, "ErDB");
|
|
661
|
-
}
|
|
662
|
-
/**
|
|
663
|
-
* Add entity
|
|
664
|
-
* @param name - The name of the entity
|
|
665
|
-
* @param alias - The alias of the entity
|
|
666
|
-
*/
|
|
667
|
-
addEntity(e, a = "") {
|
|
668
|
-
return this.entities.has(e) ? !this.entities.get(e)?.alias && a && (this.entities.get(e).alias = a, M.info(`Add alias '${a}' to entity '${e}'`)) : (this.entities.set(e, {
|
|
669
|
-
id: `entity-${e}-${this.entities.size}`,
|
|
670
|
-
label: e,
|
|
671
|
-
attributes: [],
|
|
672
|
-
alias: a,
|
|
673
|
-
shape: "erBox",
|
|
674
|
-
look: $().look ?? "default",
|
|
675
|
-
cssClasses: "default",
|
|
676
|
-
cssStyles: [],
|
|
677
|
-
labelType: "markdown"
|
|
678
|
-
}), M.info("Added new entity :", e)), this.entities.get(e);
|
|
679
|
-
}
|
|
680
|
-
getEntity(e) {
|
|
681
|
-
return this.entities.get(e);
|
|
682
|
-
}
|
|
683
|
-
getEntities() {
|
|
684
|
-
return this.entities;
|
|
685
|
-
}
|
|
686
|
-
getClasses() {
|
|
687
|
-
return this.classes;
|
|
688
|
-
}
|
|
689
|
-
addAttributes(e, a) {
|
|
690
|
-
const h = this.addEntity(e);
|
|
691
|
-
let r;
|
|
692
|
-
for (r = a.length - 1; r >= 0; r--)
|
|
693
|
-
a[r].keys || (a[r].keys = []), a[r].comment || (a[r].comment = ""), h.attributes.push(a[r]), M.debug("Added attribute ", a[r].name);
|
|
694
|
-
}
|
|
695
|
-
/**
|
|
696
|
-
* Add a relationship
|
|
697
|
-
*
|
|
698
|
-
* @param entA - The first entity in the relationship
|
|
699
|
-
* @param rolA - The role played by the first entity in relation to the second
|
|
700
|
-
* @param entB - The second entity in the relationship
|
|
701
|
-
* @param rSpec - The details of the relationship between the two entities
|
|
702
|
-
*/
|
|
703
|
-
addRelationship(e, a, h, r) {
|
|
704
|
-
let c;
|
|
705
|
-
if (this.subGraphLookup.has(e))
|
|
706
|
-
c = e;
|
|
707
|
-
else {
|
|
708
|
-
const b = this.addEntity(e);
|
|
709
|
-
if (!b)
|
|
710
|
-
return;
|
|
711
|
-
c = b.id;
|
|
712
|
-
}
|
|
713
|
-
let f;
|
|
714
|
-
if (this.subGraphLookup.has(h))
|
|
715
|
-
f = h;
|
|
716
|
-
else {
|
|
717
|
-
const b = this.addEntity(h);
|
|
718
|
-
if (!b)
|
|
719
|
-
return;
|
|
720
|
-
f = b.id;
|
|
721
|
-
}
|
|
722
|
-
const k = {
|
|
723
|
-
entityA: c,
|
|
724
|
-
roleA: a,
|
|
725
|
-
entityB: f,
|
|
726
|
-
relSpec: r
|
|
727
|
-
};
|
|
728
|
-
this.relationships.push(k), M.debug("Added new relationship :", k);
|
|
729
|
-
}
|
|
730
|
-
getRelationships() {
|
|
731
|
-
return this.relationships;
|
|
732
|
-
}
|
|
733
|
-
getDirection() {
|
|
734
|
-
return this.direction;
|
|
735
|
-
}
|
|
736
|
-
setDirection(e) {
|
|
737
|
-
this.direction = e;
|
|
738
|
-
}
|
|
739
|
-
getCompiledStyles(e) {
|
|
740
|
-
let a = [];
|
|
741
|
-
for (const h of e) {
|
|
742
|
-
const r = this.classes.get(h);
|
|
743
|
-
r?.styles && (a = [...a, ...r.styles ?? []].map((c) => c.trim())), r?.textStyles && (a = [...a, ...r.textStyles ?? []].map((c) => c.trim()));
|
|
744
|
-
}
|
|
745
|
-
return a;
|
|
746
|
-
}
|
|
747
|
-
addCssStyles(e, a) {
|
|
748
|
-
for (const h of e) {
|
|
749
|
-
const r = this.entities.get(h), c = this.subGraphLookup.get(h);
|
|
750
|
-
if (a) {
|
|
751
|
-
if (r)
|
|
752
|
-
for (const f of a)
|
|
753
|
-
r.cssStyles.push(f);
|
|
754
|
-
if (c) {
|
|
755
|
-
c.cssStyles || (c.cssStyles = []);
|
|
756
|
-
for (const f of a)
|
|
757
|
-
c.cssStyles.push(f);
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
addClass(e, a) {
|
|
763
|
-
e.forEach((h) => {
|
|
764
|
-
let r = this.classes.get(h);
|
|
765
|
-
r === void 0 && (r = { id: h, styles: [], textStyles: [] }, this.classes.set(h, r)), a && a.forEach(function(c) {
|
|
766
|
-
if (/color/.exec(c)) {
|
|
767
|
-
const f = c.replace("fill", "bgFill");
|
|
768
|
-
r.textStyles.push(f);
|
|
769
|
-
}
|
|
770
|
-
r.styles.push(c);
|
|
771
|
-
});
|
|
772
|
-
});
|
|
773
|
-
}
|
|
774
|
-
addSubGraph(e, a, h) {
|
|
775
|
-
let r = e.text.trim(), c = h.text;
|
|
776
|
-
const k = (/* @__PURE__ */ p((g) => {
|
|
777
|
-
const O = /* @__PURE__ */ new Set();
|
|
778
|
-
let B;
|
|
779
|
-
return { nodeList: g.filter((E) => {
|
|
780
|
-
if (E?.stmt)
|
|
781
|
-
return E.stmt === "dir" && (B = E.value), !1;
|
|
782
|
-
if (typeof E != "string")
|
|
783
|
-
return !1;
|
|
784
|
-
const A = E.trim();
|
|
785
|
-
return !A || O.has(A) ? !1 : (O.add(A), !0);
|
|
786
|
-
}), dir: B };
|
|
787
|
-
}, "uniq"))(a.flat()), b = k.nodeList, m = k.dir;
|
|
788
|
-
r = r ?? "subGraph" + this.subCount, c = c || "", c = this.sanitizeText(c), this.subCount = this.subCount + 1;
|
|
789
|
-
const d = {
|
|
790
|
-
id: r,
|
|
791
|
-
nodes: b,
|
|
792
|
-
title: c.trim(),
|
|
793
|
-
classes: [],
|
|
794
|
-
cssStyles: [],
|
|
795
|
-
dir: m,
|
|
796
|
-
labelType: this.sanitizeNodeLabelType(h?.type)
|
|
797
|
-
};
|
|
798
|
-
return M.info("Adding", d.id, d.nodes, d.dir), d.nodes = this.makeUniq(d, this.subGraphs).nodes, this.subGraphs.push(d), this.subGraphLookup.set(r, d), r;
|
|
799
|
-
}
|
|
800
|
-
getSubGraphs() {
|
|
801
|
-
return this.subGraphs;
|
|
802
|
-
}
|
|
803
|
-
setClass(e, a) {
|
|
804
|
-
for (const h of e) {
|
|
805
|
-
const r = this.entities.get(h);
|
|
806
|
-
if (r)
|
|
807
|
-
for (const f of a)
|
|
808
|
-
r.cssClasses += " " + f;
|
|
809
|
-
const c = this.subGraphLookup.get(h);
|
|
810
|
-
if (c)
|
|
811
|
-
for (const f of a)
|
|
812
|
-
c.classes.push(f);
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
/**
|
|
816
|
-
* Build a quick lookup for all node IDs already assigned to existing subgraphs.
|
|
817
|
-
*/
|
|
818
|
-
subgraphNodeCache(e) {
|
|
819
|
-
const a = /* @__PURE__ */ new Set();
|
|
820
|
-
for (const h of e)
|
|
821
|
-
for (const r of h.nodes)
|
|
822
|
-
a.add(r);
|
|
823
|
-
return a;
|
|
824
|
-
}
|
|
825
|
-
/**
|
|
826
|
-
* Filter out nodes that are already part of another subgraph,
|
|
827
|
-
* keeping subgraph membership unique.
|
|
828
|
-
*/
|
|
829
|
-
makeUniq(e, a) {
|
|
830
|
-
const h = this.subgraphNodeCache(a), r = [];
|
|
831
|
-
return e.nodes.forEach((c, f) => {
|
|
832
|
-
h.has(c) ? M.warn(`Entity '${c}' already belongs to another subgraph and will be ignored`) : r.push(e.nodes[f]);
|
|
833
|
-
}), { nodes: r };
|
|
834
|
-
}
|
|
835
|
-
sanitizeText(e) {
|
|
836
|
-
return Qt.sanitizeText(e, $());
|
|
837
|
-
}
|
|
838
|
-
sanitizeNodeLabelType(e) {
|
|
839
|
-
switch (e) {
|
|
840
|
-
case "markdown":
|
|
841
|
-
case "string":
|
|
842
|
-
case "text":
|
|
843
|
-
return e;
|
|
844
|
-
default:
|
|
845
|
-
return "markdown";
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
clear() {
|
|
849
|
-
this.entities = /* @__PURE__ */ new Map(), this.classes = /* @__PURE__ */ new Map(), this.relationships = [], this.subGraphs = [], this.subGraphLookup = /* @__PURE__ */ new Map(), this.subCount = 0, this.subgraphDepth = 0, Xt();
|
|
850
|
-
}
|
|
851
|
-
getData() {
|
|
852
|
-
const e = [], a = [], h = $(), r = this.getSubGraphs(), c = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
853
|
-
for (let d = r.length - 1; d >= 0; d--) {
|
|
854
|
-
const g = r[d];
|
|
855
|
-
g.nodes.length > 0 && f.set(g.id, !0);
|
|
856
|
-
for (const O of g.nodes)
|
|
857
|
-
c.set(O, g.id);
|
|
858
|
-
}
|
|
859
|
-
for (let d = r.length - 1; d >= 0; d--) {
|
|
860
|
-
const g = r[d];
|
|
861
|
-
e.push({
|
|
862
|
-
id: g.id,
|
|
863
|
-
label: g.title,
|
|
864
|
-
labelStyle: "",
|
|
865
|
-
labelType: g.labelType,
|
|
866
|
-
parentId: c.get(g.id),
|
|
867
|
-
padding: 8,
|
|
868
|
-
cssCompiledStyles: this.getCompiledStyles(g.classes),
|
|
869
|
-
cssStyles: g.cssStyles,
|
|
870
|
-
cssClasses: g.classes.join(" "),
|
|
871
|
-
shape: "rect",
|
|
872
|
-
dir: g.dir,
|
|
873
|
-
isGroup: !0,
|
|
874
|
-
look: h.look
|
|
875
|
-
});
|
|
876
|
-
}
|
|
877
|
-
const k = new Set(r.map((d) => d.id));
|
|
878
|
-
let b = 0;
|
|
879
|
-
for (const d of this.entities.keys()) {
|
|
880
|
-
if (k.has(d))
|
|
881
|
-
continue;
|
|
882
|
-
const g = this.entities.get(d);
|
|
883
|
-
g && (g.cssCompiledStyles = this.getCompiledStyles(g.cssClasses.split(" ")), g.colorIndex = b++, e.push({
|
|
884
|
-
...g,
|
|
885
|
-
parentId: c.get(d),
|
|
886
|
-
isGroup: !1
|
|
887
|
-
}));
|
|
888
|
-
}
|
|
889
|
-
let m = 0;
|
|
890
|
-
for (const d of this.relationships) {
|
|
891
|
-
const g = {
|
|
892
|
-
id: Jt(d.entityA, d.entityB, {
|
|
893
|
-
prefix: "id",
|
|
894
|
-
counter: m++
|
|
895
|
-
}),
|
|
896
|
-
type: "normal",
|
|
897
|
-
curve: "basis",
|
|
898
|
-
start: d.entityA,
|
|
899
|
-
end: d.entityB,
|
|
900
|
-
label: d.roleA,
|
|
901
|
-
labelpos: "c",
|
|
902
|
-
thickness: "normal",
|
|
903
|
-
classes: "relationshipLine",
|
|
904
|
-
arrowTypeStart: d.relSpec.cardB.toLowerCase(),
|
|
905
|
-
arrowTypeEnd: d.relSpec.cardA.toLowerCase(),
|
|
906
|
-
pattern: d.relSpec.relType == "IDENTIFYING" ? "solid" : "dashed",
|
|
907
|
-
look: h.look,
|
|
908
|
-
labelType: "markdown"
|
|
909
|
-
};
|
|
910
|
-
a.push(g);
|
|
911
|
-
}
|
|
912
|
-
return { nodes: e, edges: a, other: {}, config: h, direction: this.direction };
|
|
913
|
-
}
|
|
914
|
-
}, Mt = {};
|
|
915
|
-
re(Mt, {
|
|
916
|
-
draw: () => de
|
|
917
|
-
});
|
|
918
|
-
var de = /* @__PURE__ */ p(async function(e, a, h, r) {
|
|
919
|
-
M.info("REF0:"), M.info("Drawing er diagram (unified)", a);
|
|
920
|
-
const { securityLevel: c, er: f, layout: k } = $(), b = r.db.getData(), m = zt(a, c);
|
|
921
|
-
b.type = r.type, b.layoutAlgorithm = ne(k), b.config.flowchart.nodeSpacing = f?.nodeSpacing || 140, b.config.flowchart.rankSpacing = f?.rankSpacing || 80, b.direction = r.db.getDirection();
|
|
922
|
-
const { config: d } = b, { look: g } = d;
|
|
923
|
-
g === "neo" ? b.markers = [
|
|
924
|
-
"only_one_neo",
|
|
925
|
-
"zero_or_one_neo",
|
|
926
|
-
"one_or_more_neo",
|
|
927
|
-
"zero_or_more_neo"
|
|
928
|
-
] : b.markers = ["only_one", "zero_or_one", "one_or_more", "zero_or_more"], b.diagramId = a, await ae(b, m);
|
|
929
|
-
const O = m.selectAll('[id*="-background"]');
|
|
930
|
-
Array.from(O).length > 0 && O.each(function() {
|
|
931
|
-
const Y = oe(this), A = Y.attr("id").replace("-background", ""), U = m.select(`#${CSS.escape(A)}`);
|
|
932
|
-
if (!U.empty()) {
|
|
933
|
-
const N = U.attr("transform");
|
|
934
|
-
Y.attr("transform", N);
|
|
935
|
-
}
|
|
936
|
-
});
|
|
937
|
-
const B = 8;
|
|
938
|
-
ce.insertTitle(
|
|
939
|
-
m,
|
|
940
|
-
"erDiagramTitleText",
|
|
941
|
-
f?.titleTopMargin ?? 25,
|
|
942
|
-
r.db.getDiagramTitle()
|
|
943
|
-
), Ut(m, B, "erDiagram", f?.useMaxWidth ?? !0);
|
|
944
|
-
}, "draw"), Vt = /* @__PURE__ */ p((e, a) => {
|
|
945
|
-
const h = le, r = h(e, "r"), c = h(e, "g"), f = h(e, "b");
|
|
946
|
-
return ie(r, c, f, a);
|
|
947
|
-
}, "fade"), pe = /* @__PURE__ */ p((e) => {
|
|
948
|
-
const { theme: a, bkgColorArray: h, borderColorArray: r } = e;
|
|
949
|
-
if (!$t(a, r))
|
|
950
|
-
return "";
|
|
951
|
-
const c = te(e.look), f = ee(h);
|
|
952
|
-
let k = "";
|
|
953
|
-
for (let b = 0; b < se(r); b++) {
|
|
954
|
-
const m = r[b], d = f ? `fill: ${h[b % h.length]};` : "";
|
|
955
|
-
k += `
|
|
956
|
-
|
|
957
|
-
[data-look="${c}"][data-color-id="color-${b}"].node path {
|
|
958
|
-
stroke: ${m};
|
|
959
|
-
${d}
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
[data-look="${c}"][data-color-id="color-${b}"].node rect {
|
|
963
|
-
stroke: ${m};
|
|
964
|
-
${d}
|
|
965
|
-
}
|
|
966
|
-
`;
|
|
967
|
-
}
|
|
968
|
-
return k;
|
|
969
|
-
}, "genColor"), fe = /* @__PURE__ */ p((e) => {
|
|
970
|
-
const { look: a, theme: h, erEdgeLabelBackground: r, strokeWidth: c } = e;
|
|
971
|
-
return `
|
|
972
|
-
${pe(e)}
|
|
973
|
-
.entityBox {
|
|
974
|
-
fill: ${e.mainBkg};
|
|
975
|
-
stroke: ${e.nodeBorder};
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
.relationshipLabelBox {
|
|
979
|
-
fill: ${e.tertiaryColor};
|
|
980
|
-
opacity: 0.7;
|
|
981
|
-
background-color: ${e.tertiaryColor};
|
|
982
|
-
rect {
|
|
983
|
-
opacity: 0.5;
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
.labelBkg {
|
|
988
|
-
background-color: ${St.has(h) && r ? r : Vt(e.tertiaryColor, 0.5)};
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
.edgeLabel {
|
|
992
|
-
background-color: ${St.has(h) && r ? r : e.edgeLabelBackground};
|
|
993
|
-
}
|
|
994
|
-
.edgeLabel .label rect {
|
|
995
|
-
fill: ${St.has(h) && r ? r : e.edgeLabelBackground};
|
|
996
|
-
}
|
|
997
|
-
.edgeLabel .label text {
|
|
998
|
-
fill: ${e.textColor};
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
.edgeLabel .label {
|
|
1002
|
-
fill: ${e.nodeBorder};
|
|
1003
|
-
font-size: 14px;
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
.label {
|
|
1007
|
-
font-family: ${e.fontFamily};
|
|
1008
|
-
color: ${e.nodeTextColor || e.textColor};
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
.edge-pattern-dashed {
|
|
1012
|
-
stroke-dasharray: 8,8;
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
.node rect,
|
|
1016
|
-
.node circle,
|
|
1017
|
-
.node ellipse,
|
|
1018
|
-
.node polygon
|
|
1019
|
-
{
|
|
1020
|
-
fill: ${e.mainBkg};
|
|
1021
|
-
stroke: ${e.nodeBorder};
|
|
1022
|
-
stroke-width: ${a === "neo" ? c : "1px"};
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
.relationshipLine {
|
|
1026
|
-
stroke: ${e.lineColor};
|
|
1027
|
-
stroke-width: ${a === "neo" ? c : "1px"};
|
|
1028
|
-
fill: none;
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
.marker {
|
|
1032
|
-
fill: none !important;
|
|
1033
|
-
stroke: ${e.lineColor} !important;
|
|
1034
|
-
stroke-width: 1;
|
|
1035
|
-
}
|
|
1036
|
-
[data-look=neo].labelBkg {
|
|
1037
|
-
background-color: ${Vt(e.tertiaryColor, 0.5)};
|
|
1038
|
-
}
|
|
1039
|
-
|
|
1040
|
-
.cluster rect {
|
|
1041
|
-
fill: ${e.clusterBkg ?? e.mainBkg};
|
|
1042
|
-
stroke: ${e.clusterBorder ?? e.nodeBorder};
|
|
1043
|
-
stroke-width: 1px;
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
.cluster text {
|
|
1047
|
-
fill: ${e.titleColor ?? e.textColor};
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
|
-
.cluster-label text {
|
|
1051
|
-
fill: ${e.titleColor ?? e.textColor};
|
|
1052
|
-
}
|
|
1053
|
-
`;
|
|
1054
|
-
}, "getStyles"), be = fe, me = {
|
|
1055
|
-
parser: he,
|
|
1056
|
-
get db() {
|
|
1057
|
-
return new ue();
|
|
1058
|
-
},
|
|
1059
|
-
renderer: Mt,
|
|
1060
|
-
styles: be
|
|
1061
|
-
};
|
|
1062
|
-
export {
|
|
1063
|
-
me as diagram
|
|
1064
|
-
};
|