123 lines
70 KiB
JavaScript
123 lines
70 KiB
JavaScript
import{m as ce}from"./chunk-S4Z6OVSW-D3H4zONb.js";import{o as de}from"./chunk-ZZTKAOFA-wdOG834u.js";import{m as u,O as rt,i as C,W as ue,p as w,N as ge,P as ye,Z as pe,a as B,bh as xe,aW as be,b1 as fe,a_ as me,bi as j,bj as Yt,bk as we,d as Q,h as Le,bl as Se,bm as xt,o as bt,bn as ke}from"./mermaid.esm.min-C3PPQ_C2.js";import{_ as _e}from"./chunk-OMTJKCYW-icim_91v.js";import"./app-COnnofor.js";var ft=(function(){var e=u(function(v,h,p,m){for(p=p||{},m=v.length;m--;p[v[m]]=h);return p},"o"),t=[1,15],a=[1,7],s=[1,13],l=[1,14],r=[1,19],i=[1,16],n=[1,17],o=[1,18],g=[8,30],d=[8,10,21,28,29,30,31,39,43,46],x=[1,23],f=[1,24],b=[8,10,15,16,21,28,29,30,31,39,43,46],L=[8,10,15,16,21,27,28,29,30,31,39,43,46],S=[1,49],k={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(v,h,p,m,E,c,_){var y=c.length-1;switch(E){case 4:m.getLogger().debug("Rule: separator (NL) ");break;case 5:m.getLogger().debug("Rule: separator (Space) ");break;case 6:m.getLogger().debug("Rule: separator (EOF) ");break;case 7:m.getLogger().debug("Rule: hierarchy: ",c[y-1]),m.setHierarchy(c[y-1]);break;case 8:m.getLogger().debug("Stop NL ");break;case 9:m.getLogger().debug("Stop EOF ");break;case 10:m.getLogger().debug("Stop NL2 ");break;case 11:m.getLogger().debug("Stop EOF2 ");break;case 12:m.getLogger().debug("Rule: statement: ",c[y]),typeof c[y].length=="number"?this.$=c[y]:this.$=[c[y]];break;case 13:m.getLogger().debug("Rule: statement #2: ",c[y-1]),this.$=[c[y-1]].concat(c[y]);break;case 14:m.getLogger().debug("Rule: link: ",c[y],v),this.$={edgeTypeStr:c[y],label:""};break;case 15:m.getLogger().debug("Rule: LABEL link: ",c[y-3],c[y-1],c[y]),this.$={edgeTypeStr:c[y],label:c[y-1]};break;case 18:let A=parseInt(c[y]),O=m.generateId();this.$={id:O,type:"space",label:"",width:A,children:[]};break;case 23:m.getLogger().debug("Rule: (nodeStatement link node) ",c[y-2],c[y-1],c[y]," typestr: ",c[y-1].edgeTypeStr);let q=m.edgeStrToEdgeData(c[y-1].edgeTypeStr);this.$=[{id:c[y-2].id,label:c[y-2].label,type:c[y-2].type,directions:c[y-2].directions},{id:c[y-2].id+"-"+c[y].id,start:c[y-2].id,end:c[y].id,label:c[y-1].label,type:"edge",directions:c[y].directions,arrowTypeEnd:q,arrowTypeStart:"arrow_open"},{id:c[y].id,label:c[y].label,type:m.typeStr2Type(c[y].typeStr),directions:c[y].directions}];break;case 24:m.getLogger().debug("Rule: nodeStatement (abc88 node size) ",c[y-1],c[y]),this.$={id:c[y-1].id,label:c[y-1].label,type:m.typeStr2Type(c[y-1].typeStr),directions:c[y-1].directions,widthInColumns:parseInt(c[y],10)};break;case 25:m.getLogger().debug("Rule: nodeStatement (node) ",c[y]),this.$={id:c[y].id,label:c[y].label,type:m.typeStr2Type(c[y].typeStr),directions:c[y].directions,widthInColumns:1};break;case 26:m.getLogger().debug("APA123",this?this:"na"),m.getLogger().debug("COLUMNS: ",c[y]),this.$={type:"column-setting",columns:c[y]==="auto"?-1:parseInt(c[y])};break;case 27:m.getLogger().debug("Rule: id-block statement : ",c[y-2],c[y-1]),m.generateId(),this.$={...c[y-2],type:"composite",children:c[y-1]};break;case 28:m.getLogger().debug("Rule: blockStatement : ",c[y-2],c[y-1],c[y]);let K=m.generateId();this.$={id:K,type:"composite",label:"",children:c[y-1]};break;case 29:m.getLogger().debug("Rule: node (NODE_ID separator): ",c[y]),this.$={id:c[y]};break;case 30:m.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",c[y-1],c[y]),this.$={id:c[y-1],label:c[y].label,typeStr:c[y].typeStr,directions:c[y].directions};break;case 31:m.getLogger().debug("Rule: dirList: ",c[y]),this.$=[c[y]];break;case 32:m.getLogger().debug("Rule: dirList: ",c[y-1],c[y]),this.$=[c[y-1]].concat(c[y]);break;case 33:m.getLogger().debug("Rule: nodeShapeNLabel: ",c[y-2],c[y-1],c[y]),this.$={typeStr:c[y-2]+c[y],label:c[y-1]};break;case 34:m.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",c[y-3],c[y-2]," #3:",c[y-1],c[y]),this.$={typeStr:c[y-3]+c[y],label:c[y-2],directions:c[y-1]};break;case 35:case 36:this.$={type:"classDef",id:c[y-1].trim(),css:c[y].trim()};break;case 37:this.$={type:"applyClass",id:c[y-1].trim(),styleClass:c[y].trim()};break;case 38:this.$={type:"applyStyles",id:c[y-1].trim(),stylesStr:c[y].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:l,31:r,39:i,43:n,46:o},{8:[1,20]},e(g,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:l,31:r,39:i,43:n,46:o}),e(d,[2,16],{14:22,15:x,16:f}),e(d,[2,17]),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),e(d,[2,21]),e(d,[2,22]),e(b,[2,25],{27:[1,25]}),e(d,[2,26]),{19:26,26:12,31:r},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:l,31:r,39:i,43:n,46:o},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(L,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(g,[2,13]),{26:35,31:r},{31:[2,14]},{17:[1,36]},e(b,[2,24]),{10:t,11:37,13:4,14:22,15:x,16:f,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:l,31:r,39:i,43:n,46:o},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(L,[2,30]),{18:[1,43]},{18:[1,44]},e(b,[2,23]),{18:[1,45]},{30:[1,46]},e(d,[2,28]),e(d,[2,35]),e(d,[2,36]),e(d,[2,37]),e(d,[2,38]),{36:[1,47]},{33:48,34:S},{15:[1,50]},e(d,[2,27]),e(L,[2,33]),{38:[1,51]},{33:52,34:S,38:[2,31]},{31:[2,15]},e(L,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(v,h){if(h.recoverable)this.trace(v);else{var p=new Error(v);throw p.hash=h,p}},"parseError"),parse:u(function(v){var h=this,p=[0],m=[],E=[null],c=[],_=this.table,y="",A=0,O=0,q=0,K=2,Nt=1,le=c.slice.call(arguments,1),R=Object.create(this.lexer),V={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(V.yy[dt]=this.yy[dt]);R.setInput(v,V.yy),V.yy.lexer=R,V.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var ut=R.yylloc;c.push(ut);var oe=R.options&&R.options.ranges;typeof V.yy.parseError=="function"?this.parseError=V.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function he(Y){p.length=p.length-2*Y,E.length=E.length-Y,c.length=c.length-Y}u(he,"popStack");function $t(){var Y;return Y=m.pop()||R.lex()||Nt,typeof Y!="number"&&(Y instanceof Array&&(m=Y,Y=m.pop()),Y=h.symbols_[Y]||Y),Y}u($t,"lex");for(var P,gt,J,X,qr,yt,G={},at,Z,Tt,it;;){if(J=p[p.length-1],this.defaultActions[J]?X=this.defaultActions[J]:((P===null||typeof P>"u")&&(P=$t()),X=_[J]&&_[J][P]),typeof X>"u"||!X.length||!X[0]){var pt="";it=[];for(at in _[J])this.terminals_[at]&&at>K&&it.push("'"+this.terminals_[at]+"'");R.showPosition?pt="Parse error on line "+(A+1)+`:
|
|
`+R.showPosition()+`
|
|
Expecting `+it.join(", ")+", got '"+(this.terminals_[P]||P)+"'":pt="Parse error on line "+(A+1)+": Unexpected "+(P==Nt?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(pt,{text:R.match,token:this.terminals_[P]||P,line:R.yylineno,loc:ut,expected:it})}if(X[0]instanceof Array&&X.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+P);switch(X[0]){case 1:p.push(P),E.push(R.yytext),c.push(R.yylloc),p.push(X[1]),P=null,gt?(P=gt,gt=null):(O=R.yyleng,y=R.yytext,A=R.yylineno,ut=R.yylloc,q>0);break;case 2:if(Z=this.productions_[X[1]][1],G.$=E[E.length-Z],G._$={first_line:c[c.length-(Z||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(Z||1)].first_column,last_column:c[c.length-1].last_column},oe&&(G._$.range=[c[c.length-(Z||1)].range[0],c[c.length-1].range[1]]),yt=this.performAction.apply(G,[y,O,A,V.yy,X[1],E,c].concat(le)),typeof yt<"u")return yt;Z&&(p=p.slice(0,-1*Z*2),E=E.slice(0,-1*Z),c=c.slice(0,-1*Z)),p.push(this.productions_[X[1]][0]),E.push(G.$),c.push(G._$),Tt=_[p[p.length-2]][p[p.length-1]],p.push(Tt);break;case 3:return!0}}return!0},"parse")},T=(function(){var v={EOF:1,parseError:u(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:u(function(h,p){return this.yy=p||this.yy||{},this._input=h,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:u(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var p=h.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:u(function(h){var p=h.length,m=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var E=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),m.length-1&&(this.yylineno-=m.length-1);var c=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:m?(m.length===E.length?this.yylloc.first_column:0)+E[E.length-m.length].length-m[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[c[0],c[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(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).
|
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(h){this.unput(this.match.slice(h))},"less"),pastInput:u(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var h=this.pastInput(),p=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
|
|
`+p+"^"},"showPosition"),test_match:u(function(h,p){var m,E,c;if(this.options.backtrack_lexer&&(c={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&&(c.yylloc.range=this.yylloc.range.slice(0))),E=h[0].match(/(?:\r\n?|\n).*/g),E&&(this.yylineno+=E.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:E?E[E.length-1].length-E[E.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,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(h[0].length),this.matched+=h[0],m=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack){for(var _ in c)this[_]=c[_];return!1}return!1},"test_match"),next:u(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var h,p,m,E;this._more||(this.yytext="",this.match="");for(var c=this._currentRules(),_=0;_<c.length;_++)if(m=this._input.match(this.rules[c[_]]),m&&(!p||m[0].length>p[0].length)){if(p=m,E=_,this.options.backtrack_lexer){if(h=this.test_match(m,c[_]),h!==!1)return h;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(h=this.test_match(p,c[E]),h!==!1?h:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:u(function(){var h=this.next();return h||this.lex()},"lex"),begin:u(function(h){this.conditionStack.push(h)},"begin"),popState:u(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u(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:u(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:u(function(h){this.begin(h)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:u(function(h,p,m,E){switch(m){case 0:return h.getLogger().debug("Found block-beta"),10;case 1:return h.getLogger().debug("Found id-block"),29;case 2:return h.getLogger().debug("Found block"),10;case 3:h.getLogger().debug(".",p.yytext);break;case 4:h.getLogger().debug("_",p.yytext);break;case 5:return 5;case 6:return p.yytext=-1,28;case 7:return p.yytext=p.yytext.replace(/columns\s+/,""),h.getLogger().debug("COLUMNS (LEX)",p.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:h.getLogger().debug("LEX: POPPING STR:",p.yytext),this.popState();break;case 13:return h.getLogger().debug("LEX: STR end:",p.yytext),"STR";case 14:return p.yytext=p.yytext.replace(/space\:/,""),h.getLogger().debug("SPACE NUM (LEX)",p.yytext),21;case 15:return p.yytext="1",h.getLogger().debug("COLUMNS (LEX)",p.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),h.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),h.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),h.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),h.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),h.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),h.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),h.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),h.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),h.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),h.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),h.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),h.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),h.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),h.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),h.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),h.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),h.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return h.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return h.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return h.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return h.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return h.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return h.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return h.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return h.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return h.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return h.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return h.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return h.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),h.getLogger().debug("LEX ARR START"),37;case 74:return h.getLogger().debug("Lex: NODE_ID",p.yytext),31;case 75:return h.getLogger().debug("Lex: EOF",p.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:h.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:h.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return h.getLogger().debug("LEX: NODE_DESCR:",p.yytext),"NODE_DESCR";case 83:h.getLogger().debug("LEX POPPING"),this.popState();break;case 84:h.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return p.yytext=p.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (right): dir:",p.yytext),"DIR";case 86:return p.yytext=p.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (left):",p.yytext),"DIR";case 87:return p.yytext=p.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (x):",p.yytext),"DIR";case 88:return p.yytext=p.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (y):",p.yytext),"DIR";case 89:return p.yytext=p.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (up):",p.yytext),"DIR";case 90:return p.yytext=p.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (down):",p.yytext),"DIR";case 91:return p.yytext="]>",h.getLogger().debug("Lex (ARROW_DIR end):",p.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return h.getLogger().debug("Lex: LINK","#"+p.yytext+"#"),15;case 93:return h.getLogger().debug("Lex: LINK",p.yytext),15;case 94:return h.getLogger().debug("Lex: LINK",p.yytext),15;case 95:return h.getLogger().debug("Lex: LINK",p.yytext),15;case 96:return h.getLogger().debug("Lex: START_LINK",p.yytext),this.pushState("LLABEL"),16;case 97:return h.getLogger().debug("Lex: START_LINK",p.yytext),this.pushState("LLABEL"),16;case 98:return h.getLogger().debug("Lex: START_LINK",p.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return h.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),h.getLogger().debug("Lex: LINK","#"+p.yytext+"#"),15;case 102:return this.popState(),h.getLogger().debug("Lex: LINK",p.yytext),15;case 103:return this.popState(),h.getLogger().debug("Lex: LINK",p.yytext),15;case 104:return h.getLogger().debug("Lex: COLON",p.yytext),p.yytext=p.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return v})();k.lexer=T;function D(){this.yy={}}return u(D,"Parser"),D.prototype=k,k.Parser=D,new D})();ft.parser=ft;var Ee=ft,H=new Map,kt=[],mt=new Map,It="color",Ct="fill",De="bgFill",Wt=",",ve=B(),lt=new Map,Ne=u(e=>Le.sanitizeText(e,ve),"sanitizeText"),$e=u(function(e,t=""){let a=lt.get(e);a||(a={id:e,styles:[],textStyles:[]},lt.set(e,a)),t?.split(Wt).forEach(s=>{let l=s.replace(/([^;]*);/,"$1").trim();if(RegExp(It).exec(s)){let r=l.replace(Ct,De).replace(It,Ct);a.textStyles.push(r)}a.styles.push(l)})},"addStyleClass"),Te=u(function(e,t=""){let a=H.get(e);t!=null&&(a.styles=t.split(Wt))},"addStyle2Node"),Ie=u(function(e,t){e.split(",").forEach(function(a){let s=H.get(a);if(s===void 0){let l=a.trim();s={id:l,type:"na",children:[]},H.set(l,s)}s.classes||(s.classes=[]),s.classes.push(t)})},"setCssClass"),Xt=u((e,t)=>{let a=e.flat(),s=[],l=a.find(r=>r?.type==="column-setting")?.columns??-1;for(let r of a){if(typeof l=="number"&&l>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>l&&w.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${l}`),r.label&&(r.label=Ne(r.label)),r.type==="classDef"){$e(r.id,r.css);continue}if(r.type==="applyClass"){Ie(r.id,r?.styleClass??"");continue}if(r.type==="applyStyles"){r?.stylesStr&&Te(r.id,r?.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){let i=(mt.get(r.id)??0)+1;mt.set(r.id,i),r.id=i+"-"+r.id,kt.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);let i=H.get(r.id);if(i===void 0?H.set(r.id,r):(r.type!=="na"&&(i.type=r.type),r.label!==r.id&&(i.label=r.label)),r.children&&Xt(r.children,r),r.type==="space"){let n=r.width??1;for(let o=0;o<n;o++){let g=_e(r);g.id=g.id+"-"+o,H.set(g.id,g),s.push(g)}}else i===void 0&&s.push(r)}}t.children=s},"populateBlockDatabase"),_t=[],et={id:"root",type:"composite",children:[],columns:-1},Ce=u(()=>{w.debug("Clear called"),ge(),et={id:"root",type:"composite",children:[],columns:-1},H=new Map([["root",et]]),_t=[],lt=new Map,kt=[],mt=new Map},"clear");function Ut(e){switch(w.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return w.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}u(Ut,"typeStr2Type");function Ht(e){switch(w.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}u(Ht,"edgeTypeStr2Type");function Ft(e){switch(e.replace(/^[\s-]+|[\s-]+$/g,"")){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}u(Ft,"edgeStrToEdgeData");var Bt=0,Be=u(()=>(Bt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Bt),"generateId"),Oe=u(e=>{et.children=e,Xt(e,et),_t=et.children},"setHierarchy"),Re=u(e=>{let t=H.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),ze=u(()=>[...H.values()],"getBlocksFlat"),Ae=u(()=>_t||[],"getBlocks"),Me=u(()=>kt,"getEdges"),Pe=u(e=>H.get(e),"getBlock"),Ye=u(e=>{H.set(e.id,e)},"setBlock"),We=u(()=>w,"getLogger"),Xe=u(function(){return lt},"getClasses"),Ue={getConfig:u(()=>rt().block,"getConfig"),typeStr2Type:Ut,edgeTypeStr2Type:Ht,edgeStrToEdgeData:Ft,getLogger:We,getBlocksFlat:ze,getBlocks:Ae,getEdges:Me,setHierarchy:Oe,getBlock:Pe,setBlock:Ye,getColumns:Re,getClasses:Xe,clear:Ce,generateId:Be},He=Ue,st=u((e,t)=>{let a=ye,s=a(e,"r"),l=a(e,"g"),r=a(e,"b");return pe(s,l,r,t)},"fade"),Fe=u(e=>`.label {
|
|
font-family: ${e.fontFamily};
|
|
color: ${e.nodeTextColor||e.textColor};
|
|
}
|
|
.cluster-label text {
|
|
fill: ${e.titleColor};
|
|
}
|
|
.cluster-label span,p {
|
|
color: ${e.titleColor};
|
|
}
|
|
|
|
|
|
|
|
.label text,span,p {
|
|
fill: ${e.nodeTextColor||e.textColor};
|
|
color: ${e.nodeTextColor||e.textColor};
|
|
}
|
|
|
|
.node rect,
|
|
.node circle,
|
|
.node ellipse,
|
|
.node polygon,
|
|
.node path {
|
|
fill: ${e.mainBkg};
|
|
stroke: ${e.nodeBorder};
|
|
stroke-width: 1px;
|
|
}
|
|
.flowchart-label text {
|
|
text-anchor: middle;
|
|
}
|
|
// .flowchart-label .text-outer-tspan {
|
|
// text-anchor: middle;
|
|
// }
|
|
// .flowchart-label .text-inner-tspan {
|
|
// text-anchor: start;
|
|
// }
|
|
|
|
.node .label {
|
|
text-align: center;
|
|
}
|
|
.node.clickable {
|
|
cursor: pointer;
|
|
}
|
|
|
|
.arrowheadPath {
|
|
fill: ${e.arrowheadColor};
|
|
}
|
|
|
|
.edgePath .path {
|
|
stroke: ${e.lineColor};
|
|
stroke-width: 2.0px;
|
|
}
|
|
|
|
.flowchart-link {
|
|
stroke: ${e.lineColor};
|
|
fill: none;
|
|
}
|
|
|
|
.edgeLabel {
|
|
background-color: ${e.edgeLabelBackground};
|
|
rect {
|
|
opacity: 0.5;
|
|
background-color: ${e.edgeLabelBackground};
|
|
fill: ${e.edgeLabelBackground};
|
|
}
|
|
text-align: center;
|
|
}
|
|
|
|
/* For html labels only */
|
|
.labelBkg {
|
|
background-color: ${st(e.edgeLabelBackground,.5)};
|
|
// background-color:
|
|
}
|
|
|
|
.node .cluster {
|
|
// fill: ${st(e.mainBkg,.5)};
|
|
fill: ${st(e.clusterBkg,.5)};
|
|
stroke: ${st(e.clusterBorder,.2)};
|
|
box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
|
|
stroke-width: 1px;
|
|
}
|
|
|
|
.cluster text {
|
|
fill: ${e.titleColor};
|
|
}
|
|
|
|
.cluster span,p {
|
|
color: ${e.titleColor};
|
|
}
|
|
/* .cluster div {
|
|
color: ${e.titleColor};
|
|
} */
|
|
|
|
div.mermaidTooltip {
|
|
position: absolute;
|
|
text-align: center;
|
|
max-width: 200px;
|
|
padding: 2px;
|
|
font-family: ${e.fontFamily};
|
|
font-size: 12px;
|
|
background: ${e.tertiaryColor};
|
|
border: 1px solid ${e.border2};
|
|
border-radius: 2px;
|
|
pointer-events: none;
|
|
z-index: 100;
|
|
}
|
|
|
|
.flowchartTitleText {
|
|
text-anchor: middle;
|
|
font-size: 18px;
|
|
fill: ${e.textColor};
|
|
}
|
|
${de()}
|
|
`,"getStyles"),je=Fe,Ke=u((e,t,a,s)=>{t.forEach(l=>{ar[l](e,a,s)})},"insertMarkers"),Ze=u((e,t,a)=>{w.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),qe=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).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"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).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")},"composition"),Ve=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).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"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).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")},"aggregation"),Je=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Ge=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Qe=u((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),tr=u((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),er=u((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),rr=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),ar={extension:Ze,composition:qe,aggregation:Ve,dependency:Je,lollipop:Ge,point:Qe,circle:tr,cross:er,barb:rr},ir=Ke,I=B()?.block?.padding??8;function jt(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};let a=t%e,s=Math.floor(t/e);return{px:a,py:s}}u(jt,"calculateBlockPosition");var sr=u(e=>{let t=0,a=0;for(let s of e.children){let{width:l,height:r,x:i,y:n}=s.size??{width:0,height:0,x:0,y:0};w.debug("getMaxChildSize abc95 child:",s.id,"width:",l,"height:",r,"x:",i,"y:",n,s.type),s.type!=="space"&&(l>t&&(t=l/(e.widthInColumns??1)),r>a&&(a=r))}return{width:t,height:a}},"getMaxChildSize");function ot(e,t,a=0,s=0){w.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",a),e?.size?.width||(e.size={width:a,height:s,x:0,y:0});let l=0,r=0;if(e.children?.length>0){for(let b of e.children)ot(b,t);let i=sr(e);l=i.width,r=i.height,w.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",l,r);for(let b of e.children)b.size&&(w.debug(`abc95 Setting size of children of ${e.id} id=${b.id} ${l} ${r} ${JSON.stringify(b.size)}`),b.size.width=l*(b.widthInColumns??1)+I*((b.widthInColumns??1)-1),b.size.height=r,b.size.x=0,b.size.y=0,w.debug(`abc95 updating size of ${e.id} children child:${b.id} maxWidth:${l} maxHeight:${r}`));for(let b of e.children)ot(b,t,l,r);let n=e.columns??-1,o=0;for(let b of e.children)o+=b.widthInColumns??1;let g=e.children.length;n>0&&n<o&&(g=n);let d=Math.ceil(o/g),x=g*(l+I)+I,f=d*(r+I)+I;if(x<a){w.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${a} siblingHeight ${s} width ${x}`),x=a,f=s;let b=(a-g*I-I)/g,L=(s-d*I-I)/d;w.debug("Size indata abc88",e.id,"childWidth",b,"maxWidth",l),w.debug("Size indata abc88",e.id,"childHeight",L,"maxHeight",r),w.debug("Size indata abc88 xSize",g,"padding",I);for(let S of e.children)S.size&&(S.size.width=b,S.size.height=L,S.size.x=0,S.size.y=0)}if(w.debug(`abc95 (finale calc) ${e.id} xSize ${g} ySize ${d} columns ${n}${e.children.length} width=${Math.max(x,e.size?.width||0)}`),x<(e?.size?.width||0)){x=e?.size?.width||0;let b=n>0?Math.min(e.children.length,n):e.children.length;if(b>0){let L=(x-b*I-I)/b;w.debug("abc95 (growing to fit) width",e.id,x,e.size?.width,L);for(let S of e.children)S.size&&(S.size.width=L)}}e.size={width:x,height:f,x:0,y:0}}w.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}u(ot,"setBlockSizes");function Et(e,t){w.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);let a=e.columns??-1;if(w.debug("layoutBlocks columns abc95",e.id,"=>",a,e),e.children&&e.children.length>0){let s=e?.children[0]?.size?.width??0,l=e.children.length*s+(e.children.length-1)*I;w.debug("widthOfChildren 88",l,"posX");let r=0;w.debug("abc91 block?.size?.x",e.id,e?.size?.x);let i=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-I,n=0;for(let o of e.children){let g=e;if(!o.size)continue;let{width:d,height:x}=o.size,{px:f,py:b}=jt(a,r);if(b!=n&&(n=b,i=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-I,w.debug("New row in layout for block",e.id," and child ",o.id,n)),w.debug(`abc89 layout blocks (child) id: ${o.id} Pos: ${r} (px, py) ${f},${b} (${g?.size?.x},${g?.size?.y}) parent: ${g.id} width: ${d}${I}`),g.size){let S=d/2;o.size.x=i+I+S,w.debug(`abc91 layout blocks (calc) px, pyid:${o.id} startingPos=X${i} new startingPosX${o.size.x} ${S} padding=${I} width=${d} halfWidth=${S} => x:${o.size.x} y:${o.size.y} ${o.widthInColumns} (width * (child?.w || 1)) / 2 ${d*(o?.widthInColumns??1)/2}`),i=o.size.x+S,o.size.y=g.size.y-g.size.height/2+b*(x+I)+x/2+I,w.debug(`abc88 layout blocks (calc) px, pyid:${o.id}startingPosX${i}${I}${S}=>x:${o.size.x}y:${o.size.y}${o.widthInColumns}(width * (child?.w || 1)) / 2${d*(o?.widthInColumns??1)/2}`)}o.children&&Et(o);let L=o?.widthInColumns??1;a>0&&(L=Math.min(L,a-r%a)),r+=L,w.debug("abc88 columnsPos",o,r)}}w.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}u(Et,"layoutBlocks");function Dt(e,{minX:t,minY:a,maxX:s,maxY:l}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){let{x:r,y:i,width:n,height:o}=e.size;r-n/2<t&&(t=r-n/2),i-o/2<a&&(a=i-o/2),r+n/2>s&&(s=r+n/2),i+o/2>l&&(l=i+o/2)}if(e.children)for(let r of e.children)({minX:t,minY:a,maxX:s,maxY:l}=Dt(r,{minX:t,minY:a,maxX:s,maxY:l}));return{minX:t,minY:a,maxX:s,maxY:l}}u(Dt,"findBounds");function Kt(e){let t=e.getBlock("root");if(!t)return;ot(t,e,0,0),Et(t),w.debug("getBlocks",JSON.stringify(t,null,2));let{minX:a,minY:s,maxX:l,maxY:r}=Dt(t),i=r-s,n=l-a;return{x:a,y:s,width:n,height:i}}u(Kt,"layout");function wt(e,t){t&&e.attr("style",t)}u(wt,"applyStyle");function Zt(e,t){let a=C(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),s=a.append("xhtml:div"),l=e.label,r=e.isNode?"nodeLabel":"edgeLabel",i=s.append("span");return i.html(bt(l,t)),wt(i,e.labelStyle),i.attr("class",r),wt(s,e.labelStyle),s.style("display","inline-block"),s.style("white-space","nowrap"),s.attr("xmlns","http://www.w3.org/1999/xhtml"),a.node()}u(Zt,"addHtmlLabel");var nr=u(async(e,t,a,s)=>{let l=e||"";typeof l=="object"&&(l=l[0]);let r=B();if(j(r.flowchart.htmlLabels)){l=l.replace(/\\n|\n/g,"<br />"),w.debug("vertexText"+l);let i=await Se(xt(l)),n={isNode:s,label:i,labelStyle:t.replace("fill:","color:")};return Zt(n,r)}else{let i=document.createElementNS("http://www.w3.org/2000/svg","text");i.setAttribute("style",t.replace("color:","fill:"));let n=[];typeof l=="string"?n=l.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(l)?n=l:n=[];for(let o of n){let g=document.createElementNS("http://www.w3.org/2000/svg","tspan");g.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),g.setAttribute("dy","1em"),g.setAttribute("x","0"),a?g.setAttribute("class","title-row"):g.setAttribute("class","row"),g.textContent=o.trim(),i.appendChild(g)}return i}},"createLabel"),U=nr,lr=u((e,t,a,s,l)=>{t.arrowTypeStart&&Ot(e,"start",t.arrowTypeStart,a,s,l),t.arrowTypeEnd&&Ot(e,"end",t.arrowTypeEnd,a,s,l)},"addEdgeMarkers"),or={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Ot=u((e,t,a,s,l,r)=>{let i=or[a];if(!i){w.warn(`Unknown arrow type: ${a}`);return}let n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${s}#${l}_${r}-${i}${n})`)},"addEdgeMarker"),Lt={},M={},hr=u(async(e,t)=>{let a=B(),s=j(a.flowchart.htmlLabels),l=t.labelType==="markdown"?Yt(e,t.label,{style:t.labelStyle,useHtmlLabels:s,addSvgBackground:!0},a):await U(t.label,t.labelStyle),r=e.insert("g").attr("class","edgeLabel"),i=r.insert("g").attr("class","label");i.node().appendChild(l);let n=l.getBBox();if(s){let g=l.children[0],d=C(l);n=g.getBoundingClientRect(),d.attr("width",n.width),d.attr("height",n.height)}i.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),Lt[t.id]=r,t.width=n.width,t.height=n.height;let o;if(t.startLabelLeft){let g=await U(t.startLabelLeft,t.labelStyle),d=e.insert("g").attr("class","edgeTerminals"),x=d.insert("g").attr("class","inner");o=x.node().appendChild(g);let f=g.getBBox();x.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),M[t.id]||(M[t.id]={}),M[t.id].startLeft=d,tt(o,t.startLabelLeft)}if(t.startLabelRight){let g=await U(t.startLabelRight,t.labelStyle),d=e.insert("g").attr("class","edgeTerminals"),x=d.insert("g").attr("class","inner");o=d.node().appendChild(g),x.node().appendChild(g);let f=g.getBBox();x.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),M[t.id]||(M[t.id]={}),M[t.id].startRight=d,tt(o,t.startLabelRight)}if(t.endLabelLeft){let g=await U(t.endLabelLeft,t.labelStyle),d=e.insert("g").attr("class","edgeTerminals"),x=d.insert("g").attr("class","inner");o=x.node().appendChild(g);let f=g.getBBox();x.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),d.node().appendChild(g),M[t.id]||(M[t.id]={}),M[t.id].endLeft=d,tt(o,t.endLabelLeft)}if(t.endLabelRight){let g=await U(t.endLabelRight,t.labelStyle),d=e.insert("g").attr("class","edgeTerminals"),x=d.insert("g").attr("class","inner");o=x.node().appendChild(g);let f=g.getBBox();x.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),d.node().appendChild(g),M[t.id]||(M[t.id]={}),M[t.id].endRight=d,tt(o,t.endLabelRight)}return l},"insertEdgeLabel");function tt(e,t){B().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}u(tt,"setTerminalWidth");var cr=u((e,t)=>{w.debug("Moving label abc88 ",e.id,e.label,Lt[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath,s=B(),{subGraphTitleTotalMargin:l}=we(s);if(e.label){let r=Lt[e.id],i=e.x,n=e.y;if(a){let o=Q.calcLabelPosition(a);w.debug("Moving label "+e.label+" from (",i,",",n,") to (",o.x,",",o.y,") abc88"),t.updatedPath&&(i=o.x,n=o.y)}r.attr("transform",`translate(${i}, ${n+l/2})`)}if(e.startLabelLeft){let r=M[e.id].startLeft,i=e.x,n=e.y;if(a){let o=Q.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);i=o.x,n=o.y}r.attr("transform",`translate(${i}, ${n})`)}if(e.startLabelRight){let r=M[e.id].startRight,i=e.x,n=e.y;if(a){let o=Q.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);i=o.x,n=o.y}r.attr("transform",`translate(${i}, ${n})`)}if(e.endLabelLeft){let r=M[e.id].endLeft,i=e.x,n=e.y;if(a){let o=Q.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);i=o.x,n=o.y}r.attr("transform",`translate(${i}, ${n})`)}if(e.endLabelRight){let r=M[e.id].endRight,i=e.x,n=e.y;if(a){let o=Q.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);i=o.x,n=o.y}r.attr("transform",`translate(${i}, ${n})`)}},"positionEdgeLabel"),dr=u((e,t)=>{let a=e.x,s=e.y,l=Math.abs(t.x-a),r=Math.abs(t.y-s),i=e.width/2,n=e.height/2;return l>=i||r>=n},"outsideNode"),ur=u((e,t,a)=>{w.debug(`intersection calc abc89:
|
|
outsidePoint: ${JSON.stringify(t)}
|
|
insidePoint : ${JSON.stringify(a)}
|
|
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let s=e.x,l=e.y,r=Math.abs(s-a.x),i=e.width/2,n=a.x<t.x?i-r:i+r,o=e.height/2,g=Math.abs(t.y-a.y),d=Math.abs(t.x-a.x);if(Math.abs(l-t.y)*i>Math.abs(s-t.x)*o){let x=a.y<t.y?t.y-o-l:l-o-t.y;n=d*x/g;let f={x:a.x<t.x?a.x+n:a.x-d+n,y:a.y<t.y?a.y+g-x:a.y-g+x};return n===0&&(f.x=t.x,f.y=t.y),d===0&&(f.x=t.x),g===0&&(f.y=t.y),w.debug(`abc89 topp/bott calc, Q ${g}, q ${x}, R ${d}, r ${n}`,f),f}else{a.x<t.x?n=t.x-i-s:n=s-i-t.x;let x=g*n/d,f=a.x<t.x?a.x+d-n:a.x-d+n,b=a.y<t.y?a.y+x:a.y-x;return w.debug(`sides calc abc89, Q ${g}, q ${x}, R ${d}, r ${n}`,{_x:f,_y:b}),n===0&&(f=t.x,b=t.y),d===0&&(f=t.x),g===0&&(b=t.y),{x:f,y:b}}},"intersection"),Rt=u((e,t)=>{w.debug("abc88 cutPathAtIntersect",e,t);let a=[],s=e[0],l=!1;return e.forEach(r=>{if(!dr(t,r)&&!l){let i=ur(t,s,r),n=!1;a.forEach(o=>{n=n||o.x===i.x&&o.y===i.y}),a.some(o=>o.x===i.x&&o.y===i.y)||a.push(i),l=!0}else s=r,l||a.push(r)}),a},"cutPathAtIntersect"),gr=u(function(e,t,a,s,l,r,i){let n=a.points;w.debug("abc88 InsertEdge: edge=",a,"e=",t);let o=!1,g=r.node(t.v);var d=r.node(t.w);d?.intersect&&g?.intersect&&(n=n.slice(1,a.points.length-1),n.unshift(g.intersect(n[0])),n.push(d.intersect(n[n.length-1]))),a.toCluster&&(w.debug("to cluster abc88",s[a.toCluster]),n=Rt(a.points,s[a.toCluster].node),o=!0),a.fromCluster&&(w.debug("from cluster abc88",s[a.fromCluster]),n=Rt(n.reverse(),s[a.fromCluster].node).reverse(),o=!0);let x=n.filter(h=>!Number.isNaN(h.y)),f=fe;a.curve&&(l==="graph"||l==="flowchart")&&(f=a.curve);let{x:b,y:L}=xe(a),S=be().x(b).y(L).curve(f),k;switch(a.thickness){case"normal":k="edge-thickness-normal";break;case"thick":k="edge-thickness-thick";break;case"invisible":k="edge-thickness-thick";break;default:k=""}switch(a.pattern){case"solid":k+=" edge-pattern-solid";break;case"dotted":k+=" edge-pattern-dotted";break;case"dashed":k+=" edge-pattern-dashed";break}let T=e.append("path").attr("d",S(x)).attr("id",a.id).attr("class"," "+k+(a.classes?" "+a.classes:"")).attr("style",a.style),D="";(B().flowchart.arrowMarkerAbsolute||B().state.arrowMarkerAbsolute)&&(D=me(!0)),lr(T,a,D,i,l);let v={};return o&&(v.updatedPath=n),v.originalPath=a.points,v},"insertEdge"),yr=u(e=>{let t=new Set;for(let a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},"expandAndDeduplicateDirections"),pr=u((e,t,a)=>{let s=yr(e),l=2,r=t.height+2*a.padding,i=r/l,n=t.width+2*i+a.padding,o=a.padding/2;return s.has("right")&&s.has("left")&&s.has("up")&&s.has("down")?[{x:0,y:0},{x:i,y:0},{x:n/2,y:2*o},{x:n-i,y:0},{x:n,y:0},{x:n,y:-r/3},{x:n+2*o,y:-r/2},{x:n,y:-2*r/3},{x:n,y:-r},{x:n-i,y:-r},{x:n/2,y:-r-2*o},{x:i,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*o,y:-r/2},{x:0,y:-r/3}]:s.has("right")&&s.has("left")&&s.has("up")?[{x:i,y:0},{x:n-i,y:0},{x:n,y:-r/2},{x:n-i,y:-r},{x:i,y:-r},{x:0,y:-r/2}]:s.has("right")&&s.has("left")&&s.has("down")?[{x:0,y:0},{x:i,y:-r},{x:n-i,y:-r},{x:n,y:0}]:s.has("right")&&s.has("up")&&s.has("down")?[{x:0,y:0},{x:n,y:-i},{x:n,y:-r+i},{x:0,y:-r}]:s.has("left")&&s.has("up")&&s.has("down")?[{x:n,y:0},{x:0,y:-i},{x:0,y:-r+i},{x:n,y:-r}]:s.has("right")&&s.has("left")?[{x:i,y:0},{x:i,y:-o},{x:n-i,y:-o},{x:n-i,y:0},{x:n,y:-r/2},{x:n-i,y:-r},{x:n-i,y:-r+o},{x:i,y:-r+o},{x:i,y:-r},{x:0,y:-r/2}]:s.has("up")&&s.has("down")?[{x:n/2,y:0},{x:0,y:-o},{x:i,y:-o},{x:i,y:-r+o},{x:0,y:-r+o},{x:n/2,y:-r},{x:n,y:-r+o},{x:n-i,y:-r+o},{x:n-i,y:-o},{x:n,y:-o}]:s.has("right")&&s.has("up")?[{x:0,y:0},{x:n,y:-i},{x:0,y:-r}]:s.has("right")&&s.has("down")?[{x:0,y:0},{x:n,y:0},{x:0,y:-r}]:s.has("left")&&s.has("up")?[{x:n,y:0},{x:0,y:-i},{x:n,y:-r}]:s.has("left")&&s.has("down")?[{x:n,y:0},{x:0,y:0},{x:n,y:-r}]:s.has("right")?[{x:i,y:-o},{x:i,y:-o},{x:n-i,y:-o},{x:n-i,y:0},{x:n,y:-r/2},{x:n-i,y:-r},{x:n-i,y:-r+o},{x:i,y:-r+o},{x:i,y:-r+o}]:s.has("left")?[{x:i,y:0},{x:i,y:-o},{x:n-i,y:-o},{x:n-i,y:-r+o},{x:i,y:-r+o},{x:i,y:-r},{x:0,y:-r/2}]:s.has("up")?[{x:i,y:-o},{x:i,y:-r+o},{x:0,y:-r+o},{x:n/2,y:-r},{x:n,y:-r+o},{x:n-i,y:-r+o},{x:n-i,y:-o}]:s.has("down")?[{x:n/2,y:0},{x:0,y:-o},{x:i,y:-o},{x:i,y:-r+o},{x:n-i,y:-r+o},{x:n-i,y:-o},{x:n,y:-o}]:[{x:0,y:0}]},"getArrowPoints");function qt(e,t){return e.intersect(t)}u(qt,"intersectNode");var xr=qt;function Vt(e,t,a,s){var l=e.x,r=e.y,i=l-s.x,n=r-s.y,o=Math.sqrt(t*t*n*n+a*a*i*i),g=Math.abs(t*a*i/o);s.x<l&&(g=-g);var d=Math.abs(t*a*n/o);return s.y<r&&(d=-d),{x:l+g,y:r+d}}u(Vt,"intersectEllipse");var Jt=Vt;function Gt(e,t,a){return Jt(e,t,t,a)}u(Gt,"intersectCircle");var br=Gt;function Qt(e,t,a,s){var l,r,i,n,o,g,d,x,f,b,L,S,k,T,D;if(l=t.y-e.y,i=e.x-t.x,o=t.x*e.y-e.x*t.y,f=l*a.x+i*a.y+o,b=l*s.x+i*s.y+o,!(f!==0&&b!==0&&St(f,b))&&(r=s.y-a.y,n=a.x-s.x,g=s.x*a.y-a.x*s.y,d=r*e.x+n*e.y+g,x=r*t.x+n*t.y+g,!(d!==0&&x!==0&&St(d,x))&&(L=l*n-r*i,L!==0)))return S=Math.abs(L/2),k=i*g-n*o,T=k<0?(k-S)/L:(k+S)/L,k=r*o-l*g,D=k<0?(k-S)/L:(k+S)/L,{x:T,y:D}}u(Qt,"intersectLine");function St(e,t){return e*t>0}u(St,"sameSign");var fr=Qt,mr=te;function te(e,t,a){var s=e.x,l=e.y,r=[],i=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(L){i=Math.min(i,L.x),n=Math.min(n,L.y)}):(i=Math.min(i,t.x),n=Math.min(n,t.y));for(var o=s-e.width/2-i,g=l-e.height/2-n,d=0;d<t.length;d++){var x=t[d],f=t[d<t.length-1?d+1:0],b=fr(e,a,{x:o+x.x,y:g+x.y},{x:o+f.x,y:g+f.y});b&&r.push(b)}return r.length?(r.length>1&&r.sort(function(L,S){var k=L.x-a.x,T=L.y-a.y,D=Math.sqrt(k*k+T*T),v=S.x-a.x,h=S.y-a.y,p=Math.sqrt(v*v+h*h);return D<p?-1:D===p?0:1}),r[0]):e}u(te,"intersectPolygon");var wr=u((e,t)=>{var a=e.x,s=e.y,l=t.x-a,r=t.y-s,i=e.width/2,n=e.height/2,o,g;return Math.abs(r)*i>Math.abs(l)*n?(r<0&&(n=-n),o=r===0?0:n*l/r,g=n):(l<0&&(i=-i),o=i,g=l===0?0:i*r/l),{x:a+o,y:s+g}},"intersectRect"),Lr=wr,N={node:xr,circle:br,ellipse:Jt,polygon:mr,rect:Lr},z=u(async(e,t,a,s)=>{let l=B(),r,i=t.useHtmlLabels||j(l.flowchart.htmlLabels);a?r=a:r="node default";let n=e.insert("g").attr("class",r).attr("id",t.domId||t.id),o=n.insert("g").attr("class","label").attr("style",t.labelStyle),g;t.labelText===void 0?g="":g=typeof t.labelText=="string"?t.labelText:t.labelText[0];let d=o.node(),x;t.labelType==="markdown"?x=Yt(o,bt(xt(g),l),{useHtmlLabels:i,width:t.width||l.flowchart.wrappingWidth,classes:"markdown-node-label"},l):x=d.appendChild(await U(bt(xt(g),l),t.labelStyle,!1,s));let f=x.getBBox(),b=t.padding/2;if(j(l.flowchart.htmlLabels)){let L=x.children[0],S=C(x),k=L.getElementsByTagName("img");if(k){let T=g.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...k].map(D=>new Promise(v=>{function h(){if(D.style.display="flex",D.style.flexDirection="column",T){let p=l.fontSize?l.fontSize:window.getComputedStyle(document.body).fontSize,m=parseInt(p,10)*5+"px";D.style.minWidth=m,D.style.maxWidth=m}else D.style.width="100%";v(D)}u(h,"setupImage"),setTimeout(()=>{D.complete&&h()}),D.addEventListener("error",h),D.addEventListener("load",h)})))}f=L.getBoundingClientRect(),S.attr("width",f.width),S.attr("height",f.height)}return i?o.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"):o.attr("transform","translate(0, "+-f.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:n,bbox:f,halfPadding:b,label:o}},"labelHelper"),$=u((e,t)=>{let a=t.node().getBBox();e.width=a.width,e.height=a.height},"updateNodeBounds");function F(e,t,a,s){return e.insert("polygon",":first-child").attr("points",s.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}u(F,"insertPolygonShape");var Sr=u(async(e,t)=>{t.useHtmlLabels||B().flowchart.htmlLabels||(t.centerLabel=!0);let{shapeSvg:a,bbox:s,halfPadding:l}=await z(e,t,"node "+t.classes,!0);w.info("Classes = ",t.classes);let r=a.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-s.width/2-l).attr("y",-s.height/2-l).attr("width",s.width+t.padding).attr("height",s.height+t.padding),$(t,r),t.intersect=function(i){return N.rect(t,i)},a},"note"),kr=Sr,zt=u(e=>e?" "+e:"","formatClass"),W=u((e,t)=>`${t||"node default"}${zt(e.classes)} ${zt(e.class)}`,"getClassesFromNode"),At=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await z(e,t,W(t,void 0),!0),l=s.width+t.padding,r=s.height+t.padding,i=l+r,n=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];w.info("Question main (Circle)");let o=F(a,i,i,n);return o.attr("style",t.style),$(t,o),t.intersect=function(g){return w.warn("Intersect called"),N.polygon(t,n,g)},a},"question"),_r=u((e,t)=>{let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=28,l=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}];return a.insert("polygon",":first-child").attr("points",l.map(function(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return N.circle(t,14,r)},a},"choice"),Er=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await z(e,t,W(t,void 0),!0),l=4,r=s.height+t.padding,i=r/l,n=s.width+2*i+t.padding,o=[{x:i,y:0},{x:n-i,y:0},{x:n,y:-r/2},{x:n-i,y:-r},{x:i,y:-r},{x:0,y:-r/2}],g=F(a,n,r,o);return g.attr("style",t.style),$(t,g),t.intersect=function(d){return N.polygon(t,o,d)},a},"hexagon"),Dr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await z(e,t,void 0,!0),l=2,r=s.height+2*t.padding,i=r/l,n=s.width+2*i+t.padding,o=pr(t.directions,s,t),g=F(a,n,r,o);return g.attr("style",t.style),$(t,g),t.intersect=function(d){return N.polygon(t,o,d)},a},"block_arrow"),vr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await z(e,t,W(t,void 0),!0),l=s.width+t.padding,r=s.height+t.padding,i=[{x:-r/2,y:0},{x:l,y:0},{x:l,y:-r},{x:-r/2,y:-r},{x:0,y:-r/2}];return F(a,l,r,i).attr("style",t.style),t.width=l+r,t.height=r,t.intersect=function(n){return N.polygon(t,i,n)},a},"rect_left_inv_arrow"),Nr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await z(e,t,W(t),!0),l=s.width+t.padding,r=s.height+t.padding,i=[{x:-2*r/6,y:0},{x:l-r/6,y:0},{x:l+2*r/6,y:-r},{x:r/6,y:-r}],n=F(a,l,r,i);return n.attr("style",t.style),$(t,n),t.intersect=function(o){return N.polygon(t,i,o)},a},"lean_right"),$r=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await z(e,t,W(t,void 0),!0),l=s.width+t.padding,r=s.height+t.padding,i=[{x:2*r/6,y:0},{x:l+r/6,y:0},{x:l-2*r/6,y:-r},{x:-r/6,y:-r}],n=F(a,l,r,i);return n.attr("style",t.style),$(t,n),t.intersect=function(o){return N.polygon(t,i,o)},a},"lean_left"),Tr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await z(e,t,W(t,void 0),!0),l=s.width+t.padding,r=s.height+t.padding,i=[{x:-2*r/6,y:0},{x:l+2*r/6,y:0},{x:l-r/6,y:-r},{x:r/6,y:-r}],n=F(a,l,r,i);return n.attr("style",t.style),$(t,n),t.intersect=function(o){return N.polygon(t,i,o)},a},"trapezoid"),Ir=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await z(e,t,W(t,void 0),!0),l=s.width+t.padding,r=s.height+t.padding,i=[{x:r/6,y:0},{x:l-r/6,y:0},{x:l+2*r/6,y:-r},{x:-2*r/6,y:-r}],n=F(a,l,r,i);return n.attr("style",t.style),$(t,n),t.intersect=function(o){return N.polygon(t,i,o)},a},"inv_trapezoid"),Cr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await z(e,t,W(t,void 0),!0),l=s.width+t.padding,r=s.height+t.padding,i=[{x:0,y:0},{x:l+r/2,y:0},{x:l,y:-r/2},{x:l+r/2,y:-r},{x:0,y:-r}],n=F(a,l,r,i);return n.attr("style",t.style),$(t,n),t.intersect=function(o){return N.polygon(t,i,o)},a},"rect_right_inv_arrow"),Br=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await z(e,t,W(t,void 0),!0),l=s.width+t.padding,r=l/2,i=r/(2.5+l/50),n=s.height+i+t.padding,o="M 0,"+i+" a "+r+","+i+" 0,0,0 "+l+" 0 a "+r+","+i+" 0,0,0 "+-l+" 0 l 0,"+n+" a "+r+","+i+" 0,0,0 "+l+" 0 l 0,"+-n,g=a.attr("label-offset-y",i).insert("path",":first-child").attr("style",t.style).attr("d",o).attr("transform","translate("+-l/2+","+-(n/2+i)+")");return $(t,g),t.intersect=function(d){let x=N.rect(t,d),f=x.x-t.x;if(r!=0&&(Math.abs(f)<t.width/2||Math.abs(f)==t.width/2&&Math.abs(x.y-t.y)>t.height/2-i)){let b=i*i*(1-f*f/(r*r));b!=0&&(b=Math.sqrt(b)),b=i-b,d.y-t.y>0&&(b=-b),x.y+=b}return x},a},"cylinder"),Or=u(async(e,t)=>{let{shapeSvg:a,bbox:s,halfPadding:l}=await z(e,t,"node "+t.classes+" "+t.class,!0),r=a.insert("rect",":first-child"),i=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,o=t.positioned?-i/2:-s.width/2-l,g=t.positioned?-n/2:-s.height/2-l;if(r.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",g).attr("width",i).attr("height",n),t.props){let d=new Set(Object.keys(t.props));t.props.borders&&(ht(r,t.props.borders,i,n),d.delete("borders")),d.forEach(x=>{w.warn(`Unknown node property ${x}`)})}return $(t,r),t.intersect=function(d){return N.rect(t,d)},a},"rect"),Rr=u(async(e,t)=>{let{shapeSvg:a,bbox:s,halfPadding:l}=await z(e,t,"node "+t.classes,!0),r=a.insert("rect",":first-child"),i=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,o=t.positioned?-i/2:-s.width/2-l,g=t.positioned?-n/2:-s.height/2-l;if(r.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",g).attr("width",i).attr("height",n),t.props){let d=new Set(Object.keys(t.props));t.props.borders&&(ht(r,t.props.borders,i,n),d.delete("borders")),d.forEach(x=>{w.warn(`Unknown node property ${x}`)})}return $(t,r),t.intersect=function(d){return N.rect(t,d)},a},"composite"),zr=u(async(e,t)=>{let{shapeSvg:a}=await z(e,t,"label",!0);w.trace("Classes = ",t.class);let s=a.insert("rect",":first-child"),l=0,r=0;if(s.attr("width",l).attr("height",r),a.attr("class","label edgeLabel"),t.props){let i=new Set(Object.keys(t.props));t.props.borders&&(ht(s,t.props.borders,l,r),i.delete("borders")),i.forEach(n=>{w.warn(`Unknown node property ${n}`)})}return $(t,s),t.intersect=function(i){return N.rect(t,i)},a},"labelRect");function ht(e,t,a,s){let l=[],r=u(n=>{l.push(n,0)},"addBorder"),i=u(n=>{l.push(0,n)},"skipBorder");t.includes("t")?(w.debug("add top border"),r(a)):i(a),t.includes("r")?(w.debug("add right border"),r(s)):i(s),t.includes("b")?(w.debug("add bottom border"),r(a)):i(a),t.includes("l")?(w.debug("add left border"),r(s)):i(s),e.attr("stroke-dasharray",l.join(" "))}u(ht,"applyNodePropertyBorders");var Ar=u(async(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";let s=e.insert("g").attr("class",a).attr("id",t.domId||t.id),l=s.insert("rect",":first-child"),r=s.insert("line"),i=s.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText,o="";typeof n=="object"?o=n[0]:o=n,w.info("Label text abc79",o,n,typeof n=="object");let g=i.node().appendChild(await U(o,t.labelStyle,!0,!0)),d={width:0,height:0};if(j(B().flowchart.htmlLabels)){let S=g.children[0],k=C(g);d=S.getBoundingClientRect(),k.attr("width",d.width),k.attr("height",d.height)}w.info("Text 2",n);let x=n.slice(1,n.length),f=g.getBBox(),b=i.node().appendChild(await U(x.join?x.join("<br/>"):x,t.labelStyle,!0,!0));if(j(B().flowchart.htmlLabels)){let S=b.children[0],k=C(b);d=S.getBoundingClientRect(),k.attr("width",d.width),k.attr("height",d.height)}let L=t.padding/2;return C(b).attr("transform","translate( "+(d.width>f.width?0:(f.width-d.width)/2)+", "+(f.height+L+5)+")"),C(g).attr("transform","translate( "+(d.width<f.width?0:-(f.width-d.width)/2)+", 0)"),d=i.node().getBBox(),i.attr("transform","translate("+-d.width/2+", "+(-d.height/2-L+3)+")"),l.attr("class","outer title-state").attr("x",-d.width/2-L).attr("y",-d.height/2-L).attr("width",d.width+t.padding).attr("height",d.height+t.padding),r.attr("class","divider").attr("x1",-d.width/2-L).attr("x2",d.width/2+L).attr("y1",-d.height/2-L+f.height+L).attr("y2",-d.height/2-L+f.height+L),$(t,l),t.intersect=function(S){return N.rect(t,S)},s},"rectWithTitle"),Mr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await z(e,t,W(t,void 0),!0),l=s.height+t.padding,r=s.width+l/4+t.padding,i=a.insert("rect",":first-child").attr("style",t.style).attr("rx",l/2).attr("ry",l/2).attr("x",-r/2).attr("y",-l/2).attr("width",r).attr("height",l);return $(t,i),t.intersect=function(n){return N.rect(t,n)},a},"stadium"),Pr=u(async(e,t)=>{let{shapeSvg:a,bbox:s,halfPadding:l}=await z(e,t,W(t,void 0),!0),r=a.insert("circle",":first-child");return r.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+l).attr("width",s.width+t.padding).attr("height",s.height+t.padding),w.info("Circle main"),$(t,r),t.intersect=function(i){return w.info("Circle intersect",t,s.width/2+l,i),N.circle(t,s.width/2+l,i)},a},"circle"),Yr=u(async(e,t)=>{let{shapeSvg:a,bbox:s,halfPadding:l}=await z(e,t,W(t,void 0),!0),r=5,i=a.insert("g",":first-child"),n=i.insert("circle"),o=i.insert("circle");return i.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+l+r).attr("width",s.width+t.padding+r*2).attr("height",s.height+t.padding+r*2),o.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+l).attr("width",s.width+t.padding).attr("height",s.height+t.padding),w.info("DoubleCircle main"),$(t,n),t.intersect=function(g){return w.info("DoubleCircle intersect",t,s.width/2+l+r,g),N.circle(t,s.width/2+l+r,g)},a},"doublecircle"),Wr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await z(e,t,W(t,void 0),!0),l=s.width+t.padding,r=s.height+t.padding,i=[{x:0,y:0},{x:l,y:0},{x:l,y:-r},{x:0,y:-r},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-r},{x:-8,y:-r},{x:-8,y:0}],n=F(a,l,r,i);return n.attr("style",t.style),$(t,n),t.intersect=function(o){return N.polygon(t,i,o)},a},"subroutine"),Xr=u((e,t)=>{let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child");return s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),$(t,s),t.intersect=function(l){return N.circle(t,7,l)},a},"start"),Mt=u((e,t,a)=>{let s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),l=70,r=10;a==="LR"&&(l=10,r=70);let i=s.append("rect").attr("x",-1*l/2).attr("y",-1*r/2).attr("width",l).attr("height",r).attr("class","fork-join");return $(t,i),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return N.rect(t,n)},s},"forkJoin"),Ur=u((e,t)=>{let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child"),l=a.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),s.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),$(t,l),t.intersect=function(r){return N.circle(t,7,r)},a},"end"),Hr=u(async(e,t)=>{let a=t.padding/2,s=4,l=8,r;t.classes?r="node "+t.classes:r="node default";let i=e.insert("g").attr("class",r).attr("id",t.domId||t.id),n=i.insert("rect",":first-child"),o=i.insert("line"),g=i.insert("line"),d=0,x=s,f=i.insert("g").attr("class","label"),b=0,L=t.classData.annotations?.[0],S=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",k=f.node().appendChild(await U(S,t.labelStyle,!0,!0)),T=k.getBBox();if(j(B().flowchart.htmlLabels)){let c=k.children[0],_=C(k);T=c.getBoundingClientRect(),_.attr("width",T.width),_.attr("height",T.height)}t.classData.annotations[0]&&(x+=T.height+s,d+=T.width);let D=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(B().flowchart.htmlLabels?D+="<"+t.classData.type+">":D+="<"+t.classData.type+">");let v=f.node().appendChild(await U(D,t.labelStyle,!0,!0));C(v).attr("class","classTitle");let h=v.getBBox();if(j(B().flowchart.htmlLabels)){let c=v.children[0],_=C(v);h=c.getBoundingClientRect(),_.attr("width",h.width),_.attr("height",h.height)}x+=h.height+s,h.width>d&&(d=h.width);let p=[];t.classData.members.forEach(async c=>{let _=c.getDisplayDetails(),y=_.displayText;B().flowchart.htmlLabels&&(y=y.replace(/</g,"<").replace(/>/g,">"));let A=f.node().appendChild(await U(y,_.cssStyle?_.cssStyle:t.labelStyle,!0,!0)),O=A.getBBox();if(j(B().flowchart.htmlLabels)){let q=A.children[0],K=C(A);O=q.getBoundingClientRect(),K.attr("width",O.width),K.attr("height",O.height)}O.width>d&&(d=O.width),x+=O.height+s,p.push(A)}),x+=l;let m=[];if(t.classData.methods.forEach(async c=>{let _=c.getDisplayDetails(),y=_.displayText;B().flowchart.htmlLabels&&(y=y.replace(/</g,"<").replace(/>/g,">"));let A=f.node().appendChild(await U(y,_.cssStyle?_.cssStyle:t.labelStyle,!0,!0)),O=A.getBBox();if(j(B().flowchart.htmlLabels)){let q=A.children[0],K=C(A);O=q.getBoundingClientRect(),K.attr("width",O.width),K.attr("height",O.height)}O.width>d&&(d=O.width),x+=O.height+s,m.push(A)}),x+=l,L){let c=(d-T.width)/2;C(k).attr("transform","translate( "+(-1*d/2+c)+", "+-1*x/2+")"),b=T.height+s}let E=(d-h.width)/2;return C(v).attr("transform","translate( "+(-1*d/2+E)+", "+(-1*x/2+b)+")"),b+=h.height+s,o.attr("class","divider").attr("x1",-d/2-a).attr("x2",d/2+a).attr("y1",-x/2-a+l+b).attr("y2",-x/2-a+l+b),b+=l,p.forEach(c=>{C(c).attr("transform","translate( "+-d/2+", "+(-1*x/2+b+l/2)+")");let _=c?.getBBox();b+=(_?.height??0)+s}),b+=l,g.attr("class","divider").attr("x1",-d/2-a).attr("x2",d/2+a).attr("y1",-x/2-a+l+b).attr("y2",-x/2-a+l+b),b+=l,m.forEach(c=>{C(c).attr("transform","translate( "+-d/2+", "+(-1*x/2+b)+")");let _=c?.getBBox();b+=(_?.height??0)+s}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-d/2-a).attr("y",-(x/2)-a).attr("width",d+t.padding).attr("height",x+t.padding),$(t,n),t.intersect=function(c){return N.rect(t,c)},i},"class_box"),Pt={rhombus:At,composite:Rr,question:At,rect:Or,labelRect:zr,rectWithTitle:Ar,choice:_r,circle:Pr,doublecircle:Yr,stadium:Mr,hexagon:Er,block_arrow:Dr,rect_left_inv_arrow:vr,lean_right:Nr,lean_left:$r,trapezoid:Tr,inv_trapezoid:Ir,rect_right_inv_arrow:Cr,cylinder:Br,start:Xr,end:Ur,note:kr,subroutine:Wr,fork:Mt,join:Mt,class_box:Hr},nt={},ee=u(async(e,t,a)=>{let s,l;if(t.link){let r;B().securityLevel==="sandbox"?r="_top":t.linkTarget&&(r=t.linkTarget||"_blank"),s=e.insert("svg:a").attr("xlink:href",t.link).attr("target",r),l=await Pt[t.shape](s,t,a)}else l=await Pt[t.shape](e,t,a),s=l;return t.tooltip&&l.attr("title",t.tooltip),t.class&&l.attr("class","node default "+t.class),nt[t.id]=s,t.haveCallback&&nt[t.id].attr("class",nt[t.id].attr("class")+" clickable"),s},"insertNode"),Fr=u(e=>{let t=nt[e.id];w.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");let a=8,s=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+s-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),s},"positionNode");function vt(e,t,a=!1){let s=e,l="default";(s?.classes?.length||0)>0&&(l=(s?.classes??[]).join(" ")),l=l+" flowchart-label";let r=0,i="",n;switch(s.type){case"round":r=5,i="rect";break;case"composite":r=0,i="composite",n=0;break;case"square":i="rect";break;case"diamond":i="question";break;case"hexagon":i="hexagon";break;case"block_arrow":i="block_arrow";break;case"odd":i="rect_left_inv_arrow";break;case"lean_right":i="lean_right";break;case"lean_left":i="lean_left";break;case"trapezoid":i="trapezoid";break;case"inv_trapezoid":i="inv_trapezoid";break;case"rect_left_inv_arrow":i="rect_left_inv_arrow";break;case"circle":i="circle";break;case"ellipse":i="ellipse";break;case"stadium":i="stadium";break;case"subroutine":i="subroutine";break;case"cylinder":i="cylinder";break;case"group":i="rect";break;case"doublecircle":i="doublecircle";break;default:i="rect"}let o=ke(s?.styles??[]),g=s.label,d=s.size??{width:0,height:0,x:0,y:0};return{labelStyle:o.labelStyle,shape:i,labelText:g,rx:r,ry:r,class:l,style:o.style,id:s.id,directions:s.directions,width:d.width,height:d.height,x:d.x,y:d.y,positioned:a,intersect:void 0,type:s.type,padding:n??rt()?.block?.padding??0}}u(vt,"getNodeFromBlock");async function re(e,t,a){let s=vt(t,a,!1);if(s.type==="group")return;let l=rt(),r=await ee(e,s,{config:l}),i=r.node().getBBox(),n=a.getBlock(s.id);n.size={width:i.width,height:i.height,x:0,y:0,node:r},a.setBlock(n),r.remove()}u(re,"calculateBlockSize");async function ae(e,t,a){let s=vt(t,a,!0);if(a.getBlock(s.id).type!=="space"){let l=rt();await ee(e,s,{config:l}),t.intersect=s?.intersect,Fr(s)}}u(ae,"insertBlockPositioned");async function ct(e,t,a,s){for(let l of t)await s(e,l,a),l.children&&await ct(e,l.children,a,s)}u(ct,"performOperations");async function ie(e,t,a){await ct(e,t,a,re)}u(ie,"calculateBlockSizes");async function se(e,t,a){await ct(e,t,a,ae)}u(se,"insertBlocks");async function ne(e,t,a,s,l){let r=new ce({multigraph:!0,compound:!0});r.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(let i of a)i.size&&r.setNode(i.id,{width:i.size.width,height:i.size.height,intersect:i.intersect});for(let i of t)if(i.start&&i.end){let n=s.getBlock(i.start),o=s.getBlock(i.end);if(n?.size&&o?.size){let g=n.size,d=o.size,x=[{x:g.x,y:g.y},{x:g.x+(d.x-g.x)/2,y:g.y+(d.y-g.y)/2},{x:d.x,y:d.y}];gr(e,{v:i.start,w:i.end,name:i.id},{...i,arrowTypeEnd:i.arrowTypeEnd,arrowTypeStart:i.arrowTypeStart,points:x,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",r,l),i.label&&(await hr(e,{...i,label:i.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:i.arrowTypeEnd,arrowTypeStart:i.arrowTypeStart,points:x,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),cr({...i,x:x[1].x,y:x[1].y},{originalPath:x}))}}}u(ne,"insertEdges");var jr=u(function(e,t){return t.db.getClasses()},"getClasses"),Kr=u(async function(e,t,a,s){let{securityLevel:l,block:r}=rt(),i=s.db,n;l==="sandbox"&&(n=C("#i"+t));let o=l==="sandbox"?C(n.nodes()[0].contentDocument.body):C("body"),g=l==="sandbox"?o.select(`[id="${t}"]`):C(`[id="${t}"]`);ir(g,["point","circle","cross"],s.type,t);let d=i.getBlocks(),x=i.getBlocksFlat(),f=i.getEdges(),b=g.insert("g").attr("class","block");await ie(b,d,i);let L=Kt(i);if(await se(b,d,i),await ne(b,f,x,i,t),L){let S=L,k=Math.max(1,Math.round(.125*(S.width/S.height))),T=S.height+k+10,D=S.width+10,{useMaxWidth:v}=r;ue(g,T,D,!!v),w.debug("Here Bounds",L,S),g.attr("viewBox",`${S.x-5} ${S.y-5} ${S.width+10} ${S.height+10}`)}},"draw"),Zr={draw:Kr,getClasses:jr},ea={parser:Ee,db:He,renderer:Zr,styles:je};export{ea as diagram};
|