Liga-System/.venv/lib/python3.12/site-packages/nicegui/elements/mermaid/dist/chunk-AI4T2ZLM-DI9Pzep9.js
2026-02-16 08:18:53 +00:00

3 lines
34 KiB
JavaScript

import{m as t}from"./chunk-6EQESGSB-CMpZRKNo.js";import{y as e}from"./chunk-T244DUNM-DsHGI3jp.js";import{m as s,p as i,a as n,c as r,d as a,U as o,H as l,$ as c,G as h,j as d,e as u,an as p,h as y,N as g}from"./index-BDq3hoFe.js";var f=function(){var t,e=s(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),i=[1,2],n=[1,3],r=[1,4],a=[2,4],o=[1,9],l=[1,11],c=[1,16],h=[1,17],d=[1,18],u=[1,19],p=[1,33],y=[1,20],g=[1,21],f=[1,22],m=[1,23],S=[1,24],_=[1,26],T=[1,27],k=[1,28],b=[1,29],E=[1,30],C=[1,31],D=[1,32],x=[1,35],$=[1,36],v=[1,37],I=[1,38],A=[1,34],L=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],w=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],N=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],O={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:s(function(t,e,s,i,n,r,a){var o=r.length-1;switch(n){case 3:return i.setRootDoc(r[o]),r[o];case 4:this.$=[];break;case 5:"nl"!=r[o]&&(r[o-1].push(r[o]),this.$=r[o-1]);break;case 6:case 7:case 12:this.$=r[o];break;case 8:this.$="nl";break;case 13:let t=r[o-1];t.description=i.trimColon(r[o]),this.$=t;break;case 14:this.$={stmt:"relation",state1:r[o-2],state2:r[o]};break;case 15:let e=i.trimColon(r[o]);this.$={stmt:"relation",state1:r[o-3],state2:r[o-1],description:e};break;case 19:this.$={stmt:"state",id:r[o-3],type:"default",description:"",doc:r[o-1]};break;case 20:var l=r[o],c=r[o-2].trim();if(r[o].match(":")){var h=r[o].split(":");l=h[0],c=[c,h[1]]}this.$={stmt:"state",id:l,type:"default",description:c};break;case 21:this.$={stmt:"state",id:r[o-3],type:"default",description:r[o-5],doc:r[o-1]};break;case 22:this.$={stmt:"state",id:r[o],type:"fork"};break;case 23:this.$={stmt:"state",id:r[o],type:"join"};break;case 24:this.$={stmt:"state",id:r[o],type:"choice"};break;case 25:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[o-1].trim(),note:{position:r[o-2].trim(),text:r[o].trim()}};break;case 29:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 30:case 31:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[o-3],url:r[o-2],tooltip:r[o-1]};break;case 33:this.$={stmt:"click",id:r[o-3],url:r[o-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[o-1].trim(),classes:r[o].trim()};break;case 36:this.$={stmt:"style",id:r[o-1].trim(),styleClass:r[o].trim()};break;case 37:this.$={stmt:"applyClass",id:r[o-1].trim(),styleClass:r[o].trim()};break;case 38:i.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:i.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:i.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:i.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[o].trim(),type:"default",description:""};break;case 46:case 47:this.$={stmt:"state",id:r[o-2].trim(),classes:[r[o].trim()],type:"default",description:""}}},"anonymous"),table:[{3:1,4:i,5:n,6:r},{1:[3]},{3:5,4:i,5:n,6:r},{3:6,4:i,5:n,6:r},e([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:l,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:h,19:d,22:u,24:p,25:y,26:g,27:f,28:m,29:S,32:25,33:_,35:T,37:k,38:b,41:E,45:C,48:D,51:x,52:$,53:v,54:I,57:A},e(L,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:c,17:h,19:d,22:u,24:p,25:y,26:g,27:f,28:m,29:S,32:25,33:_,35:T,37:k,38:b,41:E,45:C,48:D,51:x,52:$,53:v,54:I,57:A},e(L,[2,7]),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(L,[2,11]),e(L,[2,12],{14:[1,40],15:[1,41]}),e(L,[2,16]),{18:[1,42]},e(L,[2,18],{20:[1,43]}),{23:[1,44]},e(L,[2,22]),e(L,[2,23]),e(L,[2,24]),e(L,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},e(L,[2,28]),{34:[1,49]},{36:[1,50]},e(L,[2,31]),{13:51,24:p,57:A},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},e(w,[2,44],{58:[1,56]}),e(w,[2,45],{58:[1,57]}),e(L,[2,38]),e(L,[2,39]),e(L,[2,40]),e(L,[2,41]),e(L,[2,6]),e(L,[2,13]),{13:58,24:p,57:A},e(L,[2,17]),e(N,a,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},e(L,[2,29]),e(L,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},e(L,[2,14],{14:[1,71]}),{4:o,5:l,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:h,19:d,21:[1,72],22:u,24:p,25:y,26:g,27:f,28:m,29:S,32:25,33:_,35:T,37:k,38:b,41:E,45:C,48:D,51:x,52:$,53:v,54:I,57:A},e(L,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},e(L,[2,34]),e(L,[2,35]),e(L,[2,36]),e(L,[2,37]),e(w,[2,46]),e(w,[2,47]),e(L,[2,15]),e(L,[2,19]),e(N,a,{7:78}),e(L,[2,26]),e(L,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:l,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:h,19:d,21:[1,81],22:u,24:p,25:y,26:g,27:f,28:m,29:S,32:25,33:_,35:T,37:k,38:b,41:E,45:C,48:D,51:x,52:$,53:v,54:I,57:A},e(L,[2,32]),e(L,[2,33]),e(L,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:s(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:s(function(t){var e=this,i=[0],n=[],r=[null],a=[],o=this.table,l="",c=0,h=0,d=a.slice.call(arguments,1),u=Object.create(this.lexer),p={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(p.yy[y]=this.yy[y]);u.setInput(t,p.yy),p.yy.lexer=u,p.yy.parser=this,typeof u.yylloc>"u"&&(u.yylloc={});var g=u.yylloc;a.push(g);var f=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=n.pop()||u.lex()||1)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(function(t){i.length=i.length-2*t,r.length=r.length-t,a.length=a.length-t},"popStack"),s(m,"lex");for(var S,_,T,k,b,E,C,D,x,$={};;){if(T=i[i.length-1],this.defaultActions[T]?k=this.defaultActions[T]:((null===S||typeof S>"u")&&(S=m()),k=o[T]&&o[T][S]),typeof k>"u"||!k.length||!k[0]){var v="";for(E in x=[],o[T])this.terminals_[E]&&E>2&&x.push("'"+this.terminals_[E]+"'");v=u.showPosition?"Parse error on line "+(c+1)+":\n"+u.showPosition()+"\nExpecting "+x.join(", ")+", got '"+(this.terminals_[S]||S)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==S?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(v,{text:u.match,token:this.terminals_[S]||S,line:u.yylineno,loc:g,expected:x})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+T+", token: "+S);switch(k[0]){case 1:i.push(S),r.push(u.yytext),a.push(u.yylloc),i.push(k[1]),S=null,_?(S=_,_=null):(h=u.yyleng,l=u.yytext,c=u.yylineno,g=u.yylloc);break;case 2:if(C=this.productions_[k[1]][1],$.$=r[r.length-C],$._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},f&&($._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),typeof(b=this.performAction.apply($,[l,h,c,p.yy,k[1],r,a].concat(d)))<"u")return b;C&&(i=i.slice(0,-1*C*2),r=r.slice(0,-1*C),a=a.slice(0,-1*C)),i.push(this.productions_[k[1]][0]),r.push($.$),a.push($._$),D=o[i[i.length-2]][i[i.length-1]],i.push(D);break;case 3:return!0}}return!0},"parse")},R=(t={EOF:1,parseError:s(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:s(function(t,e){return this.yy=e||this.yy||{},this._input=t,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:s(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:s(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),s.length-1&&(this.yylineno-=s.length-1);var n=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:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:s(function(t){this.unput(this.match.slice(t))},"less"),pastInput:s(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:s(function(t,e){var s,i,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},"test_match"),next:s(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((s=this._input.match(this.rules[n[r]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:s(function(){return this.next()||this.lex()},"lex"),begin:s(function(t){this.conditionStack.push(t)},"begin"),popState:s(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(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:s(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:s(function(t){this.begin(t)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:s(function(t,e,s,i){switch(s){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:case 45:return 51;case 5:case 46:return 52;case 6:case 47:return 53;case 7:case 48:return 54;case 8:case 9:case 11:case 12:case 13:case 14:case 57:case 59:case 65:break;case 10:case 80:return 5;case 15:case 35:return this.pushState("SCALE"),17;case 16:case 36:return 18;case 17:case 23:case 37:case 52:case 55:this.popState();break;case 18:return this.begin("acc_title"),33;case 19:return this.popState(),"acc_title_value";case 20:return this.begin("acc_descr"),35;case 21:return this.popState(),"acc_descr_value";case 22:this.begin("acc_descr_multiline");break;case 24:return"acc_descr_multiline_value";case 25:return this.pushState("CLASSDEF"),41;case 26:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 27:return this.popState(),this.pushState("CLASSDEFID"),42;case 28:return this.popState(),43;case 29:return this.pushState("CLASS"),48;case 30:return this.popState(),this.pushState("CLASS_STYLE"),49;case 31:return this.popState(),50;case 32:return this.pushState("STYLE"),45;case 33:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 34:return this.popState(),47;case 38:this.pushState("STATE");break;case 39:case 42:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 40:case 43:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 41:case 44:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 49:this.pushState("STATE_STRING");break;case 50:return this.pushState("STATE_ID"),"AS";case 51:case 67:return this.popState(),"ID";case 53:return"STATE_DESCR";case 54:return 19;case 56:return this.popState(),this.pushState("struct"),20;case 58:return this.popState(),21;case 60:return this.begin("NOTE"),29;case 61:return this.popState(),this.pushState("NOTE_ID"),59;case 62:return this.popState(),this.pushState("NOTE_ID"),60;case 63:this.popState(),this.pushState("FLOATING_NOTE");break;case 64:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 66:return"NOTE_TEXT";case 68:return this.popState(),this.pushState("NOTE_TEXT"),24;case 69:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 70:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 71:case 72:return 6;case 73:return 16;case 74:return 57;case 75:return 24;case 76:return e.yytext=e.yytext.trim(),14;case 77:return 15;case 78:return 28;case 79:return 58;case 81:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[12,13],inclusive:!1},struct:{rules:[12,13,25,29,32,38,45,46,47,48,57,58,59,60,74,75,76,77,78],inclusive:!1},FLOATING_NOTE_ID:{rules:[67],inclusive:!1},FLOATING_NOTE:{rules:[64,65,66],inclusive:!1},NOTE_TEXT:{rules:[69,70],inclusive:!1},NOTE_ID:{rules:[68],inclusive:!1},NOTE:{rules:[61,62,63],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[34],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[33],inclusive:!1},CLASS_STYLE:{rules:[31],inclusive:!1},CLASS:{rules:[30],inclusive:!1},CLASSDEFID:{rules:[28],inclusive:!1},CLASSDEF:{rules:[26,27],inclusive:!1},acc_descr_multiline:{rules:[23,24],inclusive:!1},acc_descr:{rules:[21],inclusive:!1},acc_title:{rules:[19],inclusive:!1},SCALE:{rules:[16,17,36,37],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[51],inclusive:!1},STATE_STRING:{rules:[52,53],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[12,13,39,40,41,42,43,44,49,50,54,55,56],inclusive:!1},ID:{rules:[12,13],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,18,20,22,25,29,32,35,38,56,60,71,72,73,74,75,76,77,79,80,81],inclusive:!0}}},t);function B(){this.yy={}}return O.lexer=R,s(B,"Parser"),B.prototype=O,O.Parser=B,new B}();f.parser=f;var m=f,S="state",_="root",T="relation",k="default",b="divider",E="fill:none",C="fill: #333",D="text",x="normal",$="rect",v="rectWithTitle",I="divider",A="roundedWithTitle",L="statediagram",w=`${L}-state`,N="transition",O=`${N} note-edge`,R=`${L}-note`,B=`${L}-cluster`,F=`${L}-cluster-alt`,P="parent",G="note",Y="----",j=`${Y}${G}`,z=`${Y}${P}`,M=s((t,e="TB")=>{if(!t.doc)return e;let s=e;for(let e of t.doc)"dir"===e.stmt&&(s=e.value);return s},"getDir"),U={getClasses:s(function(t,e){return e.db.getClasses()},"getClasses"),draw:s(async function(s,o,l,c){i.info("REF0:"),i.info("Drawing state diagram (v2)",o);let{securityLevel:h,state:d,layout:u}=n();c.db.extract(c.db.getRootDocV2());let p=c.db.getData(),y=t(o,h);p.type=c.type,p.layoutAlgorithm=u,p.nodeSpacing=d?.nodeSpacing||50,p.rankSpacing=d?.rankSpacing||50,p.markers=["barb"],p.diagramId=o,await r(p,y);try{("function"==typeof c.db.getLinks?c.db.getLinks():new Map).forEach((t,e)=>{let s="string"==typeof e?e:"string"==typeof e?.id?e.id:"";if(!s)return void i.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(e));let n,r=y.node()?.querySelectorAll("g");if(r?.forEach(t=>{t.textContent?.trim()===s&&(n=t)}),!n)return void i.warn("⚠️ Could not find node matching text:",s);let a=n.parentNode;if(!a)return void i.warn("⚠️ Node has no parent, cannot wrap:",s);let o=document.createElementNS("http://www.w3.org/2000/svg","a"),l=t.url.replace(/^"+|"+$/g,"");if(o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l),o.setAttribute("target","_blank"),t.tooltip){let e=t.tooltip.replace(/^"+|"+$/g,"");o.setAttribute("title",e)}a.replaceChild(o,n),o.appendChild(n),i.info("🔗 Wrapped node in <a> tag for:",s,t.url)})}catch(t){i.error("❌ Error injecting clickable links:",t)}a.insertTitle(y,"statediagramTitleText",d?.titleTopMargin??25,c.db.getDiagramTitle()),e(y,8,L,d?.useMaxWidth??!0)},"draw"),getDir:M},H=new Map,W=0;function X(t="",e=0,s="",i=Y){return`state-${t}${null!==s&&s.length>0?`${i}${s}`:""}-${e}`}s(X,"stateDomId");var V=s((t,e,s,r,a,o,l,c)=>{i.trace("items",e),e.forEach(e=>{switch(e.stmt){case S:case k:Z(t,e,s,r,a,o,l,c);break;case T:{Z(t,e.state1,s,r,a,o,l,c),Z(t,e.state2,s,r,a,o,l,c);let i={id:"edge"+W,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:E,labelStyle:"",label:y.sanitizeText(e.description??"",n()),arrowheadStyle:C,labelpos:"c",labelType:D,thickness:x,classes:N,look:l};a.push(i),W++}}})},"setupDoc"),J=s((t,e="TB")=>{let s=e;if(t.doc)for(let e of t.doc)"dir"===e.stmt&&(s=e.value);return s},"getDir");function K(t,e,s){if(!e.id||"</join></fork>"===e.id||"</choice>"===e.id)return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(t=>{let i=s.get(t);i&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...i.styles])}));let i=t.find(t=>t.id===e.id);i?Object.assign(i,e):t.push(e)}function q(t){return t?.classes?.join(" ")??""}function Q(t){return t?.styles??[]}s(K,"insertOrUpdateNode"),s(q,"getClassesFromDbInfo"),s(Q,"getStylesFromDbInfo");var Z=s((t,e,s,r,a,o,l,c)=>{let h=e.id,d=s.get(h),u=q(d),p=Q(d),g=n();if(i.info("dataFetcher parsedItem",e,d,p),"root"!==h){let s=$;!0===e.start?s="stateStart":!1===e.start&&(s="stateEnd"),e.type!==k&&(s=e.type),H.get(h)||H.set(h,{id:h,shape:s,description:y.sanitizeText(h,g),cssClasses:`${u} ${w}`,cssStyles:p});let n=H.get(h);e.description&&(Array.isArray(n.description)?(n.shape=v,n.description.push(e.description)):n.description?.length&&n.description.length>0?(n.shape=v,n.description===h?n.description=[e.description]:n.description=[n.description,e.description]):(n.shape=$,n.description=e.description),n.description=y.sanitizeTextOrArray(n.description,g)),1===n.description?.length&&n.shape===v&&("group"===n.type?n.shape=A:n.shape=$),!n.type&&e.doc&&(i.info("Setting cluster for XCX",h,J(e)),n.type="group",n.isGroup=!0,n.dir=J(e),n.shape=e.type===b?I:A,n.cssClasses=`${n.cssClasses} ${B} ${o?F:""}`);let d={labelStyle:"",shape:n.shape,label:n.description,cssClasses:n.cssClasses,cssCompiledStyles:[],cssStyles:n.cssStyles,id:h,dir:n.dir,domId:X(h,W),type:n.type,isGroup:"group"===n.type,padding:8,rx:10,ry:10,look:l};if(d.shape===I&&(d.label=""),t&&"root"!==t.id&&(i.trace("Setting node ",h," to be child of its parent ",t.id),d.parentId=t.id),d.centerLabel=!0,e.note){let t={labelStyle:"",shape:"note",label:e.note.text,cssClasses:R,cssStyles:[],cssCompiledStyles:[],id:h+j+"-"+W,domId:X(h,W,G),type:n.type,isGroup:"group"===n.type,padding:g.flowchart?.padding,look:l,position:e.note.position},s=h+z,i={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:n.cssClasses,cssStyles:[],id:h+z,domId:X(h,W,P),type:"group",isGroup:!0,padding:16,look:l,position:e.note.position};W++,i.id=s,t.parentId=s,K(r,i,c),K(r,t,c),K(r,d,c);let o=h,u=t.id;"left of"===e.note.position&&(o=t.id,u=h),a.push({id:o+"-"+u,start:o,end:u,arrowhead:"none",arrowTypeEnd:"",style:E,labelStyle:"",classes:O,arrowheadStyle:C,labelpos:"c",labelType:D,thickness:x,look:l})}else K(r,d,c)}e.doc&&(i.trace("Adding nodes children "),V(e,e.doc,s,r,a,!o,l,c))},"dataFetcher"),tt=s(()=>{H.clear(),W=0},"reset"),et="[*]",st="start",it="[*]",nt="end",rt="color",at="fill",ot="bgFill",lt=",",ct=s(()=>new Map,"newClassesList"),ht=s(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),dt=s(t=>JSON.parse(JSON.stringify(t)),"clone"),ut=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=ct(),this.documents={root:ht()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=o,this.setAccTitle=l,this.getAccDescription=c,this.setAccDescription=h,this.setDiagramTitle=d,this.getDiagramTitle=u,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}static{s(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(let e of Array.isArray(t)?t:t.doc)switch(e.stmt){case S:this.addState(e.id.trim(),e.type,e.doc,e.description,e.note);break;case T:this.addRelation(e.state1,e.state2,e.description);break;case"classDef":this.addStyleClass(e.id.trim(),e.classes);break;case"style":this.handleStyleDef(e);break;case"applyClass":this.setCssClass(e.id.trim(),e.styleClass);break;case"click":this.addLink(e.id,e.url,e.tooltip)}let e=this.getStates(),s=n();tt(),Z(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,s.look,this.classes);for(let t of this.nodes)if(Array.isArray(t.label)){if(t.description=t.label.slice(1),t.isGroup&&t.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${t.id}]`);t.label=t.label[0]}}handleStyleDef(t){let e=t.id.trim().split(","),s=t.styleClass.split(",");for(let t of e){let e=this.getState(t);if(!e){let s=t.trim();this.addState(s),e=this.getState(s)}e&&(e.styles=s.map(t=>t.replace(/;/g,"")?.trim()))}}setRootDoc(t){i.info("Setting root doc",t),this.rootDoc=t,1===this.version?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,s){if(e.stmt===T)return this.docTranslator(t,e.state1,!0),void this.docTranslator(t,e.state2,!1);if(e.stmt===S&&(e.id===et?(e.id=t.id+(s?"_start":"_end"),e.start=s):e.id=e.id.trim()),e.stmt!==_&&e.stmt!==S||!e.doc)return;let i=[],n=[];for(let t of e.doc)if(t.type===b){let e=dt(t);e.doc=dt(n),i.push(e),n=[]}else n.push(t);if(i.length>0&&n.length>0){let t={stmt:S,id:p(),type:"divider",doc:dt(n)};i.push(dt(t)),e.doc=i}e.doc.forEach(t=>this.docTranslator(e,t,!0))}getRootDocV2(){return this.docTranslator({id:_,stmt:_},{id:_,stmt:_,doc:this.rootDoc},!0),{id:_,doc:this.rootDoc}}addState(t,e=k,s=void 0,r=void 0,a=void 0,o=void 0,l=void 0,c=void 0){let h=t?.trim();if(this.currentDocument.states.has(h)){let t=this.currentDocument.states.get(h);if(!t)throw new Error(`State not found: ${h}`);t.doc||(t.doc=s),t.type||(t.type=e)}else i.info("Adding state ",h,r),this.currentDocument.states.set(h,{stmt:S,id:h,descriptions:[],type:e,doc:s,note:a,classes:[],styles:[],textStyles:[]});if(r&&(i.info("Setting state description",h,r),(Array.isArray(r)?r:[r]).forEach(t=>this.addDescription(h,t.trim()))),a){let t=this.currentDocument.states.get(h);if(!t)throw new Error(`State not found: ${h}`);t.note=a,t.note.text=y.sanitizeText(t.note.text,n())}o&&(i.info("Setting state classes",h,o),(Array.isArray(o)?o:[o]).forEach(t=>this.setCssClass(h,t.trim()))),l&&(i.info("Setting state styles",h,l),(Array.isArray(l)?l:[l]).forEach(t=>this.setStyle(h,t.trim()))),c&&(i.info("Setting state styles",h,l),(Array.isArray(c)?c:[c]).forEach(t=>this.setTextStyle(h,t.trim())))}clear(t){this.nodes=[],this.edges=[],this.documents={root:ht()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=ct(),t||(this.links=new Map,g())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){i.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,s){this.links.set(t,{url:e,tooltip:s}),i.warn("Adding link",t,e,s)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===et?(this.startEndCount++,`${st}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=k){return t===et?st:e}endIdIfNeeded(t=""){return t===it?(this.startEndCount++,`${nt}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=k){return t===it?nt:e}addRelationObjs(t,e,s=""){let i=this.startIdIfNeeded(t.id.trim()),r=this.startTypeIfNeeded(t.id.trim(),t.type),a=this.startIdIfNeeded(e.id.trim()),o=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(i,r,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(a,o,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:i,id2:a,relationTitle:y.sanitizeText(s,n())})}addRelation(t,e,s){if("object"==typeof t&&"object"==typeof e)this.addRelationObjs(t,e,s);else if("string"==typeof t&&"string"==typeof e){let i=this.startIdIfNeeded(t.trim()),r=this.startTypeIfNeeded(t),a=this.endIdIfNeeded(e.trim()),o=this.endTypeIfNeeded(e);this.addState(i,r),this.addState(a,o),this.currentDocument.relations.push({id1:i,id2:a,relationTitle:s?y.sanitizeText(s,n()):void 0})}}addDescription(t,e){let s=this.currentDocument.states.get(t),i=e.startsWith(":")?e.replace(":","").trim():e;s?.descriptions?.push(y.sanitizeText(i,n()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});let s=this.classes.get(t);e&&s&&e.split(lt).forEach(t=>{let e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(rt).exec(t)){let t=e.replace(at,ot).replace(rt,at);s.textStyles.push(t)}s.styles.push(e)})}getClasses(){return this.classes}setCssClass(t,e){t.split(",").forEach(t=>{let s=this.getState(t);if(!s){let e=t.trim();this.addState(e),s=this.getState(e)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}getDirectionStatement(){return this.rootDoc.find(t=>"dir"===t.stmt)}getDirection(){return this.getDirectionStatement()?.value??"TB"}setDirection(t){let e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:"dir",value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){let t=n();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:M(this.getRootDocV2())}}getConfig(){return n().state}},pt=s(t=>`\ndefs #statediagram-barbEnd {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n`,"getStyles");export{m as B,ut as _,pt as g,U as q};
//# sourceMappingURL=chunk-AI4T2ZLM-DI9Pzep9.js.map