import{j as a}from"./index-D2K-duz6.js";function h(s){if(!Array.isArray(s)||s.length===0)return[{label:"Security",value:72,color:"#111"},{label:"Trust",value:58,color:"rgba(17, 17, 17, 0.72)"},{label:"Growth",value:44,color:"rgba(17, 17, 17, 0.52)"}];const c=[];return s.forEach((e,n)=>{if(!e||typeof e!="object")return;const l=e,t=Number(l.value);c.push({label:String(l.label??`Series ${n+1}`),value:Number.isFinite(t)?Math.max(0,t):0,color:typeof l.color=="string"?l.color:void 0})}),c.length>0?c:[{label:"Security",value:72,color:"#111"},{label:"Trust",value:58,color:"rgba(17, 17, 17, 0.72)"},{label:"Growth",value:44,color:"rgba(17, 17, 17, 0.52)"}]}function u({props:s,paused:c}){const e=s,n=String(e.header??e.eyebrow??"Chart single"),l=String(e.title??"One chart, one comparison"),t=String(e.body??"Use one chart for one contrast."),o=h(e.points),i=Math.max(...o.map(r=>r.value),1);return a.jsx("article",{className:`chart-single ${c?"chart-single--paused":""}`,children:a.jsxs("div",{className:"chart-single__content",children:[a.jsxs("div",{className:"chart-single__copy",children:[a.jsx("p",{className:"chart-single__eyebrow",children:n}),a.jsx("h2",{className:"chart-single__title",children:l}),a.jsx("p",{className:"chart-single__body",children:t})]}),a.jsx("div",{className:"chart-single__plot",role:"img","aria-label":l,children:o.map(r=>a.jsxs("div",{className:"chart-single__row",children:[a.jsx("span",{className:"chart-single__label",children:r.label}),a.jsx("div",{className:"chart-single__bar-track",children:a.jsx("div",{className:"chart-single__bar-fill",style:{width:`${r.value/i*100}%`,background:r.color??"#111"}})}),a.jsx("span",{className:"chart-single__value",children:r.value})]},r.label))})]})})}export{u as default};
