"use strict";(self.webpackChunkforgejo=self.webpackChunkforgejo||[]).push([["vendors-node_modules_mermaid_dist_chunks_mermaid_core_kanban-definition-K7BYSVSG_mjs"],{"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-FMBD7UC4.mjs":(function(pe,Z,_){_.d(Z,{o:function(){return X}});var J=_("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-AGHRB4JF.mjs"),X=(0,J.K2)(()=>`
  /* Font Awesome icon styling - consolidated */
  .label-icon {
    display: inline-block;
    height: 1em;
    overflow: visible;
    vertical-align: -0.125em;
  }
  
  .node .label-icon path {
    fill: currentColor;
    stroke: revert;
    stroke-width: revert;
  }
`,"getIconStyles")}),"./node_modules/mermaid/dist/chunks/mermaid.core/kanban-definition-K7BYSVSG.mjs":(function(pe,Z,_){_.d(Z,{diagram:function(){return je}});var J=_("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-HHEYEP7N.mjs"),X=_("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-FMBD7UC4.mjs"),oe=_("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-XPW4576I.mjs"),z=_("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-KYZI473N.mjs"),We=_("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-YBOYWFTD.mjs"),Ge=_("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-PQ6SQG4A.mjs"),Fe=_("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-PU5JKC2W.mjs"),Ve=_("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-GEFDOKGD.mjs"),k=_("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-7R4GIKGN.mjs"),a=_("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-AGHRB4JF.mjs"),_e=_("./node_modules/khroma/dist/methods/is_dark.js"),ce=_("./node_modules/khroma/dist/methods/lighten.js"),le=_("./node_modules/khroma/dist/methods/darken.js"),Q=(function(){var e=(0,a.K2)(function(C,s,n,r){for(n=n||{},r=C.length;r--;n[C[r]]=s);return n},"o"),d=[1,4],m=[1,13],i=[1,12],g=[1,15],S=[1,16],y=[1,20],l=[1,19],x=[6,7,8],A=[1,26],u=[1,24],R=[1,25],b=[6,7,11],G=[1,31],O=[6,7,11,24],M=[1,6,13,16,17,20,23],E=[1,35],T=[1,36],I=[1,6,7,11,13,16,17,20,23],F=[1,38],P={trace:(0,a.K2)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},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,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:(0,a.K2)(function(s,n,r,o,h,t,j){var c=t.length-1;switch(h){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",t[c-1].id),o.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:o.getLogger().info("Node: ",t[c].id),o.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:o.getLogger().trace("Icon: ",t[c]),o.decorateNode({icon:t[c]});break;case 18:case 23:o.decorateNode({class:t[c]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",t[c-1].id),o.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:o.getLogger().trace("Node: ",t[c].id),o.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:o.decorateNode({icon:t[c]});break;case 27:o.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:o.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:o.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:o.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:d},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:d},{6:m,7:[1,10],9:9,12:11,13:i,14:14,16:g,17:S,18:17,19:18,20:y,23:l},e(x,[2,3]),{1:[2,2]},e(x,[2,4]),e(x,[2,5]),{1:[2,6],6:m,12:21,13:i,14:14,16:g,17:S,18:17,19:18,20:y,23:l},{6:m,9:22,12:11,13:i,14:14,16:g,17:S,18:17,19:18,20:y,23:l},{6:A,7:u,10:23,11:R},e(b,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:y,23:l}),e(b,[2,19]),e(b,[2,21],{15:30,24:G}),e(b,[2,22]),e(b,[2,23]),e(O,[2,25]),e(O,[2,26]),e(O,[2,28],{20:[1,32]}),{21:[1,33]},{6:A,7:u,10:34,11:R},{1:[2,7],6:m,12:21,13:i,14:14,16:g,17:S,18:17,19:18,20:y,23:l},e(M,[2,14],{7:E,11:T}),e(I,[2,8]),e(I,[2,9]),e(I,[2,10]),e(b,[2,16],{15:37,24:G}),e(b,[2,17]),e(b,[2,18]),e(b,[2,20],{24:F}),e(O,[2,31]),{21:[1,39]},{22:[1,40]},e(M,[2,13],{7:E,11:T}),e(I,[2,11]),e(I,[2,12]),e(b,[2,15],{24:F}),e(O,[2,30]),{22:[1,41]},e(O,[2,27]),e(O,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:(0,a.K2)(function(s,n){if(n.recoverable)this.trace(s);else{var r=new Error(s);throw r.hash=n,r}},"parseError"),parse:(0,a.K2)(function(s){var n=this,r=[0],o=[],h=[null],t=[],j=this.table,c="",V=0,de=0,ue=0,we=2,ge=1,Be=t.slice.call(arguments,1),p=Object.create(this.lexer),w={yy:{}};for(var ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ne)&&(w.yy[ne]=this.yy[ne]);p.setInput(s,w.yy),w.yy.lexer=p,w.yy.parser=this,typeof p.yylloc>"u"&&(p.yylloc={});var se=p.yylloc;t.push(se);var Me=p.options&&p.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ue(v){r.length=r.length-2*v,h.length=h.length-v,t.length=t.length-v}(0,a.K2)(Ue,"popStack");function me(){var v;return v=o.pop()||p.lex()||ge,typeof v!="number"&&(v instanceof Array&&(o=v,v=o.pop()),v=n.symbols_[v]||v),v}(0,a.K2)(me,"lex");for(var D,ie,B,L,He,re,W={},H,K,fe,Y;;){if(B=r[r.length-1],this.defaultActions[B]?L=this.defaultActions[B]:((D===null||typeof D>"u")&&(D=me()),L=j[B]&&j[B][D]),typeof L>"u"||!L.length||!L[0]){var ae="";Y=[];for(H in j[B])this.terminals_[H]&&H>we&&Y.push("'"+this.terminals_[H]+"'");p.showPosition?ae="Parse error on line "+(V+1)+`:
`+p.showPosition()+`
Expecting `+Y.join(", ")+", got '"+(this.terminals_[D]||D)+"'":ae="Parse error on line "+(V+1)+": Unexpected "+(D==ge?"end of input":"'"+(this.terminals_[D]||D)+"'"),this.parseError(ae,{text:p.match,token:this.terminals_[D]||D,line:p.yylineno,loc:se,expected:Y})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+B+", token: "+D);switch(L[0]){case 1:r.push(D),h.push(p.yytext),t.push(p.yylloc),r.push(L[1]),D=null,ie?(D=ie,ie=null):(de=p.yyleng,c=p.yytext,V=p.yylineno,se=p.yylloc,ue>0&&ue--);break;case 2:if(K=this.productions_[L[1]][1],W.$=h[h.length-K],W._$={first_line:t[t.length-(K||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(K||1)].first_column,last_column:t[t.length-1].last_column},Me&&(W._$.range=[t[t.length-(K||1)].range[0],t[t.length-1].range[1]]),re=this.performAction.apply(W,[c,de,V,w.yy,L[1],h,t].concat(Be)),typeof re<"u")return re;K&&(r=r.slice(0,-1*K*2),h=h.slice(0,-1*K),t=t.slice(0,-1*K)),r.push(this.productions_[L[1]][0]),h.push(W.$),t.push(W._$),fe=j[r[r.length-2]][r[r.length-1]],r.push(fe);break;case 3:return!0}}return!0},"parse")},te=(function(){var C={EOF:1,parseError:(0,a.K2)(function(n,r){if(this.yy.parser)this.yy.parser.parseError(n,r);else throw new Error(n)},"parseError"),setInput:(0,a.K2)(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:(0,a.K2)(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:(0,a.K2)(function(s){var n=s.length,r=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 o=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),r.length-1&&(this.yylineno-=r.length-1);var h=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:r?(r.length===o.length?this.yylloc.first_column:0)+o[o.length-r.length].length-r[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:(0,a.K2)(function(){return this._more=!0,this},"more"),reject:(0,a.K2)(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:(0,a.K2)(function(s){this.unput(this.match.slice(s))},"less"),pastInput:(0,a.K2)(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:(0,a.K2)(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:(0,a.K2)(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
`+n+"^"},"showPosition"),test_match:(0,a.K2)(function(s,n){var r,o,h;if(this.options.backtrack_lexer&&(h={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&&(h.yylloc.range=this.yylloc.range.slice(0))),o=s[0].match(/(?:\r\n?|\n).*/g),o&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.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],r=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var t in h)this[t]=h[t];return!1}return!1},"test_match"),next:(0,a.K2)(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,n,r,o;this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),t=0;t<h.length;t++)if(r=this._input.match(this.rules[h[t]]),r&&(!n||r[0].length>n[0].length)){if(n=r,o=t,this.options.backtrack_lexer){if(s=this.test_match(r,h[t]),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,h[o]),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:(0,a.K2)(function(){var n=this.next();return n||this.lex()},"lex"),begin:(0,a.K2)(function(n){this.conditionStack.push(n)},"begin"),popState:(0,a.K2)(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,a.K2)(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:(0,a.K2)(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:(0,a.K2)(function(n){this.begin(n)},"pushState"),stateStackSize:(0,a.K2)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,a.K2)(function(n,r,o,h){var t=h;switch(o){case 0:return this.pushState("shapeData"),r.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const j=/\n\s*/g;return r.yytext=r.yytext.replace(j,"<br/>"),24;case 4:return 24;case 5:this.popState();break;case 6:return n.getLogger().trace("Found comment",r.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return n.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:n.getLogger().trace("end icon"),this.popState();break;case 16:return n.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return n.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return n.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return n.getLogger().trace("description:",r.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),n.getLogger().trace("node end ...",r.yytext),"NODE_DEND";case 36:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 41:return n.getLogger().trace("Long description:",r.yytext),21;case 42:return n.getLogger().trace("Long description:",r.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\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:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return C})();P.lexer=te;function U(){this.yy={}}return(0,a.K2)(U,"Parser"),U.prototype=P,P.Parser=U,new U})();Q.parser=Q;var ye=Q,N=[],q=[],$=0,ee={},Ee=(0,a.K2)(()=>{N=[],q=[],$=0,ee={}},"clear"),ke=(0,a.K2)(e=>{if(N.length===0)return null;const d=N[0].level;let m=null;for(let i=N.length-1;i>=0;i--)if(N[i].level===d&&!m&&(m=N[i]),N[i].level<d)throw new Error('Items without section detected, found section ("'+N[i].label+'")');return e===m?.level?null:m},"getSection"),he=(0,a.K2)(function(){return q},"getSections"),be=(0,a.K2)(function(){const e=[],d=[],m=he(),i=(0,k.D7)();for(const g of m){const S={id:g.id,label:(0,k.jZ)(g.label??"",i),labelType:"markdown",isGroup:!0,ticket:g.ticket,shape:"kanbanSection",level:g.level,look:i.look};d.push(S);const y=N.filter(l=>l.parentId===g.id);for(const l of y){const x={id:l.id,parentId:g.id,label:(0,k.jZ)(l.label??"",i),labelType:"markdown",isGroup:!1,ticket:l?.ticket,priority:l?.priority,assigned:l?.assigned,icon:l?.icon,shape:"kanbanItem",level:l.level,rx:5,ry:5,cssStyles:["text-align: left"]};d.push(x)}}return{nodes:d,edges:e,other:{},config:(0,k.D7)()}},"getData"),De=(0,a.K2)((e,d,m,i,g)=>{const S=(0,k.D7)();let y=S.mindmap?.padding??k.UI.mindmap.padding;switch(i){case f.ROUNDED_RECT:case f.RECT:case f.HEXAGON:y*=2}const l={id:(0,k.jZ)(d,S)||"kbn"+$++,level:e,label:(0,k.jZ)(m,S),width:S.mindmap?.maxNodeWidth??k.UI.mindmap.maxNodeWidth,padding:y,isGroup:!1};if(g!==void 0){let A;g.includes(`
`)?A=g+`
`:A=`{
`+g+`
}`;const u=(0,oe.H)(A,{schema:oe.r});if(u.shape&&(u.shape!==u.shape.toLowerCase()||u.shape.includes("_")))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);u?.shape&&u.shape==="kanbanItem"&&(l.shape=u?.shape),u?.label&&(l.label=u?.label),u?.icon&&(l.icon=u?.icon.toString()),u?.assigned&&(l.assigned=u?.assigned.toString()),u?.ticket&&(l.ticket=u?.ticket.toString()),u?.priority&&(l.priority=u?.priority)}const x=ke(e);x?l.parentId=x.id||"kbn"+$++:q.push(l),N.push(l)},"addNode"),f={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Se=(0,a.K2)((e,d)=>{switch(a.Rm.debug("In get type",e,d),e){case"[":return f.RECT;case"(":return d===")"?f.ROUNDED_RECT:f.CLOUD;case"((":return f.CIRCLE;case")":return f.CLOUD;case"))":return f.BANG;case"{{":return f.HEXAGON;default:return f.DEFAULT}},"getType"),ve=(0,a.K2)((e,d)=>{ee[e]=d},"setElementForId"),Ne=(0,a.K2)(e=>{if(!e)return;const d=(0,k.D7)(),m=N[N.length-1];e.icon&&(m.icon=(0,k.jZ)(e.icon,d)),e.class&&(m.cssClasses=(0,k.jZ)(e.class,d))},"decorateNode"),Oe=(0,a.K2)(e=>{switch(e){case f.DEFAULT:return"no-border";case f.RECT:return"rect";case f.ROUNDED_RECT:return"rounded-rect";case f.CIRCLE:return"circle";case f.CLOUD:return"cloud";case f.BANG:return"bang";case f.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Le=(0,a.K2)(()=>a.Rm,"getLogger"),xe=(0,a.K2)(e=>ee[e],"getElementById"),Ie={clear:Ee,addNode:De,getSections:he,getData:be,nodeType:f,getType:Se,setElementForId:ve,decorateNode:Ne,type2Str:Oe,getLogger:Le,getElementById:xe},Ce=Ie,Ae=(0,a.K2)(async(e,d,m,i)=>{a.Rm.debug(`Rendering kanban diagram
`+e);const S=i.db.getData(),y=(0,k.D7)();y.htmlLabels=!1;const l=(0,J.D)(d),x=l.append("g");x.attr("class","sections");const A=l.append("g");A.attr("class","items");const u=S.nodes.filter(E=>E.isGroup);let R=0;const b=10,G=[];let O=25;for(const E of u){const T=y?.kanban?.sectionWidth||200;R=R+1,E.x=T*R+(R-1)*b/2,E.width=T,E.y=0,E.height=T*3,E.rx=5,E.ry=5,E.cssClasses=E.cssClasses+" section-"+R;const I=await(0,z.U)(x,E);O=Math.max(O,I?.labelBBox?.height),G.push(I)}let M=0;for(const E of u){const T=G[M];M=M+1;const I=y?.kanban?.sectionWidth||200,F=-I*3/2+O;let P=F;const te=S.nodes.filter(s=>s.parentId===E.id);for(const s of te){if(s.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");s.x=E.x,s.width=I-1.5*b;const r=(await(0,z.on)(A,s,{config:y})).node().getBBox();s.y=P+r.height/2,await(0,z.U_)(s),P=s.y+r.height/2+b/2}const U=T.cluster.select("rect"),C=Math.max(P-F+3*b,50)+(O-25);U.attr("height",C)}(0,k.ot)(void 0,l,y.mindmap?.padding??k.UI.kanban.padding,y.mindmap?.useMaxWidth??k.UI.kanban.useMaxWidth)},"draw"),Ke={draw:Ae},Re=(0,a.K2)(e=>{let d="";for(let i=0;i<e.THEME_COLOR_LIMIT;i++)e["lineColor"+i]=e["lineColor"+i]||e["cScaleInv"+i],(0,_e.A)(e["lineColor"+i])?e["lineColor"+i]=(0,ce.A)(e["lineColor"+i],20):e["lineColor"+i]=(0,le.A)(e["lineColor"+i],20);const m=(0,a.K2)((i,g)=>e.darkMode?(0,le.A)(i,g):(0,ce.A)(i,g),"adjuster");for(let i=0;i<e.THEME_COLOR_LIMIT;i++){const g=""+(17-3*i);d+=`
    .section-${i-1} rect, .section-${i-1} path, .section-${i-1} circle, .section-${i-1} polygon, .section-${i-1} path  {
      fill: ${m(e["cScale"+i],10)};
      stroke: ${m(e["cScale"+i],10)};

    }
    .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: ${g};
    }
    .section-${i-1} line {
      stroke: ${e["cScaleInv"+i]} ;
      stroke-width: 3;
    }

    .disabled, .disabled circle, .disabled text {
      fill: lightgray;
    }
    .disabled text {
      fill: #efefef;
    }

  .node rect,
  .node circle,
  .node ellipse,
  .node polygon,
  .node path {
    fill: ${e.background};
    stroke: ${e.nodeBorder};
    stroke-width: 1px;
  }

  .kanban-ticket-link {
    fill: ${e.background};
    stroke: ${e.nodeBorder};
    text-decoration: underline;
  }
    `}return d},"genSections"),Te=(0,a.K2)(e=>`
  .edge {
    stroke-width: 3;
  }
  ${Re(e)}
  .section-root rect, .section-root path, .section-root circle, .section-root polygon  {
    fill: ${e.git0};
  }
  .section-root text {
    fill: ${e.gitBranchLabel0};
  }
  .icon-container {
    height:100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .edge {
    fill: none;
  }
  .cluster-label, .label {
    color: ${e.textColor};
    fill: ${e.textColor};
    }
  .kanban-label {
    dy: 1em;
    alignment-baseline: middle;
    text-anchor: middle;
    dominant-baseline: middle;
    text-align: center;
  }
    ${(0,X.o)()}
`,"getStyles"),Pe=Te,je={db:Ce,renderer:Ke,parser:ye,styles:Pe}})}]);
