import{C as y}from"./DonutChart.2ca39914.js";import{U as k}from"./AnimatedNumber.987856b6.js";import{S as b}from"./Loading.ecf9741f.js";import{_ as p}from"./_plugin-vue_export-helper.eefbdd86.js";import{a6 as r,o as t,c as l,_ as s,l as C,$ as u,a4 as d,a1 as i,F as v,af as x,a0 as L,a2 as T,a7 as N,ae as S,a5 as q}from"./runtime-core.esm-bundler.ce5add0b.js";const B={emits:["onLabelClick"],components:{CoreDonutChart:y,UtilAnimatedNumber:k,SvgSeoSiteScoreLoading:b},props:{parts:{type:Array,required:!0},total:{type:Number,required:!0},label:{type:String,required:!0},link:{type:String,required:!1},animatedNumber:{type:Boolean,default(){return!0}},maxTotal:{type:String,required:!1},loading:{type:Boolean,required:!1},loadingText:{type:String,required:!1}},computed:{sortedParts(){const a=this.parts.map(n=>n);return a.forEach(function(n,e){n.last&&(a.push(a[e]),a.splice(e,1))}),a}},methods:{handleLabelClick(a,n){n!=null&&n.emitValue&&(a.preventDefault(),this.$emit("onLabelClick",n.emitValue))}}},V={class:"aioseo-donut-chart-with-legend"},A={class:"chart-left"},D={key:0,class:"aioseo-donut-chart-with-legend__loading"},w={key:0,class:"aioseo-donut-chart-with-legend__loading-text"},H={class:"chart-right"},M={class:"legend-amount"},P=["innerHTML"],U={key:0,class:"chart-more"},z=["innerHTML"];function E(a,n,e,F,I,c){const m=r("svg-seo-site-score-loading"),_=r("core-donut-chart"),h=r("util-animated-number");return t(),l("div",V,[s("div",A,[e.loading?(t(),l("div",D,[C(m),e.loadingText?(t(),l("div",w,u(e.loadingText),1)):d("",!0)])):(t(),i(_,{key:1,parts:e.parts,total:e.total,label:e.label,animatedNumber:e.animatedNumber,maxTotal:e.maxTotal,"is-label-colored":""},null,8,["parts","total","label","animatedNumber","maxTotal"]))]),s("div",H,[(t(!0),l(v,null,x(c.sortedParts,(o,g)=>(t(),l("div",{class:"legend",key:g},[s("div",{class:"legend-bullet",style:L(`background-color: ${o.color}`)},null,4),s("span",M,[e.animatedNumber?(t(),i(h,{key:0,number:parseInt(o.count)},null,8,["number"])):(t(),l("div",{key:1,innerHTML:parseInt(o.count)},null,8,P))]),(t(),i(q(o.link?"a":"span"),{href:o.link||null,class:S(["legend-label",{"is-link":o.link}]),onClick:f=>c.handleLabelClick(f,o)},{default:T(()=>[N(u(o.name),1)]),_:2},1032,["href","class","onClick"]))]))),128)),e.link&&e.total>0?(t(),l("div",U,[s("span",{innerHTML:e.link},null,8,z)])):d("",!0)])])}const K=p(B,[["render",E]]);export{K as C};
