1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/abap-DV77hVRW.js","assets/vendor-react-CCzXVbVA.js","assets/actionscript-DyLB7uHw.js","assets/ada-Bbs6w9PW.js","assets/apacheconf-CF35fTgE.js","assets/apl-BwNbAB7u.js","assets/applescript-DEbrK4Bt.js","assets/arduino-DZL-rctD.js","assets/cpp-DKX38ie2.js","assets/c-EFsh0Kpo.js","assets/arff-BoEy5Wq_.js","assets/asciidoc-B3sIlHlS.js","assets/asm6502-Dt5_Odzp.js","assets/aspnet-Dk6GV6eJ.js","assets/autohotkey-fkFS83wa.js","assets/autoit-Bg7g0MbF.js","assets/bash-BNPaHgfZ.js","assets/basic-C8AifFEy.js","assets/basic-DQBW5pFs.js","assets/batch-4RoY8fiZ.js","assets/bison-9QtFr8is.js","assets/brainfuck-DCtp19vS.js","assets/bro-CIeVpz55.js","assets/c-B91oWTYA.js","assets/clike-CNLvFxhW.js","assets/clike-CMm-llNk.js","assets/clojure-CAcggENr.js","assets/coffeescript-BBKvmWx9.js","assets/cpp-CO_rCUKB.js","assets/crystal-XsnrHCJ5.js","assets/ruby-BCXfb5tZ.js","assets/csharp-CC26C9-k.js","assets/csp-C08hbhUA.js","assets/css-extras-DYOxGPth.js","assets/css-k6r86-iN.js","assets/css-CMOIwA3Q.js","assets/d-Cc9C-Yvc.js","assets/dart-B_Gq3XQR.js","assets/diff-Dv05AY6T.js","assets/django-Dv6Tdw-C.js","assets/markup-templating-BxAVv-bL.js","assets/docker-ppZBCUij.js","assets/eiffel-BXloJmWS.js","assets/elixir-2JBMbTIi.js","assets/elm-9A7_OO51.js","assets/erb-C_e7Wzgw.js","assets/erlang-fmRyNVcI.js","assets/flow-gvc6574u.js","assets/fortran-CSMKvG9N.js","assets/fsharp-DmQ01A72.js","assets/gedcom-XXLeDdMq.js","assets/gherkin-YnzMcuXB.js","assets/git-CoDxWpwh.js","assets/glsl-PKk0J8PR.js","assets/go-C4TSfsiw.js","assets/graphql-Cb16e-A7.js","assets/groovy-CA-nfse_.js","assets/haml-COSJye4G.js","assets/handlebars-t8wkg6xN.js","assets/haskell-vtsQU3KK.js","assets/haxe-Bvgb-4GL.js","assets/hpkp-wnmh-5Es.js","assets/hsts-82VDbNGS.js","assets/http-BNL4moT5.js","assets/ichigojam-CK7aDz7w.js","assets/icon-BqLiLdOt.js","assets/inform7-Hda_hODM.js","assets/ini-C7avWR4R.js","assets/io-BoAIQe4n.js","assets/j-Bx-6TtCE.js","assets/java-CCeu2L0k.js","assets/java-CANnPxMA.js","assets/javascript-D7O3JJOH.js","assets/javascript-CItk0W4C.js","assets/jolie-B7UQH2Fu.js","assets/json-DFhl84MS.js","assets/jsx-B7wAj0Qh.js","assets/jsx-DgLX1Fsn.js","assets/julia-CMC9hJif.js","assets/keyman-Yic1jd9N.js","assets/kotlin-BtLpV0TF.js","assets/latex-DlUcs9Tv.js","assets/less-D2ijnoYF.js","assets/liquid-CAvXwp52.js","assets/lisp-B9nugxwY.js","assets/livescript-CJAB_r1K.js","assets/lolcode-Bg7Dhbpq.js","assets/lua-BTXYkT2Y.js","assets/makefile-D7WSESad.js","assets/markdown-BUQBPyso.js","assets/markup-templating-C_xMu36L.js","assets/markup-mFk57ORe.js","assets/markup-BJYiESec.js","assets/matlab-BwByJ-wA.js","assets/mel-Cu7gn0uC.js","assets/mizar-gKs5zPwe.js","assets/monkey-lWYqT2Mj.js","assets/n4js-DPCF6A2L.js","assets/nasm-DZlHg7S8.js","assets/nginx-DG03tRvh.js","assets/nim-DoTE89ud.js","assets/nix-BbTf4UEg.js","assets/nsis-C0OzytuP.js","assets/objectivec-Cp6Wr0r-.js","assets/ocaml-ljjGbuxl.js","assets/opencl-DAz4b7yy.js","assets/oz-BNJyMhKF.js","assets/parigp-BDMd_I6x.js","assets/parser-C2UtTcax.js","assets/pascal-O1IdZgxa.js","assets/perl-Dskn3Y9f.js","assets/php-extras-D1EPKrhS.js","assets/php-CvSIEBm8.js","assets/php-bnU2qan6.js","assets/plsql-DHBMYkrf.js","assets/sql-D75IDJS8.js","assets/powershell-LiBKeun9.js","assets/processing-C_UwCoxO.js","assets/prolog-Cr42Z1Mv.js","assets/properties-Cn1k-8_G.js","assets/protobuf-CSaFqR4V.js","assets/pug-BiUObuVg.js","assets/puppet-CqyBS24C.js","assets/pure-C0OPfCAz.js","assets/python-Qwej_Qcf.js","assets/q-BYbDdzh9.js","assets/qore-BZKmbxW0.js","assets/r-CtR4_UMU.js","assets/reason-QBPwDtq7.js","assets/renpy-ByEg5xiZ.js","assets/rest-b6nMrUGR.js","assets/rip-BdxkIlBX.js","assets/roboconf-CrCQFXsZ.js","assets/ruby-ZX6kQGxh.js","assets/rust-Dkp3Hkuz.js","assets/sas--o45o-iT.js","assets/sass-CabG3CKO.js","assets/scala-DQI_9P6S.js","assets/scheme-DCw2xPKa.js","assets/scss-BckyVEbA.js","assets/smalltalk-64TqhiHv.js","assets/smarty-CEy-SoLe.js","assets/soy-Y9HUP6cX.js","assets/sql-C8bXAcEN.js","assets/stylus-CXdtT_PB.js","assets/swift-BXyyaRWc.js","assets/tap-CidAtLVp.js","assets/tcl-DXwjuy_m.js","assets/textile-CA3Y7xJs.js","assets/tsx-Bz9lI800.js","assets/typescript-DBUzBHVf.js","assets/tt2-D3DJMISz.js","assets/twig-WFotadbw.js","assets/typescript-D4SdlehN.js","assets/vbnet-DYrYup2w.js","assets/velocity-CieQHVzw.js","assets/verilog-Bg4K-BhM.js","assets/vhdl-DKoTTDDj.js","assets/vim-Cg38PyJj.js","assets/visual-basic-Cl9Jpm4V.js","assets/wasm-B6Hvns3H.js","assets/wiki-BChsw-XN.js","assets/xeora-B5MKFfMk.js","assets/xojo-Q-lFte7F.js","assets/xquery-CYqFRd7J.js","assets/yaml-rqfjhcQa.js","assets/core-BCOxchYB.js","assets/vendor-lottie-Bga_Bk1l.js"])))=>i.map(i=>d[i]); 2import{j as e}from"./vendor-dotlottie-CKWLB76h.js";import{i as ht,a,n as Ve,W as ve,j as Ms,o as Gn,p as Hn,_ as Mt,g as ti,L as si,b as ni}from"./vendor-react-CCzXVbVA.js";import{A as Re,c as Ie,a7 as qe,f as xt,J as ri,g as Ee,ap as et,aq as ii,ar as oi,b as Ne,r as ai,as as hn,s as is,Q as li,at as Gs,a4 as fn,n as ze,m as Un,au as qn,av as Yn,u as Hs,aw as Ke,ax as ci,ay as Qn,az as mn,aA as os,aB as ui,a as di,aC as it,aD as Us,aE as pi,aF as hi,aG as Xn,aH as fi,S as Pt,aI as qs,G as Kn,ai as _n,aJ as Zn,ag as mi,y as _i,aK as gi,aL as Be,aM as nt,aN as rt,ad as xi}from"./app-ZGxtfi_0.js";import{u as as,a as Ys}from"./vendor-query-Cq2FYR_1.js";import{H as Jt,a as bi}from"./index.esm-DvnQRwk9.js";import{f as Ye,M as wt,b as St,d as Ct,e as kt,F as S,V as ue,T as _,g as je,k as tt,aQ as gn,H as re,$ as Jn,j as he,aR as er,Q as Lt,S as zt,aS as Ts,Z as Ot,_ as Wt,u as $e,l as ls,m as cs,an as tr,o as us,s as ds,D as ut,L as bt,I as Ue,ai as ot,aF as Oe,aj as Ds,B as z,C as Bt,a1 as Qs,aT as Gt,aU as mt,aV as _t,aW as gt,aX as xn,aY as dt,aZ as sr,R as yi,P as nr,a_ as rr,ae as ir,ag as He,a$ as ji,b0 as vi,au as ps,av as hs,aw as lt,ax as fs,ay as ct,b1 as bn,a3 as wi,a as Vt,c as Nt,b2 as Si,aC as or,b3 as Ci,a4 as ar,b4 as lr,Y as cr,aG as ur,p as dr,aD as pr,N as hr,b5 as xs,b6 as ki,aK as yn,t as Ii,b7 as Ei,ac as qt,ad as yt,af as fr,ak as Ai,aA as Ri,al as Fi,b8 as Ti,i as mr,b9 as Di,ap as Ps,ah as
2st,ao as Pi}from"./vendor-chakra-z2eW50qa.js";import{b as Li,I as ms,A as _r,C as zi,c as Oi}from"./AddProjectForm-DhTeh5j4.js";import{M as Wi}from"./ModalBlurOverlay-CoS6iLx6.js";import{P as gr}from"./PublishReport-D9pFpp_1.js";import{T as Bi,O as jn}from"./OverviewDetails-CSr34Mre.js";import{S as Vi}from"./SecurityScoreIcon-CvrdT_4t.js";import{E as Ni,a as $i}from"./vulnDistribution-C0Sar6g3.js";import{E as Mi,U as Gi,M as Hi}from"./UnverifiedContract-BFdZDnXq.js";import{S as Ui}from"./SolidityScoreProgress-nGrh_wmi.js";import{V as qi,a as Yi}from"./VulnerabilityBox-BnCfkBDE.js";import{T as Qi,a as xr,I as Xs,b as Xi,H as Ki,c as Zi}from"./ThreatScanDetailContainer-DIyL7QC4.js";import{c as br,b as bs,d as Ji,e as eo,f as yr}from"./index.esm-DOW5uEmc.js";import{R as to,a as so,b as no}from"./index.esm-BZ57b-yw.js";import{d as Ks,e as ro,f as io,g as oo,h as vn}from"./index.esm-C221wYgj.js";import{_ as I}from"./vendor-monaco-CiJro7ev.js";import{_ as ao,a as lo,b as co,c as uo,d as po}from"./react-select.esm-f8TJ4I6W.js";import{_ as ho,a as wn}from"./assertThisInitialized-DtB8HoZg.js";import{U as fo}from"./upgradePackage-BKHmRgtR.js";import{M as jr,g as vr,E as Sn}from"./useIssueDetail--1F7ufoz.js";import{k as mo}from"./index.esm-Ds02zZ7m.js";import{p as _o}from"./vendor-dompurify-CEVJ7K31.js";import{C as It}from"./confirmActionForm-DVkExoKW.js";import{r as Zs,b as es,F as Js,g as Ls,a as go}from"./jszip.min-D8_qSb1X.js";import xo from"./threatMeter-CrBiLMFN.js";import"./vendor-nivo-DiDy6rd6.js";import"./vendor-analytics-kxESroPO.js";import"./vendor-victory-2uYGyQN6.js";import"./NameInput-DO5rzGo1.js";import"./debounce-CxjSGMPP.js";import"./EmailInput-CIk9kp1G.js";import"./PaymentModal-CqHdZ8ad.js";import"./stylesForCustomSelect-_IRGt3_J.js";import"./FormatOptionLabel-2vVxqozM.js";import"./AddEmailModal-DFRV1IeX.js";import"./TurnstileComponent-DGwBZ16v.js";import"./ThreatCheckIcon-D8bOiwEM.js";import"./smallMessageModal-B0XVKEMH.js";import"./FormatOptionLabelWithImage-40ApY-OR.js";import"./jszip-ptFiYCmq.js";const bo=async t=>{const{data:s}=await Re.post(Ie.API_GET_SCAN_DETAILS,{scan_id:t});return s},yo=t=>as(["scan_detail",t],()=>bo(t)),en=({open:t,closeModal:s,scanDetails:n})=>{const{isOpen:r,onOpen:i,onClose:l}=Ye(),u=ht(),{profileData:d}=qe(),h=Ys(),{sendMessage:p,setNeedAuthToken:c}=xt(),[b,j]=a.useState(!1),{projectId:E}=Ve(),f=()=>{if(d&&d.loc_remaining>=n.loc)if(n.scan_type==="project")n.project_url==="File Scan"?i():(c(!0),p({type:"project_scan_initiate",body:{project_id:E,project_type:"existing",scan_initiator_uuid:d.member_uuid}}),h.invalidateQueries("profile"),u.push("/projects"),s());else{let o={};o={contract_address:n.contract_address,contract_platform:n.contract_platform,contract_chain:n.contract_chain,scan_initiator_uuid:d.member_uuid},c(!0),p({type:"block_scan_initiate",body:o}),h.invalidateQueries("profile"),u.push("/projects"),s()}else j(!0)};return e.jsx(e.Fragment,{children:e.jsxs(wt,{isCentered:!0,isOpen:t,onClose:s,scrollBehavior:"inside",children:[e.jsx(Wi,{}),e.jsxs(St,{bg:"bg.subtle",w:"90vw",maxW:"800px",minW:"300px",minH:"fit-content",px:[2,4,8],children:[e.jsx(Ct,{mt:4}),e.jsx(kt,{px:[0,0,2],h:"fit-content",w:"100%",py:10,children:e.jsxs(S,{justifyContent:"center",alignItems:"center",w:"100%",flexDir:"column",children:[e.jsx(Li,{scanData:n}),e.jsxs(ue,{alignItems:"flex-start",justifyContent:"flex-start",textAlign:"left",background:n.scan_type==="project"&&n.project_url==="File Scan"?"#FBFBFB":"linear-gradient(to right, #1BD8E330, #FBEAAA30)",spacing:4,p:7,display:["none","none","flex"],borderRadius:10,mt:5,children:[e.jsx(_,{fontWeight:900,children:n.scan_type==="project"&&n.project_url==="File Scan"?"Rescan Project":`${n.loc} LOC`}),e.jsx(_,{children:n.scan_type==="project"&&n.project_url==="File Scan"?"For optimal security and privacy, SolidityScan does not store your code after a scan is complete. To ensure the most up-to-date and accurate results, please upload your Solidity file again for rescanning.":`Your project has ${n.loc} lines of code and is ready for a rescan. Upon initiating the rescan, the corresponding number of lines will be deducted from your co
2de analysis credits.`}),e.jsx(je,{id:"ss-unlock-det",width:"250px",onClick:f,variant:"brand",children:n.scan_type==="project"&&n.project_url==="File Scan"?"Upload Files":"Unlock Details"})]})]})})]}),b&&e.jsx(ms,{open:b,closeModal:()=>{j(!1),s()},scanDetails:n}),e.jsx(_r,{formType:"filescan",onClose:l,isOpen:r})]})})},Cn=()=>{const{profileData:t,role:s}=qe(),{data:n}=ri(),r=ht(),i=tt(),l=Ee(),{projectType:u,projectId:d,scanId:h}=Ve(),p=u.replace(/s$/,""),{scanData:c,reportList:b,refetchReportList:j,refetchScanDetails:E}=a.useContext(et),[f,o]=a.useState(""),[m,y]=a.useState(!1),[w,D]=a.useState(""),[R,L]=a.useState(""),[P,$]=a.useState(!1),[V,M]=a.useState(!1),[N,K]=a.useState(!1),{isOpen:Q,onClose:J,onOpen:ee}=Ye();a.useEffect(()=>{c&&b&&(c.scan_report.report_regeneration_enabled&&c.scan_report.reporting_status!=="not_generated"?D("re_generate"):D(c.scan_report.reporting_status),b&&b.reports&&X(b.reports),b.reports.length&&o(b.reports[0].date_published))},[c,b]),a.useEffect(()=>{t&&n&&($(ii(t,n,s)),M(oi(t,n,s)))},[n,t,s]);const X=C=>{if(C.length===0||C.length&&(C[0].report_id!==c?.scan_report.latest_report_id||C[0].report_type==="download_only")){L("Not-Published");return}C[0].report_type==="self_published"?L("Self-Published"):C[0].is_approved||C[0].report_type==="assisted"?L("Approved"):L("Waiting For Approval")};if(!c||!t||!n)return null;const H=async()=>{D("generating_report");const{data:C}=await Re.post(Ie.API_GENERATE_REPORT,{project_id:d,scan_id:h,scan_type:p});let F;const x=()=>{F=setInterval(async()=>{await E().then(T=>{T.data?.scan_report.reporting_status==="report_generated"&&(clearInterval(F),D("report_generated"))})},5e3)};C&&C.success&&x()},q=async()=>{y(!0);try{y(!0);const{data:C}=await Re.post(`${Ie.API_GET_REPORT_PDF}`,{project_id:c?.scan_report.project_id,report_id:c?.scan_report.latest_report_id,scan_type:p});if(y(!1),C.status==="success"&&C.download_url){const F=document.createElement("a");F.href=C.download_url,F.click()}else C&&C.message&&i({title:C.message,status:"info",isClosable:!0,position:"bottom"})}catch{y(!1)}},W=()=>{(w==="not_generated"||w==="re_generate")&&H()},v=()=>w==="generating_report"?"Generating report...":w==="not_generated"?"Generate Report":w==="re_generate"?"Re-Generate Report":"Loading",k=()=>R==="Approved"?"#03C04A":R==="Self-Published"?"black":"#FF5C00";return e.jsxs(S,{flexDir:["column-reverse","column-reverse","column-reverse","row"],mt:[4,4,4,0],justifyContent:["center","center","center","flex-end"],alignItems:"center",width:["100%","100%","100%","fit-content"],ml:[0,0,0,"auto"],children:[w==="report_generated"?R==="Not-Published"?e.jsxs(e.Fragment,{children:[e.jsxs(je,{id:"ss-publish-report",variant:"accent-outline",bg:"white",w:["80%","80%","50%","200px"],maxW:["80%","80%","50%","220px"],mx:["auto","auto","auto",4],mt:[4,4,4,0],isDisabled:!V,onClick:()=>{t.current_package==="trial"?(i({title:"Please upgrade your plan to Publish report.",status:"info",isClosable:!0,position:"bottom"}),r.push("/billing")):ee()},children:[(!V||t.current_package==="trial")&&e.jsx(gn,{color:"accent",mr:3}),"Publish Report"]}),e.jsx(je,{id:"ss-view-report",variant:"accent-fill",w:["80%","80%","50%","200px"],maxW:["80%","80%","50%","220px"],mx:["auto","auto","auto",4],isDisabled:!V,onClick:()=>window.open(`http://${document.location.host}/report/${p}/${d}/${c?.scan_report.latest_report_id}`,"_blank"),children:"View Report"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(re,{my:[5,5,5,0],children:[R==="Approved"?e.jsx(Jn,{color:"#03C04A"}):R==="Self-Published"?e.jsx(he,{width:"25px",height:"25px",src:`${l}report/user.svg`}):e.jsx(er,{color:"#FF5C00"}),e.jsx(_,{color:k(),sx:{fontSize:"md",fontWeight:600,ml:2},children:R})]}),e.jsxs(re,{borderRadius:"15px",border:"1px solid #806CCF",backgroundColor:"#F5F2FF",pl:7,pr:3,py:2,ml:5,children:[e.jsx(_,{color:"#3E15F4",cursor:"pointer",onClick:()=>{window.open(`http://${document.location.host}/published-report/${p}/${c.scan_report.latest_report_id}`,"_blank")},fontSize:"sm",mr:2,children:"View Report"}),e.jsx(_,{color:"#3E15F4",fontSize:"sm",children:"|"}),e.jsxs(Lt,{children:[e.jsx(zt,{"aria-label":"Options",children:m?e.jsx(Ne,{size:20,color:"#3E15F4",py:1}):e.jsx(Ts,{color:"#3E15F4"})}),e.jsx(Ot,{children:e.jsx(Wt,{onClick:()=>q(),children:"Download PDF"})})]})]})]}):e.jsxs(je,{id:"ss-generate-report",variant:w==="report_generated"?"accent-fill":"black-outline",w:["80%","80%","50%","auto"],maxW:["80%","80%","50%","220px"],px:[0,0,0,14],mx:["auto","auto","auto",4],mb:[4,4,4,0],isDisabled:!P||w==="generating_report",onClick:W,children:[w==="generating_report"&&e.jsx(S,{mr:3,children:e.jsx(Ne,{color:"#000000",size:25})}),!P&&w!=="report_generated"&&e.jsx(gn,{color:"accent",mr:3}),v()]}),N&&e.jsx(en,{closeModal:()=>
2K(!1),open:N,scanDetails:{project_name:c?.scan_report.project_name,project_url:c?.scan_report.project_url,loc:c?.scan_report.multi_file_scan_summary.lines_analyzed_count,scan_type:p}}),c&&t&&n&&Q?e.jsx(gr,{type:p,scanData:c.scan_report,reportId:c.scan_report.latest_report_id,projectId:d,plans:n,lastTimeUpdate:f,downloadReportPaymentStatus:b?.reports&&b?.reports.length&&b?.reports[0].report_id===c.scan_report.latest_report_id?b?.reports[0].payment_status:"",isOpen:Q,onClose:()=>{j(),J()}}):null]})},kn=({contract:t})=>{const s=[{label:"Contract Name",value:t.contractname},{label:"Compiler Version",value:t.compilerversion},{label:"EVM Version",value:t.evmversion},{label:"License Type",value:t.licensetype},{label:"Balance",value:t.value&&t.currency?`${t.value} ${t.currency}`:"NA"},{label:"Contract Chain",value:t.contract_platform&&t.contract_chain?ai(t.contract_platform,t.contract_chain):t.contract_chain}];t.contract_implementation_address&&s.push({label:"Implementation Address",value:t.contract_implementation_address});const[n]=$e("(min-width: 1350px)");return e.jsx(ls,{placement:n?"right-start":"auto",matchWidth:!1,children:({isOpen:r,onClose:i})=>e.jsxs(e.Fragment,{children:[e.jsx(cs,{children:e.jsx(tr,{ml:2,color:r?"#AFA0ED":"#E4E4E4",boxSize:3.5,cursor:"pointer"})}),(r||n)&&e.jsx(us,{borderRadius:15,border:"none",sx:{boxShadow:"0px 4px 51.3px 0px #00000036 !important"},p:2,w:["100%","100%","100%"],children:e.jsx(ds,{p:6,maxW:["100%","100%","400px"],children:e.jsxs(S,{w:"100%",flexDir:"column",children:[s.map((l,u)=>e.jsxs(ve.Fragment,{children:[e.jsxs(S,{w:"100%",fontWeight:400,alignItems:"center",children:[e.jsx(_,{fontSize:["10px","10px","xs"],color:"detail",minW:["30%","30%","120px"],children:l.label}),e.jsx(_,{w:"100%",maxW:["70%","70%","250px"],overflowWrap:"break-word",fontSize:["xs","xs","sm"],textAlign:"left",children:l.value||"NA"})]}),u!==s.length-1&&e.jsx(ut,{my:2,borderColor:"#F3F3F3"})]},u)),e.jsx(bt,{id:"ss-contract-link",href:t.contract_url,target:"_blank",w:"100%",children:e.jsxs(je,{id:"ss-chain-link",borderRadius:6,bg:"#F1F1F1",color:"black",alignItems:"center",mt:10,fontSize:"sm",letterSpacing:1.2,w:"100%",children:["View on"," ",t.contract_platform&&hn[t.contract_platform]?hn[t.contract_platform]:is(t.contract_platform||""),e.jsx("span",{children:e.jsx(Ue,{as:li,ml:4,mt:1,boxSize:4})})]})})]})})})]})})},zs=({theme:t="light",page:s="scan_overview",showLabel:n=!0,iconSize:r=30})=>{const i=Ee(),l=t==="light"?"#FBFBFB":t==="transparent"?"transparent":"#272727",u=t==="light"?"#F8F8F8":t==="transparent"?"transparent":"#272727",d=t==="light"||t==="transparent"?"#000000":"white",h=[{label:"Security Score",iconComp:e.jsx(Vi,{score:"0",size:r,theme:t}),showSkeleton:!0,hasDivider:!0},{label:"Scan duration",icon:"quickscan/qs_scan_duration.svg",showSkeleton:!0,hasDivider:!0},{label:"Lines of code",icon:t==="dark"?"quickscan/qs_loc.svg":"quickscan/qs_loc_light.svg",showSkeleton:!0,hasDivider:s==="scan_overview"}];return s==="scan_overview"&&h.push({label:"Issues Count",icon:"quickscan/bug_icon.svg",showSkeleton:!0,hasDivider:!0},{label:"Threat Score",iconComp:e.jsx(Bi,{score:0,size:r+r/4}),showSkeleton:!0,hasDivider:!1}),e.jsx(S,{w:"100%",justifyContent:s==="report"?"space-between":["flex-start","flex-start","flex-start","space-between"],alignItems:"center",flexDir:s==="report"?"row":["column","column","column","row"],children:h.map((p,c)=>e.jsxs(ve.Fragment,{children:[e.jsxs(S,{w:"100%",alignItems:"center",px:[2,4,4,0],children:[e.jsx(_,{color:"gray.400",fontSize:"xs",fontWeight:300,whiteSpace:"nowrap",display:["block","block","block","none"],w:["60%","60%","85%","auto"],textAlign:"left",children:p.label}),e.jsxs(re,{bgColor:["transparent","transparent","transparent",l],color:d,w:["auto","auto","auto","100%"],borderRadius:15,py:3,px:[0,0,0,3],pl:[0,0,0,c===0&&s==="scan_overview"?0:3],mr:c!==h.length-1?[0,0,0,4]:0,sx:{gap:"10px"},children:[e.jsx(S,{bgColor:u,justifyContent:"center",alignItems:"center",children:p.icon?e.jsx(he,{src:`${i}${p.icon}`,height:r+"px"}):p.iconComp}),e.jsxs(ue,{alignItems:"flex-start",w:"calc(100% - 40px)",spacing:0,whiteSpace:"nowrap",children:[e.jsx(_,{color:"gray.400",fontSize:"xs",fontWeight:300,whiteSpace:"nowrap",display:n?["none","none","none","block"]:"none",children:p.label}),e.jsxs(re,{spacing:0,alignItems:"center",children:[e.jsx(ot,{noOfLines:1,width:"50px",skeletonHeight:"8px"})," ",(p.label==="Security Score"||p.label==="Threat Score")&&e.jsx(_,{fontSize:"sm",fontWeight:400,ml:1,children:"/100"})]})]})]},c)]}),p.hasDivider&&e.jsx(ut,{display:["block","block","block","none"]})]},c))})},jo=({type:t,scanData:s,profileData:n,isDesktopView:r,onRescanClick:i,setOpenInsufficeintLocModal:l,isRescanButtonDisabled:u,rescanIconHoverStyles:d,onOpenRescan:h})=>{const p=()=>{h()};return e.jsx(Oe,{label:"Rescan","aria-label":"A tooltip",mt:2,display:t==="project"&&!s?.scan_report?.file_url_list?"block":"none",children:e.jsxs(S,{ml:[-4,-4,-4,-2.5],c
2olor:"detail",sx:{alignItems:"center"},flexDir:["row","row","row","column"],children:[e.jsx(je,{id:"ss-rescan",size:"sm",colorScheme:"white",transition:"0.3s opacity",height:"70px",width:"70px",mr:[0,0,0,4],visibility:t==="project"&&!s?.scan_report?.file_url_list||t==="block"&&n.current_package==="custom"?"visible":"hidden",onClick:p,_hover:d(),isDisabled:u(),children:e.jsx(Gs,{size:100})}),!r&&(t==="project"||t==="block")&&!s.scan_report.file_url_list&&e.jsx(_,{ml:4,letterSpacing:2,fontWeight:700,children:"Rescan"})]})})},vo=({textToCopy:t})=>{const{hasCopied:s,onCopy:n}=Ds(t);return e.jsx(Oe,{label:s?"Copied!":"Copy Address",children:e.jsx(z,{ml:2,cursor:"pointer",color:s?"green.500":"gray.500",onClick:n,transition:"all 0.2s",className:"copy-button",opacity:0,visibility:"hidden",transitionProperty:"opacity, visibility",transitionDuration:"0.2s",_hover:{color:s?"green.600":"blue.500"},children:s?e.jsx(z,{height:"20px",children:e.jsx(Bt,{fontSize:"lg"})}):e.jsx(Jt,{fontSize:"lg",color:"#3E15F4"})})})},wo=({onOpenRescan:t})=>{const[s]=$e("(min-width: 1350px)"),n=Ee(),{projectType:r}=Ve(),i=r.replace(/s$/,"");Ys();const l=Ms();ht();const u=new URLSearchParams(l.search),{projectId:d}=Ve(),{profileData:h,role:p}=qe(),{scanData:c}=a.useContext(et);let b=u.get("scan_name")||c?.scan_report?.scan_name||"";b==="Scan 1"&&(b="");const{isOpen:j,onClose:E,onOpen:f}=Ye(),[o,m]=a.useState(!1),[y,w]=a.useState(!1),[D,R]=a.useState(!0),L=a.useRef(null);if(a.useEffect(()=>{const H=new IntersectionObserver(([W])=>{R(W.isIntersecting)},{threshold:.1}),q=L.current;return q&&H.observe(q),()=>{q&&H.unobserve(q)}},[]),!c||!h)return null;const{project_url:P,project_name:$,contract_chain:V,contract_address:M,contract_platform:N,contractname:K,contract_url:Q}=c.scan_report,J=()=>h.credits===0||p==="viewer"||c?.scan_report.scan_status==="scanning"?{opacity:.4}:{opacity:.6},ee=()=>h?.credit_system==="loc"&&h.loc_remaining<parseInt("10")?!0:h?.credit_system==="scan_credit"&&h.credits===0,X=()=>!!(h&&h.credit_system==="scan_credits"&&ee()||c?.scan_report.scan_status==="scanning"||p==="viewer");return e.jsxs(S,{w:"100%",flexDir:"column",bg:"white",borderRadius:15,p:6,pl:0,position:"relative",children:[P||M?e.jsxs(S,{w:"100%",mb:4,pl:8,flexDir:["column","column","column","row"],alignItems:"center",opacity:[1,1,1,D?1:0],transition:"opacity 0.3s ease-in",children:[e.jsxs(S,{justifyContent:"center",children:[i==="block"?e.jsx(fn,{contract:{contract_chain:V,contract_platform:N},size:50}):P?e.jsx(he,{src:`${n}icons/integrations/${ze(P||"")}.svg`,w:"50px"}):null,e.jsxs(ue,{w:["70%","80%","90%","auto"],ml:[4,4,4,7],mb:[4,4,4,0],alignItems:"flex-start",justifyContent:"flex-start",spacing:0,ref:L,children:[e.jsxs(re,{spacing:4,children:[e.jsx(_,{sx:{fontSize:c.scan_report.is_verified_scan||$?"xl":"sm",fontWeight:600},children:$||(c.scan_report.is_verified_scan||K?K:M)}),i==="block"&&e.jsx(kn,{contract:c.scan_report}),b&&e.jsx(_,{height:"fit-content",px:3,mr:5,py:1,borderRadius:3,bgColor:"#F1F1F1",color:"#323B4B",fontSize:"14px",children:`${b}${c.scan_report.is_trial_scan?" - Free Trial":""}`})]}),e.jsxs(S,{align:"center",className:"link-container",position:"relative",_hover:{".copy-button":{opacity:1,visibility:"visible"}},children:[e.jsx(bt,{id:"ss-project-link",fontSize:"14px",variant:"subtle",target:"_blank",href:P||Q,isTruncated:!0,width:["100%","100%","100%","100%"],maxW:["100%","100%","100%","380px"],children:P||(c.scan_report.is_verified_scan||K?M:Q)}),e.jsx(vo,{textToCopy:P||(c.scan_report.is_verified_scan||K?M:Q)||""})]})]})]}),e.jsx(Cn,{})]}):null,e.jsxs(S,{w:c?.scan_report?.multi_file_scan_summary?.threat_score?["100%","100%","100%","85%"]:["100%","100%","100%","70%"],maxW:c?.scan_report?.multi_file_scan_summary?.threat_score?["100%","100%","100%","850px"]:["100%","100%","100%","750px"],alignItems:["flex-start","flex-start","flex-start","center"],flexDir:["column","column","column","row"],opacity:[1,1,1,D?1:0],pl:8,transition:"opacity 0.3s ease-in",children:[!P?.includes("azure.com")&&e.jsx(jo,{type:i,scanData:c,profileData:h,isDesktopView:s,onRescanClick:f,setOpenInsufficeintLocModal:m,isRescanButtonDisabled:X,rescanIconHoverStyles:J,onOpenRescan:t}),c?.scan_report?.multi_file_scan_summary&&e.jsx(jn,{theme:"transparent",page:"scan_overview",scanReport:c.scan_report.multi_file_scan_summary})]}),o&&e.jsx(ms,{open:o,closeModal:()=>
2m(!1),scanDetails:{project_name:c?.scan_report.project_name,project_url:c?.scan_report.project_url,scan_type:"project",loc:c?.scan_report.multi_file_scan_summary.lines_analyzed_count}}),e.jsxs(S,{w:"97%",mb:4,pl:6,alignItems:"center",position:"absolute",top:"72px",left:"calc(auto - 40px)",display:["none","none","none","flex"],visibility:D?"hidden":"visible",pointerEvents:D?"none":"all",opacity:D?0:1,bg:"white",borderBottomRadius:15,transition:"top 0.3s ease-in-out, visibility 0.3s ease-in, opacity 0.3s ease-out",zIndex:10,pt:3,children:[i==="block"?e.jsx(fn,{contract:{contract_chain:V,contract_platform:N},size:50}):e.jsx(he,{src:`${n}icons/integrations/${ze(P||"")}.svg`,w:"50px"}),e.jsxs(ue,{ml:[4,4,4,7],alignItems:"flex-start",justifyContent:"flex-start",spacing:-1,children:[e.jsxs(re,{spacing:4,children:[e.jsx(_,{sx:{fontSize:c.scan_report.is_verified_scan||K?"xl":"sm",fontWeight:600},children:$||(c.scan_report.is_verified_scan||K?K:M)}),i==="block"&&e.jsx(kn,{contract:c.scan_report}),b&&e.jsx(_,{height:"fit-content",px:7,mr:5,py:1,borderRadius:3,bgColor:"#F1F1F1",color:"#323B4B",fontSize:"14px",children:`${b}${c.scan_report.is_trial_scan?" - Free Trial":""}`})]}),c?.scan_report?.multi_file_scan_summary&&c.scan_report.scan_status!=="scanning"?e.jsx(jn,{theme:"transparent",page:"scan_overview",showLabel:!1,iconSize:20,scanReport:c.scan_report.multi_file_scan_summary}):e.jsx(zs,{theme:"transparent",page:"scan_overview",showLabel:!1,iconSize:20})]}),e.jsx(Cn,{})]})]})},So=async(t,s)=>{const{data:n}=await Re.post(Ie.API_GET_REPORTS,{project_type:t,project_id:s});return n},Co=(t,s)=>as(["report_list",t,s],()=>So(t,s),{enabled:!!s}),ko=({scanData:t,scansRemaining:s,onTabChange:n})=>{const r=t.multi_file_scan_summary?.score_v2?t.multi_file_scan_summary?.score_v2:(parseFloat(t.multi_file_scan_summary?.score)*20).toFixed(2),i=t.multi_file_scan_summary.score_rating?t.multi_file_scan_summary.score_rating:parseFloat(r)<50?"LOW":parseFloat(r)>=90?"GREAT":"AVERAGE",[l,u]=a.useState(!1);a.useEffect(()=>{setTimeout(()=>{u(!0)},100)},[]);const d=h=>{n(h)};return e.jsx(e.Fragment,{children:t.multi_file_scan_status==="scan_done"&&t.multi_file_scan_summary?e.jsxs(e.Fragment,{children:[!t.is_verified_scan&&t.scan_type==="block"?null:e.jsxs(S,{w:"100%",sx:{flexDir:["column","column","column","row"]},bg:"white",borderRadius:15,py:4,pl:[3,4,4,6],pr:[3,4,4,0],children:[t.multi_file_scan_summary?.issue_severity_distribution?e.jsxs(S,{w:["100%","100%","100%","45%"],alignItems:"center",flexDir:["column","column","column","row"],pt:[2,2,2,0],children:[e.jsx(qi,{issue_count:t.multi_file_scan_summary.issues_count,issue_severity_distribution:t.multi_file_scan_summary.issue_severity_distribution,theme:"light",size:"230px",textFontSize:"xs"}),e.jsx(Qs,{templateColumns:"repeat(2, 1fr)",rowGap:3,columnGap:3,w:["80%","80%","80%","auto"],h:"fit-content",ml:[0,0,0,2],my:[4,4,4,0],children:Un.map((h,p)=>e.jsx(Yi,{item:h,count:t.multi_file_scan_summary.issue_severity_distribution[h.value],theme:"light",onClick:()=>d(1)},p))})]}):null,e.jsx(ue,{w:["100%","100%","100%","55%"],alignItems:["center","center","center","flex-start"],pt:2,pl:[0,0,6],pr:[0,0,2],spacing:5,h:["fit-content","fit-content","fit-content"],overflowY:["visible","visible","scroll"],children:e.jsxs(z,{w:"100%",px:[4,4,4,8],py:6,borderRadius:"15px",background:qn(i),children:[e.jsxs(S,{w:"100%",justifyContent:["center","center","center","flex-start"],alignItems:["center","center","center","flex-start"],direction:["column","column","row"],children:[e.jsxs(_,{fontSize:"18px",fontWeight:600,display:["block","block","block","none"],mb:[6,6,6,0],children:["Your Security Score is ",i.toUpperCase()]}),e.jsx(Ui,{score:l?r:"0",size:"120px",thickness:7}),e.jsxs(ue,{alignItems:["center","center","center","flex-start"],px:4,my:[4,4,4,0],textAlign:["center","center","center","left"],children:[e.jsxs(_,{fontSize:"18px",fontWeight:600,display:["none","none","none","block"],children:["Your Security Score is ",i.toUpperCase()]}),e.jsx(_,{color:"subtle",fontSize:"xs",fontWeight:400,children:"The SolidityScan score is calculated based on lines of code and weights assigned to each issue depending on the severity and confidence. To improve your score, view the detailed result and leverage the remediation solutions provided."})]})]}),e.jsx(S,{mt:4,justifyContent:["center","center","center","end"],children:e.jsx(bt,{id:"ss-vuln-results",variant:"accent",fontSize:"sm",fontWeight:600,onClick:()=>d(1),children:"Vulnerability Result â¶"})})]})})]}),t.multi_file_scan_summary.threat_score?e.jsx(S,{w:"100%",bg:"white",borderRadius:15,flexDir:"column",mt:[8,8,8,4],mb:[8,8,8,0],children:e.jsx(Qi,{scanReport:t,threat_score:t.multi_file_scan_summary.threat_score_v2||t.multi_file_scan_summary.threat_score,tsSupported:t.project_url||!t.ts_scan_details?.length?"failed":"yes",handleTabsChange:()=>d(2)})}):null]}):e.jsx(S,{w:"100%",sx:{flexDir:["column","column","row"]},children:e.jsxs(ue,{w:["100%","100%","50%"],spacing:5,mb:[8,8,0],children:[e.jsx(z,{w:["100%","100%","70%"],h:"200px",children:e.jsx(Mi,{})}),e.jsx(z,{w:["70%","70%","60%"],sx:{marginBottom:10},children:e.jsx(Ni,{view:"scans"})}),e.jsxs(S,{w:"100%",m:5,borderRadius:"20px",bgColor:"high-subtle",p:5,children:[e.jsx(Yn,{size:28}),e.jsx(_,{fontSize:"xs",color:"high",ml:4,children:t.scan_message?t.scan_message:t.scan_status})]})]})})})},wr=({critical:t,high:s,medium:n,low:r,informational:i,gas:l,setFilterExpanded:u,setVulnerability:d,setConfidence:h,setBugStatusFilter:p})=>{const[c,b]=a.useState(0),[j,E]=a.useState([!1,!1,!1,!1]),[f,o]=a.use
2State([!1,!1,!1]),[m,y]=a.useState([!1,!1,!1,!1,!1,!1]),w=Hs(),D=Ee(w),R=V=>{h([...V]),o([...V]),b(V.filter(Boolean).length+m.filter(Boolean).length+j.filter(Boolean).length)},L=V=>{d([...V]),y([...V]),b(f.filter(Boolean).length+V.filter(Boolean).length+j.filter(Boolean).length)},P=V=>{p([...V]),E([...V]),b(V.filter(Boolean).length+m.filter(Boolean).length+f.filter(Boolean).length)},$=()=>{E([!1,!1,!1,!1]),o([!1,!1,!1]),y([!1,!1,!1,!1,!1,!1]),b(0)};return a.useEffect(()=>{c||(p([!0,!0,!0,!0]),h([!0,!0,!0]),d([!0,!0,!0,!0,!0,!0]))},[c]),e.jsx(Gt,{w:"100%",borderBottomWidth:0,allowToggle:!0,position:["sticky","sticky","sticky","relative"],top:[0,0,0,"auto"],background:"white",zIndex:1,id:"detailed_filter",children:e.jsx(mt,{w:"100%",borderWidth:"0 !important",children:({isExpanded:V})=>e.jsxs(e.Fragment,{children:[e.jsxs(S,{w:"100%",p:2,align:"center",children:[e.jsx(_,{fontWeight:"600",whiteSpace:"nowrap",children:"Filter Parameter"}),e.jsx(_t,{ml:"auto",w:"max-content",background:"#FAFBFC",borderRadius:"11px",zIndex:1,onClick:()=>u(!V),children:e.jsxs(re,{spacing:4,p:0,children:[e.jsxs(re,{spacing:-2,children:[c>0&&e.jsx(z,{background:"red",borderRadius:"50%",w:"18px",h:"18px",mt:-3,zIndex:1,textAlign:"center",color:"white",fontSize:"xs",children:c}),e.jsx(br,{color:c>0?"#3300FF":"#8A94A6",size:24})]}),V?e.jsx(to,{color:"#3300FF",size:20}):e.jsx(so,{color:"#C4C4C4",size:20})]})})]}),e.jsxs(gt,{background:"#FAFBFC",borderBottomRadius:15,pb:2,children:[e.jsx(S,{w:"100%",justifyContent:"space-around",children:e.jsxs(z,{width:"100%",background:"white",borderRadius:15,px:4,py:3,mt:1,children:[e.jsx(_,{color:"#4E5D78",fontWeight:400,fontSize:"sm",children:"By Vulnerability Parameter"}),e.jsx($i,{critical:t,high:s,medium:n,low:r,informational:i,gas:l,vulnerabilityParams:m,setVulnerabilityFilter:L})]})}),e.jsxs(ue,{width:"100%",justify:"center",alignItems:"flex-start",background:"white",borderRadius:15,px:4,py:3,mt:2,children:[e.jsx(_,{color:"#4E5D78",fontWeight:400,fontSize:"sm",children:"By Confidence Parameter"}),e.jsxs(S,{sx:{alignItems:"center",mt:2.5,flexWrap:"wrap",gap:4},children:[e.jsxs(je,{id:"ss-certain-filter",height:"fit-content",variant:"solid",color:"low",background:"#EEFFE6",py:2,fontWeight:"500",fontSize:"xs",borderRadius:"27px",onClick:()=>R([f[0],f[1],!f[2]]),children:[f[2]&&e.jsx(bs,{}),"Â Certain"]}),e.jsxs(je,{id:"ss-firm-filter",height:"fit-content",variant:"solid",color:"#ED9801",background:"#FFF8EB",py:2,fontWeight:"500",borderRadius:"27px",fontSize:"xs",onClick:()=>R([f[0],!f[1],f[2]]),children:[f[1]&&e.jsx(bs,{}),"Â Firm"]}),e.jsxs(je,{id:"ss-tentative-filter",height:"fit-content",variant:"solid",color:"high",background:"#FFF5F3",py:2,fontWeight:"500",fontSize:"xs",borderRadius:"27px",onClick:()=>R([!f[0],f[1],f[2]]),children:[f[0]&&e.jsx(bs,{}),"Â Tentative"]})]})]}),e.jsxs(ue,{width:"100%",justify:"center",alignItems:"flex-start",background:"white",borderRadius:15,px:4,py:3,mt:2,children:[e.jsx(_,{color:"#4E5D78",fontWeight:400,fontSize:"sm",children:"By Bug Status"}),e.jsxs(S,{sx:{alignItems:"center",mt:2.5,flexWrap:"wrap",gap:4},children:[e.jsxs(je,{id:"ss-pending-filter",height:"fit-content",variant:j[0]?"outline":"solid",borderColor:j[0]?"#ED9801":"none",backgroundColor:j[0]?"white":"#F8F8F8",py:1.5,fontWeight:"normal",color:"gray.600",fontSize:"xs",borderRadius:"27px",onClick:()=>P([!j[0],j[1],j[2],j[3]]),children:[e.jsx(he,{src:`${D}report/pending_fix_color.svg`,w:"20px"}),"Â Pending Fixes"]}),e.jsxs(je,{id:"ss-wont-filter",height:"fit-content",variant:j[1]?"outline":"solid",borderColor:j[1]?"black":"none",backgroundColor:j[1]?"white":"#F8F8F8",py:1.5,fontWeight:"normal",color:"gray.600",fontSize:"xs",borderRadius:"27px",onClick:()=>P([j[0],!j[1],j[2],j[3]]),children:[e.jsx(he,{src:`${D}report/wont_fix_color.svg`,w:"16px"}),"Â Won't Fix"]}),e.jsxs(je,{id:"ss-fp-filter",height:"fit-content",variant:j[2]?"outline":"solid",borderColor:j[2]?"#3300FF":"none",backgroundColor:j[2]?"white":"#F8F8F8",py:1.5,fontWeight:"normal",color:"gray.600",fontSize:"xs",borderRadius:"27px",onClick:()=>P([j[0],j[1],!j[2],j[3]]),children:[e.jsx(he,{src:`${D}report/false_positive_color.svg`,w:"20px"}),"Â False Positive"]})]})]}),e.jsx(S,{mt:1.5,justifyContent:"center",children:e.jsx(bt,{id:"ss-clear-filter",alignItems:"center",textAlign:"center",variant:"accent",fontSize:"sm",onClick:()=>$(),_hover:{textDecoration:"underline"},children:"Clear filter"})})]})]})})})};function Io(t){function s(F,x,T,B,g){for(var U=0,O=0,oe=0,te=0,ce,ie,_e=0,le=0,Y,be=Y=ce=0,de=0,ye=0,De=0,ge=0,Me=T.length,Ge=Me-1,Fe,se="",Z="",xe="",fe="",pe;de<Me;){if(ie=T.charCodeAt(de),de===Ge&&O+te+oe+U!==0&&(O!==0&&(ie=O===47?10:47),te=oe=U=0,Me++,Ge++),O+te+oe+U===0){if(de===Ge&&(0<ye&&(se=se.replace(j,"")),0<se.trim().length)){switch(ie){case 32:case 9:case 59:case 13:case 10:break;default:se+=T.charAt(de)}ie=59}switch(ie){case 123:for(se=se.trim(),ce=se.charCodeAt(0),Y=1,ge=++de;de<Me;){switch(ie=T.charCodeAt(de)){case 123:Y++;break;case 125:Y--;break;case 47:switch(ie=T.charCodeAt(de+1)){case 42:case 47:e:{for(be=de+1;be<Ge;++be)switch(T.charCodeAt(be)){case 47:if(ie===42&&T.charCodeAt(be-1)===42&&de+2!==be){de=be+1;break e}break;case 10:if(ie===47){de=be+1;break e}}de=be}}break;case 91:ie++;case 40:ie++;case 34:case 39:for(;de++<Ge&&T.charCodeAt(de)!==ie;);}if(Y===0)break;de++}switch(Y=T.substring(ge,de),ce===0&&(ce=(se=se.replace(b,"").trim()).charCo
vendor: 5,732 bytes, line 2
2deAt(0)),ce){case 64:switch(0<ye&&(se=se.replace(j,"")),ie=se.charCodeAt(1),ie){case 100:case 109:case 115:case 45:ye=x;break;default:ye=H}if(Y=s(x,ye,Y,ie,g+1),ge=Y.length,0<W&&(ye=n(H,se,De),pe=d(3,Y,ye,x,J,Q,ge,ie,g,B),se=ye.join(""),pe!==void 0&&(ge=(Y=pe.trim()).length)===0&&(ie=0,Y="")),0<ge)switch(ie){case 115:se=se.replace(P,u);case 100:case 109:case 45:Y=se+"{"+Y+"}";break;case 107:se=se.replace(w,"$1 $2"),Y=se+"{"+Y+"}",Y=X===1||X===2&&l("@"+Y,3)?"@-webkit-"+Y+"@"+Y:"@"+Y;break;default:Y=se+Y,B===112&&(Y=(Z+=Y,""))}else Y="";break;default:Y=s(x,n(x,se,De),Y,B,g+1)}xe+=Y,Y=De=ye=be=ce=0,se="",ie=T.charCodeAt(++de);break;case 125:case 59:if(se=(0<ye?se.replace(j,""):se).trim(),1<(ge=se.length))switch(be===0&&(ce=se.charCodeAt(0),ce===45||96<ce&&123>ce)&&(ge=(se=se.replace(" ",":")).length),0<W&&(pe=d(1,se,x,F,J,Q,Z.length,B,g,B))!==void 0&&(ge=(se=pe.trim()).length)===0&&(se="\0\0"),ce=se.charCodeAt(0),ie=se.charCodeAt(1),ce){case 0:break;case 64:if(ie===105||ie===99){fe+=se+T.charAt(de);break}default:se.charCodeAt(ge-1)!==58&&(Z+=i(se,ce,ie,se.charCodeAt(2)))}De=ye=be=ce=0,se="",ie=T.charCodeAt(++de)}}switch(ie){case 13:case 10:O===47?O=0:1+ce===0&&B!==107&&0<se.length&&(ye=1,se+="\0"),0<W*k&&d(0,se,x,F,J,Q,Z.length,B,g,B),Q=1,J++;break;case 59:case 125:if(O+te+oe+U===0){Q++;break}default:switch(Q++,Fe=T.charAt(de),ie){case 9:case 32:if(te+U+O===0)switch(_e){case 44:case 58:case 9:case 32:Fe="";break;default:ie!==32&&(Fe=" ")}break;case 0:Fe="\\0";break;case 12:Fe="\\f";break;case 11:Fe="\\v";break;case 38:te+O+U===0&&(ye=De=1,Fe="\f"+Fe);break;case 108:if(te+O+U+ee===0&&0<be)switch(de-be){case 2:_e===112&&T.charCodeAt(de-3)===58&&(ee=_e);case 8:le===111&&(ee=le)}break;case 58:te+O+U===0&&(be=de);break;case 44:O+oe+te+U===0&&(ye=1,Fe+="\r");break;case 34:case 39:O===0&&(te=te===ie?0:te===0?ie:te);break;case 91:te+O+oe===0&&U++;break;case 93:te+O+oe===0&&U--;break;case 41:te+O+U===0&&oe--;break;case 40:if(te+O+U===0){if(ce===0)switch(2*_e+3*le){case 533:break;default:ce=1}oe++}break;case 64:O+oe+te+U+be+Y===0&&(Y=1);break;case 42:case 47:if(!(0<te+U+oe))switch(O){case 0:switch(2*ie+3*T.charCodeAt(de+1)){case 235:O=47;break;case 220:ge=de,O=42}break;case 42:ie===47&&_e===42&&ge+2!==de&&(T.charCodeAt(ge+2)===33&&(Z+=T.substring(ge,de+1)),Fe="",O=0)}}O===0&&(se+=Fe)}le=_e,_e=ie,de++}if(ge=Z.length,0<ge){if(ye=x,0<W&&(pe=d(2,Z,ye,F,J,Q,ge,B,g,B),pe!==void 0&&(Z=pe).length===0))return fe+Z+xe;if(Z=ye.join(",")+"{"+Z+"}",X*ee!==0){switch(X!==2||l(Z,2)||(ee=0),ee){case 111:Z=Z.replace(R,":-moz-$1")+Z;break;case 112:Z=Z.replace(D,"::-webkit-input-$1")+Z.replace(D,"::-moz-$1")+Z.replace(D,":-ms-input-$1")+Z}ee=0}}return fe+Z+xe}function n(F,x,T){var B=x.trim().split(m);x=B;var g=B.length,U=F.length;switch(U){case 0:case 1:var O=0;for(F=U===0?"":F[0]+" ";O<g;++O)x[O]=r(F,x[O],T).trim();break;default:var oe=O=0;for(x=[];O<g;++O)for(var te=0;te<U;++te)x[oe++]=r(F[te]+" ",B[O],T).trim()}return x}function r(F,x,T){var B=x.charCodeAt(0);switch(33>B&&(B=(x=x.trim()).charCodeAt(0)),B){case 38:return x.replace(y,"$1"+F.trim());case 58:return F.trim()+x.replace(y,"$1"+F.trim());default:if(0<1*T&&0<x.indexOf("\f"))return x.replace(y,(F.charCodeAt(0)===58?"":"$1")+F.trim())}return F+x}function i(F,x,T,B){var g=F+";",U=2*x+3*T+4*B;if(U===944){F=g.indexOf(":",9)+1;var O=g.substring(F,g.length-1).trim();return O=g.substring(0,F).trim()+O+";",X===1||X===2&&l(O,1)?"-webkit-"+O+O:O}if(X===0||X===2&&!l(g,1))return g;switch(U){case 1015:return g.charCodeAt(10)===97?"-webkit-"+g+g:g;case 951:return g.charCodeAt(3)===116?"-webkit-"+g+g:g;case 963:return g.charCodeAt(5)===110?"-webkit-"+g+g:g;case 1009:if(g.charCodeAt(4)!==100)break;case 969:case 942:return"-webkit-"+g+g;case 978:return"-webkit-"+g+"-moz-"+g+g;case 1019:case 983:return"-webkit-"+g+"-moz-"+g+"-ms-"+g+g;case 883:if(g.charCodeAt(8)===45)return"-webkit-"+g+g;if(0<g.indexOf("image-set(",11))return g.replace(K,"$1-webkit-$2")+g;break;case 932:if(g.charCodeAt(4)===45)switch(g.charCodeAt(5)){case 103:return"-webkit-box-"+g.replace("-grow","")+"-webkit-"+g+"-ms-"+g.replace("grow","positive")+g;case 115:return"-webkit-"+g+"-ms-"+g.replace("shrink","negative")+g;case 98:return"-webkit-"+g+"-ms-"+g.replace("basis","preferred-size")+g}return"-webkit-"+g+"-ms-"+g+g;case 964:return"-webkit-"+g+"-ms-flex-"+g+g;case 1023:if(g.charCodeAt(8)!==99)break;return O=g.substring(g.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),"-webkit-box-pack"+O+"-webkit-"+g+"-ms-flex-pack"+O+g;case 1005:return f.test(g)?g.replace(E,":-webkit-")+g.replace(E,":-moz-")+g:g;case 1e3:switch(O=g.substring(13).trim(),x=O.indexOf("-")+1,O.charCodeAt(0)+O.charCodeAt(x)){case 226:O=g.replace(L,"tb");break;case 232:O=g.replace(L,"tb-rl");break;case 220:O=g.replace(L,"lr");break;default:return g}return"-webkit-"+g+"-ms-"+O+g;case 1017:if(g.indexOf("sticky",9)===-1)break;case 975:switch(x=(g=F).length-10,O=(g.charCodeAt(x)===33?g.substring(0,x):g).substring(F.indexOf(":",7)+1).trim(),U=O.charCodeAt(0)+(O.charCodeAt(7)|0)){case 203:if(111>O.charCodeAt(8))break;case 115:g=g.replace(O,"-webkit-"+O)+";"+g;break;case 207:case 102:g=g.replace(O,"-webkit-"+(102<U?"inline-":"")+"box")+";"+g.replace(O,"-webkit-"+O)+";"+g.replace(O,"-ms-"+O+"box")+";"+g}return g+";";case 938:if(g.charCodeAt(5)===45)switch(g.charCodeAt(6)){case 105:return O=g.replace("-items",""),"-webkit-"+g+"-webkit-box-"+O+"-ms-flex-"+O+g;case 115:return"-webkit-"+g+"-ms-flex-item-"+g.replace(V,"")+g;default:return"-webkit-"+g+"-ms-flex-line-pack"+g.replace("align-content","").replace(V,"")+g}break;case 973:case 989:if(g.charCodeAt(3)!==45||g.charCodeAt(4)===122)break;case 931:case 953:if(N.test(F)===!0)return(O=F.substring(F.indexOf(":")+1)).charCo
2deAt(0)===115?i(F.replace("stretch","fill-available"),x,T,B).replace(":fill-available",":stretch"):g.replace(O,"-webkit-"+O)+g.replace(O,"-moz-"+O.replace("fill-",""))+g;break;case 962:if(g="-webkit-"+g+(g.charCodeAt(5)===102?"-ms-"+g:"")+g,T+B===211&&g.charCodeAt(13)===105&&0<g.indexOf("transform",10))return g.substring(0,g.indexOf(";",27)+1).replace(o,"$1-webkit-$2")+g}return g}function l(F,x){var T=F.indexOf(x===1?":":"{"),B=F.substring(0,x!==3?T:10);return T=F.substring(T+1,F.length-1),v(x!==2?B:B.replace(M,"$1"),T,x)}function u(F,x){var T=i(x,x.charCodeAt(0),x.charCodeAt(1),x.charCodeAt(2));return T!==x+";"?T.replace($," or ($1)").substring(4):"("+x+")"}function d(F,x,T,B,g,U,O,oe,te,ce){for(var ie=0,_e=x,le;ie<W;++ie)switch(le=q[ie].call(c,F,_e,T,B,g,U,O,oe,te,ce)){case void 0:case!1:case!0:case null:break;default:_e=le}if(_e!==x)return _e}function h(F){switch(F){case void 0:case null:W=q.length=0;break;default:if(typeof F=="function")q[W++]=F;else if(typeof F=="object")for(var x=0,T=F.length;x<T;++x)h(F[x]);else k=!!F|0}return h}function p(F){return F=F.prefix,F!==void 0&&(v=null,F?typeof F!="function"?X=1:(X=2,v=F):X=0),p}function c(F,x){var T=F;if(33>T.charCodeAt(0)&&(T=T.trim()),C=T,T=[C],0<W){var B=d(-1,x,T,T,J,Q,0,0,0,0);B!==void 0&&typeof B=="string"&&(x=B)}var g=s(H,T,x,0,0);return 0<W&&(B=d(-2,g,T,T,J,Q,g.length,0,0,0),B!==void 0&&(g=B)),C="",ee=0,Q=J=1,g}var b=/^\0+/g,j=/[\0\r\f]/g,E=/: */g,f=/zoo|gra/,o=/([,: ])(transform)/g,m=/,\r+?/g,y=/([\t\r\n ])*\f?&/g,w=/@(k\w+)\s*(\S*)\s*/,D=/::(place)/g,R=/:(read-only)/g,L=/[svh]\w+-[tblr]{2}/,P=/\(\s*(.*)\s*\)/g,$=/([\s\S]*?);/g,V=/-self|flex-/g,M=/[^]*?(:[rp][el]a[\w-]+)[^]*/,N=/stretch|:\s*\w+\-(?:conte|avail)/,K=/([^-])(image-set\()/,Q=1,J=1,ee=0,X=1,H=[],q=[],W=0,v=null,k=0,C="";return c.use=h,c.set=p,t!==void 0&&p(t),c}var Eo={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Xe={};function at(){return(at=Object.assign||function(t){for(var s=1;s<arguments.length;s++){var n=arguments[s];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var In=function(t,s){for(var n=[t[0]],r=0,i=s.length;r<i;r+=1)n.push(s[r],t[r+1]);return n},Os=function(t){return t!==null&&typeof t=="object"&&(t.toString?t.toString():Object.prototype.toString.call(t))==="[object Object]"&&!Hn.typeOf(t)},ts=Object.freeze([]),pt=Object.freeze({});function $t(t){return typeof t=="function"}function Ws(t){return t.displayName||t.name||"Component"}function tn(t){return t&&typeof t.styledComponentId=="string"}var Et=typeof process<"u"&&Xe!==void 0&&(Xe.REACT_APP_SC_ATTR||Xe.SC_ATTR)||"data-styled",sn=typeof window<"u"&&"HTMLElement"in window,Ao=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Xe!==void 0&&(Xe.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Xe.REACT_APP_SC_DISABLE_SPEEDY!==""?Xe.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Xe.REACT_APP_SC_DISABLE_SPEEDY:Xe.SC_DISABLE_SPEEDY!==void 0&&Xe.SC_DISABLE_SPEEDY!==""&&Xe.SC_DISABLE_SPEEDY!=="false"&&Xe.SC_DISABLE_SPEEDY));function Ht(t){for(var s=arguments.length,n=new Array(s>1?s-1:0),r=1;r<s;r++)n[r-1]=arguments[r];throw new Error("An error occurred. See https://git.io/JUIaE#"+t+" for more information."+(n.length>0?" Args: "+n.join(", "):""))}var Ro=(function(){function t(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var s=t.prototype;return s.indexOfGroup=function(n){for(var r=0,i=0;i<n;i++)r+=this.groupSizes[i];return r},s.insertRules=function(n,r){if(n>=this.groupSizes.length){for(var i=this.groupSizes,l=i.length,u=l;n>=u;)(u<<=1)<0&&Ht(16,""+n);this.groupSizes=new Uint32Array(u),this.groupSizes.set(i),this.length=u;for(var d=l;d<u;d++)this.groupSizes[d]=0}for(var h=this.indexOfGroup(n+1),p=0,c=r.length;p<c;p++)this.tag.insertRule(h,r[p])&&(this.groupSizes[n]++,h++)},s.clearGroup=function(n){if(n<this.length){var r=this.groupSizes[n],i=this.indexOfGroup(n),l=i+r;this.groupSizes[n]=0;for(var u=i;u<l;u++)this.tag.deleteRule(i)}},s.getGroup=function(n){var r="";if(n>=this.length||this.groupSizes[n]===0)return r;for(var i=this.groupSizes[n],l=this.indexOfGroup(n),u=l+i,d=l;d<u;d++)r+=this.tag.getRule(d)+`/*!sc*/ 3`;return r},t})(),Zt=new Map,ss=new Map,Dt=1,Yt=function(t){if(Zt.has(t))return Zt.get(t);for(;ss.has(Dt);)Dt++;var s=Dt++;return Zt.set(t,s),ss.set(s,t),s},Fo=function(t){return ss.get(t)},To=function(t,s){s>=Dt&&(Dt=s+1),Zt.set(t,s),ss.set(s,t)},Do="style["+Et+'][data-styled-version="5.3.11"]',Po=new RegExp("^"+Et+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),Lo=function(t,s,n){for(var r,i=n.split(","),l=0,u=i.length;l<u;l++)(r=i[l])&&t.registerName(s,r)},zo=function(t,s){for(var n=(s.textContent||"").split(`/*!sc*/ 4`),r=[],i=0,l=n.length;i<l;i++){var u=n[i].trim();if(u){var d=u.match(Po);if(d){var h=0|parseInt(d[1],10),p=d[2];h!==0&&(To(p,h),Lo(t,p,d[3]),t.getTag().insertRules(h,r)),r.length=0}else r.push(u)}}},Oo=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null},Sr=function(t){var s=document.head,n=t||s,r=document.createElement("style"),i=(function(d){for(var h=d.childNodes,p=h.length;p>=0;p--){var c=h[p];if(c&&c.nodeType===1&&c.hasAttribute(Et))return c}})(n),l=i!==void 0?i.nextSibling:null;r.setAttribute(Et,"active"),r.setAttribute("data-styled-version","5.3.11");var u=Oo();return u&&r.setAttribute("nonce",u),n.insertBefore(r,l),r},Wo=(function(){function t(n){var r=this.element=Sr(n);r.appendChild(document.createTextNode("")),this.sheet=(function(i){if(i.sheet)return i.sheet;for(var l=document.styleSheets,u=0,d=l.length;u<d;u++){var h=l[u];if(h.ownerNode===i)return h}Ht(17)})(r),this.length=0}var s=t.prototype;return s.insertRule=function(n,r){try{return this.sheet.insertRule(r,n),this.length++,!0}catch{return!1}},s.deleteRule=function(n){this.sheet.deleteRule(n),this.length--},s.getRule=function(n){var r=this.sheet.cssRules[n];return r!==void 0&&typeof r.cssText=="string"?r.cssText:""},t})(),Bo=(function(){function t(n){var r=this.element=Sr(n);this.nodes=r.childNodes,this.length=0}var s=t.prototype;return s.insertRule=function(n,r){if(n<=this.length&&n>=0){var i=document.createTextNode(r),l=this.nodes[n];return this.element.insertBefore(i,l||null),this.length++,!0}return!1},s.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},s.getRule=function(n){return n<this.length?this.nodes[n].textContent:""},t})(),Vo=(function(){function t(n){this.rules=[],this.length=0}var s=t.prototype;return s.insertRule=function(n,r){return n<=this.length&&(this.rules.splice(n,0,r),this.length++,!0)},s.deleteRule=function(n){this.rules.splice(n,1),this.length--},s.getRule=function(n){return n<this.length?this.rules[n]:""},t})(),En=sn,No={isServer:!sn,useCSSOMInjection:!Ao},Cr=(function(){function t(n,r,i){n===void 0&&(n=pt),r===void 0&&(r={}),this.options=at({},No,{},n),this.gs=r,this.names=new Map(i),this.server=!!n.isServer,!this.server&&sn&&En&&(En=!1,(function(l){for(var u=document.querySelectorAll(Do),d=0,h=u.length;d<h;d++){var p=u[d];p&&p.getAttribute(Et)!=="active"&&(zo(l,p),p.parentNode&&p.parentNode.removeChild(p))}})(this))}t.registerId=function(n){return Yt(n)};var s=t.prototype;return s.reconstructWithOptions=function(n,r){return r===void 0&&(r=!0),new t(at({},this.options,{},n),this.gs,r&&this.names||void 0)},s.allocateGSInstance=function(n){return this.gs[n]=(this.gs[n]||0)+1},s.getTag=function(){return this.tag||(this.tag=(i=(r=this.options).isServer,l=r.useCSSOMInjection,u=r.target,n=i?new Vo(u):l?new Wo(u):new Bo(u),new Ro(n)));var n,r,i,l,u},s.hasNameForId=function(n,r){return this.names.has(n)&&this.names.get(n).has(r)},s.registerName=function(n,r){if(Yt(n),this.names.has(n))this.names.get(n).add(r);else{var i=new Set;i.add(r),this.names.set(n,i)}},s.insertRules=function(n,r,i){this.registerName(n,r),this.getTag().insertRules(Yt(n),i)},s.clearNames=function(n){this.names.has(n)&&this.names.get(n).clear()},s.clearRules=function(n){this.getTag().clearGroup(Yt(n)),this.clearNames(n)},s.clearTag=function(){this.tag=void 0},s.toString=function(){return(function(n){for(var r=n.getTag(),i=r.length,l="",u=0;u<i;u++){var d=Fo(u);if(d!==void 0){var h=n.names.get(d),p=r.getGroup(u);if(h&&p&&h.size){var c=Et+".g"+u+'[id="'+d+'"]',b="";h!==void 0&&h.forEach((function(j){j.length>0&&(b+=j+",")})),l+=""+p+c+'{content:"'+b+`"}/*!sc*/ 5`}}}return l})(this)},t})(),$o=/(a)(d)/gi,An=function(t){return String.fromCharCode(t+(t>25?39:97))};function Bs(t){var s,n="";for(s=Math.abs(t);s>52;s=s/52|0)n=An(s%52)+n;return(An(s%52)+n).replace($o,"$1-$2")}var vt=function(t,s){for(var n=s.length;n;
5)t=33*t^s.charCodeAt(--n);return t},kr=function(t){return vt(5381,t)};function Mo(t){for(var s=0;s<t.length;s+=1){var n=t[s];if($t(n)&&!tn(n))return!1}return!0}var Go=kr("5.3.11"),Ho=(function(){function t(s,n,r){this.rules=s,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&Mo(s),this.componentId=n,this.baseHash=vt(Go,n),this.baseStyle=r,Cr.registerId(n)}return t.prototype.generateAndInjectStyles=function(s,n,r){var i=this.componentId,l=[];if(this.baseStyle&&l.push(this.baseStyle.generateAndInjectStyles(s,n,r)),this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(i,this.staticRulesId))l.push(this.staticRulesId);else{var u=At(this.rules,s,n,r).join(""),d=Bs(vt(this.baseHash,u)>>>0);if(!n.hasNameForId(i,d)){var h=r(u,"."+d,void 0,i);n.insertRules(i,d,h)}l.push(d),this.staticRulesId=d}else{for(var p=this.rules.length,c=vt(this.baseHash,r.hash),b="",j=0;j<p;j++){var E=this.rules[j];if(typeof E=="string")b+=E;else if(E){var f=At(E,s,n,r),o=Array.isArray(f)?f.join(""):f;c=vt(c,o+j),b+=o}}if(b){var m=Bs(c>>>0);if(!n.hasNameForId(i,m)){var y=r(b,"."+m,void 0,i);n.insertRules(i,m,y)}l.push(m)}}return l.join(" ")},t})(),Uo=/^\s*\/\/.*$/gm,qo=[":","[",".","#"];function Yo(t){var s,n,r,i,l=pt,u=l.options,d=u===void 0?pt:u,h=l.plugins,p=h===void 0?ts:h,c=new Io(d),b=[],j=(function(o){function m(y){if(y)try{o(y+"}")}catch{}}return function(y,w,D,R,L,P,$,V,M,N){switch(y){case 1:if(M===0&&w.charCodeAt(0)===64)return o(w+";"),"";break;case 2:if(V===0)return w+"/*|*/";break;case 3:switch(V){case 102:case 112:return o(D[0]+w),"";default:return w+(N===0?"/*|*/":"")}case-2:w.split("/*|*/}").forEach(m)}}})((function(o){b.push(o)})),E=function(o,m,y){return m===0&&qo.indexOf(y[n.length])!==-1||y.match(i)?o:"."+s};function f(o,m,y,w){w===void 0&&(w="&");var D=o.replace(Uo,""),R=m&&y?y+" "+m+" { "+D+" }":D;return s=w,n=m,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),c(y||!m?"":m,R)}return c.use([].concat(p,[function(o,m,y){o===2&&y.length&&y[0].lastIndexOf(n)>0&&(y[0]=y[0].replace(r,E))},j,function(o){if(o===-2){var m=b;return b=[],m}}])),f.hash=p.length?p.reduce((function(o,m){return m.name||Ht(15),vt(o,m.name)}),5381).toString():"",f}var Ir=ve.createContext();Ir.Consumer;var Er=ve.createContext(),Qo=(Er.Consumer,new Cr),Vs=Yo();function Xo(){return a.useContext(Ir)||Qo}function Ko(){return a.useContext(Er)||Vs}var Zo=(function(){function t(s,n){var r=this;this.inject=function(i,l){l===void 0&&(l=Vs);var u=r.name+l.hash;i.hasNameForId(r.id,u)||i.insertRules(r.id,u,l(r.rules,u,"@keyframes"))},this.toString=function(){return Ht(12,String(r.name))},this.name=s,this.id="sc-keyframes-"+s,this.rules=n}return t.prototype.getName=function(s){return s===void 0&&(s=Vs),this.name+s.hash},t})(),Jo=/([A-Z])/,ea=/([A-Z])/g,ta=/^ms-/,sa=function(t){return"-"+t.toLowerCase()};function Rn(t){return Jo.test(t)?t.replace(ea,sa).replace(ta,"-ms-"):t}var Fn=function(t){return t==null||t===!1||t===""};function At(t,s,n,r){if(Array.isArray(t)){for(var i,l=[],u=0,d=t.length;u<d;u+=1)(i=At(t[u],s,n,r))!==""&&(Array.isArray(i)?l.push.apply(l,i):l.push(i));return l}if(Fn(t))return"";if(tn(t))return"."+t.styledComponentId;if($t(t)){if(typeof(p=t)!="function"||p.prototype&&p.prototype.isReactComponent||!s)return t;var h=t(s);return At(h,s,n,r)}var p;return t instanceof Zo?n?(t.inject(n,r),t.getName(r)):t:Os(t)?(function c(b,j){var E,f,o=[];for(var m in b)b.hasOwnProperty(m)&&!Fn(b[m])&&(Array.isArray(b[m])&&b[m].isCss||$t(b[m])?o.push(Rn(m)+":",b[m],";"):Os(b[m])?o.push.apply(o,c(b[m],m)):o.push(Rn(m)+": "+(E=m,(f=b[m])==null||typeof f=="boolean"||f===""?"":typeof f!="number"||f===0||E in Eo||E.startsWith("--")?String(f).trim():f+"px")+";"));return j?[j+" {"].concat(o,["}"]):o})(t):t.toString()}var Tn=function(t){return Array.isArray(t)&&(t.isCss=!0),t};function na(t){for(var s=arguments.length,n=new Array(s>1?s-1:0),r=1;r<s;r++)n[r-1]=arguments[r];return $t(t)||Os(t)?Tn(At(In(ts,[t].concat(n)))):n.length===0&&t.length===1&&typeof t[0]=="string"?t:Tn(At(In(t,n)))}var Ar=function(t,s,n){return n===void 0&&(n=pt),t.theme!==n.theme&&t.theme||s||n.theme},ra=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,ia=/(^-|-$)/g;
5function ys(t){return t.replace(ra,"-").replace(ia,"")}var oa=function(t){return Bs(kr(t)>>>0)};function Qt(t){return typeof t=="string"&&!0}var Ns=function(t){return typeof t=="function"||typeof t=="object"&&t!==null&&!Array.isArray(t)},aa=function(t){return t!=="__proto__"&&t!=="constructor"&&t!=="prototype"};function la(t,s,n){var r=t[n];Ns(s)&&Ns(r)?Rr(r,s):t[n]=s}function Rr(t){for(var s=arguments.length,n=new Array(s>1?s-1:0),r=1;r<s;r++)n[r-1]=arguments[r];for(var i=0,l=n;i<l.length;i++){var u=l[i];if(Ns(u))for(var d in u)aa(d)&&la(t,u[d],d)}return t}var nn=ve.createContext();nn.Consumer;var js={};function Fr(t,s,n){var r=tn(t),i=!Qt(t),l=s.attrs,u=l===void 0?ts:l,d=s.componentId,h=d===void 0?(function(w,D){var R=typeof w!="string"?"sc":ys(w);js[R]=(js[R]||0)+1;var L=R+"-"+oa("5.3.11"+R+js[R]);return D?D+"-"+L:L})(s.displayName,s.parentComponentId):d,p=s.displayName,c=p===void 0?(function(w){return Qt(w)?"styled."+w:"Styled("+Ws(w)+")"})(t):p,b=s.displayName&&s.componentId?ys(s.displayName)+"-"+s.componentId:s.componentId||h,j=r&&t.attrs?Array.prototype.concat(t.attrs,u).filter(Boolean):u,E=s.shouldForwardProp;r&&t.shouldForwardProp&&(E=s.shouldForwardProp?function(w,D,R){return t.shouldForwardProp(w,D,R)&&s.shouldForwardProp(w,D,R)}:t.shouldForwardProp);var f,o=new Ho(n,b,r?t.componentStyle:void 0),m=o.isStatic&&u.length===0,y=function(w,D){return(function(R,L,P,$){var V=R.attrs,M=R.componentStyle,N=R.defaultProps,K=R.foldedComponentIds,Q=R.shouldForwardProp,J=R.styledComponentId,ee=R.target,X=(function(B,g,U){B===void 0&&(B=pt);var O=at({},g,{theme:B}),oe={};return U.forEach((function(te){var ce,ie,_e,le=te;for(ce in $t(le)&&(le=le(O)),le)O[ce]=oe[ce]=ce==="className"?(ie=oe[ce],_e=le[ce],ie&&_e?ie+" "+_e:ie||_e):le[ce]})),[O,oe]})(Ar(L,a.useContext(nn),N)||pt,L,V),H=X[0],q=X[1],W=(function(B,g,U,O){var oe=Xo(),te=Ko(),ce=g?B.generateAndInjectStyles(pt,oe,te):B.generateAndInjectStyles(U,oe,te);return ce})(M,$,H),v=P,k=q.$as||L.$as||q.as||L.as||ee,C=Qt(k),F=q!==L?at({},L,{},q):L,x={};for(var T in F)T[0]!=="$"&&T!=="as"&&(T==="forwardedAs"?x.as=F[T]:(Q?Q(T,xn,k):!C||xn(T))&&(x[T]=F[T]));return L.style&&q.style!==L.style&&(x.style=at({},L.style,{},q.style)),x.className=Array.prototype.concat(K,J,W!==J?W:null,L.className,q.className).filter(Boolean).join(" "),x.ref=v,a.createElement(k,x)})(f,w,D,m)};return y.displayName=c,(f=ve.forwardRef(y)).attrs=j,f.componentStyle=o,f.displayName=c,f.shouldForwardProp=E,f.foldedComponentIds=r?Array.prototype.concat(t.foldedComponentIds,t.styledComponentId):ts,f.styledComponentId=b,f.target=r?t.target:t,f.withComponent=function(w){var D=s.componentId,R=(function(P,$){if(P==null)return{};var V,M,N={},K=Object.keys(P);for(M=0;M<K.length;M++)V=K[M],$.indexOf(V)>=0||(N[V]=P[V]);return N})(s,["componentId"]),L=D&&D+"-"+(Qt(w)?w:ys(Ws(w)));return Fr(w,at({},R,{attrs:j,componentId:L}),n)},Object.defineProperty(f,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(w){this._foldedDefaultProps=r?Rr({},t.defaultProps,w):w}}),Object.defineProperty(f,"toString",{value:function(){return"."+f.styledComponentId}}),i&&Gn(f,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),f}var Dn=function(t){return(function s(n,r,i){if(i===void 0&&(i=pt),!Hn.isValidElementType(r))return Ht(1,String(r));var l=function(){return n(r,i,na.apply(void 0,arguments))};return l.withConfig=function(u){return s(n,r,at({},i,{},u))},l.attrs=function(u){return s(n,r,at({},i,{attrs:Array.prototype.concat(i.attrs,u).filter(Boolean)}))},l})(Fr,t)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(t){Dn[t]=Dn(t)}));var ca=function(t){var s=ve.forwardRef((function(n,r){var i=a.useContext(nn),l=t.defaultProps,u=Ar(n,i,l);return ve.createElement(t,at({},n,{theme:u,ref:r}))}));return Gn(s,t),s.displayName="WithTheme("+Ws(t)+")",s};function $s(t){for(var s=1;s<arguments.length;
5s++){var n=arguments[s]!=null?Object(arguments[s]):{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),r.forEach(function(i){dt(t,i,n[i])})}return t}function ua(t){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return t.reduce(function(r,i){return $s({},r,n[i])},s)}function Pn(t){return t.join(" ")}function da(t,s){var n=0;return function(r){return n+=1,r.map(function(i,l){return Tr({node:i,stylesheet:t,useInlineStyles:s,key:"code-segment-".concat(n,"-").concat(l)})})}}function Tr(t){var s=t.node,n=t.stylesheet,r=t.style,i=r===void 0?{}:r,l=t.useInlineStyles,u=t.key,d=s.properties,h=s.type,p=s.tagName,c=s.value;if(h==="text")return c;if(p){var b=da(n,l),j=l&&d.className&&d.className.filter(function(m){return!n[m]}),E=j&&j.length?j:void 0,f=l?$s({},d,{className:E&&Pn(E)},{style:ua(d.className,Object.assign({},d.style,i),n)}):$s({},d,{className:Pn(d.className)}),o=b(s.children);return ve.createElement(p,Mt({key:u},f),o)}}var pa=/\n/g;function ha(t){return t.match(pa)}function fa(t){var s=t.lines,n=t.startingLineNumber,r=t.numberProps,i=r===void 0?{}:r;return s.map(function(l,u){var d=u+n,h=typeof i=="function"?i(d):i;return ve.createElement("span",Mt({key:"line-".concat(u),className:"react-syntax-highlighter-line-number"},h),"".concat(d,` 6`))})}function ma(t){var s=t.codeString,n=t.codeStyle,r=t.containerProps,i=r===void 0?{}:r,l=t.numberProps,u=t.startingLineNumber;return i.style=i.style||{float:"left",paddingRight:"10px"},ve.createElement("code",Mt({},i,{style:Object.assign({},n,i.style)}),fa({lines:s.replace(/\n$/,"").split(` 7`),numberProps:l,startingLineNumber:u}))}function ft(t){var s=t.children,n=t.lineNumber,r=t.lineProps,i=t.className,l=i===void 0?[]:i,u=(typeof r=="function"?r(n):r)||{};return u.className=u.className?l.concat(u.className):l,{type:"element",tagName:"span",properties:u,children:s}}function Dr(t){for(var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=0;r<t.length;r++){var i=t[r];if(i.type==="text")n.push(ft({children:[i],className:s}));else if(i.children){var l=s.concat(i.properties.className);n=n.concat(Dr(i.children,l))}}return n}function _a(t,s){for(var n=Dr(t.value),r=[],i=-1,l=0,u=function(){var p=n[l],c=p.children[0].value,b=ha(c);if(b){var j=c.split(` 8`);j.forEach(function(E,f){var o=r.length+1,m={type:"text",value:"".concat(E,` 9`)};if(f===0){var y=n.slice(i+1,l).concat(ft({children:[m],className:p.properties.className}));r.push(ft({children:y,lineNumber:o,lineProps:s}))}else if(f===j.length-1){var w=n[l+1]&&n[l+1].children&&n[l+1].children[0];if(w){var D={type:"text",value:"".concat(E)},R=ft({children:[D],className:p.properties.className});n.splice(l+1,0,R)}else r.push(ft({children:[m],lineNumber:o,lineProps:s,className:p.properties.className}))}else r.push(ft({children:[m],lineNumber:o,lineProps:s,className:p.properties.className}))}),i=l}l++};l<n.length;)u();if(i!==n.length-1){var d=n.slice(i+1,n.length);d&&d.length&&r.push(ft({children:d,lineNumber:r.length+1,lineProps:s}))}return r}function ga(t){var s=t.rows,n=t.stylesheet,r=t.useInlineStyles;return s.map(function(i,l){return Tr({node:i,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(l)})})}function xa(t){var s=t.astGenerator,n=t.language,r=t.code,i=t.defaultCodeValue;if(s.getLanguage){var l=n&&s.getLanguage(n);return n==="text"?{value:i,language:"text"}:l?s.highlight(n,r):s.highlightAuto(r)}try{return n&&n!=="text"?{value:s.highlight(r,n)}:{value:i}}catch{return{value:i}}}function ba(t,s){return function(r){var i=r.language,l=r.children,u=r.style,d=u===void 0?s:u,h=r.customStyle,p=h===void 0?{}:h,c=r.codeTagProps,b=c===void 0?{style:d['code[class*="language-"]']}:c,j=r.useInlineStyles,E=j===void 0?!0:j,f=r.showLineNumbers,o=f===void 0?!1:f,m=r.startingLineNumber,y=m===void 0?1:m,w=r.lineNumberContainerProps,D=r.lineNumberProps,R=r.wrapLines,L=r.lineProps,P=L===void 0?{}:L,$=r.renderer,V=r.PreTag,M=V===void 0?"pre":V,N=r.CodeTag,K=N===void 0?"code":N,Q=r.code,J=Q===void 0?Array.isArray(l)?l[0]:l:Q,ee=r.astGenerator,X=ao(r,["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","startingLineNumber","lineNumberContainerProps","lineNumberProps","wrapLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"]);ee=ee||t;var H=o?ve.createElement(ma,{containerProps:w,codeStyle:b.style||{},numberProps:D,startingLineNumber:y,codeString:J}):null,q=d.hljs||d['pre[class*="language-"]']||{backgroundColor:"#fff"},W=E?Object.assign({}
9,X,{style:Object.assign({},q,p)}):Object.assign({},X,{className:"hljs"});if(!ee)return ve.createElement(M,W,H,ve.createElement(K,b,J));R=$&&R===void 0?!0:R,$=$||ga;var v=[{type:"text",value:J}],k=xa({astGenerator:ee,language:i,code:J,defaultCodeValue:v});k.language===null&&(k.value=v);var C=R?_a(k,P):k.value;return ve.createElement(M,W,H,ve.createElement(K,b,$({rows:C,stylesheet:d,useInlineStyles:E})))}}var vs={exports:{}},ws={exports:{}},Ln;function ya(){return Ln||(Ln=1,(function(t){function s(n){"@babel/helpers - typeof";return t.exports=s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},t.exports.__esModule=!0,t.exports.default=t.exports,s(n)}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports})(ws)),ws.exports}var zn;function ja(){return zn||(zn=1,(function(t){var s=ya().default;function n(){t.exports=n=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var r,i={},l=Object.prototype,u=l.hasOwnProperty,d=Object.defineProperty||function(v,k,C){v[k]=C.value},h=typeof Symbol=="function"?Symbol:{},p=h.iterator||"@@iterator",c=h.asyncIterator||"@@asyncIterator",b=h.toStringTag||"@@toStringTag";function j(v,k,C){return Object.defineProperty(v,k,{value:C,enumerable:!0,configurable:!0,writable:!0}),v[k]}try{j({},"")}catch{j=function(C,F,x){return C[F]=x}}function E(v,k,C,F){var x=k&&k.prototype instanceof R?k:R,T=Object.create(x.prototype),B=new q(F||[]);return d(T,"_invoke",{value:J(v,C,B)}),T}function f(v,k,C){try{return{type:"normal",arg:v.call(k,C)}}catch(F){return{type:"throw",arg:F}}}i.wrap=E;var o="suspendedStart",m="suspendedYield",y="executing",w="completed",D={};function R(){}function L(){}function P(){}var $={};j($,p,function(){return this});var V=Object.getPrototypeOf,M=V&&V(V(W([])));M&&M!==l&&u.call(M,p)&&($=M);var N=P.prototype=R.prototype=Object.create($);function K(v){["next","throw","return"].forEach(function(k){j(v,k,function(C){return this._invoke(k,C)})})}function Q(v,k){function C(x,T,B,g){var U=f(v[x],v,T);if(U.type!=="throw"){var O=U.arg,oe=O.value;return oe&&s(oe)=="object"&&u.call(oe,"__await")?k.resolve(oe.__await).then(function(te){C("next",te,B,g)},function(te){C("throw",te,B,g)}):k.resolve(oe).then(function(te){O.value=te,B(O)},function(te){return C("throw",te,B,g)})}g(U.arg)}var F;d(this,"_invoke",{value:function(T,B){function g(){return new k(function(U,O){C(T,B,U,O)})}return F=F?F.then(g,g):g()}})}function J(v,k,C){var F=o;return function(x,T){if(F===y)throw new Error("Generator is already running");if(F===w){if(x==="throw")throw T;return{value:r,done:!0}}for(C.method=x,C.arg=T;;){var B=C.delegate;if(B){var g=ee(B,C);if(g){if(g===D)continue;return g}}if(C.method==="next")C.sent=C._sent=C.arg;else if(C.method==="throw"){if(F===o)throw F=w,C.arg;C.dispatchException(C.arg)}else C.method==="return"&&C.abrupt("return",C.arg);F=y;var U=f(v,k,C);if(U.type==="normal"){if(F=C.done?w:m,U.arg===D)continue;return{value:U.arg,done:C.done}}U.type==="throw"&&(F=w,C.method="throw",C.arg=U.arg)}}}function ee(v,k){var C=k.method,F=v.iterator[C];if(F===r)return k.delegate=null,C==="throw"&&v.iterator.return&&(k.method="return",k.arg=r,ee(v,k),k.method==="throw")||C!=="return"&&(k.method="throw",k.arg=new TypeError("The iterator does not provide a '"+C+"' method")),D;var x=f(F,v.iterator,k.arg);if(x.type==="throw")return k.method="throw",k.arg=x.arg,k.delegate=null,D;var T=x.arg;return T?T.done?(k[v.resultName]=T.value,k.next=v.nextLoc,k.method!=="return"&&(k.method="next",k.arg=r),k.delegate=null,D):T:(k.method="throw",k.arg=new TypeError("iterator result is not an object"),k.delegate=null,D)}function X(v){var k={tryLoc:v[0]};1 in v&&(k.catchLoc=v[1]),2 in v&&(k.finallyLoc=v[2],k.afterLoc=v[3]),this.tryEntries.push(k)}function H(v){var k=v.completion||{};k.type="normal",delete k.arg,v.completion=k}function q(v){this.tryEntries=[{tryLoc:"root"}],v.forEach(X,this),this.reset(!0)}function W(v){if(v||v===""){var k=v[p];if(k)return k.call(v);
9if(typeof v.next=="function")return v;if(!isNaN(v.length)){var C=-1,F=function x(){for(;++C<v.length;)if(u.call(v,C))return x.value=v[C],x.done=!1,x;return x.value=r,x.done=!0,x};return F.next=F}}throw new TypeError(s(v)+" is not iterable")}return L.prototype=P,d(N,"constructor",{value:P,configurable:!0}),d(P,"constructor",{value:L,configurable:!0}),L.displayName=j(P,b,"GeneratorFunction"),i.isGeneratorFunction=function(v){var k=typeof v=="function"&&v.constructor;return!!k&&(k===L||(k.displayName||k.name)==="GeneratorFunction")},i.mark=function(v){return Object.setPrototypeOf?Object.setPrototypeOf(v,P):(v.__proto__=P,j(v,b,"GeneratorFunction")),v.prototype=Object.create(N),v},i.awrap=function(v){return{__await:v}},K(Q.prototype),j(Q.prototype,c,function(){return this}),i.AsyncIterator=Q,i.async=function(v,k,C,F,x){x===void 0&&(x=Promise);var T=new Q(E(v,k,C,F),x);return i.isGeneratorFunction(k)?T:T.next().then(function(B){return B.done?B.value:T.next()})},K(N),j(N,b,"Generator"),j(N,p,function(){return this}),j(N,"toString",function(){return"[object Generator]"}),i.keys=function(v){var k=Object(v),C=[];for(var F in k)C.push(F);return C.reverse(),function x(){for(;C.length;){var T=C.pop();if(T in k)return x.value=T,x.done=!1,x}return x.done=!0,x}},i.values=W,q.prototype={constructor:q,reset:function(k){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(H),!k)for(var C in this)C.charAt(0)==="t"&&u.call(this,C)&&!isNaN(+C.slice(1))&&(this[C]=r)},stop:function(){this.done=!0;var k=this.tryEntries[0].completion;if(k.type==="throw")throw k.arg;return this.rval},dispatchException:function(k){if(this.done)throw k;var C=this;function F(O,oe){return B.type="throw",B.arg=k,C.next=O,oe&&(C.method="next",C.arg=r),!!oe}for(var x=this.tryEntries.length-1;x>=0;--x){var T=this.tryEntries[x],B=T.completion;if(T.tryLoc==="root")return F("end");if(T.tryLoc<=this.prev){var g=u.call(T,"catchLoc"),U=u.call(T,"finallyLoc");if(g&&U){if(this.prev<T.catchLoc)return F(T.catchLoc,!0);if(this.prev<T.finallyLoc)return F(T.finallyLoc)}else if(g){if(this.prev<T.catchLoc)return F(T.catchLoc,!0)}else{if(!U)throw new Error("try statement without catch or finally");if(this.prev<T.finallyLoc)return F(T.finallyLoc)}}}},abrupt:function(k,C){for(var F=this.tryEntries.length-1;F>=0;--F){var x=this.tryEntries[F];if(x.tryLoc<=this.prev&&u.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var T=x;break}}T&&(k==="break"||k==="continue")&&T.tryLoc<=C&&C<=T.finallyLoc&&(T=null);var B=T?T.completion:{};return B.type=k,B.arg=C,T?(this.method="next",this.next=T.finallyLoc,D):this.complete(B)},complete:function(k,C){if(k.type==="throw")throw k.arg;return k.type==="break"||k.type==="continue"?this.next=k.arg:k.type==="return"?(this.rval=this.arg=k.arg,this.method="return",this.next="end"):k.type==="normal"&&C&&(this.next=C),D},finish:function(k){for(var C=this.tryEntries.length-1;C>=0;--C){var F=this.tryEntries[C];if(F.finallyLoc===k)return this.complete(F.completion,F.afterLoc),H(F),D}},catch:function(k){for(var C=this.tryEntries.length-1;C>=0;--C){var F=this.tryEntries[C];if(F.tryLoc===k){var x=F.completion;if(x.type==="throw"){var T=x.arg;H(F)}return T}}throw new Error("illegal catch attempt")},delegateYield:function(k,C,F){return this.delegate={iterator:W(k),resultName:C,nextLoc:F},this.method==="next"&&(this.arg=r),D}},i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})(vs)),vs.exports}var Ss,On;function va(){if(On)return Ss;On=1;var t=ja()();Ss=t;try{regeneratorRuntime=t}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}return Ss}var wa=va();const ns=ti(wa);function Wn(t,s,n,r,i,l,u){try{var d=t[l](u),h=d.value}catch(p){n(p);return}d.done?s(h):Promise.resolve(h).then(r,i)}function Pr(t){return function(){var s=this,n=arguments;return new Promise(function(r,i){var l=t.apply(s,n);function u(h){Wn(l,r,i,u,d,"next",h)}function d(h){Wn(l,r,i,u,d,"throw",h)}u(void 0)})}}const Sa=(function(t){var s=t.loader,n=t.isLanguageRegistered,r=t.registerLanguage,i=t.languageLoaders,l=t.noAsyncLoadingLanguages,u=(function(d){lo(h,d);function h(){return co(this,h),uo(this,po(h).apply(this,arguments))}
9return ho(h,[{key:"componentDidUpdate",value:function(){!h.isRegistered(this.props.language)&&i&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var c=this;h.astGeneratorPromise||h.loadAstGenerator(),h.astGenerator||h.astGeneratorPromise.then(function(){c.forceUpdate()}),!h.isRegistered(this.props.language)&&i&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var c=this,b=this.props.language;b!=="text"&&h.loadLanguage(b).then(function(){c.forceUpdate()})}},{key:"normalizeLanguage",value:function(c){return h.isSupportedLanguage(c)?c:"text"}},{key:"render",value:function(){return ve.createElement(h.highlightInstance,Mt({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:h.astGenerator}))}}],[{key:"preload",value:function(){return h.loadAstGenerator()}},{key:"loadLanguage",value:(function(){var p=Pr(ns.mark(function c(b){var j;return ns.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(j=i[b],typeof j!="function"){f.next=5;break}return f.abrupt("return",j(h.registerLanguage));case 5:throw new Error("Language ".concat(b," not supported"));case 6:case"end":return f.stop()}},c,this)}));return function(b){return p.apply(this,arguments)}})()},{key:"isSupportedLanguage",value:function(c){return h.isRegistered(c)||typeof i[c]=="function"}},{key:"loadAstGenerator",value:function(){return h.astGeneratorPromise=s().then(function(c){h.astGenerator=c,r&&h.languages.forEac
9h(function(b,j){return r(c,j,b)})}),h.astGeneratorPromise}}]),h})(ve.PureComponent);return dt(u,"astGenerator",null),dt(u,"highlightInstance",ba(null,{})),dt(u,"astGeneratorPromise",null),dt(u,"languages",new Map),dt(u,"supportedLanguages",t.supportedLanguages||Object.keys(i||{})),dt(u,"isRegistered",function(d){if(l)return!0;if(!r)throw new Error("Current syntax highlighter doesn't support registration of languages");return u.astGenerator?n(u.astGenerator,d):u.languages.has(d)}),dt(u,"registerLanguage",function(d,h){if(!r)throw new Error("Current syntax highlighter doesn't support registration of languages");if(u.astGenerator)return r(u.astGenerator,d,h);u.languages.set(d,h)}),u}),A=(function(t,s){return(function(){var n=Pr(ns.mark(function r(i){var l;return ns.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,s();case 2:l=d.sent,i(t,l.default||l);case 4:case"end":return d.stop()}},r,this)}));return function(r){return n.apply(this,arguments)}})()}),Ca={abap:A("abap",function(){return I(()=>import("./abap-DV77hVRW.js").then(t=>t.a),__vite__mapDeps([0,1]))}),actionscript:A("actionscript",function(){return I(()=>import("./actionscript-DyLB7uHw.js").then(t=>t.a),__vite__mapDeps([2,1]))}),ada:A("ada",function(){return I(()=>import("./ada-Bbs6w9PW.js").then(t=>t.a),__vite__mapDeps([3,1]))}),apacheconf:A("apacheconf",function(){return I(()=>import("./apacheconf-CF35fTgE.js").then(t=>t.a),__vite__mapDeps([4,1]))}),apl:A("apl",function(){return I(()=>import("./apl-BwNbAB7u.js").then(t=>t.a),__vite__mapDeps([5,1]))}),applescript:A("applescript",function(){return I(()=>import("./applescript-DEbrK4Bt.js").then(t=>t.a),__vite__mapDeps([6,1]))}),arduino:A("arduino",function(){return I(()=>import("./arduino-DZL-rctD.js").then(t=>t.a),__vite__mapDeps([7,1,8,9]))}),arff:A("arff",function(){return I(()=>import("./arff-BoEy5Wq_.js").then(t=>t.a),__vite__mapDeps([10,1]))}),asciidoc:A("asciidoc",function(){return I(()=>import("./asciidoc-B3sIlHlS.js").then(t=>t.a),__vite__mapDeps([11,1]))}),asm6502:A("asm6502",function(){return I(()=>import("./asm6502-Dt5_Odzp.js").then(t=>t.a),__vite__mapDeps([12,1]))}),aspnet:A("aspnet",function(){return I(()=>import("./aspnet-Dk6GV6eJ.js").then(t=>t.a),__vite__mapDeps([13,1]))}),autohotkey:A("autohotkey",function(){return I(()=>import("./autohotkey-fkFS83wa.js").then(t=>t.a),__vite__mapDeps([14,1]))}),autoit:A("autoit",function(){return I(()=>import("./autoit-Bg7g0MbF.js").then(t=>t.a),__vite__mapDeps([15,1]))}),bash:A("bash",function(){return I(()=>import("./bash-BNPaHgfZ.js").then(t=>t.b),__vite__mapDeps([16,1]))}),basic:A("basic",function(){return I(()=>import("./basic-C8AifFEy.js").then(t=>t.b),__vite__mapDeps([17,1,18]))}),batch:A("batch",function(){return I(()=>import("./batch-4RoY8fiZ.js").then(t=>t.b),__vite__mapDeps([19,1]))}),bison:A("bison",function(){return I(()=>import("./bison-9QtFr8is.js").then(t=>t.b),__vite__mapDeps([20,1,9]))}),brainfuck:A("brainfuck",function(){return I(()=>import("./brainfuck-DCtp19vS.js").then(t=>t.b),__vite__mapDeps([21,1]))}),bro:A("bro",function(){return I(()=>import("./bro-CIeVpz55.js").then(t=>t.b),__vite__mapDeps([22,1]))}),c:A("c",function(){return I(()=>import("./c-B91oWTYA.js").then(t=>t.c),__vite__mapDeps([23,1,9]))}),clike:A("clike",function(){return I(()=>import("./clike-CNLvFxhW.js").then(t=>t.c),__vite__mapDeps([24,1,25]))}),clojure:A("clojure",function(){return I(()=>import("./clojure-CAcggENr.js").then(t=>t.c),__vite__mapDeps([26,1]))}),coffeescript:A("coffeescript",function(){return I(()=>import("./coffeescript-BBKvmWx9.js").then(t=>t.c),__vite__mapDeps([27,1]))}),cpp:A("cpp",function(){return I(()=>import("./cpp-CO_rCUKB.js").then(t=>t.c),__vite__mapDeps([28,1,8,9]))}),crystal:A("crystal",function(){return I(()=>import("./crystal-XsnrHCJ5.js").then(t=>t.c),__vite__mapDeps([29,1,30]))}),csharp:A("csharp",function(){return I(()=>import("./csharp-CC26C9-k.js").then(t=>t.c),__vite__mapDeps([31,1]))}),csp:A("csp",function(){return I(()=>import("./csp-C08hbhUA.js").then(t=>t.c),__vite__mapDeps([32,1]))}),cssExtras:A("cssExtras",function(){return I(()=>import("./css-extras-DYOxGPth.js").then(t=>t.c),__vite__mapDeps([33,1]))}),css:A("css",function(){return I(()=>import("./css-k6r86-iN.js").then(t=>t.c),__vite__mapDeps([34,1,35]))}),d:A("d",function(){return I(()=>import("./d-Cc9C-Yvc.js").then(t=>t.d),__vite__mapDeps([36,1]))}),dart:A("dart",function(){return I(()=>import("./dart-B_Gq3XQR.js").then(t=>t.d),__vite__mapDeps([37,1]))}),diff:A("diff",function(){return I(()=>import("./diff-Dv05AY6T.js").then(t=>t.d),__vite__mapDeps([38,1]))}),django:A("django",function(){return I(()=>import("./django-Dv6Tdw-C.js").then(t=>t.d),__vite__mapDeps([39,1,40]))}),docker:A("docker",function(){return I(()=>import("./docker-ppZBCUij.js").then(t=>t.d),__vite__mapDeps([41,1]))}),eiffel:A("eiffel",function(){return I(()=>import("./eiffel-BXloJmWS.js").then(t=>t.e),__vite__mapDeps([42,1]))}),elixir:A("elixir",function(){return I(()=>import("./elixir-2JBMbTIi.js").then(t=>t.e),__vite__mapDeps([43,1]))}),elm:A("elm",function(){return I(()=>import("./elm-9A7_OO51.js").then(t=>t.e),__vite__mapDeps([44,1]))}),erb:A("erb",function(){return I(()=>import("./erb-C_e7Wzgw.js").then(t=>t.e),__vite__mapDeps([45,1,40,30]))}),erlang:A("erlang",function(){return I(()=>import("./erlang-fmRyNVcI.js").then(t=>t.e),__vite__mapDeps([46,1]))}),flow:A("flow",function(){return I(()=>import("./flow-gvc6574u.js").then(t=>t.f),__vite__mapDeps([47,1]))}),fortran:A("fortran",function(){return I(()=>import("./fortran-CSMKvG9N.js").then(t=>t.f),__vite__mapDeps([48,1]))}),fsharp:A("fsharp",function(){return I(()=>import("./fsharp-DmQ01A72.js").then(t=>t.f),__vite__mapDeps([49,1]))}),gedcom:A("gedcom",function(){return I(()=>import("./gedcom-XXLeDdMq.js").then(t=>t.g),__vite__mapDeps([50,1]))}),gherkin:A("gherkin",function(){return I(()=>import("./gherkin-YnzMcuXB.js").then(t=>t.g),__vite__mapDeps([51,1]))}),git:A("git",function(){return I(()=>import("./git-CoDxWpwh.js").then(t=>t.g),__vite__mapDeps([52,1]))}),glsl:A("glsl",function(){return I(()=>import("./glsl-PKk0J8PR.js").then(t=>t.g),__vite__mapDeps([53,1]))}),go:A("go",function(){return I(()=>import("./go-C4TSfsiw.js").then(t=>t.g),__vite__mapDeps([54,1]))}),graphql:A("graphql",function(){return I(()=>import("./graphql-Cb16e-A7.js").then(t=>t.g),__vite__mapDeps([55,1]))}),groovy:A("groovy",function(){return I(()=>import("./groovy-CA-nfse_.js").then(t=>t.g),__vite__mapDeps([56,1]))}),haml:A("haml",function(){return I(()=>
9import("./haml-COSJye4G.js").then(t=>t.h),__vite__mapDeps([57,1]))}),handlebars:A("handlebars",function(){return I(()=>import("./handlebars-t8wkg6xN.js").then(t=>t.h),__vite__mapDeps([58,1,40]))}),haskell:A("haskell",function(){return I(()=>import("./haskell-vtsQU3KK.js").then(t=>t.h),__vite__mapDeps([59,1]))}),haxe:A("haxe",function(){return I(()=>import("./haxe-Bvgb-4GL.js").then(t=>t.h),__vite__mapDeps([60,1]))}),hpkp:A("hpkp",function(){return I(()=>import("./hpkp-wnmh-5Es.js").then(t=>t.h),__vite__mapDeps([61,1]))}),hsts:A("hsts",function(){return I(()=>import("./hsts-82VDbNGS.js").then(t=>t.h),__vite__mapDeps([62,1]))}),http:A("http",function(){return I(()=>import("./http-BNL4moT5.js").then(t=>t.h),__vite__mapDeps([63,1]))}),ichigojam:A("ichigojam",function(){return I(()=>import("./ichigojam-CK7aDz7w.js").then(t=>t.i),__vite__mapDeps([64,1]))}),icon:A("icon",function(){return I(()=>import("./icon-BqLiLdOt.js").then(t=>t.i),__vite__mapDeps([65,1]))}),inform7:A("inform7",function(){return I(()=>import("./inform7-Hda_hODM.js").then(t=>t.i),__vite__mapDeps([66,1]))}),ini:A("ini",function(){return I(()=>import("./ini-C7avWR4R.js").then(t=>t.i),__vite__mapDeps([67,1]))}),io:A("io",function(){return I(()=>import("./io-BoAIQe4n.js").then(t=>t.i),__vite__mapDeps([68,1]))}),j:A("j",function(){return I(()=>import("./j-Bx-6TtCE.js").then(t=>t.j),__vite__mapDeps([69,1]))}),java:A("java",function(){return I(()=>import("./java-CCeu2L0k.js").then(t=>t.j),__vite__mapDeps([70,1,71]))}),javascript:A("javascript",function(){return I(()=>import("./javascript-D7O3JJOH.js").then(t=>t.j),__vite__mapDeps([72,1,73]))}),jolie:A("jolie",function(){return I(()=>import("./jolie-B7UQH2Fu.js").then(t=>t.j),__vite__mapDeps([74,1]))}),json:A("json",function(){return I(()=>import("./json-DFhl84MS.js").then(t=>t.j),__vite__mapDeps([75,1]))}),jsx:A("jsx",function(){return I(()=>import("./jsx-B7wAj0Qh.js").then(t=>t.j),__vite__mapDeps([76,1,77]))}),julia:A("julia",function(){return I(()=>import("./julia-CMC9hJif.js").then(t=>t.j),__vite__mapDeps([78,1]))}),keyman:A("keyman",function(){return I(()=>import("./keyman-Yic1jd9N.js").then(t=>t.k),__vite__mapDeps([79,1]))}),kotlin:A("kotlin",function(){return I(()=>import("./kotlin-BtLpV0TF.js").then(t=>t.k),__vite__mapDeps([80,1]))}),latex:A("latex",function(){return I(()=>import("./latex-DlUcs9Tv.js").then(t=>t.l),__vite__mapDeps([81,1]))}),less:A("less",function(){return I(()=>import("./less-D2ijnoYF.js").then(t=>t.l),__vite__mapDeps([82,1]))}),liquid:A("liquid",function(){return I(()=>import("./liquid-CAvXwp52.js").then(t=>t.l),__vite__mapDeps([83,1]))}),lisp:A("lisp",function(){return I(()=>import("./lisp-B9nugxwY.js").then(t=>t.l),__vite__mapDeps([84,1]))}),livescript:A("livescript",function(){return I(()=>import("./livescript-CJAB_r1K.js").then(t=>t.l),__vite__mapDeps([85,1]))}),lolcode:A("lolcode",function(){return I(()=>import("./lolcode-Bg7Dhbpq.js").then(t=>t.l),__vite__mapDeps([86,1]))}),lua:A("lua",function(){return I(()=>import("./lua-BTXYkT2Y.js").then(t=>t.l),__vite__mapDeps([87,1]))}),makefile:A("makefile",function(){return I(()=>import("./makefile-D7WSESad.js").then(t=>t.m),__vite__mapDeps([88,1]))}),markdown:A("markdown",function(){return I(()=>import("./markdown-BUQBPyso.js").then(t=>t.m),__vite__mapDeps([89,1]))}),markupTemplating:A("markupTemplating",function(){return I(()=>import("./markup-templating-C_xMu36L.js").then(t=>t.m),__vite__mapDeps([90,1,40]))}),markup:A("markup",function(){return I(()=>import("./markup-mFk57ORe.js").then(t=>t.m),__vite__mapDeps([91,1,92]))}),matlab:A("matlab",function(){return I(()=>import("./matlab-BwByJ-wA.js").then(t=>t.m),__vite__mapDeps([93,1]))}),mel:A("mel",function(){return I(()=>import("./mel-Cu7gn0uC.js").then(t=>t.m),__vite__mapDeps([94,1]))}),mizar:A("mizar",function(){return I(()=>import("./mizar-gKs5zPwe.js").then(t=>t.m),__vite__mapDeps([95,1]))}),monkey:A("monkey",function(){return I(()=>import("./monkey-lWYqT2Mj.js").then(t=>t.m),__vite__mapDeps([96,1]))}),n4js:A("n4js",function(){return I(()=>import("./n4js-DPCF6A2L.js").then(t=>t.n),__vite__mapDeps([97,1]))}),nasm:A("nasm",function(){return I(()=>import("./nasm-DZlHg7S8.js").then(t=>t.n),__vite__mapDeps([98,1]))}),nginx:A("nginx",function(){return I(()=>import("./nginx-DG03tRvh.js").then(t=>t.n),__vite__mapDeps([99,1]))}),nim:A("nim",function(){return I(()=>import("./nim-DoTE89ud.js").then(t=>
9t.n),__vite__mapDeps([100,1]))}),nix:A("nix",function(){return I(()=>import("./nix-BbTf4UEg.js").then(t=>t.n),__vite__mapDeps([101,1]))}),nsis:A("nsis",function(){return I(()=>import("./nsis-C0OzytuP.js").then(t=>t.n),__vite__mapDeps([102,1]))}),objectivec:A("objectivec",function(){return I(()=>import("./objectivec-Cp6Wr0r-.js").then(t=>t.o),__vite__mapDeps([103,1,9]))}),ocaml:A("ocaml",function(){return I(()=>import("./ocaml-ljjGbuxl.js").then(t=>t.o),__vite__mapDeps([104,1]))}),opencl:A("opencl",function(){return I(()=>import("./opencl-DAz4b7yy.js").then(t=>t.o),__vite__mapDeps([105,1,9,8]))}),oz:A("oz",function(){return I(()=>import("./oz-BNJyMhKF.js").then(t=>t.o),__vite__mapDeps([106,1]))}),parigp:A("parigp",function(){return I(()=>import("./parigp-BDMd_I6x.js").then(t=>t.p),__vite__mapDeps([107,1]))}),parser:A("parser",function(){return I(()=>import("./parser-C2UtTcax.js").then(t=>t.p),__vite__mapDeps([108,1]))}),pascal:A("pascal",function(){return I(()=>import("./pascal-O1IdZgxa.js").then(t=>t.p),__vite__mapDeps([109,1]))}),perl:A("perl",function(){return I(()=>import("./perl-Dskn3Y9f.js").then(t=>t.p),__vite__mapDeps([110,1]))}),phpExtras:A("phpExtras",function(){return I(()=>import("./php-extras-D1EPKrhS.js").then(t=>t.p),__vite__mapDeps([111,1,112,40]))}),php:A("php",function(){return I(()=>import("./php-bnU2qan6.js").then(t=>t.p),__vite__mapDeps([113,1,112,40]))}),plsql:A("plsql",function(){return I(()=>import("./plsql-DHBMYkrf.js").then(t=>t.p),__vite__mapDeps([114,1,115]))}),powershell:A("powershell",function(){return I(()=>import("./powershell-LiBKeun9.js").then(t=>t.p),__vite__mapDeps([116,1]))}),processing:A("processing",function(){return I(()=>import("./processing-C_UwCoxO.js").then(t=>t.p),__vite__mapDeps([117,1]))}),prolog:A("prolog",function(){return I(()=>import("./prolog-Cr42Z1Mv.js").then(t=>t.p),__vite__mapDeps([118,1]))}),properties:A("properties",function(){return I(()=>import("./properties-Cn1k-8_G.js").then(t=>t.p),__vite__mapDeps([119,1]))}),protobuf:A("protobuf",function(){return I(()=>import("./protobuf-CSaFqR4V.js").then(t=>t.p),__vite__mapDeps([120,1]))}),pug:A("pug",function(){return I(()=>import("./pug-BiUObuVg.js").then(t=>t.p),__vite__mapDeps([121,1]))}),puppet:A("puppet",function(){return I(()=>import("./puppet-CqyBS24C.js").then(t=>t.p),__vite__mapDeps([122,1]))}),pure:A("pure",function(){return I(()=>import("./pure-C0OPfCAz.js").then(t=>t.p),__vite__mapDeps([123,1,9]))}),python:A("python",function(){return I(()=>import("./python-Qwej_Qcf.js").then(t=>t.p),__vite__mapDeps([124,1]))}),q:A("q",function(){return I(()=>import("./q-BYbDdzh9.js").then(t=>t.q),__vite__mapDeps([125,1]))}),qore:A("qore",function(){return I(()=>import("./qore-BZKmbxW0.js").then(t=>t.q),__vite__mapDeps([126,1]))}),r:A("r",function(){return I(()=>import("./r-CtR4_UMU.js").then(t=>t.r),__vite__mapDeps([127,1]))}),reason:A("reason",function(){return I(()=>import("./reason-QBPwDtq7.js").then(t=>t.r),__vite__mapDeps([128,1]))}),renpy:A("renpy",function(){return I(()=>import("./renpy-ByEg5xiZ.js").then(t=>t.r),__vite__mapDeps([129,1]))}),rest:A("rest",function(){return I(()=>import("./rest-b6nMrUGR.js").then(t=>t.r),__vite__mapDeps([130,1]))}),rip:A("rip",function(){return I(()=>import("./rip-BdxkIlBX.js").then(t=>t.r),__vite__mapDeps([131,1]))}),roboconf:A("roboconf",function(){return I(()=>import("./roboconf-CrCQFXsZ.js").then(t=>t.r),__vite__mapDeps([132,1]))}),ruby:A("ruby",function(){return I(()=>import("./ruby-ZX6kQGxh.js").then(t=>t.r),__vite__mapDeps([133,1,30]))}),rust:A("rust",function(){return I(()=>import("./rust-Dkp3Hkuz.js").then(t=>t.r),__vite__mapDeps([134,1]))}),sas:A("sas",function(){return I(()=>import("./sas--o45o-iT.js").then(t=>t.s),__vite__mapDeps([135,1]))}),sass:A("sass",function(){return I(()=>import("./sass-CabG3CKO.js").then(t=>t.s),__vite__mapDeps([136,1]))}),scala:A("scala",function(){return I(()=>import("./scala-DQI_9P6S.js").then(t=>t.s),__vite__mapDeps([137,1,71]))}),scheme:A("scheme",function(){return I(()=>import("./scheme-DCw2xPKa.js").then(t=>t.s),__vite__mapDeps([138,1]))}),scss:A("scss",function(){return I(()=>import("./scss-BckyVEbA.js").then(t=>t.s),__vite__mapDeps([139,1]))}),smalltalk:A("smalltalk",function(){return I(()=>import("./smalltalk-64TqhiHv.js").then(t=>t.s),__vite__mapDeps([140,1]))}),smarty:A("smarty",function(){return I(()=>import("./smarty-CEy-SoLe.js").then(t=>t.s),__vite__mapDeps([141,1,40]))}),soy:A("soy",function(){return I(()=>import("./soy-Y9HUP6cX.js").then(t=>t.s),__vite__mapDeps([142,1,40]))}),sql:A("sql",function(){return I(()=>import("./sql-C8bXAcEN.js").then(t=>t.s),__vite__mapDeps([143,1,115]))}),stylus:A("stylus",function(){return I(()=>import("./stylus-CXdtT_PB.js").then(t=>t.s),__vite__mapDeps([144,1]))}),swift:A("swift",function(){return I(()=>import("./swift-BXyyaRWc.js").then(t=>t.s),__vite__mapDeps([145,1]))}),tap:A("tap",function(){return I(()=>import("./tap-CidAtLVp.js").then(t=>t.t),__vite__mapDeps([146,1]))}),tcl:A("tcl",function(){return I(()=>import("./tcl-DXwjuy_m.js").then(t=>t.t),__vite__mapDeps([147,1]))}),textile:A("textile",function(){return I(()=>import("./textile-CA3Y7xJs.js").then(t=>t.t),__vite__mapDeps([148,1]))}),tsx:A("tsx",function(){return I(()=>import("./tsx-Bz9lI800.js").then(t=>t.t),__vite__mapDeps([149,1,77,150]))}),tt2:A("tt2",function(){return I(()=>import("./tt2-D3DJMISz.js").then(t=>t.t),__vite__mapDeps([151,1,40]))}),twig:A("twig",function(){return I(()=>import("./twig-WFotadbw.js").then(t=>t.t),__vite__mapDeps([152,1]))}),typescript:A("typescript",function(){return I(()=>import("./typescript-D4SdlehN.js").then(t=>t.t),__vite__mapDeps([153,1,150]))}),vbnet:A("vbnet",function(){return I(()=>
9import("./vbnet-DYrYup2w.js").then(t=>t.v),__vite__mapDeps([154,1,18]))}),velocity:A("velocity",function(){return I(()=>import("./velocity-CieQHVzw.js").then(t=>t.v),__vite__mapDeps([155,1]))}),verilog:A("verilog",function(){return I(()=>import("./verilog-Bg4K-BhM.js").then(t=>t.v),__vite__mapDeps([156,1]))}),vhdl:A("vhdl",function(){return I(()=>import("./vhdl-DKoTTDDj.js").then(t=>t.v),__vite__mapDeps([157,1]))}),vim:A("vim",function(){return I(()=>import("./vim-Cg38PyJj.js").then(t=>t.v),__vite__mapDeps([158,1]))}),visualBasic:A("visualBasic",function(){return I(()=>import("./visual-basic-Cl9Jpm4V.js").then(t=>t.v),__vite__mapDeps([159,1]))}),wasm:A("wasm",function(){return I(()=>import("./wasm-B6Hvns3H.js").then(t=>t.w),__vite__mapDeps([160,1]))}),wiki:A("wiki",function(){return I(()=>import("./wiki-BChsw-XN.js").then(t=>t.w),__vite__mapDeps([161,1]))}),xeora:A("xeora",function(){return I(()=>import("./xeora-B5MKFfMk.js").then(t=>t.x),__vite__mapDeps([162,1]))}),xojo:A("xojo",function(){return I(()=>import("./xojo-Q-lFte7F.js").then(t=>t.x),__vite__mapDeps([163,1]))}),xquery:A("xquery",function(){return I(()=>import("./xquery-CYqFRd7J.js").then(t=>t.x),__vite__mapDeps([164,1]))}),yaml:A("yaml",function(){return I(()=>import("./yaml-rqfjhcQa.js").then(t=>t.y),__vite__mapDeps([165,1]))})},ka=Sa({loader:function(){return I(()=>import("./core-BCOxchYB.js").then(s=>s.c),__vite__mapDeps([166,1,92,35,25,73])).then(function(s){return s.default||s})},isLanguageRegistered:function(s,n){return s.registered(n)},languageLoaders:Ca,registerLanguage:function(s,n,r){return s.register(r)}});function Je(){return Je=Object.assign||function(t){for(var s=1;s<arguments.length;s++){var n=arguments[s];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Je.apply(this,arguments)}function Lr(t,s){t.prototype=Object.create(s.prototype),t.prototype.constructor=t,t.__proto__=s}var Ia="light";function Ea(t){return Je({mode:Ia},t?.theme)}function me(t){var s=t;return function(n){var r=Ea(n);return s[r.mode]}}var Aa=function(s){var n={theme:s};return{lineNumberColor:me({light:"#383a42",dark:"#abb2bf"})(n),lineNumberBgColor:me({light:"#fafafa",dark:"#282c34"})(n),backgroundColor:me({light:"#fafafa",dark:"#282c34"})(n),textColor:me({light:"#383a42",dark:"#abb2bf"})(n),substringColor:me({light:"#e45649",dark:"#e06c75"})(n),keywordColor:me({light:"#a626a4",dark:"#c678dd"})(n),attributeColor:me({light:"#50a14f",dark:"#98c379"})(n),selectorAttributeColor:me({light:"#e45649",dark:"#e06c75"})(n),docTagColor:me({light:"#a626a4",dark:"#c678dd"})(n),nameColor:me({light:"#e45649",dark:"#e06c75"})(n),builtInColor:me({light:"#c18401",dark:"#e6c07b"})(n),literalColor:me({light:"#0184bb",dark:"#56b6c2"})(n),bulletColor:me({light:"#4078f2",dark:"#61aeee"})(n),codeColor:me({light:"#383a42",dark:"#abb2bf"})(n),additionColor:me({light:"#50a14f",dark:"#98c379"})(n),regexpColor:me({light:"#50a14f",dark:"#98c379"})(n),symbolColor:me({light:"#4078f2",dark:"#61aeee"})(n),variableColor:me({light:"#986801",dark:"#d19a66"})(n),templateVariableColor:me({light:"#986801",dark:"#d19a66"})(n),linkColor:me({light:"#4078f2",dark:"#61aeee"})(n),selectorClassColor:me({light:"#986801",dark:"#d19a66"})(n),typeColor:me({light:"#986801",dark:"#d19a66"})(n),stringColor:me({light:"#50a14f",dark:"#98c379"})(n),selectorIdColor:me({light:"#4078f2",dark:"#61aeee"})(n),quoteColor:me({light:"#a0a1a7",dark:"#5c6370"})(n),templateTagColor:me({light:"#383a42",dark:"#abb2bf"})(n),deletionColor:me({light:"#e45649",dark:"#e06c75"})(n),titleColor:me({light:"#4078f2",dark:"#61aeee"})(n),sectionColor:me({light:"#e45649",dark:"#e06c75"})(n),commentColor:me({light:"#a0a1a7",dark:"#5c6370"})(n),metaKeywordColor:me({light:"#383a42",dark:"#abb2bf"})(n),metaColor:me({light:"#4078f2",dark:"#61aeee"})(n),functionColor:me({light:"#383a42",dark:"#abb2bf"})(n),numberColor:me({light:"#986801",dark:"#d19a66"})(n)}},rs="inherit",rn="inherit",Ra={fontSize:rn,fontFamily:rs,lineHeight:20/12,padding:8},Fa=function(s){return{fontSize:rn,lineHeight:20/14,color:s.lineNumberColor,backgroundColor:s.lineNumberBgColor,flexShrink:0,padding:8,textAlign:"right",userSelect:"none"}},zr=function(s){return{key:{color:s.keywordColor,fontWeight:"bolder"},keyword:{color:s.keywordColor,fontWeight:"bolder"},"attr-name":{color:s.attributeColor},selector:{color:s.selectorTagColor},comment:{color:s.commentColor,fontFamily:rs,fontStyle:"italic"},"block-comment":{color:s.commentColor,fontFamily:rs,fontStyle:"italic"},"function-name":{color:s.sectionColor},"class-name":{color:s.sectionColor},doctype:{color:s.docTagColor},substr:{color:s.substringColor},namespace:{color:s.nameColor},builtin:{color:s.builtInColor},entity:{color:s.literalColor},bullet:{color:s.bulletColor},code:{color:s.codeColor},addition:{color:s.additionColor},regex:{color:s.regexpColor},symbol:{color:s.symbolColor},variable:{color:s.variableColor},url:{color:s.linkColor},"selector-attr":{color:s.selectorAttributeColor},"selector-pseudo":{color:s.selectorPseudoColor},type:{color:s.typeColor},string:{color:s.stringColor},quote:{color:s.quoteColor},tag:{color:s.templateTagColor},deletion:{color:s.deletionColor},title:{color:s.titleColor},section:{color:s.sectionColor},"meta-keyword":{color:s.metaKeywordColor},meta:{color:s.metaColor},italic:{fontStyle:"italic"},bold:{fontWeight:"bolder"},function:{color:s.functionColor},number:{color:s.numberColor}}},Or=function(s){return{fontSize:rn,fontFamily:rs,background:s.backgroundColor,color:s.textColor,borderRadius:3,dis
9play:"flex",lineHeight:20/14,overflowX:"auto",whiteSpace:"pre"}},Ta=function(s){return Je({'pre[class*="language-"]':Or(s)},zr(s))},Da=function(s){return Je({'pre[class*="language-"]':Je({},Or(s),{padding:"2px 4px",display:"inline",whiteSpace:"pre-wrap"})},zr(s))};function Wr(t){t===void 0&&(t={mode:"light"});var s=Je({},Aa(t),t);return{lineNumberContainerStyle:Fa(s),codeBlockStyle:Ta(s),inlineCodeStyle:Da(s),codeContainerStyle:Ra}}var Pa=Object.freeze([{name:"PHP",alias:["php","php3","php4","php5"],value:"php"},{name:"Java",alias:["java"],value:"java"},{name:"CSharp",alias:["csharp","c#"],value:"cs"},{name:"Python",alias:["python","py"],value:"python"},{name:"JavaScript",alias:["javascript","js"],value:"javascript"},{name:"XML",alias:["xml"],value:"xml"},{name:"HTML",alias:["html","htm"],value:"html"},{name:"C++",alias:["c++","cpp","clike"],value:"cpp"},{name:"Ruby",alias:["ruby","rb","duby"],value:"ruby"},{name:"Objective-C",alias:["objective-c","objectivec","obj-c","objc"],value:"objectivec"},{name:"C",alias:["c"],value:"cpp"},{name:"Swift",alias:["swift"],value:"swift"},{name:"TeX",alias:["tex","latex"],value:"tex"},{name:"Shell",alias:["shell","bash","sh","ksh","zsh"],value:"shell"},{name:"Scala",alias:["scala"],value:"scala"},{name:"Go",alias:["go"],value:"go"},{name:"ActionScript",alias:["actionscript","actionscript3","as"],value:"actionscript"},{name:"ColdFusion",alias:["coldfusion"],value:"xml"},{name:"JavaFX",alias:["javafx","jfx"],value:"java"},{name:"VbNet",alias:["vbnet","vb.net"],value:"vbnet"},{name:"JSON",alias:["json"],value:"json"},{name:"MATLAB",alias:["matlab"],value:"matlab"},{name:"Groovy",alias:["groovy"],value:"groovy"},{name:"SQL",alias:["sql","postgresql","postgres","plpgsql","psql","postgresql-console","postgres-console","tsql","t-sql","mysql","sqlite"],value:"sql"},{name:"R",alias:["r"],value:"r"},{name:"Perl",alias:["perl","pl"],value:"perl"},{name:"Lua",alias:["lua"],value:"lua"},{name:"Delphi",alias:["delphi","pas","pascal","objectpascal"],value:"delphi"},{name:"XML",alias:["xml"],value:"xml"},{name:"TypeScript",alias:["typescript","ts","tsx"],value:"typescript"},{name:"CoffeeScript",alias:["coffeescript","coffee-script","coffee"],value:"coffeescript"},{name:"Haskell",alias:["haskell","hs"],value:"haskell"},{name:"Puppet",alias:["puppet"],value:"puppet"},{name:"Arduino",alias:["arduino"],value:"arduino"},{name:"Fortran",alias:["fortran"],value:"fortran"},{name:"Erlang",alias:["erlang","erl"],value:"erlang"},{name:"PowerShell",alias:["powershell","posh","ps1","psm1"],value:"powershell"},{name:"Haxe",alias:["haxe","hx","hxsl"],value:"haxe"},{name:"Elixir",alias:["elixir","ex","exs"],value:"elixir"},{name:"Verilog",alias:["verilog","v"],value:"verilog"},{name:"Rust",alias:["rust"],value:"rust"},{name:"VHDL",alias:["vhdl"],value:"vhdl"},{name:"Sass",alias:["sass"],value:"less"},{name:"OCaml",alias:["ocaml"],value:"ocaml"},{name:"Dart",alias:["dart"],value:"dart"},{name:"CSS",alias:["css"],value:"css"},{name:"reStructuredText",alias:["restructuredtext","rst","rest"],value:"rest"},{name:"ObjectPascal",alias:["objectpascal"],value:"delphi"},{name:"Kotlin",alias:["kotlin"],value:"kotlin"},{name:"D",alias:["d"],value:"d"},{name:"Octave",alias:["octave"],value:"matlab"},{name:"QML",alias:["qbs","qml"],value:"qml"},{name:"Prolog",alias:["prolog"],value:"prolog"},{name:"FoxPro",alias:["foxpro","vfp","clipper","xbase"],value:"vbnet"},{name:"Scheme",alias:["scheme","scm"],value:"scheme"},{name:"CUDA",alias:["cuda","cu"],value:"cpp"},{name:"Julia",alias:["julia","jl"],value:"julia"},{name:"Racket",alias:["racket","rkt"],value:"lisp"},{name:"Ada",alias:["ada","ada95","ada2005"],value:"ada"},{name:"Tcl",alias:["tcl"],value:"tcl"},{name:"Mathematica",alias:["mathematica","mma","nb"],value:"mathematica"},{name:"Autoit",alias:["autoit"],value:"autoit"},{name:"StandardML",alias:["standardmL","sml","standardml"],value:"sml"},{name:"Objective-J",alias:["objective-j","objectivej","obj-j","objj"],value:"objectivec"},{name:"Smalltalk",alias:["smalltalk","squeak","st"],value:"smalltalk"},{name:"Vala",alias:["vala","vapi"],value:"vala"},{name:"ABAP",alias:["abap"],value:"sql"},{name:"LiveScript",alias:["livescript","live-script"],value:"livescript"},{name:"XQuery",alias:["xquery","xqy","xq","xql","xqm"],value:"xquery"},{name:"PlainText",alias:["text","plaintext"],value:"text"},{name:"Yaml",alias:["yaml","yml"],value:"yaml"},{name:"GraphQL",alias:["graphql","gql"],value:"graphql"}]),La=function(s){if(!s)return"";var n=Pa.find(function(r){return r.name===s||r.alias.includes(s)});return n?n.value:s||"text"},Br=(function(t){Lr(s,t);function s(){var r;return r=t.apply(this,arguments)||this,r._isMounted=!1,r}var n=s.prototype;return n.componentDidMount=function(){this._isMounted=!0},n.componentWillUnmount=function(){this._isMounted=!1},n.getLineOpacity=function(i){if(!this.props.highlight)return 1;var l=this.props.highlight.split(",").map(function(u){if(u.indexOf("-")>0){var d=u.split("-").map(Number).sort(),h=d[0],p=d[1];return Array(p+1).fill(void 0).map(function(c,b){return b}).slice(h,p+1)}return Number(u)}).reduce(function(u,d){return u.concat(d)},[]);return l.length===0||l.includes(i)?1:.3},n.render=function(){var i=this,l=Wr(this.props.theme),u=l.inlineCodeStyle,d=La(this.props.language),h={language:d,PreTag:this.props.preTag,style:this.props.codeStyle||u,showLineNumbers:this.props.showLineNumbers,codeTagProps:this.props.codeTagProps};return ve.createElement(ka,Object.assign({},h,{wrapLines:this.props.highlight.length>0,customStyle:this.props.customStyle,lineProps:function(c){return{style:Je({opacity:i.getLineOpacity(c)},i.props.lineNumberContainerStyle)}}}),this.props.text)},s}
9)(a.PureComponent);Br.defaultProps={theme:{},showLineNumbers:!1,lineNumberContainerStyle:{},codeTagProps:{},preTag:"span",highlight:"",customStyle:{}};var Vr="text",on=(function(t){Lr(s,t);function s(){var r;return r=t.apply(this,arguments)||this,r._isMounted=!1,r.handleCopy=function(i){var l=i.nativeEvent.clipboardData;if(l){i.preventDefault();var u=window.getSelection();if(u===null)return;var d=u.toString(),h="<!doctype html><html><head></head><body><pre>"+d+"</pre></body></html>";l.clearData(),l.setData("text/html",h),l.setData("text/plain",d)}},r}var n=s.prototype;return n.componentDidMount=function(){this._isMounted=!0},n.componentWillUnmount=function(){this._isMounted=!1},n.render=function(){var i,l,u,d,h=Wr(this.props.theme),p=h.lineNumberContainerStyle,c=h.codeBlockStyle,b=h.codeContainerStyle,j={language:this.props.language||Vr,codeStyle:Je({},c,(i=this.props)===null||i===void 0?void 0:i.codeBlockStyle),customStyle:(l=this.props)===null||l===void 0?void 0:l.customStyle,showLineNumbers:this.props.showLineNumbers,codeTagProps:{style:Je({},b,(u=this.props)===null||u===void 0?void 0:u.codeContainerStyle)},lineNumberContainerStyle:Je({},p,(d=this.props)===null||d===void 0?void 0:d.lineNumberContainerStyle),text:this.props.text.toString(),highlight:this.props.highlight};return ve.createElement(Br,Object.assign({},j))},s})(a.PureComponent);on.displayName="CodeBlock";on.defaultProps={showLineNumbers:!0,language:Vr,theme:{},highlight:"",lineNumberContainerStyle:{},customStyle:{},codeBlockStyle:{}};var za=ca(on);function Oa(t){return ve.createElement(za,Object.assign({},t))}var Wa={lineNumberColor:"#383a42",lineNumberBgColor:"#fafafa",backgroundColor:"#fafafa",textColor:"#383a42",substringColor:"#e45649",ke
9ywordColor:"#a626a4",attributeColor:"#50a14f",selectorAttributeColor:"#e45649",docTagColor:"#a626a4",nameColor:"#e45649",builtInColor:"#c18401",literalColor:"#0184bb",bulletColor:"#4078f2",codeColor:"#383a42",additionColor:"#50a14f",regexpColor:"#50a14f",symbolColor:"#4078f2",variableColor:"#986801",templateVariableColor:"#986801",linkColor:"#4078f2",selectorClassColor:"#986801",typeColor:"#986801",stringColor:"#50a14f",selectorIdColor:"#4078f2",quoteColor:"#a0a1a7",templateTagColor:"#383a42",deletionColor:"#e45649",titleColor:"#4078f2",sectionColor:"#e45649",commentColor:"#a0a1a7",metaKeywordColor:"#383a42",metaColor:"#4078f2",functionColor:"#383a42",numberColor:"#986801"};const Ba=()=>e.jsx(S,{w:"100%",sx:{flexDir:"column"},children:e.jsx(Va,{})}),Va=()=>{const t=Ee(),[s,n]=a.useState(0),r=a.useContext(Ke),i=r?.issues??null,l=r?.setFiles??null,u=r?.scanSummary,d=r?.openIssueIndex,h=r?.setOpenIssueIndex??(()=>{});a.useEffect(()=>{u&&u.issue_severity_distribution.gas&&n(u.issue_severity_distribution.gas)},[]);const p=()=>{const c=i&&i.findIndex(b=>b.template_details.issue_severity==="gas");if(i&&l&&c&&c!==-1){const b=d?[c,...d]:[s];h(b),l({bug_id:i[c].metric_wise_aggregated_findings[0].bug_id,issue_id:i[c].issue_id,audit_type:i[c].metric_wise_aggregated_findings[0].audit_type,bug_hash:i[c].metric_wise_aggregated_findings[0].bug_hash,bug_status:i[c].metric_wise_aggregated_findings[0].bug_status,findings:i[c].metric_wise_aggregated_findings[0].findings,description_details:i[c].metric_wise_aggregated_findings[0].description_details,template_details:i[c].template_details,comment:i[c].metric_wise_aggregated_findings[0].comment,issue_description:i[c].metric_wise_aggregated_findings[0].issue_description,issue_remediation:i[c].metric_wise_aggregated_findings[0].issue_remediation,wait_to_scroll:1e3})}};return e.jsxs(S,{w:"100%",sx:{flexDir:["column","column","column"]},position:"relative",h:"calc(100vh - 200px)",children:[e.jsx(ue,{w:"100%",alignItems:"flex-start",spacing:5,px:4,overflowX:"hidden",children:e.jsx(z,{sx:{w:"100%",position:"sticky",top:8},children:e.jsx($r,{})})}),e.jsx(fo,{iconSize:90,footer:e.jsxs(S,{px:6,py:4,bg:"white",border:"1px solid #F795B4",boxShadow:"0px 0px 20px 0px #F795B429",borderRadius:"11px",alignItems:"center",justifyContent:"center",children:[e.jsx(he,{src:`${t}icons/gas-icon.svg`}),e.jsxs(ue,{ml:6,mr:8,alignItems:"flex-start",spacing:1,children:[e.jsxs(_,{fontWeight:600,children:[s," Gas Issues found"]}),e.jsx(_,{color:"text",fontWeight:400,fontSize:"xs",children:"Trial users have access to view the Gas Optimization bug exclusively. To access information about other severity issues, kindly upgrade your plan."})]}),e.jsx(bt,{color:"blue",ml:"auto",whiteSpace:"nowrap",onClick:p,children:"View Now"})]})})]})},Na=({no_of_issue:t,severity:s})=>{const[n]=$e("(min-width: 1024px)");return e.jsxs(S,{w:"100%",sx:{flexDir:["column","column","column"]},position:"relative",children:[e.jsx(ue,{w:"100%",alignItems:"flex-start",spacing:5,px:4,children:e.jsx(z,{sx:{w:"100%",position:"sticky",top:8},children:Qn.map(({filesCount:r,issueTitle:i,severity:l})=>e.jsx(Nr,{filesCount:r,issueTitle:i,severity:l}))})}),e.jsxs(S,{w:"100%",h:"100%",position:"absolute",sx:{backdropFilter:"blur(6px)"},bg:"rgba(255,255,255,0.3)",alignItems:"center",justifyContent:"flex-start",flexDir:"column",pt:20,children:[e.jsx(sr,{color:s,fontSize:50}),e.jsxs(_,{textAlign:"center",w:"80%",fontWeight:700,fontSize:"md",color:"black",mb:4,display:"flex",alignItems:"center",justifyContent:"center",children:[t,e.jsxs(_,{textTransform:"capitalize",mx:1,children:[s," "]}),"Vulnerabilities found !"]}),e.jsx(_,{textAlign:"center",w:"80%",fontWeight:300,fontSize:"sm",color:"black",mb:8,children:"Upgrade from the trial plan to find more details about these vulnerabilities."}),!n&&e.jsx(si,{to:"/billing",children:e.jsx(je,{id:"ss-upgrade-pkg",mt:2,px:4,variant:"brand",width:"100%",children:"Upgrade"})})]})]})},$a=({no_of_issue:t,severity:s})=>{const[n]=$e("(min-width: 1024px)"),{isOpen:r,onOpen:i,onClose:l}=Ye(),[u,d]=a.useState(!1),{profileData:h}=qe(),p=a.useContext(Ke);if(!p)return null;const{scanReport:c,scanSummary:b}=p,{project_name:j,project_url:E,contract_url:f,contract_address:o,contract_chain:m,contract_platform:y,scan_type:w}=c;return e.jsxs(S,{w:"100%",sx:{flexDir:["column","column","column"]},position:"relative",children:[e.jsx(ue,{w:"100%",alignItems:"flex-start",spacing:5,px:4,children:e.jsx(z,{sx:{w:"100%",position:"sticky",top:8},children:Qn.map(({filesCount:D,issueTitle:R,severity:L})=>e.jsx(Nr,{filesCount:D,issueTitle:R,severity:L}))})}),e.jsxs(S,{w:"100%",h:"100%",position:"absolute",sx:{backdropFilter:"blur(6px)"},bg:"rgba(255,255,255,0.3)",alignItems:"center",justifyContent:"center",flexDir:"column",children:[e.jsx(sr,{color:s,fontSize:50}),e.jsxs(_,{textAlign:"center",w:"80%",fontWeight:700,fontSize:"md",color:"black",mb:4,display:"flex",alignItems:"center",justifyContent:"center",children:[t,e.jsxs(_,{textTransform:"capitalize",mx:1,
9children:[s," "]}),"Vulnerabilities found !"]}),e.jsxs(_,{textAlign:"center",w:"80%",fontWeight:300,fontSize:"sm",color:"black",mb:8,children:["This project was scanned during your trial period and only included gas optimization analysis To unlock the details of these vulnerabilities, consider rescanning your project."," "]}),!n&&e.jsx(je,{id:"ss-unlock-detail",maxW:"250px",onClick:()=>{h&&b&&b.lines_analyzed_count>h?.loc_remaining?d(!0):i()},mt:2,mb:5,px:4,variant:"brand",width:"100%",children:"Unlock Details"})]}),e.jsx(en,{closeModal:l,open:r,scanDetails:w==="project"?{project_name:j,project_url:E,scan_type:w,loc:b?.lines_analyzed_count}:{contract_url:f,contract_address:o,contract_chain:m,contract_platform:y,scan_type:w,loc:b?.lines_analyzed_count}}),e.jsx(ms,{open:u,closeModal:()=>d(!1),scanDetails:w==="project"?{project_name:j,project_url:E,scan_type:w,loc:b?.lines_analyzed_count}:{contract_url:f,contract_address:o,contract_chain:m,contract_platform:y,scan_type:w,loc:b?.lines_analyzed_count}})]})},Nr=({severity:t,filesCount:s,issueTitle:n})=>e.jsxs(S,{sx:{w:"100%",my:3,alignItems:"center",justifyContent:"space-between",backgroundColor:"gray.100"},h:10,children:[e.jsx(S,{sx:{alignItems:"center"},children:e.jsx(_,{sx:{ml:3,fontWeight:600,color:"#4E5D78",maxW:250,fontSize:"sm"},w:"100%",isTruncated:!0,children:n})}),e.jsxs(re,{children:[e.jsxs(_,{sx:{mr:3,fontSize:"sm",fontWeight:600,color:"subtle"},children:[s," files"]})," ",e.jsx(Ue,{as:Ks,mr:2,color:"subtle",fontSize:"14px",transition:"transform 0.2s",transform:"rotate(90deg)"})]})]}),$r=()=>e.jsx(z,{w:"100%",children:e.jsxs(z,{sx:{borderRadius:15,bg:"bg.subtle",p:4,my:2},children:[e.jsx(S,{sx:{w:"100%",justifyContent:"flex-start",alignItems:"center"},children:e.jsx(_,{variant:"subtle",fontSize:"sm",color:"subtle",mb:2,maxW:"70%",isTruncated:!0,children:"src/test/resources/rules/SOLIDITY_TRANSFER_IN_LOOP"})}),e.jsx("pre",{children:e.jsx(Oa,{customStyle:{height:"55vh",fontSize:"14px",overflow:"scroll"},theme:Wa,showLineNumbers:!0,text:ci})})]})}),Mr=({file:t,setCurrentFile:s,currentFile:n,isAudit:r})=>{const[i,l]=a.useState(!1),[u,d]=a.useState(!1),h=a.useContext(Ke);if(!h)return null;const{scanReport:p,type:c}=h,{project_url:b,contract_url:j,contract_address:E,contract_chain:f,contract_platform:o,contract_implementation_address:m,project_branch:y}=p;if(!t?.file_path)return null;const w=n?.file_path===t.file_path,D=()=>{const R=E&&m&&t.file_path?.startsWith("impl_")?j?.replace(E,m):j;navigator.clipboard.writeText(c==="project"&&b&&b==="File Scan"?t.file_path:c==="project"&&b&&y?os(b,y,t):ui(R,o,f)).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)},()=>{})};return e.jsx(z,{onClick:()=>s(t),background:w?r?"#F3F3F3BF":"white":"gray.100",borderWidth:w?"1px":"0px",borderRightWidth:"1px",borderColor:w?"gray.100":"#C4C4C4",px:"10px",maxW:"360px",h:"40px",borderBottomColor:w?"#3300FF":"#C4C4C4",borderBottomWidth:"2px",children:e.jsxs(re,{justifyContent:"flex-start",alignItems:"center",height:"100%",maxW:"355px",pr:i||u?0:6,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[e.jsx(Oe,{label:t.file_path,"aria-label":"A tooltip",children:e.jsx(_,{fontSize:"xs",minW:"150px",maxW:t.file_path?.startsWith("impl_")?"230px":"320px",children:t.file_path?.startsWith("impl_")?mn(t.file_path.replace(/^impl_/,""),6,10)+" ( Implementation )":mn(t.file_path,8,12)})}),i&&!u&&e.jsx(ro,{onClick:R=>{R.stopPropagation(),D()}}),u&&e.jsx(Bt,{color:"#38CB89"})]})},t.file_path)};var Bn=Number.isNaN||function(s){return typeof s=="number"&&s!==s};function Ma(t,s){return!!(t===s||Bn(t)&&Bn(s))}function Ga(t,s){if(t.length!==s.length)return!1;for(var n=0;n<t.length;n++)if(!Ma(t[n],s[n]))return!1;return!0}function Cs(t,s){s===void 0&&(s=Ga);var n,r=[],i,l=!1;function u(){for(var d=[],h=0;h<arguments.length;h++)d[h]=arguments[h];return l&&n===this&&s(d,r)||(i=t.apply(this,d),l=!0,n=this,r=d),i}return u}var Ha=typeof performance=="object"&&typeof performance.now=="function",Vn=Ha?function(){return performance.now()}:function(){return Date.now()};function Nn(t){cancelAnimationFrame(t.id)}function Ua(t,s){var n=Vn();function r(){Vn()-n>=s?t.call(null):i.id=requestAnimationFrame(r)}var i={id:requestAnimationFrame(r)};return i}var ks=-1;function $n(t){if(t===void 0&&(t=!1),ks===-1||t){var s=document.createElement("div"),n=s.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(s),ks=s.offsetWidth-s.clientWidth,document.body.removeChild(s)}return ks}var jt=null;function Mn(t){if(t===void 0&&(t=!1),jt===null||t){var s=document.createElement("div"),n=s.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",s.appendChild(r),document.body.appendChild(s),s.scrollLeft>0?jt="positive-descending":(s.scrollLeft=1,s.scrollLeft===0?jt="negative":jt="positive-ascending"),document.body.removeChild(s),jt}return jt}
vendor: 5,975 bytes, line 9
9var qa=150,Ya=function(s,n){return s};function Qa(t){var s,n=t.getItemOffset,r=t.getEstimatedTotalSize,i=t.getItemSize,l=t.getOffsetForIndexAndAlignment,u=t.getStartIndexForOffset,d=t.getStopIndexForStartIndex,h=t.initInstanceProps,p=t.shouldResetStyleCacheOnItemSizeChange,c=t.validateProps;return s=(function(b){ni(j,b);function j(f){var o;return o=b.call(this,f)||this,o._instanceProps=h(o.props,wn(o)),o._outerRef=void 0,o._resetIsScrollingTimeoutId=null,o.state={instance:wn(o),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof o.props.initialScrollOffset=="number"?o.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},o._callOnItemsRendered=void 0,o._callOnItemsRendered=Cs(function(m,y,w,D){return o.props.onItemsRendered({overscanStartIndex:m,overscanStopIndex:y,visibleStartIndex:w,visibleStopIndex:D})}),o._callOnScroll=void 0,o._callOnScroll=Cs(function(m,y,w){return o.props.onScroll({scrollDirection:m,scrollOffset:y,scrollUpdateWasRequested:w})}),o._getItemStyle=void 0,o._getItemStyle=function(m){var y=o.props,w=y.direction,D=y.itemSize,R=y.layout,L=o._getItemStyleCache(p&&D,p&&R,p&&w),P;if(L.hasOwnProperty(m))P=L[m];else{var $=n(o.props,m,o._instanceProps),V=i(o.props,m,o._instanceProps),M=w==="horizontal"||R==="horizontal",N=w==="rtl",K=M?$:0;L[m]=P={position:"absolute",left:N?void 0:K,right:N?K:void 0,top:M?0:$,height:M?"100%":V,width:M?V:"100%"}}return P},o._getItemStyleCache=void 0,o._getItemStyleCache=Cs(function(m,y,w){return{}}),o._onScrollHorizontal=function(m){var y=m.currentTarget,w=y.clientWidth,D=y.scrollLeft,R=y.scrollWidth;o.setState(function(L){if(L.scrollOffset===D)return null;var P=o.props.direction,$=D;if(P==="rtl")switch(Mn()){case"negative":$=-D;break;case"positive-descending":$=R-w-D;break}return $=Math.max(0,Math.min($,R-w)),{isScrolling:!0,scrollDirection:L.scrollOffset<$?"forward":"backward",scrollOffset:$,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._onScrollVertical=function(m){var y=m.currentTarget,w=y.clientHeight,D=y.scrollHeight,R=y.scrollTop;o.setState(function(L){if(L.scrollOffset===R)return null;var P=Math.max(0,Math.min(R,D-w));return{isScrolling:!0,scrollDirection:L.scrollOffset<P?"forward":"backward",scrollOffset:P,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._outerRefSetter=function(m){var y=o.props.outerRef;o._outerRef=m,typeof y=="function"?y(m):y!=null&&typeof y=="object"&&y.hasOwnProperty("current")&&(y.current=m)},o._resetIsScrollingDebounced=function(){o._resetIsScrollingTimeoutId!==null&&Nn(o._resetIsScrollingTimeoutId),o._resetIsScrollingTimeoutId=Ua(o._resetIsScrolling,qa)},o._resetIsScrolling=function(){o._resetIsScrollingTimeoutId=null,o.setState({isScrolling:!1},function(){o._getItemStyleCache(-1,null)})},o}j.getDerivedStateFromProps=function(o,m){return Xa(o,m),c(o),null};var E=j.prototype;return E.scrollTo=function(o){o=Math.max(0,o),this.setState(function(m){return m.scrollOffset===o?null:{scrollDirection:m.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},E.scrollToItem=function(o,m){m===void 0&&(m="auto");var y=this.props,w=y.itemCount,D=y.layout,R=this.state.scrollOffset;o=Math.max(0,Math.min(o,w-1));var L=0;if(this._outerRef){var P=this._outerRef;D==="vertical"?L=P.scrollWidth>P.clientWidth?$n():0:L=P.scrollHeight>P.clientHeight?$n():0}this.scrollTo(l(this.props,o,m,R,this._instanceProps,L))},E.componentDidMount=function(){var o=this.props,m=o.direction,y=o.initialScrollOffset,w=o.layout;if(typeof y=="number"&&this._outerRef!=null){var D=this._outerRef;m==="horizontal"||w==="horizontal"?D.scrollLeft=y:D.scrollTop=y}this._callPropsCallbacks()},E.componentDidUpdate=function(){var o=this.props,m=o.direction,y=o.layout,w=this.state,D=w.scrollOffset,R=w.scrollUpdateWasRequested;if(R&&this._outerRef!=null){var L=this._outerRef;if(m==="horizontal"||y==="horizontal")if(m==="rtl")switch(Mn()){case"negative":L.scrollLeft=-D;break;case"positive-ascending":L.scrollLeft=D;break;default:var P=L.clientWidth,$=L.scrollWidth;L.scrollLeft=$-P-D;break}else L.scrollLeft=D;else L.scrollTop=D}this._callPropsCallbacks()},E.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Nn(this._resetIsScrollingTimeoutId)},E.render=function(){var o=this.props,m=o.children,y=o.className,w=o.direction,D=o.height,R=o.innerRef,L=o.innerElementType,P=o.innerTagName,$=o.itemCount,V=o.itemData,M=o.itemKey,N=M===void 0?Ya:M,K=o.layout,Q=o.outerElementType,J=o.outerTagName,ee=o.style,X=o.useIsScrolling,H=o.width,q=this.state.isScrolling,W=w==="horizontal"||K==="horizontal",v=W?this._onScrollHorizontal:this._onScrollVertical,k=this._getRangeToRender(),C=k[0],F=k[1],x=[];if($>0)for(var T=C;T<=F;T++)x.push(a.createElement(m,{data:V,key:N(T,V),index:T,isScrolling:X?q:void 0,style:this._getItemStyle(T)}));var B=r(this.props,this._instanceProps);return a.createElement(Q||J||"div",{className:y,onScroll:v,ref:this._outerRefSetter,style:Mt({position:"relative",height:D,width:H,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:w},ee)},a.createElement(L||P||"div",{children:x,ref:R,style:{height:W?"100%":B,pointerEvents:q?"none":void 0,width:W?B:"100%"}}))},E._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var o=this.props.itemCount;if(o>0){var m=this._getRangeToRender(),y=m[0],w=m[1],D=m[2],R=m[3];this._callOnItemsRendered(y,w,D,R)}}if(typeof this.props.onScroll=="function"){var L=this.state,P=L.scrollDirection,$=L.scrollOffset,V=L.scrollUpdateWasRequested;this._callOnScroll(P,$,V)}},E._getRangeToRender=function(){var o=this.props,m=o.itemCount,y=o.overscanCount,w=this.state,D=w.isScrolling,R=w.scrollDirection,L=w.scrollOffset;if(m===0)return[0,0,0,0];var P=u(this.props,L,this._instanceProps),$=d(this.props,P,L,this._instanceProps),V=!D||R==="backward"?Math.max(1,y):1,M=!D||R==="forward"?Math.max(1,y):1;return[Math.max(0,P-V),Math.max(0,Math.min(m-1,$+M)),P,$]},j}
9)(a.PureComponent),s.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},s}var Xa=function(s,n){s.children,s.direction,s.height,s.layout,s.innerTagName,s.outerTagName,s.width,n.instance},Ka=Qa({getItemOffset:function(s,n){var r=s.itemSize;return n*r},getItemSize:function(s,n){var r=s.itemSize;return r},getEstimatedTotalSize:function(s){var n=s.itemCount,r=s.itemSize;return r*n},getOffsetForIndexAndAlignment:function(s,n,r,i,l,u){var d=s.direction,h=s.height,p=s.itemCount,c=s.itemSize,b=s.layout,j=s.width,E=d==="horizontal"||b==="horizontal",f=E?j:h,o=Math.max(0,p*c-f),m=Math.min(o,n*c),y=Math.max(0,n*c-f+c+u);switch(r==="smart"&&(i>=y-f&&i<=m+f?r="auto":r="center"),r){case"start":return m;case"end":return y;case"center":{var w=Math.round(y+(m-y)/2);return w<Math.ceil(f/2)?0:w>o+Math.floor(f/2)?o:w}case"auto":default:return i>=y&&i<=m?i:i<y?y:m}},getStartIndexForOffset:function(s,n){var r=s.itemCount,i=s.itemSize;return Math.max(0,Math.min(r-1,Math.floor(n/i)))},getStopIndexForStartIndex:function(s,n,r){var i=s.direction,l=s.height,u=s.itemCount,d=s.itemSize,h=s.layout,p=s.width,c=i==="horizontal"||h==="horizontal",b=n*d,j=c?p:l,E=Math.ceil((j+r-b)/d);return Math.max(0,Math.min(u-1,n+E-1))},initInstanceProps:function(s){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(s){s.itemSize}});const Xt={critical:{main:"#960d00",light:"#FFE4E2",color:"#960d00"},high:{main:"#ff5c00",light:"#FFEBE2",color:"#ff5c00"},medium:{main:"#E0A921",light:"#FFFBDB",color:"#FFE500"},low:{main:"#38cb89",light:"#EFFCF6",color:"#38cb89"},gas:{main:"#f795b4",light:"#FFEEF4",color:"#f795b4"},informational:{main:"#a0aec0",light:"#E8E8E8",color:"#a0aec0"}},Za=({file_content:t,line_nos_start:s,line_nos_end:n,wait_to_scroll:r,focusColor:i,bgColor:l,auditMode:u,issueSeverity:d,textHighlight:h,setOpenIssueBox:p})=>{const c=a.useRef(null),b=a.useRef(null),[j]=$e("(min-width: 1350px)"),[E,f]=a.useState(!1),[o,m]=a.useState(null),y=a.useCallback(()=>{if(c.current&&s.length>0){const R=s[0]-3;setTimeout(()=>{c&&c.current&&(c.current.scrollToItem(R,"end"),w())},r)}},[r,s]);a.useEffect(()=>{y()},[y,s,n,t]);const w=()=>{setTimeout(j?()=>{b.current&&b.current.scrollIntoView({behavior:"smooth",block:"start",inline:"start"})}:()=>{b.current&&b.current.scrollIntoView({block:"end",inline:"start",behavior:"smooth"})},10)},D=({index:R,style:L})=>{let P=0;for(;R+1>n[P]&&P<n.length;)P++;return e.jsx(re,{as:"div",align:"flex-start",spacing:5,ref:R+1===s[P]?b:null,scrollMarginTop:["-60vh","-60vh","-38vh",20],style:L,pb:"350px",position:"relative",pl:0,zIndex:1,mt:4,className:R+1<=n[P]&&R+1>=s[P]?"highlighted-line":"",onMouseEnter:()=>{R+1<=n[P]&&R+1>=s[P]&&m(P)},onMouseLeave:()=>{m(null)},children:e.jsxs(z,{as:"pre",style:{fontSize:"13px",color:R+1<=n[P]&&R+1>=s[P]?"#000000":"#A0AEC0",cursor:R+1<=n[P]&&R+1>=s[P]?"pointer":"default",position:"relative",width:"100%",zIndex:2},className:"code_block",onClick:()=>{R+1<=n[P]&&R+1>=s[P]&&u&&p?.(!0)},children:[n.map($=>R+1<=n[P]&&R+1>=s[P]&&u?e.jsx(z,{position:"absolute",w:"150vw",h:"25px",bg:d&&Xt[d].light,pl:0,className:"overlay_highlighter",zIndex:-1,top:0,left:"-50vw",cursor:"pointer",children:R+1===s[P]?e.jsxs(S,{position:"absolute",left:"50vw",top:"-15px",justifyContent:"center",alignItems:"center",pl:4,gap:2,width:"fit-content",bg:d&&Xt[d].light,display:o===P?"flex":"none",className:"severity-overlay",zIndex:-1,children:[e.jsx(z,{width:"10px",height:"10px",borderRadius:"full",bg:d&&Xt[d].color})," ",e.jsx(_,{color:d&&Xt[d].main,fontSize:"12px",fontWeight:"500",textTransform:"capitalize",zIndex:-1,children:d})]}):null},$):null),e.jsxs(S,{gap:"20px",pl:2,position:"relative",zIndex:2,children:[" ",e.jsx(z,{color:"#A0AEC0",children:R+1})," ",e.jsx(z,{children:t[R]||"Â "})]})]})},R)};return e.jsx(S,{sx:{w:"100%",justifyContent:"flex-start",alignItems:"flex-start",flexDir:"column",h:["600px","600px","600px","100%"],overflow:"hidden"},onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:e.jsx(Ka,{height:600,itemCount:t.length,itemSize:25,width:"100%",ref:c,style:{scrollbarWidth:E&&j?"auto":"none"},children:D})})},Ja=async(t,s,n,r,i)=>{const{data:l}=await Re.post(t==="project"?Ie.API_GET_FILE_CONTENT:Ie.API_GET_FILE_CONTENT_BLOCK,{file_paths:[s],scan_id:n,report_id:r,project_id:i});return l},el=(t,s,n)=>as(["file_content",t,s],()=>Ja(n,s,t)),Gr=({file:t,type:s,wait_to_scroll:n=0,focusColor:r,auditMode:i,issueSeverity:l,setOpenIssueBox:u})=>{const{scanId:d}=Ve(),{file_path:h,line_nos_end:p,line_nos_start:c}=t,{data:b,isLoading:j}=el(d,h,s),[E,f]=a.useState();return a.useEffect(()=>{if(b&&b.file_contents&&b.file_contents.length){let o=b.file_contents[0].content.split(` 10`);f([...o])}},[b]),e.jsx(e.Fragment,{children:j?e.jsx(S,{sx:{w:"100%",justifyContent:"center",alignItems:"center",h:"300px"},children:e.jsx(Ne,{})}):E&&e.jsx(Za,{file_content:E,line_nos_start:c,line_nos_end:p,wait_to_scroll:n,focusColor:r?.main,bgColor:r?.light,auditMode:i,issueSeverity:l,textHighlight:r?.color,setOpenIssueBox:u})})},tl=({contract_address:t,files:s,onGenerate:n,fullScreen:r,setFullScreen:i,tabIndex:l})=>{const u=jr(),d=Ee(),{projectType:h,scanId:p}=Ve(),c=h.replace(/s$/,""),{sendMessage:b,messageQueue:j,updateMessageQueue:E,setNeedAuthToken:f}
10=xt(),o=tt(),m=a.useRef(null),[y,w]=a.useState([]),[D,R]=a.useState(!1),[L,P]=a.useState(!1),[$,V]=a.useState(""),[M,N]=a.useState(!1),[K,Q]=a.useState(!1),[J,ee]=a.useState(2);a.useEffect(()=>{s&&(w([]),V(""),P(!1),N(!1),s.findings&&s.findings.length&&s.findings[0].ai_tagged_status!==void 0&&ee(3),H())},[s]),a.useEffect(()=>{i(l===J&&!$&&!r)},[l]),a.useEffect(()=>{if(j&&j.length){const W=j.filter(v=>["generate_ai_remediation_acknowledge","ai_bug_remediation_updated"].includes(v.type));W&&W.length&&W.forEach(v=>{v.type==="ai_bug_remediation_updated"&&H();const k=j.filter(C=>C.type!=="generate_ai_remediation_acknowledge"&&C.type!=="ai_bug_remediation_updated");E(k)})}},[j]),a.useEffect(()=>{if(L){const W=Array.from({length:6},(v,k)=>setTimeout(()=>{w(C=>[...C,k])},(k+1)*100));return()=>{W.forEach(clearTimeout)}}},[L]),a.useEffect(()=>{if($&&m&&m.current){const W=m.current.getElementsByTagName("pre");if(W&&W.length){const v=W[0],k=v.getElementsByTagName("code");if(k&&k.length){const C=k[0],F=document.getElementById("ss-copy-icon");F&&F.remove();const x=document.createElement("div");x.style.color="#3300FF",x.style.cursor="pointer",x.style.position="absolute",x.style.top="-2.1rem",x.style.right="0",x.style.left="auto",x.style.width="fit-content",x.id="ss-copy-icon",v.appendChild(x),yi.render(e.jsx(X,{isCopied:K,onClick:()=>{navigator.clipboard.writeText(C.innerText),Q(!0),setTimeout(()=>{Q(!1)},1500),o({title:"Remediation code copied!",status:"success",duration:1500,isClosable:!0,position:"bottom"})}}),x)}}}},[$,m,K,M]);const X=({isCopied:W,onClick:v})=>e.jsxs(S,{onClick:v,cursor:"pointer",alignItems:"center",children:[e.jsx(_,{mb:"0 !important",sx:{wordSpacing:"-4px"},children:W?"Copied":"Copy code"}),e.jsx(Ue,{as:W?bi:Jt,boxSize:20,ml:10})]}),H=async()=>{R(!0);const{data:W}=await Re.post(Ie.API_GET_BUG_AI_REMEDIATION,{scan_id:p,bug_hash:s.bug_hash});W&&W.remediation?(V(u.render(W.remediation)),setTimeout(()=>{N(!0)},100),l===J&&i(!1)):(V(""),l===J&&i(!0)),R(!1),P(!1)},q=()=>{P(!0),f(!0),b({type:"ai_remediation_initiate",body:{scan_id:p,scan_type:c,bug_hash:s.bug_hash,contract_address:t}})};return e.jsx(S,{w:"100%",minH:r?"100%":"inherit",h:"fit-content",borderRadius:15,bg:"#FAFAFA",flexDir:"column",alignItems:$?"flex-start":"center",justifyContent:"center",p:$?6:8,children:L?e.jsxs(S,{w:"100%",h:"100%",flexDir:"column",children:[e.jsxs(S,{alignItems:"center",children:[e.jsx(he,{src:`${d}icons/ai_generate.svg`}),e.jsx(_,{ml:4,fontSize:"lg",children:"Generating..."})]}),e.jsx(ue,{mt:10,w:"100%",h:"100%",spacing:5,children:Array.from({length:6},(W,v)=>v+1).map((W,v)=>e.jsx(nr,{value:20,w:"100%",h:"6px",borderRadius:48,variant:"ai",isIndeterminate:y.includes(v),size:"xs"},v))})]}):D?e.jsx(Ne,{width:"100%",height:"100%"}):$?e.jsxs(sl,{children:[e.jsx(z,{dangerouslySetInnerHTML:{__html:$||""},fontSize:"xs",fontWeight:400,color:"detail",w:"100%",h:"100%",ref:m}),e.jsxs(z,{w:"100%",color:"subtle",fontSize:"xs",mt:10,px:2,children:[e.jsx(_,{fontWeight:600,children:"*Important disclaimer"}),e.jsx(_,{fontWeight:400,children:"AI remediation suggestions from SolidityScan are meant to assist and should be reviewed by developers for accuracy and completeness."})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(S,{fontSize:"2xl",fontWeight:700,children:[e.jsx(he,{src:`${d}icons/ai_generate.svg`}),e.jsx(_,{ml:4,children:"SolidityScan"}),e.jsx(_,{bg:"linear-gradient(129.18deg, #52FF00 8.52%, #00EEFD 93.94%)",backgroundClip:"text",ml:2,children:"AI"})]}),e.jsx(_,{w:"85%",color:"detail",fontWeight:400,fontSize:"sm",textAlign:"center",mt:10,children:"Our AI-powered platform identifies vulnerabilities and suggests fixes, write secure code with confidence keeping your code protected."}),e.jsx(je,{id:"ss-generate",variant:"solid",leftIcon:e.jsx(he,{src:`${d}icons/ai_generate_dark.svg`}),mt:10,w:175,bg:"#52FF00",borderRadius:8,fontSize:"sm",fontWeight:600,_hover:{bg:"#52FF00",boxShadow:"0px 4px 24px 0px #29F67E69"},_focus:{bg:"#52FF00",boxShadow:"0px 4px 24px 0px #29F67E69"},onClick:q,children:"Generate"})]})})},sl=rr.div` 11 width: 100%; 12 height: 100%; 13 display: flex; 14 flex-direction: column; 15 justify-content: space-between code { 16 padding: 2px 4px; 17 font-size: 90%; 18 color: black; 19 background-color: #cbd5e0; 20 border-radius: 4px; 21 } 22 pre { 23 background: white; 24 border-radius: 8px; 25 font-size: 12px; 26 color: black; 27 padding: 1rem; 28 margin-top: 0.6rem; 29 position: relative; 30 } 31 pre code { 32 color: black; 33 padding: 0; 34 background-color: transparent; 35 border-radius: 0; 36 white-space: pre-wrap; 37 } 38 p { 39 margin-bottom: 1rem; 40 } 41 h2 { 42 color: black; 43 font-size: 14px; 44 font-weight: 500; 45 line-height: 30px; 46 } 47 & > * { 48 opacity: 0; 49 transform: translateY(20px); 50 animation: fadeIn 0.5s ease forwards; 51 } 52`,nl=t=>
52{if(!t)return"";const s={ALLOWED_TAGS:["p","br","strong","b","em","i","u","code","pre","h1","h2","h3","h4","h5","h6","ul","ol","li","a","blockquote","div","span"],ALLOWED_ATTR:["href","title","alt","class","id"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i,FORBID_TAGS:["script","iframe","object","embed","form","input","textarea","select","button"],FORBID_ATTR:["onerror","onload","onclick","onmouseover","onfocus","onblur","onchange","onsubmit"],SANITIZE_DOM:!0,SANITIZE_NAMED_PROPS:!0,KEEP_CONTENT:!0,FORCE_BODY:!0};try{return _o.sanitize(t,s)}catch(n){return console.error("HTML sanitization failed:",n),t.replace(/<[^>]*>/g,"")}},Is=t=>{if(!t)return"";const s=document.createElement("textarea");s.innerHTML=t;const n=s.value;return nl(n)},rl=({type:t,contract_address:s,issue_id:n,context:r,description_details:i,files:l,current_file_name:u,setFiles:d,fullScreen:h,setFullScreen:p,handleTabsChange:c,tabIndex:b})=>{let j=i;const E=[{label:"Vulnerability Description",content:null},{label:"Remediation",content:null},{label:"Comments",content:null}],{scanId:f,projectId:o}=Ve(),[m,y]=a.useState(h?["430px","430px","430px","calc(100vh - 340px)"]:["270px","270px","300px","calc(100vh - 550px)"]),[w]=$e("(min-width: 1024px)"),[D,R]=ve.useState(!1),[L,P]=a.useState(!1),[$,V]=a.useState(E),[M,N]=a.useState(""),[K,Q]=a.use
52State(""),[J,ee]=a.useState(!1),[X,H]=a.useState(""),[q,W]=a.useState(!1),[v,k]=a.useState(null),C=a.useRef([]),F=Ee(),x=tt(),{hasCopied:T,onCopy:B}=Ds(M),{hasCopied:g,onCopy:U}=Ds(K);a.useEffect(()=>{(async()=>{if(l.is_manual)k({...l.template_details});else if(l.audit_type&&l.audit_type==="ai_llm"||l.template_details?.issue_name&&l.template_details?.scwe_id&&l.template_details?.link)k({...l.template_details});else{W(!0);try{const Y=await vr(n,r,t==="block"?"contract":"project");Y?.issue_details&&(k({issue_name:Y.issue_details.issue_name,issue_description:Y.issue_details.issue_description,issue_remediation:Y.issue_details.issue_remediation,issue_gas_count:Y.issue_details.issue_gas_count,scwe_id:Y.issue_details.scwe_id,link:Y.issue_details.link}),W(!1))}catch(Y){W(!1),console.error("Error fetching issue details:",Y)}}})()},[l.template_details,n,r,t,l.is_manual]),a.useEffect(()=>{if(v){N(`${v.issue_name} 53 54${ie().replace(/<[^>]*>/g,"")}`),Q(_e().replace(/<[^>]*>/g,""));let le=[{label:"AI Detection Check",content:e.jsxs(Es,{children:[e.jsx(S,{w:"100%",alignItems:"center",bg:"white",borderRadius:10,px:2,py:1,children:e.jsxs(S,{alignItems:"center",color:"detail",fontSize:"xs",children:[l?.findings[0]?.ai_tagged_status===!1?e.jsx(he,{src:`${F}icons/ai_check_0.svg`,mr:2}):l?.findings[0]?.ai_tagged_status===!0?e.jsx(he,{src:`${F}icons/ai_check_1.svg`,mr:2}):null," ","This detection result appears potentially"," ",l?.findings[0]?.ai_tagged_status===!1?"incorrect":"correct"," ","based on our AI analysis."]})}),e.jsx(_,{color:"detail",fontSize:"sm",fontWeight:600,my:4,px:2,children:v?.issue_name}),e.jsx(z,{px:2,fontWeight:400,dangerouslySetInnerHTML:{__html:Is(l.findings[0].ai_tagged_reason||"")}})]})},{label:"Vulnerability Description",content:e.jsxs(Es,{children:[e.jsxs(S,{w:"100%",alignItems:"center",pb:2,children:[e.jsx(_,{fontWeight:600,fontSize:"md",py:1,children:v?.issue_name}),v?.issue_gas_count?e.jsxs(e.Fragment,{children:[e.jsx(S,{ml:4,borderLeft:"1px solid #B8B8B8",pl:4,pr:1,children:e.jsxs(S,{alignItems:"center",px:2,py:.5,bg:"white",borderRadius:7,fontSize:"sm",color:"#6E757C",fontWeight:600,children:[e.jsx(Ue,{as:mo,color:"#F795B4",mr:2,boxSize:4}),e.jsx(_,{children:" Gas:"}),e.jsx(_,{color:"black",ml:1,children:v?.issue_gas_count})]})}),e.jsx(Oe,{label:`Addressing this gas issue with the suggested fix can enhance efficiency, saving approximately ${v?.issue_gas_count} gas units.`,fontSize:"xs",p:3,children:e.jsx(tr,{color:"#E4E4E4",boxSize:3.5,cursor:"pointer",_hover:{color:"#AFA0ED"}})})]}):null,J&&e.jsxs(S,{align:"center",cursor:"pointer",color:"blue",ml:"auto",onClick:()=>te(),children:["Copy"," ",T?e.jsx(Bt,{ml:2}):e.jsx(Ue,{as:Jt,ml:2,fontSize:"2xl"})]})]}),v?.scwe_id&&v?.link&&e.jsxs(z,{display:"inline-flex",alignItems:"center",backgroundColor:"#FFFFFF",borderRadius:"7px",width:"fit-content",height:"26px",mb:3,p:1,px:4,onClick:()=>window.open(v?.link,"_blank"),style:{cursor:"pointer"},children:[e.jsx(he,{src:Ee()+"logo/owasp_logo.svg",height:"16px",width:"16px",mr:1}),e.jsx(_,{fontSize:"14px",fontWeight:"600",color:"#666666",mr:1,children:"OWASP:"}),e.jsx(_,{fontSize:"14px",fontWeight:"600",color:"#0000FF",children:v?.scwe_id})]}),e.jsx(z,{dangerouslySetInnerHTML:{__html:ie()}})]})},{label:"Remediation",content:e.jsxs(Es,{children:[e.jsxs(S,{children:[e.jsx(_,{fontWeight:600,fontSize:"md",py:1,children:"REMEDIATION"}),e.jsxs(S,{align:"center",cursor:"pointer",color:"blue",justifyContent:"flex-end",w:"100%",mt:-2,visibility:J?"visible":"hidden",onClick:()=>ce(),children:["Copy"," ",g?e.jsx(Bt,{ml:2}):e.jsx(Ue,{as:Jt,ml:2,fontSize:"2xl"})]})]}),e.jsx(z,{dangerouslySetInnerHTML:{__html:_e()},mt:2})]})},...l.audit_type!=="ai_llm"?[{label:"AI Remediation",content:e.jsx(tl,{contract_address:s,files:l,onGenerate:O,fullScreen:h,setFullScreen:p,tabIndex:b}),badge:"New"}]:[],{label:"Comments",content:D?e.jsxs(ue,{w:"100%",bgColor:"#F6F6F6",borderRadius:"16px",height:"110px",alignItems:"flex-end",spacing:-4,mt:2,children:[e.jsx(ir,{placeholder:"Add Comment",fontSize:"12px",bgColor:"#F6F6F6",borderWidth:0,noOfLines:3,borderRadius:"16px",value:X,_selected:{borderWidth:"0px"},onKeyDown:Y=>{Y.keyCode===13&&!Y.shiftKey&&X!==""&&X&&oe()},onChange:Y=>{H(Y.target.value)},height:"60px",_hover:{borderColor:"gray.300"},_focus:{boxShadow:"0px 12px 23px rgba(107, 255, 55, 0.0)"}}),e.jsx(S,{px:1,children:e.jsx(He,{fontSize:"lg",p:0,borderRadius:"50%",onClick:()=>{X!==""&&X&&oe()},bgColor:X!==""&&X?"#3300FF":"#B8B8B8","aria-label":"Edit Comment",color:X!==""&&X?"#FFFFFF":"#000000",icon:e.jsx(ji,{})})})]}):e.jsxs(S,{w:"100%",mt:2,children:[e.jsx(_,{w:"90%",fontSize:"xs",children:l.comment}),e.jsx(Oe,{label:"Edit Comment",fontSize:"md",children:e.jsx(He,{fontSize:"lg",p:0,ml:"auto",onClick:()=>{R(!0),l.comment?H(l.comment):H("")},bgColor:"white","aria-label":"Edit Comment",icon:e.jsx(vi,{})})})]})}];l.findings&&l.findings.length&&l.findings[0].ai_tagged_status===void 0&&(le=le.filter(Y=>Y.label!=="AI Detection Check")),di().ai_remediation_enabled||(le=le.filter(Y=>Y.label!=="AI Remediation")),V(le)}},[l,D,X,J,T,j,u,b,m,v]),a.useEffect(()=>
54{y(h?["430px","430px","430px","calc(100vh - 340px)"]:["270px","270px","300px","calc(100vh - 550px)"])},[h]),a.useEffect(()=>{R(!1)},[l]),a.useEffect(()=>{b!==void 0&&!w&&C.current[b]?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[b]);const O=()=>{},oe=async()=>{if(X&&X.trim()!==""){const{data:le}=await Re.post(Ie.API_UPDATE_BUG_STATUS,{bug_ids:[l?.bug_hash],scan_id:f,project_id:o,bug_status:l?.bug_status,comment:X,scan_type:t});le.status==="success"&&d({...l,comment:X})}},te=()=>{B(),x({title:"Vulnerability Description copied",status:"success",duration:1500,isClosable:!0,position:"bottom"})},ce=()=>{U(),x({title:"Vulnerability Remediation copied",status:"success",duration:1500,isClosable:!0,position:"bottom"})},ie=()=>{const le=l.issue_description?it(l.issue_description,{...j,current_file_name:u}):v?.issue_description?it(v?.issue_description,{...j,current_file_name:u}):"";return Is(le)},_e=()=>{const le=l.issue_remediation?it(l.issue_remediation,{...j,current_file_name:u}):v?.issue_remediation?it(v?.issue_remediation,{...j,current_file_name:u}):"";return Is(le)};return e.jsxs(ps,{onChange:c,index:b,size:"sm",variant:"soft-rounded",colorScheme:"green",w:["100%","100%","100%","100%"],h:m,maxH:h?"600px":"325px",transition:"height 0.3s ease-in-out",isLazy:!0,children:[e.jsx(S,{w:["100%","100%","100%","100%"],overflowX:["scroll","scroll","scroll","scroll"],sx:{scrollbarWidth:["none","none","none","7px"],"::-webkit-scrollbar":{display:["none","none","none","block"]},"::-webkit-scrollbar-thumb":{background:"transparent"}},_hover:{"::-webkit-scrollbar-thumb":{background:"#88888880"},"::-webkit-scrollbar-thumb:hover":{background:"#888888"}},children:e.jsx(hs,{sx:{borderBottomWidth:"1px",borderBottomStyle:"solid",borderColor:"border",pb:[3,3,3,2],pt:2,w:"fit-content",alignItems:"center"},children:$&&$.map((le,Y)=>e.jsxs(ve.Fragment,{children:[e.jsx(lt,{ref:be=>C.current[Y]=be,bgColor:"#FFFFFF",_selected:{bgColor:"#E9E9E9",color:"#000000"},color:"subtle",whiteSpace:"nowrap",mr:[0,0,0,3],children:le.label},Y),le.badge&&e.jsx(z,{bg:"#52FF00",borderRadius:12,fontSize:"11px",fontWeight:550,px:2,ml:b===Y?-2:-5,mr:2,transition:"all 0.2s ease-in",children:le.badge})]},Y))})}),v&&e.jsx(fs,{w:"100%",h:"calc(100% - 50px)",children:$&&$.map((le,Y)=>e.jsx(ct,{sx:{w:"100%",h:"100%",overflowY:"scroll",scrollbarWidth:["none","none","none","7px"],"::-webkit-scrollbar":{display:["none","none","none","block"]},"::-webkit-scrollbar-thumb":{background:"transparent"},pt:[3,3,3,1],pb:3,px:2},onMouseEnter:()=>ee(!0),onMouseLeave:()=>ee(!1),_hover:{"::-webkit-scrollbar-thumb":{background:"#88888880"},"::-webkit-scrollbar-thumb:hover":{background:"#888888"}},children:q?e.jsx(Ne,{}):le.content},Y))})]})},Es=rr.div` 55 background: #FAFAFA; 56 border-radius: 15px; 57 padding: 1rem; 58 height: fit-content; 59 min-height: 100%; 60 color: #4E5D78; 61 p { 62 font-size: 12px; 63 } 64 65 code { 66 background: #cbd5e0; 67 padding: 2px 4px; 68 border-radius: 5px; 69 } 70 ul, ol { 71 margin-left: 20px 72 } 73 74 li { 75 font-weight: 300; 76 font-size: 12px 77 } 78 79
80 a { 81 color: #4299e1; 82 text-decoration: underline; 83 transition: 0.2s color; 84 &:hover { 85 color: #2b6cb0; 86 } 87 88 89 `,il=({handleTabsChange:t,tabIndex:s,openIssueBox:n,setOpenIssueBox:r,templateDetails:i,auditMode:l})=>{const u=Ee(),d=a.useContext(Ke),{type:h,files:p,restrictedBugIds:c=[],scanReport:b,setFiles:j=()=>{}}=d||{},{contract_address:E}=b||{},[f,o]=a.useState(p?.findings[0]);a.useEffect(()=>{o(p?.findings[0]),l||r(!0)},[p]);const[m,y]=a.useState(!1);if(!p)return null;const w=()=>(p?.findings.forEach((L,P)=>{if(L.file_path===f?.file_path)return P}),0),D=()=>{r(!0)},R=()=>{r(!1)};return e.jsx(z,{sx:{borderRadius:15,bg:"rgba(243, 243, 243, 0.75)",position:"relative",w:"100%",h:["650px","650px","650px","calc(100% + 20px)"],mb:[3,3,3,0]},children:p?.bug_status==="fixed"?e.jsx(S,{sx:{w:"100%",justifyContent:"center",alignItems:"center",h:"100%",flexDir:"column"},children:e.jsxs(ue,{mb:4,children:[e.jsx(he,{src:`${u}common/fixedIssueIcon.svg`}),e.jsx(_,{fontWeight:600,children:"This Issue has been fixed"})]})}):e.jsxs(e.Fragment,{children:[e.jsx(S,{width:"100%",overflowX:"hidden",mb:"7px",_hover:{overflowX:"scroll",mb:0},flexDir:"row",justifyContent:"flex-start",align:"center",background:"#FAFBFC",borderRadius:10,p:0,children:e.jsx(S,{px:0,my:0,w:"fit-content",h:"fit-content",borderColor:"#C4C4C4",borderBottomWidth:"1px",children:f&&p?.findings.map((L,P)=>e.jsx(Mr,{file:L,currentFile:f,setCurrentFile:o},P))})}),e.jsx(S,{width:"100%",height:"calc(100% - 50px)",px:2,pt:2,children:f?e.jsx(Gr,{type:h,file:f,wait_to_scroll:p?.wait_to_scroll||0,auditMode:l,issueSeverity:p.template_details.issue_severity,setOpenIssueBox:r}):null}),e.jsx(bn,{in:n,offsetY:"20px",children:e.jsxs(z,{sx:{borderRadius:15,bg:"white",px:3,w:"calc(100% - 20px)",position:"absolute",bottom:"10px",left:"10px",justifyContent:"flex-start",alignItems:"flex-start",flexDir:"column"},pointerEvents:n?"all":"none",children:[e.jsxs(re,{width:"100%",justifyContent:"space-between",alignItems:"center",p:1,children:[e.jsxs(S,{gridColumnGap:4,gridRowGap:0,flexWrap:["wrap","wrap","nowrap","nowrap"],width:"450px",children:[e.jsxs(re,{my:[2,2,2,0],width:["40%","40%","40%","23%"],children:[e.jsx(Us,{variant:p.template_details.issue_severity}),e.jsx(_,{fontSize:"sm",fontWeight:"bold",ml:2,width:"100%",children:is(p.template_details.issue_severity)})]}),e.jsx(S,{width:["40%","40%","40%","23%"],children:e.jsx(_,{width:"fit-content",px:3,py:1,my:[2,2,2,0],borderRadius:20,color:p.template_details.issue_confidence==="2"?"#289F4C":p.template_details.issue_confidence==="1"?"#ED9801":"#FF5630",backgroundColor:p.template_details.issue_confidence==="2"?"#CFFFB8":p.template_details.issue_confidence==="1"?"#FFF8EB":"#FFF5F3",fontSize:"xs",fontWeight:"bold",children:p.template_details.issue_confidence==="2"?"Certain":p.template_details.issue_confidence==="1"?"Firm":"Tentative"})}),e.jsxs(_,{width:["40%","40%","40%","23%"],my:[2,2,2,0],fontSize:"sm",fontWeight:"bold",children:[p.findings[w()].line_nos_start,"-",p.findings[w()].line_nos_end]}),e.jsxs(re,{width:["50%","50%","50%","31%"],my:[2,2,2,0],children:[e.jsx(he,{src:`${u}report/${p.bug_status}_color.svg`}),e.jsxs(_,{fontSize:"sm",fontWeight:"normal",color:"gray.600",fontStyle:"italic",children:[p.bug_status==="false_positive"&&"False Positive",p.bug_status==="wont_fix"&&"Won't Fix",p.bug_status==="pending_fix"&&"Pending Fix",p.bug_status==="fixed"&&"Fixed"]})]})]}),e.jsxs(re,{justifyContent:"flex-end",alignItems:"flex-start",position:["absolute","absolute","absolute","relative"],right:[2,2,2,0],top:[2,2,2,0],children:[e.jsx(Oe,{label:m?"Minimize":"Expand",fontSize:"md",children:e.jsx(He,{fontSize:"lg",p:0,onClick:()=>{y(!m)},bgColor:"white","aria-label":"Handle Size",icon:m?e.jsx(Ue,{as:pi,strokeWidth:.8,color:"#8A94A6",fontSize:"15px"}):e.jsx(Ue,{as:hi,strokeWidth:.8,color:"#8A94A6",fontSize:"15px"})})}),e.jsx(Oe,{label:"Close Box",fontSize:"md",children:e.jsx(He,{fontSize:"lg",p:0,onClick:R,bgColor:"white","aria-label":"Close Box",icon:e.jsx(Ue,{as:no,color:"#8A94A6",fontSize:"2xl"})})})]})]}),e.jsx(ut,{}),e.jsx(z,{fontSize:"sm",w:"100%",maxH:"600px",children:f&&e.jsx(rl,{type:h,contract_address:E,restrictedBugIds:c,handleTabsChange:t,tabIndex:s,fullScreen:m,setFullScreen:y,current_file_name:f.file_path,files:p,issue_id:p.issue_id,context:"multi_file",setFiles:j,description_details:p.description_details})})]})}),!n&&e.jsx(bn,{in:!n,offsetY:"50px",children:e.jsx(S,{w:"48px",h:"48px",minW:"48px",borderRadius:50,bg:"white",alignItems:"center",justifyContent:"center",position:"absolute",bottom:5,right:6,cursor:"pointer",onClick:D,children:e.jsx(he,{src:`${u}icons/lightbulb.svg`})})})]})})},ol=()=>{const{profileData:t}=qe(),{isOpen:s,onOpen:n,onClose:r}=Ye(),[i,l]=a.useState(!1),u=a.useContext(Ke);if(!u)return null;const{scanReport:d,scanSummary:h,type:p}=u,{project_name:c,project_url:b,contract_url:j,contract_address:E,contract_chain:f,contract_platform:o}=d,m=()=>{t&&h&&h.lines_analyzed_count>t?.loc_remaining?l(!0):n()};return e.jsxs(S,{w:"100%",sx:{flexDir:["column","column","column"]},position:"relative",h:"calc(100vh - 320px)",border:"1px solid #DADADA",borderRadius:20,overflow:"hidden",children:[e.jsx(ue,{borderRadius:20,w:"100%",alignItems:"flex-start",spacing:5,px:4,children:e.jsx(z,{sx:{w:"100%",position:"sticky",top:8},children:e.jsx($r,{})})}),e.jsx(S,{w:"100%",h:"100%",borderRadius:20,position:"absolute",sx:{backdropFilter:"blur(6px)"},p:8,bg:"rgba(255,255,255,0.3)",alignItems:"center",justifyContent:"center",flexDir:"column",children:e.jsxs(S,{w:"100%",h:"100%",alignItems:"center",justifyContent:"center",flexDir:"column",border:"1px solid #DADADA",borderRadius:20,children:[e.jsxs(S,{w:"100%",h:"65%",alignItems:"center",justifyContent:"center",flexDir:"column",children:[e.jsx(_,{textAlign:"center",fontWeight:700,fontSize:"lg",color:"black",children:"ReScan Project"}),e.jsx(_,{mt:3,textAlign:"center",w:["100%","100%","100%","80%"],fontWeight:300,fontSize:"sm",color:"detail",children:"This project was scanned during your trial period and only included gas optimization analysis. To unlock the details of these vulnerabilities, consider rescanning your project."}),e.jsx(je,{id:"ss-unlock",onClick:m,mt:10,variant:"brand",width:"250px",children:"Unlock Details"})]}),e.jsxs(S,{w:"100%",h:"35%",borderTop:"1px solid #DADADA",alignItems:"center",justifyContent:"center",flexDir:"row",children:[e.jsxs(ue,{cursor:"pointer",onClick:m,w:"25%",spacing:2,children:[e.jsx(Gs,{size:60}),e.jsx(_,{fontFamily:"monospace",textAlign:"center",fontWeight:700,fontSize:"md",color:"#323B4B",children:"RESCAN"})]}),e.jsx(ut,{orientation:"vertical",border:"1px solid #DADADA",height:"80%"}),e.jsxs(ue,{alignItems:"flex-start",textAlign:"left",w:"75%",px:10,spacing:2,children:[e.jsx(_,{w:"100%",fontWeight:700,fontSize:"lg",color:"black",children:"Rescan Project"}),e.jsx(_,{mt:3,w:"100%",fontWeight:300,fontSize:"sm",color:"detail",children:"Rescan your project to leverage the full power of SolidityScan, your new plan provides comprehensive security analysis."})]})]})]})}
89),e.jsx(en,{closeModal:r,open:s,scanDetails:p==="project"?{project_name:c,project_url:b,scan_type:p,loc:h?.lines_analyzed_count}:{contract_url:j,contract_address:E,contract_chain:f,contract_platform:o,scan_type:p,loc:h?.lines_analyzed_count}}),e.jsx(ms,{open:i,closeModal:()=>l(!1),scanDetails:p==="project"?{project_name:c,project_url:b,scan_type:p,loc:h?.lines_analyzed_count}:{contract_url:j,contract_address:E,contract_chain:f,contract_platform:o,scan_type:p,loc:h?.lines_analyzed_count}})]})},_s=({is_latest_scan:t,isAiBugSelected:s,scanning:n,auditMode:r})=>{const i=Ee(),l=tt(),{isOpen:u,onClose:d,onOpen:h}=Ye(),p=ht(),[c,b]=a.useState(null),[j,E]=a.useState("confirm"),[f,o]=a.useState(!0),{profileData:m}=qe(),[y,w]=a.useState(!r),[D,R]=a.useState(0),[L,P]=a.useState({placeholder:"Take Action",disabled:""}),$=a.useContext(Ke),{scanReport:V,isViewer:M=!1,files:N,selectedIssues:K=[],selectedBugs:Q=[],restrictedBugIds:J=[],updateBugStatus:ee}=$||{},{details_enabled:X,is_trial_scan:H,project_url:q}=V||{};a.useEffect(()=>{if(Q&&Q.length){if(K.length===1&&K[0].bugs){const x=K[0].bugs.map(B=>B.bug_status),T=Array.from(new Set(x));T.length===1&&T[0]!=="pending_fix"?P({placeholder:T[0],disabled:T[0]}):T.length>1?P({placeholder:"Take Action",disabled:""}):P({placeholder:"Take Action",disabled:"pending_fix"})}else P({placeholder:"Take Action",disabled:""});o(!1)}else P({placeholder:"Take Action",disabled:"pending_fix"}),o(!0)},[Q]);const W=x=>{r||w(!0),R(x)},v=x=>{c&&ee(c,x)},k=()=>{m?.current_package&&(m.current_package==="individual"||m.current_package==="custom"||m.current_package==="pro")?m?._integrations?.github?.status==="successful"?E("confirm"):E("connect"):E("upgrade"),h(),b("create_github_issue")},C=()=>M?!0:f||K&&K.length>1,F=x=>{Q.some(T=>J.includes(T))?l({description:"Bug Status update in progress for the selected bugs. Please try after some time.",status:"error",duration:3e3,isClosable:!0}):x.value!=="pending_fix"?(h(),b(x.value)):ee(x.value,"")};return e.jsxs(ue,{w:["100%","100%","100%","65%"],h:r?"100%":"calc(100% - 20px)",alignItems:"center",spacing:2,pl:[0,0,0,4],children:[N&&N.bug_status!=="fixed"&&t&&!r&&e.jsx(wi,{justify:"space-between",alignItems:"center",width:"100%",direction:["column","column","column","row"],mt:[4,4,4,1],mb:[0,0,0,1],children:e.jsxs(re,{display:["none","none","none","flex"],width:"100%",spacing:3,children:[e.jsx(xr,{markedAction:L,isDisabled:f||M,onBugSelect:F,isAiBugSelected:s}),q&&q!=="File Scan"&&e.jsx(Oe,{label:K.length>1?"Please select only one issue":"Please select an issue",shouldWrapChildren:!0,children:e.jsxs(je,{id:"ss-file-issue",background:C()?"#FAFBFC":"white",color:C()?"#8A94A6":"#806CCF",border:C()?"none":"1px solid #C1B1FF",isDisabled:C(),_hover:{background:"#f7f5ff"},onClick:k,children:[e.jsx(Xn,{active:!C()}),e.jsx(_,{fontSize:"sm",ml:2,children:"File Issue"})]})})]})}),N&&(N.bug_status!=="pending_fix"&&!t||N.bug_status==="fixed")&&e.jsx(re,{justify:"flex-end",width:"100%",mt:[4,4,4,0],children:e.jsxs(re,{bg:"gray.100",px:10,py:1,borderRadius:30,children:[e.jsx(_,{mr:2,color:"gray.600",fontWeight:500,children:"The issue has been marked as"}),e.jsx(he,{mr:3,src:`${i}icons/${N.bug_status}.svg`}),e.jsx(_,{fontWeight:700,children:is(N.bug_status.toLowerCase().replace("_"," "))})]})}),e.jsx(z,{sx:{w:"100%",h:r?"97%":"calc(100% - 55px)"},children:!X&&N?.template_details.issue_severity!=="gas"&&H?m?.current_package==="trial"?e.jsx(Ba,{}):e.jsx(ol,{}):N?e.jsx(il,{handleTabsChange:W,tabIndex:D,openIssueBox:y,setOpenIssueBox:w,templateDetails:N.template_details,auditMode:r}):e.jsxs(S,{sx:{w:"100%",bg:"bg.subtle",justifyContent:"center",flexDir:"column",alignItems:"center",h:"calc(100vh - 380px)",borderRadius:15},children:[e.jsx(Ue,{as:fi,fontSize:"40px",color:"subtle",mb:4}),e.jsx(_,{color:"subtle",children:n?"Scan in progress...":"Please select a file from an issue to see vulnerability details."})]})}),c==="create_github_issue"?j==="confirm"?e.jsx(It,{isOpen:u,onClose:d,onActionConfirm:v,addComment:!1,modalHeader:"Confirm Action",modelText:e.jsxs(ue,{children:[e.jsx(_,{my:4,w:["100%"],fontSize:"lg",fontWeight:600,children:`Are you sure you want to update the Issue to ${q?ze(q):"Github"}?`}),e.jsxs(_,{my:4,color:"detail",fontWeight:400,w:["100%"],children:["You are about to create a"," ",e.jsx(_,{as:"span",color:"black",fontWeight:"bold",children:`${q?ze(q):"Github"} Issue`})," ","for selected"," ",e.jsx(_,{as:"span",color:"black",fontWeight:"bold",children:Q.length})," ","bug(s). Please click on confirm to create an issue."]})]})}):j==="upgrade"?e.jsxs(wt,{isOpen:u,onClose:d,isCentered:!0,children:[e.jsx(Vt,{}
89),e.jsxs(St,{borderRadius:"15px",maxW:"736px",mx:"auto",children:[e.jsx(Nt,{textAlign:"center",fontSize:"20px",fontWeight:700,pt:6,children:"File Issue"}),e.jsx(Ct,{m:2}),e.jsx(kt,{p:8,pb:10,children:e.jsxs(z,{borderRadius:"15px",borderWidth:"1px",border:"1px solid #FFC661",bg:"#FFFBF1",p:8,pt:4,mb:2,children:[e.jsxs(S,{alignItems:"center",children:[e.jsx(he,{src:`${i}icons/upgrade_plan_icon.svg`,mr:2}),e.jsx(_,{color:"#FFA403",fontSize:"16px",fontWeight:700,children:"Upgrade to Use this feature"})]}),e.jsxs(_,{color:"gray.600",mb:6,ml:10,fontSize:"12px",fontWeight:400,children:["Upgrade and Integrate to ",q?ze(q):"Github"," to File Issue directly from SolidityScan"]}),e.jsx(Pt,{variant:"brand",width:"107px",py:0,borderRadius:"8px",mt:4,fontSize:"14px",fontWeight:600,onClick:()=>{d(),p.push("/billing")},children:"Upgrade"})]})})]})]}):e.jsxs(wt,{isOpen:u,onClose:d,isCentered:!0,children:[e.jsx(Vt,{}),e.jsxs(St,{borderRadius:"15px",maxW:"736px",mx:"auto",children:[e.jsx(Nt,{textAlign:"center",fontSize:"20px",fontWeight:700,pt:6,children:"File Issue"}),e.jsx(Ct,{m:2}),e.jsx(kt,{p:8,pb:10,children:e.jsxs(z,{borderRadius:"15px",bg:"linear-gradient(90deg, #EBFAFA 0%, #F2FBF8 50%, #FDFCF5 100%)",p:8,mb:2,children:[e.jsx(_,{fontSize:"14px",fontWeight:700,mb:2,children:"Connect to GitHub to File Issue"}),e.jsxs(_,{color:"#4E5D78",mb:8,fontSize:"12px",fontWeight:400,children:["In order to directly file issue from SolidityScan you need to connect to ",q?ze(q):"Github"," first"]}),e.jsxs(Pt,{variant:"brand",width:"175px",py:0,borderRadius:"8px",fontSize:"14px",fontWeight:600,onClick:()=>{d(),p.push("/integrations")},children:["Connect to ",q?ze(q):"Github"]})]})})]})]}):e.jsx(It,{isOpen:u,onClose:d,onActionConfirm:v,addComment:!0,modalHeader:"Confirm Action",modelText:e.jsxs(z,{my:4,w:"100%",children:[c&&c!=="comment"?e.jsxs(_,{color:"subtle",w:["100%"],children:["You are about to confirm the"," ",e.jsx(_,{as:"span",color:"black",fontWeight:"bold",children:qs[c]})," ","action on"," ",e.jsx(_,{as:"span",color:"black",fontWeight:"bold",children:Q.length})," ","bug(s)."]}):null,e.jsx(_,{color:"subtle",w:["100%"],children:"Please add your comment below and click on confirm to continue."})]})})]})};function Kt(t){return Kn({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M208,72V184a8,8,0,0,1-8,8H176V104L136,64H80V40a8,8,0,0,1,8-8h80Z",opacity:"0.2"}},{tag:"path",attr:{d:"M213.66,66.34l-40-40A8,8,0,0,0,168,24H88A16,16,0,0,0,72,40V56H56A16,16,0,0,0,40,72V216a16,16,0,0,0,16,16H168a16,16,0,0,0,16-16V200h16a16,16,0,0,0,16-16V72A8,8,0,0,0,213.66,66.34ZM168,216H56V72h76.69L168,107.31v84.53c0,.06,0,.11,0,.16s0,.1,0,.16V216Zm32-32H184V104a8,8,0,0,0-2.34-5.66l-40-40A8,8,0,0,0,136,56H88V40h76.69L200,75.31Zm-56-32a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h48A8,8,0,0,1,144,152Zm0,32a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h48A8,8,0,0,1,144,184Z"}}]})(t)}const al=({bug_id:t,issue_id:s,is_latest_scan:n,metric_wise_aggregated_finding:r,template_details:i,isSelected:l,updateBugHashList:u,auditMode:d,isManual:h,issueSeverity:p,setIssueSeverity:c,userUUID:b,isBugDeletionLoading:j,setIsBugDeletionLoading:E})=>{const f=Ee(),[o]=$e("(min-width: 1350px)"),[m,y]=a.useState(!1),[w,D]=a.useState(l),{projectType:R,projectId:L,scanId:P}=Ve(),{sendMessage:$,messageQueue:V,updateMessageQueue:M,setNeedAuthToken:N}=xt();tt();const{scanData:K,refetchScanDetails:Q}=a.useContext(et),J=a.useContext(Ke),[ee,X]=a.useState(null);if(a.useEffect(()=>{D(l)},[l]),a.useEffect(()=>{let k=V[V.length-1];k&&k.payload.scan_status==="scan_done"&&(M([]),Q(),E&&(E(!1),X(null)))},[V]),!J)return null;const{files:H,setFiles:q,isViewer:W}=J,v=async()=>{E&&(E(!0),X(t));try{const k={scan_id:P,project_id:L,scan_type:R==="projects"?"project":"block",bug_ids:[r.bug_hash],issue_id:s};let C={useruuid:b,message:k};N(!0),$({type:"enterprise_delete_bug",body:C})}catch(k){E&&E(!1),console.error("Error deleting bug:",k)}};return e.jsx(e.Fragment,{children:ee===t?e.jsx(Ne,{}):e.jsx(e.Fragment,{children:o?e.jsx(z,{id:t,p:[0,0,3],mb:.5,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),sx:{cursor:"pointer",bg:t===H?.bug_id?"#D7DDE4":l?"#E9EEF3":"#F8FAFC",color:"text",fontSize:"sm",_hover:{bg:"#D7DDE4"}},borderLeft:t===H?.bug_id?"3px solid black":"none",onClick:()=>{q({bug_id:t,issue_id:s,bug_hash:r.bug_hash,bug_status:r.bug_status,findings:r.findings,audit_type:r.audit_type,description_details:r.description_details,template_details:i,comment:r.comment,
89issue_description:r.issue_description,issue_remediation:r.issue_remediation,is_manual:h}),c&&c(i.issue_severity)},children:e.jsxs(re,{justify:"space-between",ml:2,children:[e.jsxs(re,{w:"fit-content",maxW:"50%",children:[(m||w)&&!d&&!W&&r.bug_status!=="fixed"&&!d&&e.jsx(Xs,{checked:w,checkedColor:"#8A94A6",onChange:()=>{u(r.bug_hash,!w),D(!w)}}),r?.findings[0]?.ai_tagged_status===!1?e.jsx(Oe,{label:"Potentially Incorrect",children:e.jsx(he,{w:"21px",src:`${f}icons/ai_check_0.svg`})}):r?.findings[0]?.ai_tagged_status===!0?e.jsx(Oe,{label:"Potentially Correct",children:e.jsx(he,{w:"21px",src:`${f}icons/ai_check_1.svg`})}):null,e.jsx(_,{isTruncated:!0,color:"gray.700",fontSize:"sm",children:t})]}),e.jsxs(re,{justifyContent:"space-between",position:"relative",children:[r.findings.length>1&&!d&&e.jsxs(re,{mr:r.bug_status==="pending_fix"?d?2:8:2,py:1,px:3,borderRadius:20,backgroundColor:d?"":"white",children:[e.jsx(Kt,{size:20}),e.jsx(_,{children:"MULTIFILE"})]}),r.audit_type&&r.audit_type==="manual"&&d&&e.jsx(re,{borderRadius:20,backgroundColor:"#F8F8F8",p:"2px 14px",position:"absolute",right:"25px",children:e.jsx(_,{color:"#A2ABBC",fontSize:"12px",fontWeight:500,children:"MANUAL"})}),r.bug_status!=="pending_fix"&&!d&&e.jsxs(re,{alignItems:["flex-start","flex-start","center"],spacing:2,children:[e.jsx(he,{src:`${f}report/${r.bug_status}_color.svg`}),r.findings.length===1&&e.jsxs(_,{fontSize:"xs",fontWeight:"400",color:"black",fontStyle:"italic",children:[r.bug_status==="false_positive"&&"False Positive",r.bug_status==="wont_fix"&&"Won't Fix",r.bug_status==="fixed"&&"Fixed"]})]}),r.findings.length>1&&d&&e.jsx(re,{position:"absolute",right:"25px",py:1,borderRadius:20,backgroundColor:d?"":"white",children:e.jsx(Oe,{label:"Multifile",placement:"top",color:"white",fontSize:"sm",borderRadius:"md",children:e.jsx(z,{cursor:"pointer",children:e.jsx(Kt,{size:20})})})}),d&&(m?e.jsxs(Lt,{children:[e.jsx(zt,{as:He,icon:e.jsx(_n,{}),variant:"ghost",size:"sm",cursor:"pointer",_hover:{bg:"unset"},_active:{bg:"unset"},h:"20px",position:"absolute",right:"-10px"}),e.jsx(Si,{children:e.jsx(Ot,{sx:{width:"fit-content",minWidth:"auto",whiteSpace:"nowrap"},children:e.jsx(Wt,{onClick:v,color:"#323B4B",fontSize:"14px",fontWeight:"500",children:"Delete Bug"})})})]}):e.jsx(z,{minW:"20px",minH:"20px"}))]})]})},t):e.jsx(mt,{children:({isExpanded:k})=>e.jsxs(e.Fragment,{children:[e.jsx(_t,{bg:"#F8FAFC",p:0,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),onClick:()=>{q({bug_id:t,issue_id:s,bug_hash:r.bug_hash,bug_status:r.bug_status,findings:r.findings,audit_type:r.audit_type,description_details:r.description_details,template_details:i,comment:r.comment,issue_description:r.issue_description,issue_remediation:r.issue_remediation,is_manual:h})},children:e.jsxs(re,{justify:"space-between",p:4,w:"100%",children:[e.jsxs(re,{w:"fit-content",maxW:r.findings.length>1?"50%":"80%",children:[(m||w||!o)&&r.bug_status!=="fixed"&&e.jsx(or,{name:t,colorScheme:"gray",borderColor:"gray.500",isChecked:w,onChange:()=>D(!w)}),r?.findings[0]?.ai_tagged_status===!1?e.jsx(Oe,{label:"Potentially Incorrect",children:e.jsx(he,{w:"21px",src:`${f}icons/ai_check_0.svg`})}):r?.findings[0]?.ai_tagged_status===!0?e.jsx(Oe,{label:"Potentially Correct",children:e.jsx(he,{w:"21px",src:`${f}icons/ai_check_1.svg`})}):null,e.jsx(_,{isTruncated:!0,color:"gray.700",fontSize:["sm","sm","md"],children:t})]}),e.jsxs(re,{children:[r.findings.length>1&&!d&&e.jsxs(re,{mr:r.bug_status==="pending_fix"?d?2:8:2,py:1,px:3,borderRadius:20,backgroundColor:d?"":"white",children:[e.jsx(Kt,{size:20}),e.jsx(_,{children:"MULTIFILE"})]}),r.audit_type&&r.audit_type==="manual"&&d&&e.jsx(re,{borderRadius:20,backgroundColor:"#F8F8F8",p:"2px 14px",position:"absolute",right:"45px",children:e.jsx(_,{color:"#A2ABBC",fontSize:"12px",fontWeight:500,children:"MANUAL"})}),r.bug_status!=="pending_fix"&&!d&&e.jsxs(re,{alignItems:["flex-start","flex-start","center"],spacing:2,children:[e.jsx(he,{src:`${f}report/${r.bug_status}_color.svg`}),r.findings.length===1&&e.jsxs(_,{fontSize:"xs",fontWeight:"200",fontStyle:"italic",children:[r.bug_status==="false_positive"&&"False Positive",r.bug_status==="wont_fix"&&"Won't Fix",r.bug_status==="fixed"&&"Fixed"]})]})]}),r.findings.length>1&&d&&e.jsx(re,{position:"absolute",right:"45px",py:1,borderRadius:20,backgroundColor:d?"":"white",children:e.jsx(Oe,{label:"Multifile",placement:"top",color:"white",fontSize:"sm",borderRadius:"md",children:e.jsx(z,{cursor:"pointer",children:e.jsx(Kt,{size:20})})})}),d&&e.jsxs(Lt,{children:[e.jsx(zt,{as:He,icon:e.jsx(_n,{}),variant:"ghost",size:"sm",cursor:"pointer",_hover:{bg:"unset"},_active:{bg:"unset"},h:"20px",position:"absolute",right:"10px"}),e.jsx(Ot,{children:e.jsx(Wt,{onClick:v,color:"#323B4B",fontSize:"14px",fontWeight:"500",zIndex:9999,children:"Delete Bug"})})]})]})}),e.jsx(gt,{p:0,children:k&&e.jsx(_s,{is_latest_scan:n})})]})})})})},As={critical:{main:"#960d00",light:"rgba(150, 13, 0, 0.15)",color:"#960d00"},high:{main:"#ff5c00",light:"rgba(255, 92, 0, 0.15)",color:"#ff5c00"},medium:{main:"#E0A921",light:"rgba(255, 230, 0, 0.15)",color:"#FFE500"},low:{main:"#38cb89",light:"rgba(56, 203, 137, 0.15)",color:"#38cb89"},gas:{main:"#f795b4",light:"rgba(247, 149, 180, 0.15)",color:"#f795b4"},informational:{main:"#a0aec0",light:"rgba(160, 174, 192, 0.15)",color:"#a0aec0"}},ll=({index:t,issue_id:s,metric_wise_aggregated_findings:n,template_details:r,no_of_findings:i,is_latest_scan:l,bugStatusFilter:u,scrollIntoView:d,auditMode:h,isManual:p=!1,issueSeverity:c,setIssueSeverity:b,isBugDeletionLoading:j,setIsBugDeletionLoading:E,issueAuditType:f})=>{const o=a.useContext(Ke),{scanReport:m,isViewer:y,files:w,setFiles:D=()=>{},setSelectedIssues:R=()=>{},selectedBugs:L=[]}=o||{},{details_enabled:P,is_trial_scan:$}=m||{},V=n?.sort((g,U)=>{const O=g.findings[0]?.ai_tagged_status||!1,oe=U.findings[0]?.ai_tagged_status||!1;return Number(oe)-Number(O)});let M,N=[];(P||r.issue_severity==="gas")&&(M=n.filter(g=>g.bug_status!=="fixed"),N=M&&M.map(g=>g.bug_hash));const K=a.useRef(null),[Q,J]=a.useState(!1),[ee,X]=a.useState(!1),[H,q]=a.useState(!1),[W,v]=a.useState([]),{profileData:k}=qe();a.useEffect(()=>{const g=n?.some(U=>U.audit_type==="ai_llm");q(!!g)},[n]),a.useEffect(()=>{w&&d&&K&&K.current&&K.current.scrollIntoView({behavior:"smooth",block:"center",inline:"start"})},[w]),a.useEffect(()=>{if(ee){const g=new Set([...L,...N]);v([...N]),x(Array.from(g))}else if(W.length===0){const g=L.filter(U=>!N.includes(U));x(g)}},[ee]),a.useEffect(()=>{L&&L.length===0?(v([]),X(!1)):L.forEach((g,U)=>{N.includes(g)&&!W.includes(g)&&v([...W,g])})},[L]),a.useEffect(()=>{W?.length===n?.length&&X(!0)},[W]);const C=()=>{v([]),X(!ee)},F=(g,U)=>{U?(W.includes(g)||v([...W,g]),L.includes(g)||x([...L,g])):(v(W.filter(O=>O!==g)),x(L.filter(O=>O!==g)),X(!1))},x=g=>{R(U=>{let O=U.filter(te=>te.issue_id!==s);const oe=n&&n.filter(te=>g.includes(te.bug_hash));if(g.length&&oe.length){const te={issue_id:s,template_details:r,bugs:oe};O.push(te)}return O})},T=()=>{!P&&r.issue_severity!=="gas"&&D(null)},B=()=>f==="manual"?"MANUAL":f==="auto"?"AUTOMATION":"MANUAL + AUTO.";return e.jsx(mt,{id:s,w:"100%",ref:K,children:({isExpanded:g})=>e.jsxs(e.Fragment,{children:[e.jsxs(_t,{pl:2,_hover:{bg:"rgba(47, 248, 107, 0.07)"},_expanded:{bg:"rgba(47, 248, 107, 0.1)"},onMouseEnter:()=>J(!0),onMouseLeave:()=>J(!1),onClick:T,alignItems:h?"flex-start":"center",children:[e.jsxs(re,{sx:{w:"100%",my:2,alignItems:h?"flex-start":"center"},children:[e.jsxs(re,{w:"90%",alignItems:h?"flex-start":"center",gap:h?2:"7px",children:[(P||r.issue_severity==="gas")&&M.length>0&&(Q||ee||g||W.length>0)&&!y&&!h?e.jsx(Xs,{name:s,checked:W.length>0?!0:ee,checkedColor:"#8A94A6",checkedIcon:ee?Bt:W.length>0?Ci:void 0,onChange:()=>C(),styleProps:{marginTop:"2px"}}):null,H&&e.jsx(Oe,{label:"Detected by SolidityScan AI",children:e.jsx(he,{w:"18px",h:"16px",src:`${Ee()}icons/ai_generate.svg`})}),!h&&e.jsx(z,{marginInlineStart:"0px !important",children:e.jsx(Us,{size:8,variant:r.issue_severity})}),e.jsxs(S,{w:"85%",flexDirection:"column",gap:"16px",children:[e.jsxs(S,{alignItems:"center",position:"relative",children:[h&&e.jsx(z,{h:"20px",w:"4px",bg:As[r.issue_severity].color,mr:"4px",flexShrink:0}),e.jsx(_,{sx:{ml:h?0:3,marginInlineStart:h?"0 !important":void 0,maxW:[230,230,400,225],fontWeight:600,color:"#4E5D78",fontSize:"sm",textAlign:"left"},isTruncated:!0,children:r.issue_name})]}),h?e.jsxs(S,{gap:2,children:[e.jsxs(z,{maxW:"fit-content",borderRadius:"21px",bg:As[r.issue_severity].light,color:As[r.issue_severity].main,fontSize:"12px",fontWeight:500,p:"2px 14px",textTransform:"uppercase",children:[i," BUGS"]}),e.jsx(z,{maxW:"fit-content",borderRadius:"21px",bg:"#F2F2F2",color:"#4E5D78",fontSize:"12px",fontWeight:500,p:"2px 14px",textTransform:"uppercase",children:B()})]}):null]})]}),!h&&e.jsx(_,{sx:{ml:"auto",fontSize:"sm",fontWeight:600,color:"subtle"},children:i})]}),e.jsx(z,{pt:2,children:e.jsx(Ue,{as:Ks,mr:[0,0,2],color:"subtle",fontSize:"14px",transition:"transform 0.2s",transform:g?"rotate(90deg)":"rotate(0deg)"})})]}),e.jsx(gt,{p:0,pb:4,children:!P&&r.issue_severity!=="gas"&&$?k?.current_package==="trial"?e.jsx(Na,{severity:r.issue_severity,no_of_issue:i}):e.jsx($a,{severity:r.issue_severity,no_of_issue:i}):e.jsx(e.Fragment,{children:g?e.jsx(Gt,{allowMultiple:!1,allowToggle:!0,children:V.map((U,O)=>u[Zn(U.bug_status)]?e.jsx(al,{bug_id:U.bug_id,issue_id:s,metric_wise_aggregated_finding:U,template_details:r,is_latest_scan:l,isSelected:ee||W.includes(U.bug_hash),updateBugHashList:F,auditMode:h,issueSeverity:c,setIssueSeverity:b,userUUID:k?.user_uuid,isBugDeletionLoading:j,setIsBugDeletionLoading:E,isManual:p},U.bug_id+O):null)}):null})})]})},s)},cl=t=>({critical:0,high:1,medium:2,low:3,informational:4,gas:5})[t]??0,ul=(t,s,n)=>n?t.filter(i=>s[Zn(i.bug_status)]).length:0,Hr=({is_latest_scan:t,confidence:s,vulnerability:n,bugStatusFilter:r,auditMode:i,issueSeverity:l,setIssueSeverity:u})=>{const[d]=$e("(min-width: 1350px)"),h=a.useContext(Ke),[p,c]=a.useState(!1),{scanReport:b,files:j,issues:E=[],openIssueIndex:f,setOpenIssueIndex:o=()=>{}}=h||{},{details_enabled:m=!0}=b||{},y=a.useMemo(()=>E.findIndex(w=>w.template_details.issue_severity==="gas"),[E]);return e.jsx(Gt,{allowMultiple:d,allowToggle:!0,defaultIndex:!m&&y!==-1?y:[0],index:f,onChange:p?void 0:w=>{o(typeof w=="number"?[w]:w)},opacity:p?.6:1,pointerEvents:p?"none":"auto",cursor:p?"not-allowed":"default",children:E.map((w,D)=>{const{issue_id:R,metric_wise_aggregated_findings:L,template_details:P,no_of_findings:$,is_manual:V,issue_audit_type:M}=w,N=s[parseInt(P.issue_confidence)],K=n[cl(P.issue_severity)],Q=ul(L,r,m)||$;if(!N||!K||Q===0)return null;const J=y!==-1&&R===E[y].issue_id&&j?.issue_id===E[y].issue_id;return e.jsx(ll,{index:D,issue_id:R,metric_wise_aggregated_findings:L,template_details:P,no_of_findings:Q,is_latest_scan:t,bugStatusFilter:r,scrollIntoView:J,auditMode:i,issueSeverity:l,setIssueSeverity:u,isBugDeletionLoading:p,setIsBugDeletionLoading:c,isManual:V,issueAuditType:M},R)})})},dl=({auditMode:t})=>{const[s,n]=a.useState(null),[r,i]=a.useState(!1),l=ht(),{profileData:u,role:d}
89=qe(),{scanData:h,refetchScanDetails:p}=a.useContext(et),{projectType:c="",projectId:b="",scanId:j=""}=Ve(),E=c.replace(/s$/,""),{multi_file_scan_summary:f,multi_file_scan_details:o,details_enabled:m,project_url:y,project_branch:w}=h?.scan_report||{},D=h?.is_latest_scan||!0,{issue_severity_distribution:{critical:R=0,high:L=0,medium:P=0,low:$=0,informational:V=0,gas:M=0}={}}=f||{},N=ae=>{const Ae={critical:6,high:5,medium:4,low:3,informational:2,gas:1};return ae.sort((we,Pe)=>Ae[we.template_details.issue_severity]>Ae[Pe.template_details.issue_severity]?-1:Ae[we.template_details.issue_severity]<Ae[Pe.template_details.issue_severity]?1:0),ae},[K,Q]=a.useState(N(o||[])),[J,ee]=a.useState([!0,!0,!0,!0]),[X,H]=a.useState([!0,!0,!0]),[q,W]=a.useState([!0,!0,!0,!0,!0,!0]),[v,k]=a.useState([]),[C,F]=a.useState([]),[x,T]=a.useState([]),{isOpen:B,onClose:g,onOpen:U}=Ye(),[O,oe]=a.useState(null),[te,ce]=a.useState("confirm"),[ie,_e]=a.useState(!0),[le,Y]=a.useState(!1),[be,de]=a.useState(),ye=d==="viewer",De=tt(),[ge]=$e("(min-width: 1350px)"),[Me,Ge]=a.useState([]),[Fe,se]=a.useState({placeholder:"Take Action",disabled:""});if(a.useEffect(()=>{if(o&&u&&u.current_package==="trial"){const ae=o.findIndex(Ae=>Ae.template_details.issue_severity==="gas");o&&o.length&&ae!==-1&&(k([ae]),n({bug_id:o[ae].metric_wise_aggregated_findings[0].bug_id,issue_id:o[ae].issue_id,bug_hash:o[ae].metric_wise_aggregated_findings[0].bug_hash,audit_type:o[ae].metric_wise_aggregated_findings[0].audit_type,bug_status:o[ae].metric_wise_aggregated_findings[0].bug_status,findings:o[ae].metric_wise_aggregated_findings[0].findings,description_details:o[ae].metric_wise_aggregated_findings[0].description_details,template_details:o[ae].template_details,comment:o[ae].metric_wise_aggregated_findings[0].comment,issue_description:o[ae].metric_wise_aggregated_findings[0].issue_description,issue_remediation:o[ae].metric_wise_aggregated_findings[0].issue_remediation,wait_to_scroll:1e3,is_manual:o[ae].is_manual}))}else o&&o.length&&o[0].metric_wise_aggregated_findings&&(k([0]),n({bug_id:o[0].metric_wise_aggregated_findings[0].bug_id,issue_id:o[0].issue_id,audit_type:o[0].metric_wise_aggregated_findings[0].audit_type,bug_hash:o[0].metric_wise_aggregated_findings[0].bug_hash,bug_status:o[0].metric_wise_aggregated_findings[0].bug_status,findings:o[0].metric_wise_aggregated_findings[0].findings,description_details:o[0].metric_wise_aggregated_findings[0].description_details,template_details:o[0].template_details,comment:o[0].metric_wise_aggregated_findings[0].comment,issue_description:o[0].metric_wise_aggregated_findings[0].issue_description,issue_remediation:o[0].metric_wise_aggregated_findings[0].issue_remediation,is_manual:o[0].is_manual}))},[]),a.useEffect(()=>{o&&Q(o)},[o]),a.useEffect(()=>{let ae=!1,Ae=[];const we=C.flatMap(Pe=>Pe.bugs||[]).map(Pe=>(Pe.hasOwnProperty("findings")&&Ae.push(...Pe.findings),Pe.bug_hash));if(Ae.forEach(Pe=>{Pe.hasOwnProperty("ai_tagged_status")&&(ae=!0)}),i(ae),T(we),C.length===1&&C[0].bugs){const Pe=C[0].bugs.map(G=>G.bug_status),Qe=Array.from(new Set(Pe));Qe.length===1&&Qe[0]!=="pending_fix"?se({placeholder:Qe[0],disabled:Qe[0]}):Qe.length>1?se({placeholder:"Take Action",disabled:""}):se({placeholder:"Take Action",disabled:"pending_fix"})}else se({placeholder:"Take Action",disabled:""})},[C]),a.useEffect(()=>{s&&Q(ae=>ae.map(we=>{if(we.issue_id===s.issue_id){const Pe=we.metric_wise_aggregated_findings.map(Qe=>s.bug_id===Qe.bug_id&&s.bug_status==="wont_fix"?{...Qe,comment:s.comment}:Qe);return{...we,metric_wise_aggregated_findings:Pe}}return we}))},[s]),a.useEffect(()=>{const ae=d==="viewer";x&&x.length&&!ae?_e(!1):_e(!0)},[x]),a.useEffect(()=>{le&&setTimeout(()=>{const ae=document.getElementById("detailed_filter")?.getBoundingClientRect().height;de(ae)},300)},[le]),!h||!u||!f)return null;const Z=async(ae,Ae)=>{if(s){if(ae==="create_github_issue")xe();else{const{data:we}=await Re.post(Ie.API_UPDATE_BUG_STATUS,{bug_ids:x,scan_id:j,project_id:b,bug_status:ae,comment:Ae,scan_type:E});we.status==="success"&&(De({title:ae==="comment"?"Your comment has been successfully added to the bug.":"Bug Status Upd
89ated",description:we.message,status:"success",duration:3e3,isClosable:!0}),Ae&&n({...s,comment:Ae}),p())}T([])}},xe=async()=>{if(C&&C.length===1){const ae={issue_id:C[0].issue_id,issue_title:C[0].template_details.issue_name,repo_url:y,bugs:C[0].bugs?.map(we=>({id:we.bug_id,description:C[0].template_details.issue_description?it(C[0].template_details.issue_description,{...we.description_details}):"",remediation:C[0].template_details.issue_remediation?it(C[0].template_details.issue_remediation,{...we.description_details}):"",code_snapshot:y&&w?we.findings.map(Pe=>os(y,w,Pe)).join(", "):""}))},{data:Ae}=await Re.post(Ie.API_CREATE_BUGS_ISSUE,ae);Ae&&Ae.issue_id&&y&&De({title:`Issue created successfully on ${ze(y)}`,status:"success",duration:5e3,isClosable:!0,position:"bottom"})}},fe=ae=>{O&&Z(O,ae)},pe=()=>ye?!0:ie||C&&C.length>1,We=ae=>{x.some(Ae=>Me.includes(Ae))?De({description:"Bug Status update in progress for the selected bugs. Please try after some time.",status:"error",duration:3e3,isClosable:!0}):ae.value!=="pending_fix"?(U(),oe(ae.value)):Z(ae.value)};return e.jsxs(Ke.Provider,{value:{type:E,selectedIssues:C,setSelectedIssues:F,selectedBugs:x,issues:K,scanSummary:f,files:s,setFiles:n,restrictedBugIds:Me,setRestrictedBugIds:Ge,openIssueIndex:v,setOpenIssueIndex:k,isViewer:ye,updateBugStatus:Z,scanReport:h.scan_report},children:[e.jsxs(S,{w:"100%",h:["100%","100%","100%","calc(100vh - 195px)"],maxH:["100%","100%","100%","1000px"],sx:{flexDir:["column","column","column","row"]},bg:"white",borderRadius:15,p:2,overflow:"hidden",children:[e.jsxs(ue,{w:["100%","100%","100%","35%"],h:["fit-content","fit-content","fit-content","100%"],spacing:4,mb:[8,8,8,0],pr:[0,0,0,1],alignItems:"flex-start",borderRight:"1px solid #E2E8F0",children:[e.jsx(wr,{critical:R,high:L,medium:P,low:$,informational:V,gas:M,setFilterExpanded:Y,setVulnerability:W,setConfidence:H,setBugStatusFilter:ee}),m&&e.jsxs(re,{display:["flex","flex","flex","none"],position:"sticky",top:le?be:"50px",background:"white",zIndex:1,w:"100%",py:2,p:2,children:[e.jsx(xr,{markedAction:Fe,isDisabled:ie||ye,onBugSelect:We,isAiBugSelected:r}),y&&y!=="File Scan"&&e.jsxs(je,{id:"ss-create-issue",background:pe()?"#FAFBFC":"white",color:pe()?"#8A94A6":"#806CCF",border:pe()?"none":"1px solid #C1B1FF",isDisabled:pe(),p:2,_hover:{background:"#f7f5ff"},onClick:()=>{u?.current_package&&(u.current_package==="individual"||u.current_package==="custom"||u.current_package==="pro")?u?._integrations?.github?.status==="successful"?ce("confirm"):ce("connect"):ce("upgrade"),U(),oe("create_github_issue")},children:[e.jsx(Xn,{active:!pe()}),e.jsx(_,{fontSize:"sm",ml:2,children:"File Issue"})]})]}),e.jsx(z,{w:"100%",h:["fit-content","fit-content","fit-content","auto"],p:0,px:1,sx:{overflow:"scroll","::-webkit-scrollbar-thumb":{background:"transparent"}},_hover:{"::-webkit-scrollbar-thumb":{background:"#88888880"},"::-webkit-scrollbar-thumb:hover":{background:"#888888"}},children:e.jsx(Hr,{is_latest_scan:D,confidence:X,vulnerability:q,bugStatusFilter:J,auditMode:t})})]}),ge&&e.jsx(_s,{is_latest_scan:D,isAiBugSelected:r})]}),O==="create_github_issue"?te==="confirm"?e.jsx(It,{isOpen:B,onClose:g,onActionConfirm:fe,addComment:!1,modalHeader:"Confirm Action",modelText:e.jsxs(ue,{children:[e.jsx(_,{my:4,w:["100%"],fontSize:"lg",fontWeight:600,children:`Are you sure you want to update the Issue to ${y?ze(y):"Github"}?`}),e.jsxs(_,{my:4,color:"detail",fontWeight:400,w:["100%"],children:["You are about to create a"," ",e.jsx(_,{as:"span",color:"black",fontWeight:"bold",children:`${y?ze(y):"Github"} Issue`})," ","for selected"," ",e.jsx(_,{as:"span",color:"black",fontWeight:"bold",children:x.length})," ","bug(s). Please click on confirm to create an issue."]})]})}):te==="upgrade"?e.jsxs(wt,{isOpen:B,onClose:g,isCentered:!0,children:[e.jsx(Vt,{}),e.jsxs(St,{borderRadius:"15px",maxW:"500px",mx:"auto",children:[e.jsx(Nt,{textAlign:"center",fontSize:"24px",pt:6,fontWeight:"600",children:"File Issue"}),e.jsx(Ct,{m:2}),e.jsx(kt,{p:4,pb:10,children:e.jsxs(z,{borderRadius:"8px",borderWidth:"1px",border:"1px solid #FEF3C7",bg:"#FFFBF1",p:8,mb:4,children:[e.jsxs(S,{alignItems:"center",children:[e.jsx(he,{src:`${Ee()}icons/upgrade_plan_icon.svg`,mr:2}),e.jsx(_,{color:"#FFA403",fontSize:"16px",fontWeight:700,children:"Upgrade to Use this feature"})]}),e.jsxs(_,{color:"gray.600",mb:6,ml:10,fontSize:"12px",fontWeight:400,children:["Upgrade and Integrate to"," ",y?ze(y):"Github"," to File Issue directly from SolidityScan"]}),e.jsx(Pt,{variant:"brand",width:"107px",py:0,borderRadius:"8px",mt:4,fontSize:"14px",fontWeight:600,onClick:()=>{g(),l.push("/billing")},children:"Upgrade"})]})})]})]}):e.jsxs(wt,{isOpen:B,onClose:g,isCentered:!0,children:[e.jsx(Vt,{}
89),e.jsxs(St,{borderRadius:"15px",maxW:"500px",mx:"auto",children:[e.jsx(Nt,{textAlign:"center",fontSize:"24px",pt:6,fontWeight:"600",children:"File Issue"}),e.jsx(Ct,{m:2}),e.jsx(kt,{p:4,pb:10,children:e.jsxs(z,{borderRadius:"8px",borderWidth:"1px",border:"1px solid #D1FAE5",bg:"#F0FFFA",p:8,mb:4,children:[e.jsx(_,{fontSize:"14px",fontWeight:700,mb:2,children:"Connect to GitHub to File Issue"}),e.jsxs(_,{color:"#4E5D78",mb:8,fontSize:"12px",fontWeight:400,children:["In order to directly file issue from SolidityScan you need to connect to"," ",y?ze(y):"Github"," first"]}),e.jsxs(Pt,{variant:"brand",width:"175px",py:0,borderRadius:"8px",fontSize:"14px",fontWeight:600,onClick:()=>{g(),l.push("/integrations")},children:["Connect to"," ",y?ze(y):"Github"]})]})})]})]}):e.jsx(It,{isOpen:B,onClose:g,onActionConfirm:fe,addComment:!0,modalHeader:"Confirm Action",modelText:e.jsxs(z,{my:4,w:"100%",children:[O&&O!=="comment"?e.jsxs(_,{color:"subtle",w:["100%"],children:["You are about to confirm the"," ",e.jsx(_,{as:"span",color:"black",fontWeight:"bold",children:qs[O]})," ","action on"," ",e.jsx(_,{as:"span",color:"black",fontWeight:"bold",children:x.length})," ","bug(s)."]}):null,e.jsx(_,{color:"subtle",w:["100%"],children:"Please add your comment below and click on confirm to continue."})]})})]})},pl=async t=>{const{data:s}=await Re.post(Ie.API_GET_SCANS,{project_id:t});return s},hl=t=>as(["scan_list",t],()=>pl(t)),Ur=({onScanClick:t,profile:s,project_url:n,project_branch:r,project_id:i,scan_id:l})=>{const{data:u,isLoading:d}=hl(i),[h,p]=a.useState({}),c=async j=>{const E=j||l;if(n&&n!=="File Scan"&&!h[E]){let f;j?f=await Ls(n,r||"HEAD",!1,void 0,i,j):f=await Ls(n,r||"HEAD",!1,void 0,i,l),f&&f.status==="success"&&p(o=>({...o,[E]:f.tree}))}},[b]=$e("(min-width: 1000px)");return e.jsx(z,{sx:{w:"100%",borderRadius:"20px",bg:"#FAFBFC",h:"calc(100vh - 225px)",overflowY:"scroll"},position:"relative",children:d?e.jsx(Ne,{}):b?e.jsxs(e.Fragment,{children:[e.jsx(S,{alignItems:"flex-start",justifyContent:"flex-start",flexDir:"column",position:"sticky",top:"0",sx:{cursor:"pointer",w:"100%",bg:"#FAFBFC",my:2,px:[5,5,6,6],pb:1,zIndex:1},children:e.jsxs(S,{justifyContent:"flex-start",alignItems:"center",flexWrap:"wrap",width:"fit-content",flexDir:"row",w:"100%",children:[e.jsx(_,{color:"#4E5D78",w:"10%",fontSize:"xs",children:"Scan Name"}),e.jsx(_,{color:"#4E5D78",w:"13%",fontSize:"xs",children:"Security Score"}),e.jsx(_,{color:"#4E5D78",w:"13%",fontSize:"xs",children:"Threat Score"}),e.jsx(_,{color:"#4E5D78",w:"34%",fontSize:"xs",children:"Audit Report"}),e.jsx(_,{color:"#4E5D78",w:"10%",fontSize:"xs",children:"Scan Date"}),e.jsx(_,{color:"#4E5D78",w:"20%",fontSize:"xs",children:"Actions"})]})}),e.jsx(S,{w:"100%",h:"fit-content",justifyContent:"flex-start",flexDir:"column",alignItems:"center",overflowY:"scroll",children:s&&u&&u.scans?.map(j=>e.jsx(fl,{scan:j,onScanClick:t,repoTree:h[j.scan_id]||null,project_url:n,profile:s,getRepoTreeReq:c},j.scan_id))})]}):s&&u&&u.scans?.map(j=>e.jsx(ml,{scan:j,onScanClick:t,repoTree:h[j.scan_id]||null,project_url:n,profile:s,getRepoTreeReq:c},j.scan_id))})},fl=({scan:t,profile:s,repoTree:n,getRepoTreeReq:r,project_url:i,onScanClick:l})=>{const[u,d]=a.useState(!1),[h,p]=a.useState(!1),[c,b]=a.useState(null),j=Ee(),E=ht();return a.useEffect(()=>{if(n&&t.skip_file_paths){let f=Zs(n,!0);t.skip_file_paths.forEach(o=>{f=es(o,!1,f)}),b(f)}},[n,t.skip_file_paths]),e.jsxs(S,{alignItems:"flex-start",justifyContent:"flex-start",flexDir:"column",onClick:()=>{t.scan_status==="scan_done"&&(l(),E.push(`/projects/${t.project_id}/${t.scan_id}?scan_name=${t.scan_name}`))},sx:{cursor:"pointer",w:"100%",bg:"white",borderRadius:5,mb:3,px:[5,5,7,10],py:5},children:[e.jsxs(S,{justifyContent:"flex-start",alignItems:"center",flexWrap:"wrap",width:"100%",flexDir:"row",fontSize:"sm",children:[e.jsx(_,{w:"10%",children:t.scan_name}),e.jsxs(re,{spacing:0,alignItems:"flex-end",w:"13%",children:[e.jsx(_,{fontSize:"md",fontWeight:600,children:t.scan_score_v2&&t.scan_score_v2!=="N/A"?parseFloat(t.scan_score_v2).toFixed(2):"--"}),e.jsx(_,{fontSize:"sm",fontWeight:400,children:"/100"})]}),e.jsxs(re,{spacing:0,alignItems:"flex-end",w:"13%",children:[e.jsx(_,{fontSize:"md",fontWeight:600,children:t.threat_score&&t.threat_score!=="N/A"?parseFloat(t.threat_score).toFixed(2):"--"}),e.jsx(_,{fontSize:"sm",fontWeight:400,children:"/100"})]}),e.jsxs(S,{w:"35%",alignItems:"center",children:[e.jsxs(je,{id:`ss-${t.scan_name}-report`,variant:"text",minW:"150px",color:"#4E5D78",_hover:{color:"#3300FF"},p:0,size:"sm",justifyContent:"flex-start",leftIcon:t.reporting_status==="report_generated"?e.jsx(he,{height:"30px",width:"20px",src:`${j}common/view_report_icon.svg`}):void 0,bg:"white",rightIcon:t.reporting_status==="report_generated"?e.jsx(ar,{}):void 0,isDisabled:t.reporting_status!=="report_generated"||(s.actions_supp
89orted?!s.actions_supported.generate_report:s.current_package==="trial"),onClick:f=>{f.stopPropagation(),window.open(`http://${document.location.host}/report/project/${t.project_id}/${t.latest_report_id}`,"_blank")},children:[t.reporting_status==="generating_report"&&e.jsx(S,{mr:3,children:e.jsx(Ne,{color:"#806CCF",size:25})}),t.reporting_status==="report_generated"?"View Report":t.reporting_status==="generating_report"?"Generating Report":"Report Not Generated"]}),t.is_trial_scan&&e.jsx(_,{height:"fit-content",px:7,mr:3,py:1,borderRadius:3,bgColor:"#F1F1F1",color:"#323B4B",children:"Free Trial"})]}),e.jsx(_,{w:"9%",children:new Date(t.scan_time).toLocaleDateString()}),i!=="File Scan"&&t.skip_file_paths&&t.scan_status==="scan_done"&&e.jsxs(re,{onClick:f=>f.stopPropagation(),spacing:3,w:"20%",children:[e.jsxs(je,{id:`ss-${t.scan_name}-files`,variant:"text",size:"sm",minW:"150px",color:"#4E5D78",_hover:{color:"#3300FF"},isLoading:h,spinner:e.jsx(Ne,{color:"#3300FF",size:25}),onClick:async f=>{f.stopPropagation(),u?d(!1):(p(!0),d(!0),await r(t.scan_id),p(!1))},children:[u?"Hide Scanned Files":"View Scanned Files"," ",u?e.jsx(lr,{ml:2}):e.jsx(cr,{ml:2})]}),e.jsxs(ls,{placement:"bottom-end",children:[e.jsx(cs,{children:e.jsx(ur,{color:"#d7cdfa"})}),e.jsxs(us,{p:1,children:[e.jsx(dr,{}),e.jsx(pr,{}),e.jsx(ds,{children:e.jsxs(_,{fontSize:"sm",textAlign:"left",lineHeight:"title",fontWeight:"300",mb:0,children:["The scanned files have been highlighted while the remaining ones were skipped. To modify settings for future scans, please refer to the"," ",e.jsx(z,{textDecoration:"underline",as:"span",color:"#3E15F4",mr:1,children:"Custom Settings"}),"option."]})})]})]})]})]}),e.jsx(hr,{style:{width:"100%"},in:u,animateOpacity:!0,children:c&&e.jsx(Js,{branch:"",view:"scan_history",repoTreeUP:c,setRepoTreeUP:b})})]})},ml=({scan:t,onScanClick:s,profile:n,repoTree:r,getRepoTreeReq:i,project_url:l})=>
89{const u=ht(),[d,h]=a.useState(!1),[p,c]=a.useState(!1),[b,j]=a.useState(null),E=Ee();return a.useEffect(()=>{if(r&&t.skip_file_paths){let f=Zs(r,!0);t.skip_file_paths.forEach(o=>{f=es(o,!1,f)}),j(f)}},[r,t.skip_file_paths]),e.jsxs(S,{alignItems:"flex-start",justifyContent:"flex-start",flexDir:"column",onClick:()=>{t.scan_status==="scan_done"&&(s(),u.push(`/projects/${t.project_id}/${t.scan_id}?scan_name=${t.scan_name}`))},sx:{cursor:"pointer",w:"100%",bg:"white",my:4,px:[5,5,7,10],borderRadius:"10px",transition:"0.3s box-shadow",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.05)",_hover:{boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.2)"}},children:[e.jsxs(S,{direction:"column",w:"100%",justifyContent:"flex-start",alignItems:"flex-start",p:3,children:[e.jsxs(S,{direction:"row",w:"100%",justifyContent:"flex-start",alignItems:"flex-start",flexWrap:"wrap",children:[e.jsxs(z,{sx:{width:"60px",height:"60px",p:2,bg:"#F7F7F7",color:"#4E5D78",borderRadius:"50%",textAlign:"center",mr:14,mt:2},children:[e.jsx(_,{fontSize:"xl",fontWeight:"600",children:new Date(t.scan_time).getDate()}),e.jsx(_,{fontSize:"12px",mt:"-4px",children:mi[new Date(t.scan_time).getMonth()]})]}),e.jsxs(ue,{my:2,alignItems:"flex-start",spacing:1,width:"150px",children:[e.jsx(_,{fontSize:"sm",color:"gray.400",children:"Scan Name"}),e.jsx(_,{fontSize:"md",children:t.scan_name})]}),e.jsxs(ue,{my:2,alignItems:"flex-start",spacing:1,width:"150px",children:[e.jsx(_,{fontSize:"sm",color:"gray.400",children:"Security Score"}),e.jsx(_,{sx:{color:"accent",fontSize:"xl",fontWeight:600,mx:"auto",lineHeight:1},children:parseFloat(t.scan_score_v2).toFixed(2)||t.scan_score})]}),t.is_trial_scan&&e.jsx(_,{height:"fit-content",px:7,mr:5,py:1,borderRadius:3,bgColor:"#F1F1F1",color:"#323B4B",children:"Free Trial"})]}),e.jsx(ut,{my:5}),e.jsxs(S,{justifyContent:"flex-start",alignItems:"flex-start",flexWrap:"wrap",width:"fit-content",flexDir:["column","row","row"],children:[e.jsxs(je,{id:`ss-${t.scan_name}-view-report`,variant:"text",minW:"150px",color:"#4E5D78",_hover:{color:"#3300FF"},size:"sm",leftIcon:t.reporting_status==="report_generated"?e.jsx(he,{height:"30px",width:"20px",src:`${E}common/view_report_icon.svg`}):void 0,bg:"white",mr:3,my:2,rightIcon:t.reporting_status==="report_generated"?e.jsx(ar,{}):void 0,isDisabled:t.reporting_status!=="report_generated"||(n.actions_supported?!n.actions_supported.generate_report:n.current_package==="trial"),onClick:f=>{f.stopPropagation(),window.open(`http://${document.location.host}/report/project/${t.project_id}/${t.latest_report_id}`,"_blank")},children:[t.reporting_status==="generating_report"&&e.jsx(S,{mr:3,children:e.jsx(Ne,{color:"#806CCF",size:25})}),t.reporting_status==="report_generated"?"View Report":t.reporting_status==="generating_report"?"Generating Report":"Report Not Generated"]}),l!=="File Scan"&&t.skip_file_paths&&t.scan_status==="scan_done"&&e.jsxs(re,{onClick:f=>f.stopPropagation(),spacing:3,mr:3,my:2,children:[e.jsxs(je,{id:`ss-${t.scan_name}-file`,variant:"text",minW:"150px",size:"sm",color:"#4E5D78",_hover:{color:"#3300FF"},isLoading:p,spinner:e.jsx(Ne,{color:"#3300FF",size:25}),onClick:async f=>{f.stopPropagation(),d?h(!1):(c(!0),h(!0),await i(t.scan_id),c(!1))},children:[d?"Hide Scanned Files":"View Scanned Files"," ",d?e.jsx(lr,{ml:2}):e.jsx(cr,{ml:2})]}),e.jsxs(ls,{placement:"bottom-end",children:[e.jsx(cs,{children:e.jsx(ur,{color:"#d7cdfa"})}),e.jsxs(us,{p:1,children:[e.jsx(dr,{}),e.jsx(pr,{}),e.jsx(ds,{children:e.jsxs(_,{fontSize:"sm",textAlign:"left",lineHeight:"title",fontWeight:"300",mb:0,children:["The scanned files have been highlighted while the remaining ones were skipped. To modify settings for future scans, please refer to the"," ",e.jsx(z,{textDecoration:"underline",as:"span",color:"#3E15F4",mr:1,children:"Custom Settings"}),"option."]})})]})]})]})]})]}),e.jsx(hr,{style:{width:"100%"},in:d,animateOpacity:!0,children:b&&e.jsx(Js,{branch:"",view:"scan_history",repoTreeUP:b,setRepoTreeUP:j})})]})},_l={critical:"#960d00",high:"#ff5c00",medium:"#ffe600",low:"#38cb89",gas:"#f795b4",informational:"#a0aec0"},qr=({isGithubIntegrated:t,project_id:s,project_url:n,webhook_enabled:r,project_skip_files:i,project_zip_files:l=[],project_branch:u,scanId:d,skipped_detectors:h,currentPackage:p,project_type:c,integrations:b,checkMarxProject:j,refetchScanDetail
89s:E})=>{const[f,o]=ve.useState(r),[m,y]=ve.useState(!1),[w,D]=a.useState(null),[R,L]=a.useState(null),[P,$]=a.useState(void 0),V=tt(),[M,N]=a.useState([]),[K,Q]=a.useState(!1),J=b?.checkmarx?.status==="successful",ee=async()=>{if(n!=="File Scan"&&R===null){const W=await Ls(n,u||"HEAD",void 0,void 0,s,d);W&&W.status==="success"&&L(W.tree)}},X=async()=>{y(!0);try{const{data:W}=await Re.post(Ie.API_TOGGLE_PROJECT_SYNCHRONIZATION,{project_url:n,project_id:s,recur_scans:!f});W.status==="success"?(V({title:W.message,status:"success",duration:9e3,isClosable:!0,position:"bottom"}),o(!f)):V({title:W.message,status:"error",duration:9e3,isClosable:!0,position:"bottom"})}catch{}y(!1)},H=async()=>{if(y(!0),w){const W=go(w);try{const{data:v}=await Re.post(Ie.API_UPDATE_SKIP_FILE_PATHS,{project_id:s,skip_file_paths:W});v.status==="success"&&V({description:v.message,status:"success",duration:3e3,isClosable:!0,position:"bottom"})}catch{}}y(!1)},q=async()=>{Q(!0);try{const W=`${Ie.API_GET_ALL_DETECTORS}?scan_id=${d}`,{data:v}=await Re.get(W);if(v){const k=v.sort((C,F)=>C.scwe_id&&F.scwe_id?C.scwe_id.localeCompare(F.scwe_id):C.scwe_id&&!F.scwe_id?-1:!C.scwe_id&&F.scwe_id?1:(C.issue_name||"").localeCompare(F.issue_name||""));N(k)}}catch(W){console.error("Error fetching detectors:",W)}finally{Q(!1)}};return a.useEffect(()=>{o(r)},[]),a.useEffect(()=>{if(R){let W=Zs(R,!0);i.forEach(v=>{W=es(v,!1,W)}),D(W)}else if(n==="File Scan"){let W=_i(l);i.forEach(v=>{W=es(v,!1,W)}),D(W)}},[R]),e.jsxs(S,{justifyContent:"flex-start",alignItems:"center",flexDir:"column",sx:{w:"100%",borderRadius:"20px",px:[2,2,4],h:"calc(100vh - 225px)",overflowY:"scroll"},children:[e.jsxs(Gt,{defaultIndex:void 0,allowToggle:!0,w:["100%","100%","100%","100%"],children:[c!=="blocks"&&(n!=="File Scan"||l.length>0)&&e.jsxs(mt,{alignItems:"center",justifyContent:"flex-start",flexDir:"column",sx:{cursor:"pointer",w:"100%",bg:"white",my:4,py:[4,4,6],h:"fit-content",px:[4,4,7,10],borderRadius:"15px",border:"none",transition:"0.3s box-shadow"},children:[e.jsx(_t,{id:"ss-project-folder",w:"100%",h:"fit-content",p:0,_hover:{backgroundColor:"white"},onClick:async()=>{n!=="File Scan"&&ee()},children:e.jsxs(re,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[e.jsxs(ue,{justifyContent:"flex-start",spacing:1,alignItems:"flex-start",w:["calc(100% - 60px)","calc(100% - 60px)","80%","70%"],children:[e.jsx(_,{fontWeight:500,fontSize:"lg",children:"Project Folders"}),e.jsx(_,{fontWeight:500,color:"#B0B7C3",textAlign:"left",fontSize:"sm",children:n==="File Scan"?"List of all the directories and files scanned within the zip file.":"Update directories and files to be scanned."})]}),e.jsx(xs,{})]})}),e.jsx(gt,{flexDir:"column",backgroundColor:"#FCFCFC",px:[3,3,5],py:2,mt:3,borderRadius:20,border:"1px solid #ECECEC",w:"100%",height:"fit-content",children:w?e.jsx(Js,{isLoading:m,repoTreeUP:w,setRepoTreeUP:D,branch:u||"",updateSkipPathRequests:H,view:n==="File Scan"?"scan_history":"detailed_result",showDivider:n!=="File Scan",treeHeight:"290px",isProjectSettings:!0}):e.jsx(S,{w:"100%",h:"100%",justifyContent:"center",alignItems:"center",py:4,children:e.jsx(Ne,{})})})]}),n!=="File Scan"&&c!=="blocks"&&e.jsxs(mt,{alignItems:"center",justifyContent:"flex-start",flexDir:"column",sx:{cursor:"pointer",w:"100%",bg:"white",my:4,py:6,h:"fit-content",px:[5,5,7,10],borderRadius:"15px",border:"none",transition:"0.3s box-shadow"},children:[e.jsx(_t,{w:"100%",h:"fit-content",p:0,_hover:{backgroundColor:"white"},children:e.jsxs(re,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[e.jsxs(ue,{justifyContent:"flex-start",spacing:3,alignItems:"flex-start",w:["calc(100% - 60px)","calc(100% - 60px)","80%","70%"],children:[e.jsx(_,{fontWeight:500,fontSize:"lg",children:"Project Settings"}),e.jsx(_,{color:"#B0B7C3",textAlign:"left",fontSize:"sm",fontWeight:500,children:"Configure your project settings."})]}),e.jsx(xs,{})]})}),e.jsx(gt,{flexDir:"column",backgroundColor:"#FCFCFC",px:[3,3,5],py:3,mt:5,borderRadius:20,border:"1px solid #ECECEC",w:"100%",height:"fit-content",children:e.jsx(zi,{view:"detailed_result",githubSync:f,isLoading:m,onToggleFunction:X,isOauthIntegrated:t,formType:ze(n),isProjectSettings:!0})})]}),p==="custom"&&e.jsxs(mt,{alignItems:"center",justifyContent:"flex-start",flexDir:"column",sx:{cursor:"pointer",w:"100%",bg:"white",my:4,py:6,h:"fit-content",px:[5,5,7,10],borderRadius:"15p
89x",border:"none",transition:"0.3s box-shadow"},children:[e.jsx(_t,{w:"100%",h:"fit-content",p:0,_hover:{backgroundColor:"white"},onClick:()=>{q()},children:e.jsxs(re,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[e.jsxs(ue,{justifyContent:"flex-start",spacing:3,alignItems:"flex-start",w:["calc(100% - 60px)","calc(100% - 60px)","80%","70%"],children:[e.jsx(_,{fontWeight:500,fontSize:"lg",children:"Detector Settings"}),e.jsx(_,{color:"#B0B7C3",textAlign:"left",fontSize:"sm",fontWeight:500,children:"View selected detectors for this scan."})]}),e.jsx(xs,{})]})}),e.jsx(gt,{flexDir:"column",backgroundColor:"#FCFCFC",px:[3,3,5],py:3,mt:5,borderRadius:20,border:"1px solid #ECECEC",w:"100%",height:"fit-content",children:e.jsx(z,{w:"100%",children:K?e.jsx(S,{justifyContent:"center",alignItems:"center",height:"300px",children:e.jsx(Ne,{})}):e.jsxs(e.Fragment,{children:[e.jsxs(S,{justifyContent:"space-between",alignItems:"center",mb:4,children:[e.jsx(_,{fontSize:"13px",fontWeight:500,children:"Selected Detectors"}),e.jsxs(_,{fontSize:"13px",children:[e.jsx(_,{as:"span",fontWeight:"bold",children:M.length-(h?.length||0)})," ","selected out of ",M.length]})]}),e.jsx(z,{borderRadius:"md",p:2,overflowX:"auto",css:{"&::-webkit-scrollbar":{height:"8px",width:"8px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"rgba(0,0,0,0.2)",borderRadius:"4px"}},children:e.jsxs(ue,{spacing:2,align:"stretch",maxH:["200px","250px","250px","380px"],overflowY:"auto",minW:"500px",w:"100%",children:[M.map(W=>e.jsxs(S,{p:2,bg:"white",borderRadius:"md",align:"center",justifyContent:"space-between",width:"100%",gap:"30px",children:[e.jsx(or,{isChecked:!h?.includes(W.issue_id),isDisabled:!0,mr:4}),e.jsx(_,{fontWeight:500,width:"80px",fontSize:"13px",children:W.scwe_id}),e.jsxs(S,{align:"center",width:"100px",children:[e.jsx(z,{w:"10px",h:"10px",borderRadius:"full",bg:_l[W.issue_severity],mr:2}),e.jsx(_,{fontSize:"13px",color:"gray.600",flexGrow:1,textTransform:"capitalize",children:W.issue_severity})]}),e.jsx(_,{flex:"1",fontSize:"13px",children:W.issue_name})]},`${W.issue_id}`)),M.length===0&&!K&&e.jsx(S,{justifyContent:"center",p:4,children:e.jsx(_,{children:"No detectors available for this scan."})})]})})]})})})]})]}),p==="custom"&&e.jsx(z,{w:"100%",bg:"white",px:10,pb:8,mb:32,p:[],borderRadius:"15px",border:"1px solid #ECECEC",children:e.jsx(Oi,{isCheckMarksIntegrated:J,selectedCheckmarxProject:P,setSelectedCheckmarxProject:$,showCheckmarxSendBtn:!0,checkMarxProject:j,scanId:d,refetchScanDetails:E})})]})},gl=({report:t,type:s})=>{const n=tt(),r=Ee(),{scanData:i,refetchReportList:l}=a.useContext(et),[u,d]=a.useState(!1),{isOpen:h,onClose:p,onOpen:c}=Ye(),b=async()=>{d(!0);try{d(!0);const E=t.report_type==="download_only"?Ie.API_GET_VIEW_REPORT_PDF:Ie.API_GET_REPORT_PDF,{data:f}=await Re.post(E,{project_id:t.project_id,report_id:t.report_id,scan_type:s});if(d(!1),f.status==="success"&&f.download_url){const o=document.createElement("a");o.href=f.download_url,o.click()}}catch{d(!1)}},[j]=$e("(max-width: 500px)");return e.jsxs(S,{alignItems:["flex-start","flex-start","center"],justifyContent:"space-between",sx:{cursor:"pointer",w:"100%",bg:"white",my:2,p:3,px:[3,5],borderRadius:"10px"},height:"fit-content",children:[e.jsxs(z,{display:j?"none":"block",sx:{width:"60px",height:"60px",p:2,bg:"#F7F7F7",color:"#4E5D78",borderRadius:"50%",textAlign:"center",mr:7,mt:2},children:[e.jsx(_,{fontSize:"xl",fontWeight:"600",children:t.date_published&&t.date_published.slice(0,2)}),e.jsx(_,{fontSize:"12px",mt:"-4px",children:t.date_published&&t.date_published.slice(3,6)})]}),e.jsxs(S,{justifyContent:"flex-start",width:["calc(100% - 60px)","calc(100% - 60px)","calc(100% - 120px)"],alignItems:["flex-start","flex-start","center"],flexWrap:"wrap",flexDir:["column","column","row"],height:"fit-content",children:[e.jsxs(re,{width:["210px"],my:3,children:[t.is_approved||t.report_type==="assisted"?e.jsx(Jn,{color:"#03C04A"}):t.report_type==="self_published"?e.jsx(he,{width:"25px",height:"25px",src:`${r}report/user.svg`}):t.report_type==="download_only"?e.jsx(ki,{color:"detail"}):e.jsx(er,{color:"#FF5C00"}),e.jsx(_,{color:t.is_approved||t.report_type==="assisted"?"#03C04A":t.report_type==="self_published"?"black":t.report_type==="download_only"?"detail":"#FF5C00",
89sx:{fontSize:"md",fontWeight:600,ml:2},children:t.is_approved||t.report_type==="assisted"?"Approved":t.report_type==="self_published"?"Self-Published":t.report_type==="download_only"?"Download Only":"Waiting for Approval"})]}),e.jsxs(re,{width:["130px"],my:3,children:[t.is_approved||["self_published","assisted"].includes(t.report_type)?e.jsx(gi,{}):e.jsx(io,{}),e.jsx(_,{sx:{fontSize:"md",fontWeight:600,ml:2},children:t.is_approved||["self_published","assisted"].includes(t.report_type)?"Public":"Private"})]}),(t.is_approved||["self_published","assisted"].includes(t.report_type))&&e.jsxs(re,{my:3,width:["260px"],mr:5,children:[e.jsx(oo,{color:"#3E15F4"}),e.jsx(_,{id:`ss-publish-report-${t.report_id}`,align:"left",fontSize:"md",color:"#3E15F4",onClick:E=>{E.stopPropagation(),navigator.clipboard.writeText(`http://${document.location.host}/published-report/${s}/${t.report_id}`).then(()=>n({title:"Copied Report URL",description:"",status:"success",duration:1e3,isClosable:!0}),()=>n({title:"Could not Copy Report URL",description:"",status:"error",duration:3e3,isClosable:!0}))},children:"Copy link to Published Report"})]}),t.report_type==="download_only"&&e.jsxs(e.Fragment,{children:[e.jsx(Pt,{id:"ss-publish-report",variant:"brand",px:10,py:4,onClick:c,children:"Publish Report"}),i&&e.jsx(gr,{type:s,scanData:i.scan_report,reportId:t.report_id,projectId:t.project_id,downloadReportPaymentStatus:t.payment_status,isOpen:h,onClose:()=>{l(),p()}})]}),j?e.jsxs(S,{flexDir:"row",width:"100%",alignItems:"center",justifyContent:"flex-start",children:[(t.is_approved||["self_published","assisted"].includes(t.report_type))&&e.jsx(He,{id:"ss-report-pdf",my:3,mr:4,"aria-label":"View Report",backgroundColor:"#F5F2FF",icon:u?e.jsx(Ne,{size:25,color:"#3E15F4"}):e.jsx(Ts,{color:"#3E15F4"}),onClick:E=>{b()}}),e.jsx(He,{id:`ss-published-report-${t.report_id}`,my:[2,2,5],"aria-label":"View Report",backgroundColor:"#F5F2FF",icon:e.jsx(yn,{color:"#806CCF"}),onClick:E=>{E.stopPropagation(),t.is_approved||t.report_type==="assisted"?window.open(`http://${document.location.host}/published-report/${s}/${t.report_id}`,"_blank"):window.open(`http://${document.location.host}/report/${s}/${t.project_id}/${t.report_id}`,"_blank")}})]}):null]}),e.jsxs(S,{flexDir:["column"],justifyContent:"flex-start",alignItems:"center",width:["60px","60px","120px"],height:"100%",children:[e.jsxs(z,{display:j?"block":"none",sx:{width:"60px",height:"60px",p:2,bg:"#F7F7F7",color:"#4E5D78",borderRadius:"50%",textAlign:"center"},children:[e.jsx(_,{fontSize:"xl",fontWeight:"600",children:t.date_published&&t.date_published.slice(0,2)}),e.jsx(_,{fontSize:"12px",mt:"-4px",children:t.date_published&&t.date_published.slice(3,6)})]}),j?null:e.jsxs(S,{flexDir:["column","column","row"],width:"100%",alignItems:"center",justifyContent:["flex-start","flex-start","flex-end"],children:[(t.is_approved||["self_published","assisted","download_only"].includes(t.report_type))&&e.jsx(He,{id:`ss-report-pdf-${t.report_id}`,my:[2,2,5],mr:[0,0,5],"aria-label":"View Report",backgroundColor:"#F5F2FF",icon:u?e.jsx(Ne,{size:25,color:"#3E15F4"}):e.jsx(Ts,{color:"#3E15F4"}),onClick:E=>{b()}}),e.jsx(He,{id:`ss-view-report-${t.report_id}`,my:[2,2,5],"aria-label":"View Report",backgroundColor:"#F5F2FF",icon:e.jsx(yn,{color:"#806CCF"}),onClick:E=>{E.stopPropagation(),t.is_approved?window.open(`http://${document.location.host}/published-report/${s}/${t.report_id}`,"_blank"):window.open(`http://${document.location.host}/report/${s}/${t.project_id}/${t.report_id}`,"_blank")}})]})]})]})},Yr=({profile:t,type:s,reportList:n})=>e.jsx(z,{sx:{w:"100%",borderRadius:"20px",px:0,h:"calc(100vh - 225px)",overflowY:"scroll"},children:n&&n.length>0?n.map(r=>e.jsx(gl,{type:s,profile:t,report:r})):e.jsx(S,{justifyContent:"center",alignItems:"center",w:"100%",h:"100%",children:"You have not published any reports yet."})}),xl=({isOpen:t,onClose:s})=>e.jsxs(wt,{isOpen:t,onClose:s,size:"xl",isCentered:!0,children:[e.jsx(Vt,{}),e.jsxs(St,{borderRadius:["15px","15px","15px","15px"],maxW:"1112px",maxH:"744px",bg:["white","white","white","white"],p:[0,0,0,0],m:[0,0,0,"auto"],w:["90%","90%","90%","auto"],children:[e.jsxs(Nt,{display:["none","none","none","block"],bg:"white",borderRadius:"15p
89x",fontSize:"20px",fontWeight:"bold",textAlign:"center",mt:"20px",children:[e.jsx(_,{children:"Schedule a free video consultation"}),e.jsx(ut,{mt:"24px"})]}),e.jsx(Ct,{color:["#8d86c9","#8d86c9","#8d86c9","black"],borderRadius:"full",size:"md",zIndex:10}),e.jsxs(kt,{pb:[0,0,0,6],p:[0,0,0,6],children:[e.jsxs(S,{gap:"35px",justifyContent:"space-between",maxW:"100%",flexWrap:"wrap",children:[e.jsxs(z,{flex:"1",position:"relative",maxH:"432px",maxW:"333px",display:["none","none","none","flex"],children:[e.jsx(he,{src:`${Ee()}free_consultation/banner_left.svg`,alt:"Schedule Call",w:"100%",h:"100%"}),e.jsx(_,{position:"absolute",top:"10%",right:"5%",fontSize:"2xl",fontWeight:"bold",color:"#7CC46C",children:"SCHEDULE CALL"})]}),e.jsxs(z,{position:"relative",flex:"1",borderRadius:"15px",overflow:"hidden",children:[e.jsx(z,{position:"absolute",top:"0",left:"0",right:"0",bottom:"0",bgGradient:"linear(to-br, #0F2317, #193741 50%, #0F2317)",zIndex:"0"}),e.jsx(z,{position:"absolute",bottom:"-20%",left:"-20%",width:"70%",height:"70%",bgGradient:"radial(ellipse at bottom left, #52FF00 0%, #319900 30%, transparent 70%)",opacity:"0.4",pointerEvents:"none",zIndex:"0",transform:"scale(1.2)"}),e.jsx(z,{position:"absolute",top:"0",right:"0",width:"40%",height:"40%",bgGradient:"radial(circle at top right, #3300FF, #193741, transparent 70%)",opacity:"0.3",pointerEvents:"none",zIndex:"0"}),e.jsxs(S,{direction:"column",position:"relative",zIndex:"1",py:["30px","30px","30px","30px"],px:["25px","30px","40px","46px"],pt:"40px",paddingRight:["25px","30px","40px","0px"],h:"100%",maxH:["unset","unset","unset","432px"],minW:["unset","unset","unset","638px"],w:["100%","100%","100%","auto"],maxW:["100%","100%","100%","auto"],children:[e.jsxs(S,{direction:["column","column","column","row"],height:"100%",overflow:"hidden",justify:["flex-start","flex-start","flex-start","space-between"],children:[e.jsxs(S,{direction:"column",justify:["center","center","center","space-between"],minW:["100%","100%","100%","215px"],align:["center","center","center","flex-start"],children:[e.jsx(S,{align:"center",mb:[6,8,10,12],w:"100%",justify:["center","center","center","flex-start"],children:e.jsx(he,{src:`${Ee()}free_consultation/solidity_scanner_logo.svg`,alt:"SolidityScanner",height:"25px"})}),e.jsx(S,{align:["center","center","center","flex-start"],mt:2,flexGrow:1,textAlign:["center","center","center","left"],children:e.jsx(_,{color:"white",fontWeight:"bold",fontSize:["16px","16px","24px","30px"],lineHeight:["1.2","1.2","1.2","45px"],children:"GET YOUR CONTRACT REVIEWED BY INDUSTRY EXPERTS"})}),e.jsx(he,{src:`${Ee()}free_consultation/free_card.svg`,alt:"Free",width:["140px","150px","160px"],height:"auto",mt:[4,4,4,0],alignSelf:["center","center","center","flex-start"]})]}),e.jsx(he,{src:`${Ee()}free_consultation/right_card.svg`,alt:"Audit report",minH:["240px","280px","320px","360px"],maxH:["280px","320px","350px","unset"],flexGrow:1,mt:["25px","25px","25px","20px"],alignSelf:"center",display:["block","block","block","block"],mx:"auto"})]}),e.jsx(je,{id:"ss-free-call",variant:"brand",w:"40%",minW:"234px",display:["flex","flex","flex","none"],alignSelf:"center",mt:"35px",onClick:()=>window.open("https://calendly.com/koda-credshields/30min","_blank"),children:"Schedule free Call"})]})]})]}),e.jsxs(z,{mt:6,display:["none","none","none","block"],children:[e.jsx(_,{mb:4,color:"gray.600",children:"Unlock expert guidance on your smart contract security! As part of your subscription, you're eligible for a free 1:1 consultation with our seasoned blockchain security experts. Whether you have questions about your audit results, need help interpreting vulnerabilities, or want a second opinion on your contract securityâour team is here to help."}),e.jsx(S,{justify:"flex-end",children:e.jsx(je,{id:"ss-free-call",variant:"brand",w:"234px",onClick:()=>window.open("https://calendly.com/koda-credshields/30min","_blank"),children:"Schedule free Call"})})]})]})]})]});function bl(t){return Kn({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"title",attr:{},child:[]},{tag:"path",attr:{d:"M4.409 6.608L7.981.255l3.572 6.353H4.409zM8.411 0l3.569 6.348L15.552 0H8.411zm4.036 17.392l3.572 6.354 3.575-6.354h-7.147zm-.608-10.284h-7.43l3.715 6.605 3.715-6.605zm.428-.25h7.428L15.982.255l-3.715 6.603zM15.589 24l-3.569-6.349L8.448 24h7.141zm-3.856-6.858H4.306l3.712 6.603 3.715-6.603zm.428-.25h7.433l-3.718-6.605-3.715 6.605z"}}]})(t)}const Rs={critical:{main:"#960d00",light:"#FFE4E2",color:"#960d00"},high:{main:"#ff5c00",light:"#FFEBE2",color:"#ff5c00"},medium:{main:"#FFE500",light:"#FFFBDB",color:"#E0A921"},low:{main:"#38cb89",light:"#EFFCF6",color:"#38cb89"},gas:{main:"#f795b4",light:"#FFEEF4",color:"#f795b4"},informational:{main:"#a0aec0",light:"#E8E8E8",color:"#a0aec0"}},yl=[{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"},{value:"gas",label:"Gas"},{value:"informational",label:"Informational"}],jl=[{value:"2",label:"Certain"},{value:"1",label:"Firm"},{value:"0",label:"Tentative"}],vl=({isOpen:t,onClose:s,onlyEdit:n,prefilledIssueData:r,onSuccessCallback:i,updateScanIssue:l,startLineNumber:u,endLineNumber:d,setStartLineNumber:h,setEndLineNumber:p,codeLocation:c,setCodeLocation:b,setFocusColor:j,selectedFile:E,issueSeverity:f,setIssueSeverity:o,userUuid:m})=>
89{const[y,w]=a.useState(""),[D,R]=a.useState(""),[L,P]=a.useState(""),[$,V]=a.useState(""),[M,N]=a.useState(""),[K,Q]=a.useState(""),[J,ee]=a.useState(""),[X,H]=a.useState(!1),[q,W]=a.useState([]),[v,k]=a.useState(""),[C,F]=a.useState([]),[x,T]=a.useState(!1),[B,g]=a.useState(!1),U=a.useRef(null),O=a.useRef(null),{scanData:oe,refetchScanDetails:te}=a.useContext(et),{sendMessage:ce,messageQueue:ie,updateMessageQueue:_e,setNeedAuthToken:le}=xt(),{projectType:Y,projectId:be,scanId:de}=Ve(),ye=G=>{if(!G.trim()){h(""),p("");return}const Se=G.match(/(\d+)\s*-\s*(\d+)/g);if(Se&&Se.length>0){const ke=Se[0].match(/(\d+)\s*-\s*(\d+)/);ke&&(h(ke[1]),p(ke[2]))}};a.useEffect(()=>{let G=ie[ie.length-1];G&&G.payload.scan_status==="scan_done"&&(H(!1),_e([]),te(),s())},[ie]),a.useEffect(()=>{n&&r&&ge(r)},[r,t]);const De=tt(),ge=G=>{G&&(w(G?.issue_id||""),R(G?.issue_name||""),P(G?.static_issue_description||G?.issue_description||""),Q(G?.impact?G?.impact:""),N(G?.issue_remediation||""),o(G?.issue_severity||""),ee(G?.issue_confidence||""),k(G?.issue_name||""),h(G?.start_line_number||""),p(G?.end_line_number||""),G?.code_location?b?.(G?.code_location||""):G?.start_line_number&&G?.end_line_number?b?.(`${G?.start_line_number} - ${G?.end_line_number}`||""):b?.(""))},Me=a.useCallback(()=>{w(""),R(""),V(""),P(""),N(""),o(""),ee(""),k(""),T(!1),h(""),p(""),b?.(""),g(!1)},[o,h,p,b]),Ge=()=>!!(y&&D&&M&&L&&J&&f&&c),Fe=()=>!c||!E?.cleaned_file_path?[]:(c.match(/(\d+)\s*-\s*(\d+)/g)||[]).map(Se=>{const ke=Se.match(/(\d+)\s*-\s*(\d+)/);return ke?{file_path:E.cleaned_file_path,line_nos_start:[ke[1]],line_nos_end:[ke[2]]}:null}).filter(Se=>Se!==null);let Z={scan_id:l?de:"",project_id:l?be:"",scan_type:Y==="projects"?"project":"block",issue_id:y.replace(/[^A-Z0-9_]/g,""),issue_name:D||"",static_issue_description:L||"",manual_issue_remediation:M||"",issue_confidence:J||"",issue_severity:f||"",files_vs_line_no:Fe()};const xe=async()=>{H(!0);try{const G={...Z,files_vs_line_no:Fe()};if(Ge()){if(B){const{static_issue_description:ke,issue_name:Qr,issue_severity:an,issue_confidence:ln,manual_issue_remediation:Rt,...gs}=G;ce({type:"enterprise_add_bug",body:{useruuid:m,message:gs}})}else ce({type:"enterprise_add_bug",body:{useruuid:m,message:G}});let Se={type:"enterprise_add_bug",body:{useruuid:m,message:{...G}}};le(!0),ce(Se)}}catch(G){console.error("Error adding issue:",G),H(!1)}},fe=async()=>{if(H(!0),Ge())try{const G={...Z,is_update_request:!0,is_custom:!0,files_vs_line_no:Fe()},{data:Se}=await Re.post(Ie.API_ADD_BUG,G,{headers:{"Content-Type":"application/json"}});Se.status==="success"?(De({title:"Issue Updated",description:Se.message,status:"success",duration:3e3,isClosable:!0}),Me(),i?.(),s()):De({title:"Failed",description:Se.message,status:"error",duration:3e3,isClosable:!0})}catch(G){console.error("Error updating issue:",G),De({title:"Error",description:"Failed to update issue",status:"error",duration:3e3,isClosable:!0})}finally{H(!1)}else H(!1)},pe=new jr({html:!0,breaks:!0,linkify:!0,typographer:!0}),We=G=>{P(G.html)},ae=G=>{N(G.html)},Ae=a.useCallback(async()=>{H(!0);try{const{data:G}=await Re.get(Ie.API_GET_ALL_DETECTORS);G&&W(G)}catch(G){console.error("Error fetching detectors:",G),De({title:"Error fetching detectors",status:"error",duration:3e3,isClosable:!0})}finally{H(!1)}},[De]);a.useEffect(()=>{Ae()},[Ae]),a.useEffect(()=>{if(q.length>0){const G=q.filter(Se=>Se.issue_name?.toLowerCase().includes(v.toLowerCase()));F(G)}},[v,q]);const we=async G=>{try{H(!0);const ke=(await vr(G.id||G.issue_id,"multi_file",G.issue_severity))?.issue_details;P(ke?.static_issue_description||""),V(ke?.issue_description||""),R(ke?.issue_name||""),w(ke?.issue_id||""),k(ke?.issue_name||""),T(!1),N(ke?.issue_remediation||""),Q(ke?.issue_impact||""),ee(ke?.issue_confidence||""),o(ke?.issue_severity||""),g(!0),H(!1)}catch{H(!1),De({title:"Error",description:"Failed to fetch issue details",status:"error",duration:3e3,isClosable:!0})}},Pe=G=>{const ke=G.target.value;k(ke),R(ke),w(ke.replace(/[^A-Z0-9_\s]/g,"").replace(/\s+/g,"_")),B&&(g(!1),P(""),N(""),o(""),ee(""),V("")),x||T(!0)};a.useEffect(()=>{const G=Se=>{O.current&&!O.current.contains(Se.target)&&T(!1)};return x&&document.addEventListener("mousedown",G),()=>{document.removeEventListener("mousedown",G)}},[x]),a.useEffect(()=>{j(Rs[f])},[f,j]),a.useEffect(()=>{t||Me()},[t,Me]);const Qe=()=>{s(),Me()};return t?e.jsxs(z,{position:"fixed",top:"0",right:"0",width:"462px",height:"100vh",bg:"white",boxShadow:"-4px 0 20px rgba(0, 0, 0, 0.15)",borderRadius:"15p
89x 0 0 15px",zIndex:1e3,display:"flex",flexDirection:"column",overflow:"hidden",children:[e.jsxs(S,{justifyContent:"space-between",alignItems:"center",p:4,borderBottomWidth:"1px",borderColor:"gray.100",position:"sticky",top:0,bg:"white",zIndex:10,children:[e.jsx(_,{fontWeight:"semibold",fontSize:"xl",children:"Add Bug"}),e.jsxs(re,{spacing:4,children:[e.jsx(je,{variant:"brand",size:"sm",onClick:n?fe:xe,isDisabled:!Ge(),h:"37px",w:"174px",py:0,borderRadius:"7px",color:"black",isLoading:X,children:"Save"}),e.jsx(He,{"aria-label":"Close modal",icon:e.jsx(Ii,{}),variant:"ghost",size:"sm",onClick:Qe})]})]}),e.jsx(z,{overflow:"auto",p:0,flex:"1",children:e.jsx(z,{p:6,children:e.jsxs(ue,{spacing:6,align:"stretch",children:[e.jsx(Ei,{templateColumns:"100%",gap:6,children:e.jsxs(qt,{position:"relative",ref:O,children:[e.jsx(yt,{fontWeight:"medium",children:"Detector Name"}),e.jsx(z,{position:"relative",children:e.jsx(fr,{ref:U,placeholder:"Enter or select Detector Name",value:v,onChange:Pe,onFocus:()=>!x&&T(!0),size:"md",py:4,px:4,pr:12,minH:"53px",borderRadius:"6px",isDisabled:!!n,borderColor:x?"blue.500":"gray.200",boxShadow:x?"0 0 0 1px #3182ce":"none"})}),x&&e.jsx(z,{position:"absolute",top:"100%",left:"0",right:"0",mt:1,bg:"white",border:"1px solid",borderColor:"gray.200",borderRadius:"15px",boxShadow:"0 10px 25px rgba(0, 0, 0, 0.1)",maxH:"200px",overflowY:"auto",zIndex:1e3,children:C.length>0?C.map((G,Se)=>e.jsx(z,{p:3,cursor:"pointer",borderBottom:Se<C.length-1?"1px solid":"none",borderBottomColor:"gray.100",transition:"background-color 0.2s",fontSize:"16px",fontWeight:"500",onClick:()=>we(G),_hover:{bg:"blue.50",color:"blue.600"},children:G.issue_name},Se)):e.jsx(z,{p:3,color:v?"blue.600":"gray.400",fontSize:"14px",cursor:v?"pointer":"default",transition:"background-color 0.2s",onClick:v?()=>{R(v),w(v.replace(/\s+/g,"_")),T(!1),g(!1),P(""),N(""),o(""),ee("")}:void 0,_hover:v?{bg:"blue.50",color:"blue.700"}:{},children:v?"Add Custom Detector":"Start typing to search..."})})]})}),e.jsxs(S,{direction:"row",alignItems:"flex-start",mb:4,children:[e.jsxs(z,{width:"220px",children:[e.jsx(yt,{fontWeight:"medium",children:"Issue Severity"}),e.jsxs(Lt,{children:[e.jsx(zt,{as:z,py:2,px:4,bg:B&&!n?"gray.100":"#f9fbfd",borderRadius:"6px",border:"1px solid",borderColor:B&&!n?"gray.300":"gray.200",cursor:B&&!n?"not-allowed":"pointer",width:"175px",opacity:B&&!n?.6:1,pointerEvents:B&&!n?"none":"auto",_hover:B&&!n?{}:{borderColor:"blue.300"},children:e.jsxs(S,{alignItems:"center",justifyContent:"space-between",children:[e.jsx(S,{alignItems:"center",flex:"1",children:f?e.jsxs(e.Fragment,{children:[e.jsx(z,{width:"10px",height:"10px",borderRadius:"full",bg:Rs[f].main,mr:3}),e.jsx(_,{fontWeight:500,fontSize:"13px",textTransform:"capitalize",children:f})]}):e.jsx(_,{fontWeight:500,fontSize:"13px",color:"gray.400",children:"Select"})}),!(B&&!n)&&e.jsx(vn,{size:16,color:"#718096"})]})}),e.jsx(Ot,{bg:"white",borderColor:"gray.200",width:"175px",minW:"175px",children:yl.map(G=>e.jsx(Wt,{onClick:()=>o(G.value),bg:"white",color:"black",_hover:{bg:"gray.100"},children:e.jsxs(S,{alignItems:"center",children:[e.jsx(z,{width:"12px",height:"12px",borderRadius:"full",bg:Rs[G.value].main,mr:3}),e.jsx(_,{textTransform:"capitalize",fontSize:"13px",children:G.label})]})},G.value))})]})]}),e.jsxs(z,{width:"220px",children:[e.jsx(yt,{fontWeight:"medium",children:"Issue Confidence"}),e.jsxs(Lt,{children:[e.jsx(zt,{as:z,py:2,px:4,bg:B&&!n?"gray.100":"#f9fbfd",borderRadius:"6px",border:"1px solid",borderColor:B&&!n?"gray.300":"gray.200",cursor:B&&!n?"not-allowed":"pointer",width:"175px",opacity:B&&!n?.6:1,pointerEvents:B&&!n?"none":"auto",_hover:B&&!n?{}:{borderColor:"blue.300"},children:e.jsxs(S,{alignItems:"center",justifyContent:"space-between",children:[J!==""?e.jsx(_,{flex:"1",fontWeight:500,fontSize:"13px",textTransform:"capitalize",children:J==="2"?"Certain":J==="1"?"Firm":"Tentative"}):e.jsx(_,{flex:"1",fontWeight:500,fontSize:"13px",color:"gray.400",children:"Select"}),!(B&&!n)&&e.jsx(vn,{size:16,color:"#718096"})]})}),e.jsx(Ot,{bg:"white",borderColor:"gray.200",width:"175px",minW:"175px",children:jl.map(G=>e.jsx(Wt,{onClick:()=>ee(G.value),bg:"white",color:"black",_hover:{bg:"gray.100"},children:e.jsx(_,{fontSize:"13px",children:G.label})},G.value))})]})]})]}),e.jsxs(qt,{children:[e.jsx(yt,{fontWeight:"medium",children:"Code Location"}),e.jsx(ir,{placeholder:"1 - 5, 7 - 8",value:c||"",onChange:G=>{b?.(G.target.value),ye(G.target.value)},bg:"#FAFBFC",size:"md",borderRadius:"8px",isDisabled:!!n})]}),e.jsxs(qt,{children:[e.jsx(yt,{fontWeight:"medium",children:"Static Issue Description"}),e.jsx(z,{sx:{"& .rc-md-editor .editor-container > .section":{borderRight:"unset !important"},"& .rc-md-editor .editor-container > .sec-html":{backgroundColor:"#ececec !important"},"& .rc-md-editor .custom-html-style":{border:"none !important"}
89,borderRadius:"15px !important",border:"1px solid #ECECEC !important",overflow:"hidden !important"},children:B&&!n?e.jsx(_,{color:"#323232",fontSize:"13px",fontWeight:"400",p:4,children:L}):e.jsx(Sn,{value:L,style:{height:"250px",border:"unset",boxShadow:"unset"},renderHTML:G=>pe.render(G),onChange:We,view:{menu:!0,md:!0,html:!0},readOnly:B&&!n})})]}),e.jsxs(qt,{children:[e.jsx(yt,{fontWeight:"medium",children:"Vulnerability Remediation"}),e.jsx(z,{sx:{"& .rc-md-editor .editor-container > .section":{borderRight:"unset !important"},"& .rc-md-editor .editor-container > .sec-html":{backgroundColor:"#ececec !important"},"& .rc-md-editor .custom-html-style":{border:"none !important"},borderRadius:"15px !important",border:"1px solid #ECECEC !important",overflow:"hidden !important"},children:B&&!n?e.jsx(_,{color:"#323232",fontSize:"13px",fontWeight:"400",p:4,children:M}):e.jsx(Sn,{value:M,style:{height:"250px",border:"unset",boxShadow:"unset"},renderHTML:G=>pe.render(G),onChange:ae,view:{menu:!0,md:!0,html:!1},readOnly:B&&!n})})]})]})})})]}):null},wl=({auditMode:t})=>{const[s,n]=a.useState(null),[r,i]=a.useState(!1),[l,u]=a.useState(0),[d,h]=a.use
89State(null),[p,c]=a.useState(""),[b,j]=a.useState(!1),[E,f]=a.useState(!1),[o,m]=a.useState("1"),[y,w]=a.useState("1000"),[D,R]=a.useState(""),[L,P]=a.useState({main:"",light:""}),[$,V]=a.useState([]),[M,N]=a.useState(""),[K,Q]=a.useState(""),{profileData:J,role:ee}=qe(),{scanData:X,refetchScanDetails:H}=a.useContext(et),{projectType:q,projectId:W,scanId:v}=Ve(),k=q?.replace(/s$/,""),C=()=>{f(!1),m("1"),w("1000"),R(""),P({main:"",light:""}),c(""),j(!1)},{multi_file_scan_summary:F,multi_file_scan_details:x,details_enabled:T,project_url:B,project_branch:g}=X?.scan_report||{},U=X?.is_latest_scan||!0,{issue_severity_distribution:{critical:O=0,high:oe=0,medium:te=0,low:ce=0,informational:ie=0,gas:_e=0}={}}=F||{},le=ne=>{const Ce={critical:6,high:5,medium:4,low:3,informational:2,gas:1};return ne.sort((Te,Le)=>Ce[Te.template_details.issue_severity]>Ce[Le.template_details.issue_severity]?-1:Ce[Te.template_details.issue_severity]<Ce[Le.template_details.issue_severity]?1:0),ne},[Y,be]=a.useState(le(x||[])),[de,ye]=a.useState([!0,!0,!0,!0]),[De,ge]=a.useState([!0,!0,!0]),[Me,Ge]=a.useState([!0,!0,!0,!0,!0,!0]),[Fe,se]=a.useState([]),[Z,xe]=a.useState([]),[fe,pe]=a.useState([]),{isOpen:We,onClose:ae,onOpen:Ae}=Ye(),[we,Pe]=a.useState(null),[Qe,G]=a.useState(!0),[Se,ke]=a.useState(!1),[Qr,an]=a.useState(),ln=ee==="viewer",Rt=tt(),[gs]=$e("(min-width: 1350px)"),[cn,Xr]=a.useState([]),[Pl,Ut]=a.useState({placeholder:"Take Action",disabled:""});a.useEffect(()=>{if(x&&J&&J.current_package==="trial"){const ne=x.findIndex(Ce=>Ce.template_details.issue_severity==="gas");x&&x.length&&ne!==-1&&(se([ne]),n({bug_id:x[ne].metric_wise_aggregated_findings[0].bug_id,issue_id:x[ne].issue_id,bug_hash:x[ne].metric_wise_aggregated_findings[0].bug_hash,audit_type:x[ne].metric_wise_aggregated_findings[0].audit_type,bug_status:x[ne].metric_wise_aggregated_findings[0].bug_status,findings:x[ne].metric_wise_aggregated_findings[0].findings,description_details:x[ne].metric_wise_aggregated_findings[0].description_details,template_details:x[ne].template_details,comment:x[ne].metric_wise_aggregated_findings[0].comment,issue_description:x[ne].metric_wise_aggregated_findings[0].issue_description,issue_remediation:x[ne].metric_wise_aggregated_findings[0].issue_remediation,wait_to_scroll:1e3}))}else x&&x.length&&x[0].metric_wise_aggregated_findings&&(se([0]),n({bug_id:x[0].metric_wise_aggregated_findings[0].bug_id,issue_id:x[0].issue_id,audit_type:x[0].metric_wise_aggregated_findings[0].audit_type,bug_hash:x[0].metric_wise_aggregated_findings[0].bug_hash,bug_status:x[0].metric_wise_aggregated_findings[0].bug_status,findings:x[0].metric_wise_aggregated_findings[0].findings,description_details:x[0].metric_wise_aggregated_findings[0].description_details,template_details:x[0].template_details,comment:x[0].metric_wise_aggregated_findings[0].comment,issue_description:x[0].metric_wise_aggregated_findings[0].issue_description,issue_remediation:x[0].metric_wise_aggregated_findings[0].issue_remediation}))},[]),a.useEffect(()=>{x&&be(x)},[x]),a.useEffect(()=>{let ne=!1,Ce=[];const Te=Z.flatMap(Le=>Le.bugs||[]).map(Le=>(Le.hasOwnProperty("findings")&&Ce.push(...Le.findings),Le.bug_hash));if(Ce.forEach(Le=>{Le.hasOwnProperty("ai_tagged_status")&&(ne=!0)}),i(ne),pe(Te),Z.length===1&&Z[0].bugs){const Le=Z[0].bugs.map(Ft=>Ft.bug_status),Ze=Array.from(new Set(Le));Ze.length===1&&Ze[0]!=="pending_fix"?Ut({placeholder:Ze[0],disabled:Ze[0]}):Ze.length>1?Ut({placeholder:"Take Action",disabled:""}):Ut({placeholder:"Take Action",disabled:"pending_fix"})}else Ut({placeholder:"Take Action",disabled:""})},[Z]),a.useEffect(()=>{s&&(be(ne=>ne.map(Te=>{if(Te.issue_id===s.issue_id){const Le=Te.metric_wise_aggregated_findings.map(Ze=>s.bug_id===Ze.bug_id&&s.bug_status==="wont_fix"?{...Ze,comment:s.comment}:Ze);return{...Te,metric_wise_aggregated_findings:Le}}return Te})),h({file_path:s.findings[0].file_path,original_file_path:s.findings[0].file_path,cleaned_file_path:s.findings[0].file_path}))},[s]),a.useEffect(()=>{const ne=ee==="viewer";fe&&fe.length&&!ne?G(!1):G(!0)},[fe]),a.useEffect(()=>{Se&&setTimeout(()=>{const ne=document.getElementById("detailed_filter")?.getBoundingClientRect().height;an(ne)},300)},[Se]),a.useEffect(()=>{(async()=>{const{data:Ce}=await Re.get(Ie.API_GET_FILES,{params:{scan_id:v,project_id:W}});Ce.status==="success"?V(Ce.data.files):Rt({title:"Error loading file content",status:"error",duration:3e3,isClosable:!0})})()},[W,v,Rt]);const Kr=ne=>{if(!ne||!ne.trim())return{line_nos_start:[Number(o)||1],line_nos_end:[Number(y)||1e3]};const Ce=ne.match(/(\d+)\s*-\s*(\d+)/g);if(Ce&&Ce.length>0){const Te=[],Le=[];return Ce.forEach(Ze=>{const Ft=Ze.match(/(\d+)\s*-\s*(\d+)/);
89Ft&&(Te.push(Number(Ft[1])),Le.push(Number(Ft[2])))}),{line_nos_start:Te,line_nos_end:Le}}return{line_nos_start:[Number(o)||1],line_nos_end:[Number(y)||1e3]}},Zr=ne=>{ne.file_path=ne.original_file_path,h(ne),C()},un=$.filter(ne=>ne.cleaned_file_path.toLowerCase().includes(M.toLowerCase())),Jr=()=>e.jsxs(S,{direction:"row",h:"100%",w:"100%",children:[e.jsxs(z,{w:"30%",borderRight:"1px solid #E2E8F0",h:"100%",className:"file-explorer-sidebar",display:"flex",flexDirection:"column",children:[e.jsx(z,{p:2,borderBottom:"1px solid #E2E8F0",children:e.jsxs(Ai,{size:"sm",children:[e.jsx(Ri,{pointerEvents:"none",children:e.jsx(Ji,{color:"#A0AEC0",size:14})}),e.jsx(fr,{placeholder:"Search files...",value:M,onChange:ne=>N(ne.target.value),bg:"white",border:"1px solid #E2E8F0",borderRadius:"6px",fontSize:"14px",_placeholder:{color:"#A0AEC0"},_focus:{borderColor:"#3182CE",boxShadow:"0 0 0 1px #3182CE"}}),M&&e.jsx(Fi,{children:e.jsx(He,{"aria-label":"Clear search",icon:e.jsx(eo,{}),size:"xs",variant:"ghost",onClick:()=>N(""),_hover:{bg:"gray.100"},color:"gray.500"})})]})}),e.jsx(z,{overflowY:"auto",flex:"1",p:2,children:un.length===0&&M?e.jsx(z,{p:4,textAlign:"center",children:e.jsxs(_,{color:"gray.500",fontSize:"14px",children:['No files found matching "',M,'"']})}):un.map((ne,Ce)=>e.jsx(z,{p:2,cursor:"pointer",_hover:{bg:"#f5f5f5"},bg:d?.cleaned_file_path===ne.cleaned_file_path||d?.cleaned_file_path===`/${ne.cleaned_file_path}`||`/${d?.cleaned_file_path}`===ne.cleaned_file_path?"#E9EEF3":"transparent",onClick:()=>Zr(ne),transition:"background 0.2s",mb:1,position:"relative",borderLeft:d?.cleaned_file_path===ne.cleaned_file_path||d?.cleaned_file_path===`/${ne.cleaned_file_path}`||`/${d?.cleaned_file_path}`===ne.cleaned_file_path?"3px solid #000":"3px solid transparent",children:e.jsxs(re,{spacing:2,children:[e.jsx(bl,{size:16,color:"#cbd6df"}),e.jsx(_,{fontSize:"14px",fontWeight:400,noOfLines:1,children:ne.cleaned_file_path.split("/").pop()})]})},Ce))})]}),e.jsx(z,{w:"70%",h:"100%",className:"file-content-viewer",overflowY:"auto",sx:{"&::-webkit-scrollbar":{display:"none"},"-ms-overflow-style":"none",scrollbarWidth:"none"},bg:"#F3F3F3BF",children:d?b?e.jsx(S,{justify:"center",align:"center",h:"100%",children:e.jsx(Ti,{size:"xl",color:"blue.500",thickness:"4px"})}):e.jsxs(z,{display:"flex",flexDirection:"column",h:"100%",bg:"#F3F3F3BF",children:[e.jsxs(z,{position:"sticky",top:"0",bg:"F3F3F3BF",zIndex:"1",children:[e.jsx(Mr,{file:d,setCurrentFile:h,currentFile:d,isAudit:!0}),e.jsx(ut,{mb:4})]}),e.jsx(z,{overflowY:"auto",h:"calc(100% - 50px)",sx:{"&::-webkit-scrollbar":{display:"none"},"-ms-overflow-style":"none",scrollbarWidth:"none"},children:e.jsx(Gr,{file:{file_path:d.cleaned_file_path,...Kr(D)},type:k,wait_to_scroll:0,focusColor:L,auditMode:!0,issueSeverity:K})})]}):e.jsxs(S,{justify:"center",align:"center",h:"100%",direction:"column",children:[e.jsx(_,{color:"gray.500",mb:2,children:"Select a file from the explorer to view its content"}),e.jsx(_,{color:"gray.400",fontSize:"sm",children:"Files are listed in the left panel"})]})})]});if(!X||!J||!F)return null;const dn=async(ne,Ce)=>{if(s){if(ne==="create_github_issue")ei();else{const{data:Te}=await Re.post(Ie.API_UPDATE_BUG_STATUS,{bug_ids:fe,scan_id:v,project_id:W,bug_status:ne,comment:Ce,scan_type:k});Te.status==="success"&&(Rt({title:ne==="comment"?"Your comment has been successfully added to the bug.":"Bug Status Updated",description:Te.message,status:"success",duration:3e3,isClosable:!0}),Ce&&n({...s,comment:Ce}),H())}pe([])}},ei=async()=>{if(Z&&Z.length===1){const ne={issue_id:Z[0].issue_id,issue_title:Z[0].template_details.issue_name,repo_url:B,bugs:Z[0].bugs?.map(Te=>({id:Te.bug_id,description:Z[0].template_details.issue_description?it(Z[0].template_details.issue_description,{...Te.description_details}):"",remediation:Z[0].template_details.issue_remediation?it(Z[0].template_details.issue_remediation,{...Te.description_details}):"",code_snapshot:B&&g?Te.findings.map(Le=>os(B,g,Le)).join(", "):""}))},{data:Ce}=await Re.post(Ie.API_CREATE_BUGS_ISSUE,ne);Ce&&Ce.issue_id&&B&&Rt({title:`Issue created successfully on ${ze(B)}`,status:"success",duration:5e3,isClosable:!0,position:"bottom"})}},pn=ne=>{we&&dn(we,ne)};return e.jsxs(Ke.Provider,{value:{type:k,selectedIssues:Z,setSelectedIssues:xe,selectedBugs:fe,issues:Y,scanSummary:F,files:s,setFiles:n,restrictedBugIds:cn,setRestrictedBugIds:Xr,openIssueIndex:Fe,setOpenIssueIndex:se,isViewer:ln,updateBugStatus:dn,scanReport:X.scan_report},children:[e.jsx(S,{w:"100%",h:["100%","100%","100%","calc(100vh - 195px)"],maxH:["100%","100%","100%","1000px"],sx:{flexDir:"column"},bg:"white",borderRadius:15,p:2,overflow:"hidden",children:e.jsxs(ps,{index:l,onChange:u,variant:"unstyled",w:"100%",h:"100%",children:[e.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:"0",children:[e.jsxs(hs,{mb:"0",children:[e.jsx(lt,{textTransform:"uppercase",fontSize:"14px",fontWeight:500,color:l===0?"black":"gray.400",_selected:{color:"black"},_hover:{color:l===0?"black":"gray.600"},px:6,py:3,position:"relative",_after:{content:'""',position:"absolute",bottom:"0",left:"10%",right:"10%",height:"2px",width:"100%",bgColor:l===0?"#3300FF":"transparent"},onClick:()=>{f(!1),Q("")},children:"DETECTORS"}),e.jsx(lt,{textTransform:"uppercase",fontSize:"14px",fontWeight:500,color:l===1?"black":"gray.400",_selected:{color:"black"},_hover:{color:l===1?"black":"gray.600"},px:6,py:3,position:"relative",_after:{content:'""',position:"absolute",bottom:"0",left:"10%",right:"10%",height:"2px",width:"100%",bgColor:l===1?"#3300FF":"transparent"},onClick:()=>{Q("")},children:"Explorer"})]}),e.jsx(je,{size:"sm",bg:"#F4F1FF",color:"#3300FF",fontSize:"14px",fontWeight:400,borderRadius:"5px",width:"167px",height:"29px",_hover:{bg:"#E9E1FF"},_active:{bg:"#DDD1FF"},onClick:()=>{u(1),f(!0)},children:"+ Add New Bug"})]}),e.jsxs(fs,{h:"calc(100% - 55px)",pt:4,children:[e.jsx(ct,{p:0,h:"100%",children:e.jsxs(S,{w:"100%",h:"100%",sx:{flexDir:["column","column","column","row"]},children:[e.jsxs(ue,{w:["100%","100%","100%","35%"],h:["fit-content","fit-content","fit-content","100%"],spacing:4,mb:[8,8,8,0],pr:[0,0,0,1],alignItems:"flex-start",borderRight:"1px solid #E2E8F0",children:[e.jsx(wr,{critical:O,high:oe,medium:te,low:ce,informational:ie,gas:_e,setFilterExpanded:ke,setVulnerability:Ge,setConfidence:ge,setBugStatusFilter:ye}),e.jsx(z,{w:"100%",h:["fit-content","fit-content","fit-content","auto"],p:0,px:1,sx:{overflow:"scroll","::-webkit-scrollbar-thumb":{background:"transparent"}},_hover:{"::-webkit-scrollbar-thumb":{background:"#88888880"},"::-webkit-scrollbar-thumb:hover":{background:"#888888"}},children:e.jsx(Hr,{is_latest_scan:U,confidence:De,vulnerability:Me,bugStatusFilter:de,auditMode:t,issueSeverity:K,setIssueSeverity:Q})})]}),gs&&e.jsx(_s,{is_latest_scan:U,isAiBugSelected:r,auditMode:t})]})}),e.jsx(ct,{p:0,h:"100%",children:Jr()})]})]})}),we==="create_github_issue"?e.jsx(It,{isOpen:We,onClose:ae,onActionConfirm:pn,addComment:!1,modalHeader:"Confirm Action",modelText:e.jsxs(ue,{children:[e.jsx(_,{my:4,w:["100%"],fontSize:"lg",fontWeight:600,children:`Are you sure you want to update the Issue to ${B?ze(B):"Github"}?`}),e.jsxs(_,{my:4,color:"detail",fontWeight:400,w:["100%"],children:["You are about to create a"," ",e.jsx(_,{as:"span",color:"black",fontWeight:"bold",children:`${B?ze(B):"Github"} Issue`})," ","for selected"," ",e.jsx(_,{as:"span",color:"black",fontWeight:"bold",children:fe.length})," ","bug(s). Please click on confirm to create an issue."]})]})}):e.jsx(It,{isOpen:We,onClose:ae,onActionConfirm:pn,addComment:!0,modalHeader:"Confirm Action",modelText:e.jsxs(z,{my:4,w:"100%",children:[we&&we!=="comment"?e.jsxs(_,{color:"subtle",w:["100%"],children:["You are about to confirm the"," ",e.jsx(_,{as:"span",color:"black",fontWeight:"bold",children:qs[we]})," ","action on"," ",e.jsx(_,{as:"span",color:"black",fontWeight:"bold",children:fe.length})," ","bug(s)."]}):null,e.jsx(_,{color:"subtle",w:["100%"],children:"Please add your comment below and click on confirm to continue."})]})}),e.jsx(vl,{isOpen:E,onClose:()=>{C()},updateScanIssue:!0,onSuccessCallback:()=>{H()},startLineNumber:o,endLineNumber:y,setStartLineNumber:m,setEndLineNumber:w,codeLocation:D,setCodeLocation:R,setFocusColor:P,selectedFile:d,issueSeverity:K,setIssueSeverity:Q,userUuid:J.user_uuid})]})};function Sl(){const{isOpen:t,onOpen:s,onClose:n}=Ye(),{projectType:r,projectId:i}=Ve(),l=Hs(),u=Ms(),h=new URLSearchParams(u.search).get("view"),p=r.replace(/s$/,""),{scanData:c,reportList:b,refetchScanDetail
89s:j}=a.useContext(et),{profileData:E,role:f}=qe(),[o,m]=a.useState(h||"details"),[y,w]=a.useState(0),[D,R]=a.useState(null),[L,P]=a.useState(!1),$=a.useRef(null),V=()=>{const H="consultationModalLastShown",q=new Date().toDateString(),W=localStorage.getItem(H);return!W||W!==q},M=()=>{const H="consultationModalLastShown",q=new Date().toDateString();localStorage.setItem(H,q)},[N,K]=a.useState([{label:"Published Reports",icon:e.jsx(Be,{}),hoverIcon:e.jsx(Be,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})},{label:"Custom Settings",icon:e.jsx(nt,{}),hoverIcon:e.jsx(nt,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})},{label:"Scan History",icon:e.jsx(rt,{}),hoverIcon:e.jsx(rt,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})}]);if(a.useEffect(()=>{const H=E?.current_package;return H&&!["trial","beginner","expired"].includes(H)&&l?.REACT_APP_FEATURE_GATE_CONFIG?.enable_consultation_modal&&V()&&y===0&&($.current=setTimeout(()=>{s()},1e3)),()=>{$.current&&clearTimeout($.current)}},[s,E?.current_package,l,y]),a.useEffect(()=>{if(c)if(p==="block"){let H=[{label:"Published Reports",icon:e.jsx(Be,{}),hoverIcon:e.jsx(Be,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})}];E?.current_package==="custom"&&(H.push({label:"Custom Settings",icon:e.jsx(nt,{}),hoverIcon:e.jsx(nt,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})}),H.push({label:"Scan History",icon:e.jsx(rt,{}),hoverIcon:e.jsx(rt,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})})),K(H)}else if(c.scan_report.project_url==="File Scan"){let H=[{label:"Published Reports",icon:e.jsx(Be,{}),hoverIcon:e.jsx(Be,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})}];(c.scan_report.project_zip_files?.length&&f!=="viewer"||E?.current_package==="custom")&&H.push({label:"Custom Settings",icon:e.jsx(nt,{}),hoverIcon:e.jsx(nt,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})}),K(H)}else f==="viewer"&&K([{label:"Published Reports",icon:e.jsx(Be,{}),hoverIcon:e.jsx(Be,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})},{label:"Scan History",icon:e.jsx(rt,{}),hoverIcon:e.jsx(rt,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})}])},[f,c,p]),!c||!E||!b)return null;const Q=()=>E?._integrations?.github?.status==="successful"||E?._integrations?.gitlab?.status==="successful"||E?._integrations?.bitbucket?.status==="successful",J=H=>{w(H)},ee=()=>{m("details"),J(0)},X=()=>{n(),M()};return e.jsx(z,{w:"100%",mt:2,children:(c.scan_report.scan_status==="scanning"||c.scan_report.scan_status==="initialised")&&!c.scan_report.scan_message.startsWith("Insufficient LoCs")?e.jsxs(S,{w:"100%",h:"60vh",alignItems:"center",justifyContent:"center",flexDirection:"column",children:[e.jsxs(S,{sx:{display:"inline-flex",bg:"bg.subtle",alignItems:"center",p:2,mb:2,borderRadius:15},children:[e.jsx(xi,{size:15}),e.jsx(_,{mx:2,fontSize:"sm",children:"Scan in progress..."})]}),e.jsx(nr,{value:30,width:"400px",mb:10,isIndeterminate:!0,size:"sm"})]}):e.jsxs(z,{w:"100%",position:"relative",children:[o==="details"?e.jsxs(ps,{index:y,onChange:J,variant:"soft-rounded",colorScheme:"green",w:"100%",mt:[14,14,14,0],isLazy:!0,children:[e.jsx(S,{width:"100%",overflow:"auto",flexDir:"row",justifyContent:"flex-start",align:"center",ml:0,zIndex:1,sx:{scrollbarWidth:"none","::-webkit-scrollbar":{display:"none"}},children:e.jsxs(hs,{sx:{px:2,py:3,w:"fit-content",mt:[2,2,2,0]},children:[e.jsx(lt,{fontSize:"sm",h:"35px",minW:"120px",bgColor:"#F5F5F5",children:"Overview"}),e.jsx(lt,{fontSize:"sm",h:"35px",minW:"150px",bgColor:"#F5F5F5",ml:4,whiteSpace:"nowrap",children:"Vulnerability Scan"}),e.jsx(lt,{fontSize:"sm",h:"35px",minW:"150px",bgColor:"#F5F5F5",ml:4,whiteSpace:"nowrap",children:"Threat Scan"})]})}),!["trial","beginner","expired"].includes(E?.current_package)&&y===0&&e.jsxs(z,{display:"flex",alignItems:"center",p:2,px:4,my:2,borderRadius:"md",border:"1px solid #e2e8f0",boxShadow:"sm",position:"relative",cursor:"pointer",onClick:s,_hover:{boxShadow:"md"},children:[e.jsx(z,{position:"absolute",top:"-8px",left:"10px",bg:"#52FF00",color:"black",fontSize:"11px",fontWeight:"600",px:2,py:0,borderRadius:"md",fontFamily:"monospace",children:"Free"}),e.jsxs(S,{align:"center",width:"100%",justify:"space-between",children:[e.jsxs(S,{align:"center",children:[e.jsx(he,{src:`${Ee()}free_consultation/video_cam.svg`,boxSize:5,mr:2}),e.jsxs(_,{fontSize:"16px",fontWeight:"600",children:["Expert Video Consultation"," ",e.jsxs(_,{as:"span",fontWeight:"normal",color:"gray.600",fontSize:"14px",display:["none","inline","inline","inline"],children:[":"," "]}),e.jsx(_,{as:"span",fontWeight:"normal",color:"gray.600",fontSize:"14px",display:["none","inline","inline","inline"],children:"Schedule a free call with our security experts to review results and improve the contract's security."})]})]}),e.jsx(Ue,{as:yr,boxSize:5,color:"#3300FF",sx:{borderRadius:"50%",backgroundColor:"white"}})]})]}),!["trial","beginner","expired"].includes(E?.current_package)&&l?.REACT_APP_FEATURE_GATE_CONFIG?.enable_consultation_modal&&e.jsx(xl,{isOpen:t,onClose:X}),e.jsxs(fs,{borderRadius:15,pt:2,minH:"calc(100vh - 295px)",children:[e.jsx(ct,{p:0,backgroundColor:"#fafafa",children:c.scan_report.multi_file_scan_status==="scan_done"&&(c.scan_report.multi_file_scan_summary||c.scan_report.scan_summary)?e.jsx(ko,{scansRemaining:E.credits,scanData:c.scan_report,onTabChange:J}):e.jsx(Fs,{scanData:c})}),e.jsx(ct,{p:0,children:!c.scan_report?.is_verified_scan&&!c.scan_report?.multi_file_scan_details?.length&&p==="block"?e.jsx(z,{bg:"white",borderRadius:15,px:6,py:5,h:["100%","100%","100%","58vh"],maxH:["100%","100%","100%","1000px"],children:e.jsx(Gi,{theme:"light",platform:c.scan_report?.contract_platform,chain:c.scan_report?.contract_chain,address:c.scan_report?.contract_address})}):c.scan_report.multi_file_scan_status==="scan_done"&&c.scan_report.multi_file_scan_details&&c.scan_report.multi_file_scan_summary?L?e.jsx(wl,{auditMode:L}):e.jsx(dl,{auditMode:L}):e.jsx(Fs,{scanData:c})}),e.jsx(ct,{p:0,children:c.scan_report.quick_file_scan_details?e.jsx(S,{w:"100%",h:["100%","100%","100%","calc(100vh - 195px)"],borderRadius:15,pb:4,pr:[0,0,0,6],overflowY:["auto","auto","auto","scroll"],overflowX:"hidden",position:"relative",_hover:{"::-webkit-scrollbar-thumb":{background:"#88888880"},"::-webkit-scrollbar-thumb:hover":{background:"#888888"}},sx:{"::-webkit-scrollbar-thumb":{background:"transparent"}},children:e.jsx(Xi,{scanReport:c.scan_report,projectId:i,isCodeLocked:!1,refetchScanDetail
89s:j})}):e.jsx(Fs,{scanData:c})})]})]}):e.jsxs(S,{w:"100%",flexDir:"column",py:2,maxH:"calc(100vh - 235px)",minH:"calc(100vh - 235px)",children:[e.jsxs(S,{color:"#B0B7C3",alignItems:"center",letterSpacing:1,cursor:"pointer",ml:6,onClick:()=>m("details"),children:[e.jsx(mr,{mr:1,boxSize:5}),"back"]}),e.jsxs(z,{w:"100%",h:"100%",py:4,children:[e.jsx(_,{fontWeight:600,color:"detail",mb:4,ml:6,mt:2,children:o}),o==="Published Reports"?e.jsx(Yr,{profile:E,scan_report:c.scan_report,reportList:b.reports,type:p}):o==="Custom Settings"&&(c.scan_report.project_skip_files&&c.scan_report.project_url||c.scan_report.contract_url||r==="block")?e.jsx(qr,{project_skip_files:c.scan_report?.project_skip_files||[],project_zip_files:c.scan_report?.project_zip_files||[],project_branch:c.scan_report.project_branch||c.scan_report.project_commit_id,webhook_enabled:c.webhook_enabled?c.webhook_enabled:!1,skipped_detectors:c.scan_report.skipped_detectors,project_url:c.scan_report.project_url||"",project_id:c.scan_report.project_id,isGithubIntegrated:Q(),scanId:c.scan_report.scan_id,currentPackage:E.current_package,project_type:r,integrations:E._integrations,checkMarxProject:c.scan_report.checkmarx_project||void 0,refetchScanDetails:j}):o==="Scan History"&&c.scan_report&&e.jsx(Ur,{project_url:c.scan_report.project_url,project_branch:c.scan_report.project_branch,project_id:i,scan_id:c.scan_report.scan_id,profile:E,onScanClick:ee})]})]}),o==="details"&&e.jsx(S,{w:["100%","100%","100%","fit-content"],position:"absolute",top:[-10,-10,-10,2],left:["auto"],right:["auto","auto","auto",2],justifyContent:["center","center","center","flex-end"],children:e.jsxs(re,{spacing:4,zIndex:2,cursor:"pointer",position:"relative",align:"center",children:[y===1&&E.current_package==="custom"&&e.jsxs(S,{alignItems:"center",mr:2,children:[e.jsxs(_,{fontSize:"sm",color:"black",mr:2,children:["Auditor Mode : ",L?"On":"Off"]}),e.jsx(Di,{variant:"brand-checked",size:"md",isChecked:L,onChange:H=>P(H.target.checked),sx:{"& .chakra-switch__track":{backgroundColor:"white",border:"1px solid #E2E8F0"}}})]}),N.map((H,q)=>e.jsx(Oe,{label:H.label,children:e.jsx(He,{bg:"transparent",p:0,"aria-label":H.label,icon:D===q?H.hoverIcon:H.icon,onClick:()=>{m(H.label),R(null)},onMouseEnter:()=>R(q),onMouseLeave:()=>R(null),_hover:{bg:"transparent"},_active:{bg:"transparent"}})},q))]})})]})})}const Fs=({scanData:t})=>e.jsxs(S,{w:"97%",m:4,borderRadius:"20px",bgColor:"high-subtle",p:4,children:[e.jsx(Yn,{size:28}),e.jsx(_,{fontSize:"xs",color:"high",ml:4,children:t.scan_report.multi_file_scan_status?t.scan_report.multi_file_scan_status:t.scan_report.scan_message||"Please do Rescan to carry out a Multifile Scan "})]}),Cl=({scanId:t})=>{const[s]=$e("(min-width: 1350px)");Ee();const{projectType:n}=Ve(),r=n?.replace(/s$/,"")||"project",[i,l]=a.useState(!0),[u,d]=a.useState(0),h=a.useRef(null),p=a.useRef(!0),{scanProgress:c}=xt();return a.useEffect(()=>{p.current=!0;const b=new IntersectionObserver(([E])=>{p.current&&l(E.isIntersecting)},{threshold:.1});return h.current&&b.observe(h.current),(async()=>{if(t)try{const{data:E}=await Re.post(Ie.API_PROGRESS_SCAN,{scanId:t});E?.progress&&d(E.progress)}catch(E){console.error("Error fetching initial progress:",E)}})(),()=>{p.current=!1,h.current&&b.unobserve(h.current)}},[]),a.useEffect(()=>{c&&c[t]!==void 0&&d(b=>c[t]>b?c[t]:b)},[c,t]),e.jsxs(S,{w:"100%",flexDir:"column",bg:"white",borderRadius:15,p:6,pl:0,position:"relative",children:[e.jsxs(S,{w:"100%",mb:4,pl:8,flexDir:["column","column","column","row"],alignItems:"center",opacity:[1,1,1,i?1:0],transition:"opacity 0.3s ease-in",children:[e.jsxs(S,{justifyContent:"flex-start",alignItems:"center",gap:4,w:"100%",children:[e.jsx(Ps,{size:"50px"}),e.jsxs(S,{flexDir:"column",gap:2,children:[e.jsxs(S,{justifyContent:"flex-start",alignItems:"center",gap:4,children:[e.jsx(st,{height:"17px",width:"206px",borderRadius:"md"}),e.jsxs(S,{justifyContent:"space-between",alignItems:"center",gap:2,children:[e.jsx(_,{fontSize:"13px",color:"#4E5D78",fontWeight:"small",children:"Scan in progress ..."}),e.jsxs(S,{fontSize:"12px",color:"#3300FF",fontWeight:500,fontFamily:"JetBrains Mono, monospace",letterSpacing:"0.02em",alignItems:"flex-end",gap:"5px",children:[e.jsx(_,{fontSize:"18px",children:u&&u?`${u}%`:"0%"})," ",e.jsx(_,{pb:"2px",children:"COMPLETED"})]})]})]}),e.jsx(st,{height:"7px",width:"424px",borderRadius:"md"})]})]}),e.jsx(z,{ml:"auto",mr:4,children:e.jsx(st,{height:"38px",width:"150px",borderRadius:"md"})})]}),e.jsxs(S,{w:["100%","100%","100%","85%"],maxW:["100%","100%","100%","850px"],alignItems:["flex-start","flex-start","flex-start","center"],flexDir:["column","column","column","row"],opacity:[1,1,1,i?1:0],pl:8,transition:"opacity 0.3s ease-in",children:[e.jsx(Oe,{label:"Rescan","aria-label":"A tooltip",mt:2,display:r==="project"?"block":"none",children:e.jsxs(S,{ml:[-4,-4,-4,-2.5],c
89olor:"detail",sx:{alignItems:"center"},flexDir:["row","row","row","column"],children:[e.jsx(je,{id:"ss-rescan",size:"sm",colorScheme:"white",transition:"0.3s opacity",height:"56px",width:"56px",mr:[0,0,0,8],visibility:r==="project"?"visible":"hidden",display:r==="project"?"block":["none","none","none","block"],isDisabled:!0,opacity:.4,children:e.jsx(Gs,{size:47})}),!s&&r==="project"&&e.jsx(_,{ml:4,letterSpacing:2,fontWeight:700,children:"Rescan"})]})}),e.jsx(zs,{theme:"transparent",page:"scan_overview",showLabel:!0,iconSize:20})]}),e.jsxs(S,{w:"97%",mb:4,pl:6,alignItems:"center",position:"absolute",top:"72px",left:"calc(auto - 40px)",display:["none","none","none","flex"],visibility:i?"hidden":"visible",pointerEvents:i?"none":"all",opacity:i?0:1,bg:"white",borderBottomRadius:15,transition:"top 0.3s ease-in-out, visibility 0.3s ease-in, opacity 0.3s ease-out",zIndex:10,pt:3,children:[e.jsx(Ps,{size:"50px"}),e.jsxs(ue,{ml:[4,4,4,7],alignItems:"flex-start",justifyContent:"flex-start",spacing:-1,children:[e.jsxs(re,{spacing:4,children:[e.jsx(st,{height:"24px",width:"200px"}),r==="block"&&e.jsx(st,{height:"24px",width:"80px",borderRadius:"md"}),e.jsx(st,{height:"24px",width:"120px",borderRadius:3})]}),e.jsx(zs,{theme:"transparent",page:"scan_overview",showLabel:!1,iconSize:20})]}),e.jsx(z,{ml:"auto",mr:4,children:e.jsx(st,{height:"38px",width:"150px",borderRadius:"md"})})]})]})},kl=({issue_severity_distribution:t,issue_count:s,theme:n="dark",size:r="330px",textFontSize:i="md"})=>e.jsx(z,{w:r,h:r,display:"flex",justifyContent:"center",alignItems:"center",position:"relative",children:e.jsxs(e.Fragment,{children:[e.jsx(Hi,{data:[{id:"critical",label:"NA",value:34,color:"#4d4d4d"},{id:"high",label:"NA",value:49,color:"#757575"},{id:"medium",label:"NA",value:65,color:"#a1a1a1"},{id:"low",label:"NA",value:77,color:"#c9c9c9"}],page:"quickscan",isInteractive:!1}),e.jsxs(ue,{position:"absolute",flexDir:"column",children:[e.jsx(ot,{w:"100px",noOfLines:1,skeletonHeight:"4"}),e.jsx(ot,{w:"150px",noOfLines:2,skeletonHeight:"2"})]})]})}),Il=({item:t,count:s,onClick:n,theme:r="dark"})=>e.jsxs(ls,{placement:"left",trigger:"hover",children:[e.jsx(cs,{children:e.jsxs(ue,{h:"fit-content",w:"100%",cursor:"pointer",px:3,py:1,bgColor:r==="light"?"#F8F8F8":"#3E3E3E",_hover:{bgColor:r==="light"?"#F8F8F8":"#4d4d4d"},border:r==="light"?"none":"1px solid #3E3E3E",spacing:1,borderRadius:5,alignItems:"flex-start",children:[e.jsxs(re,{children:[e.jsx(ut,{h:3,orientation:"vertical",borderColor:t.value,borderWidth:2,opacity:r==="light"?1:.6}),e.jsxs(_,{color:r==="light"?"subtle":"#8A94A6",fontSize:"xs",children:[is(t.value),e.jsx(ot,{w:"50px",noOfLines:1,skeletonHeight:"2"})]})]}),e.jsx(_,{color:r==="light"?"text":"white",fontWeight:600,children:e.jsx(ot,{w:"20px",noOfLines:1,skeletonHeight:"2"})})]})}),e.jsx(us,{borderRadius:15,border:"none",sx:{boxShadow:"0px 4px 24px rgba(0, 0, 0, 0.2) !important"},p:2,children:e.jsxs(ds,{textAlign:"left",children:[e.jsxs(re,{children:[e.jsx(ut,{h:3,orientation:"vertical",borderColor:t.value,borderWidth:2,opacity:1}),e.jsx(_,{children:e.jsx(ot,{w:"50px",noOfLines:1,skeletonHeight:"2"})})]}),e.jsx(_,{color:"detail",fontWeight:400,fontSize:"sm",mt:3,children:e.jsx(ot,{w:"50px",noOfLines:1,skeletonHeight:"2"})})]})})]}),El=a.lazy(()=>I(()=>import("./vendor-lottie-Bga_Bk1l.js"),__vite__mapDeps([167,1])));function Al(t){const{scanReport:s,threat_score:n,isDownload:r=!1,isReportView:i=!1,tsSupported:l="yes",handleTabsChange:u}=t,d=Ee(),[h]=$e("(min-width: 1350px)"),[p,c]=a.useState([{label:"High Risk",icon:"",count:0},{label:"Moderate Risk",icon:"",count:0},{label:"Low Risk",icon:"",count:0},{label:"No Impact",icon:"",count:0},{label:"Beneficial",icon:"",count:0},{label:"Unavailable",icon:"",count:0}]);let b={color:"#4E5D78",risk:"Calculating..."};const[j,E]=a.useState();return a.useEffect(()=>{const f=s&&s.quick_file_scan_details?s.quick_file_scan_details.reduce((m,y)=>{const{issue_severity:w,issue_status:D,is_tagged_via_card:R}=y;return w&&!R&&(m[D==="skipped"?"Unavailable":w]=(m[D==="skipped"?"Unavailable":w]||0)+1),m},{}):{},o=p.map(m=>({...m,count:s?.multi_file_scan_summary?.threat_scan_risk_vs_modules_count?s?.multi_file_scan_summary?.threat_scan_risk_vs_modules_count[m.label]||0:f?.[m.label]||0}));if(c(o),s&&s.quick_file_scan_details){const m=s.quick_file_scan_details.filter(y=>y.issue_id==="QUICK_SCAN_CREATOR_INFORMATION");m&&m.length&&E(m[0])}},[s]),e.jsxs(z,{w:"100%",borderRadius:15,background:"white",py:4,px:[4,4,4,6],children:[e.jsxs(S,{w:"100%",py:4,borderBottom:"1px solid #ECECEC",children:[e.jsx(_,{fontSize:"lg",fontWeight:700,children:"THREAT ANALYSIS"}),e.jsxs(S,{ml:"auto",mr:6,children:[e.jsx(_,{color:"detail",fontSize:"sm",fontWeight:400}),u?e.jsx(S,{w:"100%",justifyContent:["center","center","center","end"],children:e.jsx(bt,{id:"ss-threat-scan",variant:"accent",fontSize:"sm",fontWeight:600,opacity:.3,children:"Threat Scan Results â¶"})}):null]})]}),e.jsxs(S,{w:"100%",h:"fit-content",flexDir:["column","column","column","row"],children:[e.jsx(S,{w:["100%","100%","100%","65%"],flexDir:r?"row":["column","column","column","row"],bg:"white",borderRadius:15,py:r||!i?4:[1,1,1,4],children:e.jsxs(S,{w:"100%",bg:"#FAFBFC",borderRadius:15,flexDir:"column",alignItems:["center","center","center","flex-start"],px:2,py:4,children:[e.jsx(re,{mb:r||!i?4:[2,2,2,4],px:2,w:"100%",children:e.jsx(_,{color:"detail",fontSize:r||!i?"sm":["8px","8px","sm"],children:"Threat Score"})}),e.jsxs(S,{alignItems:["center","center","center","center"],flexDir:["column","column","column","row"],justifyContent:"center",pt:r?6:[10,10,10,6],pb:r?6:[4,4,4,6],pl:[0,0,0,4],bg:"white",w:"100%",borderRadius:15,children:[e.jsx(S,{flexDir:"column",alignItems:"center",mt:-4,children:e.jsx(z,{width:r||!i||h?"180px":"80px",height:r||!i||h?"90px":"40px",children:e.jsx(a.Suspense,{fallback:e.jsx(z,{w:"100%",h:"100%",bg:"gray.800",borderRadius:"md",mx:"auto"}),children:e.jsx(El,{style:{width:r||!i||h?"180px":"80px",height:r||!i||h?"180px":"80px",marginTop:"-10px"},animationData:xo})})})}),e.jsxs(ue,{ml:[0,0,0,8],mr:[4,4,4,8],mt:[4,4,4,0],mb:[-4,-4,-4,-2],spacing:0,h:"fit-content",alignItems:["center","center","center","flex-start"],children:[e.jsx(Pi,{bg:"transparent",whiteSpace:"nowrap",fontSize:r||!i?"lg":["10px","10px","lg"],fontWeight:"700",letterSpacing:1,color:b.color,ml:-1,children:s?.multi_file_scan_summary?.threat_scan_risk_level||b.risk.toUpperCase()}),e.jsxs(_,{fontSize:r||!i?"3xl":["xs","xs","3xl"],fontWeight:"700",children:["00",e.jsx(z,{as:"span",color:"gray.500",fontWeight:400,fontSize:r||!i?"xs":["8px","8px","xs"],children:"/100"})]})]}),e.jsx(S,{flexDir:"column",alignItems:"flex-start",color:"text",w:["100%","100%","100%","50%"],borderLeft:r?"1px solid #F3F3F3":["none","none","none","1px solid #F3F3F3"],pl:r?4:[6,6,6,6],pr:r?0:[4,4,4,6],pt:r?6:[10,10,10,6],pb:4,children:e.jsx(Qs,{templateColumns:"repeat(2, 1fr)",w:"100%",columnGap:1,rowGap:5,children:p.map((f,o)=>e.jsxs(S,{alignItems:"flex-start",children:[e.jsx(he,{src:`${d}quickscan/${f.label}.svg`,mt:.5}),e.jsxs(S,{flexDir:"column",alignItems:"flex-start",ml:2,children:[e.jsx(_,{fontSize:"xs",fontWeight:400,color:"detail",whiteSpace:"nowrap",lineHeight:"16px",children:f.label}),e.jsx(_,{fontWeight:600,children:e.jsx(ot,{w:"50px",skeletonHeight:"2",noOfLines:1})})]})]},o))})})]}),e.jsx(S,{w:"80%",mt:6,pl:[0,0,0,10],children:e.jsx(ot,{w:"100%",noOfLines:2,mt:2,mb:r||i?2:[4,4,4,2]})})]})}),e.jsx(z,{w:["100%","100%","100%","35%"],h:"auto",pl:[0,0,0,4],py:4,children:e.jsx(Ki,{tsModules:s?.t
89s_scan_details,tsSupported:l,isSkeleton:!0})})]})]})}const Rl=({scanData:t,scansRemaining:s,onTabChange:n})=>{t.multi_file_scan_summary?.score_v2?t.multi_file_scan_summary?.score_v2:(parseFloat(t.multi_file_scan_summary?.score)*20).toFixed(2);const r="Calculating....",[i,l]=a.useState(!1);a.useEffect(()=>{setTimeout(()=>{l(!0)},100)},[]);const u=d=>{n(d)};return e.jsxs(e.Fragment,{children:[e.jsxs(S,{w:"100%",sx:{flexDir:["column","column","column","row"]},bg:"white",borderRadius:15,py:4,pl:[3,4,4,6],pr:[3,4,4,0],children:[e.jsxs(S,{w:["100%","100%","100%","45%"],alignItems:"center",flexDir:["column","column","column","row"],pt:[2,2,2,0],children:[e.jsx(kl,{issue_count:0,issue_severity_distribution:{critical:0,high:0,medium:0,low:0,informational:0,gas:0},theme:"light",size:"230px",textFontSize:"xs"}),e.jsx(Qs,{templateColumns:"repeat(2, 1fr)",rowGap:3,columnGap:3,w:["80%","80%","80%","auto"],h:"fit-content",ml:[0,0,0,2],my:[4,4,4,0],children:Un.map((d,h)=>e.jsx(Il,{item:d,count:0,theme:"light",onClick:()=>u(1)},h))})]}),e.jsx(ue,{w:["100%","100%","100%","55%"],alignItems:["center","center","center","flex-start"],pt:2,pl:[0,0,6],pr:[0,0,2],spacing:5,h:["fit-content","fit-content","fit-content"],overflowY:["visible","visible","scroll"],children:e.jsxs(z,{w:"100%",px:[4,4,4,8],py:6,borderRadius:"15px",background:qn(r),children:[e.jsxs(S,{w:"100%",justifyContent:["center","center","center","flex-start"],alignItems:["center","center","center","flex-start"],direction:["column","column","row"],gap:5,children:[e.jsxs(_,{fontSize:"18px",fontWeight:600,display:["block","block","block","none"],mb:[6,6,6,0],children:["Your Security Score is ",r.toUpperCase()]}),e.jsx(Ps,{size:"100px"}),e.jsxs(ue,{alignItems:["center","center","center","flex-start"],px:4,my:[4,4,4,0],textAlign:["center","center","center","left"],children:[e.jsx(_,{fontSize:"18px",fontWeight:600,display:["none","none","none","block"],children:e.jsx(st,{w:"200px",noOfLines:1,h:"20px"})}),e.jsx(_,{color:"subtle",fontSize:"xs",fontWeight:400,children:e.jsx(ot,{w:"300px",noOfLines:6,skeletonHeight:"2"})})]})]}),e.jsx(S,{mt:4,justifyContent:["center","center","center","end"],children:e.jsx(bt,{id:"ss-vuln-results",variant:"accent",fontSize:"sm",fontWeight:600,opacity:.3,children:"Vulnerability Result â¶"})})]})})]}),e.jsx(S,{w:"100%",bg:"white",borderRadius:15,flexDir:"column",mt:[8,8,8,4],mb:[8,8,8,0],children:e.jsx(Al,{scanReport:t,threat_score:"Calculating...",tsSupported:"failed",handleTabsChange:()=>u(2)})})]})},Tt=[{issue_id:"Skeleton",metric_wise_aggregated_findings:[{bug_hash:"Skeleton",bug_id:"Skeleton",bug_status:"Skeleton",comment:"",description_details:{abused_function:"_approve",function_name:"approve"},findings:[{file_path:"Skeleton",line_nos_end:[286],line_nos_start:[282]}],scan_id:"Skeleton"},{bug_hash:"Skeleton",bug_id:"Skeleton",bug_status:"Skeleton",comment:"Skeleton",description_details:{abused_function:"Skeleton",function_name:"_approve"},findings:[{file_path:"Skeleton",line_nos_end:[418],line_nos_start:[416]}],scan_id:"Skeleton"},{bug_hash:"Skeleton",bug_id:"Skeleton",bug_status:"Skeleton",comment:"",description_details:{abused_function:"_approve",function_name:"_spendAllowance"},findings:[{file_path:"Skeleton",line_nos_end:[469],line_nos_start:[459]}],scan_id:"Skeleton"}],no_of_findings:3,template_details:{description_keys:["function_name","abused_function"],impact:"Skeleton",issue_confidence:"Skeleton",issue_description:"Skeleton",issue_gas_count:"0",issue_gas_count_type:"dynamic",issue_id:"Skeleton",issue_name:"Skeleton",issue_remediation:"Skeleton",issue_severity:"high",issue_status:"true",latest_report_id:"",link:"Skeleton",scwe_id:"Skeleton",scwe_title:"Skeleton",static_issue_description:"Skeleton",additional_meta:"Skeleton",aggregation_key:"Skeleton",multi_file_supported:"Skeleton",type:"Skeleton",version:"Skeleton"}}],Fl=()=>{const[t,s]=a.useState(null),[n,r]=a.useState(!1),{profileData:i,role:l}=qe(),{scanData:u,refetchScanDetails:d}=a.useContext(et),{projectType:h,projectId:p,scanId:c}=Ve(),b=h.replace(/s$/,""),{multi_file_scan_summary:j,multi_file_scan_details:E,details_enabled:f,project_url:o,project_branch:m}=u?.scan_report||{},y=u?.is_latest_scan||!0,{issue_severity_distribution:{critical:w=0,high:D=0,medium:R=0,low:L=0,informational:P=0,gas:$=0}={}}=j||{},V=Z=>{const xe={critical:6,high:5,medium:4,low:3,informational:2,gas:1};return Z.sort((fe,pe)=>xe[fe.template_details.issue_severity]>xe[pe.template_details.issue_severity]?-1:xe[fe.template_details.issue_severity]<xe[pe.template_details.issue_severity]?1:0),Z}
89,[M,N]=a.useState(V(Tt||[])),[K,Q]=a.useState([!0,!0,!0,!0]),[J,ee]=a.useState([!0,!0,!0]),[X,H]=a.useState([!0,!0,!0,!0,!0,!0]),[q,W]=a.useState([]),[v,k]=a.useState([]),[C,F]=a.useState([]),{isOpen:x,onClose:T,onOpen:B}=Ye(),[g,U]=a.useState(null),[O,oe]=a.useState(!0),[te,ce]=a.useState(!1),[ie,_e]=a.useState(),le=l==="viewer",Y=tt(),[be]=$e("(min-width: 1350px)"),[de,ye]=a.useState([]),[De,ge]=a.useState({placeholder:"Take Action",disabled:""});if(a.useEffect(()=>{Tt&&N(Tt)},[]),a.useEffect(()=>{let Z=!1,xe=[];const fe=v.flatMap(pe=>pe.bugs||[]).map(pe=>(pe.hasOwnProperty("findings")&&xe.push(...pe.findings),pe.bug_hash));if(xe.forEach(pe=>{pe.hasOwnProperty("ai_tagged_status")&&(Z=!0)}),r(Z),F(fe),v.length===1&&v[0].bugs){const pe=v[0].bugs.map(ae=>ae.bug_status),We=Array.from(new Set(pe));We.length===1&&We[0]!=="pending_fix"?ge({placeholder:We[0],disabled:We[0]}):We.length>1?ge({placeholder:"Take Action",disabled:""}):ge({placeholder:"Take Action",disabled:"pending_fix"})}else ge({placeholder:"Take Action",disabled:""})},[v]),a.useEffect(()=>{t&&N(Z=>Z.map(fe=>{if(fe.issue_id===t.issue_id){const pe=fe.metric_wise_aggregated_findings.map(We=>t.bug_id===We.bug_id&&t.bug_status==="wont_fix"?{...We,comment:t.comment}:We);return{...fe,metric_wise_aggregated_findings:pe}}return fe}))},[t]),a.useEffect(()=>{const Z=l==="viewer";C&&C.length&&!Z?oe(!1):oe(!0)},[C]),a.useEffect(()=>{te&&setTimeout(()=>{const Z=document.getElementById("detailed_filter")?.getBoundingClientRect().height;_e(Z)},300)},[te]),!u||!i)return e.jsxs(z,{p:5,children:[e.jsx("h1",{children:"Loading component data..."}),e.jsxs(_,{children:["Missing: ",u?"":"scanData ",i?"":"profileData "]})]});const Ge=j||{count_files_analyzed:0,issue_severity_distribution:{critical:0,high:0,medium:0,low:0,informational:0,gas:0},issues_count:0,lines_analyzed_count:0,scan_time_taken:0,scans_ran:[],score:"0",score_v2:"0",threat_score:"0",score_rating:"none",threat_scan_risk_level:"none"},Fe=async(Z,xe)=>{if(t){if(Z==="create_github_issue")se();else{const{data:fe}=await Re.post(Ie.API_UPDATE_BUG_STATUS,{bug_ids:C,scan_id:c,project_id:p,bug_status:Z,comment:xe,scan_type:b});fe.status==="success"&&(Y({title:Z==="comment"?"Your comment has been successfully added to the bug.":"Bug Status Updated",description:fe.message,status:"success",duration:3e3,isClosable:!0}),xe&&s({...t,comment:xe}),d())}F([])}},se=async()=>{if(v&&v.length===1){const Z={issue_id:v[0].issue_id,issue_title:v[0].template_details.issue_name,repo_url:o,bugs:v[0].bugs?.map(fe=>({id:fe.bug_id,description:v[0].template_details.issue_description?it(v[0].template_details.issue_description,{...fe.description_details}):"",remediation:v[0].template_details.issue_remediation?it(v[0].template_details.issue_remediation,{...fe.description_details}):"",code_snapshot:o&&m?fe.findings.map(pe=>os(o,m,pe)).join(", "):""}))},{data:xe}=await Re.post(Ie.API_CREATE_BUGS_ISSUE,Z);xe&&xe.issue_id&&o&&Y({title:`Issue created successfully on ${ze(o)}`,status:"success",duration:5e3,isClosable:!0,position:"bottom"})}};return e.jsx(e.Fragment,{children:e.jsx(Ke.Provider,{value:{type:b,selectedIssues:v,setSelectedIssues:k,selectedBugs:C,issues:M,scanSummary:Ge,files:t,setFiles:s,restrictedBugIds:de,setRestrictedBugIds:ye,openIssueIndex:q,setOpenIssueIndex:W,isViewer:le,updateBugStatus:Fe,scanReport:u.scan_report},children:e.jsxs(S,{w:"100%",h:["100%","100%","100%","calc(100vh - 170px)"],maxH:["100%","100%","100%","1000px"],sx:{flexDir:["column","column","column","row"]},bg:"white",borderRadius:15,p:2,overflow:"hidden",children:[e.jsxs(ue,{w:["100%","100%","100%","35%"],h:["fit-content","fit-content","fit-content","100%"],spacing:4,mb:[8,8,8,0],pr:[0,0,0,1],alignItems:"flex-start",borderRight:"1px solid #E2E8F0",children:[e.jsx(S,{justifyContent:"flex-end",w:"100%",pr:"50px",opacity:.3,children:e.jsx(br,{color:"#8A94A6",size:24})}),e.jsx(z,{w:"100%",h:["fit-content","fit-content","fit-content","auto"],p:0,px:1,sx:{overflow:"scroll","::-webkit-scrollbar-thumb":{background:"transparent"}},_hover:{"::-webkit-scrollbar-thumb":{background:"#88888880"},"::-webkit-scrollbar-thumb:hover":{background:"#888888"}},children:e.jsx(Gt,{children:Array.from({length:5},(Z,xe)=>e.jsx(mt,{id:`dummy-issue-${xe}`,w:"100%",ref:null,children:({isExpanded:fe})=>e.jsxs(e.Fragment,{children:[e.jsxs(_t,{pl:2,_hover:{bg:"rgba(47, 248, 107, 0.07)"},_expanded:{bg:"rgba(47, 248, 107, 0.1)"},children:[e.jsxs(re,{sx:{w:"100%",my:2,alignItems:"center"},children:[e.jsxs(re,{w:"90%",children:[e.jsx(Xs,{name:Tt[0].issue_id,checked:!1,checkedColor:"#8A94A6",disabled:!0,onChange:()=>{},opacity:.2}),e.jsx(Us,{size:8,variant:Tt[0].template_details.issue_severity}),e.jsx(_,{w:"95%",sx:{ml:3,maxW:[230,230,400,275],fontWeight:600,color:"#4E5D78",fontSize:"sm",textAlign:"left"},isTruncated:!0,children:e.jsx(st,{h:"14px",w:"200px"})})]}),e.jsx(_,{sx:{ml:"auto",fontSize:"sm",fontWeight:600,color:"subtle"},children:e.jsx(st,{h:"14px",w:"20px"})})]}),e.jsx(Ue,{as:Ks,mr:[0,0,2],color:"subtle",fontSize:"14px",transition:"transform 0.2s",transform:fe?"rotate(90deg)":"rotate(0deg)"})]}),e.jsx(gt,{p:0,pb:4})]})},`dummy-issue-${xe}`))})})]}),be&&e.jsx(_s,{is_latest_scan:y,isAiBugSelected:n,scanning:!0})]})})})};function Tl(t){const{scanReport:s,projectId:n,isCodeLocked:r=!0,refetchScanDetail
89s:i}=t,[l,u]=a.useState(s||{quick_file_scan_details:[],ts_scan_details:[]}),[d,h]=a.useState(""),[p,c]=a.useState(""),{messageQueue:b,updateMessageQueue:j,setKeepWSOpen:E}=xt();return a.useEffect(()=>{if(s){const f={...s,quick_file_scan_details:Array.isArray(s.quick_file_scan_details)?s.quick_file_scan_details:[],ts_scan_details:Array.isArray(s.ts_scan_details)?[...s.ts_scan_details].sort((o,m)=>o&&o.issue_sequence_id&&m&&m.issue_sequence_id?o.issue_sequence_id-m.issue_sequence_id:0):[]};u(f)}},[s]),a.useEffect(()=>{b.length>0&&b.some(f=>["transaction_stimulation_status","transaction_stimulation_result","quick_scan_result","quick_scan_status","quick_scan_acknowledge","public_project_scan_acknowledge","scan_status","error"].includes(f.type))&&b.forEach(f=>{if(["quick_scan_status","scan_status"].includes(f.type)&&f.payload.scan_status==="scan_done"&&(f.payload.scan_id===d||f.request_uuid===p||!p)){const o=f.payload.scan_details;o.ts_scan_details?u({...o,ts_scan_details:Array.isArray(o?.ts_scan_details)?o.ts_scan_details.sort((m,y)=>m&&m.issue_sequence_id&&y&&y.issue_sequence_id?m.issue_sequence_id-y.issue_sequence_id:0):[]}):u(m=>({...o,quick_file_scan_details:o.quick_file_scan_details||m?.quick_file_scan_details,ts_scan_details:m?.ts_scan_details||[]})),h(f.payload.scan_id),i()}else if(f.type==="transaction_stimulation_result"&&(f.payload.scan_id===d||f.request_uuid===p)){const o=f.payload.transaction_stimulation_data;o&&u(m=>{const y=Array.isArray(m?.ts_scan_details)?m.ts_scan_details.map(w=>w.issue_id===o.issue_id?{...o}:w):[o];return{...m,quick_file_scan_details:Array.isArray(m?.quick_file_scan_details)?m.quick_file_scan_details:[],ts_scan_details:y}})}else if(f.type==="transaction_stimulation_status")(d&&f.payload.scan_id===d||f.request_uuid===p)&&(["stimulation_finished"].includes(f.payload.transaction_stimulation_status)?u(o=>{const m=Array.isArray(o?.ts_scan_details)?o.ts_scan_details.filter(y=>y.issue_status!=="scanning"):[];return{...o,quick_file_scan_details:Array.isArray(o?.quick_file_scan_details)?o.quick_file_scan_details:[],ts_scan_details:m}}):["stimulation_not_supported","stimulation_env_setup_failed"].includes(f.payload.transaction_stimulation_status)&&u(o=>({...o,quick_file_scan_details:Array.isArray(o?.quick_file_scan_details)?o.quick_file_scan_details:[],ts_scan_details:[]})));else if(f.type==="quick_scan_result"){const o=f.payload.module_result;u(m=>{let y;return Array.isArray(m?.quick_file_scan_details)&&m.quick_file_scan_details.length>0?m.quick_file_scan_details.some(D=>D.issue_id===o.issue_id)?y=m.quick_file_scan_details.map(D=>D.issue_id===o.issue_id?{...o}:D):y=[...m.quick_file_scan_details,o]:y=[o],{...m,quick_file_scan_details:y}})}else f.type&&["quick_scan_acknowledge","public_project_scan_acknowledge"].includes(f.type)&&c(f.request_uuid)})},[b]),e.jsx(e.Fragment,{children:Array.isArray(l?.quick_file_scan_details)&&l.quick_file_scan_details.length>0?e.jsx(Zi,{scanReport:l,projectId:n,isCodeLocked:!1,isScanning:!0}):null})}function Dl(){const{isOpen:t,onOpen:s,onClose:n}=Ye(),{projectType:r,projectId:i}=Ve(),l=Ms(),d=new URLSearchParams(l.search).get("view"),h=r.replace(/s$/,""),{scanData:p,reportList:c,refetchScanDetails:b}=a.useContext(et),{profileData:j,role:E}=qe(),[f,o]=a.useState(d||"details"),[m,y]=a.useState(0),[w,D]=a.useState(null),R=a.useRef(null),[L,P]=a.useState([{label:"Published Reports",icon:e.jsx(Be,{}),hoverIcon:e.jsx(Be,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})},{label:"Custom Settings",icon:e.jsx(nt,{}),hoverIcon:e.jsx(nt,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})},{label:"Scan History",icon:e.jsx(rt,{}),hoverIcon:e.jsx(rt,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})}]);if(a.useEffect(()=>{const N=setTimeout(()=>{s()},1e3);return R.current=N,()=>{R.current&&clearTimeout(R.current)}},[s]),a.useEffect(()=>{if(p)if(h==="block")P([{label:"Published Reports",icon:e.jsx(Be,{}),hoverIcon:e.jsx(Be,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})}]);else if(p.scan_report.project_url==="File Scan"){let N=[{label:"Published Reports",icon:e.jsx(Be,{}),hoverIcon:e.jsx(Be,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})}];p.scan_report.project_zip_files?.length&&E!=="viewer"&&N.push({label:"Custom Settings",icon:e.jsx(nt,{}),hoverIcon:e.jsx(nt,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})}),P(N)}else E==="viewer"&&P([{label:"Published Reports",icon:e.jsx(Be,{}),hoverIcon:e.jsx(Be,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})},{label:"Scan History",icon:e.jsx(rt,{}),hoverIcon:e.jsx(rt,{primaryColor:"#D0F0DA",secondaryColor:"#289B4B"})}])},[E,p,h]),!p||!j||!c)return null;const $=()=>j?._integrations?.github?.status==="successful"||j?._integrations?.gitlab?.status==="successful"||j?._integrations?.bitbucket?.status==="successful",V=N=>{y(N)},M=()=>{o("details"),V(0)};return e.jsx(z,{w:"100%",mt:2,children:e.jsxs(z,{w:"100%",position:"relative",children:[f==="details"?e.jsxs(ps,{index:m,onChange:V,variant:"soft-rounded",colorScheme:"green",w:"100%",mt:[14,14,14,0],isLazy:!0,children:[e.jsx(S,{width:"100%",overflow:"auto",flexDir:"row",justifyContent:"flex-start",align:"center",ml:0,zIndex:1,sx:{scrollbarWidth:"none","::-webkit-scrollbar":{display:"none"}},children:e.jsxs(hs,{sx:{px:2,py:3,w:"fit-content",mt:[2,2,2,0]},children:[e.jsx(lt,{fontSize:"sm",h:"35px",minW:"120px",bgColor:"#F5F5F5",children:"Overview"}),e.jsx(lt,{fontSize:"sm",h:"35px",minW:"150px",bgColor:"#F5F5F5",ml:4,whiteSpace:"nowrap",children:"Vulnerability Scan"}),e.jsx(lt,{fontSize:"sm",h:"35px",minW:"150px",bgColor:"#F5F5F5",ml:4,whiteSpace:"nowrap",children:"Threat Scan"})]})}),!["trial","beginner","expired"].includes(j?.current_package)&&m===0&&e.jsxs(z,{display:"flex",alignItems:"center",p:2,px:4,my:2,borderRadius:"md",border:"1px solid #e2e8f0",boxShadow:"sm",position:"relative",curs
89or:"pointer",onClick:s,_hover:{boxShadow:"md"},children:[e.jsx(z,{position:"absolute",top:"-8px",left:"10px",bg:"#52FF00",color:"black",fontSize:"11px",fontWeight:"600",px:2,py:0,borderRadius:"md",fontFamily:"monospace",children:"Free"}),e.jsxs(S,{align:"center",width:"100%",justify:"space-between",children:[e.jsxs(S,{align:"center",children:[e.jsx(he,{src:`${Ee()}free_consultation/video_cam.svg`,boxSize:5,mr:2}),e.jsxs(_,{fontSize:"16px",fontWeight:"600",children:["Expert Video Consultation"," ",e.jsxs(_,{as:"span",fontWeight:"normal",color:"gray.600",fontSize:"14px",display:["none","inline","inline","inline"],children:[":"," "]}),e.jsx(_,{as:"span",fontWeight:"normal",color:"gray.600",fontSize:"14px",display:["none","inline","inline","inline"],children:"Schedule a free call with our security experts to review results and improve the contract's security."})]})]}),e.jsx(Ue,{as:yr,boxSize:5,color:"#3300FF",sx:{borderRadius:"50%",backgroundColor:"white"}})]})]}),e.jsxs(fs,{borderRadius:15,pt:2,minH:"calc(100vh - 295px)",children:[e.jsx(ct,{p:0,backgroundColor:"#fafafa",children:e.jsx(Rl,{scanData:p.scan_report,scansRemaining:j.credits,onTabChange:V})}),e.jsx(ct,{p:0,children:e.jsx(Fl,{})}),e.jsx(ct,{p:0,children:e.jsx(S,{w:"100%",h:["100%","100%","100%","calc(100vh - 195px)"],borderRadius:15,pb:4,pr:[0,0,0,6],overflowY:["auto","auto","auto","scroll"],overflowX:"hidden",position:"relative",_hover:{"::-webkit-scrollbar-thumb":{background:"#88888880"},"::-webkit-scrollbar-thumb:hover":{background:"#888888"}},sx:{"::-webkit-scrollbar-thumb":{background:"transparent"}},children:e.jsx(Tl,{scanReport:p.scan_report,projectId:i,isCodeLocked:!1,refetchScanDetails:b})})})]})]}):e.jsxs(S,{w:"100%",flexDir:"column",py:2,maxH:"calc(100vh - 235px)",minH:"calc(100vh - 235px)",children:[e.jsxs(S,{color:"#B0B7C3",alignItems:"center",letterSpacing:1,cursor:"pointer",ml:6,onClick:()=>o("details"),children:[e.jsx(mr,{mr:1,boxSize:5}),"back"]}),e.jsxs(z,{w:"100%",h:"100%",py:4,children:[e.jsx(_,{fontWeight:600,color:"detail",mb:4,ml:6,mt:2,children:f}),f==="Published Reports"?e.jsx(Yr,{profile:j,scan_report:p.scan_report,reportList:c.reports,type:h}):f==="Custom Settings"&&p.scan_report.project_skip_files&&p.scan_report.project_url?e.jsx(qr,{project_skip_files:p.scan_report.project_skip_files,project_zip_files:p.scan_report.project_zip_files,project_branch:p.scan_report.project_branch||p.scan_report.project_commit_id,webhook_enabled:p.webhook_enabled?p.webhook_enabled:!1,project_url:p.scan_report.project_url,project_id:p.scan_report.project_id,isGithubIntegrated:$(),scanId:p.scan_report.scan_id}):f==="Scan History"&&p.scan_report&&e.jsx(Ur,{project_url:p.scan_report.project_url,project_branch:p.scan_report.project_branch,project_id:i,scan_id:p.scan_report.scan_id,profile:j,onScanClick:M})]})]}),f==="details"&&e.jsx(S,{w:["100%","100%","100%","fit-content"],position:"absolute",top:[-10,-10,-10,2],left:["auto"],right:["auto","auto","auto",2],justifyContent:["center","center","center","flex-end"],children:e.jsx(re,{spacing:4,zIndex:2,cursor:"pointer",position:"relative",children:L.map((N,K)=>e.jsx(Oe,{label:N.label,children:e.jsx(He,{bg:"transparent",p:0,"aria-label":N.label,icon:w===K?N.hoverIcon:N.icon,opacity:.3,_hover:{bg:"transparent"},_active:{bg:"transparent"}})},K))})})]})})}function Cc(){const{projectType:t,projectId:s,scanId:n}=Ve(),r=t.replace(/s$/,""),{data:i,isLoading:l,refetch:u}=yo(n),{data:d,refetch:h}=Co(r,s),p=Hs(),{profileData:c}=qe(),{isOpen:b,onClose:j,onOpen:E}=Ye(),[f,o]=a.useState(""),[m,y]=a.useState(!1),w=ht(),[D]=$e("(min-width: 1920px)"),R=Ys(),{sendMessage:L,setNeedAuthToken:P}=xt();a.useEffect(()=>{if(i&&i.scan_report){const{project_url:V,scan_type:M}=i.scan_report;V?V.includes("github")?o("github"):V.includes("gitlab")?o("gitlab"):V.includes("bitbucket")&&o("bitbucket"):M&&(M==="block"?o("block"):M==="File Scan"?o("filescan"):M==="local"&&o("local"))}},[i]);const $=async()=>{p&&p.REACT_APP_FEATURE_GATE_CONFIG.websockets_enabled?(y(!0),P(!0),L({type:"project_scan_initiate",body:{project_id:s,project_type:"existing"}}),R.invalidateQueries("profile"),w.push("/projects")):(y(!0),await Re.post(Ie.API_PROJECT_SCAN,{project_id:s,project_type:"existing"}),y(!1),R.invalidateQueries(["all_scans",{pageNo:1,perPageCount:D?20:12},void 0,void 0]),R.invalidateQueries(["scan_list",s]),j(),w.push("/projects"))};return e.jsxs(z,{sx:{w:["100%","100%","calc(100% - 2rem)"],bg:"bg.subtle",borderRadius:"20px",mx:[0,0,2],py:3,minH:"85vh"},px:[2,2,2,3],children:[l?e.jsx(S,{w:"100%",h:"85vh",alignItems:"center",justifyContent:"center",children:e.jsx(Ne,{})}):i&&c&&e.jsx(et.Provider,{value:{scanData:i,type:r,reportList:d,refetchScanDetail
89s:u,refetchReportList:h},children:e.jsx(z,{sx:{w:"100%"},children:i?.scan_report?.scan_status==="scanning"?e.jsxs(ve.Fragment,{children:[e.jsx(Cl,{scanId:n}),e.jsx(Dl,{})]},`skeleton-${i?.scan_report?.scan_id}`):e.jsxs(ve.Fragment,{children:[e.jsx(wo,{onOpenRescan:()=>E()}),e.jsx(Sl,{})]},`content-${i?.scan_report?.scan_id}-${i?.scan_report?.scan_status}`)})}),e.jsx(_r,{formType:f,isOpen:b,isRescanModal:!0,scanData:i,reScan:$,projectId:s,onClose:()=>{j()}})]})}export{Cc 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.