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-WqReGThm.js";import{t as _}from"./AdminLayout-wofK_x5r.js";var v={class:`grid gap-6 lg:grid-cols-[300px_1fr]`},y={class:`rounded-2xl border border-line bg-surface p-6 text-center`},b={class:`relative mx-auto h-40 w-40`},x={class:`absolute inset-2 flex flex-col items-center justify-center rounded-full bg-surface`},S={class:`text-4xl font-extrabold text-ink`},C={class:`text-sm text-ink-2`},w={class:`space-y-6`},T={class:`rounded-2xl border border-line bg-surface p-5`},E={class:`divide-y divide-line`},D={class:`text-ink-2`},O={class:`flex items-center gap-3`},k={class:`font-mono text-ink-2`},A={class:`rounded-2xl border border-line bg-surface p-5`},j={class:`divide-y divide-line`},M={class:`text-ink-2`},N=t({__name:`Accessibility`,setup(t){let N=[{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}],P=[{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`}],F=h([]);function I(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 L(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 R(e,t){let n=L(I(e)),r=L(I(t)),[i,a]=n>r?[n,r]:[r,n];return(i+.05)/(a+.05)}o(()=>{F.value=N.map(e=>{let t=R(e.fg,e.bg);return{label:e.label,ratio:Math.round(t*100)/100,min:e.min,ok:t>=e.min}})});let z=g(()=>{let e=F.value.filter(e=>e.ok).length,t=F.value.length||1,n=P.filter(e=>e.status===`pass`).length,r=P.filter(e=>e.status===`partial`).length,i=e+n+r*.5,a=t+P.length;return Math.round(i/a*100)}),B=g(()=>z.value>=90?`Excellent`:z.value>=75?`Good`:z.value>=50?`Fair`:`Needs work`),V=g(()=>`conic-gradient(rgb(16 185 129) ${z.value*3.6}deg, rgba(255,255,255,0.08) 0deg)`),H=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`,U=e=>e===`pass`?`Pass`:e===`partial`?`Partial`:`To do`;return(t,o)=>(r(),e(f,null,[n(u(m),{title:`Admin · Accessibility`}),n(_,null,{title:i(()=>[...o[0]||=[c(`Accessibility`,-1)]]),subtitle:i(()=>[...o[1]||=[c(`WCAG / ADA compliance for your live theme`,-1)]]),default:i(()=>[p(`div`,v,[p(`div`,y,[p(`div`,b,[p(`div`,{class:`h-40 w-40 rounded-full`,style:d({background:V.value})},null,4),p(`div`,x,[p(`span`,S,s(z.value)+`%`,1),p(`span`,C,s(B.value),1)])]),o[2]||=p(`p`,{class:`mt-4 text-sm text-ink-2`},`Compliance score across contrast + best practices. Adjust theme colors to improve contrast.`,-1)]),p(`div`,w,[p(`section`,T,[o[3]||=p(`h3`,{class:`mb-3 text-sm font-bold text-ink`},`Color contrast (live theme)`,-1),p(`ul`,E,[(r(!0),e(f,null,a(F.value,t=>(r(),e(`li`,{key:t.label,class:`flex items-center justify-between py-2.5 text-sm`},[p(`span`,D,s(t.label),1),p(`span`,O,[p(`span`,k,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?`AA`:`Fail`),3)])]))),128))])]),p(`section`,A,[o[4]||=p(`h3`,{class:`mb-3 text-sm font-bold text-ink`},`Best practices`,-1),p(`ul`,j,[(r(),e(f,null,a(P,e=>p(`li`,{key:e.label,class:`flex items-center justify-between py-2.5 text-sm`},[p(`span`,M,s(e.label),1),p(`span`,{class:l([`rounded-full px-2 py-0.5 text-xs font-semibold`,H(e.status)])},s(U(e.status)),3)])),64))])])])])]),_:1})],64))}});export{N as default};