1import{P as e,S as t,aK as a,g as n,s as i,a as r,b as l,t as s,q as o,_ as p,l as c,c as d,F as u,K as f,a3 as m,e as h,z as g,G as x}from"./index-C16DHWFp.js";import{p as y}from"./chunk-4BX2VUAB-CJu338GO.js";import{p as v}from"./treemap-KZPCXAKY-DdCrRx6w.js";import{d as w}from"./arc-BQRz2rP0.js";import{o as S}from"./ordinal-BXL5nHgV.js";import"./vendor-react-DejgYtBM.js";import"./vendor-semi-D8d7bTtM.js";import"./index-BeIIFw6E.js";import"./vendor-icons-EJvJ5X-w.js";import"./vendor-motion-Chfy_MiU.js";import"./vendor-katex-BuQuj6Fv.js";import"./dayjs.min-CASHsil8.js";import"./purify.es-Bm-lHtoJ.js";import"./index-DcbB2zxU.js";import"./vendor-highlight-CaHTjBxz.js";import"./index-B_PxGnmD.js";import"./_baseUniq-BjWlgG8Y.js";import"./_basePickBy-bVyxPQRR.js";import"./clone-VMOlTGG7.js";import"./init-C0SZ43gy.js";function b(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function j(e){return e}var A=x.pie,$={sections:new Map,showData:!1},T=$.sections,C=$.showData,D=structuredClone(A),k={getConfig:p(()=>structuredClone(D),"getConfig"),clear:p(()=>{T=new Map,C=$.showData,g()},"clear"),setDiagramTitle:o,getDiagramTitle:s,setAccTitle:l,getAccTitle:r,setAccDescription:i,getAccDescription:n,addSection:p(({label:e,value:t})=>{if(t<0)throw new Error(`"${e}" has invalid value: ${t}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(e)||(T.set(e,t),c.debug(`added new section: ${e}, with value: ${t}`))},"addSection"),getSections:p(()=>T,"getSections"),setShowData:p(e=>{C=e},"setShowData"),getShowData:p(()=>C,"getShowData")},M=p((e,t)=>{y(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},"populateDb"),z={parse:p(async e=>{const t=await v("pie",e);c.debug(t),M(t,k)},"parse")},O=p(e=>`\n .pieCircle{\n stroke: ${e.pieStrokeColor};\n stroke-width : ${e.pieStrokeWidth};\n opacity : ${e.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${e.pieOuterStrokeColor};\n stroke-width: ${e.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${e.pieTitleTextSize};\n fill: ${e.pieTitleTextColor};\n font-family: ${e.fontFamily};\n }\n .slice {\n font-family: ${e.fontFamily};\n fill: ${e.pieSectionTextColor};\n font-size:${e.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${e.pieLegendTextColor};\n font-family: ${e.fontFamily};\n font-size: ${e.pieLegendTextSize};\n }\n`,"getStyles"),F=p(n=>{const i=[...n.values()].reduce((e,t)=>e+t,0),r=[...n.entries()].map(([e,t])=>({label:e,value:t})).filter(e=>e.value/i*100>=1).sort((e,t)=>t.value-e.value),l=function(){var n=j,i=b,r=null,l=e(0),s=e(t),o=e(0);function p(e){var p,c,d,u,f,m=(e=a(e)).length,h=0,g=new Array(m),x=new Array(m),y=+l.apply(this,arguments),v=Math.min(t,Math.max(-t,s.apply(this,arguments)-y)),w=Math.min(Math.abs(v)/m,o.apply(this,arguments)),S=w*(v<0?-1:1);for(p=0;p<m;++p)(f=x[g[p]=p]=+n(e[p],p,e))>0&&(h+=f);for(null!=i?g.sort(function(e,t){return i(x[e],x[t])}):null!=r&&g.sort(function(t,a){return r(e[t],e[a])}),p=0,d=h?(v-m*S)/h:0;p<m;++p,y=u)c=g[p],u=y+((f=x[c])>0?f*d:0)+S,x[c]={data:e[c],index:p,value:f,startAngle:y,endAngle:u,padAngle:w};return x}return p.value=function(t){return arguments.length?(n="function"==typeof t?t:e(+t),p):n},p.sortValues=function(e){return arguments.length?(i=e,r=null,p):i},p.sort=function(e){return arguments.length?(r=e,i=null,p):r},p.startAngle=function(t){return arguments.length?(l="function"==typeof t?t:e(+t),p):l},p.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:e(+t),p):s},p.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:e(+t),p):o},p}().value(e=>e.value);return l(r)},"createPieArcs"),B={parser:z,db:k,renderer:{draw:p((e,t,a,n)=>{c.debug("rendering pie chart\n"+e);const i=n.db,r=d(),l=u(i.getConfig(),r.pie),s=f(t),o=s.append("g");o.attr("transform","translate(225,225)");const{themeVariables:p}=r;let[g]=m(p.pieOuterStrokeWidth);g??(g=2);const x=l.textPosition,y=Math.min(450,450)/2-40,v=w().innerRadius(0).outerRadius(y),b=w().innerRadius(y*x).outerRadius(y*x);o.append("circle").attr("cx",0).attr("cy",0).attr("r",y+g/2).attr("class","pieOuterCircle");const j=i.getSections(),A=F(j),$=[p.pie1,p.pie2,p.pie3,p.pie4,p.pie5,p.pie6,p.pie7,p.pie8,p.pie9,p.pie10,p.pie11,p.pie12];let T=0;
1j.forEach(e=>{T+=e});const C=A.filter(e=>"0"!==(e.data.value/T*100).toFixed(0)),D=S($);o.selectAll("mySlices").data(C).enter().append("path").attr("d",v).attr("fill",e=>D(e.data.label)).attr("class","pieCircle"),o.selectAll("mySlices").data(C).enter().append("text").text(e=>(e.data.value/T*100).toFixed(0)+"%").attr("transform",e=>"translate("+b.centroid(e)+")").style("text-anchor","middle").attr("class","slice"),o.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");const k=[...j.entries()].map(([e,t])=>({label:e,value:t})),M=o.selectAll(".legend").data(k).enter().append("g").attr("class","legend").attr("transform",(e,t)=>"translate(216,"+(22*t-22*k.length/2)+")");M.append("rect").attr("width",18).attr("height",18).style("fill",e=>D(e.label)).style("stroke",e=>D(e.label)),M.append("text").attr("x",22).attr("y",14).text(e=>i.getShowData()?`${e.label} [${e.value}]`:e.label);const z=512+Math.max(...M.selectAll("text").nodes().map(e=>e?.getBoundingClientRect().width??0));s.attr("viewBox",`0 0 ${z} 450`),h(s,450,z,l.useMaxWidth)},"draw")},styles:O};export{B as diagram};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.