UNPKG

mermaid

Version:

Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.

99 lines (97 loc) • 23.3 kB
import{a as ce}from"./chunk-CG7VIXT6.mjs";import{a as he}from"./chunk-AEP47HME.mjs";import{b as le,c as de}from"./chunk-UGEUIIAL.mjs";import"./chunk-5LJW3EUZ.mjs";import"./chunk-767MNKTJ.mjs";import"./chunk-3NO356PZ.mjs";import"./chunk-Z2IEFKAF.mjs";import"./chunk-3DCBE5TA.mjs";import"./chunk-JENJ2NYI.mjs";import"./chunk-FRYFDGAD.mjs";import"./chunk-KNGDTZMA.mjs";import"./chunk-UCIVM6JH.mjs";import"./chunk-PNVTB6QF.mjs";import"./chunk-EB7S5WDG.mjs";import"./chunk-VHEAKMU3.mjs";import{$ as O,B,d as ne,e as re,f as se,j as C,u as ae,x as oe}from"./chunk-VLFMOWSA.mjs";import{b as _}from"./chunk-NXZFCOWJ.mjs";import{a as l}from"./chunk-V3YWWTDH.mjs";var Z=(function(){var i=l(function(D,s,n,a){for(n=n||{},a=D.length;a--;n[D[a]]=s);return n},"o"),e=[1,4],o=[1,13],h=[1,12],t=[1,15],d=[1,16],g=[1,20],f=[1,19],b=[6,7,8],E=[1,26],L=[1,24],M=[1,25],p=[6,7,11],I=[1,6,13,15,16,19,22],J=[1,33],K=[1,34],R=[1,6,7,11,13,15,16,19,22],V={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:l(function(s,n,a,c,m,r,A){var u=r.length-1;switch(m){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[u].id),c.addNode(r[u-1].length,r[u].id,r[u].descr,r[u].type);break;case 16:c.getLogger().trace("Icon: ",r[u]),c.decorateNode({icon:r[u]});break;case 17:case 21:c.decorateNode({class:r[u]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[u].id),c.addNode(0,r[u].id,r[u].descr,r[u].type);break;case 20:c.decorateNode({icon:r[u]});break;case 25:c.getLogger().trace("node found ..",r[u-2]),this.$={id:r[u-1],descr:r[u-1],type:c.getType(r[u-2],r[u])};break;case 26:this.$={id:r[u],descr:r[u],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[u-3]),this.$={id:r[u-3],descr:r[u-1],type:c.getType(r[u-2],r[u])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:o,7:[1,10],9:9,12:11,13:h,14:14,15:t,16:d,17:17,18:18,19:g,22:f},i(b,[2,3]),{1:[2,2]},i(b,[2,4]),i(b,[2,5]),{1:[2,6],6:o,12:21,13:h,14:14,15:t,16:d,17:17,18:18,19:g,22:f},{6:o,9:22,12:11,13:h,14:14,15:t,16:d,17:17,18:18,19:g,22:f},{6:E,7:L,10:23,11:M},i(p,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:g,22:f}),i(p,[2,18]),i(p,[2,19]),i(p,[2,20]),i(p,[2,21]),i(p,[2,23]),i(p,[2,24]),i(p,[2,26],{19:[1,30]}),{20:[1,31]},{6:E,7:L,10:32,11:M},{1:[2,7],6:o,12:21,13:h,14:14,15:t,16:d,17:17,18:18,19:g,22:f},i(I,[2,14],{7:J,11:K}),i(R,[2,8]),i(R,[2,9]),i(R,[2,10]),i(p,[2,15]),i(p,[2,16]),i(p,[2,17]),{20:[1,35]},{21:[1,36]},i(I,[2,13],{7:J,11:K}),i(R,[2,11]),i(R,[2,12]),{21:[1,37]},i(p,[2,25]),i(p,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:l(function(s){var n=this,a=[0],c=[],m=[null],r=[],A=this.table,u="",F=0,Q=0,ee=0,fe=2,te=1,ye=r.slice.call(arguments,1),y=Object.create(this.lexer),T={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(T.yy[H]=this.yy[H]);y.setInput(s,T.yy),T.yy.lexer=y,T.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var z=y.yylloc;r.push(z);var be=y.options&&y.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function xe($){a.length=a.length-2*$,m.length=m.length-$,r.length=r.length-$}l(xe,"popStack");function ke(){var $;return $=c.pop()||y.lex()||te,typeof $!="number"&&($ instanceof Array&&(c=$,$=c.pop()),$=n.symbols_[$]||$),$}l(ke,"lex");for(var k,X,w,S,De,W,v={},P,N,ie,j;;){if(w=a[a.length-1],this.defaultActions[w]?S=this.defaultActions[w]:((k===null||typeof k>"u")&&(k=ke()),S=A[w]&&A[w][k]),typeof S>"u"||!S.length||!S[0]){var Y="";j=[];for(P in A[w])this.terminals_[P]&&P>fe&&j.push("'"+this.terminals_[P]+"'");y.showPosition?Y="Parse error on line "+(F+1)+`: `+y.showPosition()+` Expecting `+j.join(", ")+", got '"+(this.terminals_[k]||k)+"'":Y="Parse error on line "+(F+1)+": Unexpected "+(k==te?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(Y,{text:y.match,token:this.terminals_[k]||k,line:y.yylineno,loc:z,expected:j})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+k);switch(S[0]){case 1:a.push(k),m.push(y.yytext),r.push(y.yylloc),a.push(S[1]),k=null,X?(k=X,X=null):(Q=y.yyleng,u=y.yytext,F=y.yylineno,z=y.yylloc,ee>0&&ee--);break;case 2:if(N=this.productions_[S[1]][1],v.$=m[m.length-N],v._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},be&&(v._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),W=this.performAction.apply(v,[u,Q,F,T.yy,S[1],m,r].concat(ye)),typeof W<"u")return W;N&&(a=a.slice(0,-1*N*2),m=m.slice(0,-1*N),r=r.slice(0,-1*N)),a.push(this.productions_[S[1]][0]),m.push(v.$),r.push(v._$),ie=A[a[a.length-2]][a[a.length-1]],a.push(ie);break;case 3:return!0}}return!0},"parse")},me=(function(){var D={EOF:1,parseError:l(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:l(function(s,n){return this.yy=n||this.yy||{},this._input=s,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:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);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),s},"input"),unput:l(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var c=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),a.length-1&&(this.yylineno-=a.length-1);var m=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:a?(a.length===c.length?this.yylloc.first_column:0)+c[c.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(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:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+` `+n+"^"},"showPosition"),test_match:l(function(s,n){var a,c,m;if(this.options.backtrack_lexer&&(m={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&&(m.yylloc.range=this.yylloc.range.slice(0))),c=s[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],a=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var r in m)this[r]=m[r];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,n,a,c;this._more||(this.yytext="",this.match="");for(var m=this._currentRules(),r=0;r<m.length;r++)if(a=this._input.match(this.rules[m[r]]),a&&(!n||a[0].length>n[0].length)){if(n=a,c=r,this.options.backtrack_lexer){if(s=this.test_match(a,m[r]),s!==!1)return s;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(s=this.test_match(n,m[c]),s!==!1?s:!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: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,a,c,m){var r=m;switch(c){case 0:return n.getLogger().trace("Found comment",a.yytext),6;break;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;break;case 4:this.popState();break;case 5:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return n.getLogger().trace("SPACELINE"),6;break;case 7:return 7;case 8:return 15;case 9:n.getLogger().trace("end icon"),this.popState();break;case 10:return n.getLogger().trace("Exploding node"),this.begin("NODE"),19;break;case 11:return n.getLogger().trace("Cloud"),this.begin("NODE"),19;break;case 12:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;break;case 13:return n.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;break;case 14:return this.begin("NODE"),19;break;case 15:return this.begin("NODE"),19;break;case 16:return this.begin("NODE"),19;break;case 17:return this.begin("NODE"),19;break;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return n.getLogger().trace("description:",a.yytext),"NODE_DESCR";break;case 26:this.popState();break;case 27:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";break;case 28:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";break;case 29:return this.popState(),n.getLogger().trace("node end ...",a.yytext),"NODE_DEND";break;case 30:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";break;case 31:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";break;case 32:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";break;case 33:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";break;case 34:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";break;case 35:return n.getLogger().trace("Long description:",a.yytext),20;break;case 36:return n.getLogger().trace("Long description:",a.yytext),20;break}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return D})();V.lexer=me;function G(){this.yy={}}return l(G,"Parser"),G.prototype=V,V.Parser=G,new G})();Z.parser=Z;var pe=Z;var q=12;var x={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},U=class{constructor(){this.nodes=[];this.count=0;this.elements={};this.getLogger=this.getLogger.bind(this),this.nodeType=x,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{l(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let o=this.nodes.length-1;o>=0;o--)if(this.nodes[o].level<e)return this.nodes[o];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(e,o,h,t){_.info("addNode",e,o,h,t);let d=!1;this.nodes.length===0?(this.baseLevel=e,e=0,d=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,d=!1);let g=O(),f=g.mindmap?.padding??C.mindmap.padding;switch(t){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:f*=2;break}let b={id:this.count++,nodeId:B(o,g),level:e,descr:B(h,g),type:t,children:[],width:g.mindmap?.maxNodeWidth??C.mindmap.maxNodeWidth,padding:f,isRoot:d},E=this.getParent(e);if(E)E.children.push(b),this.nodes.push(b);else if(d)this.nodes.push(b);else throw new Error(`There can be only one root. No parent could be found for ("${b.descr}")`)}getType(e,o){switch(_.debug("In get type",e,o),e){case"[":return this.nodeType.RECT;case"(":return o===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,o){this.elements[e]=o}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;let o=O(),h=this.nodes[this.nodes.length-1];e.icon&&(h.icon=B(e.icon,o)),e.class&&(h.class=B(e.class,o))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,o,h=0,t=!1){if(e.level===0?e.section=void 0:e.section=t?(h-1)%(q-1):o,e.children)for(let[d,g]of e.children.entries()){let f=e.level===0?d%(q-1):o;this.assignSections(g,f,h+1,t)}}flattenNodes(e,o){let h=O(),t=["mindmap-node"];e.isRoot===!0?t.push("section-root","section--1"):e.section!==void 0&&t.push(`section-${e.section}`),e.class&&t.push(e.class);let d=t.join(" "),g=l(b=>{let L=(h.theme?.toLowerCase()??"").includes("redux");switch(b){case x.CIRCLE:return"mindmapCircle";case x.RECT:return"rect";case x.ROUNDED_RECT:return"rounded";case x.CLOUD:return"cloud";case x.BANG:return"bang";case x.HEXAGON:return"hexagon";case x.DEFAULT:return L?"rounded":"defaultMindmapNode";case x.NO_BORDER:default:return"rect"}},"getShapeFromType"),f={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:g(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:d,cssStyles:[],centerLabel:!0,look:h.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(o.push(f),e.children)for(let b of e.children)this.flattenNodes(b,o)}generateEdges(e,o){if(!e.children)return;let h=O();for(let t of e.children){let d="edge";t.section!==void 0&&(d+=` section-edge-${t.section}`);let g=e.level+1;d+=` edge-depth-${g}`;let f={id:`edge_${e.id}_${t.id}`,start:e.id.toString(),end:t.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:h.look,classes:d,depth:e.level,section:t.section};o.push(f),this.generateEdges(t,o)}}getData(){let e=this.getMindmap(),o=O(),t=oe().layout!==void 0,d=o;if(t||(d.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:d};_.debug("getData: mindmapRoot",e,o),this.assignSections(e,void 0,0,o.mindmap?.colorBy==="depth");let g=[],f=[];this.flattenNodes(e,g),this.generateEdges(e,f),_.debug(`getData: processed ${g.length} nodes and ${f.length} edges`);let b=new Map;for(let E of g)b.set(E.id,{shape:E.shape,width:E.width,height:E.height,padding:E.padding});return{nodes:g,edges:f,config:d,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(b),type:"mindmap"}}getLogger(){return _}};var Ee=l(async(i,e,o,h)=>{_.debug(`Rendering mindmap diagram `+i);let t=h.db,d=t.getData(),g=ce(e,d.config.securityLevel);if(d.type=h.type,d.layoutAlgorithm=de(d.config.layout,{fallback:"cose-bilkent"}),d.diagramId=e,!t.getMindmap())return;d.nodes.forEach(p=>{p.shape==="rounded"?(p.radius=15,p.taper=15,p.stroke="none",p.width=0,p.padding=15):p.shape==="circle"?p.padding=10:p.shape==="rect"?(p.width=0,p.padding=10):p.shape==="hexagon"&&(p.width=0,p.height=0)}),await le(d,g);let{themeVariables:b}=ae(),{useGradient:E,gradientStart:L,gradientStop:M}=b;if(E&&L&&M){let p=g.attr("id"),I=g.append("defs").append("linearGradient").attr("id",`${p}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");I.append("stop").attr("offset","0%").attr("stop-color",L).attr("stop-opacity",1),I.append("stop").attr("offset","100%").attr("stop-color",M).attr("stop-opacity",1)}he(g,d.config.mindmap?.padding??C.mindmap.padding,"mindmapDiagram",d.config.mindmap?.useMaxWidth??C.mindmap.useMaxWidth)},"draw"),ge={draw:Ee};var $e=l(i=>{let{theme:e,look:o}=i,h="";for(let t=0;t<i.THEME_COLOR_LIMIT;t++)i["lineColor"+t]=i["lineColor"+t]||i["cScaleInv"+t],ne(i["lineColor"+t])?i["lineColor"+t]=re(i["lineColor"+t],20):i["lineColor"+t]=se(i["lineColor"+t],20);for(let t=0;t<i.THEME_COLOR_LIMIT;t++){let d=""+(o==="neo"?Math.max(10-(t-1)*2,2):17-3*t),g=e==="redux"||e==="redux-dark"?i.nodeBorder:i["cScaleLabel"+(e==="neutral"?1:t)];h+=` .section-${t-1} rect, .section-${t-1} path, .section-${t-1} circle, .section-${t-1} polygon, .section-${t-1} path { fill: ${i["cScale"+t]}; } .section-${t-1} text { fill: ${i["cScaleLabel"+t]}; } .section-${t-1} span { color: ${i["cScaleLabel"+t]}; } .node-icon-${t-1} { font-size: 40px; color: ${i["cScaleLabel"+t]}; } .section-edge-${t-1}{ stroke: ${i["cScale"+t]}; } .edge-depth-${t-1}{ stroke-width: ${d}; } .section-${t-1} line { stroke: ${i["cScaleInv"+t]} ; stroke-width: 3; } .disabled, .disabled circle, .disabled text { fill: lightgray; } .disabled text { fill: #efefef; } [data-look="neo"].mindmap-node.section-${t-1} rect, [data-look="neo"].mindmap-node.section-${t-1} path, [data-look="neo"].mindmap-node.section-${t-1} circle, [data-look="neo"].mindmap-node.section-${t-1} polygon { fill: ${e==="redux"||e==="redux-dark"||e==="neutral"?i.mainBkg:i["cScale"+t]}; stroke: ${e==="redux"||e==="redux-dark"?i.nodeBorder:i["cScale"+t]}; stroke-width: ${i.strokeWidth??2}px; } [data-look="neo"].section-edge-${t-1}{ stroke: ${e?.includes("redux")||e==="neo-dark"?i.nodeBorder:i["cScale"+t]}; } [data-look="neo"].mindmap-node.section-${t-1} text, [data-look="neo"].mindmap-node.section-${t-1} span { fill: ${g}; color: ${g}; } `}return h},"genSections"),Se=l((i,e,o)=>{let h="";for(let t=0;t<i;t++)h+=` [data-look="neo"].mindmap-node.section-${t-1} rect, [data-look="neo"].mindmap-node.section-${t-1} path, [data-look="neo"].mindmap-node.section-${t-1} circle, [data-look="neo"].mindmap-node.section-${t-1} polygon { stroke: url(${e}-gradient); fill: ${o}; } .section-${t-1} line { stroke-width: 0; }`;return h},"genGradient"),Ne=l(i=>{let{theme:e}=i,o=i.svgId,h=e?.includes("redux")?i.nodeBorder:i["cScaleLabel"+(e==="neutral"?1:0)],t=i.dropShadow?i.dropShadow.replace("url(#drop-shadow)",`url(${o}-drop-shadow)`):"none";return` .edge { stroke-width: 3; } ${$e(i)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${i.git0}; } .section-root text { fill: ${i.gitBranchLabel0}; } .section-root span { color: ${e?.includes("redux")?i.nodeBorder:i.gitBranchLabel0}; } .icon-container { height:100%; display: flex; justify-content: center; align-items: center; } .edge { fill: none; } .mindmap-node-label { dy: 1em; alignment-baseline: middle; text-anchor: middle; dominant-baseline: middle; text-align: center; } [data-look="neo"].mindmap-node { filter: ${t}; } [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon { fill: ${e?.includes("redux")?i.mainBkg:i.git0}; } [data-look="neo"].mindmap-node.section-root .text-inner-tspan, [data-look="neo"].mindmap-node.section-root span { fill: ${h}; color: ${h}; } ${i.useGradient&&o&&i.mainBkg?Se(i.THEME_COLOR_LIMIT,o,i.mainBkg):""} `},"getStyles"),ue=Ne;var nt={get db(){return new U},renderer:ge,parser:pe,styles:ue};export{nt as diagram};