"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["node_modules_pnpm_mermaid_11_11_0_node_modules_mermaid_dist_chunks_mermaid_core_pieDiagram-AD-78b3ca"],{"./node_modules/.pnpm/mermaid@11.11.0/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-ADFJNKIX.mjs":(function(me,j,o){o.d(j,{diagram:function(){return ae}});var L=o("./node_modules/.pnpm/mermaid@11.11.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-EXTU4WIE.mjs"),U=o("./node_modules/.pnpm/mermaid@11.11.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-4BX2VUAB.mjs"),T=o("./node_modules/.pnpm/mermaid@11.11.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-S3R3BYOJ.mjs"),n=o("./node_modules/.pnpm/mermaid@11.11.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ABZYJK2D.mjs"),r=o("./node_modules/.pnpm/mermaid@11.11.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-AGHRB4JF.mjs"),b=o("./node_modules/.pnpm/@mermaid-js+parser@0.6.2/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.mjs"),u=o("./node_modules/.pnpm/d3@7.9.0/node_modules/d3/src/index.js"),k=n.UI.pie,g={sections:new Map,showData:!1,config:k},p=g.sections,D=g.showData,F=structuredClone(k),G=(0,r.K2)(()=>structuredClone(F),"getConfig"),J=(0,r.K2)(()=>{p=new Map,D=g.showData,(0,n.IU)()},"clear"),N=(0,r.K2)(({label:e,value:a})=>{if(a<0)throw new Error(`"${e}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);p.has(e)||(p.set(e,a),r.Rm.debug(`added new section: ${e}, with value: ${a}`))},"addSection"),z=(0,r.K2)(()=>p,"getSections"),X=(0,r.K2)(e=>{D=e},"setShowData"),V=(0,r.K2)(()=>D,"getShowData"),w={getConfig:G,clear:J,setDiagramTitle:n.ke,getDiagramTitle:n.ab,setAccTitle:n.SV,getAccTitle:n.iN,setAccDescription:n.EI,getAccDescription:n.m7,addSection:N,getSections:z,setShowData:X,getShowData:V},Y=(0,r.K2)((e,a)=>{(0,U.S)(e,a),a.setShowData(e.showData),e.sections.map(a.addSection)},"populateDb"),Z={parse:(0,r.K2)(async e=>{const a=await(0,b.qg)("pie",e);r.Rm.debug(a),Y(a,w)},"parse")},H=(0,r.K2)(e=>`
  .pieCircle{
    stroke: ${e.pieStrokeColor};
    stroke-width : ${e.pieStrokeWidth};
    opacity : ${e.pieOpacity};
  }
  .pieOuterCircle{
    stroke: ${e.pieOuterStrokeColor};
    stroke-width: ${e.pieOuterStrokeWidth};
    fill: none;
  }
  .pieTitleText {
    text-anchor: middle;
    font-size: ${e.pieTitleTextSize};
    fill: ${e.pieTitleTextColor};
    font-family: ${e.fontFamily};
  }
  .slice {
    font-family: ${e.fontFamily};
    fill: ${e.pieSectionTextColor};
    font-size:${e.pieSectionTextSize};
    // fill: white;
  }
  .legend text {
    fill: ${e.pieLegendTextColor};
    font-family: ${e.fontFamily};
    font-size: ${e.pieLegendTextSize};
  }
`,"getStyles"),Q=H,q=(0,r.K2)(e=>{const a=[...e.values()].reduce((i,d)=>i+d,0),$=[...e.entries()].map(([i,d])=>({label:i,value:d})).filter(i=>i.value/a*100>=1).sort((i,d)=>d.value-i.value);return(0,u.rLf)().value(i=>i.value)($)},"createPieArcs"),ee=(0,r.K2)((e,a,$,O)=>{r.Rm.debug(`rendering pie chart
`+e);const i=O.db,d=(0,n.D7)(),y=(0,T.$t)(i.getConfig(),d.pie),K=40,l=18,_=4,c=450,f=c,v=(0,L.D)(a),m=v.append("g");m.attr("transform","translate("+f/2+","+c/2+")");const{themeVariables:s}=d;let[M]=(0,T.I5)(s.pieOuterStrokeWidth);M??(M=2);const P=y.textPosition,h=Math.min(f,c)/2-K,re=(0,u.JLW)().innerRadius(0).outerRadius(h),ie=(0,u.JLW)().innerRadius(h*P).outerRadius(h*P);m.append("circle").attr("cx",0).attr("cy",0).attr("r",h+M/2).attr("class","pieOuterCircle");const E=i.getSections(),se=q(E),ne=[s.pie1,s.pie2,s.pie3,s.pie4,s.pie5,s.pie6,s.pie7,s.pie8,s.pie9,s.pie10,s.pie11,s.pie12];let S=0;E.forEach(t=>{S+=t});const R=se.filter(t=>(t.data.value/S*100).toFixed(0)!=="0"),A=(0,u.UMr)(ne);m.selectAll("mySlices").data(R).enter().append("path").attr("d",re).attr("fill",t=>A(t.data.label)).attr("class","pieCircle"),m.selectAll("mySlices").data(R).enter().append("text").text(t=>(t.data.value/S*100).toFixed(0)+"%").attr("transform",t=>"translate("+ie.centroid(t)+")").style("text-anchor","middle").attr("class","slice"),m.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-(c-50)/2).attr("class","pieTitleText");const B=[...E.entries()].map(([t,x])=>({label:t,value:x})),C=m.selectAll(".legend").data(B).enter().append("g").attr("class","legend").attr("transform",(t,x)=>{const W=l+_,de=W*B.length/2,le=12*l,ce=x*W-de;return"translate("+le+","+ce+")"});C.append("rect").attr("width",l).attr("height",l).style("fill",t=>A(t.label)).style("stroke",t=>A(t.label)),C.append("text").attr("x",l+_).attr("y",l-_).text(t=>i.getShowData()?`${t.label} [${t.value}]`:t.label);const oe=Math.max(...C.selectAll("text").nodes().map(t=>t?.getBoundingClientRect().width??0)),I=f+K+l+_+oe;v.attr("viewBox",`0 0 ${I} ${c}`),(0,n.a$)(v,c,I,y.useMaxWidth)},"draw"),te={draw:ee},ae={parser:Z,db:w,renderer:te,styles:Q}})}]);
