71 lines
38 KiB
JavaScript
71 lines
38 KiB
JavaScript
|
import{c as C,s as vt,g as Ct,a as Ot,b as Pt,x as At,y as Gt,l as B,j as D,A as St,h as It,z as Nt,as as Ht,at as Bt}from"../app.CV7ObeM5.js";import"./framework.DuA-ZlS8.js";import"./theme.B-IrzYt-.js";var mt=function(){var r=function(G,o,u,d){for(u=u||{},d=G.length;d--;u[G[d]]=o);return u},n=[1,3],l=[1,6],h=[1,4],i=[1,5],c=[2,5],p=[1,12],m=[5,7,13,19,21,23,24,26,28,31,37,40,47],x=[7,13,19,21,23,24,26,28,31,37,40],y=[7,12,13,19,21,23,24,26,28,31,37,40],a=[7,13,47],R=[1,42],_=[1,41],b=[7,13,29,32,35,38,47],f=[1,55],k=[1,56],g=[1,57],E=[7,13,32,35,42,47],z={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,GG:5,document:6,EOF:7,":":8,DIR:9,options:10,body:11,OPT:12,NL:13,line:14,statement:15,commitStatement:16,mergeStatement:17,cherryPickStatement:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,section:24,branchStatement:25,CHECKOUT:26,ref:27,BRANCH:28,ORDER:29,NUM:30,CHERRY_PICK:31,COMMIT_ID:32,STR:33,PARENT_COMMIT:34,COMMIT_TAG:35,EMPTYSTR:36,MERGE:37,COMMIT_TYPE:38,commitType:39,COMMIT:40,commit_arg:41,COMMIT_MSG:42,NORMAL:43,REVERSE:44,HIGHLIGHT:45,ID:46,";":47,$accept:0,$end:1},terminals_:{2:"error",5:"GG",7:"EOF",8:":",9:"DIR",12:"OPT",13:"NL",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"section",26:"CHECKOUT",28:"BRANCH",29:"ORDER",30:"NUM",31:"CHERRY_PICK",32:"COMMIT_ID",33:"STR",34:"PARENT_COMMIT",35:"COMMIT_TAG",36:"EMPTYSTR",37:"MERGE",38:"COMMIT_TYPE",40:"COMMIT",42:"COMMIT_MSG",43:"NORMAL",44:"REVERSE",45:"HIGHLIGHT",46:"ID",47:";"},productions_:[0,[3,2],[3,3],[3,4],[3,5],[6,0],[6,2],[10,2],[10,1],[11,0],[11,2],[14,2],[14,1],[15,1],[15,1],[15,1],[15,2],[15,2],[15,1],[15,1],[15,1],[15,2],[25,2],[25,4],[18,3],[18,5],[18,5],[18,7],[18,7],[18,5],[18,5],[18,5],[18,7],[18,7],[18,7],[18,7],[17,2],[17,4],[17,4],[17,4],[17,6],[17,6],[17,6],[17,6],[17,6],[17,6],[17,8],[17,8],[17,8],[17,8],[17,8],[17,8],[16,2],[16,3],[16,3],[16,5],[16,5],[16,3],[16,5],[16,5],[16,5],[16,5],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,3],[16,5],[16,5],[16,5],[16,5],[16,5],[16,5],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[41,0],[41,1],[39,1],[39,1],[39,1],[27,1],[27,1],[4,1],[4,1],[4,1]],performAction:function(o,u,d,s,T,t,X){var e=t.length-1;switch(T){case 2:return t[e];case 3:return t[e-1];case 4:return s.setDirection(t[e-3]),t[e-1];case 6:s.setOptions(t[e-1]),this.$=t[e];break;case 7:t[e-1]+=t[e],this.$=t[e-1];break;case 9:this.$=[];break;case 10:t[e-1].push(t[e]),this.$=t[e-1];break;case 11:this.$=t[e-1];break;case 16:this.$=t[e].trim(),s.setAccTitle(this.$);break;case 17:case 18:this.$=t[e].trim(),s.setAccDescription(this.$);break;case 19:s.addSection(t[e].substr(8)),this.$=t[e].substr(8);break;case 21:s.checkout(t[e]);break;case 22:s.branch(t[e]);break;case 23:s.branch(t[e-2],t[e]);break;case 24:s.cherryPick(t[e],"",void 0);break;case 25:s.cherryPick(t[e-2],"",void 0,t[e]);break;case 26:s.cherryPick(t[e-2],"",t[e]);break;case 27:s.cherryPick(t[e-4],"",t[e],t[e-2]);break;case 28:s.cherryPick(t[e-4],"",t[e-2],t[e]);break;case 29:s.cherryPick(t[e],"",t[e-2]);break;case 30:s.cherryPick(t[e],"","");break;case 31:s.cherryPick(t[e-2],"","");break;case 32:s.cherryPick(t[e-4],"","",t[e-2]);break;case 33:s.cherryPick(t[e-4],"","",t[e]);break;case 34:s.cherryPick(t[e-2],"",t[e-4],t[e]);break;case 35:s.cherryPick(t[e-2],"","",t[e]);break;case 36:s.merge(t[e],"","","");break;case 37:s.merge(t[e-2],t[e],"","");break;case 38:s.merge(t[e-2],"",t[e],"");break;case 39:s.merge(t[e-2],"","",t[e]);break;case 40:s.merge(t[e-4],t[e],"",t[e-2]);break;case 41:s.merge(t[e-4],"",t[e],t[e-2]);break;case 42:s.merge(t[e-4],"",t[e-2],t[e]);break;case 43:s.merge(t[e-4],t[e-2],t[e],"");break;case 44:s.merge(t[e-4],t[e-2],"",t[e]);break;case 45:s.merge(t[e-4],t[e],t[e-2],"");break;case 46:s.merge(t[e-6],
|
||
|
`+O.showPosition()+`
|
||
|
Expecting `+st.join(", ")+", got '"+(this.terminals_[N]||N)+"'":ht="Parse error on line "+(rt+1)+": Unexpected "+(N==pt?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(ht,{text:O.match,token:this.terminals_[N]||N,line:O.yylineno,loc:ot,expected:st})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+K+", token: "+N);switch(V[0]){case 1:d.push(N),T.push(O.yytext),t.push(O.yylloc),d.push(V[1]),N=null,ft=O.yyleng,e=O.yytext,rt=O.yylineno,ot=O.yylloc;break;case 2:if(j=this.productions_[V[1]][1],J.$=T[T.length-j],J._$={first_line:t[t.length-(j||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(j||1)].first_column,last_column:t[t.length-1].last_column},Rt&&(J._$.range=[t[t.length-(j||1)].range[0],t[t.length-1].range[1]]),lt=this.performAction.apply(J,[e,ft,rt,F.yy,V[1],T,t].concat(Lt)),typeof lt<"u")return lt;j&&(d=d.slice(0,-1*j*2),T=T.slice(0,-1*j),t=t.slice(0,-1*j)),d.push(this.productions_[V[1]][0]),T.push(J.$),t.push(J._$),bt=X[d[d.length-2]][d[d.length-1]],d.push(bt);break;case 3:return!0}}return!0}},M=function(){var G={EOF:1,parseError:function(u,d){if(this.yy.parser)this.yy.parser.parseError(u,d);else throw new Error(u)},setInput:function(o,u){return this.yy=u||this.yy||{},this._input=o,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},input:function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var u=o.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},unput:function(o){var u=o.length,d=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var s=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),d.length-1&&(this.yylineno-=d.length-1);var T=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:d?(d.length===s.length?this.yylloc.first_column:0)+s[s.length-d.length].length-d[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[T[0],T[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject: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},less:function(o){this.unput(this.match.slice(o))},pastInput:function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var o=this.pastInput(),u=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
|
||
|
`+u+"^"},test_match:function(o,u){var d,s,T;if(this.options.backtrack_lexer&&(T={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&&(T.yylloc.range=this.yylloc.range.slice(0))),s=o[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,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(o[0].length),this.matched+=o[0],d=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),d)return d;if(this._backtrack){for(var t in T)this[t]=T[t];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,u,d,s;this._more||(this.yytext="",this.match="");for(var T=this._currentRules(),t=0;t<T.length;t++)if(d=this._input.match(this.rules[T[t]]),d&&(!u||d[0].length>u[0].length)){if(u=d,s=t,this.options.backtrack_lexer){if(o=this.test_match(d,T[t]),o!==!1)return o;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(o=this.test_match(u,T[s]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
||
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var u=this.next();return u||this.lex()},begin:function(u){this.conditionStack.push(u)},popState:function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},pushState:function(u){this.begin(u)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(u,d,s,T){switch(s){case 0:return this.begin("acc_title"),19;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),21;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:return 13;case 8:break;case 9:break;case 10:return 5;case 11:return 40;case 12:return 32;case 13:return 38;case 14:return 42;case 15:return 43;case 16:return 44;case 17:return 45;case 18:return 35;case 19:return 28;case 20:return 29;case 21:return 37;case 22:return 31;case 23:return 34;case 24:return 26;case 25:return 9;case 26:return 9;case 27:return 8;case 28:return"CARET";case 29:this.begin("options");break;case 30:this.popState();break;case 31:return 12;case 32:return 36;case 33:this.begin("string");break;case 34:this.popState();break;case 35:return 33;case 36:return 30;case 37:return 46;case 38:return 7}},rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gitGraph\b)/i,/^(?:commit(?=\s|$))/i,/^(?:id:)/i,/^(?:type:)/i,/^(?:msg:)/i,/^(?:NORMAL\b)/i,/^(?:REVERSE\b)/i,/^(?:HIGHLIGHT\b)/i,/^(?:tag:)/i,/^(?:branch(?=\s|$))/i,/^(?:order:)/i,/^(?:merge(?=\s|$))/i,/^(?:cherry-pick(?=\s|$))/i,/^(?:parent:)/i,/^(?:checkout(?=\s|$))/i,/^(?:LR\b)/i,/^(?:TB\b)/i,/^(?::)/i,/^(?:\^)/i,/^(?:options\r?\n)/i,/^(?:[ \r\n\t]+end\b)/i,/^(?:[\s\S]+(?=[ \r\n\t]+end))/i,/^(?:["]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[0-9]+(?=\s|$))/i,/^(?:\w([-\./\w]*[-\w])?)/i,/^(?:$)/i,/^(?:\s+)/i],conditions:{acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},options:{rules:[30,31],inclusive:!1},string:{rules:[34,35],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,32,33,36,37,38,39],inclusive:!0}}};return G}();z.lexer=M;function S(){this.yy={}}return S.prototype=z,z.Parser=S,new S}();mt.parser=mt;const Vt=mt;let at=C().gitGraph.mainBranchName,Dt=C().gitGraph.mainBranchOrder,v={},I=null,tt={};tt[at]={name:at,order:Dt};let L={};L[at]=I;let A=at,kt="LR",W=0;function ut(){return Bt({length:7})}function zt(r,n){const l=Object.create(null);return r.reduce((h,i)=>{const c=n(i);return l[c]||(l[c]=!0,h.push(i)),h},[])}const jt=function(r){kt=r};let xt={};const qt=function(r){B.debug("options str",r),r=r&&r.trim(),r=r||"{}";try{xt=JSON.parse(r)}catch(n){B.error("error while parsing gitGraph options",n.message)}},Yt=function(){return xt},Ft=function(r,n,l,h){B.debug("Entering commit:",r,n,l,h),n=D.sanitizeText(n,C()),r=D.sanitizeText(r,C()),h=D.sanitizeText(h,C());const i={id:n||W+"-"+ut(),message:r,seq:W++,type:l||Q.NORMAL,tag:h||"",parents:I==null?[]:[I.id],branch:A};I=i,v[i.id]=i,L[A]=i.id,B.debug("in pushCommit "+i.id)},Kt=function(r,n){if(r=D.sanitizeText(r,C()),L[r]===void 0)L[r]=I!=null?I.id:null,tt[r]={name:r,order:n?parseInt(n,10):null},yt(r),B.debug("in createBranch");else{let l=new Error('Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout '+r+'")');throw l.hash={text:"branch "+r,token:"branch "+r,line:"1",loc:{first_line:1,last_line:1,fir
|
||
|
${p-o.width/2-4/2},${d+2}
|
||
|
${p-o.width/2-4/2},${d-2}
|
||
|
${f-o.width/2-4},${d-u-2}
|
||
|
${f+o.width/2+4},${d-u-2}
|
||
|
${f+o.width/2+4},${d+u+2}
|
||
|
${f-o.width/2-4},${d+u+2}`),S.attr("cx",p-o.width/2+4/2).attr("cy",d).attr("r",1.5).attr("class","tag-hole"),w==="TB"&&(M.attr("class","tag-label-bkg").attr("points",`
|
||
|
${g},${p+2}
|
||
|
${g},${p-2}
|
||
|
${g+a},${p-u-2}
|
||
|
${g+a+o.width+4},${p-u-2}
|
||
|
${g+a+o.width+4},${p+u+2}
|
||
|
${g+a},${p+u+2}`).attr("transform","translate(12,12) rotate(45, "+g+","+p+")"),S.attr("cx",g+4/2).attr("cy",p).attr("transform","translate(12,12) rotate(45, "+g+","+p+")"),G.attr("x",g+5).attr("y",p+3).attr("transform","translate(14,14) rotate(45, "+g+","+p+")"))}}p+=R+a,p>et&&(et=p)})},ne=(r,n,l,h,i)=>{const p=(w==="TB"?l.x<h.x:l.y<h.y)?n.branch:r.branch,m=y=>y.branch===p,x=y=>y.seq>r.seq&&y.seq<n.seq;return Object.values(i).some(y=>x(y)&&m(y))},$=(r,n,l=0)=>{const h=r+Math.abs(r-n)/2;if(l>5)return h;if(nt.every(p=>Math.abs(p-h)>=10))return nt.push(h),h;const c=Math.abs(r-n);return $(r,n-c/5,l+1)},ce=(r,n,l,h)=>{const i=Y[n.id],c=Y[l.id],p=ne(n,l,i,c,h);let m="",x="",y=0,a=0,R=H[l.branch].index;l.type===P.MERGE&&n.id!==l.parents[0]&&(R=H[n.branch].index);let _;if(p){m="A 10 10, 0, 0, 0,",x="A 10 10, 0, 0, 1,",y=10,a=10;const b=i.y<c.y?$(i.y,c.y):$(c.y,i.y),f=i.x<c.x?$(i.x,c.x):$(c.x,i.x);w==="TB"?i.x<c.x?_=`M ${i.x} ${i.y} L ${f-y} ${i.y} ${x} ${f} ${i.y+a} L ${f} ${c.y-y} ${m} ${f+a} ${c.y} L ${c.x} ${c.y}`:(R=H[n.branch].index,_=`M ${i.x} ${i.y} L ${f+y} ${i.y} ${m} ${f} ${i.y+a} L ${f} ${c.y-y} ${x} ${f-a} ${c.y} L ${c.x} ${c.y}`):i.y<c.y?_=`M ${i.x} ${i.y} L ${i.x} ${b-y} ${m} ${i.x+a} ${b} L ${c.x-y} ${b} ${x} ${c.x} ${b+a} L ${c.x} ${c.y}`:(R=H[n.branch].index,_=`M ${i.x} ${i.y} L ${i.x} ${b+y} ${x} ${i.x+a} ${b} L ${c.x-y} ${b} ${m} ${c.x} ${b-a} L ${c.x} ${c.y}`)}else m="A 20 20, 0, 0, 0,",x="A 20 20, 0, 0, 1,",y=20,a=20,w==="TB"?(i.x<c.x&&(l.type===P.MERGE&&n.id!==l.parents[0]?_=`M ${i.x} ${i.y} L ${i.x} ${c.y-y} ${m} ${i.x+a} ${c.y} L ${c.x} ${c.y}`:_=`M ${i.x} ${i.y} L ${c.x-y} ${i.y} ${x} ${c.x} ${i.y+a} L ${c.x} ${c.y}`),i.x>c.x&&(m="A 20 20, 0, 0, 0,",x="A 20 20, 0, 0, 1,",y=20,a=20,l.type===P.MERGE&&n.id!==l.parents[0]?_=`M ${i.x} ${i.y} L ${i.x} ${c.y-y} ${x} ${i.x-a} ${c.y} L ${c.x} ${c.y}`:_=`M ${i.x} ${i.y} L ${c.x+y} ${i.y} ${m} ${c.x} ${i.y+a} L ${c.x} ${c.y}`),i.x===c.x&&(_=`M ${i.x} ${i.y} L ${c.x} ${c.y}`)):(i.y<c.y&&(l.type===P.MERGE&&n.id!==l.parents[0]?_=`M ${i.x} ${i.y} L ${c.x-y} ${i.y} ${x} ${c.x} ${i.y+a} L ${c.x} ${c.y}`:_=`M ${i.x} ${i.y} L ${i.x} ${c.y-y} ${m} ${i.x+a} ${c.y} L ${c.x} ${c.y}`),i.y>c.y&&(l.type===P.MERGE&&n.id!==l.parents[0]?_=`M ${i.x} ${i.y} L ${c.x-y} ${i.y} ${m} ${c.x} ${i.y-a} L ${c.x} ${c.y}`:_=`M ${i.x} ${i.y} L ${i.x} ${c.y+y} ${x} ${i.x+a} ${c.y} L ${c.x} ${c.y}`),i.y===c.y&&(_=`M ${i.x} ${i.y} L ${c.x} ${c.y}`));r.append("path").attr("d",_).attr("class","arrow arrow"+R%U)},oe=(r,n)=>{const l=r.append("g").attr("class","commit-arrows");Object.keys(n).forEach(h=>{const i=n[h];i.parents&&i.parents.length>0&&i.parents.forEach(c=>{ce(l,n[c],i,n)})})},le=(r,n)=>{const l=C().gitGraph,h=r.append("g");n.forEach((i,c)=>{const p=c%U,m=H[i.name].pos,x=h.append("line");x.attr("x1",0),x.attr("y1",m),x.attr("x2",et),x.attr("y2",m),x.attr("class","branch branch"+p),w==="TB"&&(x.attr("y1",30),x.attr("x1",m),x.attr("y2",et),x.attr("x2",m)),nt.push(m);let y=i.name;const a=Tt(y),R=h.insert("rect"),b=h.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+p);b.node().appendChild(a);let f=a.getBBox();R.attr("class","branchLabelBkg label"+p).attr("rx",4).attr("ry",4).attr("x",-f.width-4-(l.rotateCommitLabel===!0?30:0)).attr("y",-f.height/2+8).attr("width",f.width+18).attr("height",f.height+4),b.attr("transform","translate("+(-f.width-14-(l.rotateCommitLabel===!0?30:0))+", "+(m-f.height/2-1)+")"),w==="TB"&&(R.attr("x",m-f.width/2-10).attr("y",0),b.attr("transform","translate("+(m-f.width/2-5)+", 0)")),w!=="TB"&&R.attr("transform","translate(-19, "+(m-f.height/2)+")")})},he=function(r,n,l,h){se();const i=C(),c=i.gitGraph;B.debug("in gitgraph renderer",r+`
|
||
|
`,"id:",n,l),Z=h.db.getCommits();const p=h.db.getBranchesAsObjArray();w=h.db.getDirection();const m=It(`[id="${n}"]`);let x=0;p.forEach((y,a)=>{const R=Tt(y.name),_=m.append("g"),b=_.insert("g").attr("class","branchLabel"),f=b.insert("g").attr("class","label branch-label");f.node().appendChild(R);let k=R.getBBox();H[y.name]={pos:x,index:a},x+=50+(c.rotateCommitLabel?40:0)+(w==="TB"?k.width/2:0),f.remove(),b.remove(),_.remove()}),dt(m,Z,!1),c.showBranches&&le(m,p),oe(m,Z),dt(m,Z,!0),Nt.insertTitle(m,"gitTitleText",c.titleTopMargin,h.db.getDiagramTitle()),Ht(void 0,m,c.diagramPadding,c.useMaxWidth??i.useMaxWidth)},me={draw:he},ue=r=>`
|
||
|
.commit-id,
|
||
|
.commit-msg,
|
||
|
.branch-label {
|
||
|
fill: lightgrey;
|
||
|
color: lightgrey;
|
||
|
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
||
|
font-family: var(--mermaid-font-family);
|
||
|
}
|
||
|
${[0,1,2,3,4,5,6,7].map(n=>`
|
||
|
.branch-label${n} { fill: ${r["gitBranchLabel"+n]}; }
|
||
|
.commit${n} { stroke: ${r["git"+n]}; fill: ${r["git"+n]}; }
|
||
|
.commit-highlight${n} { stroke: ${r["gitInv"+n]}; fill: ${r["gitInv"+n]}; }
|
||
|
.label${n} { fill: ${r["git"+n]}; }
|
||
|
.arrow${n} { stroke: ${r["git"+n]}; }
|
||
|
`).join(`
|
||
|
`)}
|
||
|
|
||
|
.branch {
|
||
|
stroke-width: 1;
|
||
|
stroke: ${r.lineColor};
|
||
|
stroke-dasharray: 2;
|
||
|
}
|
||
|
.commit-label { font-size: ${r.commitLabelFontSize}; fill: ${r.commitLabelColor};}
|
||
|
.commit-label-bkg { font-size: ${r.commitLabelFontSize}; fill: ${r.commitLabelBackground}; opacity: 0.5; }
|
||
|
.tag-label { font-size: ${r.tagLabelFontSize}; fill: ${r.tagLabelColor};}
|
||
|
.tag-label-bkg { fill: ${r.tagLabelBackground}; stroke: ${r.tagLabelBorder}; }
|
||
|
.tag-hole { fill: ${r.textColor}; }
|
||
|
|
||
|
.commit-merge {
|
||
|
stroke: ${r.primaryColor};
|
||
|
fill: ${r.primaryColor};
|
||
|
}
|
||
|
.commit-reverse {
|
||
|
stroke: ${r.primaryColor};
|
||
|
fill: ${r.primaryColor};
|
||
|
stroke-width: 3;
|
||
|
}
|
||
|
.commit-highlight-outer {
|
||
|
}
|
||
|
.commit-highlight-inner {
|
||
|
stroke: ${r.primaryColor};
|
||
|
fill: ${r.primaryColor};
|
||
|
}
|
||
|
|
||
|
.arrow { stroke-width: 8; stroke-linecap: round; fill: none}
|
||
|
.gitTitleText {
|
||
|
text-anchor: middle;
|
||
|
font-size: 18px;
|
||
|
fill: ${r.textColor};
|
||
|
}
|
||
|
`,fe=ue,de={parser:Vt,db:ie,renderer:me,styles:fe};export{de as diagram};
|