69 lines
21 KiB
JavaScript
69 lines
21 KiB
JavaScript
import{a as dt}from"./chunk-TBF5ZNIQ.mjs";import{a as ut}from"./chunk-T4EQAHMB.mjs";import{b as pt,c as gt}from"./chunk-SK62O5VA.mjs";import"./chunk-5YHUCXBM.mjs";import"./chunk-3ZBQQEZ6.mjs";import"./chunk-BDKIFH7H.mjs";import"./chunk-XODN6PIJ.mjs";import"./chunk-IWDTEBJL.mjs";import"./chunk-D2KP3OBD.mjs";import"./chunk-YLHEXJF3.mjs";import"./chunk-Q3CC2MQB.mjs";import"./chunk-XBXGYYE5.mjs";import{Y as F,d as ot,e as ct,f as lt,j as C,v as ht,z as M}from"./chunk-3UWU4A3N.mjs";import{b as $}from"./chunk-MGPAVIPZ.mjs";import"./chunk-JIN56HTB.mjs";import{a as o}from"./chunk-VELTKBKT.mjs";var W=(function(){var e=o(function(L,s,n,a){for(n=n||{},a=L.length;a--;n[L[a]]=s);return n},"o"),t=[1,4],i=[1,13],l=[1,12],p=[1,15],h=[1,16],m=[1,20],y=[1,19],u=[6,7,8],N=[1,26],K=[1,24],Q=[1,25],k=[6,7,11],tt=[1,6,13,15,16,19,22],et=[1,33],it=[1,34],O=[1,6,7,11,13,15,16,19,22],P={trace:o(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:o(function(s,n,a,c,g,r,I){var d=r.length-1;switch(g){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[d].id),c.addNode(r[d-1].length,r[d].id,r[d].descr,r[d].type);break;case 16:c.getLogger().trace("Icon: ",r[d]),c.decorateNode({icon:r[d]});break;case 17:case 21:c.decorateNode({class:r[d]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[d].id),c.addNode(0,r[d].id,r[d].descr,r[d].type);break;case 20:c.decorateNode({icon:r[d]});break;case 25:c.getLogger().trace("node found ..",r[d-2]),this.$={id:r[d-1],descr:r[d-1],type:c.getType(r[d-2],r[d])};break;case 26:this.$={id:r[d],descr:r[d],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[d-3]),this.$={id:r[d-3],descr:r[d-1],type:c.getType(r[d-2],r[d])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:t},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:t},{6:i,7:[1,10],9:9,12:11,13:l,14:14,15:p,16:h,17:17,18:18,19:m,22:y},e(u,[2,3]),{1:[2,2]},e(u,[2,4]),e(u,[2,5]),{1:[2,6],6:i,12:21,13:l,14:14,15:p,16:h,17:17,18:18,19:m,22:y},{6:i,9:22,12:11,13:l,14:14,15:p,16:h,17:17,18:18,19:m,22:y},{6:N,7:K,10:23,11:Q},e(k,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:m,22:y}),e(k,[2,18]),e(k,[2,19]),e(k,[2,20]),e(k,[2,21]),e(k,[2,23]),e(k,[2,24]),e(k,[2,26],{19:[1,30]}),{20:[1,31]},{6:N,7:K,10:32,11:Q},{1:[2,7],6:i,12:21,13:l,14:14,15:p,16:h,17:17,18:18,19:m,22:y},e(tt,[2,14],{7:et,11:it}),e(O,[2,8]),e(O,[2,9]),e(O,[2,10]),e(k,[2,15]),e(k,[2,16]),e(k,[2,17]),{20:[1,35]},{21:[1,36]},e(tt,[2,13],{7:et,11:it}),e(O,[2,11]),e(O,[2,12]),{21:[1,37]},e(k,[2,25]),e(k,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:o(function(s){var n=this,a=[0],c=[],g=[null],r=[],I=this.table,d="",R=0,nt=0,rt=0,Dt=2,st=1,xt=r.slice.call(arguments,1),f=Object.create(this.lexer),v={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(v.yy[V]=this.yy[V]);f.setInput(s,v.yy),v.yy.lexer=f,v.yy.parser=this,typeof f.yylloc>"u"&&(f.yylloc={});var H=f.yylloc;r.push(H);var Nt=f.options&&f.options.ranges;typeof v.yy.parseError=="function"?this.parseError=v.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ct(D){a.length=a.length-2*D,g.length=g.length-D,r.length=r.length-D}o(Ct,"popStack");function St(){var D;return D=c.pop()||f.lex()||st,typeof D!="number"&&(D instanceof Array&&(c=D,D=c.pop()),D=n.symbols_[D]||D),D}o(St,"lex");for(var E,G,T,x,Ot,X,w={},A,S,at,U;;){if(T=a[a.length-1],this.defaultActions[T]?x=this.defaultActions[T]:((E===null||typeof E>"u")&&(E=St()),x=I[T]&&I[T][E]),typeof x>"u"||!x.length||!x[0]){var z="";U=[];for(A in I[T])this.terminals_[A]&&A>Dt&&U.push("'"+this.terminals_[A]+"'");f.showPosition?z="Parse error on line "+(R+1)+`:
|
|
`+f.showPosition()+`
|
|
Expecting `+U.join(", ")+", got '"+(this.terminals_[E]||E)+"'":z="Parse error on line "+(R+1)+": Unexpected "+(E==st?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(z,{text:f.match,token:this.terminals_[E]||E,line:f.yylineno,loc:H,expected:U})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+T+", token: "+E);switch(x[0]){case 1:a.push(E),g.push(f.yytext),r.push(f.yylloc),a.push(x[1]),E=null,G?(E=G,G=null):(nt=f.yyleng,d=f.yytext,R=f.yylineno,H=f.yylloc,rt>0&&rt--);break;case 2:if(S=this.productions_[x[1]][1],w.$=g[g.length-S],w._$={first_line:r[r.length-(S||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(S||1)].first_column,last_column:r[r.length-1].last_column},Nt&&(w._$.range=[r[r.length-(S||1)].range[0],r[r.length-1].range[1]]),X=this.performAction.apply(w,[d,nt,R,v.yy,x[1],g,r].concat(xt)),typeof X<"u")return X;S&&(a=a.slice(0,-1*S*2),g=g.slice(0,-1*S),r=r.slice(0,-1*S)),a.push(this.productions_[x[1]][0]),g.push(w.$),r.push(w._$),at=I[a[a.length-2]][a[a.length-1]],a.push(at);break;case 3:return!0}}return!0},"parse")},kt=(function(){var L={EOF:1,parseError:o(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:o(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:o(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:o(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 g=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=[g[0],g[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(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:o(function(s){this.unput(this.match.slice(s))},"less"),pastInput:o(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:o(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:o(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
`+n+"^"},"showPosition"),test_match:o(function(s,n){var a,c,g;if(this.options.backtrack_lexer&&(g={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&&(g.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 g)this[r]=g[r];return!1}return!1},"test_match"),next:o(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 g=this._currentRules(),r=0;r<g.length;r++)if(a=this._input.match(this.rules[g[r]]),a&&(!n||a[0].length>n[0].length)){if(n=a,c=r,this.options.backtrack_lexer){if(s=this.test_match(a,g[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,g[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:o(function(){var n=this.next();return n||this.lex()},"lex"),begin:o(function(n){this.conditionStack.push(n)},"begin"),popState:o(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(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:o(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:o(function(n){this.begin(n)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(n,a,c,g){var r=g;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 L})();P.lexer=kt;function j(){this.yy={}}return o(j,"Parser"),j.prototype=P,P.Parser=j,new j})();W.parser=W;var mt=W;var b=[];for(let e=0;e<256;++e)b.push((e+256).toString(16).slice(1));function ft(e,t=0){return(b[e[t+0]]+b[e[t+1]]+b[e[t+2]]+b[e[t+3]]+"-"+b[e[t+4]]+b[e[t+5]]+"-"+b[e[t+6]]+b[e[t+7]]+"-"+b[e[t+8]]+b[e[t+9]]+"-"+b[e[t+10]]+b[e[t+11]]+b[e[t+12]]+b[e[t+13]]+b[e[t+14]]+b[e[t+15]]).toLowerCase()}o(ft,"unsafeStringify");var Y,_t=new Uint8Array(16);function Z(){if(!Y){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Y=crypto.getRandomValues.bind(crypto)}return Y(_t)}o(Z,"rng");var Lt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),q={randomUUID:Lt};function $t(e,t,i){if(q.randomUUID&&!t&&!e)return q.randomUUID();e=e||{};let l=e.random??e.rng?.()??Z();if(l.length<16)throw new Error("Random bytes length must be >= 16");if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,t){if(i=i||0,i<0||i+16>t.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let p=0;p<16;++p)t[i+p]=l[p];return t}return ft(l)}o($t,"v4");var J=$t;var yt=12;var _={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},B=class{constructor(){this.nodes=[];this.count=0;this.elements={};this.getLogger=this.getLogger.bind(this),this.nodeType=_,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{o(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(t){for(let i=this.nodes.length-1;i>=0;i--)if(this.nodes[i].level<t)return this.nodes[i];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(t,i,l,p){$.info("addNode",t,i,l,p);let h=!1;this.nodes.length===0?(this.baseLevel=t,t=0,h=!0):this.baseLevel!==void 0&&(t=t-this.baseLevel,h=!1);let m=F(),y=m.mindmap?.padding??C.mindmap.padding;switch(p){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:y*=2;break}let u={id:this.count++,nodeId:M(i,m),level:t,descr:M(l,m),type:p,children:[],width:m.mindmap?.maxNodeWidth??C.mindmap.maxNodeWidth,padding:y,isRoot:h},N=this.getParent(t);if(N)N.children.push(u),this.nodes.push(u);else if(h)this.nodes.push(u);else throw new Error(`There can be only one root. No parent could be found for ("${u.descr}")`)}getType(t,i){switch($.debug("In get type",t,i),t){case"[":return this.nodeType.RECT;case"(":return i===")"?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(t,i){this.elements[t]=i}getElementById(t){return this.elements[t]}decorateNode(t){if(!t)return;let i=F(),l=this.nodes[this.nodes.length-1];t.icon&&(l.icon=M(t.icon,i)),t.class&&(l.class=M(t.class,i))}type2Str(t){switch(t){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(t,i){if(t.level===0?t.section=void 0:t.section=i,t.children)for(let[l,p]of t.children.entries()){let h=t.level===0?l%(yt-1):i;this.assignSections(p,h)}}flattenNodes(t,i){let l=["mindmap-node"];t.isRoot===!0?l.push("section-root","section--1"):t.section!==void 0&&l.push(`section-${t.section}`),t.class&&l.push(t.class);let p=l.join(" "),h=o(y=>{switch(y){case _.CIRCLE:return"mindmapCircle";case _.RECT:return"rect";case _.ROUNDED_RECT:return"rounded";case _.CLOUD:return"cloud";case _.BANG:return"bang";case _.HEXAGON:return"hexagon";case _.DEFAULT:return"defaultMindmapNode";case _.NO_BORDER:default:return"rect"}},"getShapeFromType"),m={id:t.id.toString(),domId:"node_"+t.id.toString(),label:t.descr,labelType:"markdown",isGroup:!1,shape:h(t.type),width:t.width,height:t.height??0,padding:t.padding,cssClasses:p,cssStyles:[],look:"default",icon:t.icon,x:t.x,y:t.y,level:t.level,nodeId:t.nodeId,type:t.type,section:t.section};if(i.push(m),t.children)for(let y of t.children)this.flattenNodes(y,i)}generateEdges(t,i){if(t.children)for(let l of t.children){let p="edge";l.section!==void 0&&(p+=` section-edge-${l.section}`);let h=t.level+1;p+=` edge-depth-${h}`;let m={id:`edge_${t.id}_${l.id}`,start:t.id.toString(),end:l.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:"default",classes:p,depth:t.level,section:l.section};i.push(m),this.generateEdges(l,i)}}getData(){let t=this.getMindmap(),i=F(),p=ht().layout!==void 0,h=i;if(p||(h.layout="cose-bilkent"),!t)return{nodes:[],edges:[],config:h};$.debug("getData: mindmapRoot",t,i),this.assignSections(t);let m=[],y=[];this.flattenNodes(t,m),this.generateEdges(t,y),$.debug(`getData: processed ${m.length} nodes and ${y.length} edges`);let u=new Map;for(let N of m)u.set(N.id,{shape:N.shape,width:N.width,height:N.height,padding:N.padding});return{nodes:m,edges:y,config:h,rootNode:t,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(u),type:"mindmap",diagramId:"mindmap-"+J()}}getLogger(){return $}};var vt=o(async(e,t,i,l)=>{$.debug(`Rendering mindmap diagram
|
|
`+e);let p=l.db,h=p.getData(),m=dt(t,h.config.securityLevel);h.type=l.type,h.layoutAlgorithm=gt(h.config.layout,{fallback:"cose-bilkent"}),h.diagramId=t,p.getMindmap()&&(h.nodes.forEach(u=>{u.shape==="rounded"?(u.radius=15,u.taper=15,u.stroke="none",u.width=0,u.padding=15):u.shape==="circle"?u.padding=10:u.shape==="rect"&&(u.width=0,u.padding=10)}),await pt(h,m),ut(m,h.config.mindmap?.padding??C.mindmap.padding,"mindmapDiagram",h.config.mindmap?.useMaxWidth??C.mindmap.useMaxWidth))},"draw"),bt={draw:vt};var Tt=o(e=>{let t="";for(let i=0;i<e.THEME_COLOR_LIMIT;i++)e["lineColor"+i]=e["lineColor"+i]||e["cScaleInv"+i],ot(e["lineColor"+i])?e["lineColor"+i]=ct(e["lineColor"+i],20):e["lineColor"+i]=lt(e["lineColor"+i],20);for(let i=0;i<e.THEME_COLOR_LIMIT;i++){let l=""+(17-3*i);t+=`
|
|
.section-${i-1} rect, .section-${i-1} path, .section-${i-1} circle, .section-${i-1} polygon, .section-${i-1} path {
|
|
fill: ${e["cScale"+i]};
|
|
}
|
|
.section-${i-1} text {
|
|
fill: ${e["cScaleLabel"+i]};
|
|
}
|
|
.node-icon-${i-1} {
|
|
font-size: 40px;
|
|
color: ${e["cScaleLabel"+i]};
|
|
}
|
|
.section-edge-${i-1}{
|
|
stroke: ${e["cScale"+i]};
|
|
}
|
|
.edge-depth-${i-1}{
|
|
stroke-width: ${l};
|
|
}
|
|
.section-${i-1} line {
|
|
stroke: ${e["cScaleInv"+i]} ;
|
|
stroke-width: 3;
|
|
}
|
|
|
|
.disabled, .disabled circle, .disabled text {
|
|
fill: lightgray;
|
|
}
|
|
.disabled text {
|
|
fill: #efefef;
|
|
}
|
|
`}return t},"genSections"),wt=o(e=>`
|
|
.edge {
|
|
stroke-width: 3;
|
|
}
|
|
${Tt(e)}
|
|
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
|
|
fill: ${e.git0};
|
|
}
|
|
.section-root text {
|
|
fill: ${e.gitBranchLabel0};
|
|
}
|
|
.section-root span {
|
|
color: ${e.gitBranchLabel0};
|
|
}
|
|
.section-2 span {
|
|
color: ${e.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;
|
|
}
|
|
`,"getStyles"),Et=wt;var xe={get db(){return new B},renderer:bt,parser:mt,styles:Et};export{xe as diagram};
|