1import{j as e,_ as re,c as ce,r,u as oe,cH as de,l as c,cp as xe,cI as W,cJ as ue,aR as N,b0 as me,b1 as pe,cK as $,$ as k,cL as fe,au as he}from"./index-B5VVhelE.js";import{A as f}from"./ArrowButton-B2ynqkAV.js";import{c as ge}from"./clock-DRzDJp1a.js";import{A as D}from"./activity-WLD0SV_M.js";import{c as je}from"./check-circle-9qnyWhV_.js";import{S as we}from"./ScanningProgress-D9qFz0Nj.js";import{i as Se,g as ye}from"./TeamsService-CpdyVebs.js";import{S as be}from"./ScanGlobalLayout-DlpmqxPv.js";import{f as Ne}from"./formatDateAndTime-Co87W52X.js";import{A as ve}from"./Activity-B-5dERQV.js";import{m as Ce}from"./mapFileTypes-CWO8uMMJ.js";import"./close-CRvejc1V.js";const ke=({color:t="#093B42",size:l=20,opacity:s=.7})=>e.jsx("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:l,height:l,viewBox:"0 0 20 20",fill:"none",children:e.jsxs("g",{opacity:s,children:[e.jsx("path",{d:"M15.7033 2.66406H4.29568C3.39564 2.66406 2.66602 3.39369 2.66602 4.29373V15.7014C2.66602 16.6014 3.39564 17.3311 4.29568 17.3311H15.7033C16.6034 17.3311 17.333 16.6014 17.333 15.7014V4.29373C17.333 3.39369 16.6034 2.66406 15.7033 2.66406Z",stroke:t,strokeWidth:"1.4667",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M6.94393 8.16325C7.61896 8.16325 8.16618 7.61603 8.16618 6.941C8.16618 6.26597 7.61896 5.71875 6.94393 5.71875C6.2689 5.71875 5.72168 6.26597 5.72168 6.941C5.72168 7.61603 6.2689 8.16325 6.94393 8.16325Z",stroke:t,strokeWidth:"1.4667",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M17.3324 12.3308L13.131 8.16406L3.8877 17.3309",stroke:t,strokeWidth:"1.4667",strokeLinecap:"round",strokeLinejoin:"round"})]})}),Pe=({size:t=20,strokeColor:l="#093B42"})=>e.jsx("svg",{"aria-hidden":"true",width:t,height:t,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxs("g",{opacity:"0.7",children:[e.jsx("path",{d:"M18 10H2",stroke:l,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M4.76 4.48956L2 10.0016V14.8016C2 15.2259 2.16857 15.6329 2.46863 15.9329C2.76869 16.233 3.17565 16.4016 3.6 16.4016H16.4C16.8243 16.4016 17.2313 16.233 17.5314 15.9329C17.8314 15.6329 18 15.2259 18 14.8016V10.0016L15.24 4.48956C15.1075 4.22299 14.9033 3.99866 14.6504 3.84179C14.3974 3.68491 14.1057 3.60172 13.808 3.60156H6.192C5.89433 3.60172 5.60261 3.68491 5.34964 3.84179C5.09666 3.99866 4.89246 4.22299 4.76 4.48956Z",stroke:l,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M5.20117 13.2031H5.20913",stroke:l,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8.40039 13.2031H8.40835",stroke:l,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})}),Te={scan:{scanId:"",title:"Initialising Scan...",status:"Starting",totalIssues:0,url:"Preparing scan...",scheduledTime:new Date().toISOString(),engine:"Default",compliance:"Standard",scannedPages:0,totalPages:0,mediaTypes:[]}},Ie=async t=>{try{if(!await Se())return;const s=await ye(),d=new AbortController,o=setTimeout(()=>d.abort(),1e4),i=await fetch("https://nfmb8ev6g7.execute-api.eu-west-1.amazonaws.com/default/send-teams-notification",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scanData:t,credentials:{accessToken:s.accessToken,refreshToken:s.refreshToken,expiresAt:s.expiresAt,userId:s.userId}}),signal:d.signal});clearTimeout(o);const u=await i.json();if(!i.ok){const g=new Error(i.statusText);throw g.response={status:i.status,data:u},g}u.success||c("Failed to send Teams notification:",u.error)}catch(l){c("Error sending Teams notification:",l);const s=l;s!=null&&s.response&&(c("Response status:",s.response.status),c("Response data:",s.response.data))}},Ee=t=>t?t==="IN_PROGRESS"?"In Progress":t==="STOPPING"?"Stopping":t:"Starting",H=(t,l)=>{const s=t||"",d=s.toUpperCase();return l&&!$(l)&&d==="PENDING"?"IN_PROGRESS":s},Le=(t="")=>String(t).charAt(0).toUpperCase()+String(t).slice(1).toLowerCase(),Ae=t=>{const l=Ee(t.status),s=t.crawledPages||t.totalPages||0,d=t.scannedPages||0,o=t.totalIssues||0;let i=`${l}. `;return s>0&&(i+=`${s} pages found. `),d>0&&(i+=`${d} pages analysed. `),o>0&&(i+=`${o} issues found. `),t.status==="COMPLETED"?i+="Scan completed successfully.":t.status==="IN_PROGRESS"?i+="Scan is currently in progress.":t.status==="STOPPING"?i+="Scan is being stopped.":t.status==="FAILED"?i+="Scan failed.":t.status==="STOPPED"&&(i+="Scan was stopped."),i},Ze=()=>{var L,A,F,R,O;const{scanId:t}=re(),l=ce(),[s,d]=r.useState(Te),[o,i]=r.useState(!1),[u,g]=r.useState(!1),[Be,z]=r.useState(0),[h,m]=r.useState(!1),[P,M]=r.useState(""),[U,j]=r.useState(""),[w,S]=r.useState(""),[x,y]=r.useState(!1),[T,I]=r.useState(!1),q=r.useRef(null);(L=l.state)!=null&&L.fromVerifiedRedirect;const p=oe(),[V,E]=r.useState(!1),K=async()=>{try{t&&(await navigator.clipboard.writeText(t),E(!0),setTimeout(()=>E(!1),2e3))}catch(a){c("Failed to copy text:",a)}},Y=a=>{if(l.state&&l.state.fromCrawlAccessibility)return"Dual Engine";if(!a)return"Default";if(Array.isArray(a)){if(a.length===2)return"Dual Engine";if(a.length===1)a=a[0];else return a.join(", ")}const n=String(a).toLowerCase();return n==="htmlcs"||n==="html-code-sniffer"||n==="html_code_sniffer"?"Html Code Sniffer":n==="axe"||n==="axe-core"?"Axe Core":Le(n)},v=r.useCallback(async()=>{var a;if(t)try{const n=await de(t);n&&(d(n),i(!0),x&&((a=n==null?void 0:n.scan)==null?void 0:a.status)==="STOPPED"&&(y(!1),m(!1)))}catch(n){c("Error fetching scan data:",n)}},[t,x,p]);r.useEffect(()=>{var _,G;const a=()=>
1{if(s.scan.createdAt){const le=new Date(s.scan.createdAt),ie=Math.floor((new Date().getTime()-le.getTime())/1e3);z(ie)}};v(),a();let n;return(((_=s==null?void 0:s.scan)==null?void 0:_.status)==="IN_PROGRESS"||x||!["COMPLETED","STOPPED","FAILED"].includes(((G=s==null?void 0:s.scan)==null?void 0:G.status)||""))&&(n=setInterval(()=>{v(),a()},5e3)),()=>{n&&clearInterval(n)}},[v,t,s.scan.status,s.scan.createdAt,x]),r.useEffect(()=>{if(o&&s.scan.status){const a=s.scan.status,n=Ae(s.scan);a!==P&&(j(n),M(a),setTimeout(()=>{j("")},1e3))}},[o,s.scan.status,s.scan.scannedPages,s.scan.totalPages,s.scan.totalIssues,P]),r.useEffect(()=>{s.scan.status!="IN_PROGRESS"&&s.scan.status!="STOPPING"&&o&&t&&!x&&(u||(Ie(s.scan),g(!0)))},[s.scan.status,o,t,p,u,x]);const Z=[{icon:D,label:"Scan Name",value:s.scan.title&&s.scan.title.trim()!==""?s.scan.title:"Unnamed Scan"},{icon:ge,label:"Scheduled for",value:s.scan.scheduledTime?Ne(s.scan.scheduledTime).date:"Now"},{icon:e.jsx(Pe,{}),label:"Engine",value:Y(s.scan.engine)},{icon:D,label:"Scan Size",value:(()=>{const a=s.scan.reqPageCount??0,n=xe.find(B=>B.value===a);return n?n.label:a===0?"Single Page":a>=1e3?"Full Site":a>0?`${a} Pages`:"Unknown"})()},{icon:je,label:"Compliance",value:s.scan.complianceSelected?W(Array.isArray(s.scan.complianceSelected)?s.scan.complianceSelected.join(", "):String(s.scan.complianceSelected)):s.scan.compliance?W(s.scan.compliance):"Europ (EAA)"},{icon:e.jsx(ke,{}),label:"Find File Types",value:Ce(s.scan.mediaTypes)}],J=a=>a?a==="PENDING"?e.jsxs("div",{children:[e.jsx(f,{label:"Cancel",onClick:X,disabled:T,isLoading:T}),w&&e.jsx("div",{className:"mt-2 text-red-600 text-sm",children:w})]}):a==="IN_PROGRESS"&&!x?e.jsxs("div",{children:[e.jsx(f,{label:"Stop",onClick:Q,disabled:h,isLoading:h}),w&&e.jsx("div",{className:"mt-2 text-red-600 text-sm",children:w})]}):a==="IN_PROGRESS"&&x?e.jsx("div",{children:e.jsx(f,{label:"Stop",onClick:()=>{},disabled:!0,isLoading:!0})}):a==="STOPPED"?e.jsxs("div",{className:"flex flex-wrap items-start gap-4 flex-row items-center justify-between w-full xl:flex-col xl:items-start xl:justify-start",children:[e.jsx("a",{href:"/app/scans",className:"text-primary font-aeonik text-[16px] font-medium leading-6 link-underline focus:outline-none focus-visible:border-[2px] focus-visible:border-focus-blue",children:"Dashboard"}),e.jsx(f,{label:"Result",onClick:()=>{p(`/scans/${t}`)},disabled:h})]}):a!=="IN_PROGRESS"?e.jsxs("div",{className:"flex flex-wrap items-start gap-4 flex-row items-center justify-between w-full xl:flex-col xl:items-start xl:justify-start",children:[e.jsx("a",{href:"/app/scans",className:"text-primary font-aeonik text-base font-medium leading-6 link-underline",children:"Dashboard"}),e.jsx(f,{label:"Result",onClick:()=>{p(`/scans/${t}`)},disabled:h})]}):e.jsxs("div",{className:"flex items-center justify-between gap-4 w-full xl:flex-col xl:items-start xl:justify-start",children:[e.jsx("a",{href:"/app/scans",className:"text-primary font-aeonik text-base font-medium leading-6 link-underline",children:"Dashboard"}),e.jsx(f,{label:"Result",onClick:()=>{p(`/scans/${t}`)},disabled:h})]}):"Starting",Q=async()=>{if(!t){c("scanId is required");return}m(!0),S(""),y(!0);try{const a=await he(t,"fullSite");a.status&&a.message==="Execution stopped successfully"?j("Scan stop request sent successfully. Please wait..."):(c("Failed to stop scan:",a),S("Failed to stop scan. Please try again."),m(!1),y(!1))}catch(a){c("Error stopping scan:",a),S("Error occurred while stopping scan. Please try again."),m(!1),y(!1)}},X=async()=>{if(!t){c("scanId is required");return}m(!0),I(!0);try{await fe(t),j("Scheduled scan cancelled successfully."),p("/scans")}catch(a){c("Error cancelling scheduled scan:",a),S("Failed to cancel scheduled scan. Please try again."),m(!1),I(!1)}},ee="https://www.nexusinclusion.com/",C=s.scan.screenshotS3Key||s.scan.screenshotS3KeyDesktop||s.scan.screenshotS3KeyMobile,se=C?`${ee}${C}`:"",te=H((A=s==null?void 0:s.scan)==null?void 0:A.status,(F=s==null?void 0:s.scan)==null?void 0:F.scheduledTime),b=ue(s.scan.url),ae=e.jsx("a",{href:s.scan.url&&s.scan.url.trim()!==""?s.scan.url:"#",target:"_blank",rel:"noopener noreferrer",className:"font-medium breadcrumb-underline [text-decoration-skip-ink:none] focus:outline-none focus-visible:outline-none focus:ring-0 focus-visible:ring-0 max-w-full inline-block [overflow-wrap:anywhere]",title:b,children:b&&b.trim()!==""?b:"Unnamed Scan"}),ne=e.jsxs("div",{className:"w-full",children:[J(te),s.scan.status==="Completed"&&e.jsx("span",{className:"mt-2 inline-block px-2 py-1 text-[14px] rounded-lg bg-green-100 text-green-800",children:"Teams notification sent â
"})]});return e.jsxs(be,{isInitializing:!o,loadedWidthClassName:"mx-4 md:mx-0 sm:max-w-[448px] lg:max-w-[704px] xl:max-w-[832px] 2xl:max-w-[976px] 3xl:max-w-[1200px]",children:[e.jsx("div",{ref:q,"aria-live":"polite","aria-atomic":"true",className:"sr-only",role:"status",children:U}),e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row lg:gap-8 mb-8",children:[e.jsxs("div",{className:"flex flex-col flex-1",children:[e.jsx(Fe,{websiteUrlLink:ae}),e.jsxs("div",{className:"flex max-xl:flex-col flex-row gap-8 w-full min-w-0 lg:flex-1",children:[e.jsx("div",{className:"flex flex-col justify-end shrink-0 max-xl:order-last",children:e.jsx("div",{children:ne})}),e.jsx("div",{className:"w-full min-w-0 flex flex-col lg:flex-1 h-full",children:e.jsxs("div",{className:"rounded-xl bg-gray-100 overflow-hidden flex flex-col min-h-[238px] xs:min-h-[280px]",children:[s.scan.status!=="FAILED"&&e.jsxs("div",{className:"bg-[#F4F5F6] flex-1 flex flex-col p-6",children:[e.jsx(Re,{}),e.jsx(Oe,{screenshotKey:C,scanData:s,screenshotUrl:se})]}),s.scan.status==="FAILED"&&e.jsxs("div",{className:"bg-surface flex-1 flex flex-col p-[18px]",children:[e.jsx("div",{className:"w-full h-[19.741px] bg-primary py-1 rounded-t-[11px] flex items-center px-3 shrink-0",children:e.jsxs("div",{className:"flex space-x-2","aria-hidden":"true",children:[e.jsx("div",{className:"w-[6.344px] h-[6.344px] bg-[#F32FAA] rounded-full"}),e.jsx("div",{className:"w-[6.344px] h-[6.344px] bg-[#77CFBF] rounded-full"}),e.jsx("div",{className:"w-[6.344px] h-[6.344px] bg-white rounded-full"})]})}),e.jsxs("div",{className:"w-full flex-1 flex flex-col items-center bg-white justify-center px-4",children:[e.jsxs("div",{className:"flex flex-col items-center sm:flex-row sm:items-center gap-[8px] mt-[37px]",children:[e.jsx(N,{size:35,color:"#BC2A40",opacity:1,borderColor:"#BC2A40"}),e.jsxs("h2",{className:"text-[14px] text-error-red font-medium text-center sm:text-start",children:[t,": Failed to Scan the website."]})]}
1),e.jsx("p",{className:"text-[14px] font-medium mt-[22px] text-center",children:"The website URL may be invalid, the site may not exist, or it is currently unreachable."}),e.jsxs("div",{className:"mt-[22px] mb-[38px] flex flex-wrap items-center justify-center gap-[9px]",children:[e.jsx("span",{className:"text-base shrink-0",children:e.jsx(ve,{opacity:1})}),e.jsxs("p",{className:"text-[14px] font-medium text-center min-w-0 [overflow-wrap:anywhere]",children:["Scan ID: ",t]}),e.jsx("button",{onClick:K,className:" hover:bg-downy-100 rounded-full transition-colors duration-200",title:"Copy the text",children:V?e.jsx(me,{size:15}):e.jsx(pe,{size:15,color:"#093b42"})})]})]})]})]})})]})]}),e.jsxs("section",{"aria-labelledby":"scan-summary-heading",className:"relative mt-8 lg:mt-0 flex justify-center w-full lg:w-[236px] shrink-0 bg-[#F4F5F6] rounded-[20px] px-[41px] xl:pt-[96px] xl:pb-[95px] lg:py-[90px] py-[66px] lg:mt-[91px] xl:mt-0",children:[e.jsx("h2",{id:"scan-summary-heading",className:"sr-only",children:"Scan Summary"}),e.jsx(we,{scheduledDateTime:(R=s==null?void 0:s.scan)==null?void 0:R.scheduledTime,scannedPages:s.scan.scannedPages,totalPages:s.scan.crawledPages,reqPageCount:s.scan.reqPageCount,status:x?"STOPPING":H(s.scan.status,s.scan.scheduledTime),scaningInputType:(O=s==null?void 0:s.scan)==null?void 0:O.scaningInputType})]})]}),e.jsx("section",{children:e.jsx("div",{className:"bg-[#F4F5F6] rounded-xl w-full p-6",children:e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-x-8 gap-y-6",children:Z.map((a,n)=>e.jsxs("div",{className:"flex items-start space-x-2 text-gray-700 min-w-0",children:[e.jsx("span",{className:"text-base shrink-0 mt-0.5",children:typeof a.icon=="string"?e.jsx("img",{src:a.icon,alt:"",className:"w-5 h-5"}):a.icon}),e.jsx("span",{className:"text-primary text-[16px] font-medium min-w-0 [overflow-wrap:anywhere]",children:e.jsxs("span",{children:[e.jsxs("span",{children:[a.label,":"]})," ",a.value]})})]},n))})})})]})]})},Fe=({websiteUrlLink:t})=>e.jsxs("div",{className:"mb-[7px]",children:[e.jsx("h1",{className:"text-[28px] md:text-[40px] mb-[20px] leading-[44px]",children:"Scanning Website"}),e.jsx("p",{className:"text-[14px] leading-[20px]",children:t})]}),Re=()=>e.jsx("div",{className:"w-full h-[19.741px] bg-primary py-1 rounded-t-[11px] flex items-center px-3 shrink-0",children:e.jsxs("div",{className:"flex space-x-2","aria-hidden":"true",children:[e.jsx("div",{className:"w-[6.344px] h-[6.344px] bg-[#F32FAA] rounded-full"}),e.jsx("div",{className:"w-[6.344px] h-[6.344px] bg-[#77CFBF] rounded-full"}),e.jsx("div",{className:"w-[6.344px] h-[6.344px] bg-white rounded-full"})]})}),Oe=({screenshotKey:t,scanData:l,screenshotUrl:s})=>!t&&l.scan.status==="IN_PROGRESS"?e.jsxs("div",{className:"w-full flex-1 flex flex-col items-center bg-white justify-center px-4 py-4",children:[e.jsxs("div",{className:"w-full sm:w-auto flex flex-col items-start sm:flex-row sm:items-center sm:justify-center gap-[10px] sm:mt-[29px]",children:[e.jsx(N,{color:"#093B42",opacity:1,borderColor:"#FFB700",size:36}),e.jsx("h2",{className:"text-[20px] font-medium",children:"We've started scanning"})]}),e.jsx("p",{className:"text-[14px] font-medium mt-[10px] text-center",children:"This could take a little while. Once the scan is complete, we'll send you an email. You can close this window or go explore our other tools."}),e.jsx("div",{className:"mt-[10px]",children:e.jsx(k,{bgColor:"",className:"mb-[28px]",classSize:"w-4 h-4"})})]}):t?e.jsx("div",{className:"h-[238px] xs:h-[213px] overflow-hidden rounded-b-[11px]",children:e.jsx("img",{src:s,alt:`Screenshot of ${l.scan.title}`,className:"w-full flex-1 min-h-0 object-cover object-top"})}):$(l.scan.scheduledTime)?e.jsxs("div",{className:"w-full flex-1 flex flex-col items-center bg-white justify-center px-4 py-4",children:[e.jsxs("div",{className:"w-full sm:w-auto flex flex-col items-start sm:flex-row sm:items-center sm:justify-center gap-[10px] sm:mt-[29px]",children:[e.jsx(N,{color:"#093B42",opacity:1,borderColor:"#FFB700",size:36}),e.jsx("h2",{className:"text-[20px] font-medium",children:"Waiting for scan to start"})]}
1),e.jsx("p",{className:"text-[14px] font-medium mt-[10px] text-center",children:"Your scan is scheduled. It will start at the scheduled time."}),e.jsx("div",{className:"mt-[10px]",children:e.jsx(k,{bgColor:"",className:"mb-[28px]",classSize:"w-4 h-4"})})]}):e.jsxs("div",{className:"w-full flex-1 flex flex-col items-center bg-white justify-center px-4 py-4",children:[e.jsxs("div",{className:"w-full sm:w-auto flex flex-col items-start sm:flex-row sm:items-center sm:justify-center gap-[10px] sm:mt-[29px]",children:[e.jsx(N,{color:"#093B42",opacity:1,borderColor:"#FFB700",size:36}),e.jsx("h2",{className:"text-[20px] font-medium",children:"We've started scanning"})]}),e.jsx("p",{className:"text-[14px] font-medium mt-[10px] text-center",children:"This could take a little while. Once the scan is complete, we'll send you an email. You can close this window or go explore our other tools."}),e.jsx("div",{className:"mt-[10px]",children:e.jsx(k,{bgColor:"",className:"mb-[28px]",classSize:"w-4 h-4"})})]});export{Ze 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.