(t,i="")
| 4 | `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(a){this.unput(this.match.slice(a))},"less"),pastInput:l(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var a=this.pastInput(),n=new Array(a.length+1).join("-");return a+this.upcomingInput()+` |
| 5 | `+n+"^"},"showPosition"),test_match:l(function(a,n){var c,r,u;if(this.options.backtrack_lexer&&(u={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&&(u.yylloc.range=this.yylloc.range.slice(0))),r=a[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},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)return c;if(this._backtrack){for(var e in u)this[e]=u[e];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,n,c,r;this._more||(this.yytext="",this.match="");for(var u=this._currentRules(),e=0;e<u.length;e++)if(c=this._input.match(this.rules[u[e]]),c&&(!n||c[0].length>n[0].length)){if(n=c,r=e,this.options.backtrack_lexer){if(a=this.test_match(c,u[e]),a!==!1)return a;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(a=this.test_match(n,u[r]),a!==!1?a:!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:l(function(){var n=this.next();return n||this.lex()},"lex"),begin:l(function(n){this.conditionStack.push(n)},"begin"),popState:l(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(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:l(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:l(function(n){this.begin(n)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(n,c,r,u){var e=u;switch(r){case 0:return this.begin("acc_title"),24;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),26;break;case 3:return this.popState(),"acc_descr_value";break;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 72;case 16:return 4;case 17:return this.begin("block"),17;break;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 61;case 25:return 58;case 26:return 58;case 27:return 62;case 28:break;case 29:return this.popState(),19;break;case 30:return c.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;break;case 34:return this.popState(),10;break;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;break;case 40:return 43;case 41:return 65;case 42:return 67;case 43:return 67;case 44:return 67;case 45:return 65;case 46:return 65;case 47:return 66;case 48:return 66;case 49:return 66;case 50:return 66;case 51:return 66;case 52:return 67;case 53:return 66;case 54:return 67;case 55:return 68;case 56:return 68;case 57:return 51;case 58:return 68;case 59:return 68;case 60:return 52;case 61:return 48;case 62:return 68;case 63:return 65;case 64:return 66;case 65:return 67;case 66:return 69;case 67:return 70;case 68:return 71;case 69:return 71;case 70:return 70;case 71:return 70;case 72:return 70;case 73:return 41;case 74:return 47;case 75:return 40;case 76:return c.yytext[0];case 77: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,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/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],conditions:{style:{rules:[34,35,36,37,38,73,74],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,69,70,71,72,75,76,77],inclusive:!0}}};return A})();he.lexer=Xe;function $(){this.yy={}}return l($,"Parser"),$.prototype=he,he.Parser=$,new $})();ye.parser=ye;var et=ye,tt=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=Me,this.getAccTitle=Be,this.setAccDescription=Fe,this.getAccDescription=Ye,this.setDiagramTitle=Pe,this.getDiagramTitle=ze,this.getConfig=l(()=>j().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)}static{l(this,"ErDB")}addEntity(t,i=""){return this.entities.has(t)?!this.entities.get(t)?.alias&&i&&(this.entities.get(t).alias=i,v.info(`Add alias '${i}' to entity '${t}'`)):(this.entities.set(t,{id:`entity-${t}-${this.entities.size}`,label:t,attributes:[],alias:i,shape:"erBox",look:j().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),v.info("Added new entity :",t)),this.entities.get(t)}getEntity(t){return this.entities.get(t)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(t,i){let d=this.addEntity(t),o;for(o=i.length-1;o>=0;o--)i[o].keys||(i[o].keys=[]),i[o].comment||(i[o].comment=""),d.attributes.push(i[o]),v.debug("Added attribute ",i[o].name)}addRelationship(t,i,d,o){let h=this.entities.get(t),b=this.entities.get(d);if(!h||!b)return;let R={entityA:h.id,roleA:i,entityB:b.id,relSpec:o};this.relationships.push(R),v.debug("Added new relationship :",R)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(t){this.direction=t}getCompiledStyles(t){let i=[];for(let d of t){let o=this.classes.get(d);o?.styles&&(i=[...i,...o.styles??[]].map(h=>h.trim())),o?.textStyles&&(i=[...i,...o.textStyles??[]].map(h=>h.trim()))}return i}addCssStyles(t,i){for(let d of t){let o=this.entities.get(d);if(!i||!o)return;for(let h of i)o.cssStyles.push(h)}}addClass(t,i){t.forEach(d=>{let o=this.classes.get(d);o===void 0&&(o={id:d,styles:[],textStyles:[]},this.classes.set(d,o)),i&&i.forEach(function(h){if(/color/.exec(h)){let b=h.replace("fill","bgFill");o.textStyles.push(b)}o.styles.push(h)})})}setClass(t,i){for(let d of t){let o=this.entities.get(d);if(o)for(let h of i)o.cssClasses+=" "+h}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Ve()}getData(){let t=[],i=[],d=j();for(let h of this.entities.keys()){let b=this.entities.get(h);b&&(b.cssCompiledStyles=this.getCompiledStyles(b.cssClasses.split(" ")),t.push(b))}let o=0;for(let h of this.relationships){let b={id:Ke(h.entityA,h.entityB,{prefix:"id",counter:o++}),type:"normal",curve:"basis",start:h.entityA,end:h.entityB,label:h.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:h.relSpec.cardB.toLowerCase(),arrowTypeEnd:h.relSpec.cardA.toLowerCase(),pattern:h.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:d.look,labelType:"markdown"};i.push(b)}return{nodes:t,edges:i,other:{},config:d,direction:"TB"}}},Qe={};De(Qe,{draw:()=>st});var st=l(function(t,i,d,o){return Ce(this,null,function*(){v.info("REF0:"),v.info("Drawing er diagram (unified)",i);let{securityLevel:h,er:b,layout:R}=j(),k=o.db.getData(),_=je(i,h);k.type=o.type,k.layoutAlgorithm=Ze(R),k.config.flowchart.nodeSpacing=b?.nodeSpacing||140,k.config.flowchart.rankSpacing=b?.rankSpacing||80,k.direction=o.db.getDirection(),k.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],k.diagramId=i,yield Ue(k,_),k.layoutAlgorithm==="elk"&&_.select(".edges").lower();let w=_.selectAll('[id*="-background"]');Array.from(w).length>0&&w.each(function(){let E=ve(this),Q=E.attr("id").replace("-background",""),S=_.select(`#${CSS.escape(Q)}`);if(!S.empty()){let I=S.attr("transform");E.attr("transform",I)}});let W=8;Ge.insertTitle(_,"erDiagramTitleText",b?.titleTopMargin??25,o.db.getDiagramTitle()),We(_,W,"erDiagram",b?.useMaxWidth??!0)})},"draw"),it=l((t,i)=>{let d=we,o=d(t,"r"),h=d(t,"g"),b=d(t,"b");return Le(o,h,b,i)},"fade"),rt=l(t=>` |
| 7 | .entityBox { |
| 8 | fill: ${t.mainBkg}; |
| 9 | stroke: ${t.nodeBorder}; |
no test coverage detected