mio-previewer 0.1.1
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 +218 -0
- package/README.zh-CN.md +206 -0
- package/dist/MdRenderer.vue_vue_type_style_index_0_lang-ClzqKjX4.js +4562 -0
- package/dist/MdRenderer.vue_vue_type_style_index_0_lang-Dpnz3CdM.cjs +16 -0
- package/dist/_basePickBy-CZxbwAvt.cjs +1 -0
- package/dist/_basePickBy-nvL1-X4h.js +151 -0
- package/dist/_baseUniq-Cwhfu1XM.js +614 -0
- package/dist/_baseUniq-DunUk-cd.cjs +1 -0
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +1 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/arc-C9I4pYLv.js +83 -0
- package/dist/arc-fCflz0gB.cjs +1 -0
- package/dist/architecture-O4VJ6CD3-D00QJU0o.js +5 -0
- package/dist/architecture-O4VJ6CD3-dKuizgWO.cjs +1 -0
- package/dist/architectureDiagram-VXUJARFQ-DQ-YD3RX.cjs +36 -0
- package/dist/architectureDiagram-VXUJARFQ-VWr1UuPv.js +4662 -0
- package/dist/assets/parser.worker-67NQKZt5.js +16 -0
- package/dist/blockDiagram-VD42YOAC-DuC96I2Q.js +2261 -0
- package/dist/blockDiagram-VD42YOAC-EC2x5LwN.cjs +122 -0
- package/dist/c4Diagram-YG6GDRKO-Dm5d0BWL.cjs +10 -0
- package/dist/c4Diagram-YG6GDRKO-OB8wIuF8.js +1580 -0
- package/dist/channel-C-uR528Z.js +5 -0
- package/dist/channel-YfH5CBV-.cjs +1 -0
- package/dist/chunk-4BX2VUAB-3Liht_XN.cjs +1 -0
- package/dist/chunk-4BX2VUAB-j8LeaMvy.js +8 -0
- package/dist/chunk-55IACEB6-Dm3mi3ha.cjs +1 -0
- package/dist/chunk-55IACEB6-IYAIzfR4.js +8 -0
- package/dist/chunk-B4BG7PRW-CpqTB0S5.cjs +165 -0
- package/dist/chunk-B4BG7PRW-DB5df3Iz.js +1375 -0
- package/dist/chunk-DI55MBZ5-BoFZpvY3.js +1370 -0
- package/dist/chunk-DI55MBZ5-wqsoqtNw.cjs +220 -0
- package/dist/chunk-FMBD7UC4-BZS_4hun.cjs +15 -0
- package/dist/chunk-FMBD7UC4-CdmoYYnM.js +19 -0
- package/dist/chunk-QN33PNHL-BuyP9RXS.js +19 -0
- package/dist/chunk-QN33PNHL-CHI_-zix.cjs +1 -0
- package/dist/chunk-QZHKN3VN-15dJyQk0.js +15 -0
- package/dist/chunk-QZHKN3VN-DfH9qQ3T.cjs +1 -0
- package/dist/chunk-TZMSLE5B-BgFWf03M.js +64 -0
- package/dist/chunk-TZMSLE5B-qIo1h7Gz.cjs +1 -0
- package/dist/classDiagram-2ON5EDUG-BQz3UzKi.js +16 -0
- package/dist/classDiagram-2ON5EDUG-CZWeacVd.cjs +1 -0
- package/dist/classDiagram-v2-WZHVMYZB-BQz3UzKi.js +16 -0
- package/dist/classDiagram-v2-WZHVMYZB-CZWeacVd.cjs +1 -0
- package/dist/clone-ByeQKKoW.cjs +1 -0
- package/dist/clone-D6h_cwF4.js +8 -0
- package/dist/cose-bilkent-S5V4N54A-5dO3qpr4.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-D2q7jBXB.js +2609 -0
- package/dist/cytoscape.esm-DHF7mANN.cjs +331 -0
- package/dist/cytoscape.esm-DfdJODL8.js +18735 -0
- package/dist/dagre-6UL2VRFP-Cfh4UdSr.js +444 -0
- package/dist/dagre-6UL2VRFP-DS2Ki9Dv.cjs +4 -0
- package/dist/defaultLocale-D7EN2tov.js +171 -0
- package/dist/defaultLocale-DIVzfLaQ.cjs +1 -0
- package/dist/diagram-PSM6KHXK-BZDEX43o.js +531 -0
- package/dist/diagram-PSM6KHXK-CTsP6f2a.cjs +24 -0
- package/dist/diagram-QEK2KX5R-BDKMNi97.cjs +43 -0
- package/dist/diagram-QEK2KX5R-Dda_FEDc.js +217 -0
- package/dist/diagram-S2PKOQOG-CmfsKOvs.cjs +24 -0
- package/dist/diagram-S2PKOQOG-Cnw4b7LB.js +142 -0
- package/dist/entries/md.cjs.js +1 -0
- package/dist/entries/md.es.js +5 -0
- package/dist/entries/plugin-alert.cjs.js +1 -0
- package/dist/entries/plugin-alert.es.js +27 -0
- package/dist/entries/plugin-codeblock.cjs.js +9 -0
- package/dist/entries/plugin-codeblock.es.js +3441 -0
- package/dist/entries/plugin-emoji.cjs.js +1 -0
- package/dist/entries/plugin-emoji.es.js +28 -0
- package/dist/entries/plugin-katex.cjs.js +1 -0
- package/dist/entries/plugin-katex.es.js +92 -0
- package/dist/entries/plugin-mermaid.cjs.js +1 -0
- package/dist/entries/plugin-mermaid.es.js +4 -0
- package/dist/erDiagram-Q2GNP2WA-DE4JLeNF.cjs +60 -0
- package/dist/erDiagram-Q2GNP2WA-qAdA8fbE.js +841 -0
- package/dist/favicon.ico +0 -0
- package/dist/flowDiagram-NV44I4VS-C7YBx4JP.js +1620 -0
- package/dist/flowDiagram-NV44I4VS-j3dB-fjF.cjs +162 -0
- package/dist/ganttDiagram-LVOFAZNH-BL-Yjadx.js +2506 -0
- package/dist/ganttDiagram-LVOFAZNH-CBhzET57.cjs +267 -0
- package/dist/gitGraph-ZV4HHKMB-Dr9sn7R3.js +5 -0
- package/dist/gitGraph-ZV4HHKMB-DyXW77WY.cjs +1 -0
- package/dist/gitGraphDiagram-NY62KEGX-DDklxVnY.cjs +65 -0
- package/dist/gitGraphDiagram-NY62KEGX-DFn7h5BH.js +699 -0
- package/dist/graph-CHoeKkVR.cjs +1 -0
- package/dist/graph-DiGqaw_6.js +247 -0
- package/dist/info-63CPKGFF-BGxbI0Qv.cjs +1 -0
- package/dist/info-63CPKGFF-xflgSxfH.js +5 -0
- package/dist/infoDiagram-F6ZHWCRC-DOtGa28U.js +24 -0
- package/dist/infoDiagram-F6ZHWCRC-Duylo4r7.cjs +2 -0
- package/dist/init-CHZsXQcr.cjs +1 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/journeyDiagram-XKPGCS4Q-bJncB3oe.js +834 -0
- package/dist/journeyDiagram-XKPGCS4Q-h-CtcfbS.cjs +139 -0
- package/dist/kanban-definition-3W4ZIXB7-C3y0C_bw.cjs +89 -0
- package/dist/kanban-definition-3W4ZIXB7-nMPCi8GW.js +719 -0
- package/dist/katex-CmGeg_OO.js +11692 -0
- package/dist/katex-DEiiRhcn.cjs +261 -0
- package/dist/layout-BG4AbhIW.cjs +1 -0
- package/dist/layout-CHaNS4g6.js +1324 -0
- package/dist/linear-Bqd4C_Yb.cjs +1 -0
- package/dist/linear-CPFNaVnw.js +259 -0
- package/dist/mermaid-parser.core-CR8Rcyps.cjs +128 -0
- package/dist/mermaid-parser.core-CkQKh-yb.js +12966 -0
- package/dist/mindmap-definition-VGOIOE7T-C63AEIdU.js +784 -0
- package/dist/mindmap-definition-VGOIOE7T-CHI9UFtA.cjs +68 -0
- package/dist/mio-previewer.cjs.js +3 -0
- package/dist/mio-previewer.css +1 -0
- package/dist/mio-previewer.es.js +25 -0
- package/dist/ordinal-CagbB1m8.cjs +1 -0
- package/dist/ordinal-DfAQgscy.js +61 -0
- package/dist/packet-HUATNLJX-BeAGxpDF.cjs +1 -0
- package/dist/packet-HUATNLJX-dnmrn2-l.js +5 -0
- package/dist/parser.worker.js +21 -0
- package/dist/pie-WTHONI2E-BKoHQt0i.js +5 -0
- package/dist/pie-WTHONI2E-BifrFKgo.cjs +1 -0
- package/dist/pieDiagram-ADFJNKIX-B9OONHi_.cjs +30 -0
- package/dist/pieDiagram-ADFJNKIX-CEMFAt9B.js +161 -0
- package/dist/plugin-mermaid-FTki7cN8.cjs +255 -0
- package/dist/plugin-mermaid-y4lbJ7sL.js +15369 -0
- package/dist/quadrantDiagram-AYHSOK5B-DobvzsAU.js +1022 -0
- package/dist/quadrantDiagram-AYHSOK5B-DqXDgyBD.cjs +7 -0
- package/dist/radar-NJJJXTRR-BPN19Spv.cjs +1 -0
- package/dist/radar-NJJJXTRR-Bj9rI8mr.js +5 -0
- package/dist/requirementDiagram-UZGBJVZJ-CVbmNF7M.cjs +64 -0
- package/dist/requirementDiagram-UZGBJVZJ-M-MPvTnX.js +850 -0
- package/dist/sankeyDiagram-TZEHDZUN-C-ESiLJA.cjs +10 -0
- package/dist/sankeyDiagram-TZEHDZUN-Czsin99f.js +810 -0
- package/dist/sequenceDiagram-WL72ISMW-BJByNQsK.js +2511 -0
- package/dist/sequenceDiagram-WL72ISMW-DApIQwP-.cjs +145 -0
- package/dist/stateDiagram-FKZM4ZOC-BuKL2w66.cjs +1 -0
- package/dist/stateDiagram-FKZM4ZOC-jAiBDhVn.js +263 -0
- package/dist/stateDiagram-v2-4FDKWEC3-Ct5PFxdd.cjs +1 -0
- package/dist/stateDiagram-v2-4FDKWEC3-umSVoFht.js +16 -0
- package/dist/timeline-definition-IT6M3QCI-BfAvK0gf.cjs +61 -0
- package/dist/timeline-definition-IT6M3QCI-I--lBLTi.js +795 -0
- package/dist/treemap-75Q7IDZK-DNt-zuL8.cjs +1 -0
- package/dist/treemap-75Q7IDZK-bjql9DgL.js +5 -0
- package/dist/types/entries/md.d.ts +3 -0
- package/dist/types/entries/plugin-alert.d.ts +1 -0
- package/dist/types/entries/plugin-codeblock.d.ts +1 -0
- package/dist/types/entries/plugin-emoji.d.ts +1 -0
- package/dist/types/entries/plugin-katex.d.ts +1 -0
- package/dist/types/entries/plugin-mermaid.d.ts +1 -0
- package/dist/types/helpers/containerHelpers.d.ts +47 -0
- package/dist/types/helpers/index.d.ts +4 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/main-plugin-demo.d.ts +1 -0
- package/dist/types/main.d.ts +1 -0
- package/dist/types/plugins/AlertPlugin.d.ts +16 -0
- package/dist/types/plugins/CodeBlockPlugin.d.ts +9 -0
- package/dist/types/plugins/EmojiPlugin.d.ts +11 -0
- package/dist/types/plugins/katexPlugin.d.ts +8 -0
- package/dist/types/plugins/mermaidPlugin.d.ts +13 -0
- package/dist/types/types.d.ts +77 -0
- package/dist/xychartDiagram-PRI3JC2R-BN9e47xe.cjs +7 -0
- package/dist/xychartDiagram-PRI3JC2R-XrOK_egj.js +1340 -0
- package/package.json +114 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a={name:"emoji",priority:10,test:e=>e.type==="text"&&/:\w+:/g.test(e.data||""),render:(e,o,c)=>{const r=e.data||"",i={":smile:":"😊",":heart:":"❤️",":fire:":"🔥",":rocket:":"🚀",":star:":"⭐",":thumbsup:":"👍",":tada:":"🎉",":check:":"✅",":cross:":"❌",":eyes:":"👀",":thinking:":"🤔",":100:":"💯"};let t=r;return Object.entries(i).forEach(([n,s])=>{t=t.replace(new RegExp(n,"g"),s)}),t}};exports.EmojiPlugin=a;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const o = {
|
|
2
|
+
name: "emoji",
|
|
3
|
+
priority: 10,
|
|
4
|
+
test: (e) => e.type === "text" && /:\w+:/g.test(e.data || ""),
|
|
5
|
+
render: (e, i, c) => {
|
|
6
|
+
const r = e.data || "", n = {
|
|
7
|
+
":smile:": "😊",
|
|
8
|
+
":heart:": "❤️",
|
|
9
|
+
":fire:": "🔥",
|
|
10
|
+
":rocket:": "🚀",
|
|
11
|
+
":star:": "⭐",
|
|
12
|
+
":thumbsup:": "👍",
|
|
13
|
+
":tada:": "🎉",
|
|
14
|
+
":check:": "✅",
|
|
15
|
+
":cross:": "❌",
|
|
16
|
+
":eyes:": "👀",
|
|
17
|
+
":thinking:": "🤔",
|
|
18
|
+
":100:": "💯"
|
|
19
|
+
};
|
|
20
|
+
let t = r;
|
|
21
|
+
return Object.entries(n).forEach(([s, a]) => {
|
|
22
|
+
t = t.replace(new RegExp(s, "g"), a);
|
|
23
|
+
}), t;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
o as EmojiPlugin
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../katex-DEiiRhcn.cjs");function M(p){return $(p)}function $(p){const h=[{open:"$$",close:"$$",display:!0},{open:"\\[",close:"\\]",display:!0},{open:"\\(",close:"\\)",display:!1},{open:"$",close:"$",display:!1}],m=(e,r)=>{const c=e.src;for(const t of h){if(!c.startsWith(t.open,e.pos))continue;const n=e.pos+t.open.length;let l=n,i=-1;for(;(l=c.indexOf(t.close,l))!==-1;){let o=l-1,f=0;for(;o>=0&&c[o]==="\\";)f++,o--;if(f%2===0){i=l;break}l+=t.close.length}if(i===-1)return r||(e.pending+=t.open),e.pos+=t.open.length,!0;const u=c.slice(n,i);if(!r){const o=e.push("math","math",0);o.content=u,o.markup=t.open,o.meta={display:t.display}}return e.pos=i+t.close.length,!0}return!1},k=(e,r)=>{const c=e[r],t=c.meta?.display||!1;try{const n=x.default.renderToString(c.content,{displayMode:t,throwOnError:!1});return t?`<div class="katex-block">${n}</div>`:n}catch(n){const l=n instanceof Error?n.message:String(n),i=p.utils?p.utils.escapeHtml(c.content):c.content;return`<span class="katex-error" title="${p.utils?p.utils.escapeHtml(l):l}">${i}</span>`}};p.inline.ruler.before("escape","math",m),p.renderer.rules.math=k;const g=(e,r,c,t)=>{for(const n of h){if(!n.display)continue;let l=e.bMarks[r]+e.tShift[r],i=e.eMarks[r];if(l+n.open.length>i||e.src.slice(l,l+n.open.length)!==n.open)continue;l+=n.open.length;const u=e.src.slice(l,i);if(u.trim().endsWith(n.close)){const s=u.trim().slice(0,-n.close.length);if(!t){const a=e.push("math","math",0);a.block=!0,a.content=s,a.markup=n.open,a.meta={display:n.display},a.map=[r,r+1]}return e.line=r+1,!0}let o=r,f=!1;for(;o<c&&(o++,!(o>=c||(l=e.bMarks[o]+e.tShift[o],i=e.eMarks[o],l<i&&e.tShift[o]<e.blkIndent)));)if(e.src.slice(l,i).trim()===n.close){f=!0;break}if(!f)continue;const y=e.parentType,b=e.lineMax;e.parentType="math";let d="";for(let s=r+1;s<o;s++){const a=e.getLines(s,s+1,e.tShift[r],!1);d+=a}if(!t){const s=e.push("math","math",0);s.block=!0,s.content=d.trim(),s.markup=n.open,s.meta={display:n.display},s.map=[r,o+1]}return e.parentType=y,e.lineMax=b,e.line=o+1,!0}return!1};p.block.ruler.before("fence","math_block",g)}exports.katexPlugin=M;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import x from "../katex-CmGeg_OO.js";
|
|
2
|
+
function S(p) {
|
|
3
|
+
return M(p);
|
|
4
|
+
}
|
|
5
|
+
function M(p) {
|
|
6
|
+
const h = [
|
|
7
|
+
{ open: "$$", close: "$$", display: !0 },
|
|
8
|
+
{ open: "\\[", close: "\\]", display: !0 },
|
|
9
|
+
{ open: "\\(", close: "\\)", display: !1 },
|
|
10
|
+
{ open: "$", close: "$", display: !1 }
|
|
11
|
+
], d = (e, r) => {
|
|
12
|
+
const c = e.src;
|
|
13
|
+
for (const t of h) {
|
|
14
|
+
if (!c.startsWith(t.open, e.pos)) continue;
|
|
15
|
+
const n = e.pos + t.open.length;
|
|
16
|
+
let l = n, i = -1;
|
|
17
|
+
for (; (l = c.indexOf(t.close, l)) !== -1; ) {
|
|
18
|
+
let o = l - 1, f = 0;
|
|
19
|
+
for (; o >= 0 && c[o] === "\\"; )
|
|
20
|
+
f++, o--;
|
|
21
|
+
if (f % 2 === 0) {
|
|
22
|
+
i = l;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
l += t.close.length;
|
|
26
|
+
}
|
|
27
|
+
if (i === -1)
|
|
28
|
+
return r || (e.pending += t.open), e.pos += t.open.length, !0;
|
|
29
|
+
const u = c.slice(n, i);
|
|
30
|
+
if (!r) {
|
|
31
|
+
const o = e.push("math", "math", 0);
|
|
32
|
+
o.content = u, o.markup = t.open, o.meta = { display: t.display };
|
|
33
|
+
}
|
|
34
|
+
return e.pos = i + t.close.length, !0;
|
|
35
|
+
}
|
|
36
|
+
return !1;
|
|
37
|
+
}, k = (e, r) => {
|
|
38
|
+
const c = e[r], t = c.meta?.display || !1;
|
|
39
|
+
try {
|
|
40
|
+
const n = x.renderToString(c.content, {
|
|
41
|
+
displayMode: t,
|
|
42
|
+
throwOnError: !1
|
|
43
|
+
});
|
|
44
|
+
return t ? `<div class="katex-block">${n}</div>` : n;
|
|
45
|
+
} catch (n) {
|
|
46
|
+
const l = n instanceof Error ? n.message : String(n), i = p.utils ? p.utils.escapeHtml(c.content) : c.content;
|
|
47
|
+
return `<span class="katex-error" title="${p.utils ? p.utils.escapeHtml(l) : l}">${i}</span>`;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
p.inline.ruler.before("escape", "math", d), p.renderer.rules.math = k;
|
|
51
|
+
const y = (e, r, c, t) => {
|
|
52
|
+
for (const n of h) {
|
|
53
|
+
if (!n.display) continue;
|
|
54
|
+
let l = e.bMarks[r] + e.tShift[r], i = e.eMarks[r];
|
|
55
|
+
if (l + n.open.length > i || e.src.slice(l, l + n.open.length) !== n.open) continue;
|
|
56
|
+
l += n.open.length;
|
|
57
|
+
const u = e.src.slice(l, i);
|
|
58
|
+
if (u.trim().endsWith(n.close)) {
|
|
59
|
+
const s = u.trim().slice(0, -n.close.length);
|
|
60
|
+
if (!t) {
|
|
61
|
+
const a = e.push("math", "math", 0);
|
|
62
|
+
a.block = !0, a.content = s, a.markup = n.open, a.meta = { display: n.display }, a.map = [r, r + 1];
|
|
63
|
+
}
|
|
64
|
+
return e.line = r + 1, !0;
|
|
65
|
+
}
|
|
66
|
+
let o = r, f = !1;
|
|
67
|
+
for (; o < c && (o++, !(o >= c || (l = e.bMarks[o] + e.tShift[o], i = e.eMarks[o], l < i && e.tShift[o] < e.blkIndent))); )
|
|
68
|
+
if (e.src.slice(l, i).trim() === n.close) {
|
|
69
|
+
f = !0;
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
if (!f) continue;
|
|
73
|
+
const g = e.parentType, b = e.lineMax;
|
|
74
|
+
e.parentType = "math";
|
|
75
|
+
let m = "";
|
|
76
|
+
for (let s = r + 1; s < o; s++) {
|
|
77
|
+
const a = e.getLines(s, s + 1, e.tShift[r], !1);
|
|
78
|
+
m += a;
|
|
79
|
+
}
|
|
80
|
+
if (!t) {
|
|
81
|
+
const s = e.push("math", "math", 0);
|
|
82
|
+
s.block = !0, s.content = m.trim(), s.markup = n.open, s.meta = { display: n.display }, s.map = [r, o + 1];
|
|
83
|
+
}
|
|
84
|
+
return e.parentType = g, e.lineMax = b, e.line = o + 1, !0;
|
|
85
|
+
}
|
|
86
|
+
return !1;
|
|
87
|
+
};
|
|
88
|
+
p.block.ruler.before("fence", "math_block", y);
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
S as katexPlugin
|
|
92
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../plugin-mermaid-FTki7cN8.cjs");exports.mermaidPlugin=e.mermaidPlugin;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xt=require("./chunk-55IACEB6-Dm3mi3ha.cjs"),vt=require("./chunk-QN33PNHL-CHI_-zix.cjs"),a=require("./plugin-mermaid-FTki7cN8.cjs"),Dt=require("./channel-YfH5CBV-.cjs");var ht=(function(){var s=a.__name(function(R,r,c,l){for(c=c||{},l=R.length;l--;c[R[l]]=r);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,50],o=[1,10],d=[1,11],h=[1,12],u=[1,13],f=[1,20],y=[1,21],k=[1,22],w=[1,23],K=[1,24],S=[1,19],$=[1,25],Z=[1,26],T=[1,18],L=[1,33],tt=[1,34],et=[1,35],st=[1,36],it=[1,37],ut=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,50,63,64,65,66,67],O=[1,42],N=[1,43],V=[1,52],M=[40,50,68,69],B=[1,63],F=[1,61],A=[1,58],P=[1,62],Y=[1,64],U=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,63,64,65,66,67],dt=[63,64,65,66,67],_t=[1,81],pt=[1,80],ft=[1,78],yt=[1,79],gt=[6,10,42,47],x=[6,10,13,41,42,47,48,49],j=[1,89],W=[1,88],q=[1,87],z=[19,56],mt=[1,98],bt=[1,97],nt=[19,56,58,60],rt={trace:a.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes: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:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,attribute:51,attributeType:52,attributeName:53,attributeKeyTypeList:54,attributeComment:55,ATTRIBUTE_WORD:56,attributeKeyType:57,",":58,ATTRIBUTE_KEY:59,COMMENT:60,cardinality:61,relType:62,ZERO_OR_ONE:63,ZERO_OR_MORE:64,ONE_OR_MORE:65,ONLY_ONE:66,MD_PARENT:67,NON_IDENTIFYING:68,IDENTIFYING:69,WORD:70,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",56:"ATTRIBUTE_WORD",58:",",59:"ATTRIBUTE_KEY",60:"COMMENT",63:"ZERO_OR_ONE",64:"ZERO_OR_MORE",65:"ONE_OR_MORE",66:"ONLY_ONE",67:"MD_PARENT",68:"NON_IDENTIFYING",69:"IDENTIFYING",70:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[18,1],[18,2],[51,2],[51,3],[51,3],[51,4],[52,1],[53,1],[54,1],[54,3],[57,1],[55,1],[12,3],[61,1],[61,1],[61,1],[61,1],[61,1],[62,1],[62,1],[14,1],[14,1],[14,1]],performAction:a.__name(function(r,c,l,n,_,t,G){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:t[e-1].push(t[e]),this.$=t[e-1];break;case 4:case 5:this.$=t[e];break;case 6:case 7:this.$=[];break;case 8:n.addEntity(t[e-4]),n.addEntity(t[e-2]),n.addRelationship(t[e-4],t[e],t[e-2],t[e-3]);break;case 9:n.addEntity(t[e-8]),n.addEntity(t[e-4]),n.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),n.setClass([t[e-8]],t[e-6]),n.setClass([t[e-4]],t[e-2]);break;case 10:n.addEntity(t[e-6]),n.addEntity(t[e-2]),n.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),n.setClass([t[e-6]],t[e-4]);break;case 11:n.addEntity(t[e-6]),n.addEntity(t[e-4]),n.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),n.setClass([t[e-4]],t[e-2]);break;case 12:n.addEntity(t[e-3]),n.addAttributes(t[e-3],t[e-1]);break;case 13:n.addEntity(t[e-5]),n.addAttributes(t[e-5],t[e-1]),n.setClass([t[e-5]],t[e-3]);break;case 14:n.addEntity(t[e-2]);break;case 15:n.addEntity(t[e-4]),n.setClass([t[e-4]],t[e-2]);break;case 16:n.addEntity(t[e]);break;case 17:n.addEntity(t[e-2]),n.setClass([t[e-2]],t[e]);break;case 18:n.addEntity(t[e-6],t[e-4]),n.addAttributes(t[e-6],t[e-1]);break;case 19:n.addEntity(t[e-8],t[e-6]),n.addAttributes(t[e-8],t[e-1]),n.setClass([t[e-8]],t[e-3]);break;case 20:n.addEntity(t[e-5],t[e-3]);break;case 21:n.addEntity(t[e-7],t[e-5]),n.setClass([t[e-7]],t[e-2]);break;case 22:n.addEntity(t[e-3],t[e-1]);break;case 23:n.addEntity(t[e-5],t[e-3]),n.setClass([t[e-5]],t[e]);break;case 24:case 25:this.$=t[e].trim(),n.setAccTitle(this.$);break;case 26:case 27:this.$=t[e].trim(),n.setAccDescription(this.$);break;case 32:n.setDirection("TB");break;case 33:n.setDirection("BT");break;case 34:n.setDirection("RL");break;case 35:n.setDirection("LR");break;case 36:this.$=t[e-3],n.addClass(t[e-2],t[e-1]);break;case 37:case 38:case 56:case 64:this.$=[t[e]];break;case 39:case 40:this.$=t[e-2].concat([t[e]]);break;case 41:this.$=t[e-2],n.setClass(t[e-1],t[e]);break;case 42:this.$=t[e-3],n.addCssStyles(t[e-2],t[e-1]);break;case 43:this.$=[t[e]];break;case 44:t[e-2].push(t[e]),this.$=t[e-2];break;case 46:this.$=t[e-1]+t[e];break;case 54:case 76:case 77:this.$=t[e].replace(/"/g,"");break;case 55:case 78:this.$=t[e];break;case 57:t[e].push(t[e-1]),this.$=t[e];break;case 58:this.$={type:t[e-1],name:t[e]};break;case 59:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 60:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 61:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 62:case 63:case 66:this.$=t[e];break;case 65:t[e-2].push(t[e]),this.$=t[e-2];break;case 67:this.$=t[e].replace(/"/g,"");break;case 68:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 69:this.$=n.Cardinality.ZERO_OR_ONE;break;case 70:this.$=n.Cardinality.ZERO_OR_MORE;break;case 71:this.$=n.Cardinality.ONE_OR_MORE;break;case 72:this.$=n.Cardinality.ONLY_ONE;break;case 73:this.$=n.Cardinality.MD_PARENT;break;case 74:this.$=n.Identification.NON_IDENTIFYING;break;case 75:this.$=n.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:o,24:d,26:h,28:u,29:14,30:15,31:16,32:17,33:f,34:y,35:k,36:w,37:K,40:S,43:$,44:Z,50:T},s(i,[2,7],{1:[2,1]}),s(i,[2,3]),{9:27,11:9,22:o,24:d,26:h,28:u,29:14,30:15,31:16,32:17,33:f,34:y,35:k,36:w,37:K,40:S,43:$,44:Z,50:T},s(i,[2,5]),s(i,[2,6]),s(i,[2,16],{12:28,61:32,15:[1,29],17:[1,30],20:[1,31],63:L,64:tt,65:et,66:st,67:it}),{23:[1,38]},{25:[1,39]},{27:[1,40]},s(i,[2,27]),s(i,[2,28]),s(i,[2,29]),s(i,[2,30]),s(i,[2,31]),s(ut,[2,54]),s(ut,[2,55]),s(i,[2,32]),s(i,[2,33]),s(i,[2,34]),s(i,[2,35]),{16:41,40:O,41:N},{16:44,40:O,41:N},{16:45,40:O,41:N},s(i,[2,4]),{11:46,40:S,50:T},{16:47,40:O,41:N},{18:48,19:[1,49],51:50,52:51,56:V},{11:53,40:S,50:T},{62:54,68:[1,55],69:[1,56]},s(M,[2,69]),s(M,[2,70]),s(M,[2,71]),s(M,[2,72]),s(M,[2,73]),s(i,[2,24]),s(i,[2,25]),s(i,[2,26]),{13:B,38:57,41:F,42:A,45:59,46:60,48:P,49:Y},s(U,[2,37]),s(U,[2,38]),{16:65,40:O,41:N,42:A},{13:B,38:66,41:F,42:A,45:59,46:60,48:P,49:Y},{13:[1,67],15:[1,68]},s(i,[2,17],{61:32,12:69,17:[1,70],42:A,63:L,64:tt,65:et,66:st,67:it}),{19:[1,71]},s(i,[2,14]),{18:72,19:[2,56],51:50,52:51,56:V},{53:73,56:[1,74]},{56:[2,62]},{21:[1,75]},{61:76,63:L,64:tt,65:et,66:st,67:it},s(dt,[2,74]),s(dt,[2,75]),{6:_t,10:pt,39:77,42:ft,47:yt},{40:[1,82],41:[1,83]},s(gt,[2,43],{46:84,13:B,41:F,48:P,49:Y}),s(x,[2,45]),s(x,[2,50]),s(x,[2,51]),s(x,[2,52]),s(x,[2,53]),s(i,[2,41],{42:A}),{6:_t,10:pt,39:85,42:ft,47:yt},{14:86,40:j,50:W,70:q},{16:90,40:O,41:N},{11:91,40:S,50:T},{18:92,19:[1,93],51:50,52:51,56:V},s(i,[2,12]),{19:[2,57]},s(z,[2,58],{54:94,55:95,57:96,59:mt,60:bt}),s([19,56,59,60],[2,63]),s(i,[2,22],{15:[1,100],17:[1,99]}),s([40,50],[2,68]),s(i,[2,36]),{13:B,41:F,45:101,46:60,48:P,49:Y},s(i,[2,47]),s(i,[2,48]),s(i,[2,49]),s(U,[2,39]),s(U,[2,40]),s(x,[2,46]),s(i,[2,42]),s(i,[2,8]),s(i,[2,76]),s(i,[2,77]),s(i,[2,78]),{13:[1,102],42:A},{13:[1,104],15:[1,103]},{19:[1,105]},s(i,[2,15]),s(z,[2,59],{55:106,58:[1,107],60:bt}),s(z,[2,60]),s(nt,[2,64]),s(z,[2,67]),s(nt,[2,66]),{18:108,19:[1,109],51:50,52:51,56:V},{16:110,40:O,41:N},s(gt,[2,44],{46:84,13:B,41:F,48:P,49:Y}),{14:111,40:j,50:W,70:q},{16:112,40:O,41:N},{14:113,40:j,50:W,70:q},s(i,[2,13]),s(z,[2,61]),{57:114,59:mt},{19:[1,115]},s(i,[2,20]),s(i,[2,23],{17:[1,116],42:A}),s(i,[2,11]),{13:[1,117],42:A},s(i,[2,10]),s(nt,[2,65]),s(i,[2,18]),{18:118,19:[1,119],51:50,52:51,56:V},{14:120,40:j,50:W,70:q},{19:[1,121]},s(i,[2,21]),s(i,[2,9]),s(i,[2,19])],defaultActions:{52:[2,62],72:[2,57]},parseError:a.__name(function(r,c){if(c.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=c,l}},"parseError"),parse:a.__name(function(r){var c=this,l=[0],n=[],_=[null],t=[],G=this.table,e="",X=0,kt=0,At=2,Et=1,Rt=t.slice.call(arguments,1),p=Object.create(this.lexer),C={yy:{}};for(var at in this.yy)Object.prototype.hasOwnProperty.call(this.yy,at)&&(C.yy[at]=this.yy[at]);p.setInput(r,C.yy),C.yy.lexer=p,C.yy.parser=this,typeof p.yylloc>"u"&&(p.yylloc={});var ct=p.yylloc;t.push(ct);var Ct=p.options&&p.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function It(m){l.length=l.length-2*m,_.length=_.length-m,t.length=t.length-m}a.__name(It,"popStack");function St(){var m;return m=n.pop()||p.lex()||Et,typeof m!="number"&&(m instanceof Array&&(n=m,m=n.pop()),m=c.symbols_[m]||m),m}a.__name(St,"lex");for(var g,I,b,lt,v={},H,E,Tt,J;;){if(I=l[l.length-1],this.defaultActions[I]?b=this.defaultActions[I]:((g===null||typeof g>"u")&&(g=St()),b=G[I]&&G[I][g]),typeof b>"u"||!b.length||!b[0]){var ot="";J=[];for(H in G[I])this.terminals_[H]&&H>At&&J.push("'"+this.terminals_[H]+"'");p.showPosition?ot="Parse error on line "+(X+1)+`:
|
|
2
|
+
`+p.showPosition()+`
|
|
3
|
+
Expecting `+J.join(", ")+", got '"+(this.terminals_[g]||g)+"'":ot="Parse error on line "+(X+1)+": Unexpected "+(g==Et?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(ot,{text:p.match,token:this.terminals_[g]||g,line:p.yylineno,loc:ct,expected:J})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+g);switch(b[0]){case 1:l.push(g),_.push(p.yytext),t.push(p.yylloc),l.push(b[1]),g=null,kt=p.yyleng,e=p.yytext,X=p.yylineno,ct=p.yylloc;break;case 2:if(E=this.productions_[b[1]][1],v.$=_[_.length-E],v._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},Ct&&(v._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),lt=this.performAction.apply(v,[e,kt,X,C.yy,b[1],_,t].concat(Rt)),typeof lt<"u")return lt;E&&(l=l.slice(0,-1*E*2),_=_.slice(0,-1*E),t=t.slice(0,-1*E)),l.push(this.productions_[b[1]][0]),_.push(v.$),t.push(v._$),Tt=G[l[l.length-2]][l[l.length-1]],l.push(Tt);break;case 3:return!0}}return!0},"parse")},Nt=(function(){var R={EOF:1,parseError:a.__name(function(c,l){if(this.yy.parser)this.yy.parser.parseError(c,l);else throw new Error(c)},"parseError"),setInput:a.__name(function(r,c){return this.yy=c||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a.__name(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var c=r.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:a.__name(function(r){var c=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===n.length?this.yylloc.first_column:0)+n[n.length-l.length].length-l[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:a.__name(function(){return this._more=!0,this},"more"),reject:a.__name(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else 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).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a.__name(function(r){this.unput(this.match.slice(r))},"less"),pastInput:a.__name(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a.__name(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a.__name(function(){var r=this.pastInput(),c=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
|
+
`+c+"^"},"showPosition"),test_match:a.__name(function(r,c){var l,n,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),n=r[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,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(r[0].length),this.matched+=r[0],l=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var t in _)this[t]=_[t];return!1}return!1},"test_match"),next:a.__name(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,c,l,n;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),t=0;t<_.length;t++)if(l=this._input.match(this.rules[_[t]]),l&&(!c||l[0].length>c[0].length)){if(c=l,n=t,this.options.backtrack_lexer){if(r=this.test_match(l,_[t]),r!==!1)return r;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(r=this.test_match(c,_[n]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a.__name(function(){var c=this.next();return c||this.lex()},"lex"),begin:a.__name(function(c){this.conditionStack.push(c)},"begin"),popState:a.__name(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a.__name(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a.__name(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:a.__name(function(c){this.begin(c)},"pushState"),stateStackSize:a.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a.__name(function(c,l,n,_){switch(n){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 70;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 59;case 25:return 56;case 26:return 56;case 27:return 60;case 28:break;case 29:return this.popState(),19;case 30:return l.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 63;case 42:return 65;case 43:return 65;case 44:return 65;case 45:return 63;case 46:return 63;case 47:return 64;case 48:return 64;case 49:return 64;case 50:return 64;case 51:return 64;case 52:return 65;case 53:return 64;case 54:return 65;case 55:return 66;case 56:return 66;case 57:return 66;case 58:return 66;case 59:return 63;case 60:return 64;case 61:return 65;case 62:return 67;case 63:return 68;case 64:return 69;case 65:return 69;case 66:return 68;case 67:return 68;case 68:return 68;case 69:return 41;case 70:return 47;case 71:return 40;case 72:return 48;case 73:return l.yytext[0];case 74:return 6}},"anonymous"),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,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/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,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:1\b)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\s*u\b)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:[0-9])/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,69,70],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,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,71,72,73,74],inclusive:!0}}};return R})();rt.lexer=Nt;function Q(){this.yy={}}return a.__name(Q,"Parser"),Q.prototype=rt,rt.Parser=Q,new Q})();ht.parser=ht;var wt=ht,D,Lt=(D=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=a.setAccTitle,this.getAccTitle=a.getAccTitle,this.setAccDescription=a.setAccDescription,this.getAccDescription=a.getAccDescription,this.setDiagramTitle=a.setDiagramTitle,this.getDiagramTitle=a.getDiagramTitle,this.getConfig=a.__name(()=>a.getConfig2().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)}addEntity(i,o=""){return this.entities.has(i)?!this.entities.get(i)?.alias&&o&&(this.entities.get(i).alias=o,a.log.info(`Add alias '${o}' to entity '${i}'`)):(this.entities.set(i,{id:`entity-${i}-${this.entities.size}`,label:i,attributes:[],alias:o,shape:"erBox",look:a.getConfig2().look??"default",cssClasses:"default",cssStyles:[]}),a.log.info("Added new entity :",i)),this.entities.get(i)}getEntity(i){return this.entities.get(i)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(i,o){const d=this.addEntity(i);let h;for(h=o.length-1;h>=0;h--)o[h].keys||(o[h].keys=[]),o[h].comment||(o[h].comment=""),d.attributes.push(o[h]),a.log.debug("Added attribute ",o[h].name)}addRelationship(i,o,d,h){const u=this.entities.get(i),f=this.entities.get(d);if(!u||!f)return;const y={entityA:u.id,roleA:o,entityB:f.id,relSpec:h};this.relationships.push(y),a.log.debug("Added new relationship :",y)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(i){this.direction=i}getCompiledStyles(i){let o=[];for(const d of i){const h=this.classes.get(d);h?.styles&&(o=[...o,...h.styles??[]].map(u=>u.trim())),h?.textStyles&&(o=[...o,...h.textStyles??[]].map(u=>u.trim()))}return o}addCssStyles(i,o){for(const d of i){const h=this.entities.get(d);if(!o||!h)return;for(const u of o)h.cssStyles.push(u)}}addClass(i,o){i.forEach(d=>{let h=this.classes.get(d);h===void 0&&(h={id:d,styles:[],textStyles:[]},this.classes.set(d,h)),o&&o.forEach(function(u){if(/color/.exec(u)){const f=u.replace("fill","bgFill");h.textStyles.push(f)}h.styles.push(u)})})}setClass(i,o){for(const d of i){const h=this.entities.get(d);if(h)for(const u of o)h.cssClasses+=" "+u}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],a.clear()}getData(){const i=[],o=[],d=a.getConfig2();for(const u of this.entities.keys()){const f=this.entities.get(u);f&&(f.cssCompiledStyles=this.getCompiledStyles(f.cssClasses.split(" ")),i.push(f))}let h=0;for(const u of this.relationships){const f={id:a.getEdgeId(u.entityA,u.entityB,{prefix:"id",counter:h++}),type:"normal",curve:"basis",start:u.entityA,end:u.entityB,label:u.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:u.relSpec.cardB.toLowerCase(),arrowTypeEnd:u.relSpec.cardA.toLowerCase(),pattern:u.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:d.look};o.push(f)}return{nodes:i,edges:o,other:{},config:d,direction:"TB"}}},a.__name(D,"ErDB"),D),Ot={};a.__export(Ot,{draw:()=>Vt});var Vt=a.__name(async function(s,i,o,d){a.log.info("REF0:"),a.log.info("Drawing er diagram (unified)",i);const{securityLevel:h,er:u,layout:f}=a.getConfig2(),y=d.db.getData(),k=xt.getDiagramElement(i,h);y.type=d.type,y.layoutAlgorithm=a.getRegisteredLayoutAlgorithm(f),y.config.flowchart.nodeSpacing=u?.nodeSpacing||140,y.config.flowchart.rankSpacing=u?.rankSpacing||80,y.direction=d.db.getDirection(),y.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],y.diagramId=i,await a.render(y,k),y.layoutAlgorithm==="elk"&&k.select(".edges").lower();const w=k.selectAll('[id*="-background"]');Array.from(w).length>0&&w.each(function(){const S=a.select(this),Z=S.attr("id").replace("-background",""),T=k.select(`#${CSS.escape(Z)}`);if(!T.empty()){const L=T.attr("transform");S.attr("transform",L)}});const K=8;a.utils_default.insertTitle(k,"erDiagramTitleText",u?.titleTopMargin??25,d.db.getDiagramTitle()),vt.setupViewPortForSVG(k,K,"erDiagram",u?.useMaxWidth??!0)},"draw"),Mt=a.__name((s,i)=>{const o=Dt.channel,d=o(s,"r"),h=o(s,"g"),u=o(s,"b");return a.rgba(d,h,u,i)},"fade"),Bt=a.__name(s=>`
|
|
7
|
+
.entityBox {
|
|
8
|
+
fill: ${s.mainBkg};
|
|
9
|
+
stroke: ${s.nodeBorder};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.relationshipLabelBox {
|
|
13
|
+
fill: ${s.tertiaryColor};
|
|
14
|
+
opacity: 0.7;
|
|
15
|
+
background-color: ${s.tertiaryColor};
|
|
16
|
+
rect {
|
|
17
|
+
opacity: 0.5;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.labelBkg {
|
|
22
|
+
background-color: ${Mt(s.tertiaryColor,.5)};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.edgeLabel .label {
|
|
26
|
+
fill: ${s.nodeBorder};
|
|
27
|
+
font-size: 14px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.label {
|
|
31
|
+
font-family: ${s.fontFamily};
|
|
32
|
+
color: ${s.nodeTextColor||s.textColor};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.edge-pattern-dashed {
|
|
36
|
+
stroke-dasharray: 8,8;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.node rect,
|
|
40
|
+
.node circle,
|
|
41
|
+
.node ellipse,
|
|
42
|
+
.node polygon
|
|
43
|
+
{
|
|
44
|
+
fill: ${s.mainBkg};
|
|
45
|
+
stroke: ${s.nodeBorder};
|
|
46
|
+
stroke-width: 1px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.relationshipLine {
|
|
50
|
+
stroke: ${s.lineColor};
|
|
51
|
+
stroke-width: 1;
|
|
52
|
+
fill: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.marker {
|
|
56
|
+
fill: none !important;
|
|
57
|
+
stroke: ${s.lineColor} !important;
|
|
58
|
+
stroke-width: 1;
|
|
59
|
+
}
|
|
60
|
+
`,"getStyles"),Ft=Bt,Pt={parser:wt,get db(){return new Lt},renderer:Ot,styles:Ft};exports.diagram=Pt;
|