import{C as e,D as t,E as n,F as r,H as i,I as a,N as o,Q as s,T as c,X as l,Y as u,Z as d,_ as f,b as p,n as m,q as h,y as g}from"./app-B7qSClfI.js";import{t as _}from"./i18n-CVEVRKD0.js";import{t as v}from"./AdminLayout-Cvx3XEZs.js";var y={class:`grid gap-6 lg:grid-cols-[300px_1fr]`},b={class:`rounded-2xl border border-line bg-surface p-6 text-center`},x={class:`relative mx-auto h-40 w-40`},S={class:`absolute inset-2 flex flex-col items-center justify-center rounded-full bg-surface`},C={class:`text-4xl font-extrabold text-ink`},w={class:`text-sm text-ink-2`},T={class:`mt-4 text-sm text-ink-2`},E={class:`space-y-6`},D={class:`rounded-2xl border border-line bg-surface p-5`},O={class:`mb-3 text-sm font-bold text-ink`},k={class:`divide-y divide-line`},A={class:`text-ink-2`},j={class:`flex items-center gap-3`},M={class:`font-mono text-ink-2`},N={class:`rounded-2xl border border-line bg-surface p-5`},P={class:`mb-3 text-sm font-bold text-ink`},F={class:`divide-y divide-line`},I={class:`text-ink-2`},L=t({__name:`Accessibility`,setup(t){let L=[{label:_(`Body text on background`),fg:`--c-text`,bg:`--c-bg`,min:4.5},{label:_(`Body text on cards`),fg:`--c-text`,bg:`--c-surface`,min:4.5},{label:_(`Secondary text on cards`),fg:`--c-text-2`,bg:`--c-surface`,min:4.5},{label:_(`Muted text on background`),fg:`--c-muted`,bg:`--c-bg`,min:3},{label:_(`White text on brand buttons`),fg:`#fff`,bg:`--c-primary`,min:4.5},{label:_(`Links/badges (brand on soft)`),fg:`--c-primary-700`,bg:`--c-primary-soft`,min:4.5}],R=[{label:_(`Keyboard navigation with visible focus rings`),status:`pass`},{label:_(`Semantic landmarks (header, nav, main)`),status:`pass`},{label:_(`Skip-to-content link`),status:`pass`},{label:_(`All form fields have labels`),status:`pass`},{label:_(`Light and dark themes available`),status:`pass`},{label:_(`Respects “reduce motion” preference`),status:`pass`},{label:_(`Alt text captured on uploaded images`),status:`todo`},{label:_(`Full screen-reader audit (ARIA roles)`),status:`partial`}],z=h([]);function B(e){if(e===`#fff`)return[255,255,255];let t=getComputedStyle(document.documentElement).getPropertyValue(e).trim().split(/\s+/).map(Number);return t.length===3&&t.every(e=>!Number.isNaN(e))?t:[0,0,0]}function V(e){let t=e.map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*t[0]+.7152*t[1]+.0722*t[2]}function H(e,t){let n=V(B(e)),r=V(B(t)),[i,a]=n>r?[n,r]:[r,n];return(i+.05)/(a+.05)}o(()=>{z.value=L.map(e=>{let t=H(e.fg,e.bg);return{label:e.label,ratio:Math.round(t*100)/100,min:e.min,ok:t>=e.min}})});let U=g(()=>{let e=z.value.filter(e=>e.ok).length,t=z.value.length||1,n=R.filter(e=>e.status===`pass`).length,r=R.filter(e=>e.status===`partial`).length,i=e+n+r*.5,a=t+R.length;return Math.round(i/a*100)}),W=g(()=>U.value>=90?_(`Excellent`):U.value>=75?_(`Good`):U.value>=50?_(`Fair`):_(`Needs work`)),G=g(()=>`conic-gradient(rgb(16 185 129) ${U.value*3.6}deg, rgba(255,255,255,0.08) 0deg)`),K=e=>e===`pass`?`bg-emerald-500/20 text-emerald-400`:e===`partial`?`bg-amber-500/20 text-amber-400`:`bg-slate-500/20 text-ink-2`,q=e=>_(e===`pass`?`Pass`:e===`partial`?`Partial`:`To do`);return(t,o)=>(r(),e(f,null,[n(u(m),{title:u(_)(`Admin · Accessibility`)},null,8,[`title`]),n(v,null,{title:i(()=>[c(s(u(_)(`Accessibility`)),1)]),subtitle:i(()=>[c(s(u(_)(`WCAG / ADA compliance for your live theme`)),1)]),default:i(()=>[p(`div`,y,[p(`div`,b,[p(`div`,x,[p(`div`,{class:`h-40 w-40 rounded-full`,style:d({background:G.value})},null,4),p(`div`,S,[p(`span`,C,s(U.value)+`%`,1),p(`span`,w,s(W.value),1)])]),p(`p`,T,s(u(_)(`Compliance score across contrast + best practices. Adjust theme colors to improve contrast.`)),1)]),p(`div`,E,[p(`section`,D,[p(`h3`,O,s(u(_)(`Color contrast (live theme)`)),1),p(`ul`,k,[(r(!0),e(f,null,a(z.value,t=>(r(),e(`li`,{key:t.label,class:`flex items-center justify-between py-2.5 text-sm`},[p(`span`,A,s(t.label),1),p(`span`,j,[p(`span`,M,s(t.ratio)+`:1`,1),p(`span`,{class:l([`rounded-full px-2 py-0.5 text-xs font-semibold`,t.ok?`bg-emerald-500/20 text-emerald-400`:`bg-red-500/20 text-red-400`])},s(t.ok?u(_)(`AA`):u(_)(`Fail`)),3)])]))),128))])]),p(`section`,N,[p(`h3`,P,s(u(_)(`Best practices`)),1),p(`ul`,F,[(r(),e(f,null,a(R,e=>p(`li`,{key:e.label,class:`flex items-center justify-between py-2.5 text-sm`},[p(`span`,I,s(e.label),1),p(`span`,{class:l([`rounded-full px-2 py-0.5 text-xs font-semibold`,K(e.status)])},s(q(e.status)),3)])),64))])])])])]),_:1})],64))}});export{L as default};