2023-07-20 03:58:40 +08:00
import { Aa as Me , Fa as Ae , Ka as Oe , Na as Se , b as Ke , c as Fe , da as O , h as ye , ha as V , na as A , qa as Ee , ra as ve , sa as we , ta as Te , ua as Re , va as Ce , wa as Le , z as Ue , za as te } from "./chunk-KU2GO2AH.js" ; import { a as _e , b as xe , h as ue } from "./chunk-2YVZDWG7.js" ; var Ct = ue ( Ke ( ) , 1 ) , Lt = ue ( Fe ( ) , 1 ) , Mt = ue ( Ue ( ) , 1 ) ; var pe = function ( ) { var r = function ( B , l , u , b ) { for ( u = u || { } , b = B . length ; b -- ; u [ B [ b ] ] = l ) ; return u } , a = [ 1 , 4 ] , o = [ 1 , 7 ] , h = [ 1 , 5 ] , c = [ 1 , 9 ] , n = [ 1 , 6 ] , f = [ 2 , 6 ] , p = [ 1 , 16 ] , v = [ 6 , 8 , 14 , 20 , 22 , 24 , 25 , 27 , 29 , 32 , 37 , 40 , 50 , 55 ] , y = [ 8 , 14 , 20 , 22 , 24 , 25 , 27 , 29 , 32 , 37 , 40 ] , m = [ 8 , 13 , 14 , 20 , 22 , 24 , 25 , 27 , 29 , 32 , 37 , 40 ] , d = [ 1 , 26 ] , _ = [ 6 , 8 , 14 , 50 , 55 ] , s = [ 8 , 14 , 55 ] , C = [ 1 , 53 ] , w = [ 1 , 52 ] , H = [ 8 , 14 , 30 , 33 , 35 , 38 , 55 ] , x = [ 1 , 67 ] , g = [ 1 , 68 ] , k = [ 1 , 69 ] , P = [ 8 , 14 , 33 , 35 , 42 , 55 ] , ce = { trace : function ( ) { } , yy : { } , symbols _ : { error : 2 , start : 3 , eol : 4 , directive : 5 , GG : 6 , document : 7 , EOF : 8 , ":" : 9 , DIR : 10 , options : 11 , body : 12 , OPT : 13 , NL : 14 , line : 15 , statement : 16 , commitStatement : 17 , mergeStatement : 18 , cherryPickStatement : 19 , acc _title : 20 , acc _title _value : 21 , acc _descr : 22 , acc _descr _value : 23 , acc _descr _multiline _value : 24 , section : 25 , branchStatement : 26 , CHECKOUT : 27 , ref : 28 , BRANCH : 29 , ORDER : 30 , NUM : 31 , CHERRY _PICK : 32 , COMMIT _ID : 33 , STR : 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 , openDirective : 46 , typeDirective : 47 , closeDirective : 48 , argDirective : 49 , open _directive : 50 , type _directive : 51 , arg _directive : 52 , close _directive : 53 , ID : 54 , ";" : 55 , $accept : 0 , $end : 1 } , terminals _ : { 2 : "error" , 6 : "GG" , 8 : "EOF" , 9 : ":" , 10 : "DIR" , 13 : "OPT" , 14 : "NL" , 20 : "acc_title" , 21 : "acc_title_value" , 22 : "acc_descr" , 23 : "acc_descr_value" , 24 : "acc_descr_multiline_value" , 25 : "section" , 27 : "CHECKOUT" , 29 : "BRANCH" , 30 : "ORDER" , 31 : "NUM" , 32 : "CHERRY_PICK" , 33 : "COMMIT_ID" , 34 : "STR" , 35 : "COMMIT_TAG" , 36 : "EMPTYSTR" , 37 : "MERGE" , 38 : "COMMIT_TYPE" , 40 : "COMMIT" , 42 : "COMMIT_MSG" , 43 : "NORMAL" , 44 : "REVERSE" , 45 : "HIGHLIGHT" , 50 : "open_directive" , 51 : "type_directive" , 52 : "arg_directive" , 53 : "close_directive" , 54 : "ID" , 55 : ";" } , productions _ : [ 0 , [ 3 , 2 ] , [ 3 , 2 ] , [ 3 , 3 ] , [ 3 , 4 ] , [ 3 , 5 ] , [ 7 , 0 ] , [ 7 , 2 ] , [ 11 , 2 ] , [ 11 , 1 ] , [ 12 , 0 ] , [ 12 , 2 ] , [ 15 , 2 ] , [ 15 , 1 ] , [ 16 , 1 ] , [ 16 , 1 ] , [ 16 , 1 ] , [ 16 , 2 ] , [ 16 , 2 ] , [ 16 , 1 ] , [ 16 , 1 ] , [ 16 , 1 ] , [ 16 , 2 ] , [ 26 , 2 ] , [ 26 , 4 ] , [ 19 , 3 ] , [ 19 , 5 ] , [ 19 , 5 ] , [ 19 , 5 ] , [ 19 , 5 ] , [ 18 , 2 ] , [ 18 , 4 ] , [ 18 , 4 ] , [ 18 , 4 ] , [ 18 , 6 ] , [ 18 , 6 ] , [ 18 , 6 ] , [ 18 , 6 ] , [ 18 , 6 ] , [ 18 , 6 ] , [ 18 , 8 ] , [ 18 , 8 ] , [ 18 , 8 ] , [ 18 , 8 ] , [ 18 , 8 ] , [ 18 , 8 ] , [ 17 , 2 ] , [ 17 , 3 ] , [ 17 , 3 ] , [ 17 , 5 ] , [ 17 , 5 ] , [ 17 , 3 ] , [ 17 , 5 ] , [ 17 , 5 ] , [ 17 , 5 ] , [ 17 , 5 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 3 ] , [ 17 , 5 ] , [ 17 , 5 ] , [ 17 , 5 ] , [ 17 , 5 ] , [ 17 , 5 ] , [ 17 , 5 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 7 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 17 , 9 ] , [ 41 , 0 ] , [ 41 , 1 ] , [ 39 , 1 ] , [ 39 , 1 ] , [ 39 , 1 ] , [ 5 , 3 ] , [ 5 , 5 ] , [ 46 , 1 ] , [ 47 , 1 ] , [ 49 , 1 ] , [ 48 , 1 ] , [ 28 , 1 ] , [ 28 , 1 ] , [ 4 , 1 ] , [ 4 , 1 ] , [ 4 , 1 ] ] , performAction : function ( l , u , b , i , E , e , W ) { var t = e . length - 1 ; switch ( E ) { case 3 : return e [ t ] ; case 4 : return e [ t - 1 ] ; case 5 : return i . setDirection ( e [ t - 3 ] ) , e [ t - 1 ] ; case 7 : i . setOptions ( e [ t - 1 ] ) , this . $ = e [ t ] ; break ; case 8 : e [ t - 1 ] += e [ t ] , this . $ = e [ t - 1 ] ; break ; case 10 : this . $ = [ ] ; break ; case 11 : e [ t - 1 ] . push ( e [ t ] ) , this . $ = e [ t - 1 ] ; break ; case 12 : this . $ = e [ t - 1 ] ; break ; case 17 : this . $ = e [ t ] . trim ( ) , i . setAccTitle ( this . $ ) ; break ; case 18 : case 19 : this . $ = e [ t ] . trim ( ) , i . setAccDescription ( this . $ ) ; break ; case 20 : i . addSection ( e [ t ] . substr ( 8 ) ) , this . $ = e [ t ] . substr ( 8 ) ; break ; case 22 : i . checkout ( e [ t ] ) ; break ; case 23 : i . branch ( e [ t ] ) ; break ; case 24 : i . branch ( e [ t - 2 ] , e [ t ] ) ; break ; case 25 : i . cherryPick ( e [ t ] , "" , void 0 ) ; break ; case 26 : i . cherryPick ( e [ t - 2 ] , "" , e [ t ] ) ; break ; case 27 : case 29 : i . cherryPick ( e [ t - 2 ] , "" , "" ) ; break ; case 28 : i . cherryPick ( e [ t ] , "" , e [ t - 2 ] ) ; break ; case 30 : i . merge ( e [ t ] , "" , "" , "" ) ; break ; case 31 : i . merge ( e [ t - 2 ] , e [ t ] , "" , "" ) ; break ; case 32 : i . merge ( e [ t - 2 ] , "" , e [ t ] , "" ) ; break ; case 33 : i . merge ( e [ t - 2 ] , "" , "" , e [ t ] ) ; break ; case 34 : i . merge ( e [ t - 4 ] , e [ t ] , "" , e [ t - 2 ] ) ; break ; case 35 : i . merge ( e [ t - 4 ] , "" , e [ t ] , e [ t - 2 ] ) ; break ; case 36 : i . merge ( e [ t - 4 ] , "" , e [ t - 2 ] , e [ t ] ) ; break ; case 37 : i . merge ( e [ t - 4 ] , e [ t - 2 ] , e [ t ] , "" ) ; break ; case 38 : i . merge ( e [ t - 4 ] , e [ t - 2 ] , "" , e [ t ] ) ; break ; case 39 : i . merge ( e [ t - 4 ] , e [ t ] , e [ t - 2 ] , "" ) ; break ; case 40 : i . merge ( e [ t - 6 ] , e [ t - 4 ] , e [ t - 2 ] , e [ t ] ) ; break ; case 41 : i . merg
2023-05-27 15:05:48 +08:00
` +L.showPosition()+ `
2023-06-20 23:34:33 +08:00
Expecting ` +ee.join(", ")+", got '"+(this.terminals_[I]||I)+"'":me="Parse error on line "+(Z+1)+": Unexpected "+(I==de?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(me,{text:L.match,token:this.terminals_[I]||I,line:L.yylineno,loc:le,expected:ee})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Y+", token: "+I);switch(D[0]){case 1:b.push(I),E.push(L.yytext),e.push(L.yylloc),b.push(D[1]),I=null,ge=L.yyleng,t=L.yytext,Z=L.yylineno,le=L.yylloc;break;case 2:if(z=this.productions_[D[1]][1],U. $ =E[E.length-z],U._ $ ={first_line:e[e.length-(z||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(z||1)].first_column,last_column:e[e.length-1].last_column},qe&&(U._ $ .range=[e[e.length-(z||1)].range[0],e[e.length-1].range[1]]),he=this.performAction.apply(U,[t,ge,Z,q.yy,D[1],E,e].concat(Be)),typeof he!="undefined")return he;z&&(b=b.slice(0,-1*z*2),E=E.slice(0,-1*z),e=e.slice(0,-1*z)),b.push(this.productions_[D[1]][0]),E.push(U. $ ),e.push(U._ $ ),ke=W[b[b.length-2]][b[b.length-1]],b.push(ke);break;case 3:return!0}}return!0}},ze=function(){var B={EOF:1,parseError:function(u,b){if(this.yy.parser)this.yy.parser.parseError(u,b);else throw new Error(u)},setInput:function(l,u){return this.yy=u||this.yy||{},this._input=l,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 l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.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),l},unput:function(l){var u=l.length,b=l.split(/(?: \r \n ?| \n )/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;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),b.length-1&&(this.yylineno-=b.length-1);var E=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:b?(b.length===i.length?this.yylloc.first_column:0)+i[i.length-b.length].length-b[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[E[0],E[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 ) .
2023-05-27 15:05:48 +08:00
` +this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(l){this.unput(this.match.slice(l))},pastInput:function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/ \n /g,"")},upcomingInput:function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/ \n /g,"")},showPosition:function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+ `
` +u+"^"},test_match:function(l,u){var b,i,E;if(this.options.backtrack_lexer&&(E={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&&(E.yylloc.range=this.yylloc.range.slice(0))),i=l[0].match(/(?: \r \n ?| \n ).*/g),i&&(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+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,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(l[0].length),this.matched+=l[0],b=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var e in E)this[e]=E[e];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,b,i;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),e=0;e<E.length;e++)if(b=this._input.match(this.rules[E[e]]),b&&(!u||b[0].length>u[0].length)){if(u=b,i=e,this.options.backtrack_lexer){if(l=this.test_match(b,E[e]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,E[i]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+ ` . Unrecognized text .
2023-06-20 23:34:33 +08:00
` +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,b,i,E){switch(i){case 0:return this.begin("open_directive"),50;case 1:return this.begin("type_directive"),51;case 2:return this.popState(),this.begin("arg_directive"),9;case 3:return this.popState(),this.popState(),53;case 4:return 52;case 5:return this.begin("acc_title"),20;case 6:return this.popState(),"acc_title_value";case 7:return this.begin("acc_descr"),22;case 8:return this.popState(),"acc_descr_value";case 9:this.begin("acc_descr_multiline");break;case 10:this.popState();break;case 11:return"acc_descr_multiline_value";case 12:return 14;case 13:break;case 14:break;case 15:return 6;case 16:return 40;case 17:return 33;case 18:return 38;case 19:return 42;case 20:return 43;case 21:return 44;case 22:return 45;case 23:return 35;case 24:return 29;case 25:return 30;case 26:return 37;case 27:return 32;case 28:return 27;case 29:return 10;case 30:return 10;case 31:return 9;case 32:return"CARET";case 33:this.begin("options");break;case 34:this.popState();break;case 35:return 13;case 36:return 36;case 37:this.begin("string");break;case 38:this.popState();break;case 39:return 34;case 40:return 31;case 41:return 54;case 42:return 8}},rules:[/^(?:%% \{ )/i,/^(?:((?:(?! \} %%)[^:.])*))/i,/^(?::)/i,/^(?: \} %%)/i,/^(?:((?:(?! \} %%).| \n )*))/i,/^(?: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,/^(?:checkout(?= \s | $ ))/i,/^(?:LR \b )/i,/^(?:BT \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:[10,11],inclusive:!1},acc_descr:{rules:[8],inclusive:!1},acc_title:{rules:[6],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},options:{rules:[34,35],inclusive:!1},string:{rules:[38,39],inclusive:!1},INITIAL:{rules:[0,5,7,9,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,36,37,40,41,42,43],inclusive:!0}}};return B}();ce.lexer=ze;function ne(){this.yy={}}return ne.prototype=ce,ce.Parser=ne,new ne}();pe.parser=pe;var We=pe,re=A().gitGraph.mainBranchName,Je=A().gitGraph.mainBranchOrder,R={},S=null,Q={};Q[re]={name:re,order:Je};var T={};T[re]=S;var M=re,Pe="LR",F=0;function be(){return Ae({length:7})}var Qe=function(r,a,o){Se.parseDirective(this,r,a,o)};function Xe(r,a){let o=Object.create(null);return r.reduce((h,c)=>{let n=a(c);return o[n]||(o[n]=!0,h.push(c)),h},[])}var Ze=function(r){Pe=r},Ne={}, $ e=function(r){O.debug("options str",r),r=r&&r.trim(),r=r||"{}";try{Ne=JSON.parse(r)}catch(a){O.error("error while parsing gitGraph options",a.message)}},et=function(){return Ne},tt=function(r,a,o,h){O.debug("Entering commit:",r,a,o,h),a=V.sanitizeText(a,A()),r=V.sanitizeText(r,A()),h=V.sanitizeText(h,A());let c={id:a||F+"-"+be(),message:r,seq:F++,type:o||X.NORMAL,tag:h||"",parent
2023-05-27 15:05:48 +08:00
$ { f - g . width / 2 - 4 / 2 } , $ { P + 2 }
$ { f - g . width / 2 - 4 / 2 } , $ { P - 2 }
$ { f + 10 - g . width / 2 - 4 } , $ { P - k - 2 }
$ { f + 10 + g . width / 2 + 4 } , $ { P - k - 2 }
$ { f + 10 + g . width / 2 + 4 } , $ { P + k + 2 }
2023-06-20 23:34:33 +08:00
$ { f + 10 - g . width / 2 - 4 } , $ { P + k + 2 } ` ),H.attr("cx",f-g.width/2+4/2).attr("cy",P).attr("r",1.5).attr("class","tag-hole")}}f+=50,f>ae&&(ae=f)})},gt=(r,a,o)=>Object.keys(o).filter(n=>o[n].branch===a.branch&&o[n].seq>r.seq&&o[n].seq<a.seq).length>0,fe=(r,a,o=0)=>{let h=r+Math.abs(r-a)/2;if(o>5)return h;if(se.every(f=>Math.abs(f-h)>=10))return se.push(h),h;let n=Math.abs(r-a);return fe(r,a-n/5,o+1)},dt=(r,a,o,h)=>{let c=ie[a.id],n=ie[o.id],f=gt(a,o,h),p="",v="",y=0,m=0,d=G[o.branch].index,_;if(f){p="A 10 10, 0, 0, 0,",v="A 10 10, 0, 0, 1,",y=10,m=10,d=G[o.branch].index;let s=c.y<n.y?fe(c.y,n.y):fe(n.y,c.y);c.y<n.y?_= ` M $ { c . x } $ { c . y } L $ { c . x } $ { s - y } $ { p } $ { c . x + m } $ { s } L $ { n . x - y } $ { s } $ { v } $ { n . x } $ { s + m } L $ { n . x } $ { n . y } ` :_= ` M $ { c . x } $ { c . y } L $ { c . x } $ { s + y } $ { v } $ { c . x + m } $ { s } L $ { n . x - y } $ { s } $ { p } $ { n . x } $ { s - m } L $ { n . x } $ { n . y } ` }else c.y<n.y&&(p="A 20 20, 0, 0, 0,",y=20,m=20,d=G[o.branch].index,_= ` M $ { c . x } $ { c . y } L $ { c . x } $ { n . y - y } $ { p } $ { c . x + m } $ { n . y } L $ { n . x } $ { n . y } ` ),c.y>n.y&&(p="A 20 20, 0, 0, 0,",y=20,m=20,d=G[a.branch].index,_= ` M $ { c . x } $ { c . y } L $ { n . x - y } $ { c . y } $ { p } $ { n . x } $ { c . y - m } L $ { n . x } $ { n . y } ` ),c.y===n.y&&(d=G[a.branch].index,_= ` M $ { c . x } $ { c . y } L $ { c . x } $ { n . y - y } $ { p } $ { c . x + m } $ { n . y } L $ { n . x } $ { n . y } ` );r.append("path").attr("d",_).attr("class","arrow arrow"+d%K)},kt=(r,a)=>{let o=r.append("g").attr("class","commit-arrows");Object.keys(a).forEach(h=>{let c=a[h];c.parents&&c.parents.length>0&&c.parents.forEach(n=>{dt(o,a[n],c,a)})})},_t=(r,a)=>{let o=te().gitGraph,h=r.append("g");a.forEach((c,n)=>{let f=n%K,p=G[c.name].pos,v=h.append("line");v.attr("x1",0),v.attr("y1",p),v.attr("x2",ae),v.attr("y2",p),v.attr("class","branch branch"+f),se.push(p);let y=c.name,m=bt(y),d=h.insert("rect"),s=h.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+f);s.node().appendChild(m);let C=m.getBBox();d.attr("class","branchLabelBkg label"+f).attr("rx",4).attr("ry",4).attr("x",-C.width-4-(o.rotateCommitLabel===!0?30:0)).attr("y",-C.height/2+8).attr("width",C.width+18).attr("height",C.height+4),s.attr("transform","translate("+(-C.width-14-(o.rotateCommitLabel===!0?30:0))+", "+(p-C.height/2-1)+")"),d.attr("transform","translate(-19, "+(p-C.height/2)+")")})},xt=function(r,a,o,h){var y;ft();let c=te(),n=c.gitGraph;O.debug("in gitgraph renderer",r+ `
` ,"id:",a,o),J=h.db.getCommits();let f=h.db.getBranchesAsObjArray(),p=0;f.forEach((m,d)=>{G[m.name]={pos:p,index:d},p+=50+(n.rotateCommitLabel?40:0)});let v=ye( ` [ id = "${a}" ] ` );Ge(v,J,!1),n.showBranches&&_t(v,f),kt(v,J),Ge(v,J,!0),Oe.insertTitle(v,"gitTitleText",n.titleTopMargin,h.db.getDiagramTitle()),Me(void 0,v,n.diagramPadding,(y=n.useMaxWidth)!=null?y:c.useMaxWidth)},yt={draw:xt},Et=r=> `
2023-05-27 15:05:48 +08:00
. 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 ( a => `
. branch - label$ { a } { fill : $ { r [ "gitBranchLabel" + a ] } ; }
. commit$ { a } { stroke : $ { r [ "git" + a ] } ; fill : $ { r [ "git" + a ] } ; }
. commit - highlight$ { a } { stroke : $ { r [ "gitInv" + a ] } ; fill : $ { r [ "gitInv" + a ] } ; }
. label$ { a } { fill : $ { r [ "git" + a ] } ; }
. arrow$ { a } { stroke : $ { r [ "git" + a ] } ; }
` ).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 : 18 px ;
fill : $ { r . textColor } ;
}
2023-06-20 23:34:33 +08:00
` ,vt=Et,At={parser:We,db:pt,renderer:yt,styles:vt};export{At as diagram};