2024-08-29 18:38:21 +08:00
import { g as pt , s as ft } from "./chunk-FUIDI54P-PrnwRhHI.js" ; import "./chunk-Z2VRG6XP-BdW_8cnt.js" ; import { d as O1 , _ as l , n as Qe , o as At , s as gt , g as kt , b as bt , c as Et , p as St , q as Dt , l as e1 , u as Ae , r as mt , t as xt , j as m1 , v as Tt , x as Ct , e as yt , y as Ft } from "./index-CFgdrPfe.js" ; import { c as _t } from "./channel-M0IoihHW.js" ; var vt = "flowchart-" , Ze = 0 , P1 = O1 ( ) , g1 = new Map , W = [ ] , j1 = new Map , p1 = [ ] , ge = new Map , ke = new Map , ee = 0 , pe = ! 0 , H , se , re = [ ] , ie = l ( e => yt . sanitizeText ( e , P1 ) , "sanitizeText" ) , ue = l ( function ( e ) { for ( const r of g1 . values ( ) ) if ( r . id === e ) return r . domId ; return e } , "lookUpDomId" ) , Bt = l ( function ( e , r , i , u , n , c , f = { } ) { if ( ! e || e . trim ( ) . length === 0 ) return ; let k , o = g1 . get ( e ) ; o === void 0 && ( o = { id : e , labelType : "text" , domId : vt + e + "-" + Ze , styles : [ ] , classes : [ ] } , g1 . set ( e , o ) ) , Ze ++ , r !== void 0 ? ( P1 = O1 ( ) , k = ie ( r . text . trim ( ) ) , o . labelType = r . type , k . startsWith ( '"' ) && k . endsWith ( '"' ) && ( k = k . substring ( 1 , k . length - 1 ) ) , o . text = k ) : o . text === void 0 && ( o . text = e ) , i !== void 0 && ( o . type = i ) , u != null && u . forEach ( function ( p ) { o . styles . push ( p ) } ) , n != null && n . forEach ( function ( p ) { o . classes . push ( p ) } ) , c !== void 0 && ( o . dir = c ) , o . props === void 0 ? o . props = f : f !== void 0 && Object . assign ( o . props , f ) } , "addVertex" ) , Vt = l ( function ( e , r , i ) { const c = { start : e , end : r , type : void 0 , text : "" , labelType : "text" } ; e1 . info ( "abc78 Got edge..." , c ) ; const f = i . text ; if ( f !== void 0 && ( c . text = ie ( f . text . trim ( ) ) , c . text . startsWith ( '"' ) && c . text . endsWith ( '"' ) && ( c . text = c . text . substring ( 1 , c . text . length - 1 ) ) , c . labelType = f . type ) , i !== void 0 && ( c . type = i . type , c . stroke = i . stroke , c . length = i . length > 10 ? 10 : i . length ) , W . length < ( P1 . maxEdges ? ? 500 ) ) e1 . info ( "Pushing edge..." ) , W . push ( c ) ; else throw new Error ( ` Edge limit exceeded. ${ W . length } edges found, but the limit is ${ P1 . maxEdges } .
2024-08-27 22:31:52 +08:00
Initialize mermaid with maxEdges set to a higher number to allow more edges .
You cannot set this config via configuration inside the diagram as it is a secure config .
You have to call mermaid . initialize . ` )},"addSingleLink"),Lt=l(function(e,r,i){e1.info("addLink",e,r,i);for(const u of e)for(const n of r)Vt(u,n,i)},"addLink"),wt=l(function(e,r){e.forEach(function(i){i==="default"?W.defaultInterpolate=r:W[i].interpolate=r})},"updateLinkInterpolate"),It=l(function(e,r){e.forEach(function(i){var u,n,c,f,k,o;if(typeof i=="number"&&i>=W.length)throw new Error( ` The index $ { i } for linkStyle is out of bounds . Valid indices for linkStyle are between 0 and $ { W . length - 1 } . ( Help : Ensure that the index is within the range of existing edges . ) ` );i==="default"?W.defaultStyle=r:(W[i].style=r,(((n=(u=W[i])==null?void 0:u.style)==null?void 0:n.length)??0)>0&&!((f=(c=W[i])==null?void 0:c.style)!=null&&f.some(p=>p==null?void 0:p.startsWith("fill")))&&((o=(k=W[i])==null?void 0:k.style)==null||o.push("fill:none")))})},"updateLink"),Rt=l(function(e,r){e.split(",").forEach(function(i){let u=j1.get(i);u===void 0&&(u={id:i,styles:[],textStyles:[]},j1.set(i,u)),r!=null&&r.forEach(function(n){if(/color/.exec(n)){const c=n.replace("fill","bgFill");u.textStyles.push(c)}u.styles.push(n)})})},"addClass"),Nt=l(function(e){H=e,/.*</.exec(H)&&(H="RL"),/.* \^ /.exec(H)&&(H="BT"),/.*>/.exec(H)&&(H="LR"),/.*v/.exec(H)&&(H="TB"),H==="TD"&&(H="TB")},"setDirection"),be=l(function(e,r){for(const i of e.split(",")){const u=g1.get(i);u&&u.classes.push(r);const n=ge.get(i);n&&n.classes.push(r)}},"setClass"),Pt=l(function(e,r){if(r!==void 0){r=ie(r);for(const i of e.split(","))ke.set(se==="gen-1"?ue(i):i,r)}},"setTooltip"),Ot=l(function(e,r,i){const u=ue(e);if(O1().securityLevel!=="loose"||r===void 0)return;let n=[];if(typeof i=="string"){n=i.split(/,(?=(?:(?:[^"]*"){2})*[^"]* $ )/);for(let f=0;f<n.length;f++){let k=n[f].trim();k.startsWith('"')&&k.endsWith('"')&&(k=k.substr(1,k.length-2)),n[f]=k}}n.length===0&&n.push(e);const c=g1.get(e);c&&(c.haveCallback=!0,re.push(function(){const f=document.querySelector( ` [ id = "${u}" ] ` );f!==null&&f.addEventListener("click",function(){Ae.runFunc(r,...n)},!1)}))},"setClickFun"),Mt=l(function(e,r,i){e.split(",").forEach(function(u){const n=g1.get(u);n!==void 0&&(n.link=Ae.formatUrl(r,P1),n.linkTarget=i)}),be(e,"clickable")},"setLink"),Je=l(function(e){return ke.get(e)},"getTooltip"),Gt=l(function(e,r,i){e.split(",").forEach(function(u){Ot(u,r,i)}),be(e,"clickable")},"setClickEvent"),Ut=l(function(e){re.forEach(function(r){r(e)})},"bindFunctions"), $ e=l(function(){return H.trim()},"getDirection"),et=l(function(){return g1},"getVertices"),tt=l(function(){return W},"getEdges"),Wt=l(function(){return j1},"getClasses"),st=l(function(e){let r=m1(".mermaidTooltip");(r._groups||r)[0][0]===null&&(r=m1("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),m1(e).select("svg").selectAll("g.node").on("mouseover",function(){const n=m1(this);if(n.attr("title")===null)return;const f=this==null?void 0:this.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(n.attr("title")).style("left",window.scrollX+f.left+(f.right-f.left)/2+"px").style("top",window.scrollY+f.bottom+"px"),r.html(r.html().replace(/<br \/ >/g,"<br/>")),n.classed("hover",!0)}).on("mouseout",function(){r.transition().duration(500).style("opacity",0),m1(this).classed("hover",!1)})},"setupToolTips");re.push(st);var jt=l(function(e="gen-1"){g1=new Map,j1=new Map,W=[],re=[st],p1=[],ge=new Map,ee=0,ke=new Map,pe=!0,se=e,P1=O1(),mt()},"clear"),zt=l(e=>{se=e||"gen-2"},"setGen"),Kt=l(function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},"defaultStyle"),Yt=l(function(e,r,i){let u=e.text.trim(),n=i.text;e===i&&/ \s /.exec(i.text)&&(u=void 0);function c(p){const O={boolean:{},number:{},string:{}},Q=[];let j;return{nodeList:p.filter(function(g){const m=typeof g;return g.stmt&&g.stmt==="dir"?(j=g.value,!1):g.trim()===""?!1:m in O?O[m].hasOwnProperty(g)?!1:O[m][g]=!0:Q.includes(g)?!1:Q.push(g)}),dir:j}}l(c,"uniq");const{nodeList:f,dir:k}=c(r.flat());if(se==="gen-1")for(let p=0;p<f.length;p++)f[p]=ue(f[p]);u=u??"subGraph"+ee,n=n||"",n=ie(n),ee=ee+1;const o={id:u,n
` +F.showPosition()+ `
Expecting ` + $ 1.join(", ")+", got '"+(this.terminals_[U]||U)+"'":he="Parse error on line "+(X+1)+": Unexpected "+(U==Xe?"end of input":"'"+(this.terminals_[U]||U)+"'"),this.parseError(he,{text:F.match,token:this.terminals_[U]||U,line:F.yylineno,loc:oe,expected: $ 1})}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+D1+", token: "+U);switch(q[0]){case 1:A.push(U),C.push(F.yytext),t.push(F.yylloc),A.push(q[1]),U=null,Ye=F.yyleng,s=F.yytext,X=F.yylineno,oe=F.yylloc;break;case 2:if(d1=this.productions_[q[1]][1],N1. $ =C[C.length-d1],N1._ $ ={first_line:t[t.length-(d1||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(d1||1)].first_column,last_column:t[t.length-1].last_column},ht&&(N1._ $ .range=[t[t.length-(d1||1)].range[0],t[t.length-1].range[1]]),ce=this.performAction.apply(N1,[s,Ye,X,S1.yy,q[1],C,t].concat(ct)),typeof ce<"u")return ce;d1&&(A=A.slice(0,-1*d1*2),C=C.slice(0,-1*d1),t=t.slice(0,-1*d1)),A.push(this.productions_[q[1]][0]),C.push(N1. $ ),t.push(N1._ $ ),He=U1[A[A.length-2]][A[A.length-1]],A.push(He);break;case 3:return!0}}return!0},"parse")},lt=function(){var A1={EOF:1,parseError:l(function(d,A){if(this.yy.parser)this.yy.parser.parseError(d,A);else throw new Error(d)},"parseError"),setInput:l(function(h,d){return this.yy=d||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:l(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var d=h.match(/(?: \r \n ?| \n ).*/g);return d?(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:l(function(h){var d=h.length,A=h.split(/(?: \r \n ?| \n )/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var a=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 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:A?(A.length===a.length?this.yylloc.first_column:0)+a[a.length-A.length].length-A[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-d]),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(h){this.unput(this.match.slice(h))},"less"),pastInput:l(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:l(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:l(function(){var h=this.pastInput(),d=new Array(h.length+1).join("-");return h+this.upcomingInput()+ `
` +d+"^"},"showPosition"),test_match:l(function(h,d){var A,a,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))),a=h[0].match(/(?: \r \n ?| \n ).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.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],A=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),A)return A;if(this._backtrack){for(var t in C)this[t]=C[t];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var h,d,A,a;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),t=0;t<C.length;t++)if(A=this._input.match(this.rules[C[t]]),A&&(!d||A[0].length>d[0].length)){if(d=A,a=t,this.options.backtrack_lexer){if(h=this.test_match(A,C[t]),h!==!1)return h;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(h=this.test_match(d,C[a]),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:l(function(){var d=this.next();return d||this.lex()},"lex"),begin:l(function(d){this.conditionStack.push(d)},"begin"),popState:l(function(){var d=this.conditionStack.length-1;return d>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(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:l(function(d){this.begin(d)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:l(function(d,A,a,C){switch(a){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:this.begin("callbackname");break;case 8:this.popState();break;case 9:this.popState(),this.begin("callbackargs");break;case 10:return 92;case 11:this.popState();break;case 12:return 93;case 13:return"MD_STR";case 14:this.popState();break;case 15:this.begin("md_string");break;case 16:return"STR";case 17:this.popState();break;case 18:this.pushState("string");break;case 19:return 81;case 20:return 99;case 21:return 82;case 22:return 101;case 23:return 83;case 24:return 84;case 25:return 94;case 26:this.begin("click");break;case 27:this.popState();break;case 28:return 85;case 29:return d.lex.firstGraph()&&this.begin("dir"),12;case 30:return d.lex.firstGraph()&&this.begin("dir"),12;case 31:return d.lex.firstGraph()&&this.begin("dir"),12;case 32:return 27;case 33:return 32;case 34:return 95;case 35:return 95;case 36:return 95;case 37:return 95;case 38:return this.popState(),13;case 39:return this.popState(),14;case 40:return this.popState(),14;case 41:return this.popState(),14;case 42:return this.popState(),14;case 43:return this.popState(),14;case 44:return this.popState(),14;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return 118;case 50:return 119;case 51:return 120;case 52:return 121;case 53:return 102;case 54:return 108;case 55:return 44;case 56:return 58;case 57:return 42;case 58:return 8;case 59:return 103;case 60:return 112;case 61:return this.popState(),75;case 62:return this.pushState("edgeText"),73;case 63:return 116;case 64:return this.popState(),75;case 65:return this.pushState("thickEdgeText"),73;case 66:return 116;case 67:return this.popState(),75;case 68:return this.pushState("dottedEdgeText"),73;case 69:return 116;case 70:return 75;case 71:return this.popState(),51;case 72:return"TEXT";case 73:return this.pushState("ellipseText"),50;case 74:return this.popState(),53;case 75:return this.pushState("text"),52;case 76:return this.popState(),55;case 77:return this.pushState("text"),54;case 78:return 56;case 79:return this.pushState("text"),65;case 80:return this.popState(),62;case 81:return this.pushState("text"),61;case 82:return this.popState(),47;case 83:return this.pushState("text"),46;case 84:return this.popState(),67;case 85:return this.popState(),69;case 86:return 114;case 87:return this.pushState("trapText"),66;case 88:return this.pushState("trapText"),68;case 89:return 115;case 90:return 65;case 91:return 87;case 92:return"SEP";case 93:return 86;case 94:return 112;case 95:return 108;case 96:return 42;case 97:return 106;case 98:return 111;case 99:return 113;case 100:return this.popState(),60;case 101:return this.pushState("text"),60;case 102:return this.popState(),49;case 103:return this.pushState("text"),48;case 104:return this.popState(),31;case 105:return this.pushState("text"),29;case 106:return this.popState(),64;case 107:return this.pushState("text"),63
font - family : $ { e . fontFamily } ;
color : $ { e . nodeTextColor || e . textColor } ;
}
. cluster - label text {
fill : $ { e . titleColor } ;
}
. cluster - label span {
color : $ { e . titleColor } ;
}
. cluster - label span p {
background - color : transparent ;
}
. label text , span {
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 : 1 px ;
}
. rough - node . label text , . node . label text {
text - anchor : middle ;
}
// .flowchart-label .text-outer-tspan {
// text-anchor: middle;
// }
// .flowchart-label .text-inner-tspan {
// text-anchor: start;
// }
. node . katex path {
fill : # 000 ;
stroke : # 000 ;
stroke - width : 1 px ;
}
. node . label {
text - align : center ;
}
. node . clickable {
cursor : pointer ;
}
. arrowheadPath {
fill : $ { e . arrowheadColor } ;
}
. edgePath . path {
stroke : $ { e . lineColor } ;
stroke - width : 2.0 px ;
}
. flowchart - link {
stroke : $ { e . lineColor } ;
fill : none ;
}
. edgeLabel {
background - color : $ { e . edgeLabelBackground } ;
p {
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 : $ { hs ( e . edgeLabelBackground , . 5 ) } ;
// background-color:
}
. cluster rect {
fill : $ { e . clusterBkg } ;
stroke : $ { e . clusterBorder } ;
stroke - width : 1 px ;
}
. cluster text {
fill : $ { e . titleColor } ;
}
. cluster span {
color : $ { e . titleColor } ;
}
/ * . c l u s t e r d i v {
color : $ { e . titleColor } ;
} * /
div . mermaidTooltip {
position : absolute ;
text - align : center ;
max - width : 200 px ;
padding : 2 px ;
font - family : $ { e . fontFamily } ;
font - size : 12 px ;
background : $ { e . tertiaryColor } ;
border : 1 px solid $ { e . border2 } ;
border - radius : 2 px ;
pointer - events : none ;
z - index : 100 ;
}
. flowchartTitleText {
text - anchor : middle ;
font - size : 18 px ;
fill : $ { e . textColor } ;
}
` ,"getStyles"),ps=ds,bs={parser:cs,db:de,renderer:os,styles:ps,init:l(e=>{e.flowchart||(e.flowchart={}),e.layout&&Qe({layout:e.layout}),e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,Qe({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}}),de.clear(),de.setGen("gen-2")},"init")};export{bs as diagram};