PageSourceSearch

https://app.webability.io/assets/DomainAnalyses-bQjWjSpS.js

js webability.io collected 2026-10-02 09:58:57 UTC 160,795 bytes, 97 lines download raw bytes

1import{r as p,aR as cn,j as e,R as dn,G as Ue,L as Xt}from"./vendor-CXh69xiq.js";import{c as Z,ba as un,P as bt,Q as yt,N as wt,U as vt,Z as jt,a6 as mn,T as hn,V as es,W as et,u as pn,aL as xn,aK as fn,i as ye,n as tt}from"./index-BVVRvbjs.js";import{F as kt}from"./Favicon-BLYmuA4y.js";import{t as Lt,A as gn}from"./app-vendor-nlFuy7bi.js";import{u as bn,S as yn}from"./useStateManager-7e1e8489.esm-CZ--1W1H.js";import{M as fs,u as wn}from"./Modal-BmPxbOG5.js";import{V as gs}from"./LivePagePreviewModal-Dg48NYFC.js";import{C as vn}from"./code-DQE-Ikto.js";import{Z as bs}from"./zap-DqWbjZ1W.js";import{L as jn}from"./layout-dashboard-DdTjPSIR.js";import{L as kn}from"./link-rlNsL98i.js";import{m as Me,A as Nt}from"./motion-BljJOqSN.js";import{A as Nn}from"./arrow-right-CnOpxMeR.js";import{S as _n}from"./SuggestedFixCard-DyHip5ux.js";import{D as Cn}from"./download-CnPFzK3c.js";import{S as Sn}from"./sparkles-C4lP0XRg.js";import"./rotate-ccw-DZk31c-h.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"app-build-1790920293420"};var n=new t.Error().stack;
1n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="b1c61e1f-31b8-43c8-9323-1fbe1b420d61",t._sentryDebugIdIdentifier="sentry-dbid-b1c61e1f-31b8-43c8-9323-1fbe1b420d61")}catch{}})();/**
2 * @license lucide-react v0.511.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const An=[["path",{d:"M21 14h-5",key:"1vh23k"}],["path",{d:"M16 16v-3.5a2.5 2.5 0 0 1 5 0V16",key:"1wh10o"}],["path",{d:"M4.5 13h6",key:"dfilno"}],["path",{d:"m3 16 4.5-9 4.5 9",key:"2dxa0e"}]],Mn=Z("a-large-small",An);/**
7 * @license lucide-react v0.511.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Ln=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],Fn=Z("braces",Ln);/**
12 * @license lucide-react v0.511.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const $n=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 18a6 6 0 0 0 0-12v12z",key:"j4l70d"}]],Tn=Z("contrast",$n);/**
17 * @license lucide-react v0.511.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const En=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Rn=Z("earth",En);/**
22 * @license lucide-react v0.511.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const In=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],On=Z("file-spreadsheet",In);/**
27 * @license lucide-react v0.511.0 - ISC
28 *
29 * This source code is licensed under the ISC license.
30 * See the LICENSE file in the root directory of this source tree.
31 */const Bn=[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]],Wn=Z("frame",Bn);/**
32 * @license lucide-react v0.511.0 - ISC
33 *
34 * This source code is licensed under the ISC license.
35 * See the LICENSE file in the root directory of this source tree.
36 */const zn=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Dn=Z("image",zn);/**
37 * @license lucide-react v0.511.0 - ISC
38 *
39 * This source code is licensed under the ISC license.
40 * See the LICENSE file in the root directory of this source tree.
41 */const Pn=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],Gn=Z("keyboard",Pn);/**
42 * @license lucide-react v0.511.0 - ISC
43 *
44 * This source code is licensed under the ISC license.
45 * See the LICENSE file in the root directory of this source tree.
46 */const Un=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],Vn=Z("languages",Un);/**
47 * @license lucide-react v0.511.0 - ISC
48 *
49 * This source code is licensed under the ISC license.
50 * See the LICENSE file in the root directory of this source tree.
51 */const Hn=[["path",{d:"M13 13.74a2 2 0 0 1-2 0L2.5 8.87a1 1 0 0 1 0-1.74L11 2.26a2 2 0 0 1 2 0l8.5 4.87a1 1 0 0 1 0 1.74z",key:"15q6uc"}],["path",{d:"m20 14.285 1.5.845a1 1 0 0 1 0 1.74L13 21.74a2 2 0 0 1-2 0l-8.5-4.87a1 1 0 0 1 0-1.74l1.5-.845",key:"byia6g"}]],qn=Z("layers-2",Hn);/**
52 * @license lucide-react v0.511.0 - ISC
53 *
54 * This source code is licensed under the ISC license.
55 * See the LICENSE file in the root directory of this source tree.
56 */const Jn=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]],Kn=Z("layout-list",Jn);/**
57 * @license lucide-react v0.511.0 - ISC
58 *
59 * This source code is licensed under the ISC license.
60 * See the LICENSE file in the root directory of this source tree.
61 */const Yn=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],ys=Z("layout-template",Yn);/**
62 * @license lucide-react v0.511.0 - ISC
63 *
64 * This source code is licensed under the ISC license.
65 * See the LICENSE file in the root directory of this source tree.
66 */const Qn=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v2",key:"stiyo7"}],["path",{d:"M12 13h.01",key:"y0uutt"}]],Zn=Z("message-square-warning",Qn);/**
67 * @license lucide-react v0.511.0 - ISC
68 *
69 * This source code is licensed under the ISC license.
70 * See the LICENSE file in the root directory of this source tree.
71 */const Xn=[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]],er=Z("shapes",Xn);/**
72 * @license lucide-react v0.511.0 - ISC
73 *
74 * This source code is licensed under the ISC license.
75 * See the LICENSE file in the root directory of this source tree.
76 */const tr=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],sr=Z("table",tr);/**
77 * @license lucide-react v0.511.0 - ISC
78 *
79 * This source code is licensed under the ISC license.
80 * See the LICENSE file in the root directory of this source tree.
81 */const nr=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],rr=Z("tag",nr);/**
82 * @license lucide-react v0.511.0 - ISC
83 *
84 * This source code is licensed under the ISC license.
85 * See the LICENSE file in the root directory of this source tree.
86 */const ir=[["path",{d:"M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6",key:"1528k5"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1",key:"1mj8rg"}],["path",{d:"M9 6v12",key:"velyjx"}]],or=Z("text-cursor-input",ir);/**
87 * @license lucide-react v0.511.0 - ISC
88 *
89 * This source code is licensed under the ISC license.
90 * See the LICENSE file in the root directory of this source tree.
91 */const ar=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],lr=Z("video",ar);var cr=p.forwardRef(function(t,n){var s=bn(t);return p.createElement(yn,cn({ref:n},s))}),ts=cr;const ws={applied:"Applied (live on page)",pending_review:"Pending review (NOT on page)",rejected:"Rejected (not applied)"};function nt(t){const n=t==null?void 0:t.action;return n==="review"?"pending_review":n==="deleted"?"rejected":"applied"}const vs={all:"All statuses (applied + pending review + rejected)",active:"Applied only",deleted:"Rejected only",review:"Pending review only"},Ct=["status","page_url","selector","issue_type","wcag","impact","category","model","description","current_value","suggested_fix","attributes","applies_to_pages"],dr=new Set(["page_url"]),ur=new Set(["confidence"]);function St({fix:t,url:n},s){if(s==="page_url")return n??"";if(s==="status")return ws[nt(t)];if(s==="wcag")return String((t==null?void 0:t.wcag)??(t==null?void 0:t.wcag_criteria)??"");const i=t==null?void 0:t[s];return i==null?"":typeof i=="object"?JSON.stringify(i):String(i)}function js(t){const n={applied:0,pending_review:0,rejected:0};for(const s of t)n[nt(s.fix)]+=1;return n}function Ft(t,n,s){const i=js(t),o=(s==null?void 0:s.status)??"all",c=[`Site: ${n||"this site"}`,`Generated: ${ks()}`,`Status filter: ${vs[o]??o}`];return s&&(c.push(`Page filter: ${s.page&&s.page!=="all"?s.page:"No page selected"}`,`Impact filter: ${!s.impact||s.impact==="all"?"All impacts":s.impact}`,`Category filter: ${!s.category||s.category==="all"?"All categories":s.category}`),s.hideEmptyReview&&c.push("Empty-value review fixes: HIDDEN (rows excluded from this file)")),c.push(`Rows in this file: ${t.length} (applied ${i.applied}; pending review ${i.pending_review}; rejected ${i.rejected})`),typeof(s==null?void 0:s.distinctFixes)=="number"&&s.distinctFixes!==t.length&&c.push(`Distinct fixes: ${s.distinctFixes} (review rows are page-multiplied; this is the number the dashboard shows)`),o!=="all"&&c.push("NOTE: this is a FILTERED export and is not the complete fix record for this site."),s!=null&&s.hideEmptyReview&&c.push("NOTE: review fixes with no generated value yet were excluded from this file."),i.pending_review>0&&c.push('NOTE: rows marked "Pending review" have NOT been applied to the live page.'),c}function ks(t=new Date){const n=g=>String(g).padStart(2,"0"),s=-t.getTimezoneOffset(),i=s<0?"-":"+",o=n(Math.floor(Math.abs(s)/60)),c=n(Math.abs(s)%60);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())} ${i}${o}:${c}`}function ss(t){return`"${t.replace(/"/g,'""')}"`}function mr(t){return`# ${t.replace(/[\r\n]+/g," ").replace(/,/g,";")}`}function hr(t,n="",s){const i=t.length===0?Ct.slice():Ct.filter(x=>dr.has(x)||t.some(h=>St(h,x)!=="")),o=Ft(t,n,s).map(mr),c=i.map(x=>ss(x)).join(","),g=t.map(x=>i.map(h=>ss(St(x,h))).join(","));return[...o,"",c,...g].join(`\r
92`)}function pr(t,n,s){const i=t.map(({fix:c,url:g})=>{const x={status:nt(c),status_label:ws[nt(c)],page_url:g??""};for(const[h,F]of Object.entries(c??{}))h.startsWith("_")||ur.has(h)||(x[h]=F);return x}),o=(s==null?void 0:s.status)??"all";return JSON.stringify({domain:n,generated_at:ks(),export_scope:{status_filter:o,status_filter_label:vs[o]??o,page_filter:(s==null?void 0:s.page)??"all",impact_filter:(s==null?void 0:s.impact)??"all",category_filter:(s==null?void 0:s.category)??"all",hide_empty_review:(s==null?void 0:s.hideEmptyReview)??!1,is_filtered:o!=="all"||(s==null?void 0:s.hideEmptyReview)===!0},status_counts:js(t),total_fixes:t.length,distinct_fixes:(s==null?void 0:s.distinctFixes)??t.length,notices:Ft(t,n,s).filter(c=>c.startsWith("NOTE:")),fixes:i},null,2)}function xr(t,n,s){const i=[`# WebAbility — automated accessibility fixes for ${n}`,"","The list below describes automated client-side WCAG fixes that the","WebAbility enhancer applies at runtime on the live page. These are runtime","adjustments, NOT source-code remediation. Use them to understand what the","enhancer 
92changed and to plan any deeper source-level accessibility work.","",'Each fix carries a `status`. Only "Applied" fixes are live on the page;','"Pending review" fixes have been generated but NOT applied, and "Rejected"',"fixes were turned off. Do not treat a pending or rejected fix as remediated.","","## Export scope","",...Ft(t,n,s).map(c=>`- ${c}`),"","---",""].join(`
93`),o=t.map((c,g)=>{const x=[`## Fix ${g+1}`];for(const h of Ct){const F=St(c,h);F&&x.push(`- ${h}: ${F}`)}return x.join(`
94`)});return i+o.join(`
95
96`)+`
97`}function ns(t,n){const s=new Date,i=`${s.getFullYear()}${String(s.getMonth()+1).padStart(2,"0")}${String(s.getDate()).padStart(2,"0")}`;return`webability-fixes-${t.replace(/[^a-z0-9.-]/gi,"_")}-${i}.${n}`}function rs(t,n,s){const i=new Blob([n],{type:`${s};charset=utf-8`}),o=URL.createObjectURL(i),c=document.createElement("a");c.href=o,c.download=t,c.click(),URL.revokeObjectURL(o)}const fr="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",gr="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z";function Ns({title:t,subtext:n,isError:s,undo:i,toastId:o}){return e.jsxs("div",{className:"bg-white rounded-xl shadow-[0_4px_20px_rgba(0,0,0,0.17)] px-5 py-4 w-[min(380px,calc(100vw-48px))]",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("svg",{className:"w-5 h-5 shrink-0",viewBox:"0 0 20 20",fill:s?"#dc2626":"#16a34a","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:s?gr:fr})}),e.jsx("p",{className:"font-bold text-[15px] leading-5 text-gray-900",children:t})]}),n&&e.jsx("p",{className:"text-[13px] leading-5 text-gray-500 mt-0.5 ml-[30px]",children:n}),e.jsxs("div",{className:"flex justify-end items-center gap-2 mt-5",children:[e.jsx("button",{type:"button",onClick:()=>Lt.dismiss(o),className:"px-2.5 py-[3px] text-xs font-medium rounded-md border border-gray-700 text-gray-900 hover:bg-gray-50 transition-colors",children:"Dismiss"}),i&&e.jsx("button",{type:"button",onClick:()=>i(o),className:"px-2.5 py-1 text-xs font-semibold rounded-md text-white hover:opacity-90 transition-opacity",style:{backgroundColor:"#0052CC"},children:"Undo"})]})]})}function Ee(t){const{kind:n,title:s,subtext:i,undo:o}=t,c=n==="error";return Lt.custom(g=>e.jsx(Ns,{title:s,subtext:i,isError:c,undo:o,toastId:g}),{duration:c?5e3:6e3})}function is(t,n){const s=n.kind==="error";Lt.custom(i=>e.jsx(Ns,{title:n.title,subtext:n.subtext,isError:s,toastId:i}),{id:t,duration:s?5e3:6e3})}function br({exportItems:t,exportDomain:n,exportScope:s,setExportMenuOpen:i,t:o}){return{handleExportCSV:()=>{rs(ns(n,"csv"),hr(t,n,s),"text/csv"),i(!1),Ee({kind:"success",title:o("AutoFixes.export.toast_csv"),subtext:o("AutoFixes.export.toast_csv_sub")})},handleExportJSON:()=>{rs(ns(n,"json"),pr(t,n,s),"application/json"),i(!1),Ee({kind:"success",title:o("AutoFixes.export.toast_json"),subtext:o("AutoFixes.export.toast_json_sub")})},handleCopyForAI:async()=>{try{await navigator.clipboard.writeText(xr(t,n,s)),Ee({kind:"success",title:o("AutoFixes.export.toast_copied"),subtext:o("AutoFixes.export.toast_copied_sub")})}catch{Ee({kind:"error",title:o("AutoFixes.export.toast_copy_failed"),subtext:o("AutoFixes.export.toast_copy_failed_sub")})}i(!1)}}}function _s(t){if(typeof t!="string")return null;const n=t.replace(/:nth-(?:of-type|child)\(\d+\)/g,"").replace(/\s+/g," ").trim();return!n||/[>+~]\s*[>+~]|^\s*[>+~]|[>+~]\s*$/.test(n)||n.split(/\s*[>+~]\s*|\s+/).some(i=>i.length===0)?null:n}function yr(t){const n=t==null?void 0:t.attributes;if(n&&typeof n=="object")return Object.keys(n).sort().join(",");const s=t==null?void 0:t.attribute;return typeof s=="string"?s:""}function it(t){const n=t==null?void 0:t.attributes;if(n&&typeof n=="object"){const i=Object.keys(n);if(i.length===1)return i[0];const o=i.filter(c=>c&&c!=="class");return o.length===1?o[0]:null}const s=t==null?void 0:t.attribute;return typeof s=="string"?s:null}function ot(t){const n=it(t);if(n){const i=t==null?void 0:t.attributes;if(i&&typeof i=="object"&&n in i){const o=i[n];
97return typeof o=="string"?o:o==null?null:String(o)}}const s=t==null?void 0:t.value;return typeof s=="string"?s:null}function le(t){const n=ot(t);return n==null||n.trim()===""}function wr(t){const n=it(t),s=ot(t);return n==null||s==null?null:`${n}\0${s}`}function He(t,n,s){const i=(t==null?void 0:t.issue_type)||"unknown",o=_s(t==null?void 0:t.selector);if(o)return`s:${i}|${yr(t)}|${o}`;const c=t==null?void 0:t._manifestId;return c!=null?`m:${c}`:`i:${n}:${s}`}function os(t,n,s){return He(t,n,s)}const vr=new Set(["deferred","ai-failed"]);function jr(t){if((t==null?void 0:t.action)!=="review")return null;if(!le(t))return"actionable";const n=typeof(t==null?void 0:t.model)=="string"?t.model:"";return vr.has(n)?"queued_for_ai":"needs_human"}function st(t){const n=new Set;for(const s of t)n.add(He(s.fix,s.url,s.fixIndex));return n.size}const as={actionable:0,queued_for_ai:1,needs_human:2};function kr(t){const n=new Map;for(const i of t){const o=jr(i.fix);if(!o)continue;const c=He(i.fix,i.url,i.fixIndex),g=n.get(c);(!g||as[o]<as[g])&&n.set(c,o)}const s={actionable:0,queuedForAi:0,needsHuman:0};for(const i of n.values())i==="actionable"?s.actionable++:i==="queued_for_ai"?s.queuedForAi++:s.needsHuman++;return s}const Nr={missing_alt:{title:"Missing image alt text",description:"This image has no alt text. Screen readers cannot describe it to blind users."},decorative_icon:{title:"Decorative icon (hidden from assistive tech)",description:"This icon is purely visual. Marking it as decorative prevents screen readers from announcing meaningless markup."},empty_link:{title:"Link missing accessible name",description:"This link has no visible text or aria-label. Screen readers cannot describe where it goes."},weak_link_name:{title:"Vague link text",description:'Link text like "click here" or "read more" is meaningless without context. Improve it for screen reader users.'},new_window_link:{title:"Link opens new window — needs warning",description:'Add "(opens in new window)" so users know the link will leave their current context.'},adjacent_identical_links:{title:"Duplicate adjacent links",description:"Two consecutive links point to the same destination. Screen readers announce both, which is repetitive."},image_text_adjacent_links:{title:"Same-target image and text links",description:"An image link and text link point to the same place. Hide the image one from assistive tech."},unlabeled_button:{title:"Button missing accessible name",description:'This button has no text or aria-label. Screen readers announce only "button" with no purpose.'},weak_button_name:{title:"Generic button label",description:'Replace generic labels like "Click" or "Submit" with descriptive ones that explain the action.'},button_type_missing:{title:"Button missing type attribute",description:'Without type="button", a button inside a form may unexpectedly submit it.'},missing_button_type:{title:"Button missing type attribute",description:'Without type="button", a button inside a form may unexpectedly submit it.'},missing_button_role:{title:"Clickable element missing button role",description:'A non-button element with click handlers needs role="button" + tabindex="0" so keyboard users can activate it.'},label_in_name:{title:"Visible text not in accessible name",description:"WCAG 2.5.3: voice-control users can't activate this control because the visible text doesn't match the aria-label."},target_too_small:{title:"Touch target too small",description:"Interactive controls should be at least 24×24 CSS pixels for users with motor impairments."},missing_label:{title:"Form field missing label",description:"This input has no associated <label> or aria-label. Screen reader users won't know what to enter."},missing_fieldset_legend:{title:"Form group missing label",description:"Group of related controls needs a fieldset/legend or aria-label so users know what they're filling out."},identify_input_purpose:{title:"Input missing autocomplete",description:"Common fields (name, email, address) should have autocomplete attributes for autofill and assistive tech."},combobox_name_missing:{title:"Combobox/select missing accessible name",description:"Comboboxes and dropdowns need a label so users know what value they're selecting."},auto_submit_on_change:{title:"Form auto-submits on change",description:"WCAG 3.2.2: form changes shouldn't cause unexpected submissions or page navigation. Add a confirm step."},missing_pattern_title:{title:"Input pattern needs explanation",description:"Inputs with a pattern attribute should explain the expected format via title."},svg_missing_name:{title:"SVG missing accessible name",description:"This SVG icon has no aria-label and isn't marked decorative. Screen readers cannot describe it."},weak_svg_name:{title:"Vague SVG label",description:`Replace generic labels like "icon" with the SVG's actual purpose.`},weak_heading:{title:"Vague heading",description:'Headings should describe the section content, not generic words like "Welcome" or "Section".'}
97,heading_skip:{title:"Heading levels skipped",description:"Heading levels jump (e.g., h2 to h4). Skipping levels confuses screen reader navigation."},missing_h1:{title:"No H1 on page",description:"Every page should have exactly one H1 to identify its main topic."},multiple_h1:{title:"Multiple H1 elements",description:"A page should have one H1. Demote others to H2 or use aria-level."},empty_heading:{title:"Empty heading",description:"This heading element has no text. Either add content or remove the heading."},missing_heading_semantics:{title:"Visual heading missing semantic role",description:'This element looks like a heading but has no role="heading". Add aria-level for screen readers.'},weak_page_title:{title:"Page title not descriptive",description:"Replace generic page titles with ones that describe the specific page content."},missing_landmark:{title:"Missing page landmark",description:"Pages should have main, nav, banner, and contentinfo landmarks for keyboard navigation."},landmark_duplicate_unlabeled:{title:"Duplicate landmarks need unique labels",description:"Multiple landmarks of the same type (e.g. two <nav>) need aria-labels to distinguish them."},unlabeled_navigation:{title:"Navigation missing label",description:"Add aria-label so users know if this is main, footer, breadcrumb, or pagination navigation."},redundant_role:{title:"Redundant role attribute",description:`This role duplicates the element's implicit role (e.g. role="button" on <button>). Remove it.`},structural_section_no_heading:{title:"Section/article missing heading",description:"Sectioning elements should contain a heading or be labeled with aria-label."},missing_skip_link:{title:"No skip-to-content link",description:"Keyboard users need a skip link as the first focusable element to bypass repeated navigation."},invalid_aria_role:{title:"Invalid ARIA role",description:"This role isn't a valid WAI-ARIA value. Screen readers will ignore it or behave unpredictably."}
97,aria_hidden_focusable:{title:"Focusable element hidden from screen readers",description:'Element has aria-hidden="true" but is keyboard-focusable. Keyboard users will land on an "invisible" control.'},broken_aria_reference:{title:"Broken aria-labelledby/describedby reference",description:"aria-labelledby points to an ID that doesn't exist on the page, leaving the element unlabeled."},aria_live_status_message:{title:"Status region missing aria-live",description:"Dynamic notifications, toasts, and status messages need aria-live so screen readers announce them."},missing_live_region:{title:"Cart count / badge missing aria-live",description:'Counters and badges that update need aria-live="polite" so the change is announced.'},missing_dialog_role:{title:"Modal missing dialog role",description:'Cart drawers, modals, and popups need role="dialog" + aria-modal so screen readers identify them.'},missing_tablist_role:{title:"Tab container missing role",description:'A tab UI needs role="tablist" on the container for proper screen reader navigation.'},missing_tab_role:{title:"Tab button missing role + state",description:'Tabs need role="tab" and aria-selected so users know which tab is active.'},missing_popup_trigger:{title:"Popup trigger missing aria-haspopup",description:"Buttons that open menus, dialogs, or listboxes need aria-haspopup so users know."},missing_carousel_role:{title:"Carousel missing accessible role",description:'Auto-rotating content needs role="region" + aria-roledescription="carousel" + a label.'},missing_media_controls:{title:"Video/audio missing captions or controls",description:"Media must have captions, transcripts, or pause controls for users who can't hear or need to stop autoplay."},contrast_insufficient:{title:"Low color contrast",description:"Text doesn't meet WCAG AA contrast ratio. Users with low vision may not be able to read it."},missing_lang:{title:"Missing page language",description:"Without lang on <html>, screen readers may pronounce content incorrectly."},missing_table_header:{title:"Data table missing header cells",description:"Add <th> elements with scope so screen readers can announce column/row headers."},missing_table_caption:{title:"Data table missing caption",description:"A <caption> describes the table's purpose to screen reader users."},weak_iframe_title:{title:"Iframe missing/generic title",description:"Each iframe needs a unique title so screen readers can identify its content."},duplicate_id:{title:"Duplicate element ID",description:"IDs must be unique. Duplicates break aria-labelledby/for references and confuse the page structure."},positive_tabindex:{title:"Positive tabindex disrupts focus order",description:"tabindex values > 0 disrupt natural keyboard navigation. Use 0 or -1."},scrollable_not_focusable:{title:"Scrollable region not keyboard-accessible",description:'Scrollable areas need tabindex="0" so keyboard users can scroll them.'},zoom_restriction:{title:"Page restricts zoom",description:"meta viewport with user-scalable=no or maximum-scale<2 prevents low-vision users from zooming in."},javascript_link:{title:"JavaScript-only link",description:'Links with href="javascript:" or # are inaccessible to keyboard users when JS fails.'},nested_interactive:{title:"Nested interactive elements",description:"Buttons inside links (or vice versa) confuse screen readers and break keyboard navigation."},invalid_list_structure:{title:"Invalid list structure",description:"List items (<li>) must be inside <ul>/<ol>. Lists must contain only list items."},skip_link:{title:"No skip-to-content link",description:"Keyboard users need a skip link as the first focusable element to bypass repeated navigation."},aria_live:{title:"Status region missing aria-live",description:"Dynamic notifications and status messages need aria-live so screen readers announce updates."},nested_landmark:{title:"Nested landmarks",description:"Landmarks (main/nav/banner/etc.) shouldn't nest inside each other — flatten the structure."},missing_aria_required:{title:"Required field missing aria-required",description:'Required form fields should have aria-required="true" so screen readers announce them.'},missing_required_indicator:{title:"Required field missing visible indicator",description:"Required fields need both a visible asterisk/text and aria-required for clarity."},missing_semantic_role:{title:"Custom control missing semantic role",description:"Custom controls built from divs need an ARIA role so assistive tech understands their purpose."},on_input_change:{title:"Input change triggers context change",description:"WCAG 3.2.2: changes that disorient users (auto-submit, navigation) shouldn't happen on input."},onfocus_context_change:{title:"Focus triggers unexpected change",description:"WCAG 3.2.1: focusing an element shouldn't cause navigation, popup, or major layout change."},error_prevention_missing:{title:"No error prevention on submit",description:"Critical actions (delete, payment) need a confirm step so users can recover from mistakes."},missing_audio_description:{title:"Video missing audio description",description:"Videos with visual-only information need audio description for blind users."},missing_captions:{title:"Video missing captions",description:"Videos with audio need captions so deaf users can follow along."},missing_transcript:{title:"Audio/video missing transcript",description:"Provide a text transcript so users who can't play the media can still access the content."},unsafe_autoplay:{title:"Autoplay without controls",description:"Auto-playing media must have visible pause/stop controls for users who need to silence it."},animated_gif_no_pause:{title:"Animated content missing pause",description:"Animations longer than 5 seconds need a pause control for users with vestibular disorders."},flashing_content:{title:"Flashing content (seizure risk)",description:"Content flashing more than 3 times per second can trigger seizures. Reduce flash rate or warn users."},missing_table_scope:{title:"Table header missing scope",description:'<th> elements need scope="col" or scope="row" so screen readers map data to headers correctly.'},link_consistency:{title:"Inconsistent link text",description:"Same-purpose links should use consistent text across pages so users know what to expect."},inconsistent_navigation:{title:"Navigation order changes between pages",description:"WCAG 3.2.3: keep nav items in the same order on every page so users build muscle memory."},insufficient_navigation:{title:"Not enough ways to find content",description:"WCAG 2.4.5: provide at least two ways to reach pages (search, sitemap, links)."},external_link_warning:{title:"External link missing warning",description:"Links leaving the site should announce that they're external so users aren't surprised."},download_link_warning:{title:"Download link missing format",description:"Links to files (PDF, Word, etc.) should announce the file type and size."},placeholder_link:{title:"Empty placeholder link",description:'Links with href="#" or empty href do nothing on click and confuse keyboard users.'},color_only_link:{title:"Link distinguished by color only",description:"WCAG 1.4.1: links in text need underline or other non-color cue so colorblind users can spot them."}
97,adjacent_redundant_link:{title:"Duplicate adjacent links",description:"Two consecutive links pointing to the same destination get announced twice. Combine or hide one."},background_image_unlabeled:{title:"Meaningful background image not described",description:"CSS background images that convey meaning need an aria-label or visible text alternative."},image_of_text:{title:"Text rendered as image",description:"Use real text instead of images of text — screen readers can't read images, and they don't scale."},non_text_contrast_insufficient:{title:"UI element low contrast",description:"Buttons, borders, and icons need 3:1 contrast against adjacent colors for users with low vision."},reflow_overflow:{title:"Content doesn't reflow at 320px",description:"WCAG 1.4.10: content must reflow without horizontal scrolling at 320px viewport width."},text_spacing_blocked:{title:"Text spacing overrides blocked",description:"WCAG 1.4.12: respect users' line-height/letter-spacing overrides — don't lock them with !important."},semantic_emphasis:{title:"Bold/italic should use <strong>/<em>",description:"Visual <b>/<i> styles aren't announced by screen readers. Use <strong>/<em> for emphasis."},focus_not_visible:{title:"Focus indicator not visible",description:"Keyboard users need a clearly visible outline-solid when an element is focused."},focus_obscured_by_sticky:{title:"Focused element hidden behind sticky element",description:"When tabbing, the focused element gets covered by sticky headers/footers — adjust scroll-padding."},focus_order_disruption:{title:"Tab order doesn't match visual order",description:"Tab navigation should follow the visual reading order (top-to-bottom, left-to-right)."},meaningful_sequence:{title:"Reading order doesn't match visual order",description:"WCAG 1.3.2: when CSS hides, the underlying DOM order should still make sense to screen readers."},main_content_hidden:{title:"Main content hidden from screen readers",description:'aria-hidden="true" on a main content area blocks all of it from screen readers — remove it.'},auto_refresh:{title:"Page auto-refreshes",description:"Pages refreshing without user control disrupt users on slow connections or assistive tech."},character_key_shortcut:{title:"Character-key shortcut without modifier",description:'Single-key shortcuts (e.g. "S" to search) interfere with voice control. Require Ctrl or similar.'},motion_actuation:{title:"Feature requires device motion",description:"WCAG 2.5.4: alternative non-motion controls needed for users who can't shake/tilt the device."},motion_uncontrollable:{title:"Motion content cannot be paused",description:"Animations and transitions need a way to pause for users with vestibular disorders."},motion_without_reduced_motion:{title:"Animation ignores prefers-reduced-motion",description:"Respect the prefers-reduced-motion media query — disable or reduce animations for affected users."},orientation_lock:{title:"Orientation locked to portrait/landscape",description:"WCAG 1.3.4: don't restrict orientation unless essential — users may have devices mounted fixed."},pointer_cancellation:{title:"Action triggered on pointerdown",description:"WCAG 2.5.2: trigger actions on pointerup, not pointerdown, so users can abort by moving away."},pointer_gesture:{title:"Multi-finger gesture without alternative",description:"Pinch/swipe gestures need single-pointer alternatives for users with motor impairments."},sensory_characteristic:{title:"Instruction relies on shape/color/position only",description:'WCAG 1.3.3: instructions like "click the round red button" exclude blind/colorblind users.'}};function $t(t){if(!t)return{title:"Accessibility issue",description:""};const n=Nr[t];if(n)return n;const s=t.replace(/_/g," ");return{title:s.charAt(0).toUpperCase()+s.slice(1),description:""}}const _r={missing_alt:"1.1.1",decorative_icon:"1.1.1",svg_missing_name:"1.1.1",weak_svg_name:"1.1.1",background_image_unlabeled:"1.1.1",image_of_text:"1.4.5",empty_link:"2.4.4",weak_link_name:"2.4.4",new_window_link:"3.2.5",adjacent_identical_links:"2.4.4",image_text_adjacent_links:"2.4.4",placeholder_link:"2.4.4",color_only_link:"1.4.1",javascript_link:"2.1.1",adjacent_redundant_link:"2.4.4",external_link_warning:"3.2.5",download_link_warning:"2.4.4",link_consistency:"3.2.4",inconsistent_navigation:"3.2.3",insufficient_navigation:"2.4.5",unlabeled_button:"4.1.2",weak_button_name:"4.1.2",button_type_missing:"4.1.2",missing_button_type:"4.1.2",missing_button_role:"4.1.2",label_in_name:"2.5.3",target_too_small:"2.5.5",nested_interactive:"4.1.2",missing_label:"3.3.2",missing_fieldset_legend:"1.3.1",identify_input_purpose:"1.3.5",combobox_name_missing:"4.1.2",auto_submit_on_change:"3.2.2",missing_pattern_title:"3.3.2",missing_aria_required:"3.3.2",missing_required_indicator:"3.3.2",on_input_change:"3.2.2",onfocus_context_change:"3.2.1",error_prevention_missing:"3.3.4",weak_heading:"2.4.6",heading_skip:"1.3.1",missing_h1:"1.3.1",multiple_h1:"1.3.1",empty_heading:"1.3.1",missing_heading_semantics:"1.3.1",weak_page_title:"2.4.2",missing_landmark:"1.3.1",landmark_duplicate_unlabeled:"1.3.1",unlabeled_navigation:"1.3.1",redundant_role:"4.1.2",structural_section_no_heading:"1.3.1",missing_skip_link:"2.4.1",skip_link:"2.4.1",nested_landmark:"1.3.1",main_content_hidden:"1.3.1",meaningful_sequence:"1.3.2",invalid_aria_role:"4.1.2",aria_hidden_focu
97sable:"4.1.2",broken_aria_reference:"1.3.1",aria_live_status_message:"4.1.3",missing_live_region:"4.1.3",aria_live:"4.1.3",missing_semantic_role:"4.1.2",missing_dialog_role:"4.1.2",missing_tablist_role:"4.1.2",missing_tab_role:"4.1.2",missing_popup_trigger:"4.1.2",missing_carousel_role:"1.3.1",missing_media_controls:"1.2.1",missing_audio_description:"1.2.5",missing_captions:"1.2.2",missing_transcript:"1.2.1",unsafe_autoplay:"1.4.2",animated_gif_no_pause:"2.2.2",flashing_content:"2.3.1",contrast_insufficient:"1.4.3",non_text_contrast_insufficient:"1.4.11",reflow_overflow:"1.4.10",text_spacing_blocked:"1.4.12",semantic_emphasis:"1.3.1",zoom_restriction:"1.4.4",motion_actuation:"2.5.4",motion_uncontrollable:"2.2.2",motion_without_reduced_motion:"2.3.3",orientation_lock:"1.3.4",pointer_cancellation:"2.5.2",pointer_gesture:"2.5.1",sensory_characteristic:"1.3.3",focus_not_visible:"2.4.7",focus_obscured_by_sticky:"2.4.11",focus_not_obscured_enhanced:"2.4.11",focus_order_disruption:"2.4.3",positive_tabindex:"2.4.3",scrollable_not_focusable:"2.1.1",missing_lang:"3.1.1",missing_table_header:"1.3.1",missing_table_caption:"1.3.1",missing_table_scope:"1.3.1",weak_iframe_title:"4.1.2",duplicate_id:"4.1.1",invalid_list_structure:"1.3.1",auto_refresh:"2.2.1",character_key_shortcut:"2.1.4"};function Cs(t){return t?_r[t]??null:null}function Tt(t){if(!t)return null;if(typeof t=="object"){const c={};for(const[g,x]of Object.entries(t))x!=null&&(c[g]=String(x));return Object.keys(c).length?c:null}if(typeof t!="string")return null;const n=t.trim();if(!n)return null;if(n.startsWith("{"))try{const c=JSON.parse(n);if(c&&typeof c=="object")return Tt(c)}catch{}const s={},i=/(\w+)=("(?:[^"\\]|\\.)*"|\S+)/g;let o;for(;(o=i.exec(n))!==null;){let c=o[2];if(c.startsWith('"')&&c.endsWith('"'))try{c=JSON.parse(c)}catch{c=c.slice(1,-1)}s[o[1]]=c}return Object.keys(s).length?s:null}function Ge(t){if(!t)return null;const n=String(t).match(/[\d.]+/);if(!n)return null;const s=parseFloat(n[0]);return Number.isFinite(s)?s:null}function Ss(t,n){return t?t==="non_text_contrast_insufficient"?"This UI element fails AA contrast against its background for low-vision users. Adjust its color to meet the 3:1 ratio.":t==="contrast_insufficient"?n==="background"?"This text fails AA contrast against its background for low-vision users. Adjust the background color to meet AA contrast.":n==="text"?"This text fails AA contrast against its background for low-vision users. Adjust the text color to meet AA contrast.":"This text fails AA contrast against its background for low-vision users. Adjust the color to meet AA contrast.":null:null}function Cr({allFixes:t,selectedPage:n,filter:s,selectedImpact:i,selectedCategory:o,hideEmptyReview:c,sliderFixes:g,sliderUrl:x,sliderReviewCount:h,selectedDomain:F,selectedOptionValue:C}){const M=p.useMemo(()=>t.filter(({fix:v,url:m})=>!(n!=="all"&&m!==n||s==="active"&&v.action!=="update"||s==="deleted"&&v.action!=="deleted"||s==="review"&&v.action!=="review"||s==="review"&&c&&le(v)||i!=="all"&&(v.impact||"minor")!==i||o!=="all"&&(v.category||"other")!==o)),[t,n,s,i,o,c]),S=p.useMemo(()=>g.map(({fix:v,url:m})=>({url:m,fix:{...v,impact:v.impact||"minor",description:v.description||$t(v.issue_type).description}})),[g]),w=F||C||"site",u=p.useMemo(()=>({status:s,page:x||"all",impact:i,category:o,hideEmptyReview:s==="review"&&c,distinctFixes:h}),[s,x,i,o,c,h]);return{filteredFixes:M,exportItems:S,exportScope:u,exportDomain:w}}const re="#0052CC",Q={contrast:{Icon:Tn,bg:re},image:{Icon:Dn,bg:re},button:{Icon:un,bg:re}
97,form:{Icon:or,bg:re},link:{Icon:kn,bg:re},heading:{Icon:Mn,bg:re,iconClass:"w-6 h-6"},structure:{Icon:jn,bg:re},widget:{Icon:ys,bg:re},media:{Icon:lr,bg:re},motion:{Icon:bs,bg:re},focus:{Icon:Gn,bg:re},table:{Icon:sr,bg:re},lang:{Icon:Vn,bg:re},frame:{Icon:Wn,bg:re},aria:{Icon:vn,bg:re},fallback:{Icon:er,bg:re}},ls={meaningful_sequence:"structure",duplicate_id:"aria",label_in_name:"button",redundant_role:"aria"};function Sr(t){if(!t)return Q.fallback;const n=t.toLowerCase();if(ls[n])return Q[ls[n]];const s=(...i)=>i.some(o=>n.includes(o));return s("contrast")?Q.contrast:s("alt","image","svg","icon","background_image")?Q.image:s("button")?Q.button:s("label","input","form","field","combobox","fieldset","required","autocomplete","pattern")?Q.form:s("link","nav","skip")?Q.link:s("heading","h1","page_title","title")?Q.heading:s("landmark","section","list","sequence","structur")?Q.structure:s("dialog","tab","carousel","popup","tooltip","menu","widget")?Q.widget:s("media","video","audio","caption","transcript","autoplay")?Q.media:s("motion","animat","flash","gif","refresh","orientation","gesture","pointer")?Q.motion:s("focus","tabindex","keyboard","scrollable")?Q.focus:s("table")?Q.table:s("lang")?Q.lang:s("iframe","frame")?Q.frame:s("aria","role","live","semantic")?Q.aria:Q.fallback}const As=({issueType:t})=>{const{Icon:n,bg:s,iconClass:i}=Sr(t);return e.jsx("div",{className:"shrink-0 w-11 h-11 rounded-full flex items-center justify-center",style:{backgroundColor:s},children:e.jsx(n,{className:i??"w-5 h-5",strokeWidth:2.25,style:{color:"#ffffff"}})})};function Ar(t){return typeof t!="number"||Number.isNaN(t)?null:t>=.85?{label:"High",dot:"#166534",text:"#166534"}:t>=.7?{label:"Medium",dot:"#92400e",text:"#92400e"}:{label:"Low",dot:"#991b1b",text:"#991b1b"}}const Ms=({confidence:t,size:n="default"})=>{const s=Ar(t);return s?e.jsxs("span",{className:`group inline-flex items-center gap-1 rounded-full font-bold cursor-default border bg-white ${n==="sm"?"px-2.5 py-0.5 text-[11px]":"px-3 py-1 text-xs"}`,style:{color:s.text,borderColor:s.text},title:`Model confidence ${t.toFixed(2)} (self-reported triage aid)`,children:[e.jsx("span",{style:{width:8,height:8,minWidth:8,minHeight:8,borderRadius:"50%",backgroundColor:s.dot,flexShrink:0}}),"Confidence ",s.label,e.jsxs("span",{className:"overflow-hidden max-w-0 opacity-0 transition-all duration-200 ease-out group-hover:max-w-16 group-hover:opacity-100 inline-flex items-center whitespace-nowrap",children:[e.jsx("span",{style:{width:3,height:3,minWidth:3,minHeight:3,borderRadius:"50%",backgroundColor:s.dot,flexShrink:0,opacity:.5,marginLeft:4,alignSelf:"center"}}),e.jsx("span",{style:{marginLeft:5},children:t.toFixed(2)})]})]}):null},Mr={"1.1.1":"non-text-content","1.2.1":"audio-only-and-video-only-prerecorded","1.2.2":"captions-prerecorded","1.2.3":"audio-description-or-media-alternative-prerecorded","1.2.5":"audio-description-prerecorded","1.3.1":"info-and-relationships","1.3.2":"meaningful-sequence","1.3.3":"sensory-characteristics","1.3.4":"orientation","1.3.5":"identify-input-purpose","1.4.1":"use-of-color","1.4.3":"contrast-minimum","1.4.4":"resize-text","1.4.5":"images-of-text","1.4.10":"reflow","1.4.11":"non-text-contrast","1.4.12":"text-spacing","1.4.13":"content-on-hover-or-focus","2.1.1":"keyboard","2.2.2":"pause-stop-hide","2.3.1":"three-flashes-or-below-threshold","2.4.1":"bypass-blocks","2.4.2":"page-titled","2.4.4":"link-purpose-in-context","2.4.6":"headings-and-labels","2.4.7":"focus-visible","2.5.2":"pointer-cancellation","2.5.3":"label-in-name","2.5.4":"motion-actuation","2.5.5":"target-size-enhanced","3.1.1":"language-of-page","3.2.1":"on-focus","3.2.2":"on-input","3.2.3":"consistent-navigation","3.3.1":"error-identification","3.3.2":"labels-or-instructions","4.1.1":"parsing","4.1.2":"name-role-value","4.1.3":"status-messages"};function At(t){if(!t)return null;const n=String(t).match(/\d+\.\d+\.\d+/);return n?n[0]:null}function Ls(t){const n=At(t),s=n?Mr[n]:null;return s?`https://www.w3.org/WAI/WCAG21/Understanding/${s}.html`:"https://www.w3.org/WAI/WCAG21/Understanding/"}function rt(t){if(!t)return null;const n=t.trim(),s=n.match(/#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b/);if(s){let o=s[1];o.length===3&&(o=o.split("").map(g=>g+g).join(""));const c=parseInt(o,16);return[c>>16&255,c>>8&255,c&255]}const i=n.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);return i?[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10)]:null}function cs([t,n,s]){const i=o=>{const c=o/255;return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)};return .2126*i(t)+.7152*i(n)+.0722*i(s)}function Lr(t,n){const s=cs(t),i=cs(n),o=Math.max(s,i),c=Math.min(s,i);return(o+.05)/(c+.05)}function _t(t){if(!t)return null;const n=t.match(/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)/);return n?n[0]:null}function Fr(t,n,s){if(!t||!n||!s||s==="remove_attribute")return null;try{const o=new DOMParser().parseFromString(t,"text/html").querySelector(n);return o?o.getAttribute(s):null}catch{return null}}const Fs=({fix:t,onRemove:n,onRestore:s,isUpdating:i,pageHtml:o,url:c})=>{const g=t.action==="deleted",x=t.action==="review",h=$t(t.issue_type),F=Tt(t.context),C=t.wcag_criteria||t.wcag||Cs(t.issue_type)||void 0,M=t.issue_type==="contrast_insufficient"||t.issue_type==="non_text_contrast_insufficient",S=M?(()=>{const v=$s(t.attributes&&typeof t.attributes=="object"?t.attributes.style:void 0);return v.background&&!v.color?"background":"text"})():void 0,w=Ss(t.issue_type,S)||t.description||h.description,u=[t.source,t.model].filter(v=>v&&String(v).trim()).join(" + ");return e.jsxs("div",{className:"flex flex-col",children:[typeof t.applies_to_pages=="number"&&t.applies_to_pages>
971&&e.jsxs("span",{className:"self-start inline-flex items-center gap-1.5 px-3.5 pt-1.5 text-xs font-semibold",style:{marginBottom:-24,paddingBottom:30,color:"#ffffff",backgroundColor:"#000000",borderTopLeftRadius:14,borderTopRightRadius:14},children:[e.jsx(qn,{className:"w-3.5 h-3.5",strokeWidth:2.5}),"Applies to ",t.applies_to_pages," pages"]}),e.jsx("div",{className:"fix-card relative rounded-3xl w-full max-w-full bg-white",style:{border:"1.5px solid #000000",boxShadow:"0 4px 10px -4px rgba(0,0,0,0.28)"},children:e.jsxs("div",{className:"flex flex-col md:flex-row",children:[e.jsxs("div",{className:`flex flex-col gap-5 px-6 pt-6 pb-0 md:pb-6 md:w-[50%] ${g?"opacity-60":""}`,style:{borderRight:"1px solid rgba(0,0,0,0.16)"},children:[e.jsx(As,{issueType:t.issue_type}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h3",{className:"text-base md:text-lg font-bold wrap-break-word leading-snug",style:{color:"#000000"},children:h.title}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-xs font-bold uppercase tracking-wider",style:{backgroundColor:"#E8ECF5",color:"#000000",border:"1px solid hsl(var(--border))"},children:t.impact||"minor"}),C&&e.jsxs("a",{href:Ls(C),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 px-3 py-1 rounded-full text-xs font-bold uppercase tracking-wider hover:underline",style:{backgroundColor:"#E8ECF5",color:"#000000",border:"1px solid hsl(var(--border))"},title:`Open WCAG ${At(C)} (Understanding) in a new tab`,children:["WCAG ",At(C)||C,e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14 5h5v5m0-5L10 14M5 9v10h10"})})]}),e.jsx(Ms,{confidence:t.confidence})]})]}),w&&e.jsx("p",{className:"text-sm text-gray-800 leading-relaxed wrap-break-word line-clamp-4",children:w}),t.category&&e.jsxs("p",{className:"text-xs text-gray-700 flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"font-bold flex items-center gap-2 shrink-0",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"})}),"Category:"]}),e.jsx("span",{className:"break-all capitalize",children:t.category.replace(/_/g," ")})]}),t.selector&&e.jsxs("div",{className:"mt-auto",children:[e.jsxs("p",{className:"text-xs font-bold text-gray-700 mb-1.5 flex items-center gap-1.5",children:[e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),"Element Selector:"]}),e.jsx("div",{className:"rounded-lg px-3 py-2.5 overflow-x-auto",style:{backgroundColor:"#E8ECF5",border:"1px solid hsl(var(--border))"},children:e.jsx("code",{className:"text-xs break-all block",style:{color:"#000000",lineHeight:1.3,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:t.selector})})]})]}),e.jsxs("div",{className:"flex flex-col px-6 pt-5 pb-6 md:pt-6 md:w-[50%]",children:[e.jsxs("div",{className:`flex flex-col gap-5 mt-auto ${g?"opacity-60":""}`,children:[M&&!Ts(t)?e.jsx(Es,{fix:t,ctx:F}):e.jsx(Rs,{fix:t,pageHtml:o}),u&&e.jsxs("p",{className:"text-xs text-gray-700 flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"font-bold flex items-center gap-2 shrink-0",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Source:"]}),e.jsx("code",{className:"break-all",style:{fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:u})]})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 mt-4 flex-wrap",children:[e.jsx(gs,{url:c||"",selector:t.selector,attributes:t.attributes,title:(h==null?void 0:h.title)||t.issue_type}),e.jsx("div",{className:"flex justify-end gap-2 flex-wrap",children:g?e.jsxs("button",{onClick:s,disabled:i,className:"px-5 py-2.5 text-white text-sm font-bold rounded-lg disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",style:{backgroundColor:"#15803d"},children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Enable Auto-Fix"]}):x?e.jsx("span",{className:"px-5 py-2.5 text-sm font-bold rounded-lg flex items-center gap-2 text-amber-700 bg-amber-50 border border-amber-300",title:"Not applied yet. Approve or reject it under Needs Review.",children:"Awaiting review"}):e.jsxs("button",{onClick:n,disabled:i,className:"px-5 py-2.5 text-white text-sm font-bold rounded-lg disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",style:{backgroundColor:"#dc2626"},children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),"Disable Auto-Fix"]})})]})]})]})})]})};function $s(t){var o,c;if(!t)return{color:null,background:null};const n="#[0-9a-fA-F]{3,8}\\b|rgba?\\([^)]+\\)",s=((o=t.match(new RegExp(`background(?:-color)?\\s*:\\s*(${n})`,"i")))==null?void 0:o[1])||null;return{color:((c=t.match(new RegExp(`(?:^|;|\\s)color\\s*:\\s*(${n})`,"i")))==null?void 0:c[1])||null,background:s}}function Ts(t){var o;const n=t.issue_type==="contrast_insufficient"||t.issue_type==="non_text_contrast_insufficient",s=typeof((o=t.attributes)==null?void 0:o.style)=="str
97ing"?t.attributes.style:"",i=typeof t.context=="string"?t.context:"";return n&&/border/i.test(s+i)}function ds(t,n){const s=rt(t),i=rt(n);return s&&i?Lr(s,i):null}function $r(t){return Number(t.toFixed(2)).toString()}const Es=({fix:t,ctx:n,bare:s})=>{var ae,V,ue,me;const i=t.attributes&&typeof t.attributes=="object"?t.attributes:null,o=i==null?void 0:i.style,c=typeof t.context=="string"?t.context:"",g=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)/i,x=((ae=c.match(new RegExp(`Border:\\s*(${g.source})`,"i")))==null?void 0:ae[1])||null,h=((V=c.match(new RegExp(`Background:\\s*(${g.source})`,"i")))==null?void 0:V[1])||null,F=((ue=c.match(/contrast\s*([\d.]+)\s*:\s*1/i))==null?void 0:ue[1])||null,C=(n==null?void 0:n.fg)||x||t.current_value&&_t(t.current_value)||t.current_value||null,M=(n==null?void 0:n.bg)||h||null,S=$s(o),w=_t(n==null?void 0:n.suggested)||(n==null?void 0:n.suggested)||null,u=!!S.background&&!S.color,v=S.color||S.background||_t(o)||w||null,m=u?C:v||C,O=u&&v||M,A=t.issue_type==="non_text_contrast_insufficient",P=((me=c.match(/needs\s*([\d.]+)\s*:\s*1/i))==null?void 0:me[1])||null,L=Ge(n==null?void 0:n.needs)??Ge(n==null?void 0:n.threshold)??Ge(P||void 0)??(A?3:4.5),te=Ge(n==null?void 0:n.ratio)??Ge(F||void 0)??ds(C,M),a=ds(m,O),k=te!=null?te>=L:!1,$=a!=null?a>=L:!1,U=({fg:_,bg:K})=>{const ce=_&&rt(_),pe=K&&rt(K);if(!ce&&!pe)return null;const Re=pe?K:"#ffffff",_e=ce?_:"#111827";return e.jsx("span",{className:"inline-flex items-center justify-center rounded-xs border border-input shrink-0",style:{backgroundColor:Re,width:54,height:40},title:`${_||"?"} on ${K||"unknown background"}`,children:A?e.jsx("span",{style:{color:_e,fontSize:20,lineHeight:1},children:"★"}):e.jsx("span",{style:{color:_e,fontWeight:700,fontSize:16,lineHeight:1},children:"Aa"})})},N=({fg:_,bg:K,className:ce,fallback:pe=""})=>e.jsx("code",{className:`font-mono leading-tight ${ce}`,children:_&&K?e.jsxs(e.Fragment,{children:[_,e.jsx("br",{}),"on ",K]}):_||K||pe}),E=s?"text-black":"text-rose-700",J="text-black",ie=k?"text-emerald-700":"text-rose-700",I=$?"text-emerald-700":"text-rose-700",z=(_,K)=>e.jsxs(e.Fragment,{children:["contrast ",$r(_),":1"," ",e.jsx("span",{className:"font-sans",children:K?"✓ AA":"✗ AA"})]}),oe=e.jsxs("div",{className:`${s?"text-[12px] divide-y divide-border":"px-3 py-3 space-y-3 text-[12px]"}`,children:[e.jsxs("div",{className:`flex flex-wrap items-start gap-x-3 gap-y-1.5 ${s?"pb-2.5":""}`,children:[e.jsx("span",{className:`text-[10px] uppercase font-bold tracking-wider w-12 shrink-0 pt-0.5 ${E}`,children:"Before"}),e.jsxs("span",{className:"flex items-start gap-2",children:[e.jsx(U,{fg:C,bg:M}),e.jsx(N,{fg:C,bg:M,className:E,fallback:"(not previously set)"})]}),te!=null&&e.jsx("span",{className:`ml-auto font-mono font-bold flex items-center gap-1 pt-0.5 ${ie}`,children:z(te,k)})]}),!s&&e.jsx("div",{className:"-mx-3",style:{borderTop:"1px solid #c3cce0"}}),e.jsxs("div",{className:`flex flex-wrap items-start gap-x-3 gap-y-1.5 ${s?"pt-2.5":""}`,children:[e.jsx("span",{className:`text-[10px] uppercase font-bold tracking-wider w-12 shrink-0 pt-0.5 ${J}`,children:"After"}),e.jsxs("span",{className:"flex items-start gap-2",children:[e.jsx(U,{fg:m,bg:O}),e.jsx(N,{fg:m,bg:O,className:J,fallback:"(empty)"})]}),a!=null&&e.jsx("span",{className:`ml-auto font-mono font-bold flex items-center gap-1 pt-0.5 ${I}`,children:z(a,$)})]})]});return s?oe:e.jsxs("div",{className:"rounded-xl overflow-hidden",style:{border:"1px solid hsl(var(--border))"},children:[e.jsxs("div",{className:"px-3 py-2 text-[11px] font-bold tracking-wider flex items-center gap-2",style:{backgroundColor:"#E8ECF5",color:"#000000"},children:[e.jsx("span",{className:"uppercase",children:"Attribute:"}),e.jsx("code",{className:"font-mono normal-case",children:"style"})]}),oe]})},Rs=({fix:t,pageHtml:n,bare:s})=>{const i=t.attributes&&typeof t.attributes=="object"?t.attributes:null;if(!i)return null;const o=Object.entries(i).filter(([x])=>x&&x!=="class");if(!o.length)return null;const c=o.map(([x,h])=>x==="remove_attribute"?`remove ${String(h??"")}`:x).join(", "),g=o.map(([x,h])=>{const F=String(h??""),C=x==="remove_attribute",M=x==="style"?F.match(/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)/g):null,S=Fr(n,t.selector,x),w=t.current_value&&t.current_value.trim()?t.current_value:null;let u;C?u=`${F}=…`:S!=null?u=S===""?"(empty)":S:w?u=w:u="(not previously set)";const v=u.length>60?u.slice(0,60)+"…":u;return e.jsxs("div",{className:`${s?"":"px-3 py-2.5"} grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 items-center text-[12px]`,children:[e.jsx("span",{className:"text-[10px] uppercase font-bold tracking-wider text-rose-700",children:"Before"}),e.jsx("code",{className:"font-mono font-normal text-rose-700 truncate",title:u,style:{fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:v}),e.jsx("div",{className:`col-span-2 ${s?"":"-mx-3"}`,style:{borderTop:"1px solid #c3cce0"}}),e.jsx("span",{className:"text-[10px] uppercase font-bold tracking-wider",style:{color:"#000000"},children:"After"}),e.jsxs("span",{className:"flex items-start gap-2 min-w-0",children:[M&&M.length>0&&e.jsx("span",{className:"flex items-center gap-1 shrink-0",children:M.slice(0,2).map((m,O)=>e.jsx("span",{className:"inline-block w-4 h-4 rounded-xs border border-input",style:{backgroundColor:m},title:m},O))}),e.jsx("code",{className:"font-mono font-normal text-black truncate",title:F,style:{fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:C?"(removed)":F.length>70?F.slice(0,70)+"…":F||"(empty)"})]})]},x)});return s?e.jsx("div",{className:"divide-y divide-border",children:g}):e.jsxs("div",{className:"rounded-xl overflow-hidden",style:{border:"1px solid hsl(var(--border))"},children:[e.jsxs("div",{className:"px-3 py-2 text-[11px] font-bold tracking-wider flex items-center gap-2",style:{backgroundColor:"#E8ECF5",color:"#000000"},children:[e.jsx("span",{className:"uppercase",children:"Attribute:"}),e.jsx("code",{className:"normal-case truncate",style:{fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:c})]}),e.jsx("div",{className:"divide-y divide-border",children:g})]})},Tr=({fix:t,pageHtml:n,bare:s})=>{const i=Tt(t.context);return(t.issue_type==="contrast_insufficient"||t.issue_type==="non_text_contrast_insufficient")&&!Ts(t)?e.jsx(Es,{fix:t,ctx:i,bare:s}):e.jsx(Rs,{fix:t,pageHtml:n,bare:s})},Er=new Set(["contrast_insufficient","non_text_contrast_insufficient","target_too_small","focus_not_visible","focus_obscured_by_sticky","focus_not_obscured_enhanced","reflow_overflow","zoom_restriction","motion_without_reduced_motion","motion_uncontrollable","text_spacing_blocked","color_only_link"]),Rr=new Set(["style"]),Ir=new Set(["axe_aria_prohibited_attr","invali
97d_list_structure","weak_skip_link"]);function Or(t){const n=t==null?void 0:t.attributes;return!n||typeof n!="object"?null:Object.keys(n).filter(i=>i&&i!=="class")[0]??null}function Is(t){const n=t==null?void 0:t.issue_type;if(n&&(Er.has(n)||Ir.has(n)))return!0;const s=Or(t);return!!(s&&Rr.has(s))}const Br=new Set(["style","class"]),us=new Set(["aria-expanded","aria-checked","aria-selected","aria-pressed","aria-current","role"]);function Wr(t,n){const s=(t||"").trim().toLowerCase();return us.has(s)?!0:s==="remove_attribute"?us.has((n||"").trim().toLowerCase()):!1}function zr(t){const n=ot(t);if(n==null||n.trim()===""||Is(t))return!0;const s=(it(t)||"").toLowerCase();return!!(Br.has(s)||Wr(s,n))}function Dr(t){var F,C,M;if(!t)return null;const n=typeof((F=t.attributes)==null?void 0:F.style)=="string"?t.attributes.style:null;if(!n)return null;const s="#[0-9a-fA-F]{3,8}\\b|rgba?\\([^)]+\\)",i=((C=n.match(new RegExp(`background(?:-color)?\\s*:\\s*(${s})`,"i")))==null?void 0:C[1])??null,o=((M=n.match(new RegExp(`(?:^|;|\\s)color\\s*:\\s*(${s})`,"i")))==null?void 0:M[1])??null,c=o??i;if(!c)return null;const g=t.context;let x=null;if(g&&typeof g=="object")x=g;else if(typeof g=="string"){const S=g.trim();if(S.startsWith("{"))try{x=JSON.parse(S)}catch{}if(!x){x={};const w=/(\w+)=("(?:[^"\\]|\\.)*"|\S+)/g;let u;for(;u=w.exec(S);)x[u[1]]=u[2].replace(/^"|"$/g,"")}}const h=o?(x==null?void 0:x.fg)??(x==null?void 0:x.color)??null:(x==null?void 0:x.bg)??null;return h?{before:h,after:c}:null}const Pr=new Set(["heading_skip","invalid_list_structure","multiple_h1","nested_interactive","missing_h1"]),Gr={contrast_insufficient:"contrast",invalid_aria_role:"role",landmark_duplicate_unlabeled:"role"},Ur=new Set(["target_too_small"]),Vr=.85,Hr=.7;function Os(t){return He(t.fix,t.url,t.fixIndex)}function Bs(t){const n=new Map;for(const s of t){const i=Os(s);n.has(i)||n.set(i,s)}return Array.from(n.values())}function Mt(t){return Array.from(new Set(t.map(n=>n.fixIndex)))}function Ws(t,n){var o;const s=new Set;let i=0;for(const c of t){const g=n==null?void 0:n.get(Os(c));if(g&&g.size)for(const h of g)s.add(h);else c.url&&s.add(c.url);const x=(o=c.fix)==null?void 0:o.applies_to_pages;typeof x=="number"&&x>i&&(i=x)}return Math.max(s.size,i,1)}function ms(t){var n;return t?((n=t.match(/\d+\.\d+\.\d+/))==null?void 0:n[0])||t:null}function hs(t){if(!t||typeof t!="string")return null;try{const n=JSON.parse(t);return n&&typeof n=="object"?n:null}catch{return null}}function qr(t){var i;return t&&(((i=t.split(">").pop())==null?void 0:i.trim())||t.trim()).split(/[.#:[]/)[0].trim().toLowerCase()||"unknown"}function ps(t){return typeof t!="number"||Number.isNaN(t)?null:t>=Vr?"high":t>=Hr?"medium":"low"}function Ve(t,n,s,i,o,c){return{key:t,label:n,description:o,ids:Mt(s),count:Bs(s).length,pageCount:Ws(s,i),isPattern:c}}function Jr(t){var c,g;const n=t.split(/\s*[>+~]\s*|\s+/).filter(Boolean),s=n[n.length-1]||t,i=(c=s.match(/^[a-z][a-z0-9-]*/i))==null?void 0:c[0],o=(g=s.match(/[.#][A-Za-z0-9_-]+/))==null?void 0:g[0];return i&&o?`<${i}>${o}`:i?`<${i}>`:o||s}function Kr(t,n){var i;const s=new Map;for(const o of t){const c=_s((i=o.fix)==null?void 0:i.selector);if(!c)continue;const g=s.get(c);g?g.push(o):s.set(c,[o])}return Array.from(s.entries()).map(([o,c])=>Ve(o,Jr(o),c,n,void 0,!0)).filter(o=>o.ids.length>1||o.pageCount>1).sort((o,c)=>c.pageCount-o.pageCount||c.ids.length-o.ids.length)}const Yr=3;function Qr(t,n){const s=n.length>48?`${n.slice(0,48)}…`:n;return`${t} = "${s}"`}function Zr(t,n){const s=new Map;for(const i of t){if(zr(i.fix))continue;const o=wr(i.fix);if(!o)continue;const c=s.get(o);c?c.push(i):s.set(o,[i])}return Array.from(s.entries()).map(([i,o])=>{var x,h;const c=it((x=o[0])==null?void 0:x.fix)??"",g=ot((h=o[0])==null?void 0:h.fix)??"";return{...Ve(i,Qr(c,g),o,n),kind:"value",expand:!1}}).filter(i=>i.count>=Yr).sort((i,o)=>o.count-i.count)}function Xr(t,n,s){var x,h,F,C,M;if(t==="contrast_insufficient"){const S=new Map;for(const w of n){const u=hs((x=w.fix)==null?void 0:x.context),v=(u==null?void 0:u.fg)||"",m=(u==null?void 0:u.suggested)||((F=(h=w.fix)==null?void 0:h.attributes)==null?void 0:F.color)||"",O=(u==null?void 0:u.bg)||"",A=`${v.toLowerCase()}→${m.toLowerCase()}`,P=S.get(A);P?P.fixes.push(w):S.set(A,{fg:v,suggested:m,bg:O,fixes:[w]})}return Array.from(S.entries()).map(([w,u])=>Ve(w,u.fg&&u.suggested?`${u.fg} → ${u.suggested}`:"Unknown colour pair",u.fixes,s,u.bg?`On background ${u.bg}`:void 0)).sort((w,u)=>u.count-w.count)}if(Ur.has(t)){const S=new Map;for(const w of n){const u=qr((C=w.fix)==null?void 0:C.selector),v=S.get(u);v?v.push(w):S.set(u,[w])}return Array.from(S.entries()).map(([w,u])=>Ve(w,`<${w}>`,u,s)).sort((w,u)=>u.count-w.count)}const i=Gr[t];if(i){const S=new Map;for(const w of n){const u=hs((M=w.fix)==null?void 0:M.context),v=(u==null?void 0:u[i])||"unspecified",m=S.get(v);m?m.push(w):S.set(v,[w])}return S.size<=1?[]:Array.from(S.entries()).map(([w,u])=>Ve(w,`${i}="${w}"`,u,s)).sort((w,u)=>u.count-w.count)}const o=Kr(n,s),c=new Set(o.flatMap(S=>S.ids)),g=n.filter(S=>!c.has(S.fixIndex));return[...o,...Zr(g,s)]}function ei(t,n){var o,c,g;const s=new Map;for(const x of t){const h=((o=x.fix)==null?void 0:o.issue_type)||"unknown",F=s.get(h);F?F.push(x):s.set(h,[x])}const i=[];for(const[x,h]of s){const F=$t(x),C=Bs(h),M=Ws(h,n),S=Xr(x,h,n),w={high:0,medium:0,low:0};let u=0;for(const A of C){const P=ps((c=A.fix)==null?void 0:c.confidence);P==="high"?(w.high+=1,u+=1):P==="medium"?w.medium+=1:P==="low"&&(w.low+=1)}const v=Mt(h.filter(A=>{var P;return ps((P=A.fix)==null?void 0:P.confidence)==="high"})),m=h.some(A=>Is(A.fix||{}
97)),O=((g=C[0])==null?void 0:g.fix)||{};i.push({issueType:x,title:F.title,description:Ss(x)||F.description,totalCount:C.length,pageCount:M,subGroups:S,ids:Mt(h),isReportOnly:Pr.has(x),isBulkGated:m,confidence:w,highConfidenceIds:v,highConfidenceCount:u,fixes:h,wcag:O.wcag_criteria||O.wcag||Cs(x),impact:O.impact||"minor"})}return i.sort((x,h)=>h.totalCount-x.totalCount)}function Le(t,n=5){var i;const s=new Set;for(const o of t){const c=(i=o.fix)==null?void 0:i.selector;if(typeof c=="string"&&c.trim()&&s.add(c),s.size>=n)break}return Array.from(s)}const zs=({reviewFixes:t,coverage:n,onBulkAction:s})=>{const i=p.useMemo(()=>ei(t,n),[t,n]),[o,c]=p.useState(null),[g,x]=p.useState(new Set),[h,F]=p.useState(new Set),[C,M]=p.useState({}),S=p.useMemo(()=>i.filter(a=>!a.isReportOnly),[i]),w=p.useMemo(()=>S.filter(a=>a.pageCount>1).sort((a,k)=>(k.isBulkGated?1:0)-(a.isBulkGated?1:0)),[S]),u=p.useMemo(()=>S.filter(a=>a.pageCount<=1).sort((a,k)=>(k.isBulkGated?1:0)-(a.isBulkGated?1:0)),[S]),v=p.useMemo(()=>i.filter(a=>a.isReportOnly),[i]),m=a=>{x(k=>{const $=new Set(k);return $.has(a)?$.delete(a):$.add(a),$})},O=a=>{F(k=>{const $=new Set(k);return $.has(a)?$.delete(a):$.add(a),$})},A=async(a,k)=>{if(!o){c(a);try{await s(k)}finally{c(null)}}};if(i.length===0)return e.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"All clear"}),e.jsx("p",{className:"text-gray-600 text-center max-w-md",children:"No fixes are waiting for review."})]});const P=(a,k,$,U,N=!1)=>{var I,z,oe,ae,V,ue,me,_;const E=`${$}:${a.issueType}:${k.fixIndex}:${U}`,J=o===E;return e.jsxs("div",{className:N?"px-3 py-3 space-y-4":"rounded-xl border border-border px-5 py-4 space-y-5",style:N?{}:{backgroundColor:"#f3f4f6"},children:[e.jsx("div",{children:e.jsx(Ms,{confidence:(I=k.fix)==null?void 0:I.confidence,size:"sm"})}),!a.isReportOnly&&e.jsx(Tr,{fix:k.fix,bare:!0}),((z=k.fix)==null?void 0:z.selector)&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] uppercase font-semibold tracking-wider text-black mb-1.5 flex items-center gap-1.5",children:[e.jsx("svg",{className:"w-3 h-3 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),"Element Selector:"]}),e.jsx("div",{className:"rounded-md px-3 py-2",style:{backgroundColor:"#ffffff",border:"1px solid hsl(var(--border))"},children:e.jsx("code",{className:"text-[11px] break-all whitespace-pre-wrap text-black block",style:{lineHeight:1.2,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:k.fix.selector})})]}),!a.isReportOnly&&(((oe=k.fix)==null?void 0:oe.source)||((ae=k.fix)==null?void 0:ae.model))&&e.jsxs("p",{className:"text-[11px] text-black flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"uppercase font-semibold tracking-wider shrink-0 flex items-center gap-1.5",children:[e.jsx("svg",{className:"w-3 h-3 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Source:"]}),e.jsx("code",{className:"break-all",style:{fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:[(V=k.fix)==null?void 0:V.source,(ue=k.fix)==null?void 0:ue.model].filter(K=>K&&String(K).trim()).join(" + ")})]}),e.jsxs("div",{className:"flex items-center justify-between gap-1.5 flex-wrap",children:[e.jsx(gs,{url:k.url||"",selector:(me=k.fix)==null?void 0:me.selector,attributes:(_=k.fix)==null?void 0:_.attributes,title:a.issueType,size:"sm"}),!a.isReportOnly&&e.jsxs("div",{className:"flex justify-end gap-1.5 flex-wrap",children:[e.jsx("button",{type:"button",onClick:()=>A(E,{action:"reject",filter:{ids:[k.fixIndex]}}),disabled:o!==null,className:"px-3 py-1 rounded-xs text-[11px] font-semibold text-white disabled:opacity-50",style:{backgroundColor:"#dc2626"},children:"Reject"}),e.jsx("button",{type:"button",onClick:()=>A(E,{action:"approve",filter:{ids:[k.fixIndex]}}),disabled:o!==null,className:"px-3 py-1 rounded-xs text-[11px] font-semibold text-white disabled:opacity-50",style:{backgroundColor:"#15803d"},children:J?"…":"Approve"})]})]})]},`${k.fixIndex}-${U}`)},L=a=>a.isBulkGated&&!a.isReportOnly,te=(a,k=!1)=>{const $=g.has(a.issueType),U=a.isBulkGated&&!a.isReportOnly?{label:"Individual review",color:"#1e40af",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"}:null;return e.jsxs(Me.div,{className:"flex flex-col",initial:{opacity:0,y:12}
97,animate:{opacity:1,y:0},transition:{duration:.25,ease:"easeOut"},children:[U?e.jsxs("span",{className:"self-start inline-flex items-center gap-1.5 px-3.5 pt-1.5 text-xs font-semibold",style:{marginBottom:-16,paddingBottom:22,color:"#ffffff",backgroundColor:U.color,borderTopLeftRadius:12,borderTopRightRadius:12},children:[e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:U.d})}),U.label]}):k?e.jsx("div",{style:{height:28,flexShrink:0}}):null,e.jsxs("div",{className:"relative rounded-2xl p-5 md:p-6 bg-white flex flex-col h-full",style:{border:`1.5px solid ${U?U.color:a.isReportOnly?"#000000":"#a16207"}`,boxShadow:"0 4px 10px -4px rgba(0,0,0,0.28)"},children:[e.jsxs("div",{className:"flex flex-col gap-4 mb-5",children:[e.jsx(As,{issueType:a.issueType}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h4",{className:"text-lg md:text-xl font-bold wrap-break-word",style:{color:"#000000"},children:a.title}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsxs("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-[11px] font-bold uppercase tracking-wider cursor-help",style:{backgroundColor:"#E8ECF5",color:"#000000",border:"1px solid hsl(var(--border))"},title:`${a.totalCount} unique fix${a.totalCount!==1?"es":""} across ${a.pageCount} page${a.pageCount!==1?"s":""} (each counted once, not per page)`,children:[a.totalCount," fix",a.totalCount!==1?"es":"",e.jsxs("span",{className:"font-bold normal-case tracking-wider",children:[" · ",a.pageCount," Page",a.pageCount!==1?"s":""]})]}),a.wcag&&e.jsxs("a",{href:Ls(a.wcag),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 px-3 py-1 rounded-full text-[11px] font-bold uppercase tracking-wider hover:underline",style:{backgroundColor:"#E8ECF5",color:"#000000",border:"1px solid hsl(var(--border))"},title:`Open WCAG ${ms(a.wcag)} (Understanding) in a new tab`,children:["WCAG ",ms(a.wcag),e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14 5h5v5m0-5L10 14M5 9v10h10"})})]}),a.isReportOnly&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-3 py-1 rounded-full text-[11px] font-bold uppercase tracking-wider",style:{backgroundColor:"#fee2e2",color:"#991b1b",border:"1px solid #fca5a5"},title:"This issue cannot be auto-fixed. It requires a developer to change the source code directly.",children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"})}),"requires dev fix"]})]})]})]}),a.description&&e.jsx("p",{className:"mb-2 text-sm text-gray-800 leading-relaxed wrap-break-word",children:a.description}),e.jsxs("div",{className:"mt-auto pt-2 flex flex-col gap-3",children:[e.jsx(ti,{confidence:a.confidence}),a.isReportOnly&&e.jsxs("p",{className:"text-xs px-2.5 py-1.5 rounded-lg",style:{color:"#000000",backgroundColor:"#E8ECF5",border:"1px solid hsl(var(--border))"},children:[e.jsx("strong",{children:"Cannot be auto-fixed."})," This is a structural issue in the HTML source code. The WebAbility enhancer cannot patch this at runtime, so a developer needs to fix it directly."]}),e.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[a.isBulkGated&&!a.isReportOnly&&e.jsxs("button",{type:"button",onClick:()=>m(a.issueType),className:"px-3 py-1.5 rounded-lg text-xs font-semibold text-white transition-all flex items-center gap-1.5",style:{backgroundColor:"#15803d"},children:[$?"Hide details":"Review individually",e.jsx("svg",{className:`w-3.5 h-3.5 transition-transform ${$?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),!a.isReportOnly&&!a.isBulkGated&&e.jsxs(e.Fragment,{children:[a.highConfidenceCount>0&&e.jsx("button",{type:"button",onClick:()=>s({action:"approve",filter:{ids:a.highConfidenceIds},expand:!0}
97,{actionLabel:"Approve",count:a.highConfidenceCount,pageCount:a.pageCount,examples:Le(a.fixes.filter(N=>a.highConfidenceIds.includes(N.fixIndex))),ids:a.highConfidenceIds}),disabled:o!==null,className:"px-3 py-1.5 rounded-lg text-xs font-semibold text-white disabled:opacity-50",style:{backgroundColor:"#15803d"},title:"Approve only the fixes the model is highly confident about (≥ 0.85)",children:`Approve high-confidence (${a.highConfidenceCount})`}),a.highConfidenceCount<a.totalCount&&e.jsx("button",{type:"button",onClick:()=>s({action:"approve",filter:{issue_type:a.issueType}},{actionLabel:"Approve",count:a.totalCount,pageCount:a.pageCount,examples:Le(a.fixes),ids:a.ids}),disabled:o!==null,className:"px-3 py-1.5 rounded-lg text-xs font-semibold text-white disabled:opacity-50",style:{backgroundColor:"#15803d"},children:`Approve all (${a.totalCount})`})]}),a.isReportOnly?e.jsx("button",{type:"button",onClick:()=>s({action:"dismiss",filter:{issue_type:a.issueType}},{actionLabel:"Dismiss",count:a.totalCount,pageCount:a.pageCount,examples:Le(a.fixes),ids:a.ids}),disabled:o!==null,className:"px-3 py-1.5 rounded-lg text-xs font-semibold text-white disabled:opacity-50",style:{backgroundColor:"#dc2626"},children:`Dismiss (${a.totalCount})`}):e.jsx("button",{type:"button",onClick:()=>s({action:"reject",filter:{issue_type:a.issueType}},{actionLabel:"Reject",count:a.totalCount,pageCount:a.pageCount,examples:Le(a.fixes),ids:a.ids}),disabled:o!==null,className:"px-3 py-1.5 rounded-lg text-xs font-semibold text-white disabled:opacity-50",style:{backgroundColor:"#dc2626"},children:"Reject all"}),(a.isReportOnly||!a.isBulkGated)&&e.jsxs("button",{type:"button",onClick:()=>m(a.issueType),className:"px-3 py-1.5 rounded-lg text-xs font-semibold text-gray-700 bg-transparent border border-gray-500 flex items-center gap-1.5",children:[$?"Hide details":"Show details",e.jsx("svg",{className:`w-3.5 h-3.5 transition-transform ${$?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]})]})]}),e.jsx(Nt,{initial:!1,children:$&&e.jsx(Me.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.22,ease:"easeInOut"},style:{overflow:"hidden"},className:"mt-4",children:!a.isReportOnly&&a.subGroups.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex justify-center mb-5 mt-3",children:e.jsx("div",{className:"inline-flex items-center bg-gray-100 px-1.5 py-1 gap-0.5 rounded-full relative",children:["subset","individual"].map(N=>{const E=(C[a.issueType]??"subset")===N;return e.jsxs("button",{type:"button",onClick:()=>M(J=>({...J,[a.issueType]:N})),className:"relative inline-flex items-center justify-center px-4 py-2 rounded-full text-xs font-semibold z-10",style:{color:E?"#ffffff":"#4b5563"},children:[E&&e.jsx(Me.span,{layoutId:`tab-pill-${a.issueType}`,className:"absolute inset-0 rounded-full",style:{backgroundColor:"#0052CC"},transition:{type:"spring",stiffness:400,damping:30}}),e.jsx("span",{className:"relative z-10",children:N==="subset"?"Act on subset":`Individual fixes (${a.fixes.length})`})]},N)})})}),e.jsx(Nt,{mode:"wait",initial:!1,children:(C[a.issueType]??"subset")==="subset"?e.jsxs(Me.div,{initial:{opacity:0,x:-24},animate:{opacity:1,x:0},exit:{opacity:0,x:-24},transition:{duration:.2,ease:"easeInOut"},children:[e.jsx("div",{className:"space-y-3",children:a.subGroups.map(N=>{const E=`${a.issueType}:${N.key}`,J=h.has(E),ie=a.fixes.filter(I=>N.ids.includes(I.fixIndex));return e.jsxs("div",{children:[e.jsxs("div",{className:`flex flex-wrap items-center gap-x-3 gap-y-2 p-2.5 cursor-pointer ${J?"":"rounded-lg border border-border"}`,style:J?{}:{backgroundColor:"#f3f4f6"},onClick:()=>O(E),children:[e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),O(E)},className:"shrink-0 p-0.5 text-gray-700 hover:text-gray-900","aria-label":J?"Collapse fixes":"Show fixes","aria-expanded":J,children:e.jsx("svg",{className:`w-3.5 h-3.5 transition-transform ${J?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})}),e.jsx("div",{className:"min-w-0",children:e.jsx("div",{className:"flex items-center gap-1.5 min-w-0",children:(()=>{var I;if(a.issueType==="contrast_insufficient"&&((I=ie[0])!=null&&I.fix)){const z=Dr(ie[0].fix);if(z)return e.jsxs("span",{className:"inline-flex items-center gap-1 font-mono text-xs text-gray-900 whitespace-nowrap shrink-0",children:[e.jsx("span",{className:"w-3.5 h-3.5 rounded-xs border border-input shrink-0",style:{backgroundColor:z.before},title:z.before}),e.jsx("span",{children:z.before}),e.jsx(Nn,{className:"w-3 h-3 text-gray-600 shrink-0"}),e.jsx("span",{className:"w-3.5 h-3.5 rounded-xs border border-input shrink-0",style:{backgroundColor:z.after},title:z.after}),e.jsx("span",{children:z.after})]})}return e.jsx("p",{className:"text-xs font-medium text-gray-900 break-all font-mono",children:N.label})})()})})]}),e.jsxs("div",{className:"flex gap-1.5 shrink-0 items-center ml-auto",children:[e.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-medium",style:{backgroundColor:"#ffffff",color:"#000000",border:"1px solid hsl(var(--border))"},children:[N.kind==="value"?`${N.count} fix${N.count!==1?"es":""}
97`:`${N.count} pattern${N.count!==1?"s":""}`,N.pageCount>1?` · ${N.pageCount} pages`:""]}),a.isBulkGated?e.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),O(E)},className:"px-2 py-1 rounded-xs text-[11px] font-semibold text-white",style:{backgroundColor:"#15803d"},children:J?"Close":"Review"}):e.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),s({action:"approve",filter:{ids:N.ids},expand:N.expand??!0},{actionLabel:"Approve",count:N.count,pageCount:N.pageCount,examples:Le(ie),ids:N.ids})},disabled:o!==null,className:"px-2 py-1 rounded-xs text-[11px] font-semibold text-white disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:"#15803d"},children:`Approve ${N.count}`}),e.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),s({action:"reject",filter:{ids:N.ids},expand:N.expand??!0},{actionLabel:"Reject",count:N.count,pageCount:N.pageCount,examples:Le(ie),ids:N.ids})},disabled:o!==null,className:"px-2 py-1 rounded-xs text-[11px] font-semibold text-white disabled:opacity-50",style:{backgroundColor:"#dc2626"},children:"Reject"})]})]}),e.jsx(Nt,{initial:!1,children:J&&e.jsx(Me.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},style:{overflow:"hidden"},children:e.jsx("div",{className:"subset-scroll space-y-4 mt-2 max-h-[480px] overflow-y-auto pr-1",children:ie.map((I,z)=>P(a,I,`sub:${N.key}`,z))})},"sub-content")})]},N.key)})}),e.jsx("p",{className:"text-xs text-gray-600 mt-3 text-center",children:"Switch to Individual fixes for all issues."})]},"subset"):e.jsx(Me.div,{initial:{opacity:0,x:24},animate:{opacity:1,x:0},exit:{opacity:0,x:24},transition:{duration:.2,ease:"easeInOut"},children:e.jsx("div",{className:"subset-scroll space-y-4 max-h-[640px] overflow-y-auto pr-1",children:a.fixes.map((N,E)=>P(a,N,"row",E))})},"individual")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex justify-center mb-5 mt-3",children:e.jsxs("div",{className:"inline-flex items-center bg-gray-100 px-1.5 py-1 gap-0.5 rounded-full",children:[e.jsx("button",{type:"button",onClick:()=>M(N=>({...N,[a.issueType]:"subset"})),className:`inline-flex items-center justify-center px-4 py-2 rounded-full text-xs font-semibold transition-all ${(C[a.issueType]??"individual")==="subset"?"text-white shadow-xs":"text-gray-600"}`,style:(C[a.issueType]??"individual")==="subset"?{backgroundColor:"#0052CC"}:{},children:"Act on subset"}),e.jsxs("button",{type:"button",onClick:()=>M(N=>({...N,[a.issueType]:"individual"})),className:`inline-flex items-center justify-center px-4 py-2 rounded-full text-xs font-semibold transition-all ${(C[a.issueType]??"individual")==="individual"?"text-white shadow-xs":"text-gray-600"}`,style:(C[a.issueType]??"individual")==="individual"?{backgroundColor:"#0052CC"}:{},children:["Individual fixes (",a.fixes.length,")"]})]})}),(C[a.issueType]??"individual")==="subset"?e.jsx("p",{className:"text-xs text-gray-600 text-center py-6",children:"No subsets available for this issue type."}):e.jsx("div",{className:"space-y-4 max-h-[640px] overflow-y-auto pr-1",children:a.fixes.map((N,E)=>P(a,N,"row",E))})]})},"details")})]})]},a.issueType)};return e.jsxs("div",{className:"w-full overflow-hidden",children:[e.jsx("div",{className:"mb-8 flex justify-center",children:e.jsx("p",{className:"text-sm font-semibold text-gray-700 text-center max-w-3xl",children:"Grouped by issue type. Each card clears every matching review fix in one click, except visual and contrast fixes, which need individual review."})}),w.length>0&&e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsx("div",{className:"w-11 h-11 rounded-full flex items-center justify-center shrink-0",style:{backgroundColor:"rgba(161,98,7,0.10)"},children:e.jsx(Rn,{className:"w-5 h-5",strokeWidth:2,style:{color:"#000000"}})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-base font-bold text-gray-900",children:["Applies site-wide (",w.reduce((a,k)=>a+k.totalCount,0),")"]}),e.jsx("p",{className:"text-xs text-gray-600 mt-0.5",children:"These repeat across pages, approve once to fix them everywhere"})]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 gap-y-7 w-full pt-3",children:w.map((a,k)=>{const $=w[k%2===0?k+1:k-1];return te(a,!L(a)&&!!$&&L($))})}),e.jsx("div",{className:"border-t border-input mt-8"})]}),u.length>0&&e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsx("div",{className:"w-11 h-11 rounded-full flex items-center justify-center shrink-0",style:{backgroundColor:"rgba(161,98,7,0.10)"},children:e.jsx(ys,{className:"w-5 h-5",strokeWidth:2,style:{color:"#000000"}})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-base font-bold text-gray-900",children:[w.length>0?"On specific pages":"Auto-fixable"," (",u.reduce((a,k)=>a+k.totalCount,0),")"]}),e.jsx("p",{className:"text-xs text-gray-600 mt-0.5",children:"The enhancer 
97can apply these fixes automatically"})]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 gap-y-7 w-full pt-3",children:u.map((a,k)=>{const $=u[k%2===0?k+1:k-1];return te(a,!L(a)&&!!$&&L($))})}),e.jsx("div",{className:"border-t border-input mt-8"})]}),v.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsx("div",{className:"w-11 h-11 rounded-full flex items-center justify-center shrink-0",style:{backgroundColor:"rgba(153,27,27,0.10)"},children:e.jsx(Zn,{className:"w-5 h-5",strokeWidth:2,style:{color:"#000000"}})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-base font-bold text-gray-900",children:["Report only (",v.reduce((a,k)=>a+k.totalCount,0),")"]}),e.jsx("p",{className:"text-xs text-gray-600 mt-0.5",children:"These require developer changes to the source code"})]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 gap-y-7 w-full pt-3",children:v.map((a,k)=>{const $=v[k%2===0?k+1:k-1];return te(a,!L(a)&&!!$&&L($))})})]})]})},ti=({confidence:t})=>{const{high:n,medium:s,low:i}=t;if(n+s+i===0)return null;const o=[];return n>0&&o.push(e.jsxs("span",{className:"text-black",children:[n," high"]},"h")),s>0&&o.push(e.jsxs("span",{className:"text-black",children:[s," medium"]},"m")),i>0&&o.push(e.jsxs("span",{className:"text-black",children:[i," low"]},"l")),e.jsxs("div",{className:"flex items-center gap-1.5 mt-2 text-[12px] font-semibold flex-wrap text-black",children:[e.jsx("span",{className:"font-semibold uppercase tracking-wider",children:"Confidence:"}),o.map((c,g)=>e.jsxs(dn.Fragment,{children:[g>0&&e.jsx("span",{style:{width:3,height:3,minWidth:3,minHeight:3,borderRadius:"50%",backgroundColor:"#4b5563",flexShrink:0,opacity:.6,alignSelf:"center"}}),c]},g))]})},si=({dialogRef:t,onClose:n,sliderUrl:s,sliderTab:i,exportMenuOpen:o,setExportMenuOpen:c,exportDisabled:g,onExportCSV:x,onExportJSON:h,onCopyForAI:F,t:C,filter:M,setFilter:S,impacts:w,categories:u,selectedImpact:v,setSelectedImpact:m,selectedCategory:O,setSelectedCategory:A,impactDropdownOpen:P,setImpactDropdownOpen:L,categoryDropdownOpen:te,setCategoryDropdownOpen:a,allImpactsCount:k,allCategoriesCount:$,sliderFixes:U,sliderReviewCount:N,pageHtml:E,fetchPageHtml:J,sliderAnalysis:ie,pageHtmlView:I,setPageHtmlView:z,suggestedFixes:oe,suggestedFixesLoading:ae,fetchSuggestedFixes:V,handleAcceptSuggestedFix:ue,handleRejectSuggestedFix:me,acceptingFixKey:_,loader:K,error:ce,selectedDomain:pe,fetchAnalyses:Re,reviewCoverage:_e,onBulkAction:at,handleRemoveClick:lt,handleRestoreClick:se,updatingFixId:we})=>{var qe,Ie;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300",onClick:n}),e.jsxs("div",{ref:t,role:"dialog","aria-modal":"true","aria-labelledby":"autofixes-slider-title",tabIndex:-1,className:"font-inter fixed right-0 top-0 h-full w-full lg:w-[min(90vw,1200px)] bg-white shadow-2xl z-50 flex flex-col transition-transform duration-300 ease-in-out focus:outline-hidden",style:{height:"100vh"},onClick:R=>R.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-6 pt-6 pb-3 shrink-0",children:[e.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[e.jsx("h2",{id:"autofixes-slider-title",className:"text-xl md:text-2xl font-bold text-gray-900 leading-tight",children:"Auto Fixes"}),s&&e.jsx("p",{className:"text-[12px] text-gray-600 truncate leading-tight mt-0.5",children:s})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-4 shrink-0",children:[i==="fixes"&&e.jsxs(bt,{open:o,onOpenChange:c,children:[e.jsxs(yt,{disabled:g,className:"inline-flex items-center gap-1.5 rounded-full bg-blue-600 px-3 py-2.5 text-xs font-semibold text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-50 focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",children:[e.jsx(Cn,{className:"block h-3.5 w-3.5 shrink-0"}),C("AutoFixes.export.button"),e.jsx(wt,{className:"block h-3 w-3 transition-transform data-[state=open]:rotate-180"})]}),e.jsxs(vt,{align:"end",className:"min-w-[160px]",children:[e.jsxs(jt,{onSelect:x,className:"text-xs",children:[e.jsx(On,{className:"h-3.5 w-3.5 shrink-0 text-gray-500"}),C("AutoFixes.export.download_csv")]}),e.jsxs(jt,{onSelect:h,className:"text-xs",children:[e.jsx(Fn,{className:"h-3.5 w-3.5 shrink-0 text-gray-500"}),C("AutoFixes.export.download_json")]}),e.jsxs(jt,{onSelect:F,className:"text-xs",children:[e.jsx(Sn,{className:"h-3.5 w-3.5 shrink-0 text-gray-500"}),C("AutoFixes.export.copy_for_ai")]})]})]}),e.jsx("button",{onClick:n,className:"p-1.5 rounded-full border border-gray-400 hover:bg-gray-100 transition-colors","aria-label":"Close slider",children:e.jsx("svg",{className:"w-6 h-6 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),i==="fixes"&&e.jsx("div",{className:"shrink-0",children:e.jsxs("div",{className:"px-6 py-3.5",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between md:gap-4 mb-3",children:[e.jsx("div",{className:"flex flex-wrap items-center gap-2 md:inline-flex md:flex-nowrap md:gap-0.5 md:bg-gray-100 md:px-1.5 md:py-1 md:rounded-full",children:[{key:"all",label:"All",Icon:Kn,color:"#0052CC"},{key:"active",label:"Enabled",Icon:mn,color:"#15803d"},{key:"review",label:"Needs Review",Icon:hn,color:"#a16207"}].map(({key:R,label:H,Icon:ve,color:xe})=>{const he=M===R;return e.jsxs("button",{onClick:()=>S(R),className:`inline-flex items-center justify-center gap-1.5 px-3 py-2.5 md:py-1.5 rounded-full text-xs font-semibold whitespace-nowrap transition-all ${he?"text-white shadow-sm":"bg-gray-100 md:bg-transparent text-gray-600 hover:text-gray-700"}`,style:he?{backgroundColor:xe}:{},children:[e.jsx(ve,{className:"block w-3.5 h-3.5 shrink-0",strokeWidth:2,"aria-hidden":!0}
97),e.jsx("span",{className:"translate-y-px",children:H})]},R)})}),(w.length>0||u.length>0)&&e.jsx("div",{className:"border-t border-input md:hidden"}),(w.length>0||u.length>0)&&e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[w.length>0&&e.jsxs(bt,{open:P,onOpenChange:L,children:[e.jsxs(yt,{className:"inline-flex items-center gap-1.5 rounded-full bg-gray-100 px-3 py-2.5 text-xs transition-colors hover:bg-gray-200 focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",children:[e.jsx(bs,{className:"block h-3.5 w-3.5 shrink-0 text-gray-900",strokeWidth:2}),e.jsx("span",{className:"font-bold text-gray-900",children:"Impact:"}),e.jsx("span",{className:"capitalize text-gray-900",children:v==="all"?"All":v}),v!=="all"&&e.jsx("span",{className:"inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full px-1 text-[10px] font-bold text-white",style:{backgroundColor:"#0052CC"},children:(qe=w.find(R=>R.impact===v))==null?void 0:qe.count}),e.jsx(wt,{className:"block h-3 w-3 text-gray-400 transition-transform data-[state=open]:rotate-180"})]}),e.jsx(vt,{align:"end",className:"min-w-[160px]",children:e.jsxs(es,{value:v,onValueChange:m,children:[e.jsxs(et,{value:"all",className:"justify-between gap-3 text-xs",children:[e.jsx("span",{children:"All"}),e.jsx("span",{className:"inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full px-1 text-[10px] font-bold text-white",style:{backgroundColor:"#0052CC"},children:k})]}),w.map(({impact:R,count:H})=>e.jsxs(et,{value:R,className:"justify-between gap-3 capitalize text-xs",children:[e.jsx("span",{children:R}),e.jsx("span",{className:"inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full px-1 text-[10px] font-bold text-white",style:{backgroundColor:"#0052CC"},children:H})]},R))]})})]}),u.length>0&&e.jsxs(bt,{open:te,onOpenChange:a,children:[e.jsxs(yt,{className:"inline-flex items-center gap-1.5 rounded-full bg-gray-100 px-3 py-2.5 text-xs transition-colors hover:bg-gray-200 focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",children:[e.jsx(rr,{className:"block h-3.5 w-3.5 shrink-0 text-gray-900",strokeWidth:2}),e.jsx("span",{className:"font-bold text-gray-900",children:"Category:"}),e.jsx("span",{className:"capitalize text-gray-900",children:O==="all"?"All":O.replace(/_/g," ")}),O!=="all"&&e.jsx("span",{className:"inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full px-1 text-[10px] font-bold text-white",style:{backgroundColor:"#0052CC"},children:(Ie=u.find(R=>R.category===O))==null?void 0:Ie.count}),e.jsx(wt,{className:"block h-3 w-3 text-gray-400 transition-transform data-[state=open]:rotate-180"})]}),e.jsx(vt,{align:"end",className:"min-w-[160px]",children:e.jsxs(es,{value:O,onValueChange:A,children:[e.jsxs(et,{value:"all",className:"justify-between gap-3 text-xs",children:[e.jsx("span",{children:"All"}),e.jsx("span",{className:"inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full px-1 text-[10px] font-bold text-white",style:{backgroundColor:"#0052CC"},children:$})]}),u.map(({category:R,count:H})=>e.jsxs(et,{value:R,className:"justify-between gap-3 capitalize text-xs",children:[e.jsx("span",{children:R.replace(/_/g," ")}),e.jsx("span",{className:"inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full px-1 text-[10px] font-bold text-white",style:{backgroundColor:"#0052CC"},children:H})]},R))]})})]})]})]}),U.length>0&&e.jsx("div",{className:"flex items-center gap-2 mt-3 pl-1.5",children:e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",style:{flexShrink:0,display:"block"},"aria-hidden":"true",children:e.jsx("circle",{cx:"4",cy:"4",r:"4",fill:M==="active"?"#15803d":M==="deleted"?"#dc2626":M==="review"?"#a16207":"#0052CC"})}),e.jsxs("span",{className:"font-semibold text-gray-900",children:[N," auto-fix",N!==1?"es":""]}),e.jsx("span",{className:"text-gray-500",children:M==="review"?"to review":"displayed"})]})})]})}),e.jsx("div",{className:"slider-scroll flex-1 overflow-y-auto bg-white px-6",children:e.jsx("div",{className:"pt-4 pb-6",children:i==="page-html"?e.jsx(e.Fragment,{children:E.loading?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[e.jsx(Ue,{size:40}),e.jsx("p",{className:"text-gray-500 mt-4 text-sm",children:"Loading page HTML…"})]}):E.error?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 px-4",children:[e.jsx("p",{className:"text-red-600 text-center mb-4",children:E.error}),e.jsx("button",{type:"button",onClick:()=>
97s&&J(s,(ie==null?void 0:ie.url_hash)??null),className:"px-4 py-2 text-white rounded-lg transition-colors font-medium",style:{backgroundColor:"#0052CC"},children:"Retry"})]}):E.html!=null?e.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[e.jsxs("div",{className:"shrink-0 flex items-center gap-2 mb-3",children:[e.jsx("button",{type:"button",onClick:()=>z("preview"),className:`px-3 py-1.5 rounded-lg text-sm font-medium ${I==="preview"?"text-white":"text-gray-600 bg-gray-100 hover:bg-gray-200"}`,style:I==="preview"?{backgroundColor:"#0052CC"}:{},children:"Preview"}),e.jsx("button",{type:"button",onClick:()=>z("source"),className:`px-3 py-1.5 rounded-lg text-sm font-medium ${I==="source"?"text-white":"text-gray-600 bg-gray-100 hover:bg-gray-200"}`,style:I==="source"?{backgroundColor:"#0052CC"}:{},children:"Source"}),e.jsx("button",{type:"button",onClick:()=>z("suggested-fixes"),className:`px-3 py-1.5 rounded-lg text-sm font-medium ${I==="suggested-fixes"?"text-white":"text-gray-600 bg-gray-100 hover:bg-gray-200"}`,style:I==="suggested-fixes"?{backgroundColor:"#0052CC"}:{},children:"Suggested Fixes"})]}),e.jsx("div",{className:"flex-1 min-h-0 rounded-lg border border-border overflow-hidden bg-white",children:I==="suggested-fixes"?e.jsx("div",{className:"w-full h-full min-h-[400px] p-4 overflow-y-auto",children:ie?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 mb-4",children:[e.jsx("p",{className:"text-sm text-gray-600",children:"Get AI-suggested accessibility fixes for this page. Existing fixes are sent so duplicates are avoided."}),e.jsx("button",{type:"button",onClick:V,disabled:ae,className:"px-4 py-2 rounded-lg text-sm font-medium text-white shrink-0 disabled:opacity-50",style:{backgroundColor:"#0052CC"},children:ae?"Loading…":"Get suggestions"})]}),oe.length===0&&!ae&&e.jsx("p",{className:"text-gray-500 text-sm",children:'Click "Get suggestions" to fetch AI-generated fixes.'}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:oe.map((R,H)=>e.jsx(_n,{fix:R,url:s??"",onAccept:()=>ue(R,H),onReject:()=>me(H),isUpdating:_===`suggested-${H}-${R.selector}-${R.issue_type}`},`${R.selector}-${R.issue_type}-${H}`))})]}):e.jsx("p",{className:"text-gray-500 text-sm",children:"No analysis for this URL. View fixes first."})}):I==="preview"?e.jsx("iframe",{title:"Page preview",srcDoc:E.html,sandbox:"allow-same-origin",className:"w-full h-full min-h-[400px] border-0"}):e.jsx("pre",{className:"w-full h-full min-h-[400px] p-4 overflow-auto text-xs font-mono text-gray-800 whitespace-pre-wrap break-all bg-gray-50",children:E.html})})]}):e.jsx("div",{className:"flex flex-col items-center justify-center py-16 text-gray-500",children:e.jsx("p",{className:"text-sm",children:"No HTML available for this URL."})})}):K?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(Ue,{size:40})}):ce?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx("p",{className:"text-red-600 mb-4",children:ce}),e.jsx("button",{onClick:()=>pe&&Re(pe),className:"px-4 py-2 text-white rounded-sm transition-colors",style:{backgroundColor:"#0052CC"},onMouseEnter:R=>R.currentTarget.style.backgroundColor="#0041A3",onMouseLeave:R=>R.currentTarget.style.backgroundColor="#0052CC",children:"Retry"})]}):M==="review"?e.jsx(zs,{reviewFixes:U,coverage:_e,onBulkAction:at}):U.length>0?e.jsx("div",{className:"w-full",children:e.jsx("div",{className:"grid grid-cols-1 gap-8 w-full pt-2",children:U.map(({fix:R,url:H,analysisId:ve,fixIndex:xe})=>{const he=`${ve}-${xe}`;return e.jsx(Fs,{fix:R,url:H,pageHtml:E.url===H?E.html:null,onRemove:()=>lt(ve,xe),onRestore:()=>se(ve,xe),isUpdating:we===he},he)})})}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[e.jsxs("div",{className:"relative mb-6",children:[e.jsx("div",{className:"absolute inset-0 bg-green-100 rounded-full blur-xl opacity-50"}),e.jsx("div",{className:"relative p-6 bg-green-50 rounded-2xl shadow-lg",children:e.jsx("svg",{className:"h-16 w-16 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})})]}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:M==="deleted"?"No Disabled Auto-Fixes":M==="active"?"No Enabled Auto-Fixes":"All Clear!"}),e.jsx("p",{className:"text-gray-600 text-center max-w-md",children:M==="deleted"?"No disabled auto-fixes found for the selected filters":M==="active"?"No enabled auto-fixes found for the selected filters":"No auto-fixes found for this page."})]})})})]})]})},ni=({bulkConfirm:t,bulkRunning:n,onClose:s,onConfirm:i})=>e.jsx(fs,{isOpen:t!==null,ariaLabelledBy:"bulk-confirm-title",ariaDescribedBy:"bulk-confirm-desc",blur:!0,onClose:()=>{n||s()},children:t&&e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:`p-2.5 rounded-full ${t.preview.actionLabel==="Approve"?"bg-green-100":t.preview.actionLabel==="Reject"?"bg-red-100":"bg-gray-100"}`,children:e.jsx("svg",{className:"w-5 h-5 text-black",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t.preview.actionLabel==="Approve"?"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z":"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),e.jsxs("h2",{id:"bulk-confirm-title",className:"text-xl font-bold text-gray-900",children:[t.preview.actionLabel," ",t.preview.count," fix",t.preview.count===1?"":"es","?"]})]}),e.jsxs("p",{id:"bulk-confirm-desc",className:"text-gray-700 mb-4",children:["This ",t.preview.actionLabel.toLowerCase(),"s"," ",t.preview.count," fix",t.preview.count===1?"":"es",t.preview.pageCount>1?e.jsxs(e.Fragment,{children:[" across ",t.preview.pageCount," pages in one step."]}):e.jsx(e.Fragment,{children:" in one step."})]}),t.preview.examples.length>0&&e.jsxs("div",{className:"mb-6",children:[e.jsx("p",{className:"text-[11px] uppercase font-semibold tracking-wider text-gray-500 mb-1.5",children:"Examples"}),e.jsx("div",{className:"bg-gray-50 border border-border rounded-lg px-3 divide-y divide-border max-h-40 overflow-y-auto",children:t.preview.examples.map((o,c)=>e.jsx("code",{className:"block py-1.5 text-[11px] font-mono text-gray-700 break-all",children:o},c))})]}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{onClick:s,disabled:n,className:"px-4 py-2 text-gray-700 border border-gray-400 rounded-lg hover:bg-gray-50 transition-colors font-medium disabled:opacity-50",children:"Cancel"}),e.jsx("button",{onClick:i,disabled:n,className:"px-4 py-2 text-white rounded-lg transition-opacity font-medium hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:t.preview.actionLabel==="Approve"?"#15803d":"#dc2626"},children:n?"Working…":t.preview.actionLabel})]})]})}),Fe=({children:t})=>e.jsx("div",{className:"flex flex-col items-center justify-center py-16 px-6 text-center",children:e.jsx("div",{className:"max-w-md",children:t})}),$e=({children:t})=>e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:t}),Te=({children:t})=>e.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:t}),xs=({kind:t,domain:n,detail:s,onRetry:i,onCheckInstall:o})=>t==="empty"?e.jsxs(Fe,{children:[e.jsxs($e,{children:["No fixes for ",n," yet"]}),e.jsx(Te,{children:"This usually means one of two things: the WebAbility widget isn’t installed on the site yet, or it is installed and we’re still working through the first scan. Fixes show up here on their own once that finishes."}),e.jsxs("div",{className:"mt-5 flex flex-wrap items-center justify-center gap-3",children:[o&&e.jsx("button",{onClick:o,className:"px-4 py-2 text-white text-sm font-semibold rounded-lg",style:{backgroundColor:"#0052CC"},children:"Check if the widget is installed"}),e.jsx(Xt,{to:`/installation?site=${encodeURIComponent(n)}`,className:"px-4 py-2 text-sm font-medium",style:{color:"#0052CC"}
97,children:"Get the install code"})]})]}):t==="checking"?e.jsxs(Fe,{children:[e.jsxs($e,{children:["Checking ",n,"…"]}),e.jsx(Te,{children:"Looking for the WebAbility widget on your site so we can tell you what’s happening."})]}):t==="no-widget"?e.jsxs(Fe,{children:[e.jsxs($e,{children:["The widget isn’t installed on ",n," yet"]}),e.jsx(Te,{children:"We couldn’t find the WebAbility widget on this site. Fixes are generated once the widget is live and we’ve scanned your pages — until then there’s nothing for us to apply, and nothing for your visitors to benefit from."}),e.jsx(Xt,{to:`/installation?site=${encodeURIComponent(n)}`,className:"inline-block mt-5 px-4 py-2 text-white text-sm font-semibold rounded-lg",style:{backgroundColor:"#0052CC"},children:"Get the install code"})]}):t==="not-scanned"?e.jsxs(Fe,{children:[e.jsxs($e,{children:["We haven’t scanned ",n," yet"]}),e.jsx(Te,{children:"The widget is installed — good. Your first scan runs shortly after install, and fixes appear here as soon as it finishes. This page doesn’t need to stay open."}),i&&e.jsx("button",{onClick:i,className:"mt-5 px-4 py-2 text-sm font-medium",style:{color:"#0052CC"},children:"Check again"})]}):t==="all-clear"?e.jsxs(Fe,{children:[e.jsxs($e,{children:["Nothing to fix on ",n]}),e.jsx(Te,{children:"We scanned your pages and didn’t find accessibility problems we can fix automatically. That’s a good result — it doesn’t replace a manual audit, but nothing is outstanding here."})]}):e.jsxs(Fe,{children:[e.jsxs($e,{children:["We couldn’t load fixes for ",n]}),e.jsx(Te,{children:"Something went wrong on our side — this isn’t a problem with your site, and no fixes were changed. Try again, and if it keeps happening send us the details below."}),i&&e.jsx("button",{onClick:i,className:"mt-5 px-4 py-2 text-white text-sm font-semibold rounded-lg",style:{backgroundColor:"#0052CC"},children:"Retry"}),s&&e.jsxs("details",{className:"mt-5 text-left",children:[e.jsx("summary",{className:"text-xs text-gray-500 cursor-pointer",children:"Technical details"}),e.jsx("pre",{className:"mt-2 whitespace-pre-wrap wrap-break-word rounded-lg bg-gray-50 border border-border p-3 text-[11px] text-gray-600",children:s})]})]});function Ds(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"&&typeof t.result_json=="string"}function ri(t,n,s){return Ds(s)?{analyses:t.map(i=>i.id===n?s:i),needsRefetch:!1}:{analyses:t,needsRefetch:!0}}const ji=({lockedDomain:t})=>{pn({title:t?"Site Settings":"Auto Fixes"});const{t:n}=gn(),[s,i]=p.useState([]),[o,c]=p.useState(!1),[g,x]=p.useState(null),[h,F]=p.useState(null),[C,M]=p.useState(null),[S,w]=p.useState(!1),[u,v]=p.useState("all"),[m,O]=p.useState("all"),[A,P]=p.useState("all"),[L,te]=p.useState("all"),[a,k]=p.useState(!0),[$,U]=p.useState(null),N=30,[E,J]=p.useState(N),[ie,I]=p.useState(!1),[z,oe]=p.useState(t?"url-list":"domain-selection"),ae=p.useRef(null),[V,ue]=p.useState(!1),me=p.useRef(null),[_,K]=p.useState(null),[ce,pe]=p.useState("fixes"),[Re,_e]=p.useState(!1),[at,lt]=p.useState(!1),[se,we]=p.useState({url:null,html:null,loading:!1,error:null}),[qe,Ie]=p.useState("preview"),[R,H]=p.useState([]),[ve,xe]=p.useState(!1),[,he]=p.useState(null),[Ps,Je]=p.useState(null),[je,ct]=p.useState(""),[fe,Oe]=p.useState({isOpen:!1,type:"remove",analysisId:"",fixIndex:-1}),[Ke,dt]=p.useState(null),[Et,Rt]=p.useState(!1),ke=p.useRef(!0),It=p.useRef(0),[Ye,Be]=p.useState("unknown"),{data:We,loading:Ot}=xn(),{site:Ce,setSite:Gs}=fn(),ze=p.useMemo(()=>{var r;return(r=We==null?void 0:We.getUserSites)!=null&&r.sites?We.getUserSites.sites.map(l=>({value:(l==null?void 0:l.url)||"",label:(l==null?void 0:l.url)||""})).filter(l=>l.value):[]},[We]),Bt=r=>{const l=tt(r);return l&&ze.find(d=>tt(d.value)===l)||null};p.useEffect(()=>()=>{ke.current=!1},[]);const De=p.useCallback(async(r,l)=>{we(f=>({...f,url:r,html:null,loading:!0,error:null}));const d=new URLSearchParams({url:r});l&&l.trim()&&d.set("url_hash",l.trim());const b=`https://api.webability.io/domain-analyses/page-html?${d.toString()}`,j=ye();try{const f=await fetch(b,{method:"GET",headers:{"Content-Type":"application/json",...j?{Authorization:`Bearer ${j}`}:{}}}),y=await f.json();if(!ke.current)return;if(!f.ok){we({url:r,html:null,loading:!1,error:(y==null?void 0:y.message)||(y==null?void 0:y.error)||`Request failed: ${f.status}`});return}we({url:r,html:y.html??null,loading:!1,error:null})}catch(f){if(!ke.current)return;we({url:r,html:null,loading:!1,error:f instanceof Error?f.message:"Failed to load page HTML"})}},[]),B=p.useMemo(()=>_?s.find(r=>(r.url||r.domain||"")===_)??null:null,[s,_]);p.useEffect(()=>{ce!=="page-html"||!_||se.url===_&&(se.html!=null||se.loading||se.error)||De(_,(B==null?void 0:B.url_hash)??null)},[ce,_,B==null?void 0:B.url_hash,De,se]),p.useEffect(()=>{!V||!_||se.url===_&&(se.html!=null||se.loading||se.error)||De(_,(B==null?void 0:B.url_hash)??null)},[V,_,B==null?void 0:B.url_hash,De,se]),p.useEffect(()=>{_&&(H([]),he(null),Je(null))},[_]),p.useEffect(()=>{J(N)},[m,u,A,L]);const Wt=p.useMemo(()=>{var r;if(!B)return[];try{const l=JSON.parse(B.result_json);return Array.isArray((r=l==null?void 0:l.analysis)==null?void 0:r.fixes)?l.analysis.fixes:[]}catch{return[]}},[B]),Us=p.useCallback(async()=>
97{if(!_||!se.html||!B)return;xe(!0),he(null);const r="https://api.webability.io/domain-analyses/suggested-fixes",l=ye();try{const d=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",...l?{Authorization:`Bearer ${l}`}:{}},body:JSON.stringify({url:_,html:se.html,existingFixes:Wt,...B!=null&&B.domain?{domain:B.domain}:{}})}),b=await d.json();if(!d.ok)throw new Error((b==null?void 0:b.message)??(b==null?void 0:b.error)??"Failed to fetch suggestions");H(Array.isArray(b.suggestedFixes)?b.suggestedFixes:[])}catch{H([]),he(null)}finally{xe(!1)}},[_,se.html,B,Wt]),Vs=p.useCallback(async(r,l)=>{if(!B)return;const d=`suggested-${l}-${r.selector}-${r.issue_type}`;Je(d);const b="https://api.webability.io/domain-analyses/add-fix",j=ye();try{const f=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json",...j?{Authorization:`Bearer ${j}`}:{}},body:JSON.stringify({analysisId:B.id,fix:r})}),y=await f.json();if(!f.ok)throw new Error((y==null?void 0:y.message)??(y==null?void 0:y.error)??"Failed to add fix");i(W=>ri(W,B.id,y).analyses),!Ds(y)&&h&&ge(h,{silent:!0}),H(W=>W.filter((D,T)=>T!==l))}catch(f){alert(f instanceof Error?f.message:"Failed to add fix")}finally{Je(null)}},[B,h]),Hs=p.useCallback(r=>{H(l=>l.filter((d,b)=>b!==r))},[]),ge=async(r,l={})=>{if(!r)return;const d=++It.current,b=()=>ke.current&&d===It.current;w(!0),l.silent||c(!0),x(null);const j=`https://api.webability.io/domain-analyses?url=${encodeURIComponent(r)}`,f=ye();try{const y=await fetch(j,{method:"GET",headers:{"Content-Type":"application/json",...f?{Authorization:`Bearer ${f}`}:{}}});if(!y.ok)throw new Error(`Server error: ${y.statusText}`);const W=await y.json();b()&&(i(W||[]),c(!1),x(null))}catch(y){if(console.error("Error fetching analyses:",y),!b()||l.silent)return;i([]),c(!1),x(y instanceof Error?y.message:"Failed to fetch analyses")}},ut=r=>{r?(M(r),F(r.value),v("all"),P("all"),te("all"),ae.current=tt(r.value),Gs(r.value)):(M(null),F(null),i([]),w(!1),oe("domain-selection"))},qs=()=>{h&&(oe("url-list"),ge(h))};p.useEffect(()=>{const r=t||(Ce==null?void 0:Ce.url);if(!r||ze.length===0)return;const l=Bt(r);if(!l)return;const d=tt(r);ae.current!==d&&(ae.current=d,M(l),F(l.value),v("all"),oe("url-list"),ge(l.value))},[t,Ce==null?void 0:Ce.url,ze]);const ne=p.useMemo(()=>{const r=new Map;s.forEach(b=>{var f;const j=b.url||b.domain||"";if(j)try{const y=JSON.parse(b.result_json),W=((f=y==null?void 0:y.analysis)==null?void 0:f.fixes)||[],D=W.filter(ee=>ee.action!=="deleted"&&ee.action!=="review"),T=W.filter(ee=>ee.action==="deleted"),Ae=W.filter(ee=>ee.action==="review"&&!(a&&le(ee))),Y=r.get(j)||{url:j,fixCount:0,activeFixCount:0,deletedFixCount:0,reviewFixCount:0,score:null,analyzedAt:0};Y.fixCount+=W.length,Y.activeFixCount+=D.length,Y.deletedFixCount+=T.length,Y.reviewFixCount+=Ae.length,b.score!==null&&(Y.score===null||b.analyzed_at>Y.analyzedAt)&&(Y.score=b.score),b.analyzed_at>Y.analyzedAt&&(Y.analyzedAt=b.analyzed_at),r.set(j,Y)}catch(y){console.error("Error parsing analysis:",y)}});const l=Array.from(r.values()),d=b=>{try{return new URL(b.startsWith("http")?b:`https://${b}`).pathname.split("/").filter(Boolean).length}catch{return 0}};return l.sort((b,j)=>{const f=d(b.url),y=d(j.url);return f!==y?f-y:b.url.localeCompare(j.url,void 0,{sensitivity:"base"})})},[s,a]);p.useEffect(()=>{Be("unknown")},[h]);const Js=p.useCallback(async()=>{if(h){Be("checking");try{const r=ye(),l=await fetch("https://api.webability.io/check-script",{method:"POST",headers:{"Content-Type":"application/json",...r?{Authorization:`Bearer ${r}`}:{}},body:JSON.stringify({siteUrl:h})});if(!ke.current)return;if(!l.ok){Be("unknown");return}const d=await l.json();if(!ke.current)return;Be(d==="Web Ability"?"present":"absent")}catch{if(!ke.current)return;Be("unknown")}}},[h]),Ks=p.useMemo(()=>g?"error":Ye==="checking"?"checking":Ye==="absent"?"no-widget":Ye==="present"?"not-scanned":"empty",[g,Ye]),Qe=p.useMemo(()=>{if(!je.trim())return ne;const r=je.toLowerCase().trim();return ne.filter(l=>l.url.toLowerCase().includes(r))},[ne,je]),Ze=r=>{K(r),v(r),ue(!0)},zt=()=>{ue(!1),K(null),v("all"),pe("fixes"),we({url:null,html:null,loading:!1,error:null}),Ie("preview"),H([]),xe(!1),he(null),Je(null)};wn(me,V,{onClose:zt,initialFocusId:"autofixes-slider-title"});const Ys=()=>{oe("url-list"),v("all")},Dt=(r,{action:l})=>
97{if(l==="input-change"&&r){const d=r.trim();if(/^(https?:\/\/|www\.|[a-zA-Z0-9-]+\.[a-zA-Z]{2,})/i.test(d)){const j=Bt(d);j&&(!C||C.value!==j.value)&&setTimeout(()=>{ut(j)},100)}}return r},G=p.useMemo(()=>{const r=[];return s.forEach(l=>{var d;try{const b=JSON.parse(l.result_json);(((d=b==null?void 0:b.analysis)==null?void 0:d.fixes)||[]).forEach((f,y)=>{r.push({fix:f,url:l.url||l.domain||"",analysisId:l.id,fixIndex:f._manifestId??y})})}catch(b){console.error("Error parsing analysis:",b)}}),r},[s]),Pt=p.useMemo(()=>{const r=new Map;for(const{fix:l,url:d,fixIndex:b}of G){if(l.action!=="review"||!d||a&&le(l))continue;const j=He(l,d,b);let f=r.get(j);f||(f=new Set,r.set(j,f)),f.add(d)}return r},[G,a]),Se=p.useMemo(()=>kr(G),[G]),Xe=Se.actionable+Se.queuedForAi+Se.needsHuman,mt=a?Se.actionable:Xe,Qs=p.useMemo(()=>G.filter(({fix:r,url:l})=>!(r.action!=="review"||a&&le(r)||u!=="all"&&l!==u)),[G,u,a]),Pe=p.useMemo(()=>_?G.filter(({fix:r,url:l})=>!(l!==_||m==="active"&&r.action!=="update"||m==="deleted"&&r.action!=="deleted"||m==="review"&&r.action!=="review"||m==="review"&&a&&le(r)||A!=="all"&&(r.impact||"minor")!==A||L!=="all"&&(r.category||"other")!==L)):[],[G,_,m,A,L,a]),Gt=p.useMemo(()=>m==="review"?st(Pe):Pe.length,[Pe,m]),Ut=p.useMemo(()=>{const r=new Map;return G.forEach(({fix:l,url:d})=>{if(m==="active"&&l.action!=="update"||m==="deleted"&&l.action!=="deleted"||m==="review"&&l.action!=="review"||m==="review"&&a&&le(l)||A!=="all"&&(l.impact||"minor")!==A||L!=="all"&&(l.category||"other")!==L)return;const b=r.get(d)||0;r.set(d,b+1)}),Array.from(r.entries()).map(([l,d])=>({url:l,count:d}))},[G,m,A,L,a]),ht=p.useMemo(()=>{const r=m==="review",l=new Map,d=new Map,b=V&&_?_:u;return G.forEach(({fix:f,url:y,fixIndex:W})=>{if(b!=="all"&&y!==b||m==="active"&&f.action!=="update"||m==="deleted"&&f.action!=="deleted"||m==="review"&&f.action!=="review"||m==="review"&&a&&le(f)||L!=="all"&&(f.category||"other")!==L)return;const D=f.impact||"minor";if(r){let T=d.get(D);T||(T=new Set,d.set(D,T)),T.add(os(f,y,W))}else{const T=l.get(D)||0;l.set(D,T+1)}}),(r?Array.from(d.entries()).map(([f,y])=>[f,y.size]):Array.from(l.entries())).map(([f,y])=>({impact:f,count:y})).sort((f,y)=>{const W={serious:0,moderate:1,minor:2};return(W[f.impact]||3)-(W[y.impact]||3)})},[G,u,m,L,V,_,a]),pt=p.useMemo(()=>{const r=m==="review",l=new Map,d=new Map,b=V&&_?_:u;return G.forEach(({fix:f,url:y,fixIndex:W})=>{if(b!=="all"&&y!==b||m==="active"&&f.action!=="update"||m==="deleted"&&f.action!=="deleted"||m==="review"&&f.action!=="review"||m==="review"&&a&&le(f)||A!=="all"&&(f.impact||"minor")!==A)return;const D=f.category||"other";if(r){let T=d.get(D);T||(T=new Set,d.set(D,T)),T.add(os(f,y,W))}else{const T=l.get(D)||0;l.set(D,T+1)}}),(r?Array.from(d.entries()).map(([f,y])=>[f,y.size]):Array.from(l.entries())).map(([f,y])=>({category:f,count:y})).sort((f,y)=>y.count-f.count)},[G,u,m,A,V,_,a]),{filteredFixes:be,exportItems:Vt,exportScope:Zs,exportDomain:Xs}=Cr({allFixes:G,selectedPage:u,filter:m,selectedImpact:A,selectedCategory:L,hideEmptyReview:a,sliderFixes:Pe,sliderUrl:_,sliderReviewCount:Gt,selectedDomain:h,selectedOptionValue:C==null?void 0:C.value}),{handleExportCSV:en,handleExportJSON:tn,handleCopyForAI:sn}=br({exportItems:Vt,exportDomain:Xs,exportScope:Zs,setExportMenuOpen:I,t:n}),nn=p.useMemo(()=>{const r=G.filter(({fix:l})=>!(m==="active"&&l.action!=="update"||m==="deleted"&&l.action!=="deleted"||m==="review"&&l.action!=="review"||m==="review"&&a&&le(l)||A!=="all"&&(l.impact||"minor")!==A||L!=="all"&&(l.category||"other")!==L));return m==="review"?st(r):r.length},[G,m,A,L,a]),Ht=p.useMemo(()=>{const r=V&&_?_:u,l=G.filter(({fix:d,url:b})=>!(r!=="all"&&b!==r||m==="active"&&d.action!=="update"||m==="deleted"&&d.action!=="deleted"||m==="review"&&d.action!=="review"||m==="review"&&a&&le(d)||L!=="all"&&(d.category||"other")!==L));return m==="review"?st(l):l.length},[G,m,u,L,V,_,a]),qt=p.useMemo(()=>{const r=V&&_?_:u,l=G.filter(({fix:d,url:b})=>!(r!=="all"&&b!==r||m==="active"&&d.action!=="update"||m==="deleted"&&d.action!=="deleted"||m==="review"&&d.action!=="review"||m==="review"&&a&&le(d)||A!=="all"&&(d.impact||"minor")!==A));return m==="review"?st(l):l.length},[G,m,u,A,V,_,a]),Jt=async(r,l,d)=>{const b=`${r}-${l}`;U(b),Oe({isOpen:!1,type:"remove",analysisId:"",fixIndex:-1});try{const j="https://api.webability.io/domain-analyses/fix-action",f=ye(),y=await fetch(j,{method:"PUT",headers:{"Content-Type":"application/json",...f?{Authorization:`Bearer ${f}`}:{}},body:JSON.stringify({analysisId:r,fixIndex:l,action:d})});if(!y.ok){const D=await y.json().catch(()=>({error:"Unknown error"}));throw new Error(D.error||"Failed to update fix action")}const W=await y.json();W.updated&&h?i(D=>D.map(T=>{var Ae;if(T.id!==r)return T;try{const Y=JSON.parse(T.result_json),ee=(Ae=Y==null?void 0:Y.anal
97ysis)==null?void 0:Ae.fixes;if(!Array.isArray(ee))return T;const ft=ee.map((Ne,q)=>((Ne==null?void 0:Ne._manifestId)??q)===l?{...Ne,action:d}:Ne),gt={...Y,analysis:{...Y.analysis,fixes:ft}};return{...T,result_json:JSON.stringify(gt)}}catch{return T}})):i(D=>D.map(T=>T.id===r?W:T))}catch(j){console.error("Error updating fix action:",j),alert(j instanceof Error?j.message:"Failed to update fix. Please try again.")}finally{U(null)}},Kt=p.useCallback(async(r,l)=>{if(!h||!r.length)return;const d="https://api.webability.io/domain-analyses/fixes/bulk",b=ye();try{const j=await fetch(d,{method:"POST",headers:{"Content-Type":"application/json",...b?{Authorization:`Bearer ${b}`}:{}},body:JSON.stringify({domain:h,action:"restore",filter:{ids:r}})});if(!j.ok){const f=await j.json().catch(()=>({error:"Unknown error"}));throw new Error(f.message||f.error||"Failed to undo")}await ge(h),is(l,{kind:"success",title:"Fixes Restored",subtext:"Fixes returned to the review queue"})}catch(j){console.error("Error undoing bulk action:",j),is(l,{kind:"error",title:"Undo failed",subtext:j instanceof Error?j.message:"Something went wrong. Please try again."})}},[h]),xt=p.useCallback(async(r,l)=>{if(!h)return;const d="https://api.webability.io/domain-analyses/fixes/bulk",b=ye();try{const j=await fetch(d,{method:"POST",headers:{"Content-Type":"application/json",...b?{Authorization:`Bearer ${b}`}:{}},body:JSON.stringify({domain:h,action:r.action,filter:r.filter,expand:r.expand===!0})});if(!j.ok){const T=await j.json().catch(()=>({error:"Unknown error"}));throw new Error(T.message||T.error||"Failed to bulk update fixes")}await ge(h);const f=r.action==="approve"?"Fixes Approved":r.action==="dismiss"?"Fixes Dismissed":"Fixes Rejected",y=(l==null?void 0:l.count)??0,W=(l==null?void 0:l.pageCount)??0,D=(l==null?void 0:l.ids)??[];Ee({kind:"success",title:f,subtext:y>0?`${y} fix${y===1?"":"es"} across ${W} page${W===1?"":"s"}`:void 0,undo:D.length>0?T=>Kt(D,T):void 0})}catch(j){console.error("Error bulk updating fixes:",j),Ee({kind:"error",title:"Action failed",subtext:j instanceof Error?j.message:"Failed to update fixes. Please try again."})}},[h,Kt]),Yt=p.useCallback(async(r,l)=>{if(l){dt({payload:r,preview:l});return}await xt(r)},[xt]),Qt=(r,l)=>{Oe({isOpen:!0,type:"remove",analysisId:r,fixIndex:l})},Zt=(r,l)=>{Oe({isOpen:!0,type:"restore",analysisId:r,fixIndex:l})},rn=()=>{const{analysisId:r,fixIndex:l,type:d}=fe;d==="remove"?Jt(r,l,"deleted"):Jt(r,l,"update")},on=async()=>{if(!(!Ke||Et)){Rt(!0);try{await xt(Ke.payload,Ke.preview)}finally{Rt(!1),dt(null)}}},X=p.useMemo(()=>{const r=s[0],l=typeof(r==null?void 0:r.unique_fix_count)=="number"?r.unique_fix_count:null,d=ne.reduce((q,de)=>q+de.activeFixCount,0),b=typeof(r==null?void 0:r.served_fix_count)=="number"?r.served_fix_count:d,j=ne.reduce((q,de)=>q+de.fixCount,0),f=ne.reduce((q,de)=>q+de.activeFixCount,0),y=ne.reduce((q,de)=>q+de.deletedFixCount,0);let W=f,D=y;if(l!==null&&j>0){const q=l/j;W=Math.round(f*q),D=Math.round(y*q)}const T=Se,Ae=mt,Y=l??j,ee=ne.map(q=>q.activeFixCount).sort((q,de)=>q-de),ft=ee.length>0?ee[Math.floor((ee.length-1)/2)]:0,gt=ee.length>0?ee[ee.length-1]:0,Ne=ne.length>0?ne.reduce((q,de)=>q+(de.score||0),0)/ne.filter(q=>q.score!==null).length:null;return{totalFixes:Y,servedTotal:b,totalEnabled:W,totalDisabled:D,totalReview:Ae,reviewQueuedForAi:T.queuedForAi,reviewNeedsHuman:T.needsHuman,reviewAny:Xe,medianPerPage:ft,maxPerPage:gt,avgScore:Ne}},[ne,s,Se,Xe,mt]),an=()=>e.jsx("div",{className:"w-full flex flex-col",children:e.jsxs("div",{className:"bg-white rounded-xl sm:rounded-2xl shadow-xl p-4 sm:p-6 md:p-8 w-full max-w-full border border-border flex flex-col",children:[e.jsxs("div",{className:"mb-6 sm:mb-8",children:[e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6",children:e.jsxs("div",{className:"flex items-center gap-3 md:gap-4 min-w-0 flex-1",children:[!t&&e.jsx("button",{onClick:()=>{oe("domain-selection"),i([]),w(!1)},className:"p-2 hover:bg-gray-100 rounded-lg transition-all shrink-0 group",title:"Back to domain selection","aria-label":"Back to domain selection",children:e.jsx("svg",{className:"w-5 h-5 text-gray-600 group-hover:text-gray-900 transition-colors",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})})}),e.jsx("div",{className:"flex-1 min-w-0",children:h&&e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(kt,{domain:h,size:18,className:"shrink-0"}),e.jsx("span",{className:"text-sm md:text-base text-gray-600 truncate font-medium",children:h})]})})]})}),ne.length>0&&e.jsxs("div",{className:`grid grid-cols-2 gap-4 mb-6 ${X.reviewAny>0?"lg:grid-cols-3":""}`,children:[e.jsxs("div",{className:"bg-white rounded-lg border border-border p-5 shadow-xs hover:shadow-md transition-shadow",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("span",{className:"text-sm font-medium text-gray-600",children:"Total Pages"}),e.jsx("div",{className:"p-2 rounded-lg",style:{backgroundColor:"rgba(0, 82, 204, 0.1)"},children:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"#0052CC"},children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})})]}),e.jsx("div",{className:"text-3xl font-bold text-gray-900",children:ne.length})]}),e.jsxs("div",{className:"bg-white rounded-lg border border-border p-5 shadow-xs hover:shadow-md transition-shadow",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("span",{className:"text-sm font-medium text-gray-600",children:"Active Fixes"}),e.jsx("div",{className:"p-2 bg-indigo-50 rounded-lg",children:e.jsx("svg",{className:"w-5 h-5 text-indigo-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})})]}),e.jsx("div",{className:"text-3xl font-bold text-gray-900",children:X.servedTotal}),e.jsxs("div",{className:"mt-1 text-xs text-gray-500",children:["live across your site",X.medianPerPage>0&&e.jsxs(e.Fragment,{children:[" · ~",X.medianPerPage," per page"]})]})]}),X.reviewAny>0&&e.jsxs("div",{className:"bg-white rounded-lg border-2 border-amber-300 p-5 shadow-xs hover:shadow-md transition-shadow",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("span",{className:"text-sm font-medium text-amber-700",children:"Needs Review"}),e.jsx("div",{className:"p-2 bg-amber-50 rounded-lg",children:e.jsx("svg",{className:"w-5 h-5 text-amber-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"})})})]}),e.jsx("div",{className:"text-3xl font-bold text-amber-700",children:X.totalReview}),e.jsx("div",{className:"mt-1 text-xs text-amber-700/70",children:"distinct issues awaiting your review"}),(X.reviewQueuedForAi>0||X.reviewNeedsHuman>0)&&e.jsxs("div",{className:"mt-1 text-xs text-amber-700/70",children:[X.reviewQueuedForAi>0&&e.jsxs("span",{children:[X.reviewQueuedForAi," queued for AI"]}),X.reviewQueuedForAi>0&&X.reviewNeedsHuman>0&&e.jsx("span",{children:" · "}),X.reviewNeedsHuman>0&&e.jsxs("span",{children:[X.reviewNeedsHuman," ",X.reviewNeedsHuman===1?"needs":"need"," ","a value from you"]})]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none",children:e.jsx("svg",{className:"h-5 w-5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),e.jsx("input",{type:"text",placeholder:"Search pages by URL...",value:je,onChange:r=>ct(r.target.value),className:"block w-full pl-12 pr-12 py-3 md:py-3.5 border-2 border-border rounded-xl text-sm md:text-base focus:outline-hidden transition-all bg-gray-50 focus:bg-white",onFocus:r=>{r.target.style.borderColor="#0052CC",r.target.style.boxShadow="0 0 0 3px rgba(0, 82, 204, 0.1)"},onBlur:r=>{r.target.style.borderColor="#e5e7eb",r.target.style.boxShadow="none"}}),je&&e.jsx("button",{onClick:()=>ct(""),className:"absolute inset-y-0 right-0 pr-4 flex items-center hover:bg-gray-100 rounded-r-xl transition-colors","aria-label":"Clear search",children:e.jsx("svg",{className:"h-5 w-5 text-gray-400 hover:text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),je&&e.jsxs("div",{className:"absolute top-full left-0 right-0 mt-2 text-xs text-gray-500 px-4",children:["Showing ",Qe.length," of ",ne.length," pages"]})]})]}),e.jsx("div",{className:"flex-1 flex flex-col md:overflow-hidden md:min-
97h-0",children:o?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(Ue,{size:40})}):g?e.jsx(xs,{kind:"error",domain:h||"this site",detail:g,onRetry:()=>h&&ge(h)}):Qe.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-full block md:hidden space-y-3 pb-6",children:Qe.map(r=>{let l=r.url;try{!r.url.startsWith("http://")&&!r.url.startsWith("https://")&&(l=`https://${r.url}`)}catch{l=r.url}return e.jsxs("div",{className:"bg-white border-2 border-border rounded-xl p-5 hover:shadow-lg transition-all duration-200 cursor-pointer group",onMouseEnter:d=>d.currentTarget.style.borderColor="rgba(0, 82, 204, 0.3)",onMouseLeave:d=>d.currentTarget.style.borderColor="#e5e7eb",onClick:()=>Ze(r.url),children:[e.jsx("div",{className:"mb-4 pb-4 border-b border-border",children:e.jsxs("a",{href:l,target:"_blank",rel:"noopener noreferrer",onClick:d=>d.stopPropagation(),className:"flex items-start gap-2 group/link transition-colors",style:{color:"#0052CC"},onMouseEnter:d=>d.currentTarget.style.color="#003d99",onMouseLeave:d=>d.currentTarget.style.color="#0052CC",children:[e.jsx("svg",{className:"w-5 h-5 shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"#0052CC"},children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),e.jsx("span",{className:"text-sm break-all flex-1 font-medium leading-relaxed",children:r.url}),e.jsx("svg",{className:"w-4 h-4 shrink-0 mt-1 opacity-0 group-hover/link:opacity-100 transition-opacity",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})}),e.jsxs("div",{className:`grid gap-3 mb-4 ${r.reviewFixCount>0?"grid-cols-3":"grid-cols-2"}`,children:[e.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 text-center border border-border",children:[e.jsx("div",{className:"text-xs text-gray-500 mb-1.5 font-medium",children:"Detected"}),e.jsx("div",{className:"text-2xl font-bold text-gray-900",children:r.fixCount})]}),e.jsxs("div",{className:"bg-green-50 rounded-lg p-3 text-center border border-green-100",children:[e.jsx("div",{className:"text-xs text-green-600 mb-1.5 font-medium",children:"Enabled"}),e.jsx("div",{className:"text-2xl font-bold text-green-700",children:r.activeFixCount})]}),r.reviewFixCount>0&&e.jsxs("div",{className:"bg-amber-50 rounded-lg p-3 text-center border border-amber-200",children:[e.jsx("div",{className:"text-xs text-amber-600 mb-1.5 font-medium",children:"Review"}),e.jsx("div",{className:"text-2xl font-bold text-amber-700",children:r.reviewFixCount})]})]}),e.jsx("div",{className:"flex flex-col sm:flex-col gap-2",children:e.jsx("button",{onClick:d=>{d.stopPropagation(),Ze(r.url)},className:"w-full px-3 sm:px-4 py-2.5 sm:py-3 text-white text-xs sm:text-sm font-semibold rounded-lg transition-all duration-200 shadow-xs hover:shadow-md transform hover:scale-[1.02] active:scale-100 whitespace-nowrap",style:{backgroundColor:"#0052CC"},onMouseEnter:d=>d.currentTarget.style.backgroundColor="#0041A3",onMouseLeave:d=>d.currentTarget.style.backgroundColor="#0052CC",children:"View Fixes"})})]},r.url)})}),e.jsx("div",{className:"hidden md:flex w-full",children:e.jsx("div",{className:"rounded-xl border border-border overflow-hidden flex-1 flex flex-col min-w-0",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse min-w-[600px] bg-white",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-gray-50 border-b-2 border-border",children:[e.jsx("th",{className:"text-left py-4 px-4 text-sm font-bold text-gray-700 uppercase tracking-wider",children:"URL"}),e.jsx("th",{className:"text-left py-4 px-4 text-sm font-bold text-gray-700 uppercase tracking-wider whitespace-nowrap",children:"Issues found"}),e.jsx("th",{className:"text-left py-4 px-4 text-sm font-bold text-gray-700 uppercase tracking-wider whitespace-nowrap",children:"Live"}),X.reviewAny>0&&e.jsx("th",{className:"text-left py-4 px-4 text-sm font-bold text-amber-700 uppercase tracking-wider whitespace-nowrap",children:"Needs review"}),e.jsx("th",{className:"text-left py-4 px-4 text-sm font-bold text-gray-700 uppercase tracking-wider whitespace-nowrap",children:"Actions"})]})}),e.jsx("tbody",{children:Qe.map(r=>{let l=r.url;try{!r.url.startsWith("http://")&&!r.url.startsWith("https://")&&(l=`https://${r.url}`)}catch{l=r.url}return e.jsxs("tr",{className:"border-b border-border transition-all duration-200 cursor-pointer group",onMouseEnter:d=>d.currentTarget.style.backgroundColor="rgba(0, 82, 204, 0.05)",onMouseLeave:d=>d.currentTarget.style.backgroundColor="transparent",onClick:()=>Ze(r.url),children:[e.jsx("td",{className:"py-4 px-4 min-w-[200px] max-w-[400px]",children:e.jsx("div",{className:"flex items-center gap-2 min-w-0",children:e.jsxs("a",{href:l,target:"_blank",rel:"noopener noreferrer",onClick:d=>d.stopPropagation(),className:"flex items-center gap-2 min-w-0 group/link transition-colors",style:{color:"#0052CC"},onMouseEnter:d=>d.currentTarget.style.color="#003d99",onMouseLeave:d=>d.currentTarget.style.color="#0052CC",children:[e.jsx("span",{className:"text-sm wrap-break-word break-all font-medium",children:r.url}),e.jsx("svg",{className:"w-4 h-4 shrink-0 opacity-0 group-hover/link:opacity-100 transition-opacity",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})})}),e.jsx("td",{className:"py-4 px-4 whitespace-nowrap",children:e.jsx("span",{className:"text-base font-semibold text-gray-900",children:r.fixCount})}),e.jsx("td",{className:"py-4 px-4 whitespace-nowrap",children:e.jsx("span",{className:"text-base font-semibold text-green-600",children:r.activeFixCount})}),X.reviewAny>0&&e.jsx("td",{className:"py-4 px-4 whitespace-nowrap",children:e.jsx("span",{className:`text-base font-semibold ${r.reviewFixCount>0?"text-amber-600":"text-gray-400"}`,children:r.reviewFixCount})}),e.jsx("td",{className:"py-4 px-4 whitespace-nowrap",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("button",{onClick:d=>{d.stopPropagation(),Ze(r.url)},className:"px-4 py-2 text-white text-sm font-semibold rounded-lg transition-all duration-200 whitespace-nowrap shadow-xs hover:shadow-md transform hover:scale-105",style:{backgroundColor:"#0052CC"},onMouseEnter:d=>d.currentTarget.style.backgroundColor="#0041A3",onMouseLeave:d=>d.currentTarget.style.backgroundColor="#0052CC",children:"View Fixes"})})})]},r.url)})})]})})})})]}
97):ne.length===0?e.jsx(xs,{kind:Ks,domain:h||"this site",onCheckInstall:Js,onRetry:()=>h&&ge(h)}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[e.jsxs("div",{className:"relative mb-6",children:[e.jsx("div",{className:"absolute inset-0 bg-gray-100 rounded-full blur-xl opacity-50"}),e.jsx("div",{className:"relative p-6 bg-gray-50 rounded-2xl shadow-lg",children:e.jsx("svg",{className:"h-16 w-16 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})})]}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No Results Found"}),e.jsxs("p",{className:"text-gray-600 text-center max-w-md",children:['No pages match your search query "',je,'". Try a different search term.']}),e.jsx("button",{onClick:()=>ct(""),className:"mt-4 px-4 py-2 text-sm font-medium transition-colors",style:{color:"#0052CC"},onMouseEnter:r=>r.currentTarget.style.color="#003d99",onMouseLeave:r=>r.currentTarget.style.color="#0052CC",children:"Clear search"})]})})]})}),ln=()=>e.jsx("div",{className:"w-full px-2 sm:px-4 py-4 sm:py-8",children:e.jsxs("div",{className:"w-full max-w-7xl mx-auto",children:[e.jsxs("div",{className:"mb-6 sm:mb-8",children:[e.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl font-bold text-gray-900 mb-2",children:"Auto Fixes"}),e.jsx("p",{className:"text-base sm:text-lg text-gray-600",children:"View and manage your AI-powered accessibility auto-fixes across your websites"})]}),e.jsxs("div",{className:"bg-white rounded-xl sm:rounded-2xl shadow-xl p-4 sm:p-6 md:p-8 w-full",children:[e.jsxs("div",{className:"mb-6 sm:mb-8",children:[e.jsx("h2",{className:"text-xl sm:text-2xl md:text-3xl font-bold text-gray-900 mb-2 sm:mb-3",children:"Select a Domain"}),e.jsx("p",{className:"text-base sm:text-lg text-gray-600 leading-relaxed",children:"Choose a domain to view and manage its AI-powered accessibility auto-fixes."})]}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-3 sm:gap-4 mb-6",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{htmlFor:"domain-select-input-main",className:"sr-only",children:"Select a Domain"}),e.jsx(ts,{inputId:"domain-select-input-main","aria-label":"Select a Domain",options:ze,value:C,onChange:ut,onInputChange:Dt,placeholder:"Enter your Domain URL (e.g. example.com)",isSearchable:!0,isClearable:!0,isLoading:Ot,formatOptionLabel:r=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(kt,{domain:r.value,size:16,className:"shrink-0"}),e.jsx("span",{className:"truncate min-w-0",children:r.label})]}),classNamePrefix:"react-select",className:"w-full min-w-0",styles:{control:(r,l)=>({...r,borderRadius:"8px",border:l.isFocused?"2px solid #0052CC":"1px solid #e5e7eb",minHeight:"44px",boxShadow:l.isFocused?"0 0 0 3px rgba(0, 82, 204, 0.1)":"none",fontSize:"14px","@media (min-width: 640px)":{fontSize:"16px",minHeight:"48px"},"&:hover":{border:l.isFocused?"2px solid #0052CC":"1px solid #d1d5db"}}),placeholder:r=>({...r,color:"#4b5563",fontSize:"14px","@media (min-width: 640px)":{fontSize:"16px"}}),indicatorSeparator:()=>({display:"none"}),dropdownIndicator:r=>({...r,color:"#767676","&:hover":{color:"#767676"}}),clearIndicator:r=>({...r,color:"#767676","&:hover":{color:"#767676"}})}})]}),e.jsxs("button",{type:"button",className:"text-white px-4 sm:px-6 py-2 sm:py-3 rounded-lg font-medium flex items-center justify-center gap-2 transition-colors duration-200 min-w-[120px] sm:min-w-[140px] text-sm sm:text-base focus:outline-hidden focus:ring-2 focus:ring-offset-2",style:{backgroundColor:o||!h?"#9ca3af":"#0052CC","--tw-ring-color":"#0052CC"},onClick:qs,disabled:o||!h,"aria-label":o?"Finding auto fixes, please wait":"Find auto fixes",children:[o?e.jsx(Ue,{size:18,sx:{color:"white"},"aria-hidden":"true"}):e.jsx("svg",{className:"w-4 h-4 sm:w-5 sm:h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),e.jsx("span",{className:"hidden sm:inline",children:"Find Auto Fixes"}),e.jsx("span",{className:"sm:hidden",children:"Find"})]})]}),e.jsx("div",{className:"sr-only","aria-live":"polite","aria-atomic":"true",children:o&&"Finding auto fixes, please wait"})]}),e.jsxs("div",{className:"mt-8 sm:mt-10",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 sm:gap-6 mb-6 sm:mb-8",children:[e.jsxs("div",{className:"bg-white rounded-xl p-5 sm:p-6 border border-border shadow-xs hover:shadow-md transition-shadow",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"p-2.5 rounded-lg",style:{backgroundColor:"rgba(0, 82, 204, 0.1)"},children:e.jsx("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"#0052CC"},children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsx("h3",{className:"text-base sm:text-lg font-semibold text-gray-900",children:"View All Fixes"})]}),e.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:"See every AI-generated accessibility fix across your website pages, managed in one place"})]}),e.jsxs("div",{className:"bg-white rounded-xl p-5 sm:p-6 border border-border shadow-xs hover:shadow-md transition-shadow",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"p-2.5 bg-green-50 rounded-lg",children:e.jsx("svg",{className:"w-5 h-5 sm:w-6 sm:h-6 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"})})}),e.jsx("h3",{className:"text-base sm:text-lg font-semibold text-gray-900",children:"Manage Fixes"})]}),e.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:"Enable or disable specific auto-fixes based on your website's needs and preferences"})]}),e.jsxs("div",{className:"bg-white rounded-xl p-5 sm:p-6 border border-border shadow-xs hover:shadow-md transition-shadow",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"p-2.5 bg-blue-50 rounded-lg",children:e.jsx("svg",{className:"w-5 h-5 sm:w-6 sm:h-6 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})}),e.jsx("h3",{className:"text-base sm:text-lg font-semibold text-gray-900",children:"Track Progress"})]}),e.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:"Monitor accessibility improvements and track fixes across different pages and categories"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 sm:gap-6",children:[e.jsxs("div",{className:"bg-white rounded-xl p-5 sm:p-6 border border-border shadow-xs",children:[e.jsxs("h4",{className:"text-base font-semibold text-gray-900 mb-2 flex items-center gap-2",children:[e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"#0052CC"},children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"How it works"]}),e.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:"The accessibility enhancer automatically scans your website and applies fixes for common accessibility issues. You can review, enable, or disable these fixes from this dashboard."})]}),e.jsxs("div",{className:"bg-white rounded-xl p-5 sm:p-6 border border-border shadow-xs",children:[e.jsxs("h4",{className:"text-base font-semibold text-gray-900 mb-2 flex items-center gap-2",children:[e.jsx("svg",{className:"w-5 h-5 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),"Benefits"]}),e.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:"Improve your website's accessibility compliance, enhance user experience, and ensure your site is accessible to all users, including those using assistive technologies."})]})]})]})]})});return e.jsxs("div",{className:"domain-analyses-container md:h-full md:overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-stretch gap-6 p-6 h-full md:overflow-hidden",children:[z==="fixes-view"&&e.jsx("aside",{className:"lg:w-96 w-full lg:shrink-0 flex",children:e.jsxs("div",{className:"rounded-xl border-2 p-6 sticky top-4 w-full",style:{backgroundColor:"#e9ecfb",borderColor:"#0f172a14"},children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"p-2 rounded-lg",style:{backgroundColor:"rgba(0, 82, 204, 0.1)"},children:e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"#0052CC"},children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})})}),e.jsx("h2",{className:"text-sm font-bold text-gray-900",children:"Select Website"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"domain-select-input",className:"block text-xs font-medium text-gray-700 mb-2",children:"Domain name"}),e.jsx(ts,{inputId:"domain-select-input",options:ze,value:C,onChange:ut,onInputChange:Dt,placeholder:"Select a domain or paste a URL",isSearchable:!0,isClearable:!0,isLoading:Ot,formatOptionLabel:r=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(kt,{domain:r.value,size:16,className:"shrink-0"}),e.jsx("span",{className:"truncate min-w-0",children:r.label})]}),classNamePrefix:"react-select",className:"w-full",styles:{control:r=>({...r,maxWidth:"100%",borderColor:"#d1d5db","&:hover":{borderColor:"#9ca3af"}}),menu:r=>({...r,maxWidth:"100%"})}})]})]}),Ut.length>0&&e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:e.jsx("svg",{className:"w-4 h-4 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),e.jsx("h2",{className:"text-sm font-bold text-gray-900",children:"Pages"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("button",{onClick:()=>v("all"),className:`page-button w-full flex items-center justify-between px-3.5 py-2.5 rounded-lg text-sm font-medium transition-all ${u==="all"?"text-white shadow-md":"bg-white text-gray-700 hover:bg-gray-50 border border-border"}`,style:u==="all"?{backgroundColor:"#0052CC"}:{},children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})}),"All Pages"]}),e.jsx("span",{className:`px-2.5 py-1 rounded-full text-xs font-semibold ${u==="all"?"text-white":"bg-gray-200 text-gray-700"}`,style:u==="all"?{backgroundColor:"rgba(255,255,255,0.2)"}:{},children:nn})]}),e.jsx("div",{className:"pages-list-scrollable max-h-[400px] overflow-y-auto pr-1",children:e.jsx("div",{className:"space-y-1.5",children:Ut.map(({url:r,count:l})=>{let d="/";try{d=new URL(r).pathname||"/"}catch{d=r}return e.jsxs("button",{onClick:()=>v(r),className:`page-button w-full flex items-center justify-between px-3.5 py-2.5 rounded-lg text-sm font-medium transition-all ${u===r?"text-white shadow-md":"bg-white text-gray-700 hover:bg-gray-50 border border-border"}`,style:u===r?{backgroundColor:"#0052CC"}:{},children:[e.jsx("span",{className:"truncate flex-1 text-left",children:d}),e.jsx("span",{className:`px-2.5 py-1 rounded-full text-xs font-semibold ml-2 ${u===r?"text-white":"bg-gray-200 text-gray-700"}`,style:u===r?{backgroundColor:"rgba(255,255,255,0.2)"}:{},children:l})]},r)})})})]})]}),ht.length>0&&e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"p-2 bg-red-50 rounded-lg",children:e.jsx("svg",{className:"w-4 h-4 text-red-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),e.jsx("h2",{className:"text-sm font-bold text-gray-900",children:"Impact"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("button",{onClick:()=>P("all"),className:`page-button w-full flex items-center justify-between px-3.5 py-2.5 rounded-lg text-sm font-medium transition-all ${A==="all"?"text-white shadow-md":"bg-white text-gray-700 hover:bg-gray-50 border border-border"}`,style:A==="all"?{backgroundColor:"#0052CC"}:{},children:[e.jsx("span",{children:"All Impacts"}),e.jsx("span",{className:`px-2.5 py-1 rounded-full text-xs font-semibold ${A==="all"?"text-white":"bg-gray-200 text-gray-700"}`,style:A==="all"?{backgroundColor:"rgba(255,255,255,0.2)"}:{},children:Ht})]}),ht.map(({impact:r,count:l})=>e.jsxs("button",{onClick:()=>P(r),className:`page-button w-full flex items-center justify-between px-3.5 py-2.5 rounded-lg text-sm font-medium transition-all ${A===r?"text-white shadow-md":"bg-white text-gray-700 hover:bg-gray-50 border border-border"}`,style:A===r?{backgroundColor:"#0052CC"}:{},children:[e.jsx("span",{className:"capitalize",children:r}),e.jsx("span",{className:`px-2.5 py-1 rounded-full text-xs font-semibold ${A===r?"text-white":"bg-gray-200 text-gray-700"}`,style:A===r?{backgroundColor:"rgba(255,255,255,0.2)"}:{},children:l})]},r))]})]}),pt.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"p-2 bg-green-50 rounded-lg",children:e.jsx("svg",{className:"w-4 h-4 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"})})}),e.jsx("h2",{className:"text-sm font-bold text-gray-900",children:"Category"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("button",{onClick:()=>te("all"),className:`page-button w-full flex items-center justify-between px-3.5 py-2.5 rounded-lg text-sm font-medium transition-all ${L==="all"?"text-white shadow-md":"bg-white text-gray-700 hover:bg-gray-50 border border-border"}`,style:L==="all"?{backgroundColor:"#0052CC"}:{},children:[e.jsx("span",{children:"All Categories"}),e.jsx("span",{className:`px-2.5 py-1 rounded-full text-xs font-semibold ${L==="all"?"text-white":"bg-gray-200 text-gray-700"}`,style:L==="all"?{backgroundColor:"rgba(255,255,255,0.2)"}:{},children:qt})]}),pt.map(({category:r,count:l})=>e.jsxs("button",{onClick:()=>te(r),className:`page-button w-full flex items-center justify-between px-3.5 py-2.5 rounded-lg text-sm font-medium transition-all ${L===r?"text-white shadow-md":"bg-white text-gray-700 hover:bg-gray-50 border border-border"}`,style:L===r?{backgroundColor:"#0052CC"}:{},children:[e.jsx("span",{className:"capitalize",children:r.replace(/_/g," ")}),e.jsx("span",{className:`px-2.5 py-1 rounded-full text-xs font-semibold ${L===r?"text-white":"bg-gray-200
97 text-gray-700"}`,style:L===r?{backgroundColor:"rgba(255,255,255,0.2)"}:{},children:l})]},r))]})]}),(u!=="all"||m!=="all"||A!=="all"||L!=="all")&&e.jsx("div",{className:"mt-6 pt-6 border-t border-border",children:e.jsxs("button",{onClick:()=>{v("all"),O("all"),P("all"),te("all")},className:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-red-600 text-white text-sm font-semibold rounded-lg hover:bg-red-700 transition-all shadow-md hover:shadow-lg transform hover:scale-[1.02]",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Clear All Filters"]})})]})}),e.jsxs("main",{className:"flex-1 min-w-0 flex md:overflow-hidden",children:[!t&&z==="domain-selection"&&ln(),z==="url-list"&&an(),z==="fixes-view"&&e.jsxs("div",{className:"bg-white rounded-xl border-2 p-4 sm:p-6 md:p-7 w-full max-w-full overflow-hidden",style:{borderColor:"#0f172a14"},children:[e.jsxs("div",{className:"flex flex-col gap-4 mb-7 pb-6 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:Ys,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",title:"Back to pages",children:e.jsx("svg",{className:"w-5 h-5 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})})}),e.jsx("div",{className:"p-2.5 rounded-lg shadow-md",style:{backgroundColor:"#0052CC"},children:e.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h1",{className:"text-xl md:text-2xl lg:text-3xl font-bold text-gray-900",children:"Auto Fixes"}),u!=="all"&&e.jsx("p",{className:"text-sm text-gray-600 mt-1 truncate",children:u})]})]}),be.length>0&&e.jsxs("p",{className:"text-sm text-gray-600 flex items-center gap-2 sm:ml-14",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full animate-pulse",style:{backgroundColor:"#0052CC"}}),be.length," ",m==="review"?"AI suggestion":"AI auto-fix",be.length!==1?m==="review"?"s":"es":"",m==="review"?" for your review":m==="deleted"?" disabled":m==="active"?" active":""]}),G.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-2.5",children:[e.jsx("button",{onClick:()=>O("all"),className:`filter-button px-4 py-2 rounded-lg text-xs font-semibold transition-all ${m==="all"?"text-white shadow-md":"bg-gray-100 text-gray-700 hover:bg-gray-200 border border-border"}`,style:m==="all"?{backgroundColor:"#0052CC"}:{},children:"All"}),e.jsx("button",{onClick:()=>O("active"),className:`filter-button px-4 py-2 rounded-lg text-xs font-semibold transition-all ${m==="active"?"text-white shadow-md":"bg-gray-100 text-gray-700 hover:bg-gray-200 border border-border"}`,style:m==="active"?{backgroundColor:"#16a34a"}:{},children:"Enabled"}),Xe>0&&e.jsxs("button",{onClick:()=>O("review"),className:`filter-button px-4 py-2 rounded-lg text-xs font-semibold transition-all flex items-center gap-1.5 ${m==="review"?"text-white shadow-md":"bg-gray-100 text-gray-700 hover:bg-gray-200 border border-border"}`,style:m==="review"?{backgroundColor:"#f59e0b"}:{},children:["Needs Review",e.jsx("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 rounded-full text-[10px] font-bold",style:{backgroundColor:m==="review"?"#ffffff"
97:"#f59e0b",color:m==="review"?"#f59e0b":"#ffffff"},children:mt})]}),m==="review"&&e.jsxs("label",{className:"filter-button px-3 py-2 rounded-lg text-xs font-medium transition-all flex items-center gap-1.5 bg-gray-100 text-gray-700 border border-border hover:bg-gray-200 cursor-pointer select-none",title:"Empty-value fixes have no accessible name to apply and can never go live. Hidden by default.",children:[e.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 accent-amber-500 cursor-pointer",checked:a,onChange:r=>k(r.target.checked)}),"Hide empty (not applicable)"]})]})]}),o?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(Ue,{size:40})}):g?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx("p",{className:"text-red-600 mb-4",children:g}),e.jsx("button",{onClick:()=>h&&ge(h),className:"px-4 py-2 text-white rounded-xs transition-colors",style:{backgroundColor:"#0052CC"},onMouseEnter:r=>r.currentTarget.style.backgroundColor="#0041A3",onMouseLeave:r=>r.currentTarget.style.backgroundColor="#0052CC",children:"Retry"})]}):S?m==="review"?e.jsx(zs,{reviewFixes:Qs,coverage:Pt,onBulkAction:Yt}):be.length>0?e.jsxs("div",{className:"w-full",children:[e.jsx("div",{className:"grid grid-cols-1 gap-8 w-full pt-2",children:be.slice(0,E).map(({fix:r,url:l,analysisId:d,fixIndex:b})=>{const j=`${d}-${b}`;return e.jsx(Fs,{fix:r,url:l,onRemove:()=>Qt(d,b),onRestore:()=>Zt(d,b),isUpdating:$===j},j)})}),E<be.length&&e.jsx("div",{className:"flex justify-center py-8",children:e.jsxs("button",{onClick:()=>J(r=>r+N),className:"px-5 py-2.5 rounded-lg text-sm font-semibold border border-border bg-white text-gray-700 hover:bg-gray-50 shadow-xs transition-all",children:["Load"," ",Math.min(N,be.length-E)," ","more (",E," of ",be.length," shown)"]})})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[e.jsx("div",{className:"mb-6 p-6 bg-green-50 rounded-2xl",children:e.jsx("svg",{className:"h-16 w-16 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:m==="deleted"?"No Disabled Auto-Fixes":m==="active"?"No Enabled Auto-Fixes":"All Clear!"}),e.jsx("p",{className:"text-gray-600 text-center max-w-md",children:m==="deleted"?"No disabled auto-fixes found for the selected filters":m==="active"?"No enabled auto-fixes found for the selected filters":"No auto-fixes found for this website. The enhancer has not applied any fixes yet."})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[e.jsxs("div",{className:"relative mb-6",children:[e.jsx("div",{className:"absolute inset-0 rounded-full blur-xl opacity-50 animate-pulse",style:{backgroundColor:"rgba(0, 82, 204, 0.2)"}}),e.jsx("div",{className:"relative p-6 rounded-2xl shadow-lg",style:{backgroundColor:"rgba(0, 82, 204, 0.1)"},children:e.jsx("svg",{className:"h-16 w-16",style:{color:"#0052CC"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})})]}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Get Started"}),e.jsx("p",{className:"text-gray-600 text-center max-w-md",children:"Select a website from the left sidebar to view its auto-fixes"})]})]})]})]}),V&&e.jsx(si,{dialogRef:me,onClose:zt,sliderUrl:_,sliderTab:ce,exportMenuOpen:ie,setExportMenuOpen:I,exportDisabled:Vt.length===0,onExportCSV:en,onExportJSON:tn,onCopyForAI:sn,t:n,filter:m,setFilter:O,impacts:ht,categories:pt,selectedImpact:A,setSelectedImpact:P,selectedCategory:L,setSelectedCategory:te,impactDropdownOpen:Re,setImpactDropdownOpen:_e,categoryDropdownOpen:at,setCategoryDropdownOpen:lt,allImpactsCount:Ht,allCategoriesCount:qt,sliderFixes:Pe,sliderReviewCount:Gt,pageHtml:se,fetchPageHtml:De,sliderAnalysis:B,pageHtmlView:qe,setPageHtmlView:Ie,suggestedFixes:R,suggestedFixesLoading:ve,fetchSuggestedFixes:Us,handleAcceptSuggestedFix:Vs,handleRejectSuggestedFix:Hs,acceptingFixKey:Ps,loader:o,error:g,selectedDomain:h,fetchAnalyses:ge,reviewCoverage:Pt,onBulkAction:Yt,handleRemoveClick:Qt,handleRestoreClick:Zt,updatingFixId:$}),e.jsx(ni,{bulkConfirm:Ke,bulkRunning:Et,onClose:()=>dt(null),onConfirm:on}),e.jsx(fs,{isOpen:fe.isOpen,ariaLabelledBy:"confirm-modal-title",onClose:()=>Oe({isOpen:!1,type:"remove",analysisId:"",fixIndex:-1}),children:e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:`p-3 rounded-full ${fe.type==="remove"?"bg-red-100":"bg-green-100"}`,children:fe.type==="remove"?e.jsx("svg",{className:"w-6 h-6 text-red-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}):e.jsx("svg",{className:"w-6 h-6 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsx("h2",{id:"confirm-modal-title",className:"text-xl font-bold text-gray-900",children:fe.type==="remove"?"Disable Auto-Fix?":"Enable Auto-Fix?"})]}),e.jsx("p",{className:"text-gray-700 mb-6",children:fe.type==="remove"?"Are you sure you want to disable this auto-fix? The enhancer will stop applying this fix to your website.":"Are you sure you want to enable this auto-fix? The enhancer will start applying this fix to your website."}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{onClick:()=>Oe({isOpen:!1,type:"remove",analysisId:"",fixIndex:-1}),className:"px-4 py-2 text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors font-medium",children:"Cancel"}),e.jsx("button",{onClick:rn,disabled:$!==null,className:"px-4 py-2 text-white rounded-lg transition-opacity font-medium hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:fe.type==="remove"?"#dc2626":"#15803d"},children:$!==null?fe.type==="remove"?"Disabling...":"Enabling...":fe.type==="remove"?"Disable":"Enable"})]})]})})]})};export{ji as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.