@life-exe/wiki-engine 0.1.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/LICENSE +21 -0
- package/README.md +180 -0
- package/dist/analytics/index.d.ts +10 -0
- package/dist/chunks/abnfDiagram-VCTEODGH-DyAP6Aua.js +87 -0
- package/dist/chunks/arc-OroUeRL_.js +83 -0
- package/dist/chunks/architectureDiagram-5GKGNRK7-FjmrDCl4.js +4784 -0
- package/dist/chunks/blockDiagram-I7D4REHJ-BF3oIDlI.js +1416 -0
- package/dist/chunks/c4Diagram-7LVT6UL2-Cmdq0LZr.js +1511 -0
- package/dist/chunks/channel-Bdy1QZHo.js +5 -0
- package/dist/chunks/chunk-2Q5K7J3B-BwxRSEKd.js +15 -0
- package/dist/chunks/chunk-5VM5RSS4-BtHwUU4T.js +19 -0
- package/dist/chunks/chunk-F27PBJKO-DF4TGftR.js +68 -0
- package/dist/chunks/chunk-IMKFNOWR-DkBQ-1aV.js +1421 -0
- package/dist/chunks/chunk-JWPE2WC7-BIokdAUW.js +9 -0
- package/dist/chunks/chunk-POPQ4Y6H-CcjOsf9X.js +20 -0
- package/dist/chunks/chunk-SHT3W25Y-lYp5BdEg.js +1695 -0
- package/dist/chunks/chunk-SVP7TREG-DN-ravNt.js +664 -0
- package/dist/chunks/chunk-TICWLB2K-CtTJ0xaY.js +1534 -0
- package/dist/chunks/chunk-XXDRQBXY-BovkWFC0.js +8 -0
- package/dist/chunks/classDiagram-ZZMXUADV-CMYS0pHw.js +16 -0
- package/dist/chunks/classDiagram-v2-VYDZK3BY-CMYS0pHw.js +16 -0
- package/dist/chunks/common-BJ4q25wy.js +12633 -0
- package/dist/chunks/cose-bilkent-JH36ORCC-CaMqpJY7.js +2608 -0
- package/dist/chunks/cynefin-OW5HDTMX-Bzjecpt-.js +23853 -0
- package/dist/chunks/cynefinDiagram-5FMLGOSQ-C0NuKLt0.js +299 -0
- package/dist/chunks/cytoscape.esm-DmPrb1GM.js +18787 -0
- package/dist/chunks/dagre-GXQ25YYZ-Ds09_NdN.js +461 -0
- package/dist/chunks/defaultLocale-BgPVtth8.js +171 -0
- package/dist/chunks/diagram-S7CK7UJ4-IvSazk1O.js +349 -0
- package/dist/chunks/diagram-UQ7AKVKN-58epdx5V.js +223 -0
- package/dist/chunks/diagram-VSXAHHWV-BrzRGMeV.js +466 -0
- package/dist/chunks/diagram-VX7I27RA-DPL0Nw6d.js +530 -0
- package/dist/chunks/diagram-Z3DM3KII-8VWVu0I5.js +143 -0
- package/dist/chunks/ebnfDiagram-PWID7BFC-DeByR_ze.js +109 -0
- package/dist/chunks/erDiagram-RLTQ6QDP-C9uo9iE1.js +1060 -0
- package/dist/chunks/flowDiagram-HODETNUW-BpoY3OMp.js +7 -0
- package/dist/chunks/ganttDiagram-EL5Y4UJY-psdwnC-T.js +2711 -0
- package/dist/chunks/gitGraphDiagram-WWUBYQGX-vsDfkn_Q.js +828 -0
- package/dist/chunks/index-f7Uzykhj.js +38262 -0
- package/dist/chunks/infoDiagram-27XIBGKW-8K-eQZiU.js +24 -0
- package/dist/chunks/init-DjUOC4st.js +16 -0
- package/dist/chunks/ishikawaDiagram-5VMMS53U-CuqR1k5i.js +622 -0
- package/dist/chunks/journeyDiagram-3NMN7TZE-BPW1nmwZ.js +834 -0
- package/dist/chunks/kanban-definition-UXKFOSKX-iY6-d6jO.js +726 -0
- package/dist/chunks/katex-jHfnQmlp.js +11682 -0
- package/dist/chunks/layout-CgV9vOdp.js +1704 -0
- package/dist/chunks/linear-BzcaSMTS.js +259 -0
- package/dist/chunks/mindmap-definition-YA3MSWOX-CaLfHyv0.js +831 -0
- package/dist/chunks/ordinal-DfAQgscy.js +61 -0
- package/dist/chunks/pegDiagram-XKGWAZYB-6Y28VvVh.js +95 -0
- package/dist/chunks/pieDiagram-E7YTZNPT-OrjeRxhs.js +209 -0
- package/dist/chunks/quadrantDiagram-AXDQQJYC-rgw2lV2J.js +1025 -0
- package/dist/chunks/railroadDiagram-O6MQD6OU-D6QNO5r1.js +77 -0
- package/dist/chunks/requirementDiagram-BXWQKSXE-a8tNRSuE.js +884 -0
- package/dist/chunks/sankeyDiagram-P5KCCOFB-CdaC8rLw.js +847 -0
- package/dist/chunks/sequenceDiagram-WJ2MYXX4-CGLi38Hj.js +2898 -0
- package/dist/chunks/sizeCapture-INFHLROL-g5RJXnik.js +47 -0
- package/dist/chunks/stateDiagram-D77RDMKH-Cou0eVl1.js +262 -0
- package/dist/chunks/stateDiagram-v2-MP3YSRHH-BHQspnUg.js +16 -0
- package/dist/chunks/swimlanes-42K2YHIH-BU7S1WgJ.js +5239 -0
- package/dist/chunks/swimlanesDiagram-VR7AAH4N-BsEplbno.js +13 -0
- package/dist/chunks/timeline-definition-24CTP7MA-BB-IyxWL.js +1066 -0
- package/dist/chunks/vennDiagram-4TSXK5OY-BToYolPI.js +1585 -0
- package/dist/chunks/wardleyDiagram-VM6X3IG4-BgoueOw_.js +684 -0
- package/dist/chunks/xychartDiagram-S5SC5T6Z-CF0fWv-W.js +1492 -0
- package/dist/components/CodeBlock.d.ts +5 -0
- package/dist/components/CommunityLinks.d.ts +21 -0
- package/dist/components/CookieConsent.d.ts +2 -0
- package/dist/components/DocLinkCard.d.ts +6 -0
- package/dist/components/LecturePageView.d.ts +3 -0
- package/dist/components/MermaidDiagram.d.ts +3 -0
- package/dist/components/SearchPopup.d.ts +6 -0
- package/dist/components/WikiApp.d.ts +9 -0
- package/dist/components/WikiLayout.d.ts +2 -0
- package/dist/components/WikiPageView.d.ts +6 -0
- package/dist/components/ZoomableImage.d.ts +2 -0
- package/dist/context/LangContext.d.ts +2 -0
- package/dist/context/WikiContext.d.ts +18 -0
- package/dist/data.d.ts +8 -0
- package/dist/hooks/useLanguage.d.ts +4 -0
- package/dist/hooks/useTheme.d.ts +5 -0
- package/dist/hooks/useWiki.d.ts +2 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +45 -0
- package/dist/languages/ue-cpp.d.ts +7 -0
- package/dist/languages/ue-cpp.js +21 -0
- package/dist/types.d.ts +119 -0
- package/dist/wiki-engine.css +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,1060 @@
|
|
|
1
|
+
import { g as Ut } from "./chunk-XXDRQBXY-BovkWFC0.js";
|
|
2
|
+
import { s as Kt } from "./chunk-POPQ4Y6H-CcjOsf9X.js";
|
|
3
|
+
import { _ as f, b as Zt, a as jt, s as qt, g as Wt, q as Ht, t as Qt, c as tt, l as F, k as Xt, A as Jt, y as $t, C as te, D as ee, p as se, r as ie, j as re, u as ne } from "./index-f7Uzykhj.js";
|
|
4
|
+
import { c as ae } from "./channel-Bdy1QZHo.js";
|
|
5
|
+
var Ot = (function() {
|
|
6
|
+
var s = /* @__PURE__ */ f(function(G, a, h, d) {
|
|
7
|
+
for (h = h || {}, d = G.length; d--; h[G[d]] = a) ;
|
|
8
|
+
return h;
|
|
9
|
+
}, "o"), n = [6, 9, 21, 23, 25, 27, 34, 37, 38, 39, 40, 41, 43, 46, 47, 51, 53, 54, 55], c = [2, 2], o = [1, 7], r = [1, 9], l = [1, 10], y = [1, 11], b = [1, 12], k = [1, 30], R = [1, 23], p = [1, 24], g = [1, 25], C = [1, 26], v = [1, 27], x = [1, 19], T = [1, 28], I = [1, 29], N = [1, 20], D = [1, 18], L = [1, 21], w = [1, 22], xt = [2, 6], u = [6, 9, 21, 23, 25, 27, 33, 34, 37, 38, 39, 40, 41, 43, 46, 47, 51, 53, 54, 55], pt = [1, 36], ft = [1, 37], bt = [1, 38], gt = [1, 39], yt = [1, 40], Z = [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], V = [1, 46], M = [1, 47], j = [1, 57], q = [43, 51, 53, 54, 55, 74, 75], W = [1, 70], H = [1, 68], B = [1, 65], Q = [1, 69], X = [1, 71], et = [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], st = [1, 78], it = [1, 77], rt = [1, 76], Nt = [69, 70, 71, 72, 73], Ct = [1, 91], It = [6, 9, 45, 50], z = [6, 9, 12, 44, 45, 50, 51, 52], nt = [1, 101], at = [1, 100], ot = [1, 99], J = [18, 61], At = [1, 110], Rt = [1, 109], vt = [20, 43, 51, 53, 54, 55], _t = [18, 61, 64, 66], kt = {
|
|
10
|
+
trace: /* @__PURE__ */ f(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__ */ f(function(a, h, d, i, _, t, $) {
|
|
17
|
+
var e = t.length - 1;
|
|
18
|
+
switch (_) {
|
|
19
|
+
case 1:
|
|
20
|
+
break;
|
|
21
|
+
case 2:
|
|
22
|
+
this.$ = [];
|
|
23
|
+
break;
|
|
24
|
+
case 3:
|
|
25
|
+
this.$ = t[e - 1].concat(t[e]);
|
|
26
|
+
break;
|
|
27
|
+
case 4:
|
|
28
|
+
this.$ = t[e];
|
|
29
|
+
break;
|
|
30
|
+
case 5:
|
|
31
|
+
case 6:
|
|
32
|
+
this.$ = [];
|
|
33
|
+
break;
|
|
34
|
+
case 7:
|
|
35
|
+
i.addEntity(t[e - 4]), i.addEntity(t[e - 2]), i.addRelationship(t[e - 4], t[e], t[e - 2], t[e - 3]), this.$ = [t[e - 4], t[e - 2]];
|
|
36
|
+
break;
|
|
37
|
+
case 8:
|
|
38
|
+
i.addEntity(t[e - 8]), i.addEntity(t[e - 4]), i.addRelationship(t[e - 8], t[e], t[e - 4], t[e - 5]), i.setClass([t[e - 8]], t[e - 6]), i.setClass([t[e - 4]], t[e - 2]), this.$ = [t[e - 8], t[e - 4]];
|
|
39
|
+
break;
|
|
40
|
+
case 9:
|
|
41
|
+
i.addEntity(t[e - 6]), i.addEntity(t[e - 2]), i.addRelationship(t[e - 6], t[e], t[e - 2], t[e - 3]), i.setClass([t[e - 6]], t[e - 4]), this.$ = [t[e - 6], t[e - 2]];
|
|
42
|
+
break;
|
|
43
|
+
case 10:
|
|
44
|
+
i.addEntity(t[e - 6]), i.addEntity(t[e - 4]), i.addRelationship(t[e - 6], t[e], t[e - 4], t[e - 5]), i.setClass([t[e - 4]], t[e - 2]), this.$ = [t[e - 6], t[e - 4]];
|
|
45
|
+
break;
|
|
46
|
+
case 11:
|
|
47
|
+
i.addEntity(t[e - 3]), i.addAttributes(t[e - 3], t[e - 1]), this.$ = [t[e - 3]];
|
|
48
|
+
break;
|
|
49
|
+
case 12:
|
|
50
|
+
i.addEntity(t[e - 5]), i.addAttributes(t[e - 5], t[e - 1]), i.setClass([t[e - 5]], t[e - 3]), this.$ = [t[e - 5]];
|
|
51
|
+
break;
|
|
52
|
+
case 13:
|
|
53
|
+
i.addEntity(t[e - 2]), this.$ = [t[e - 2]];
|
|
54
|
+
break;
|
|
55
|
+
case 14:
|
|
56
|
+
i.addEntity(t[e - 4]), i.setClass([t[e - 4]], t[e - 2]), this.$ = [t[e - 4]];
|
|
57
|
+
break;
|
|
58
|
+
case 15:
|
|
59
|
+
i.addEntity(t[e]), this.$ = [t[e]];
|
|
60
|
+
break;
|
|
61
|
+
case 16:
|
|
62
|
+
i.addEntity(t[e - 2]), i.setClass([t[e - 2]], t[e]), this.$ = [t[e - 2]];
|
|
63
|
+
break;
|
|
64
|
+
case 17:
|
|
65
|
+
i.addEntity(t[e - 6], t[e - 4]), i.addAttributes(t[e - 6], t[e - 1]), this.$ = [t[e - 6]];
|
|
66
|
+
break;
|
|
67
|
+
case 18:
|
|
68
|
+
i.addEntity(t[e - 8], t[e - 6]), i.addAttributes(t[e - 8], t[e - 1]), i.setClass([t[e - 8]], t[e - 3]), this.$ = [t[e - 8]];
|
|
69
|
+
break;
|
|
70
|
+
case 19:
|
|
71
|
+
i.addEntity(t[e - 5], t[e - 3]), this.$ = [t[e - 5]];
|
|
72
|
+
break;
|
|
73
|
+
case 20:
|
|
74
|
+
i.addEntity(t[e - 7], t[e - 5]), i.setClass([t[e - 7]], t[e - 2]), this.$ = [t[e - 7]];
|
|
75
|
+
break;
|
|
76
|
+
case 21:
|
|
77
|
+
i.addEntity(t[e - 3], t[e - 1]);
|
|
78
|
+
break;
|
|
79
|
+
case 22:
|
|
80
|
+
i.addEntity(t[e - 5], t[e - 3]), i.setClass([t[e - 5]], t[e]);
|
|
81
|
+
break;
|
|
82
|
+
case 23:
|
|
83
|
+
case 24:
|
|
84
|
+
this.$ = t[e].trim(), i.setAccTitle(this.$);
|
|
85
|
+
break;
|
|
86
|
+
case 25:
|
|
87
|
+
case 26:
|
|
88
|
+
this.$ = t[e].trim(), i.setAccDescription(this.$);
|
|
89
|
+
break;
|
|
90
|
+
case 27:
|
|
91
|
+
i.subgraphDepth ? this.$ = t[e] : (i.setDirection(t[e].value), this.$ = []);
|
|
92
|
+
break;
|
|
93
|
+
case 31:
|
|
94
|
+
i.subgraphDepth = (i.subgraphDepth || 1) - 1, this.$ = i.addSubGraph({ text: t[e - 2].id }, t[e - 1], { text: t[e - 2].text });
|
|
95
|
+
break;
|
|
96
|
+
case 32:
|
|
97
|
+
i.subgraphDepth = (i.subgraphDepth || 0) + 1, this.$ = { id: t[e - 1], text: t[e - 1] };
|
|
98
|
+
break;
|
|
99
|
+
case 33:
|
|
100
|
+
i.subgraphDepth = (i.subgraphDepth || 0) + 1, this.$ = { id: t[e - 4], text: t[e - 2] };
|
|
101
|
+
break;
|
|
102
|
+
case 34:
|
|
103
|
+
case 59:
|
|
104
|
+
case 60:
|
|
105
|
+
case 61:
|
|
106
|
+
case 62:
|
|
107
|
+
case 86:
|
|
108
|
+
this.$ = t[e];
|
|
109
|
+
break;
|
|
110
|
+
case 35:
|
|
111
|
+
this.$ = t[e - 1] + " " + t[e];
|
|
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[e - 3], i.addClass(t[e - 2], t[e - 1]);
|
|
127
|
+
break;
|
|
128
|
+
case 41:
|
|
129
|
+
case 42:
|
|
130
|
+
case 63:
|
|
131
|
+
case 72:
|
|
132
|
+
this.$ = [t[e]];
|
|
133
|
+
break;
|
|
134
|
+
case 43:
|
|
135
|
+
case 44:
|
|
136
|
+
this.$ = t[e - 2].concat([t[e]]);
|
|
137
|
+
break;
|
|
138
|
+
case 45:
|
|
139
|
+
this.$ = t[e - 2], i.setClass(t[e - 1], t[e]);
|
|
140
|
+
break;
|
|
141
|
+
case 46:
|
|
142
|
+
this.$ = t[e - 3], i.addCssStyles(t[e - 2], t[e - 1]);
|
|
143
|
+
break;
|
|
144
|
+
case 47:
|
|
145
|
+
this.$ = [t[e]];
|
|
146
|
+
break;
|
|
147
|
+
case 48:
|
|
148
|
+
t[e - 2].push(t[e]), this.$ = t[e - 2];
|
|
149
|
+
break;
|
|
150
|
+
case 50:
|
|
151
|
+
this.$ = t[e - 1] + t[e];
|
|
152
|
+
break;
|
|
153
|
+
case 58:
|
|
154
|
+
case 84:
|
|
155
|
+
case 85:
|
|
156
|
+
this.$ = t[e].replace(/"/g, "");
|
|
157
|
+
break;
|
|
158
|
+
case 64:
|
|
159
|
+
t[e].push(t[e - 1]), this.$ = t[e];
|
|
160
|
+
break;
|
|
161
|
+
case 65:
|
|
162
|
+
this.$ = { type: t[e - 1], name: t[e] };
|
|
163
|
+
break;
|
|
164
|
+
case 66:
|
|
165
|
+
this.$ = { type: t[e - 2], name: t[e - 1], keys: t[e] };
|
|
166
|
+
break;
|
|
167
|
+
case 67:
|
|
168
|
+
this.$ = { type: t[e - 2], name: t[e - 1], comment: t[e] };
|
|
169
|
+
break;
|
|
170
|
+
case 68:
|
|
171
|
+
this.$ = { type: t[e - 3], name: t[e - 2], keys: t[e - 1], comment: t[e] };
|
|
172
|
+
break;
|
|
173
|
+
case 69:
|
|
174
|
+
case 71:
|
|
175
|
+
case 74:
|
|
176
|
+
this.$ = t[e];
|
|
177
|
+
break;
|
|
178
|
+
case 70:
|
|
179
|
+
this.$ = t[e - 1] + t[e];
|
|
180
|
+
break;
|
|
181
|
+
case 73:
|
|
182
|
+
t[e - 2].push(t[e]), this.$ = t[e - 2];
|
|
183
|
+
break;
|
|
184
|
+
case 75:
|
|
185
|
+
this.$ = t[e].replace(/"/g, "");
|
|
186
|
+
break;
|
|
187
|
+
case 76:
|
|
188
|
+
this.$ = { cardA: t[e], relType: t[e - 1], cardB: t[e - 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] }, s(n, c, { 5: 3 }), { 6: [1, 4], 7: 5, 8: 6, 9: o, 10: 8, 21: r, 23: l, 25: y, 27: b, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 34: k, 37: R, 38: p, 39: g, 40: C, 41: v, 43: x, 46: T, 47: I, 51: N, 53: D, 54: L, 55: w }, s(n, xt, { 1: [2, 1] }), s(u, [2, 3]), s(u, [2, 4]), s(u, [2, 5]), s(u, [2, 15], { 11: 31, 67: 35, 14: [1, 32], 16: [1, 33], 19: [1, 34], 69: pt, 70: ft, 71: bt, 72: gt, 73: yt }), { 22: [1, 41] }, { 24: [1, 42] }, { 26: [1, 43] }, s(u, [2, 26]), s(u, [2, 27]), s(u, [2, 28]), s(u, [2, 29]), s(u, [2, 30]), s(u, c, { 5: 44 }), s(Z, [2, 58]), s(Z, [2, 59]), s(Z, [2, 60]), s(Z, [2, 61]), s(Z, [2, 62]), s(u, [2, 36]), s(u, [2, 37]), s(u, [2, 38]), s(u, [2, 39]), { 15: 45, 43: V, 44: M }, { 15: 48, 43: V, 44: M }, { 15: 49, 43: V, 44: M }, { 10: 50, 43: x, 51: N, 53: D, 54: L, 55: w }, { 10: 51, 43: x, 51: N, 53: D, 54: L, 55: w }, { 15: 52, 43: V, 44: M }, { 17: 53, 18: [1, 54], 56: 55, 57: 56, 61: j }, { 10: 58, 43: x, 51: N, 53: D, 54: L, 55: w }, { 68: 59, 74: [1, 60], 75: [1, 61] }, s(q, [2, 77]), s(q, [2, 78]), s(q, [2, 79]), s(q, [2, 80]), s(q, [2, 81]), s(u, [2, 23]), s(u, [2, 24]), s(u, [2, 25]), { 6: [1, 63], 7: 5, 8: 6, 9: o, 10: 8, 21: r, 23: l, 25: y, 27: b, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: [1, 62], 34: k, 37: R, 38: p, 39: g, 40: C, 41: v, 43: x, 46: T, 47: I, 51: N, 53: D, 54: L, 55: w }, { 12: W, 42: 64, 44: H, 45: B, 48: 66, 49: 67, 51: Q, 52: X }, s(et, [2, 41]), s(et, [2, 42]), { 15: 72, 43: V, 44: M, 45: B }, { 12: W, 42: 73, 44: H, 45: B, 48: 66, 49: 67, 51: Q, 52: X }, { 6: st, 9: it, 19: [1, 75], 35: 74, 50: rt }, { 12: [1, 79], 14: [1, 80] }, s(u, [2, 16], { 67: 35, 11: 81, 16: [1, 82], 45: B, 69: pt, 70: ft, 71: bt, 72: gt, 73: yt }), { 18: [1, 83] }, s(u, [2, 13]), { 17: 84, 18: [2, 63], 56: 55, 57: 56, 61: j }, { 58: 85, 61: [1, 86] }, { 61: [2, 69], 62: [1, 87] }, { 20: [1, 88] }, { 67: 89, 69: pt, 70: ft, 71: bt, 72: gt, 73: yt }, s(Nt, [2, 82]), s(Nt, [2, 83]), s(u, [2, 31]), s(u, xt), { 6: st, 9: it, 35: 90, 45: Ct, 50: rt }, { 43: [1, 92], 44: [1, 93] }, s(It, [2, 47], { 49: 94, 12: W, 44: H, 51: Q, 52: X }), s(z, [2, 49]), s(z, [2, 54]), s(z, [2, 55]), s(z, [2, 56]), s(z, [2, 57]), s(u, [2, 45], { 45: B }), { 6: st, 9: it, 35: 95, 45: Ct, 50: rt }, s(u, [2, 32]), { 10: 97, 36: 96, 43: x, 51: N, 53: D, 54: L, 55: w }, s(u, [2, 51]), s(u, [2, 52]), s(u, [2, 53]), { 13: 98, 43: nt, 53: at, 76: ot }, { 15: 102, 43: V, 44: M }, { 10: 103, 43: x, 51: N, 53: D, 54: L, 55: w }, { 17: 104, 18: [1, 105], 56: 55, 57: 56, 61: j }, s(u, [2, 11]), { 18: [2, 64] }, s(J, [2, 65], { 59: 106, 60: 107, 63: 108, 65: At, 66: Rt }), s([18, 61, 65, 66], [2, 71]), { 61: [2, 70] }, s(u, [2, 21], { 14: [1, 112], 16: [1, 111] }), s([43, 51, 53, 54, 55], [2, 76]), s(u, [2, 40]), { 12: W, 44: H, 48: 113, 49: 67, 51: Q, 52: X }, s(et, [2, 43]), s(et, [2, 44]), s(z, [2, 50]), s(u, [2, 46]), { 10: 115, 20: [1, 114], 43: x, 51: N, 53: D, 54: L, 55: w }, s(vt, [2, 34]), s(u, [2, 7]), s(u, [2, 84]), s(u, [2, 85]), s(u, [2, 86]), { 12: [1, 116], 45: B }, { 12: [1, 118], 14: [1, 117] }, { 18: [1, 119] }, s(u, [2, 14]), s(J, [2, 66], { 60: 120, 64: [1, 121], 66: Rt }), s(J, [2, 67]), s(_t, [2, 72]), s(J, [2, 75]), s(_t, [2, 74]), { 17: 122, 18: [1, 123], 56: 55, 57: 56, 61: j }, { 15: 124, 43: V, 44: M }, s(It, [2, 48], { 49: 94, 12: W, 44: H, 51: Q, 52: X }), { 6: st, 9: it, 35: 125, 50: rt }, s(vt, [2, 35]), { 13: 126, 43: nt, 53: at, 76: ot }, { 15: 127, 43: V, 44: M }, { 13: 128, 43: nt, 53: at, 76: ot }, s(u, [2, 12]), s(J, [2, 68]), { 63: 129, 65: At }, { 18: [1, 130] }, s(u, [2, 19]), s(u, [2, 22], { 16: [1, 131], 45: B }), s(u, [2, 33]), s(u, [2, 10]), { 12: [1, 132], 45: B }, s(u, [2, 9]), s(_t, [2, 73]), s(u, [2, 17]), { 17: 133, 18: [1, 134], 56: 55, 57: 56, 61: j }, { 13: 135, 43: nt, 53: at, 76: ot }, { 18: [1, 136] }, s(u, [2, 20]), s(u, [2, 8]), s(u, [2, 18])],
|
|
214
|
+
defaultActions: { 84: [2, 64], 87: [2, 70] },
|
|
215
|
+
parseError: /* @__PURE__ */ f(function(a, h) {
|
|
216
|
+
if (h.recoverable)
|
|
217
|
+
this.trace(a);
|
|
218
|
+
else {
|
|
219
|
+
var d = new Error(a);
|
|
220
|
+
throw d.hash = h, d;
|
|
221
|
+
}
|
|
222
|
+
}, "parseError"),
|
|
223
|
+
parse: /* @__PURE__ */ f(function(a) {
|
|
224
|
+
var h = this, d = [0], i = [], _ = [null], t = [], $ = this.table, e = "", lt = 0, Dt = 0, Ft = 2, Lt = 1, Yt = t.slice.call(arguments, 1), m = Object.create(this.lexer), Y = { yy: {} };
|
|
225
|
+
for (var mt in this.yy)
|
|
226
|
+
Object.prototype.hasOwnProperty.call(this.yy, mt) && (Y.yy[mt] = this.yy[mt]);
|
|
227
|
+
m.setInput(a, Y.yy), Y.yy.lexer = m, Y.yy.parser = this, typeof m.yylloc > "u" && (m.yylloc = {});
|
|
228
|
+
var Et = m.yylloc;
|
|
229
|
+
t.push(Et);
|
|
230
|
+
var Pt = m.options && m.options.ranges;
|
|
231
|
+
typeof Y.yy.parseError == "function" ? this.parseError = Y.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
232
|
+
function zt(S) {
|
|
233
|
+
d.length = d.length - 2 * S, _.length = _.length - S, t.length = t.length - S;
|
|
234
|
+
}
|
|
235
|
+
f(zt, "popStack");
|
|
236
|
+
function wt() {
|
|
237
|
+
var S;
|
|
238
|
+
return S = i.pop() || m.lex() || Lt, typeof S != "number" && (S instanceof Array && (i = S, S = i.pop()), S = h.symbols_[S] || S), S;
|
|
239
|
+
}
|
|
240
|
+
f(wt, "lex");
|
|
241
|
+
for (var E, P, O, St, U = {}, ht, A, Vt, ut; ; ) {
|
|
242
|
+
if (P = d[d.length - 1], this.defaultActions[P] ? O = this.defaultActions[P] : ((E === null || typeof E > "u") && (E = wt()), O = $[P] && $[P][E]), typeof O > "u" || !O.length || !O[0]) {
|
|
243
|
+
var Tt = "";
|
|
244
|
+
ut = [];
|
|
245
|
+
for (ht in $[P])
|
|
246
|
+
this.terminals_[ht] && ht > Ft && ut.push("'" + this.terminals_[ht] + "'");
|
|
247
|
+
m.showPosition ? Tt = "Parse error on line " + (lt + 1) + `:
|
|
248
|
+
` + m.showPosition() + `
|
|
249
|
+
Expecting ` + ut.join(", ") + ", got '" + (this.terminals_[E] || E) + "'" : Tt = "Parse error on line " + (lt + 1) + ": Unexpected " + (E == Lt ? "end of input" : "'" + (this.terminals_[E] || E) + "'"), this.parseError(Tt, {
|
|
250
|
+
text: m.match,
|
|
251
|
+
token: this.terminals_[E] || E,
|
|
252
|
+
line: m.yylineno,
|
|
253
|
+
loc: Et,
|
|
254
|
+
expected: ut
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
if (O[0] instanceof Array && O.length > 1)
|
|
258
|
+
throw new Error("Parse Error: multiple actions possible at state: " + P + ", token: " + E);
|
|
259
|
+
switch (O[0]) {
|
|
260
|
+
case 1:
|
|
261
|
+
d.push(E), _.push(m.yytext), t.push(m.yylloc), d.push(O[1]), E = null, Dt = m.yyleng, e = m.yytext, lt = m.yylineno, Et = m.yylloc;
|
|
262
|
+
break;
|
|
263
|
+
case 2:
|
|
264
|
+
if (A = this.productions_[O[1]][1], U.$ = _[_.length - A], U._$ = {
|
|
265
|
+
first_line: t[t.length - (A || 1)].first_line,
|
|
266
|
+
last_line: t[t.length - 1].last_line,
|
|
267
|
+
first_column: t[t.length - (A || 1)].first_column,
|
|
268
|
+
last_column: t[t.length - 1].last_column
|
|
269
|
+
}, Pt && (U._$.range = [
|
|
270
|
+
t[t.length - (A || 1)].range[0],
|
|
271
|
+
t[t.length - 1].range[1]
|
|
272
|
+
]), St = this.performAction.apply(U, [
|
|
273
|
+
e,
|
|
274
|
+
Dt,
|
|
275
|
+
lt,
|
|
276
|
+
Y.yy,
|
|
277
|
+
O[1],
|
|
278
|
+
_,
|
|
279
|
+
t
|
|
280
|
+
].concat(Yt)), typeof St < "u")
|
|
281
|
+
return St;
|
|
282
|
+
A && (d = d.slice(0, -1 * A * 2), _ = _.slice(0, -1 * A), t = t.slice(0, -1 * A)), d.push(this.productions_[O[1]][0]), _.push(U.$), t.push(U._$), Vt = $[d[d.length - 2]][d[d.length - 1]], d.push(Vt);
|
|
283
|
+
break;
|
|
284
|
+
case 3:
|
|
285
|
+
return !0;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return !0;
|
|
289
|
+
}, "parse")
|
|
290
|
+
}, Gt = /* @__PURE__ */ (function() {
|
|
291
|
+
var G = {
|
|
292
|
+
EOF: 1,
|
|
293
|
+
parseError: /* @__PURE__ */ f(function(h, d) {
|
|
294
|
+
if (this.yy.parser)
|
|
295
|
+
this.yy.parser.parseError(h, d);
|
|
296
|
+
else
|
|
297
|
+
throw new Error(h);
|
|
298
|
+
}, "parseError"),
|
|
299
|
+
// resets the lexer, sets new input
|
|
300
|
+
setInput: /* @__PURE__ */ f(function(a, h) {
|
|
301
|
+
return this.yy = h || this.yy || {}, this._input = a, 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__ */ f(function() {
|
|
310
|
+
var a = this._input[0];
|
|
311
|
+
this.yytext += a, this.yyleng++, this.offset++, this.match += a, this.matched += a;
|
|
312
|
+
var h = a.match(/(?:\r\n?|\n).*/g);
|
|
313
|
+
return h ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), a;
|
|
314
|
+
}, "input"),
|
|
315
|
+
// unshifts one char (or a string) into the input
|
|
316
|
+
unput: /* @__PURE__ */ f(function(a) {
|
|
317
|
+
var h = a.length, d = a.split(/(?:\r\n?|\n)/g);
|
|
318
|
+
this._input = a + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - h), this.offset -= h;
|
|
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), d.length - 1 && (this.yylineno -= d.length - 1);
|
|
321
|
+
var _ = 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: d ? (d.length === i.length ? this.yylloc.first_column : 0) + i[i.length - d.length].length - d[0].length : this.yylloc.first_column - h
|
|
327
|
+
}, this.options.ranges && (this.yylloc.range = [_[0], _[0] + this.yyleng - h]), 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__ */ f(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__ */ f(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__ */ f(function(a) {
|
|
348
|
+
this.unput(this.match.slice(a));
|
|
349
|
+
}, "less"),
|
|
350
|
+
// displays already matched input, i.e. for error messages
|
|
351
|
+
pastInput: /* @__PURE__ */ f(function() {
|
|
352
|
+
var a = this.matched.substr(0, this.matched.length - this.match.length);
|
|
353
|
+
return (a.length > 20 ? "..." : "") + a.substr(-20).replace(/\n/g, "");
|
|
354
|
+
}, "pastInput"),
|
|
355
|
+
// displays upcoming input, i.e. for error messages
|
|
356
|
+
upcomingInput: /* @__PURE__ */ f(function() {
|
|
357
|
+
var a = this.match;
|
|
358
|
+
return a.length < 20 && (a += this._input.substr(0, 20 - a.length)), (a.substr(0, 20) + (a.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__ */ f(function() {
|
|
362
|
+
var a = this.pastInput(), h = new Array(a.length + 1).join("-");
|
|
363
|
+
return a + this.upcomingInput() + `
|
|
364
|
+
` + h + "^";
|
|
365
|
+
}, "showPosition"),
|
|
366
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
367
|
+
test_match: /* @__PURE__ */ f(function(a, h) {
|
|
368
|
+
var d, i, _;
|
|
369
|
+
if (this.options.backtrack_lexer && (_ = {
|
|
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 && (_.yylloc.range = this.yylloc.range.slice(0))), i = a[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 + a[0].length
|
|
393
|
+
}, this.yytext += a[0], this.match += a[0], this.matches = a, 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(a[0].length), this.matched += a[0], d = this.performAction.call(this, this.yy, this, h, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), d)
|
|
394
|
+
return d;
|
|
395
|
+
if (this._backtrack) {
|
|
396
|
+
for (var t in _)
|
|
397
|
+
this[t] = _[t];
|
|
398
|
+
return !1;
|
|
399
|
+
}
|
|
400
|
+
return !1;
|
|
401
|
+
}, "test_match"),
|
|
402
|
+
// return next match in input
|
|
403
|
+
next: /* @__PURE__ */ f(function() {
|
|
404
|
+
if (this.done)
|
|
405
|
+
return this.EOF;
|
|
406
|
+
this._input || (this.done = !0);
|
|
407
|
+
var a, h, d, i;
|
|
408
|
+
this._more || (this.yytext = "", this.match = "");
|
|
409
|
+
for (var _ = this._currentRules(), t = 0; t < _.length; t++)
|
|
410
|
+
if (d = this._input.match(this.rules[_[t]]), d && (!h || d[0].length > h[0].length)) {
|
|
411
|
+
if (h = d, i = t, this.options.backtrack_lexer) {
|
|
412
|
+
if (a = this.test_match(d, _[t]), a !== !1)
|
|
413
|
+
return a;
|
|
414
|
+
if (this._backtrack) {
|
|
415
|
+
h = !1;
|
|
416
|
+
continue;
|
|
417
|
+
} else
|
|
418
|
+
return !1;
|
|
419
|
+
} else if (!this.options.flex)
|
|
420
|
+
break;
|
|
421
|
+
}
|
|
422
|
+
return h ? (a = this.test_match(h, _[i]), a !== !1 ? a : !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__ */ f(function() {
|
|
431
|
+
var h = this.next();
|
|
432
|
+
return h || this.lex();
|
|
433
|
+
}, "lex"),
|
|
434
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
435
|
+
begin: /* @__PURE__ */ f(function(h) {
|
|
436
|
+
this.conditionStack.push(h);
|
|
437
|
+
}, "begin"),
|
|
438
|
+
// pop the previously active lexer condition state off the condition stack
|
|
439
|
+
popState: /* @__PURE__ */ f(function() {
|
|
440
|
+
var h = this.conditionStack.length - 1;
|
|
441
|
+
return h > 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__ */ f(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__ */ f(function(h) {
|
|
449
|
+
return h = this.conditionStack.length - 1 - Math.abs(h || 0), h >= 0 ? this.conditionStack[h] : "INITIAL";
|
|
450
|
+
}, "topState"),
|
|
451
|
+
// alias for begin(condition)
|
|
452
|
+
pushState: /* @__PURE__ */ f(function(h) {
|
|
453
|
+
this.begin(h);
|
|
454
|
+
}, "pushState"),
|
|
455
|
+
// return the number of states currently on the stack
|
|
456
|
+
stateStackSize: /* @__PURE__ */ f(function() {
|
|
457
|
+
return this.conditionStack.length;
|
|
458
|
+
}, "stateStackSize"),
|
|
459
|
+
options: { "case-insensitive": !0 },
|
|
460
|
+
performAction: /* @__PURE__ */ f(function(h, d, i, _) {
|
|
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 d.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 d.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 G;
|
|
638
|
+
})();
|
|
639
|
+
kt.lexer = Gt;
|
|
640
|
+
function ct() {
|
|
641
|
+
this.yy = {};
|
|
642
|
+
}
|
|
643
|
+
return f(ct, "Parser"), ct.prototype = kt, kt.Parser = ct, new ct();
|
|
644
|
+
})();
|
|
645
|
+
Ot.parser = Ot;
|
|
646
|
+
var oe = Ot, K, ce = (K = 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 = Zt, this.getAccTitle = jt, this.setAccDescription = qt, this.getAccDescription = Wt, this.setDiagramTitle = Ht, this.getDiagramTitle = Qt, this.getConfig = /* @__PURE__ */ f(() => tt().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
|
+
/**
|
|
660
|
+
* Add entity
|
|
661
|
+
* @param name - The name of the entity
|
|
662
|
+
* @param alias - The alias of the entity
|
|
663
|
+
*/
|
|
664
|
+
addEntity(n, c = "") {
|
|
665
|
+
var o;
|
|
666
|
+
return this.entities.has(n) ? !((o = this.entities.get(n)) != null && o.alias) && c && (this.entities.get(n).alias = c, F.info(`Add alias '${c}' to entity '${n}'`)) : (this.entities.set(n, {
|
|
667
|
+
id: `entity-${n}-${this.entities.size}`,
|
|
668
|
+
label: n,
|
|
669
|
+
attributes: [],
|
|
670
|
+
alias: c,
|
|
671
|
+
shape: "erBox",
|
|
672
|
+
look: tt().look ?? "default",
|
|
673
|
+
cssClasses: "default",
|
|
674
|
+
cssStyles: [],
|
|
675
|
+
labelType: "markdown"
|
|
676
|
+
}), F.info("Added new entity :", n)), this.entities.get(n);
|
|
677
|
+
}
|
|
678
|
+
getEntity(n) {
|
|
679
|
+
return this.entities.get(n);
|
|
680
|
+
}
|
|
681
|
+
getEntities() {
|
|
682
|
+
return this.entities;
|
|
683
|
+
}
|
|
684
|
+
getClasses() {
|
|
685
|
+
return this.classes;
|
|
686
|
+
}
|
|
687
|
+
addAttributes(n, c) {
|
|
688
|
+
const o = this.addEntity(n);
|
|
689
|
+
let r;
|
|
690
|
+
for (r = c.length - 1; r >= 0; r--)
|
|
691
|
+
c[r].keys || (c[r].keys = []), c[r].comment || (c[r].comment = ""), o.attributes.push(c[r]), F.debug("Added attribute ", c[r].name);
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Add a relationship
|
|
695
|
+
*
|
|
696
|
+
* @param entA - The first entity in the relationship
|
|
697
|
+
* @param rolA - The role played by the first entity in relation to the second
|
|
698
|
+
* @param entB - The second entity in the relationship
|
|
699
|
+
* @param rSpec - The details of the relationship between the two entities
|
|
700
|
+
*/
|
|
701
|
+
addRelationship(n, c, o, r) {
|
|
702
|
+
let l;
|
|
703
|
+
if (this.subGraphLookup.has(n))
|
|
704
|
+
l = n;
|
|
705
|
+
else {
|
|
706
|
+
const k = this.addEntity(n);
|
|
707
|
+
if (!k)
|
|
708
|
+
return;
|
|
709
|
+
l = k.id;
|
|
710
|
+
}
|
|
711
|
+
let y;
|
|
712
|
+
if (this.subGraphLookup.has(o))
|
|
713
|
+
y = o;
|
|
714
|
+
else {
|
|
715
|
+
const k = this.addEntity(o);
|
|
716
|
+
if (!k)
|
|
717
|
+
return;
|
|
718
|
+
y = k.id;
|
|
719
|
+
}
|
|
720
|
+
const b = {
|
|
721
|
+
entityA: l,
|
|
722
|
+
roleA: c,
|
|
723
|
+
entityB: y,
|
|
724
|
+
relSpec: r
|
|
725
|
+
};
|
|
726
|
+
this.relationships.push(b), F.debug("Added new relationship :", b);
|
|
727
|
+
}
|
|
728
|
+
getRelationships() {
|
|
729
|
+
return this.relationships;
|
|
730
|
+
}
|
|
731
|
+
getDirection() {
|
|
732
|
+
return this.direction;
|
|
733
|
+
}
|
|
734
|
+
setDirection(n) {
|
|
735
|
+
this.direction = n;
|
|
736
|
+
}
|
|
737
|
+
getCompiledStyles(n) {
|
|
738
|
+
let c = [];
|
|
739
|
+
for (const o of n) {
|
|
740
|
+
const r = this.classes.get(o);
|
|
741
|
+
r != null && r.styles && (c = [...c, ...r.styles ?? []].map((l) => l.trim())), r != null && r.textStyles && (c = [...c, ...r.textStyles ?? []].map((l) => l.trim()));
|
|
742
|
+
}
|
|
743
|
+
return c;
|
|
744
|
+
}
|
|
745
|
+
addCssStyles(n, c) {
|
|
746
|
+
for (const o of n) {
|
|
747
|
+
const r = this.entities.get(o), l = this.subGraphLookup.get(o);
|
|
748
|
+
if (c) {
|
|
749
|
+
if (r)
|
|
750
|
+
for (const y of c)
|
|
751
|
+
r.cssStyles.push(y);
|
|
752
|
+
if (l) {
|
|
753
|
+
l.cssStyles || (l.cssStyles = []);
|
|
754
|
+
for (const y of c)
|
|
755
|
+
l.cssStyles.push(y);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
addClass(n, c) {
|
|
761
|
+
n.forEach((o) => {
|
|
762
|
+
let r = this.classes.get(o);
|
|
763
|
+
r === void 0 && (r = { id: o, styles: [], textStyles: [] }, this.classes.set(o, r)), c && c.forEach(function(l) {
|
|
764
|
+
if (/color/.exec(l)) {
|
|
765
|
+
const y = l.replace("fill", "bgFill");
|
|
766
|
+
r.textStyles.push(y);
|
|
767
|
+
}
|
|
768
|
+
r.styles.push(l);
|
|
769
|
+
});
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
addSubGraph(n, c, o) {
|
|
773
|
+
let r = n.text.trim(), l = o.text;
|
|
774
|
+
const b = (/* @__PURE__ */ f((g) => {
|
|
775
|
+
const C = /* @__PURE__ */ new Set();
|
|
776
|
+
let v;
|
|
777
|
+
return { nodeList: g.filter((T) => {
|
|
778
|
+
if (T != null && T.stmt)
|
|
779
|
+
return T.stmt === "dir" && (v = T.value), !1;
|
|
780
|
+
if (typeof T != "string")
|
|
781
|
+
return !1;
|
|
782
|
+
const I = T.trim();
|
|
783
|
+
return !I || C.has(I) ? !1 : (C.add(I), !0);
|
|
784
|
+
}), dir: v };
|
|
785
|
+
}, "uniq"))(c.flat()), k = b.nodeList, R = b.dir;
|
|
786
|
+
r = r ?? "subGraph" + this.subCount, l = l || "", l = this.sanitizeText(l), this.subCount = this.subCount + 1;
|
|
787
|
+
const p = {
|
|
788
|
+
id: r,
|
|
789
|
+
nodes: k,
|
|
790
|
+
title: l.trim(),
|
|
791
|
+
classes: [],
|
|
792
|
+
cssStyles: [],
|
|
793
|
+
dir: R,
|
|
794
|
+
labelType: this.sanitizeNodeLabelType(o == null ? void 0 : o.type)
|
|
795
|
+
};
|
|
796
|
+
return F.info("Adding", p.id, p.nodes, p.dir), p.nodes = this.makeUniq(p, this.subGraphs).nodes, this.subGraphs.push(p), this.subGraphLookup.set(r, p), r;
|
|
797
|
+
}
|
|
798
|
+
getSubGraphs() {
|
|
799
|
+
return this.subGraphs;
|
|
800
|
+
}
|
|
801
|
+
setClass(n, c) {
|
|
802
|
+
for (const o of n) {
|
|
803
|
+
const r = this.entities.get(o);
|
|
804
|
+
if (r)
|
|
805
|
+
for (const y of c)
|
|
806
|
+
r.cssClasses += " " + y;
|
|
807
|
+
const l = this.subGraphLookup.get(o);
|
|
808
|
+
if (l)
|
|
809
|
+
for (const y of c)
|
|
810
|
+
l.classes.push(y);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* Build a quick lookup for all node IDs already assigned to existing subgraphs.
|
|
815
|
+
*/
|
|
816
|
+
subgraphNodeCache(n) {
|
|
817
|
+
const c = /* @__PURE__ */ new Set();
|
|
818
|
+
for (const o of n)
|
|
819
|
+
for (const r of o.nodes)
|
|
820
|
+
c.add(r);
|
|
821
|
+
return c;
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* Filter out nodes that are already part of another subgraph,
|
|
825
|
+
* keeping subgraph membership unique.
|
|
826
|
+
*/
|
|
827
|
+
makeUniq(n, c) {
|
|
828
|
+
const o = this.subgraphNodeCache(c), r = [];
|
|
829
|
+
return n.nodes.forEach((l, y) => {
|
|
830
|
+
o.has(l) ? F.warn(`Entity '${l}' already belongs to another subgraph and will be ignored`) : r.push(n.nodes[y]);
|
|
831
|
+
}), { nodes: r };
|
|
832
|
+
}
|
|
833
|
+
sanitizeText(n) {
|
|
834
|
+
return Xt.sanitizeText(n, tt());
|
|
835
|
+
}
|
|
836
|
+
sanitizeNodeLabelType(n) {
|
|
837
|
+
switch (n) {
|
|
838
|
+
case "markdown":
|
|
839
|
+
case "string":
|
|
840
|
+
case "text":
|
|
841
|
+
return n;
|
|
842
|
+
default:
|
|
843
|
+
return "markdown";
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
clear() {
|
|
847
|
+
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, Jt();
|
|
848
|
+
}
|
|
849
|
+
getData() {
|
|
850
|
+
const n = [], c = [], o = tt(), r = this.getSubGraphs(), l = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map();
|
|
851
|
+
for (let p = r.length - 1; p >= 0; p--) {
|
|
852
|
+
const g = r[p];
|
|
853
|
+
g.nodes.length > 0 && y.set(g.id, !0);
|
|
854
|
+
for (const C of g.nodes)
|
|
855
|
+
l.set(C, g.id);
|
|
856
|
+
}
|
|
857
|
+
for (let p = r.length - 1; p >= 0; p--) {
|
|
858
|
+
const g = r[p];
|
|
859
|
+
n.push({
|
|
860
|
+
id: g.id,
|
|
861
|
+
label: g.title,
|
|
862
|
+
labelStyle: "",
|
|
863
|
+
labelType: g.labelType,
|
|
864
|
+
parentId: l.get(g.id),
|
|
865
|
+
padding: 8,
|
|
866
|
+
cssCompiledStyles: this.getCompiledStyles(g.classes),
|
|
867
|
+
cssStyles: g.cssStyles,
|
|
868
|
+
cssClasses: g.classes.join(" "),
|
|
869
|
+
shape: "rect",
|
|
870
|
+
dir: g.dir,
|
|
871
|
+
isGroup: !0,
|
|
872
|
+
look: o.look
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
const b = new Set(r.map((p) => p.id));
|
|
876
|
+
let k = 0;
|
|
877
|
+
for (const p of this.entities.keys()) {
|
|
878
|
+
if (b.has(p))
|
|
879
|
+
continue;
|
|
880
|
+
const g = this.entities.get(p);
|
|
881
|
+
g && (g.cssCompiledStyles = this.getCompiledStyles(g.cssClasses.split(" ")), g.colorIndex = k++, n.push({
|
|
882
|
+
...g,
|
|
883
|
+
parentId: l.get(p),
|
|
884
|
+
isGroup: !1
|
|
885
|
+
}));
|
|
886
|
+
}
|
|
887
|
+
let R = 0;
|
|
888
|
+
for (const p of this.relationships) {
|
|
889
|
+
const g = {
|
|
890
|
+
id: $t(p.entityA, p.entityB, {
|
|
891
|
+
prefix: "id",
|
|
892
|
+
counter: R++
|
|
893
|
+
}),
|
|
894
|
+
type: "normal",
|
|
895
|
+
curve: "basis",
|
|
896
|
+
start: p.entityA,
|
|
897
|
+
end: p.entityB,
|
|
898
|
+
label: p.roleA,
|
|
899
|
+
labelpos: "c",
|
|
900
|
+
thickness: "normal",
|
|
901
|
+
classes: "relationshipLine",
|
|
902
|
+
arrowTypeStart: p.relSpec.cardB.toLowerCase(),
|
|
903
|
+
arrowTypeEnd: p.relSpec.cardA.toLowerCase(),
|
|
904
|
+
pattern: p.relSpec.relType == "IDENTIFYING" ? "solid" : "dashed",
|
|
905
|
+
look: o.look,
|
|
906
|
+
labelType: "markdown"
|
|
907
|
+
};
|
|
908
|
+
c.push(g);
|
|
909
|
+
}
|
|
910
|
+
return { nodes: n, edges: c, other: {}, config: o, direction: this.direction };
|
|
911
|
+
}
|
|
912
|
+
}, f(K, "ErDB"), K), Bt = {};
|
|
913
|
+
ee(Bt, {
|
|
914
|
+
draw: () => le
|
|
915
|
+
});
|
|
916
|
+
var le = /* @__PURE__ */ f(async function(s, n, c, o) {
|
|
917
|
+
F.info("REF0:"), F.info("Drawing er diagram (unified)", n);
|
|
918
|
+
const { securityLevel: r, er: l, layout: y } = tt(), b = o.db.getData(), k = Ut(n, r);
|
|
919
|
+
b.type = o.type, b.layoutAlgorithm = se(y), b.config.flowchart.nodeSpacing = (l == null ? void 0 : l.nodeSpacing) || 140, b.config.flowchart.rankSpacing = (l == null ? void 0 : l.rankSpacing) || 80, b.direction = o.db.getDirection();
|
|
920
|
+
const { config: R } = b, { look: p } = R;
|
|
921
|
+
p === "neo" ? b.markers = [
|
|
922
|
+
"only_one_neo",
|
|
923
|
+
"zero_or_one_neo",
|
|
924
|
+
"one_or_more_neo",
|
|
925
|
+
"zero_or_more_neo"
|
|
926
|
+
] : b.markers = ["only_one", "zero_or_one", "one_or_more", "zero_or_more"], b.diagramId = n, await ie(b, k), b.layoutAlgorithm === "elk" && k.select(".edges").lower();
|
|
927
|
+
const g = k.selectAll('[id*="-background"]');
|
|
928
|
+
Array.from(g).length > 0 && g.each(function() {
|
|
929
|
+
const v = re(this), T = v.attr("id").replace("-background", ""), I = k.select(`#${CSS.escape(T)}`);
|
|
930
|
+
if (!I.empty()) {
|
|
931
|
+
const N = I.attr("transform");
|
|
932
|
+
v.attr("transform", N);
|
|
933
|
+
}
|
|
934
|
+
});
|
|
935
|
+
const C = 8;
|
|
936
|
+
ne.insertTitle(
|
|
937
|
+
k,
|
|
938
|
+
"erDiagramTitleText",
|
|
939
|
+
(l == null ? void 0 : l.titleTopMargin) ?? 25,
|
|
940
|
+
o.db.getDiagramTitle()
|
|
941
|
+
), Kt(k, C, "erDiagram", (l == null ? void 0 : l.useMaxWidth) ?? !0);
|
|
942
|
+
}, "draw"), Mt = /* @__PURE__ */ f((s, n) => {
|
|
943
|
+
const c = ae, o = c(s, "r"), r = c(s, "g"), l = c(s, "b");
|
|
944
|
+
return te(o, r, l, n);
|
|
945
|
+
}, "fade"), dt = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), he = /* @__PURE__ */ f((s) => {
|
|
946
|
+
const { theme: n, look: c, bkgColorArray: o, borderColorArray: r } = s;
|
|
947
|
+
if (!dt.has(n))
|
|
948
|
+
return "";
|
|
949
|
+
const l = (o == null ? void 0 : o.length) > 0;
|
|
950
|
+
let y = "";
|
|
951
|
+
for (let b = 0; b < s.THEME_COLOR_LIMIT; b++)
|
|
952
|
+
y += `
|
|
953
|
+
|
|
954
|
+
[data-look="${c}"][data-color-id="color-${b}"].node path {
|
|
955
|
+
stroke: ${r[b]};
|
|
956
|
+
${l ? `fill: ${o[b]};` : ""}
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
[data-look="${c}"][data-color-id="color-${b}"].node rect {
|
|
960
|
+
stroke: ${r[b]};
|
|
961
|
+
${l ? `fill: ${o[b]};` : ""}
|
|
962
|
+
}
|
|
963
|
+
`;
|
|
964
|
+
return y;
|
|
965
|
+
}, "genColor"), ue = /* @__PURE__ */ f((s) => {
|
|
966
|
+
const { look: n, theme: c, erEdgeLabelBackground: o, strokeWidth: r } = s;
|
|
967
|
+
return `
|
|
968
|
+
${he(s)}
|
|
969
|
+
.entityBox {
|
|
970
|
+
fill: ${s.mainBkg};
|
|
971
|
+
stroke: ${s.nodeBorder};
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
.relationshipLabelBox {
|
|
975
|
+
fill: ${s.tertiaryColor};
|
|
976
|
+
opacity: 0.7;
|
|
977
|
+
background-color: ${s.tertiaryColor};
|
|
978
|
+
rect {
|
|
979
|
+
opacity: 0.5;
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
.labelBkg {
|
|
984
|
+
background-color: ${dt.has(c) && o ? o : Mt(s.tertiaryColor, 0.5)};
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
.edgeLabel {
|
|
988
|
+
background-color: ${dt.has(c) && o ? o : s.edgeLabelBackground};
|
|
989
|
+
}
|
|
990
|
+
.edgeLabel .label rect {
|
|
991
|
+
fill: ${dt.has(c) && o ? o : s.edgeLabelBackground};
|
|
992
|
+
}
|
|
993
|
+
.edgeLabel .label text {
|
|
994
|
+
fill: ${s.textColor};
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
.edgeLabel .label {
|
|
998
|
+
fill: ${s.nodeBorder};
|
|
999
|
+
font-size: 14px;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
.label {
|
|
1003
|
+
font-family: ${s.fontFamily};
|
|
1004
|
+
color: ${s.nodeTextColor || s.textColor};
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
.edge-pattern-dashed {
|
|
1008
|
+
stroke-dasharray: 8,8;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
.node rect,
|
|
1012
|
+
.node circle,
|
|
1013
|
+
.node ellipse,
|
|
1014
|
+
.node polygon
|
|
1015
|
+
{
|
|
1016
|
+
fill: ${s.mainBkg};
|
|
1017
|
+
stroke: ${s.nodeBorder};
|
|
1018
|
+
stroke-width: ${n === "neo" ? r : "1px"};
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
.relationshipLine {
|
|
1022
|
+
stroke: ${s.lineColor};
|
|
1023
|
+
stroke-width: ${n === "neo" ? r : "1px"};
|
|
1024
|
+
fill: none;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
.marker {
|
|
1028
|
+
fill: none !important;
|
|
1029
|
+
stroke: ${s.lineColor} !important;
|
|
1030
|
+
stroke-width: 1;
|
|
1031
|
+
}
|
|
1032
|
+
[data-look=neo].labelBkg {
|
|
1033
|
+
background-color: ${Mt(s.tertiaryColor, 0.5)};
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
.cluster rect {
|
|
1037
|
+
fill: ${s.clusterBkg ?? s.mainBkg};
|
|
1038
|
+
stroke: ${s.clusterBorder ?? s.nodeBorder};
|
|
1039
|
+
stroke-width: 1px;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
.cluster text {
|
|
1043
|
+
fill: ${s.titleColor ?? s.textColor};
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
.cluster-label text {
|
|
1047
|
+
fill: ${s.titleColor ?? s.textColor};
|
|
1048
|
+
}
|
|
1049
|
+
`;
|
|
1050
|
+
}, "getStyles"), de = ue, ye = {
|
|
1051
|
+
parser: oe,
|
|
1052
|
+
get db() {
|
|
1053
|
+
return new ce();
|
|
1054
|
+
},
|
|
1055
|
+
renderer: Bt,
|
|
1056
|
+
styles: de
|
|
1057
|
+
};
|
|
1058
|
+
export {
|
|
1059
|
+
ye as diagram
|
|
1060
|
+
};
|