mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-07 21:44:36 +08:00
88 lines
20 KiB
JavaScript
88 lines
20 KiB
JavaScript
import{a as me}from"./chunk-5XJO6U7A.js";import{a as pe,b as fe}from"./chunk-VJZZWRCC.js";import{e as be,h as ye,k as ke}from"./chunk-FIA6NTGC.js";import"./chunk-VW6A6SAT.js";import"./chunk-NCYNIMJ4.js";import"./chunk-ZPWCXWQI.js";import"./chunk-47P5NBBB.js";import"./chunk-XHGORZV2.js";import{H as V,P as de,Z as M,d as ge,e as ne,f as ie,h as c,j as q,v as X}from"./chunk-KRX7QNR4.js";import"./chunk-24JW6VB3.js";import"./chunk-MGYUK2XN.js";var re=function(){var e=c(function(p,i,t,a){for(t=t||{},a=p.length;a--;t[p[a]]=i);return t},"o"),d=[1,4],f=[1,13],s=[1,12],k=[1,15],_=[1,16],u=[1,20],b=[1,19],D=[6,7,8],g=[1,26],O=[1,24],L=[1,25],m=[6,7,11],I=[1,31],r=[6,7,11,24],B=[1,6,13,16,17,20,23],U=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],F={trace:c(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:c(function(i,t,a,l,h,n,C){var o=n.length-1;switch(h){case 6:case 7:return l;case 8:l.getLogger().trace("Stop NL ");break;case 9:l.getLogger().trace("Stop EOF ");break;case 11:l.getLogger().trace("Stop NL2 ");break;case 12:l.getLogger().trace("Stop EOF2 ");break;case 15:l.getLogger().info("Node: ",n[o-1].id),l.addNode(n[o-2].length,n[o-1].id,n[o-1].descr,n[o-1].type,n[o]);break;case 16:l.getLogger().info("Node: ",n[o].id),l.addNode(n[o-1].length,n[o].id,n[o].descr,n[o].type);break;case 17:l.getLogger().trace("Icon: ",n[o]),l.decorateNode({icon:n[o]});break;case 18:case 23:l.decorateNode({class:n[o]});break;case 19:l.getLogger().trace("SPACELIST");break;case 20:l.getLogger().trace("Node: ",n[o-1].id),l.addNode(0,n[o-1].id,n[o-1].descr,n[o-1].type,n[o]);break;case 21:l.getLogger().trace("Node: ",n[o].id),l.addNode(0,n[o].id,n[o].descr,n[o].type);break;case 22:l.decorateNode({icon:n[o]});break;case 27:l.getLogger().trace("node found ..",n[o-2]),this.$={id:n[o-1],descr:n[o-1],type:l.getType(n[o-2],n[o])};break;case 28:this.$={id:n[o],descr:n[o],type:0};break;case 29:l.getLogger().trace("node found ..",n[o-3]),this.$={id:n[o-3],descr:n[o-1],type:l.getType(n[o-2],n[o])};break;case 30:this.$=n[o-1]+n[o];break;case 31:this.$=n[o];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:f,7:[1,10],9:9,12:11,13:s,14:14,16:k,17:_,18:17,19:18,20:u,23:b},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:f,12:21,13:s,14:14,16:k,17:_,18:17,19:18,20:u,23:b},{6:f,9:22,12:11,13:s,14:14,16:k,17:_,18:17,19:18,20:u,23:b},{6:g,7:O,10:23,11:L},e(m,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:u,23:b}),e(m,[2,19]),e(m,[2,21],{15:30,24:I}),e(m,[2,22]),e(m,[2,23]),e(r,[2,25]),e(r,[2,26]),e(r,[2,28],{20:[1,32]}),{21:[1,33]},{6:g,7:O,10:34,11:L},{1:[2,7],6:f,12:21,13:s,14:14,16:k,17:_,18:17,19:18,20:u,23:b},e(B,[2,14],{7:U,11:j}),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(m,[2,16],{15:37,24:I}),e(m,[2,17]),e(m,[2,18]),e(m,[2,20],{24:H}),e(r,[2,31]),{21:[1,39]},{22:[1,40]},e(B,[2,13],{7:U,11:j}),e(A,[2,11]),e(A,[2,12]),e(m,[2,15],{24:H}),e(r,[2,30]),{22:[1,41]},e(r,[2,27]),e(r,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(i,t){if(t.recoverable)this.trace(i);else{var a=new Error(i);throw a.hash=t,a}},"parseError"),parse:c(function(i){var t=this,a=[0],l=[],h=[null],n=[],C=this.table,o="",W=0,z=0,le=0,_e=2,ce=1,Se=n.slice.call(arguments,1),E=Object.create(this.lexer),R={yy:{}};for(var Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(R.yy[Q]=this.yy[Q]);E.setInput(i,R.yy),R.yy.lexer=E,R.yy.parser=this,typeof E.yylloc=="undefined"&&(E.yylloc={});var Z=E.yylloc;n.push(Z);var Ne=E.options&&E.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function xe(N){a.length=a.length-2*N,h.length=h.length-N,n.length=n.length-N}c(xe,"popStack");function he(){var N;return N=l.pop()||E.lex()||ce,typeof N!="number"&&(N instanceof Array&&(l=N,N=l.pop()),N=t.symbols_[N]||N),N}c(he,"lex");for(var S,$,P,x,He,ee,G={},Y,w,ue,J;;){if(P=a[a.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((S===null||typeof S=="undefined")&&(S=he()),x=C[P]&&C[P][S]),typeof x=="undefined"||!x.length||!x[0]){var te="";J=[];for(Y in C[P])this.terminals_[Y]&&Y>_e&&J.push("'"+this.terminals_[Y]+"'");E.showPosition?te="Parse error on line "+(W+1)+`:
|
|
`+E.showPosition()+`
|
|
Expecting `+J.join(", ")+", got '"+(this.terminals_[S]||S)+"'":te="Parse error on line "+(W+1)+": Unexpected "+(S==ce?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(te,{text:E.match,token:this.terminals_[S]||S,line:E.yylineno,loc:Z,expected:J})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+S);switch(x[0]){case 1:a.push(S),h.push(E.yytext),n.push(E.yylloc),a.push(x[1]),S=null,$?(S=$,$=null):(z=E.yyleng,o=E.yytext,W=E.yylineno,Z=E.yylloc,le>0&&le--);break;case 2:if(w=this.productions_[x[1]][1],G.$=h[h.length-w],G._$={first_line:n[n.length-(w||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(w||1)].first_column,last_column:n[n.length-1].last_column},Ne&&(G._$.range=[n[n.length-(w||1)].range[0],n[n.length-1].range[1]]),ee=this.performAction.apply(G,[o,z,W,R.yy,x[1],h,n].concat(Se)),typeof ee!="undefined")return ee;w&&(a=a.slice(0,-1*w*2),h=h.slice(0,-1*w),n=n.slice(0,-1*w)),a.push(this.productions_[x[1]][0]),h.push(G.$),n.push(G._$),ue=C[a[a.length-2]][a[a.length-1]],a.push(ue);break;case 3:return!0}}return!0},"parse")},K=function(){var p={EOF:1,parseError:c(function(t,a){if(this.yy.parser)this.yy.parser.parseError(t,a);else throw new Error(t)},"parseError"),setInput:c(function(i,t){return this.yy=t||this.yy||{},this._input=i,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:c(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var t=i.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:c(function(i){var t=i.length,a=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var l=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 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:a?(a.length===l.length?this.yylloc.first_column:0)+l[l.length-a.length].length-a[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(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:c(function(i){this.unput(this.match.slice(i))},"less"),pastInput:c(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var i=this.pastInput(),t=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
`+t+"^"},"showPosition"),test_match:c(function(i,t){var a,l,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))),l=i[0].match(/(?:\r\n?|\n).*/g),l&&(this.yylineno+=l.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:l?l[l.length-1].length-l[l.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,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(i[0].length),this.matched+=i[0],a=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var n in h)this[n]=h[n];return!1}return!1},"test_match"),next:c(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,t,a,l;this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),n=0;n<h.length;n++)if(a=this._input.match(this.rules[h[n]]),a&&(!t||a[0].length>t[0].length)){if(t=a,l=n,this.options.backtrack_lexer){if(i=this.test_match(a,h[n]),i!==!1)return i;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(i=this.test_match(t,h[l]),i!==!1?i:!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:c(function(){var t=this.next();return t||this.lex()},"lex"),begin:c(function(t){this.conditionStack.push(t)},"begin"),popState:c(function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:c(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:c(function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:c(function(t){this.begin(t)},"pushState"),stateStackSize:c(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:c(function(t,a,l,h){var n=h;switch(l){case 0:return this.pushState("shapeData"),a.yytext="",24;break;case 1:return this.pushState("shapeDataStr"),24;break;case 2:return this.popState(),24;break;case 3:let C=/\n\s*/g;return a.yytext=a.yytext.replace(C,"<br/>"),24;break;case 4:return 24;case 5:this.popState();break;case 6:return t.getLogger().trace("Found comment",a.yytext),6;break;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;break;case 10:this.popState();break;case 11:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return t.getLogger().trace("SPACELINE"),6;break;case 13:return 7;case 14:return 16;case 15:t.getLogger().trace("end icon"),this.popState();break;case 16:return t.getLogger().trace("Exploding node"),this.begin("NODE"),20;break;case 17:return t.getLogger().trace("Cloud"),this.begin("NODE"),20;break;case 18:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;break;case 19:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;break;case 20:return this.begin("NODE"),20;break;case 21:return this.begin("NODE"),20;break;case 22:return this.begin("NODE"),20;break;case 23:return this.begin("NODE"),20;break;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:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",a.yytext),"NODE_DESCR";break;case 32:this.popState();break;case 33:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";break;case 34:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";break;case 35:return this.popState(),t.getLogger().trace("node end ...",a.yytext),"NODE_DEND";break;case 36:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";break;case 37:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";break;case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";break;case 39:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";break;case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";break;case 41:return t.getLogger().trace("Long description:",a.yytext),21;break;case 42:return t.getLogger().trace("Long description:",a.yytext),21;break}},"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 p}();F.lexer=K;function T(){this.yy={}}return c(T,"Parser"),T.prototype=F,F.Parser=T,new T}();re.parser=re;var ve=re,v=[],ae=[],se=0,oe={},De=c(()=>{v=[],ae=[],se=0,oe={}},"clear"),Le=c(e=>{if(v.length===0)return null;let d=v[0].level,f=null;for(let s=v.length-1;s>=0;s--)if(v[s].level===d&&!f&&(f=v[s]),v[s].level<d)throw new Error('Items without section detected, found section ("'+v[s].label+'")');return e===(f==null?void 0:f.level)?null:f},"getSection"),Ee=c(function(){return ae},"getSections"),Oe=c(function(){var k,_;let e=[],d=[],f=Ee(),s=M();for(let u of f){let b={id:u.id,label:V((k=u.label)!=null?k:"",s),isGroup:!0,ticket:u.ticket,shape:"kanbanSection",level:u.level,look:s.look};d.push(b);let D=v.filter(g=>g.parentId===u.id);for(let g of D){let O={id:g.id,parentId:u.id,label:V((_=g.label)!=null?_:"",s),isGroup:!1,ticket:g==null?void 0:g.ticket,priority:g==null?void 0:g.priority,assigned:g==null?void 0:g.assigned,icon:g==null?void 0:g.icon,shape:"kanbanItem",level:g.level,rx:5,ry:5,cssStyles:["text-align: left"]};d.push(O)}}return{nodes:d,edges:e,other:{},config:M()}},"getData"),Ie=c((e,d,f,s,k)=>{var g,O,L,m;let _=M(),u=(O=(g=_.mindmap)==null?void 0:g.padding)!=null?O:X.mindmap.padding;switch(s){case y.ROUNDED_RECT:case y.RECT:case y.HEXAGON:u*=2}let b={id:V(d,_)||"kbn"+se++,level:e,label:V(f,_),width:(m=(L=_.mindmap)==null?void 0:L.maxNodeWidth)!=null?m:X.mindmap.maxNodeWidth,padding:u,isGroup:!1};if(k!==void 0){let I;k.includes(`
|
|
`)?I=k+`
|
|
`:I=`{
|
|
`+k+`
|
|
}`;let r=fe(I,{schema:pe});if(r.shape&&(r.shape!==r.shape.toLowerCase()||r.shape.includes("_")))throw new Error(`No such shape: ${r.shape}. Shape names should be lowercase.`);r!=null&&r.shape&&r.shape==="kanbanItem"&&(b.shape=r==null?void 0:r.shape),r!=null&&r.label&&(b.label=r==null?void 0:r.label),r!=null&&r.icon&&(b.icon=r==null?void 0:r.icon.toString()),r!=null&&r.assigned&&(b.assigned=r==null?void 0:r.assigned.toString()),r!=null&&r.ticket&&(b.ticket=r==null?void 0:r.ticket.toString()),r!=null&&r.priority&&(b.priority=r==null?void 0:r.priority)}let D=Le(e);D?b.parentId=D.id||"kbn"+se++:ae.push(b),v.push(b)},"addNode"),y={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ce=c((e,d)=>{switch(q.debug("In get type",e,d),e){case"[":return y.RECT;case"(":return d===")"?y.ROUNDED_RECT:y.CLOUD;case"((":return y.CIRCLE;case")":return y.CLOUD;case"))":return y.BANG;case"{{":return y.HEXAGON;default:return y.DEFAULT}},"getType"),we=c((e,d)=>{oe[e]=d},"setElementForId"),Ae=c(e=>{if(!e)return;let d=M(),f=v[v.length-1];e.icon&&(f.icon=V(e.icon,d)),e.class&&(f.cssClasses=V(e.class,d))},"decorateNode"),Te=c(e=>{switch(e){case y.DEFAULT:return"no-border";case y.RECT:return"rect";case y.ROUNDED_RECT:return"rounded-rect";case y.CIRCLE:return"circle";case y.CLOUD:return"cloud";case y.BANG:return"bang";case y.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Re=c(()=>q,"getLogger"),Pe=c(e=>oe[e],"getElementById"),Ve={clear:De,addNode:Ie,getSections:Ee,getData:Oe,nodeType:y,getType:Ce,setElementForId:we,decorateNode:Ae,type2Str:Te,getLogger:Re,getElementById:Pe},Be=Ve,Fe=c(async(e,d,f,s)=>{var U,j,A,H,F,K,T;q.debug(`Rendering kanban diagram
|
|
`+e);let _=s.db.getData(),u=M();u.htmlLabels=!1;let b=me(d),D=b.append("g");D.attr("class","sections");let g=b.append("g");g.attr("class","items");let O=_.nodes.filter(p=>p.isGroup),L=0,m=10,I=[],r=25;for(let p of O){let i=((U=u==null?void 0:u.kanban)==null?void 0:U.sectionWidth)||200;L=L+1,p.x=i*L+(L-1)*m/2,p.width=i,p.y=0,p.height=i*3,p.rx=5,p.ry=5,p.cssClasses=p.cssClasses+" section-"+L;let t=await be(D,p);r=Math.max(r,(j=t==null?void 0:t.labelBBox)==null?void 0:j.height),I.push(t)}let B=0;for(let p of O){let i=I[B];B=B+1;let t=((A=u==null?void 0:u.kanban)==null?void 0:A.sectionWidth)||200,a=-t*3/2+r,l=a,h=_.nodes.filter(o=>o.parentId===p.id);for(let o of h){if(o.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");o.x=p.x,o.width=t-1.5*m;let z=(await ye(g,o,{config:u})).node().getBBox();o.y=l+z.height/2,await ke(o),l=o.y+z.height/2+m/2}let n=i.cluster.select("rect"),C=Math.max(l-a+3*m,50)+(r-25);n.attr("height",C)}de(void 0,b,(F=(H=u.mindmap)==null?void 0:H.padding)!=null?F:X.kanban.padding,(T=(K=u.mindmap)==null?void 0:K.useMaxWidth)!=null?T:X.kanban.useMaxWidth)},"draw"),Ge={draw:Fe},Me=c(e=>{let d="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)e["lineColor"+s]=e["lineColor"+s]||e["cScaleInv"+s],ge(e["lineColor"+s])?e["lineColor"+s]=ne(e["lineColor"+s],20):e["lineColor"+s]=ie(e["lineColor"+s],20);let f=c((s,k)=>e.darkMode?ie(s,k):ne(s,k),"adjuster");for(let s=0;s<e.THEME_COLOR_LIMIT;s++){let k=""+(17-3*s);d+=`
|
|
.section-${s-1} rect, .section-${s-1} path, .section-${s-1} circle, .section-${s-1} polygon, .section-${s-1} path {
|
|
fill: ${f(e["cScale"+s],10)};
|
|
stroke: ${f(e["cScale"+s],10)};
|
|
|
|
}
|
|
.section-${s-1} text {
|
|
fill: ${e["cScaleLabel"+s]};
|
|
}
|
|
.node-icon-${s-1} {
|
|
font-size: 40px;
|
|
color: ${e["cScaleLabel"+s]};
|
|
}
|
|
.section-edge-${s-1}{
|
|
stroke: ${e["cScale"+s]};
|
|
}
|
|
.edge-depth-${s-1}{
|
|
stroke-width: ${k};
|
|
}
|
|
.section-${s-1} line {
|
|
stroke: ${e["cScaleInv"+s]} ;
|
|
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"),Ue=c(e=>`
|
|
.edge {
|
|
stroke-width: 3;
|
|
}
|
|
${Me(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;
|
|
}
|
|
`,"getStyles"),je=Ue,$e={db:Be,renderer:Ge,parser:ve,styles:je};export{$e as diagram};
|