PageSourceSearch

https://philippecloutier.com/public/generated/js/vendor_dist/mermaid/dist/erDiagram-52ee5ed7.js

js philippecloutier.com collected 2026-10-02 16:43:32 UTC 42,708 bytes, 931 lines download raw bytes

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

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.