mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-30 09:27:04 +02:00
63 lines
No EOL
37 KiB
JavaScript
63 lines
No EOL
37 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[49711],{49711:(t,e,r)=>{r.d(e,{diagram:()=>B});var i=r(17367),a=r(93126);r(95285),r(31546),r(31234);var c=function(){var t=function(t,e,r,i){for(r=r||{},i=t.length;i--;r[t[i]]=e);return r},e=[1,4],r=[1,7],i=[1,5],a=[1,9],c=[1,6],s=[2,6],n=[1,16],o=[6,8,14,20,22,24,25,27,29,32,37,40,50,55],l=[8,14,20,22,24,25,27,29,32,37,40],h=[8,13,14,20,22,24,25,27,29,32,37,40],m=[1,26],u=[6,8,14,50,55],y=[8,14,55],p=[1,53],g=[1,52],b=[8,14,30,33,35,38,55],d=[1,67],f=[1,68],k=[1,69],$=[8,14,33,35,42,55],_={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(t,e,r,i,a,c,s){var n=c.length-1;switch(a){case 3:return c[n];case 4:return c[n-1];case 5:return i.setDirection(c[n-3]),c[n-1];case 7:i.setOptions(c[n-1]),this.$=c[n];break;case 8:c[n-1]+=c[n],this.$=c[n-1];break;case 10:this.$=[];break;case 11:c[n-1].push(c[n]),this.$=c[n-1];break;case 12:this.$=c[n-1];break;case 17:this.$=c[n].trim(),i.setAccTitle(this.$);break;case 18:case 19:this.$=c[n].trim(),i.setAccDescription(this.$);break;case 20:i.addSection(c[n].substr(8)),this.$=c[n].substr(8);break;case 22:i.checkout(c[n]);break;case 23:i.branch(c[n]);break;case 24:i.branch(c[n-2],c[n]);break;case 25:i.cherryPick(c[n],"",void 0);break;case 26:i.cherryPick(c[n-2],"",c[n]);break;case 27:case 29:i.cherryPick(c[n-2],"","");break;case 28:i.cherryPick(c[n],"",c[n-2]);break;case 30:i.merge(c[n],"","","");break;case 31:i.merge(c[n-2],c[n],"","");break;case 32:i.merge(c[n-2],"",c[n],"");break;case 33:i.merge(c[n-2],"","",c[n]);break;case 34:i.merge(c[n-4],c[n],"",c[n-2]);break;case 35:i.merge(c[n-4],"",c[n],c[n-2]);break;case 36:i.merge(c[n-4],"",c[n-2],c[n]);break;case 37:i.merge(c[n-4],c[n-2],c[n],"");break;case 38:i.merge(c[n-4],c[n-2],"",c[n]);break;case 39:i.merge(c[n-4],c[n],c[n-2],"");break;case 40:i.merge(c[n-6],c[n-4],c[n-2],c[n]);break;case 41:i.merge(c[n-6],c[n],c[n-4],c[n-2]);break;case 42:i.merge(c[n-6],c[n-4],c[n],c[n-2]);break;case 43:i.merge(c[n-6],c[n-2],c[n-4],c[n]);break;case 44:i.merge(c[n-6],c[n],c[n-2],c[n-4]);break;case 45:i.merge(c[n-6],c[n-2],c[n],c[n-4]);break;case 46:i.commit(c[n]);break;case 47:i.commit("","",i.commitType.NORMAL,c[n]);break;case 48:i.commit("","",c[n],"");break;case 49:i.commit("","",c[n],c[n-2]);break;case 50:i.commit("","",c[n-2],c[n]);break;case 51:i.commit("",c[n],i.commitType.NORMAL,"");break;case 52:i.commit("",c[n-2],i.commitType.NORMAL,c[n]);break;case 53:i.commit("",c[n],i.commitType.NORMAL,c[n-2]);break;case 54:i.commit("",c[n-2],c[n],"");break;case 55:i.commit("",c[n],c[n-2],"");break;case 56:i.commit("",c[n-4],c[n-2],c[n]);break;case 57:i.commit("",c[n-4],c[n],c[n-2]);break;case 58:i.commit("",c[n-2],c[n-4],c[n]);break;case 59:i.commit("",c[n],c[n-4],c[n-2]);break;case 60:i.commit("",c[n],c[n-2],c[n-4]);break;case 61:i.commit("",c[n-2],c[n],c[n-4]);break;case 62:i.commit(c[n],"",i.commitType.NORMAL,"");break;case 63:i.commit(c[n],"",i.commitType.NORMAL,c[n-2]);break;case 64:i.commit(c[n-2],"",i.commitType.NORMAL,c[n]);break;case 65:i.commit(c[n-2],"",c[n],"");break;case 66:i.commit(c[n],"",c[n-2],"");break;case 67:i.commit(c[n],c[n-2],i.commitType.NORMAL,"");break;case 68:i.commit(c[n-2],c[n],i.commitType.NORMAL,"");break;case 69:i.commit(c[n-4],"",c[n-2],c[n]);break;case 70:i.commit(c[n-4],"",c[n],c[n-2]);break;case 71:i.commit(c[n-2],"",c[n-4],c[n]);break;case 72:i.commit(c[n],"",c[n-4],c[n-2]);break;case 73:i.commit(c[n],"",c[n-2],c[n-4]);break;case 74:i.commit(c[n-2],"",c[n],c[n-4]);break;case 75:i.commit(c[n-4],c[n],c[n-2],"");break;case 76:i.commit(c[n-4],c[n-2],c[n],"");break;case 77:i.commit(c[n-2],c[n],c[n-4],"");break;case 78:i.commit(c[n],c[n-2],c[n-4],"");break;case 79:i.commit(c[n],c[n-4],c[n-2],"");break;case 80:i.commit(c[n-2],c[n-4],c[n],"");break;case 81:i.commit(c[n-4],c[n],i.commitType.NORMAL,c[n-2]);break;case 82:i.commit(c[n-4],c[n-2],i.commitType.NORMAL,c[n]);break;case 83:i.commit(c[n-2],c[n],i.commitType.NORMAL,c[n-4]);break;case 84:i.commit(c[n],c[n-2],i.commitType.NORMAL,c[n-4]);break;case 85:i.commit(c[n],c[n-4],i.commitType.NORMAL,c[n-2]);break;case 86:i.commit(c[n-2],c[n-4],i.commitType.NORMAL,c[n]);break;case 87:i.commit(c[n-6],c[n-4],c[n-2],c[n]);break;case 88:i.commit(c[n-6],c[n-4],c[n],c[n-2]);break;case 89:i.commit(c[n-6],c[n-2],c[n-4],c[n]);break;case 90:i.commit(c[n-6],c[n],c[n-4],c[n-2]);break;case 91:i.commit(c[n-6],c[n-2],c[n],c[n-4]);break;case 92:i.commit(c[n-6],c[n],c[n-2],c[n-4]);break;case 93:i.commit(c[n-4],c[n-6],c[n-2],c[n]);break;case 94:i.commit(c[n-4],c[n-6],c[n],c[n-2]);break;case 95:i.commit(c[n-2],c[n-6],c[n-4],c[n]);break;case 96:i.commit(c[n],c[n-6],c[n-4],c[n-2]);break;case 97:i.commit(c[n-2],c[n-6],c[n],c[n-4]);break;case 98:i.commit(c[n],c[n-6],c[n-2],c[n-4]);break;case 99:i.commit(c[n],c[n-4],c[n-2],c[n-6]);break;case 100:i.commit(c[n-2],c[n-4],c[n],c[n-6]);break;case 101:i.commit(c[n],c[n-2],c[n-4],c[n-6]);break;case 102:i.commit(c[n-2],c[n],c[n-4],c[n-6]);break;case 103:i.commit(c[n-4],c[n-2],c[n],c[n-6]);break;case 104:i.commit(c[n-4],c[n],c[n-2],c[n-6]);break;case 105:i.commit(c[n-2],c[n-4],c[n-6],c[n]);break;case 106:i.commit(c[n],c[n-4],c[n-6],c[n-2]);break;case 107:i.commit(c[n-2],c[n],c[n-6],c[n-4]);break;case 108:i.commit(c[n],c[n-2],c[n-6],c[n-4]);break;case 109:i.commit(c[n-4],c[n-2],c[n-6],c[n]);break;case 110:i.commit(c[n-4],c[n],c[n-6],c[n-2]);break;case 111:this.$="";break;case 112:this.$=c[n];break;case 113:this.$=i.commitType.NORMAL;break;case 114:this.$=i.commitType.REVERSE;break;case 115:this.$=i.commitType.HIGHLIGHT;break;case 118:i.parseDirective("%%{","open_directive");break;case 119:i.parseDirective(c[n],"type_directive");break;case 120:c[n]=c[n].trim().replace(/'/g,'"'),i.parseDirective(c[n],"arg_directive");break;case 121:i.parseDirective("}%%","close_directive","gitGraph")}},table:[{3:1,4:2,5:3,6:e,8:r,14:i,46:8,50:a,55:c},{1:[3]},{3:10,4:2,5:3,6:e,8:r,14:i,46:8,50:a,55:c},{3:11,4:2,5:3,6:e,8:r,14:i,46:8,50:a,55:c},{7:12,8:s,9:[1,13],10:[1,14],11:15,14:n},t(o,[2,124]),t(o,[2,125]),t(o,[2,126]),{47:17,51:[1,18]},{51:[2,118]},{1:[2,1]},{1:[2,2]},{8:[1,19]},{7:20,8:s,11:15,14:n},{9:[1,21]},t(l,[2,10],{12:22,13:[1,23]}),t(h,[2,9]),{9:[1,25],48:24,53:m},t([9,53],[2,119]),{1:[2,3]},{8:[1,27]},{7:28,8:s,11:15,14:n},{8:[2,7],14:[1,31],15:29,16:30,17:32,18:33,19:34,20:[1,35],22:[1,36],24:[1,37],25:[1,38],26:39,27:[1,40],29:[1,44],32:[1,43],37:[1,42],40:[1,41]},t(h,[2,8]),t(u,[2,116]),{49:45,52:[1,46]},t(u,[2,121]),{1:[2,4]},{8:[1,47]},t(l,[2,11]),{4:48,8:r,14:i,55:c},t(l,[2,13]),t(y,[2,14]),t(y,[2,15]),t(y,[2,16]),{21:[1,49]},{23:[1,50]},t(y,[2,19]),t(y,[2,20]),t(y,[2,21]),{28:51,34:p,54:g},t(y,[2,111],{41:54,33:[1,57],34:[1,59],35:[1,55],38:[1,56],42:[1,58]}),{28:60,34:p,54:g},{33:[1,61],35:[1,62]},{28:63,34:p,54:g},{48:64,53:m},{53:[2,120]},{1:[2,5]},t(l,[2,12]),t(y,[2,17]),t(y,[2,18]),t(y,[2,22]),t(b,[2,122]),t(b,[2,123]),t(y,[2,46]),{34:[1,65]},{39:66,43:d,44:f,45:k},{34:[1,70]},{34:[1,71]},t(y,[2,112]),t(y,[2,30],{33:[1,72],35:[1,74],38:[1,73]}),{34:[1,75]},{34:[1,76],36:[1,77]},t(y,[2,23],{30:[1,78]}),t(u,[2,117]),t(y,[2,47],{33:[1,80],38:[1,79],42:[1,81]}),t(y,[2,48],{33:[1,83],35:[1,82],42:[1,84]}),t($,[2,113]),t($,[2,114]),t($,[2,115]),t(y,[2,51],{35:[1,85],38:[1,86],42:[1,87]}),t(y,[2,62],{33:[1,90],35:[1,88],38:[1,89]}),{34:[1,91]},{39:92,43:d,44:f,45:k},{34:[1,93]},t(y,[2,25],{35:[1,94]}),{33:[1,95]},{33:[1,96]},{31:[1,97]},{39:98,43:d,44:f,45:k},{34:[1,99]},{34:[1,100]},{34:[1,101]},{34:[1,102]},{34:[1,103]},{34:[1,104]},{39:105,43:d,44:f,45:k},{34:[1,106]},{34:[1,107]},{39:108,43:d,44:f,45:k},{34:[1,109]},t(y,[2,31],{35:[1,111],38:[1,110]}),t(y,[2,32],{33:[1,113],35:[1,112]}),t(y,[2,33],{33:[1,114],38:[1,115]}),{34:[1,116],36:[1,117]},{34:[1,118]},{34:[1,119]},t(y,[2,24]),t(y,[2,49],{33:[1,120],42:[1,121]}),t(y,[2,53],{38:[1,122],42:[1,123]}),t(y,[2,63],{33:[1,125],38:[1,124]}),t(y,[2,50],{33:[1,126],42:[1,127]}),t(y,[2,55],{35:[1,128],42:[1,129]}),t(y,[2,66],{33:[1,131],35:[1,130]}),t(y,[2,52],{38:[1,132],42:[1,133]}),t(y,[2,54],{35:[1,134],42:[1,135]}),t(y,[2,67],{35:[1,137],38:[1,136]}),t(y,[2,64],{33:[1,139],38:[1,138]}),t(y,[2,65],{33:[1,141],35:[1,140]}),t(y,[2,68],{35:[1,143],38:[1,142]}),{39:144,43:d,44:f,45:k},{34:[1,145]},{34:[1,146]},{34:[1,147]},{34:[1,148]},{39:149,43:d,44:f,45:k},t(y,[2,26]),t(y,[2,27]),t(y,[2,28]),t(y,[2,29]),{34:[1,150]},{34:[1,151]},{39:152,43:d,44:f,45:k},{34:[1,153]},{39:154,43:d,44:f,45:k},{34:[1,155]},{34:[1,156]},{34:[1,157]},{34:[1,158]},{34:[1,159]},{34:[1,160]},{34:[1,161]},{39:162,43:d,44:f,45:k},{34:[1,163]},{34:[1,164]},{34:[1,165]},{39:166,43:d,44:f,45:k},{34:[1,167]},{39:168,43:d,44:f,45:k},{34:[1,169]},{34:[1,170]},{34:[1,171]},{39:172,43:d,44:f,45:k},{34:[1,173]},t(y,[2,37],{35:[1,174]}),t(y,[2,38],{38:[1,175]}),t(y,[2,36],{33:[1,176]}),t(y,[2,39],{35:[1,177]}),t(y,[2,34],{38:[1,178]}),t(y,[2,35],{33:[1,179]}),t(y,[2,60],{42:[1,180]}),t(y,[2,73],{33:[1,181]}),t(y,[2,61],{42:[1,182]}),t(y,[2,84],{38:[1,183]}),t(y,[2,74],{33:[1,184]}),t(y,[2,83],{38:[1,185]}),t(y,[2,59],{42:[1,186]}),t(y,[2,72],{33:[1,187]}),t(y,[2,58],{42:[1,188]}),t(y,[2,78],{35:[1,189]}),t(y,[2,71],{33:[1,190]}),t(y,[2,77],{35:[1,191]}),t(y,[2,57],{42:[1,192]}),t(y,[2,85],{38:[1,193]}),t(y,[2,56],{42:[1,194]}),t(y,[2,79],{35:[1,195]}),t(y,[2,80],{35:[1,196]}),t(y,[2,86],{38:[1,197]}),t(y,[2,70],{33:[1,198]}),t(y,[2,81],{38:[1,199]}),t(y,[2,69],{33:[1,200]}),t(y,[2,75],{35:[1,201]}),t(y,[2,76],{35:[1,202]}),t(y,[2,82],{38:[1,203]}),{34:[1,204]},{39:205,43:d,44:f,45:k},{34:[1,206]},{34:[1,207]},{39:208,43:d,44:f,45:k},{34:[1,209]},{34:[1,210]},{34:[1,211]},{34:[1,212]},{39:213,43:d,44:f,45:k},{34:[1,214]},{39:215,43:d,44:f,45:k},{34:[1,216]},{34:[1,217]},{34:[1,218]},{34:[1,219]},{34:[1,220]},{34:[1,221]},{34:[1,222]},{39:223,43:d,44:f,45:k},{34:[1,224]},{34:[1,225]},{34:[1,226]},{39:227,43:d,44:f,45:k},{34:[1,228]},{39:229,43:d,44:f,45:k},{34:[1,230]},{34:[1,231]},{34:[1,232]},{39:233,43:d,44:f,45:k},t(y,[2,40]),t(y,[2,42]),t(y,[2,41]),t(y,[2,43]),t(y,[2,45]),t(y,[2,44]),t(y,[2,101]),t(y,[2,102]),t(y,[2,99]),t(y,[2,100]),t(y,[2,104]),t(y,[2,103]),t(y,[2,108]),t(y,[2,107]),t(y,[2,106]),t(y,[2,105]),t(y,[2,110]),t(y,[2,109]),t(y,[2,98]),t(y,[2,97]),t(y,[2,96]),t(y,[2,95]),t(y,[2,93]),t(y,[2,94]),t(y,[2,92]),t(y,[2,91]),t(y,[2,90]),t(y,[2,89]),t(y,[2,87]),t(y,[2,88])],defaultActions:{9:[2,118],10:[2,1],11:[2,2],19:[2,3],27:[2,4],46:[2,120],47:[2,5]},parseError:function(t,e){if(e.recoverable)this.trace(t);else{var r=Error(t);throw r.hash=e,r}},parse:function(t){var e=this,r=[0],i=[],a=[null],c=[],s=this.table,n="",o=0,l=0,h=c.slice.call(arguments,1),m=Object.create(this.lexer),u={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(u.yy[y]=this.yy[y]);m.setInput(t,u.yy),u.yy.lexer=m,u.yy.parser=this,void 0===m.yylloc&&(m.yylloc={});var p=m.yylloc;c.push(p);var g=m.options&&m.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var b,d,f,k,$,_,x,E,v={};;){if(d=r[r.length-1],this.defaultActions[d]?f=this.defaultActions[d]:(null==b&&(b=function(){var t;return"number"!=typeof(t=i.pop()||m.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}()),f=s[d]&&s[d][b]),void 0===f||!f.length||!f[0]){var T="";for($ in E=[],s[d])this.terminals_[$]&&$>2&&E.push("'"+this.terminals_[$]+"'");T=m.showPosition?"Parse error on line "+(o+1)+":\n"+m.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(T,{text:m.match,token:this.terminals_[b]||b,line:m.yylineno,loc:p,expected:E})}if(f[0]instanceof Array&&f.length>1)throw Error("Parse Error: multiple actions possible at state: "+d+", token: "+b);switch(f[0]){case 1:r.push(b),a.push(m.yytext),c.push(m.yylloc),r.push(f[1]),b=null,l=m.yyleng,n=m.yytext,o=m.yylineno,p=m.yylloc;break;case 2:if(_=this.productions_[f[1]][1],v.$=a[a.length-_],v._$={first_line:c[c.length-(_||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(_||1)].first_column,last_column:c[c.length-1].last_column},g&&(v._$.range=[c[c.length-(_||1)].range[0],c[c.length-1].range[1]]),void 0!==(k=this.performAction.apply(v,[n,l,o,u.yy,f[1],a,c].concat(h))))return k;_&&(r=r.slice(0,-1*_*2),a=a.slice(0,-1*_),c=c.slice(0,-1*_)),r.push(this.productions_[f[1]][0]),a.push(v.$),c.push(v._$),x=s[r[r.length-2]][r[r.length-1]],r.push(x);break;case 3:return!0}}return!0}};function x(){this.yy={}}return _.lexer={EOF:1,parseError:function(t,e){if(this.yy.parser)this.yy.parser.parseError(t,e);else throw Error(t)},setInput: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},input: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},unput:function(t){var e=t.length,r=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),r.length-1&&(this.yylineno-=r.length-1);var a=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===i.length?this.yylloc.first_column:0)+i[i.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject: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})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var t=this.pastInput(),e=Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,i,a;if(this.options.backtrack_lexer&&(a={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&&(a.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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack)for(var c in a)this[c]=a[c];return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,r,i,a=this._currentRules(),c=0;c<a.length;c++)if((r=this._input.match(this.rules[a[c]]))&&(!e||r[0].length>e[0].length)){if(e=r,i=c,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,a[c])))return t;if(!this._backtrack)return!1;e=!1;continue}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[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})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>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(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,r,i){switch(r){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:case 34:case 38:this.popState();break;case 11:return"acc_descr_multiline_value";case 12:return 14;case 13: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:case 30:return 10;case 31:return 9;case 32:return"CARET";case 33:this.begin("options");break;case 35:return 13;case 36:return 36;case 37:this.begin("string");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,/^(?: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:[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}}},x.prototype=_,_.Parser=x,new x}();c.parser=c;let s=(0,i.c)().gitGraph.mainBranchName,n=(0,i.c)().gitGraph.mainBranchOrder,o={},l=null,h={};h[s]={name:s,order:n};let m={};m[s]=l;let u=s,y="LR",p=0;function g(){return(0,i.y)({length:7})}let b={},d=function(t){if(void 0===m[t=i.e.sanitizeText(t,(0,i.c)())]){let e=Error('Trying to checkout branch which is not yet created. (Help try using "branch '+t+'")');throw e.hash={text:"checkout "+t,token:"checkout "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"branch '+t+'"']},e}l=o[m[u=t]]};function f(t,e,r){let i=t.indexOf(e);-1===i?t.push(r):t.splice(i,1,r)}let k=function(){let t=Object.keys(o).map(function(t){return o[t]});return t.forEach(function(t){i.l.debug(t.id)}),t.sort((t,e)=>t.seq-e.seq),t},$={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},_={parseDirective:function(t,e,r){i.m.parseDirective(this,t,e,r)},getConfig:()=>(0,i.c)().gitGraph,setDirection:function(t){y=t},setOptions:function(t){i.l.debug("options str",t),t=(t=t&&t.trim())||"{}";try{b=JSON.parse(t)}catch(t){i.l.error("error while parsing gitGraph options",t.message)}},getOptions:function(){return b},commit:function(t,e,r,a){i.l.debug("Entering commit:",t,e,r,a),e=i.e.sanitizeText(e,(0,i.c)()),t=i.e.sanitizeText(t,(0,i.c)()),a=i.e.sanitizeText(a,(0,i.c)());let c={id:e||p+"-"+g(),message:t,seq:p++,type:r||$.NORMAL,tag:a||"",parents:null==l?[]:[l.id],branch:u};l=c,o[c.id]=c,m[u]=c.id,i.l.debug("in pushCommit "+c.id)},branch:function(t,e){if(void 0===m[t=i.e.sanitizeText(t,(0,i.c)())])m[t]=null!=l?l.id:null,h[t]={name:t,order:e?parseInt(e,10):null},d(t),i.l.debug("in createBranch");else{let e=Error('Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout '+t+'")');throw e.hash={text:"branch "+t,token:"branch "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"checkout '+t+'"']},e}},merge:function(t,e,r,a){t=i.e.sanitizeText(t,(0,i.c)()),e=i.e.sanitizeText(e,(0,i.c)());let c=o[m[u]],s=o[m[t]];if(u===t){let e=Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch abc"]},e}if(void 0!==c&&c){if(void 0===m[t]){let e=Error('Incorrect usage of "merge". Branch to be merged ('+t+") does not exist");throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch "+t]},e}if(void 0!==s&&s){if(c===s){let e=Error('Incorrect usage of "merge". Both branches have same head');throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch abc"]},e}if(e&&void 0!==o[e]){let i=Error('Incorrect usage of "merge". Commit with id:'+e+" already exists, use different custom Id");throw i.hash={text:"merge "+t+e+r+a,token:"merge "+t+e+r+a,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["merge "+t+" "+e+"_UNIQUE "+r+" "+a]},i}}else{let e=Error('Incorrect usage of "merge". Branch to be merged ('+t+") has no commits");throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"commit"']},e}}else{let e=Error('Incorrect usage of "merge". Current branch ('+u+")has no commits");throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["commit"]},e}let n={id:e||p+"-"+g(),message:"merged branch "+t+" into "+u,seq:p++,parents:[null==l?null:l.id,m[t]],branch:u,type:$.MERGE,customType:r,customId:!!e,tag:a||""};l=n,o[n.id]=n,m[u]=n.id,i.l.debug(m),i.l.debug("in mergeBranch")},cherryPick:function(t,e,r){if(i.l.debug("Entering cherryPick:",t,e,r),t=i.e.sanitizeText(t,(0,i.c)()),e=i.e.sanitizeText(e,(0,i.c)()),r=i.e.sanitizeText(r,(0,i.c)()),!t||void 0===o[t]){let r=Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw r.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},r}let a=o[t],c=a.branch;if(a.type===$.MERGE){let r=Error('Incorrect usage of "cherryPick". Source commit should not be a merge commit');throw r.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},r}if(!e||void 0===o[e]){if(c===u){let r=Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw r.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},r}let s=o[m[u]];if(void 0===s||!s){let r=Error('Incorrect usage of "cherry-pick". Current branch ('+u+")has no commits");throw r.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},r}let n={id:p+"-"+g(),message:"cherry-picked "+a+" into "+u,seq:p++,parents:[null==l?null:l.id,a.id],branch:u,type:$.CHERRY_PICK,tag:r??"cherry-pick:"+a.id};l=n,o[n.id]=n,m[u]=n.id,i.l.debug(m),i.l.debug("in cherryPick")}},checkout:d,prettyPrint:function(){i.l.debug(o),function t(e){let r=e.reduce((t,e)=>t.seq>e.seq?t:e,e[0]),a="";e.forEach(function(t){t===r?a+=" *":a+=" |"});let c=[a,r.id,r.seq];for(let t in m)m[t]===r.id&&c.push(t);if(i.l.debug(c.join(" ")),r.parents&&2==r.parents.length){let t=o[r.parents[0]];f(e,r,t),e.push(o[r.parents[1]])}else{if(0==r.parents.length)return;let t=o[r.parents];f(e,r,t)}t(e=function(t,e){let r=Object.create(null);return t.reduce((t,i)=>{let a=e(i);return r[a]||(r[a]=!0,t.push(i)),t},[])}(e,t=>t.id))}([k()[0]])},clear:function(){o={},l=null;let t=(0,i.c)().gitGraph.mainBranchName,e=(0,i.c)().gitGraph.mainBranchOrder;(m={})[t]=null,(h={})[t]={name:t,order:e},u=t,p=0,(0,i.v)()},getBranchesAsObjArray:function(){return Object.values(h).map((t,e)=>null!==t.order?t:{...t,order:parseFloat(`0.${e}`,10)}).sort((t,e)=>t.order-e.order).map(({name:t})=>({name:t}))},getBranches:function(){return m},getCommits:function(){return o},getCommitsArray:k,getCurrentBranch:function(){return u},getDirection:function(){return y},getHead:function(){return l},setAccTitle:i.s,getAccTitle:i.g,getAccDescription:i.a,setAccDescription:i.b,setDiagramTitle:i.r,getDiagramTitle:i.t,commitType:$},x={},E={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},v={},T={},w=[],L=0,R="LR",M=()=>{v={},T={},x={},L=0,w=[],R="LR"},I=t=>{let e=document.createElementNS("http://www.w3.org/2000/svg","text");for(let r of"string"==typeof t?t.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(t)?t:[]){let t=document.createElementNS("http://www.w3.org/2000/svg","tspan");t.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),t.setAttribute("dy","1em"),t.setAttribute("x","0"),t.setAttribute("class","row"),t.textContent=r.trim(),e.appendChild(t)}return e},A=(t,e,r)=>{let a=(0,i.z)().gitGraph,c=t.append("g").attr("class","commit-bullets"),s=t.append("g").attr("class","commit-labels"),n=0;"TB"===R&&(n=30),Object.keys(e).sort((t,r)=>e[t].seq-e[r].seq).forEach(t=>{let i=e[t],o="TB"===R?n+10:v[i.branch].pos,l="TB"===R?v[i.branch].pos:n+10;if(r){let t;let e=void 0!==i.customType&&""!==i.customType?i.customType:i.type;switch(e){case E.NORMAL:t="commit-normal";break;case E.REVERSE:t="commit-reverse";break;case E.HIGHLIGHT:t="commit-highlight";break;case E.MERGE:t="commit-merge";break;case E.CHERRY_PICK:t="commit-cherry-pick";break;default:t="commit-normal"}if(e===E.HIGHLIGHT){let e=c.append("rect");e.attr("x",l-10),e.attr("y",o-10),e.attr("height",20),e.attr("width",20),e.attr("class",`commit ${i.id} commit-highlight${v[i.branch].index%8} ${t}-outer`),c.append("rect").attr("x",l-6).attr("y",o-6).attr("height",12).attr("width",12).attr("class",`commit ${i.id} commit${v[i.branch].index%8} ${t}-inner`)}else if(e===E.CHERRY_PICK)c.append("circle").attr("cx",l).attr("cy",o).attr("r",10).attr("class",`commit ${i.id} ${t}`),c.append("circle").attr("cx",l-3).attr("cy",o+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${i.id} ${t}`),c.append("circle").attr("cx",l+3).attr("cy",o+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${i.id} ${t}`),c.append("line").attr("x1",l+3).attr("y1",o+1).attr("x2",l).attr("y2",o-5).attr("stroke","#fff").attr("class",`commit ${i.id} ${t}`),c.append("line").attr("x1",l-3).attr("y1",o+1).attr("x2",l).attr("y2",o-5).attr("stroke","#fff").attr("class",`commit ${i.id} ${t}`);else{let r=c.append("circle");if(r.attr("cx",l),r.attr("cy",o),r.attr("r",i.type===E.MERGE?9:10),r.attr("class",`commit ${i.id} commit${v[i.branch].index%8}`),e===E.MERGE){let e=c.append("circle");e.attr("cx",l),e.attr("cy",o),e.attr("r",6),e.attr("class",`commit ${t} ${i.id} commit${v[i.branch].index%8}`)}e===E.REVERSE&&c.append("path").attr("d",`M ${l-5},${o-5}L${l+5},${o+5}M${l-5},${o+5}L${l+5},${o-5}`).attr("class",`commit ${t} ${i.id} commit${v[i.branch].index%8}`)}}if("TB"===R?T[i.id]={x:l,y:n+10}:T[i.id]={x:n+10,y:o},r){if(i.type!==E.CHERRY_PICK&&(i.customId&&i.type===E.MERGE||i.type!==E.MERGE)&&a.showCommitLabel){let t=s.append("g"),e=t.insert("rect").attr("class","commit-label-bkg"),r=t.append("text").attr("x",n).attr("y",o+25).attr("class","commit-label").text(i.id),c=r.node().getBBox();if(e.attr("x",n+10-c.width/2-2).attr("y",o+13.5).attr("width",c.width+4).attr("height",c.height+4),"TB"===R&&(e.attr("x",l-(c.width+16+5)).attr("y",o-12),r.attr("x",l-(c.width+16)).attr("y",o+c.height-12)),"TB"!==R&&r.attr("x",n+10-c.width/2),a.rotateCommitLabel){if("TB"===R)r.attr("transform","rotate(-45, "+l+", "+o+")"),e.attr("transform","rotate(-45, "+l+", "+o+")");else{let e=-7.5-(c.width+10)/25*9.5,r=10+c.width/25*8.5;t.attr("transform","translate("+e+", "+r+") rotate(-45, "+n+", "+o+")")}}}if(i.tag){let t=s.insert("polygon"),e=s.append("circle"),r=s.append("text").attr("y",o-16).attr("class","tag-label").text(i.tag),a=r.node().getBBox();r.attr("x",n+10-a.width/2);let c=a.height/2,h=o-19.2;t.attr("class","tag-label-bkg").attr("points",`
|
|
${n-a.width/2-2},${h+2}
|
|
${n-a.width/2-2},${h-2}
|
|
${n+10-a.width/2-4},${h-c-2}
|
|
${n+10+a.width/2+4},${h-c-2}
|
|
${n+10+a.width/2+4},${h+c+2}
|
|
${n+10-a.width/2-4},${h+c+2}`),e.attr("cx",n-a.width/2+2).attr("cy",h).attr("r",1.5).attr("class","tag-hole"),"TB"===R&&(t.attr("class","tag-label-bkg").attr("points",`
|
|
${l},${n+2}
|
|
${l},${n-2}
|
|
${l+10},${n-c-2}
|
|
${l+10+a.width+4},${n-c-2}
|
|
${l+10+a.width+4},${n+c+2}
|
|
${l+10},${n+c+2}`).attr("transform","translate(12,12) rotate(45, "+l+","+n+")"),e.attr("cx",l+2).attr("cy",n).attr("transform","translate(12,12) rotate(45, "+l+","+n+")"),r.attr("x",l+5).attr("y",n+3).attr("transform","translate(14,14) rotate(45, "+l+","+n+")"))}}(n+=50)>L&&(L=n)})},C=(t,e,r)=>Object.keys(r).filter(i=>r[i].branch===e.branch&&r[i].seq>t.seq&&r[i].seq<e.seq).length>0,O=(t,e,r=0)=>{let i=t+Math.abs(t-e)/2;if(r>5)return i;if(w.every(t=>Math.abs(t-i)>=10))return w.push(i),i;let a=Math.abs(t-e);return O(t,e-a/5,r+1)},S=(t,e,r,i)=>{let a;let c=T[e.id],s=T[r.id],n=C(e,r,i),o="",l="",h=0,m=0,u=v[r.branch].index;if(n){o="A 10 10, 0, 0, 0,",l="A 10 10, 0, 0, 1,",h=10,m=10,u=v[r.branch].index;let t=c.y<s.y?O(c.y,s.y):O(s.y,c.y),e=c.x<s.x?O(c.x,s.x):O(s.x,c.x);a="TB"===R?c.x<s.x?`M ${c.x} ${c.y} L ${e-h} ${c.y} ${l} ${e} ${c.y+m} L ${e} ${s.y-h} ${o} ${e+m} ${s.y} L ${s.x} ${s.y}`:`M ${c.x} ${c.y} L ${e+h} ${c.y} ${o} ${e} ${c.y+m} L ${e} ${s.y-h} ${l} ${e-m} ${s.y} L ${s.x} ${s.y}`:c.y<s.y?`M ${c.x} ${c.y} L ${c.x} ${t-h} ${o} ${c.x+m} ${t} L ${s.x-h} ${t} ${l} ${s.x} ${t+m} L ${s.x} ${s.y}`:`M ${c.x} ${c.y} L ${c.x} ${t+h} ${l} ${c.x+m} ${t} L ${s.x-h} ${t} ${o} ${s.x} ${t-m} L ${s.x} ${s.y}`}else"TB"===R?(c.x<s.x&&(o="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",h=20,m=20,u=v[r.branch].index,a=`M ${c.x} ${c.y} L ${s.x-h} ${c.y} ${l} ${s.x} ${c.y+m} L ${s.x} ${s.y}`),c.x>s.x&&(o="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",h=20,m=20,u=v[e.branch].index,a=`M ${c.x} ${c.y} L ${c.x} ${s.y-h} ${l} ${c.x-m} ${s.y} L ${s.x} ${s.y}`),c.x===s.x&&(u=v[e.branch].index,a=`M ${c.x} ${c.y} L ${c.x+h} ${c.y} ${o} ${c.x+m} ${s.y+h} L ${s.x} ${s.y}`)):(c.y<s.y&&(o="A 20 20, 0, 0, 0,",h=20,m=20,u=v[r.branch].index,a=`M ${c.x} ${c.y} L ${c.x} ${s.y-h} ${o} ${c.x+m} ${s.y} L ${s.x} ${s.y}`),c.y>s.y&&(o="A 20 20, 0, 0, 0,",h=20,m=20,u=v[e.branch].index,a=`M ${c.x} ${c.y} L ${s.x-h} ${c.y} ${o} ${s.x} ${c.y-m} L ${s.x} ${s.y}`),c.y===s.y&&(u=v[e.branch].index,a=`M ${c.x} ${c.y} L ${c.x} ${s.y-h} ${o} ${c.x+m} ${s.y} L ${s.x} ${s.y}`));t.append("path").attr("d",a).attr("class","arrow arrow"+u%8)},G=(t,e)=>{let r=t.append("g").attr("class","commit-arrows");Object.keys(e).forEach(t=>{let i=e[t];i.parents&&i.parents.length>0&&i.parents.forEach(t=>{S(r,e[t],i,e)})})},P=(t,e)=>{let r=(0,i.z)().gitGraph,a=t.append("g");e.forEach((t,e)=>{let i=e%8,c=v[t.name].pos,s=a.append("line");s.attr("x1",0),s.attr("y1",c),s.attr("x2",L),s.attr("y2",c),s.attr("class","branch branch"+i),"TB"===R&&(s.attr("y1",30),s.attr("x1",c),s.attr("y2",L),s.attr("x2",c)),w.push(c);let n=I(t.name),o=a.insert("rect"),l=a.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+i);l.node().appendChild(n);let h=n.getBBox();o.attr("class","branchLabelBkg label"+i).attr("rx",4).attr("ry",4).attr("x",-h.width-4-(!0===r.rotateCommitLabel?30:0)).attr("y",-h.height/2+8).attr("width",h.width+18).attr("height",h.height+4),l.attr("transform","translate("+(-h.width-14-(!0===r.rotateCommitLabel?30:0))+", "+(c-h.height/2-1)+")"),"TB"===R&&(o.attr("x",c-h.width/2-10).attr("y",0),l.attr("transform","translate("+(c-h.width/2-5)+", 0)")),"TB"!==R&&o.attr("transform","translate(-19, "+(c-h.height/2)+")")})},B={parser:c,db:_,renderer:{draw:function(t,e,r,c){M();let s=(0,i.z)(),n=s.gitGraph;i.l.debug("in gitgraph renderer",t+"\n","id:",e,r),x=c.db.getCommits();let o=c.db.getBranchesAsObjArray();R=c.db.getDirection();let l=(0,a.Ltv)(`[id="${e}"]`),h=0;o.forEach((t,e)=>{let r=I(t.name),i=l.append("g"),a=i.insert("g").attr("class","branchLabel"),c=a.insert("g").attr("class","label branch-label");c.node().appendChild(r);let s=r.getBBox();v[t.name]={pos:h,index:e},h+=50+(n.rotateCommitLabel?40:0)+("TB"===R?s.width/2:0),c.remove(),a.remove(),i.remove()}),A(l,x,!1),n.showBranches&&P(l,o),G(l,x),A(l,x,!0),i.u.insertTitle(l,"gitTitleText",n.titleTopMargin,c.db.getDiagramTitle()),(0,i.A)(void 0,l,n.diagramPadding,n.useMaxWidth??s.useMaxWidth)}},styles:t=>`
|
|
.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(e=>`
|
|
.branch-label${e} { fill: ${t["gitBranchLabel"+e]}; }
|
|
.commit${e} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }
|
|
.commit-highlight${e} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }
|
|
.label${e} { fill: ${t["git"+e]}; }
|
|
.arrow${e} { stroke: ${t["git"+e]}; }
|
|
`).join("\n")}
|
|
|
|
.branch {
|
|
stroke-width: 1;
|
|
stroke: ${t.lineColor};
|
|
stroke-dasharray: 2;
|
|
}
|
|
.commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}
|
|
.commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }
|
|
.tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
|
|
.tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }
|
|
.tag-hole { fill: ${t.textColor}; }
|
|
|
|
.commit-merge {
|
|
stroke: ${t.primaryColor};
|
|
fill: ${t.primaryColor};
|
|
}
|
|
.commit-reverse {
|
|
stroke: ${t.primaryColor};
|
|
fill: ${t.primaryColor};
|
|
stroke-width: 3;
|
|
}
|
|
.commit-highlight-outer {
|
|
}
|
|
.commit-highlight-inner {
|
|
stroke: ${t.primaryColor};
|
|
fill: ${t.primaryColor};
|
|
}
|
|
|
|
.arrow { stroke-width: 8; stroke-linecap: round; fill: none}
|
|
.gitTitleText {
|
|
text-anchor: middle;
|
|
font-size: 18px;
|
|
fill: ${t.textColor};
|
|
}
|
|
`}}}]); |