/*! third party licenses: js/vendor.LICENSE.txt */
import{p as K}from"./chunk-4BX2VUAB-CRQkbnhe.chunk.mjs";import{I as Y}from"./chunk-QZHKN3VN-BMszg4_5.chunk.mjs";import{_ as h,q as U,p as V,s as J,g as Q,a as X,b as Z,l as u,c as rr,u as tr,B as er,y as or,j as E,C as ar,D as nr,E as ir,F as cr}from"./NcSelect-DXLJbwym.chunk.mjs";import{p as sr}from"./treemap-KMMF4GRG-BMzvQTWV.chunk.mjs";import{s as dr}from"./isEmpty-nTVdZyYD.chunk.mjs";import"./whiteboard-main.mjs";import"./index-Anv74-sp.chunk.mjs";import"./vendor-BeFBwUwf.chunk.mjs";import"./index-C0mkXnFg.chunk.mjs";import"./index-Bn0s6V7w.chunk.mjs";import"./index-vg7q3Iku.chunk.mjs";import"./translation-DoG5ZELJ-DKBzIEvm.chunk.mjs";import"./percentages-BXMCSKIN-Cw9SI0WV.chunk.mjs";import"./useJwtStore-B1DPLYgs.chunk.mjs";import"./_plugin-vue2_normalizer-CBCAj2XU.chunk.mjs";import"./line-2ECJkxIB.chunk.mjs";import"./array-Cg_lHFoG.chunk.mjs";import"./path-i7Zvihw6.chunk.mjs";import"./_baseUniq-CE6homwJ.chunk.mjs";import"./_basePickBy-0DU--7tw.chunk.mjs";import"./has-DJswI7NS.chunk.mjs";import"./clone-Dt8ItUbV.chunk.mjs";var f={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},hr=ir.gitGraph,P=h(()=>ar({...hr,...nr().gitGraph}),"getConfig"),s=new Y(()=>{const t=P(),r=t.mainBranchName,a=t.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:a}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function O(){return cr({length:7})}h(O,"getID");function D(t,r){const a=Object.create(null);return t.reduce((n,e)=>{const o=r(e);return a[o]||(a[o]=!0,n.push(e)),n},[])}h(D,"uniqBy");var mr=h(function(t){s.records.direction=t},"setDirection"),$r=h(function(t){u.debug("options str",t),t=t?.trim(),t=t||"{}";try{s.records.options=JSON.parse(t)}catch(r){u.error("error while parsing gitGraph options",r.message)}},"setOptions"),lr=h(function(){return s.records.options},"getOptions"),gr=h(function(t){let r=t.msg,a=t.id;const n=t.type;let e=t.tags;u.info("commit",r,a,n,e),u.debug("Entering commit:",r,a,n,e);const o=P();a=E.sanitizeText(a,o),r=E.sanitizeText(r,o),e=e?.map(i=>E.sanitizeText(i,o));const d={id:a||s.records.seq+"-"+O(),message:r,seq:s.records.seq++,type:n??f.NORMAL,tags:e??[],parents:s.records.head==null?[]:[s.records.head.id],branch:s.records.currBranch};s.records.head=d,u.info("main branch",o.mainBranchName),s.records.commits.has(d.id)&&u.warn(`Commit ID ${d.id} already exists`),s.records.commits.set(d.id,d),s.records.branches.set(s.records.currBranch,d.id),u.debug("in pushCommit "+d.id)},"commit"),yr=h(function(t){let r=t.name;const a=t.order;if(r=E.sanitizeText(r,P()),s.records.branches.has(r))throw 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}")`);s.records.branches.set(r,s.records.head!=null?s.records.head.id:null),s.records.branchConfig.set(r,{name:r,order:a}),N(r),u.debug("in createBranch")},"branch"),pr=h(t=>{let r=t.branch,a=t.id;const n=t.type,e=t.tags,o=P();r=E.sanitizeText(r,o),a&&(a=E.sanitizeText(a,o));const d=s.records.branches.get(s.records.currBranch),i=s.records.branches.get(r),l=d?s.records.commits.get(d):void 0,m=i?s.records.commits.get(i):void 0;if(l&&m&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(s.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${s.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!s.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(m===void 0||!m){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===m){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(a&&s.records.commits.has(a)){const c=new Error('Incorrect usage of "merge". Commit with id:'+a+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${a} ${n} ${e?.join(" ")}`,token:`merge ${r} ${a} ${n} ${e?.join(" ")}`,expected:[`merge ${r} ${a}_UNIQUE ${n} ${e?.join(" ")}`]},c}const $=i||"",g={id:a||`${s.records.seq}-${O()}`,message:`merged branch ${r} into ${s.records.currBranch}`,seq:s.records.seq++,parents:s.records.head==null?[]:[s.records.head.id,$],branch:s.records.currBranch,type:f.MERGE,customType:n,customId:!!a,tags:e??[]};s.records.head=g,s.records.commits.set(g.id,g),s.records.branches.set(s.records.currBranch,g.id),u.debug(s.records.branches),u.debug("in mergeBranch")},"merge"),fr=h(function(t){let r=t.id,a=t.targetId,n=t.tags,e=t.parent;u.debug("Entering cherryPick:",r,a,n);const o=P();if(r=E.sanitizeText(r,o),a=E.sanitizeText(a,o),n=n?.map(l=>E.sanitizeText(l,o)),e=E.sanitizeText(e,o),!r||!s.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},l}const d=s.records.commits.get(r);if(d===void 0||!d)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(e&&!(Array.isArray(d.parents)&&d.parents.includes(e)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const i=d.branch;if(d.type===f.MERGE&&!e)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!a||!s.records.commits.has(a)){if(i===s.records.currBranch){const g=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const l=s.records.branches.get(s.records.currBranch);if(l===void 0||!l){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${s.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const m=s.records.commits.get(l);if(m===void 0||!m){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${s.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const $={id:s.records.seq+"-"+O(),message:`cherry-picked ${d?.message} into ${s.records.currBranch}`,seq:s.records.seq++,parents:s.records.head==null?[]:[s.records.head.id,d.id],branch:s.records.currBranch,type:f.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${d.id}${d.type===f.MERGE?`|parent:${e}`:""}`]};s.records.head=$,s.records.commits.set($.id,$),s.records.branches.set(s.records.currBranch,$.id),u.debug(s.records.branches),u.debug("in cherryPick")}},"cherryPick"),N=h(function(t){if(t=E.sanitizeText(t,P()),s.records.branches.has(t)){s.records.currBranch=t;const r=s.records.branches.get(s.records.currBranch);r===void 0||!r?s.records.head=null:s.records.head=s.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}},"checkout");function H(t,r,a){const n=t.indexOf(r);n===-1?t.push(a):t.splice(n,1,a)}h(H,"upsert");function z(t){const r=t.reduce((e,o)=>e.seq>o.seq?e:o,t[0]);let a="";t.forEach(function(e){e===r?a+=" *":a+=" |"});const n=[a,r.id,r.seq];for(const e in s.records.branches)s.records.branches.get(e)===r.id&&n.push(e);if(u.debug(n.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const e=s.records.commits.get(r.parents[0]);H(t,r,e),r.parents[1]&&t.push(s.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const e=s.records.commits.get(r.parents[0]);H(t,r,e)}}t=D(t,e=>e.id),z(t)}h(z,"prettyPrintCommitHistory");var xr=h(function(){u.debug(s.records.commits);const t=W()[0];z([t])},"prettyPrint"),ur=h(function(){s.reset(),or()},"clear"),br=h(function(){return[...s.records.branchConfig.values()].map((t,r)=>t.order!==null&&t.order!==void 0?t:{...t,order:parseFloat(`0.${r}`)}).sort((t,r)=>(t.order??0)-(r.order??0)).map(({name:t})=>({name:t}))},"getBranchesAsObjArray"),wr=h(function(){return s.records.branches},"getBranches"),Br=h(function(){return s.records.commits},"getCommits"),W=h(function(){const t=[...s.records.commits.values()];return t.forEach(function(r){u.debug(r.id)}),t.sort((r,a)=>r.seq-a.seq),t},"getCommitsArray"),Er=h(function(){return s.records.currBranch},"getCurrentBranch"),Cr=h(function(){return s.records.direction},"getDirection"),kr=h(function(){return s.records.head},"getHead"),j={commitType:f,getConfig:P,setDirection:mr,setOptions:$r,getOptions:lr,commit:gr,branch:yr,merge:pr,cherryPick:fr,checkout:N,prettyPrint:xr,clear:ur,getBranchesAsObjArray:br,getBranches:wr,getCommits:Br,getCommitsArray:W,getCurrentBranch:Er,getDirection:Cr,getHead:kr,setAccTitle:Z,getAccTitle:X,getAccDescription:Q,setAccDescription:J,setDiagramTitle:V,getDiagramTitle:U},Lr=h((t,r)=>{K(t,r),t.dir&&r.setDirection(t.dir);for(const a of t.statements)Tr(a,r)},"populate"),Tr=h((t,r)=>{const a={Commit:h(n=>r.commit(Mr(n)),"Commit"),Branch:h(n=>r.branch(vr(n)),"Branch"),Merge:h(n=>r.merge(Pr(n)),"Merge"),Checkout:h(n=>r.checkout(Rr(n)),"Checkout"),CherryPicking:h(n=>r.cherryPick(Ir(n)),"CherryPicking")}[t.$type];a?a(t):u.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Mr=h(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?f[t.type]:f.NORMAL,tags:t.tags??void 0}),"parseCommit"),vr=h(t=>({name:t.name,order:t.order??0}),"parseBranch"),Pr=h(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?f[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Rr=h(t=>t.branch,"parseCheckout"),Ir=h(t=>({id:t.id,targetId:"",tags:t.tags?.length===0?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),Ar={parse:h(async t=>{const r=await sr("gitGraph",t);u.debug(r),Lr(r,j)},"parse")},Gr=rr(),B=Gr?.gitGraph,T=10,M=40,C=4,k=2,v=8,b=new Map,w=new Map,A=30,R=new Map,G=[],L=0,y="LR",Or=h(()=>{b.clear(),w.clear(),R.clear(),L=0,G=[],y="LR"},"clear"),_=h(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|
/gi):t).forEach(a=>{const n=document.createElementNS("http://www.w3.org/2000/svg","tspan");n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),n.setAttribute("dy","1em"),n.setAttribute("x","0"),n.setAttribute("class","row"),n.textContent=a.trim(),r.appendChild(n)}),r},"drawText"),F=h(t=>{let r,a,n;return y==="BT"?(a=h((e,o)=>e<=o,"comparisonFunc"),n=1/0):(a=h((e,o)=>e>=o,"comparisonFunc"),n=0),t.forEach(e=>{const o=y==="TB"||y=="BT"?w.get(e)?.y:w.get(e)?.x;o!==void 0&&a(o,n)&&(r=e,n=o)}),r},"findClosestParent"),qr=h(t=>{let r="",a=1/0;return t.forEach(n=>{const e=w.get(n).y;e<=a&&(r=n,a=e)}),r||void 0},"findClosestParentBT"),Hr=h((t,r,a)=>{let n=a,e=a;const o=[];t.forEach(d=>{const i=r.get(d);if(!i)throw new Error(`Commit not found for key ${d}`);i.parents.length?(n=Sr(i),e=Math.max(n,e)):o.push(i),Dr(i,n)}),n=e,o.forEach(d=>{Nr(d,n,a)}),t.forEach(d=>{const i=r.get(d);if(i?.parents.length){const l=qr(i.parents);n=w.get(l).y-M,n<=e&&(e=n);const m=b.get(i.branch).pos,$=n-T;w.set(i.id,{x:m,y:$})}})},"setParallelBTPos"),zr=h(t=>{const r=F(t.parents.filter(n=>n!==null));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const a=w.get(r)?.y;if(a===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return a},"findClosestParentPos"),Sr=h(t=>zr(t)+M,"calculateCommitPosition"),Dr=h((t,r)=>{const a=b.get(t.branch);if(!a)throw new Error(`Branch not found for commit ${t.id}`);const n=a.pos,e=r+T;return w.set(t.id,{x:n,y:e}),{x:n,y:e}},"setCommitPosition"),Nr=h((t,r,a)=>{const n=b.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const e=r+a,o=n.pos;w.set(t.id,{x:o,y:e})},"setRootPosition"),Wr=h((t,r,a,n,e,o)=>{if(o===f.HIGHLIGHT)t.append("rect").attr("x",a.x-10).attr("y",a.y-10).attr("width",20).attr("height",20).attr("class",`commit ${r.id} commit-highlight${e%v} ${n}-outer`),t.append("rect").attr("x",a.x-6).attr("y",a.y-6).attr("width",12).attr("height",12).attr("class",`commit ${r.id} commit${e%v} ${n}-inner`);else if(o===f.CHERRY_PICK)t.append("circle").attr("cx",a.x).attr("cy",a.y).attr("r",10).attr("class",`commit ${r.id} ${n}`),t.append("circle").attr("cx",a.x-3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${n}`),t.append("circle").attr("cx",a.x+3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${n}`),t.append("line").attr("x1",a.x+3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${n}`),t.append("line").attr("x1",a.x-3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${n}`);else{const d=t.append("circle");if(d.attr("cx",a.x),d.attr("cy",a.y),d.attr("r",r.type===f.MERGE?9:10),d.attr("class",`commit ${r.id} commit${e%v}`),o===f.MERGE){const i=t.append("circle");i.attr("cx",a.x),i.attr("cy",a.y),i.attr("r",6),i.attr("class",`commit ${n} ${r.id} commit${e%v}`)}o===f.REVERSE&&t.append("path").attr("d",`M ${a.x-5},${a.y-5}L${a.x+5},${a.y+5}M${a.x-5},${a.y+5}L${a.x+5},${a.y-5}`).attr("class",`commit ${n} ${r.id} commit${e%v}`)}},"drawCommitBullet"),jr=h((t,r,a,n)=>{if(r.type!==f.CHERRY_PICK&&(r.customId&&r.type===f.MERGE||r.type!==f.MERGE)&&B?.showCommitLabel){const e=t.append("g"),o=e.insert("rect").attr("class","commit-label-bkg"),d=e.append("text").attr("x",n).attr("y",a.y+25).attr("class","commit-label").text(r.id),i=d.node()?.getBBox();if(i&&(o.attr("x",a.posWithOffset-i.width/2-k).attr("y",a.y+13.5).attr("width",i.width+2*k).attr("height",i.height+2*k),y==="TB"||y==="BT"?(o.attr("x",a.x-(i.width+4*C+5)).attr("y",a.y-12),d.attr("x",a.x-(i.width+4*C)).attr("y",a.y+i.height-12)):d.attr("x",a.posWithOffset-i.width/2),B.rotateCommitLabel))if(y==="TB"||y==="BT")d.attr("transform","rotate(-45, "+a.x+", "+a.y+")"),o.attr("transform","rotate(-45, "+a.x+", "+a.y+")");else{const l=-7.5-(i.width+10)/25*9.5,m=10+i.width/25*8.5;e.attr("transform","translate("+l+", "+m+") rotate(-45, "+n+", "+a.y+")")}}},"drawCommitLabel"),_r=h((t,r,a,n)=>{if(r.tags.length>0){let e=0,o=0,d=0;const i=[];for(const l of r.tags.reverse()){const m=t.insert("polygon"),$=t.append("circle"),g=t.append("text").attr("y",a.y-16-e).attr("class","tag-label").text(l),c=g.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");o=Math.max(o,c.width),d=Math.max(d,c.height),g.attr("x",a.posWithOffset-c.width/2),i.push({tag:g,hole:$,rect:m,yOffset:e}),e+=20}for(const{tag:l,hole:m,rect:$,yOffset:g}of i){const c=d/2,x=a.y-19.2-g;if($.attr("class","tag-label-bkg").attr("points",`
${n-o/2-C/2},${x+k}
${n-o/2-C/2},${x-k}
${a.posWithOffset-o/2-C},${x-c-k}
${a.posWithOffset+o/2+C},${x-c-k}
${a.posWithOffset+o/2+C},${x+c+k}
${a.posWithOffset-o/2-C},${x+c+k}`),m.attr("cy",x).attr("cx",n-o/2+C/2).attr("r",1.5).attr("class","tag-hole"),y==="TB"||y==="BT"){const p=n+g;$.attr("class","tag-label-bkg").attr("points",`
${a.x},${p+2}
${a.x},${p-2}
${a.x+T},${p-c-2}
${a.x+T+o+4},${p-c-2}
${a.x+T+o+4},${p+c+2}
${a.x+T},${p+c+2}`).attr("transform","translate(12,12) rotate(45, "+a.x+","+n+")"),m.attr("cx",a.x+C/2).attr("cy",p).attr("transform","translate(12,12) rotate(45, "+a.x+","+n+")"),l.attr("x",a.x+5).attr("y",p+3).attr("transform","translate(14,14) rotate(45, "+a.x+","+n+")")}}}},"drawCommitTags"),Fr=h(t=>{switch(t.customType??t.type){case f.NORMAL:return"commit-normal";case f.REVERSE:return"commit-reverse";case f.HIGHLIGHT:return"commit-highlight";case f.MERGE:return"commit-merge";case f.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),Kr=h((t,r,a,n)=>{const e={x:0,y:0};if(t.parents.length>0){const o=F(t.parents);if(o){const d=n.get(o)??e;return r==="TB"?d.y+M:r==="BT"?(n.get(t.id)??e).y-M:d.x+M}}else return r==="TB"?A:r==="BT"?(n.get(t.id)??e).y-M:0;return 0},"calculatePosition"),Yr=h((t,r,a)=>{const n=y==="BT"&&a?r:r+T,e=y==="TB"||y==="BT"?n:b.get(t.branch)?.pos,o=y==="TB"||y==="BT"?b.get(t.branch)?.pos:n;if(o===void 0||e===void 0)throw new Error(`Position were undefined for commit ${t.id}`);return{x:o,y:e,posWithOffset:n}},"getCommitPosition"),S=h((t,r,a)=>{if(!B)throw new Error("GitGraph config not found");const n=t.append("g").attr("class","commit-bullets"),e=t.append("g").attr("class","commit-labels");let o=y==="TB"||y==="BT"?A:0;const d=[...r.keys()],i=B?.parallelCommits??!1,l=h(($,g)=>{const c=r.get($)?.seq,x=r.get(g)?.seq;return c!==void 0&&x!==void 0?c-x:0},"sortKeys");let m=d.sort(l);y==="BT"&&(i&&Hr(m,r,o),m=m.reverse()),m.forEach($=>{const g=r.get($);if(!g)throw new Error(`Commit not found for key ${$}`);i&&(o=Kr(g,y,o,w));const c=Yr(g,o,i);if(a){const x=Fr(g),p=g.customType??g.type,q=b.get(g.branch)?.index??0;Wr(n,g,c,x,q,p),jr(e,g,c,o),_r(e,g,c,o)}y==="TB"||y==="BT"?w.set(g.id,{x:c.x,y:c.posWithOffset}):w.set(g.id,{x:c.posWithOffset,y:c.y}),o=y==="BT"&&i?o+M:o+M+T,o>L&&(L=o)})},"drawCommits"),Ur=h((t,r,a,n,e)=>{const o=(y==="TB"||y==="BT"?a.xl.branch===o,"isOnBranchToGetCurve"),i=h(l=>l.seq>t.seq&&l.seqi(l)&&d(l))},"shouldRerouteArrow"),I=h((t,r,a=0)=>{const n=t+Math.abs(t-r)/2;if(a>5)return n;if(G.every(o=>Math.abs(o-n)>=10))return G.push(n),n;const e=Math.abs(t-r);return I(t,r-e/5,a+1)},"findLane"),Vr=h((t,r,a,n)=>{const e=w.get(r.id),o=w.get(a.id);if(e===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${a.id}`);const d=Ur(r,a,e,o,n);let i="",l="",m=0,$=0,g=b.get(a.branch)?.index;a.type===f.MERGE&&r.id!==a.parents[0]&&(g=b.get(r.branch)?.index);let c;if(d){i="A 10 10, 0, 0, 0,",l="A 10 10, 0, 0, 1,",m=10,$=10;const x=e.yo.x&&(i="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",m=20,$=20,a.type===f.MERGE&&r.id!==a.parents[0]?c=`M ${e.x} ${e.y} L ${e.x} ${o.y-m} ${l} ${e.x-$} ${o.y} L ${o.x} ${o.y}`:c=`M ${e.x} ${e.y} L ${o.x+m} ${e.y} ${i} ${o.x} ${e.y+$} L ${o.x} ${o.y}`),e.x===o.x&&(c=`M ${e.x} ${e.y} L ${o.x} ${o.y}`)):y==="BT"?(e.xo.x&&(i="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",m=20,$=20,a.type===f.MERGE&&r.id!==a.parents[0]?c=`M ${e.x} ${e.y} L ${e.x} ${o.y+m} ${i} ${e.x-$} ${o.y} L ${o.x} ${o.y}`:c=`M ${e.x} ${e.y} L ${o.x-m} ${e.y} ${i} ${o.x} ${e.y-$} L ${o.x} ${o.y}`),e.x===o.x&&(c=`M ${e.x} ${e.y} L ${o.x} ${o.y}`)):(e.yo.y&&(a.type===f.MERGE&&r.id!==a.parents[0]?c=`M ${e.x} ${e.y} L ${o.x-m} ${e.y} ${i} ${o.x} ${e.y-$} L ${o.x} ${o.y}`:c=`M ${e.x} ${e.y} L ${e.x} ${o.y+m} ${l} ${e.x+$} ${o.y} L ${o.x} ${o.y}`),e.y===o.y&&(c=`M ${e.x} ${e.y} L ${o.x} ${o.y}`));if(c===void 0)throw new Error("Line definition not found");t.append("path").attr("d",c).attr("class","arrow arrow"+g%v)},"drawArrow"),Jr=h((t,r)=>{const a=t.append("g").attr("class","commit-arrows");[...r.keys()].forEach(n=>{const e=r.get(n);e.parents&&e.parents.length>0&&e.parents.forEach(o=>{Vr(a,r.get(o),e,r)})})},"drawArrows"),Qr=h((t,r)=>{const a=t.append("g");r.forEach((n,e)=>{const o=e%v,d=b.get(n.name)?.pos;if(d===void 0)throw new Error(`Position not found for branch ${n.name}`);const i=a.append("line");i.attr("x1",0),i.attr("y1",d),i.attr("x2",L),i.attr("y2",d),i.attr("class","branch branch"+o),y==="TB"?(i.attr("y1",A),i.attr("x1",d),i.attr("y2",L),i.attr("x2",d)):y==="BT"&&(i.attr("y1",L),i.attr("x1",d),i.attr("y2",A),i.attr("x2",d)),G.push(d);const l=n.name,m=_(l),$=a.insert("rect"),g=a.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+o);g.node().appendChild(m);const c=m.getBBox();$.attr("class","branchLabelBkg label"+o).attr("rx",4).attr("ry",4).attr("x",-c.width-4-(B?.rotateCommitLabel===!0?30:0)).attr("y",-c.height/2+8).attr("width",c.width+18).attr("height",c.height+4),g.attr("transform","translate("+(-c.width-14-(B?.rotateCommitLabel===!0?30:0))+", "+(d-c.height/2-1)+")"),y==="TB"?($.attr("x",d-c.width/2-10).attr("y",0),g.attr("transform","translate("+(d-c.width/2-5)+", 0)")):y==="BT"?($.attr("x",d-c.width/2-10).attr("y",L),g.attr("transform","translate("+(d-c.width/2-5)+", "+L+")")):$.attr("transform","translate(-19, "+(d-c.height/2)+")")})},"drawBranches"),Xr=h(function(t,r,a,n,e){return b.set(t,{pos:r,index:a}),r+=50+(e?40:0)+(y==="TB"||y==="BT"?n.width/2:0),r},"setBranchPosition"),Zr=h(function(t,r,a,n){if(Or(),u.debug("in gitgraph renderer",t+`
`,"id:",r,a),!B)throw new Error("GitGraph config not found");const e=B.rotateCommitLabel??!1,o=n.db;R=o.getCommits();const d=o.getBranchesAsObjArray();y=o.getDirection();const i=dr(`[id="${r}"]`);let l=0;d.forEach((m,$)=>{const g=_(m.name),c=i.append("g"),x=c.insert("g").attr("class","branchLabel"),p=x.insert("g").attr("class","label branch-label");p.node()?.appendChild(g);const q=g.getBBox();l=Xr(m.name,l,$,q,e),p.remove(),x.remove(),c.remove()}),S(i,R,!1),B.showBranches&&Qr(i,d),Jr(i,R),S(i,R,!0),tr.insertTitle(i,"gitTitleText",B.titleTopMargin??0,o.getDiagramTitle()),er(void 0,i,B.diagramPadding,B.useMaxWidth)},"draw"),rt={draw:Zr},tt=h(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(r=>`
.branch-label${r} { fill: ${t["gitBranchLabel"+r]}; }
.commit${r} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; }
.commit-highlight${r} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; }
.label${r} { fill: ${t["git"+r]}; }
.arrow${r} { stroke: ${t["git"+r]}; }
`).join(`
`)}
.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};
}
`,"getStyles"),et=tt,kt={parser:Ar,db:j,renderer:rt,styles:et};export{kt as diagram};
//# sourceMappingURL=gitGraphDiagram-NY62KEGX-BXDkjyrV.chunk.mjs.map