import{pasU}from"./chunk-JJENOPKO-D7WHNuK7.js";import{adasy,a5asz,aHasj,zasq,pasH,qasZ,sasJ,gasK,casQ,basX,_asp,lasF,rasY,dastt,Aaset,Easat,Lasrt,kasnt}from"./index-CEaWaBDv.js";import{pasit}from"./gitGraph-F2EDSAW4-COXU65Tl.js";import{dasO}from"./arc-D5zh37vz.js";import{oasst}from"./ordinal-Cboi1Yqb.js";import"./reduce-Dy0Mg_vr.js";import"./min-DQRx9kam.js";import"./init-Gi6I4Gst.js";functionot(t,a){returna<t?-1:a>t?1:a>=t?0:NaN}functionlt(t){returnt}functionct(){vart=lt,a=ot,m=null,o=y(0),g=y(z),x=y(0);functioni(e){varr,l=(e=j(e)).length,c,A,h=0,u=newArray(l),n=newArray(l),v=+o.apply(this,arguments),w=Math.min(z,Math.max(-z,g.apply(this,arguments)-v)),f,T=Math.min(Math.abs(w)/l,x.apply(this,arguments)),$=T*(w<0?-1:1),d;for(r=0;r<l;++r)(d=n[u[r]=r]=+t(e[r],r,e))>0&&(h+=d);for(a!=null?u.sort(function(S,C){returna(n[S],n[C])}):m!=null&&u.sort(function(S,C){returnm(e[S],e[C])}),r=0,A=h?(w-l*$)/h:0;r<l;++r,v=f)c=u[r],d=n[c],f=v+(d>0?d*A:0)+$,n[c]={data:e[c],index:r,value:d,startAngle:v,endAngle:f,padAngle:T};returnn}returni.value=function(e){returnarguments.length?(t=typeofe=="function"?e:y(+e),i):t},i.sortValues=function(e){returnarguments.length?(a=e,m=null,i):a},i.sort=function(e){returnarguments.length?(m=e,a=null,i):m},i.startAngle=function(e){returnarguments.length?(o=typeofe=="function"?e:y(+e),i):o},i.endAngle=function(e){returnarguments.length?(g=typeofe=="function"?e:y(+e),i):g},i.padAngle=function(e){returnarguments.length?(x=typeofe=="function"?e:y(+e),i):x},i}varP=q.pie,G={sections:newMap,showData:!1,config:P},b=G.sections,W=G.showData,ut=structuredClone(P),pt=p(()=>structuredClone(ut),"getConfig"),gt=p(()=>{b=newMap,W=G.showData,Y()},"clear"),dt=p(({label:t,value:a})=>{b.has(t)||(b.set(t,a),F.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),ft=p(()=>b,"getSections"),mt=p(t=>{W=t},"setShowData"),ht=p(()=>W,"getShowData"),R={getConfig:pt,clear:gt,setDiagramTitle:H,getDiagramTitle:Z,setAccTitle:J,getAccTitle:K,setAccDescription:Q,getAccDescription:X,addSection:dt,getSections:ft,setShowData:mt,getShowData:ht},vt=p((t,a)=>{U(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),St={parse:p(asynct=>{consta=awaitit("pie",t);F.debug(a),vt(a,R)},"parse")},yt=p(t=>`