@testver/testver 1.4.3 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +88 -69
- package/README.md +6 -2
- package/bin/testver.js +9 -1
- package/dist/index.js +52200 -35695
- package/package.json +179 -178
- package/src/ui/static/agents/antigravity.svg +76 -0
- package/src/ui/static/agents/codex.svg +3 -0
- package/src/ui/static/agents/gemini.svg +1 -0
- package/src/ui/static/agents/opencode.svg +4 -0
- package/src/ui/static/agents/vscode.svg +17 -0
- package/src/ui/static/assets/{AIPanel-KQFq4c0Q.js → AIPanel-RWO8Cd9w.js} +32 -32
- package/src/ui/static/assets/{AIRecordPanel-CAs8fXyS.js → AIRecordPanel-DnreS585.js} +40 -40
- package/src/ui/static/assets/{AIStreamUI-p_sMTEDQ.js → AIStreamUI-C1gHJtlF.js} +9 -9
- package/src/ui/static/assets/{AITestGenPage-CHaHfmu4.js → AITestGenPage-C8bWUelu.js} +5 -5
- package/src/ui/static/assets/{APITestingPage-BSGJY_hd.js → APITestingPage-DwL67hqL.js} +19 -19
- package/src/ui/static/assets/AboutPage-CynLB95E.js +1 -0
- package/src/ui/static/assets/AccessTokensTab-BdevOmpE.js +1 -0
- package/src/ui/static/assets/AdvancedPage-BeM7aB8b.js +3 -0
- package/src/ui/static/assets/{AnalyticsPage-Lm8noJqC.js → AnalyticsPage-C5ddYfRk.js} +1 -1
- package/src/ui/static/assets/AuditLogPage-DYcUdJoj.js +1 -0
- package/src/ui/static/assets/{ChangesSummary-Cu0_4Ucf.js → ChangesSummary-BjNMwGIZ.js} +3 -3
- package/src/ui/static/assets/{CodeMapPage-uEjuo3fk.js → CodeMapPage-BQOEtv-R.js} +3 -3
- package/src/ui/static/assets/{ConfirmDialog-DtotgVmI.js → ConfirmDialog-D_N9188T.js} +1 -1
- package/src/ui/static/assets/{CoveragePage-jNkQJA1P.js → CoveragePage-8bDSphY1.js} +2 -2
- package/src/ui/static/assets/{CronBuilder-D2fERHt9.js → CronBuilder-C7_JADb7.js} +1 -1
- package/src/ui/static/assets/{Dashboard-BaIj_IdQ.js → Dashboard-B22yRPyV.js} +1 -1
- package/src/ui/static/assets/{DefectsPage-DH0njYFG.js → DefectsPage-Arv4Ac-b.js} +72 -72
- package/src/ui/static/assets/{EmptyState-utxlJ0fu.js → EmptyState-BShNSbLf.js} +1 -1
- package/src/ui/static/assets/{ExportButton-ouKqn9CU.js → ExportButton-xrS_AnfS.js} +1 -1
- package/src/ui/static/assets/{FileViewer-mU3JloJ6.js → FileViewer-Bcr9T1jW.js} +18 -18
- package/src/ui/static/assets/{GitPage-TrX-RqNC.js → GitPage-DXL2Sv40.js} +12 -12
- package/src/ui/static/assets/{ImportExportPage-CIhK_raX.js → ImportExportPage-BcjzRd7T.js} +36 -36
- package/src/ui/static/assets/{JiraPushDialog-DgEZS-0u.js → JiraPushDialog-DNYU9Ce0.js} +1 -1
- package/src/ui/static/assets/{KpiTile-BHLE3HVj.js → KpiTile-BKlWqjgN.js} +1 -1
- package/src/ui/static/assets/{LiveExecutionView-CaIf7Jux.js → LiveExecutionView-1LlyEDEe.js} +1 -1
- package/src/ui/static/assets/{MediaModal-DNM45Uz2.js → MediaModal-Dyy_iHl9.js} +1 -1
- package/src/ui/static/assets/MobileRunPicker-Cf5rm469.js +1 -0
- package/src/ui/static/assets/MobileRunTarget-C4M4YJJh.js +6 -0
- package/src/ui/static/assets/{ModuleExplorer-rni7JbsL.js → ModuleExplorer-BKVbxFZK.js} +1 -1
- package/src/ui/static/assets/{OutputPage-Cn2WCpJ6.js → OutputPage-Bi-28tJi.js} +1 -1
- package/src/ui/static/assets/PipelinesPanel-BtO3iSJ4.js +1 -0
- package/src/ui/static/assets/{ProfilePage-BKNdkSnx.js → ProfilePage-BgZ4VDC-.js} +1 -1
- package/src/ui/static/assets/{ProjectExplorer-5e7J8t-o.js → ProjectExplorer-BVGbmVP7.js} +1 -1
- package/src/ui/static/assets/{RemoteFileStrip-C1S2aclP.js → RemoteFileStrip-dzPInzgb.js} +1 -1
- package/src/ui/static/assets/{ReportCard-D4EElEe9.js → ReportCard-LOf1PXlb.js} +2 -2
- package/src/ui/static/assets/{ReportFullView-2w2ysKRg.js → ReportFullView-Ce4OI8lf.js} +1 -1
- package/src/ui/static/assets/{ReportsPage-9Fx-IEwV.js → ReportsPage-DFxCQ8cY.js} +48 -48
- package/src/ui/static/assets/{ResultsPage-DPkfGh-K.js → ResultsPage-DD-uj8gk.js} +115 -115
- package/src/ui/static/assets/{RunState-CRuS_bC2.js → RunState-DDwFB4tA.js} +1 -1
- package/src/ui/static/assets/{RunTargets-CPKBrefj.js → RunTargets-CkIpY3v3.js} +1 -1
- package/src/ui/static/assets/ScriptMappingPage-DQQoR6sR.js +1 -0
- package/src/ui/static/assets/{SearchableDevicePicker-DubIldKj.js → SearchableDevicePicker-CenIxD7b.js} +1 -1
- package/src/ui/static/assets/{SettingsPage-BuZrrlW2.js → SettingsPage-DAV_0y0m.js} +83 -83
- package/src/ui/static/assets/{SharedReportView-ig5hECRk.js → SharedReportView-CqSLFKT1.js} +1 -1
- package/src/ui/static/assets/{SourcesPage-BPkqRqkC.js → SourcesPage-BvqC9oKw.js} +14 -14
- package/src/ui/static/assets/TestExplorerPage-Bdnll77k.js +7 -0
- package/src/ui/static/assets/{TestManagementPage-DJiWpCne.js → TestManagementPage-CCNE688A.js} +10 -10
- package/src/ui/static/assets/{TestPlansPage-G1lvK1C0.js → TestPlansPage-T6D25i6-.js} +5 -5
- package/src/ui/static/assets/{TestverCreditsRing-CEBSy3w3.js → TestverCreditsRing-CoDk5eAS.js} +1 -1
- package/src/ui/static/assets/TestverMcpPage-Dte0qSXp.js +34 -0
- package/src/ui/static/assets/{UncommittedDiffViewer-FKvUZcRi.js → UncommittedDiffViewer-BNroxCoo.js} +2 -2
- package/src/ui/static/assets/{UserManagementPage-gDGhaHE4.js → UserManagementPage-BU4MuDJZ.js} +10 -10
- package/src/ui/static/assets/{WorkflowsPage-BACdnU-1.js → WorkflowsPage-BP5k7AqE.js} +83 -83
- package/src/ui/static/assets/clipboard-BIEd7Ccc.js +1 -0
- package/src/ui/static/assets/{hiddenLlmProviders-DzwaR-b9.js → hiddenLlmProviders-BPORgy-e.js} +1 -1
- package/src/ui/static/assets/index-BlA8ntjb.js +47 -0
- package/src/ui/static/assets/index-Co4_SlGD.css +1 -0
- package/src/ui/static/assets/{reportMeta-3kxT7BIT.js → reportMeta-B9ZRW6ts.js} +1 -1
- package/src/ui/static/assets/runSelected-BoPm1sz-.js +1 -0
- package/src/ui/static/assets/{useFeatureFlags-DrhvBp0C.js → useFeatureFlags-B4Otsv-N.js} +1 -1
- package/src/ui/static/assets/{useJiraConnector-Dwj69Rfh.js → useJiraConnector--JZhbYrT.js} +1 -1
- package/src/ui/static/assets/{useOwnership-C1CmzcvJ.js → useOwnership-BhPOiYzy.js} +1 -1
- package/src/ui/static/assets/useSuites-GN_K2mHc.js +1 -0
- package/src/ui/static/assets/{useTestExplorer-CUqC18DV.js → useTestExplorer-BGhkGHKy.js} +1 -1
- package/src/ui/static/assets/{useTestLifecycle-C2S_vaX2.js → useTestLifecycle-DX5ES6x8.js} +1 -1
- package/src/ui/static/assets/{useTestManagement-DW6AW2mt.js → useTestManagement-ommXjx0q.js} +2 -2
- package/src/ui/static/assets/{useTestResults-yjH1aUy-.js → useTestResults-DWjvm8gm.js} +1 -1
- package/src/ui/static/assets/{vendor-icons-D_Dmmj8d.js → vendor-icons-Cm92aSc5.js} +1426 -1416
- package/src/ui/static/index.html +479 -479
- package/src/ui/static/assets/AboutPage-CDa24SCJ.js +0 -1
- package/src/ui/static/assets/AdvancedPage-BqXP0FLg.js +0 -3
- package/src/ui/static/assets/AuditLogPage-BvldSIik.js +0 -1
- package/src/ui/static/assets/MobileRunPicker-DFKm6_nU.js +0 -1
- package/src/ui/static/assets/MobileRunTarget-DHDoDZ_F.js +0 -6
- package/src/ui/static/assets/PipelinesPanel-D6zWcLtD.js +0 -1
- package/src/ui/static/assets/ScriptMappingPage-C3K_uyf0.js +0 -1
- package/src/ui/static/assets/TestExplorerPage-C_jl93GR.js +0 -7
- package/src/ui/static/assets/index-D6sQYc_0.js +0 -47
- package/src/ui/static/assets/index-aInN0yoR.css +0 -1
- package/src/ui/static/assets/runSelected-WlgnZcSF.js +0 -1
- package/src/ui/static/assets/useSuites-V0AxZYex.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as k,j as e,L as je,b as ke,u as we}from"./vendor-react-DOVfxdUy.js";import{a as Ne,u as Ce}from"./vendor-query-DkZSMtfn.js";import{d$ as ge,iE as Te,b as ze,iF as Ae,dS as Se,iG as Ie,iH as Be,iI as Le,iJ as $e,er as Me}from"./index-D6sQYc_0.js";import{u as Pe,b as se}from"./TestverCreditsRing-CEBSy3w3.js";import{t as De,T as Re}from"./TestverCreditsDetail-BKpt4oLW.js";import{C as Ee}from"./ConfirmDialog-DtotgVmI.js";import{a0 as T,o as re,Z as ue,cR as H,r as Ge,R as _e,z as Fe,S as W,$ as pe,b9 as qe,bC as Oe,ac as ye,al as Ye,_ as z,P as He,l as We,I as Ue,dn as ae,K as ne,Q as ie,dq as Ke,V as oe,J as Ze,bD as Je,bP as Qe,d as Ve,bz as le,G as Xe,b as ce,e as de,a7 as et,dr as tt,ds as xe,g as st,cr as rt,O as at,dt as nt,i as it,bw as ot,Y as lt,du as ct}from"./vendor-icons-D_Dmmj8d.js";import"./formatDate-T65-Y6Mi.js";function dt(t){if(!t)return"";const a=Math.max(0,Math.round((Date.now()-Date.parse(t))/6e4));return a<1?"just now":a<60?`${a} min ago`:`${Math.floor(a/60)} h ago`}function me(t){return t?new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):""}function o({tone:t,children:a}){const r={ok:"bg-emerald-50 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400",off:"bg-gray-100 text-gray-600 dark:bg-white/5 dark:text-gray-400",sys:"bg-amber-50 text-amber-700 dark:bg-amber-500/10 dark:text-amber-300",team:"bg-violet-50 text-violet-700 dark:bg-violet-500/15 dark:text-violet-300",info:"bg-sky-50 text-sky-700 dark:bg-sky-500/10 dark:text-sky-300",warn:"bg-amber-50 text-amber-700 dark:bg-amber-500/10 dark:text-amber-300"}[t];return e.jsx("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[11px] font-semibold whitespace-nowrap ${r}`,children:a})}function P({on:t,disabled:a,busy:r,onChange:i,label:n}){return e.jsxs("button",{type:"button",role:"switch","aria-checked":t,"aria-label":n,disabled:a||r,onClick:()=>i(!t),className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors ${t?"bg-sky-500":"bg-gray-300 dark:bg-zinc-600"} ${a?"opacity-40 cursor-not-allowed":""}`,children:[e.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white shadow transition-transform ${t?"translate-x-[18px]":"translate-x-0.5"}`}),r&&e.jsx(T,{size:10,className:"absolute -right-4 animate-spin text-gray-500 dark:text-gray-400"})]})}function D({tone:t,children:a}){const r={sky:"border-sky-200 bg-sky-50 text-sky-600 dark:border-sky-400/30 dark:bg-sky-500/10 dark:text-sky-300",violet:"border-violet-200 bg-violet-50 text-violet-600 dark:border-violet-400/30 dark:bg-violet-500/10 dark:text-violet-300",emerald:"border-emerald-200 bg-emerald-50 text-emerald-600 dark:border-emerald-400/30 dark:bg-emerald-500/10 dark:text-emerald-300"}[t];return e.jsx("span",{className:`inline-flex h-10 w-10 items-center justify-center rounded-xl border ${r}`,children:a})}function R({children:t,dashed:a,dim:r,footer:i}){return e.jsxs("div",{className:`flex flex-col rounded-2xl border ${a?"border-dashed":""} border-black/[0.06] dark:border-white/5 bg-surface-1 p-6 ${r?"opacity-60":""}`,children:[t,i&&e.jsx("div",{className:"mt-auto flex justify-end pt-4 text-sm",children:i})]})}const he="text-sky-600 dark:text-sky-300 hover:text-sky-700 dark:hover:text-sky-200 font-medium inline-flex items-center gap-1 whitespace-nowrap";function B({to:t,href:a,children:r}){return t?e.jsxs(je,{to:t,className:he,children:[r," ",e.jsx(Ye,{size:12})]}):e.jsxs("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:he,children:[r," ",e.jsx(z,{size:12})]})}const L=({k:t,v:a,tone:r})=>e.jsxs("div",{className:"flex justify-between gap-3 text-sm",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:t}),e.jsx("span",{className:r??"text-gray-800 dark:text-gray-200",children:a})]});function xt(t){const[a,r]=k.useState("idle"),[i,n]=k.useState(null),l=k.useRef(null);return k.useEffect(()=>()=>{l.current&&window.clearInterval(l.current)},[]),{state:a,error:i,start:async()=>{n(null),r("waiting");const f=window.open("about:blank","_blank");try{const m=await Be();if(!f){n("Your browser blocked the popup — allow popups for this site and retry."),r("error");return}f.location.href=m.approveUrl;const p=Math.max(1500,Number(m.pollIntervalMs)||2500),j=Date.now()+5*6e4;l.current=window.setInterval(async()=>{if(Date.now()>j){l.current&&window.clearInterval(l.current),r("error"),n("The connection request expired — click Connect to try again.");return}try{const w=await Le(m.code);w.status==="connected"?(l.current&&window.clearInterval(l.current),r("idle"),t()):(w.status==="denied"||w.status==="expired"||w.status==="invalid")&&(l.current&&window.clearInterval(l.current),r("error"),n(w.status==="denied"?"The request was denied on testver.com.":"The connection request expired — click Connect to try again."))}catch{}},p)}catch(m){f==null||f.close(),r("error"),n(m instanceof Error?m.message:"Could not start the connection")}},cancel:()=>{l.current&&window.clearInterval(l.current),r("idle")}}}function mt(){var J,Q,V,X,ee,te;const{data:t,isLoading:a,refetch:r,isFetching:i}=ge(),n=Te(),l=Ne(),v=!!(t!=null&&t.connected),{data:h,isError:f}=Pe({enabled:v});k.useEffect(()=>{v&&se(l)},[v,l]);const{toast:m}=ze(),[p,j]=k.useState(null),[w,E]=k.useState(!1),[S,$]=k.useState(null),I=xt(()=>{n(),r(),m("success","Connected to Testver — services are being set up.")}),U=async(x,M)=>{j(x),$(null);try{const F=(await Ae(x,M)).result;x==="grid"&&M&&F&&!F.connected&&$(F),n(),await r()}catch(_){m("error",_ instanceof Error?_.message:"Could not update the service")}finally{j(null)}},K=async()=>{j("takeover");try{await Se({takeover:!0}),$(null),n(),await r(),m("success","Testver Grid is now connected on this device.")}catch(x){m("error",x instanceof Error?x.message:"Take-over failed")}finally{j(null)}},be=async()=>{j("disconnect");try{await Ie(),n(),await r(),m("success","Disconnected from Testver.")}catch(x){m("error",x instanceof Error?x.message:"Disconnect failed")}finally{j(null)}};if(a||!t)return e.jsxs("div",{className:"max-w-[1100px] mx-auto px-6 py-16 text-sm text-gray-500 dark:text-gray-400 flex items-center gap-2",children:[e.jsx(T,{size:14,className:"animate-spin"})," Loading your Testver connections…"]});const{services:s,isSystem:u,memberOnly:c}=t,ve=!u&&(s.grid.providedBy==="system"||s.mail.providedBy==="system"),y=t.own.account,d=t.own.subject,fe=s.ai.entitled&&s.ai.credits?{connected:!0,active:s.ai.active,plan:s.ai.plan??null,paidThrough:s.ai.paidThrough,totalCredits:s.ai.credits.total,usedCredits:s.ai.credits.used,remainingCredits:s.ai.credits.remaining,cycleUsedCredits:s.ai.credits.cycleUsed,cycleAllowanceCredits:s.ai.credits.cycleAllowance}:null,N=h!=null&&h.connected&&(h.totalCredits??0)>0?h:f||h&&!h.connected?fe:null,Z=t.connected&&!h&&!f,G=t.connected&&!Z&&!N&&((h==null?void 0:h.active)===!1||!s.ai.entitled),b=N?De(N):null;return e.jsxs("div",{className:"max-w-[1100px] mx-auto px-6 py-10 space-y-5",children:[!t.connected&&e.jsxs("div",{className:"rounded-2xl border border-sky-200 dark:border-sky-500/20 bg-sky-50 dark:bg-sky-500/5 p-6",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"max-w-2xl",children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:u?"Connect this Testver to your account":"Connect your Testver account"}),e.jsxs("p",{className:"mt-2 text-base text-gray-500 dark:text-gray-400 leading-relaxed",children:["One click on testver.com. Everything your plan includes and every add-on you hold switches on automatically — AI credits, Testver mail and Grid browsers — and you can turn any of them off here later. Your custom SMTP or vendor grids keep working as they are.",u&&" This becomes the system connection: schedules, CI gates and healing use it too."]}),t.own.invalid&&e.jsxs("p",{className:"mt-2 text-sm text-amber-300 flex items-center gap-1.5",children:[e.jsx(re,{size:14})," Your previous connection was rejected — connect again."]})]}),I.state==="waiting"?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300",children:[e.jsx(T,{size:16,className:"animate-spin text-sky-400"}),"Approve in the tab we opened… waiting.",e.jsx("button",{onClick:I.cancel,className:"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:text-gray-300 underline underline-offset-2",children:"Cancel"})]}):e.jsxs("button",{onClick:()=>void I.start(),className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-lg text-sm font-semibold text-white bg-gradient-to-r from-sky-500 to-indigo-500 hover:from-sky-400 hover:to-indigo-400 transition-colors",children:[e.jsx(ue,{size:15})," Connect to Testver"]})]}),I.error&&e.jsx("p",{className:"mt-3 text-xs text-red-400",children:I.error}),e.jsx("ol",{className:"mt-5 grid gap-3 sm:grid-cols-3 text-[13px] text-gray-700 dark:text-gray-300",children:["A testver.com tab opens — sign in if you are not already.","Approve the connection for this installation.","Come back here — the services below light up on their own."].map((x,M)=>e.jsxs("li",{className:"flex items-start gap-2.5",children:[e.jsx("span",{className:"mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-sky-500/15 text-[11px] font-bold text-sky-300",children:M+1}),e.jsx("span",{children:x})]},x))})]}),ve&&e.jsxs("div",{className:"flex items-start gap-2.5 rounded-xl border border-amber-200 dark:border-amber-500/25 bg-amber-50 dark:bg-amber-500/[0.07] px-4 py-3 text-sm text-amber-800 dark:text-amber-200",children:[e.jsx(H,{size:15,className:"mt-0.5 shrink-0"}),e.jsxs("span",{children:["This is a shared Testver server. The super admin's ",e.jsx("span",{className:"font-semibold",children:"system connection"})," provides"," ",[s.grid.providedBy==="system"&&"Testver Grid",s.mail.providedBy==="system"&&"Testver Mail"].filter(Boolean).join(" and ")," to everyone here — you cannot change ",s.grid.providedBy==="system"&&s.mail.providedBy==="system"?"them":"it",". Your AI credits come from your own account."]})]}),t.connected&&y&&d&&e.jsxs("div",{className:"rounded-2xl border border-sky-200 dark:border-sky-500/20 bg-sky-50 dark:bg-sky-500/5 p-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3.5",children:[e.jsx("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-full bg-gradient-to-br from-sky-500 to-indigo-500 text-sm font-bold text-white",children:(y.name??y.email??"?").split(/\s+/).map(x=>x[0]).join("").slice(0,2).toUpperCase()}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:["Connected as ",y.name??y.email]}),e.jsxs(o,{tone:"ok",children:[e.jsx(Ge,{size:11})," ",u?"System connection":"Your account"]}),d.type==="team"&&e.jsxs(o,{tone:"team",children:[d.name??"Team"," · ",d.role]})]}),e.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400 mt-0.5",children:[y.email,y.plan?` · ${y.plan.name} plan${y.paidThrough?`, paid through ${me(y.paidThrough)}`:""}`:" · no plan",d.type==="team"&&((J=d.owner)!=null&&J.email)&&d.role!=="owner"?` · owner: ${d.owner.name??d.owner.email}`:"",d.type==="user"?" · individual":""]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>{r(),se(l)},disabled:i,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-gray-800 dark:text-gray-200 bg-surface-2 border border-black/10 dark:border-white/10 hover:bg-surface-3 disabled:opacity-50",children:[e.jsx(_e,{size:12,className:i?"animate-spin":""})," Check all services"]}),e.jsxs("button",{onClick:()=>E(!0),disabled:p!==null,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-red-300 bg-red-500/10 border border-red-500/20 hover:bg-red-500/20 disabled:opacity-50",children:[p==="disconnect"?e.jsx(T,{size:12,className:"animate-spin"}):e.jsx(Fe,{size:12})," Disconnect"]})]})]}),e.jsx("p",{className:"mt-3 text-sm text-gray-500 dark:text-gray-400 leading-relaxed",children:c?"As a team member you get the team's AI credits here. Grid, Cloud and Mail are set up once for the whole team by the owner or the platform manager, on their own Testver installation.":u?"Everything your plan includes is connected below. Switch a service off here at any time; automation (schedules, CI gates, healing) uses this connection too.":"Everything your plan includes is connected below for your own account. Switch a service off here at any time."})]}),e.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[e.jsxs(R,{dim:!t.connected,footer:t.connected&&N?e.jsx(B,{to:"/settings?tab=llm",children:"AI settings"}):G?e.jsx(B,{href:"https://testver.com/pricing",children:"See plans"}):null,children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(D,{tone:"sky",children:e.jsx(W,{size:15})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[15px] font-semibold text-gray-900 dark:text-gray-100",children:"Testver AI"}),e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:t.connected?(d==null?void 0:d.type)==="team"?"Team credits · your share":"Your account · frontier models, managed":"Frontier models, managed — no API keys"})]})]}),t.connected?b!=null&&b.suspended?e.jsx(o,{tone:"warn",children:"Suspended"}):b!=null&&b.seatPaused?e.jsx(o,{tone:"warn",children:"Seat paused"}):b!=null&&b.planExpired?e.jsx(o,{tone:"warn",children:"Plan expired"}):N||s.ai.entitled&&!G?e.jsx(o,{tone:"ok",children:"Active"}):e.jsx(o,{tone:"off",children:"No plan"}):e.jsx(o,{tone:"off",children:"Connects automatically"})]}),Z&&e.jsxs("p",{className:"mt-3.5 text-sm text-gray-500 dark:text-gray-400 flex items-center gap-2",children:[e.jsx(T,{size:13,className:"animate-spin"})," Loading credits…"]}),t.connected&&N&&e.jsx(Re,{data:N,formatDay:me,className:"mt-3.5"}),G&&e.jsx("p",{className:"mt-3 text-sm text-gray-500 dark:text-gray-400",children:"No Testver plan on this account."}),!t.connected&&e.jsx("p",{className:"mt-3 text-sm text-gray-500 dark:text-gray-400",children:"Your plan's credits power every AI feature the moment you connect."})]}),e.jsxs(R,{dim:!t.connected,dashed:c,footer:t.connected&&!c&&(s.grid.on||s.grid.providedBy)&&e.jsx(B,{to:"/settings?tab=connectors",children:"Grid settings"}),children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(D,{tone:"violet",children:e.jsx(pe,{size:15})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[15px] font-semibold text-gray-900 dark:text-gray-100",children:"Testver Grid"}),e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:s.grid.entitled||s.grid.providedBy?`Cloud browsers · ${s.grid.limit} at once${(d==null?void 0:d.type)==="team"||s.grid.providedBy==="system"?", one pool":""}`:"Chromium, Firefox and WebKit in the cloud"})]})]}),t.connected?c?e.jsx(o,{tone:"team",children:"Managed by your team owner"}):s.grid.providedBy==="system"&&!u?e.jsx(P,{on:!0,disabled:!0,label:"Testver Grid (system)",onChange:()=>{}}):s.grid.entitled?e.jsx(P,{on:s.grid.on,busy:p==="grid",disabled:!s.grid.manageable,label:"Testver Grid",onChange:x=>void U("grid",x)}):e.jsx(o,{tone:"off",children:"Not in your plan"}):e.jsx(o,{tone:"off",children:"Add-on"})]}),t.connected&&s.grid.providedBy==="system"&&!u&&e.jsx("div",{className:"mt-3",children:e.jsx(o,{tone:"sys",children:"Provided by the system connection"})}),t.connected&&(s.grid.on||s.grid.providedBy)&&!c&&e.jsxs("div",{className:"mt-3.5 space-y-1.5",children:[e.jsx(L,{k:"Connection",v:s.grid.thisDevice?`This device · ${t.installation.deviceName}`:s.grid.connection?`${s.grid.connection.deviceName??"another device"} · ${dt(s.grid.connection.lastSeenAt)}`:"Not connected yet",tone:s.grid.thisDevice?"text-emerald-400":s.grid.connection?"text-amber-300":"text-gray-700 dark:text-gray-300"}),s.grid.providedBy==="system"&&!u&&e.jsx(L,{k:"Managed by",v:`super admin${(V=(Q=t.system)==null?void 0:Q.account)!=null&&V.email?` · ${t.system.account.email}`:""}`})]}),t.connected&&c&&e.jsxs("div",{className:"mt-3 text-sm text-gray-500 dark:text-gray-400 leading-relaxed",children:[s.grid.connection?e.jsxs("span",{className:"flex items-center gap-1.5 text-gray-700 dark:text-gray-300",children:[e.jsx(qe,{size:12})," ",((X=d==null?void 0:d.owner)==null?void 0:X.name)??"The owner"," holds the team's connection on ",s.grid.connection.deviceName??"their device","."]}):null,e.jsx("span",{className:"block mt-1",children:"Only the owner or the platform manager can connect or move it. Runs started from that installation use the team pool."})]}),S&&e.jsxs("div",{className:"mt-3 rounded-xl border border-amber-200 dark:border-amber-500/25 bg-amber-50 dark:bg-amber-500/[0.07] px-3 py-2.5 text-sm text-amber-800 dark:text-amber-200 space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(re,{size:13,className:"mt-0.5 shrink-0"}),e.jsx("span",{children:S.message})]}),S.code==="GRID_IN_USE"&&((ee=S.holder)==null?void 0:ee.canTakeOver)!==!1&&e.jsxs("div",{className:"flex gap-2 pl-5",children:[e.jsx("button",{onClick:()=>void K(),disabled:p!==null,className:"px-2.5 py-1 rounded-md bg-amber-600 hover:bg-amber-500 text-white text-[11px] font-medium disabled:opacity-50",children:p==="takeover"?e.jsx(T,{size:11,className:"animate-spin"}):"Take over on this device"}),e.jsx("button",{onClick:()=>$(null),className:"px-2.5 py-1 rounded-md text-[11px] text-amber-200 hover:bg-amber-500/20",children:"Not now"})]})]}),t.connected&&!S&&s.grid.on&&s.grid.manageable&&s.grid.connection&&!s.grid.thisDevice&&!c&&e.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[e.jsx("button",{onClick:()=>void K(),disabled:p!==null,className:"px-2.5 py-1 rounded-md bg-amber-600 hover:bg-amber-500 text-white text-[11px] font-medium disabled:opacity-50",children:p==="takeover"?e.jsx(T,{size:11,className:"animate-spin"}):"Take over on this device"}),e.jsx("span",{className:"text-[11px] text-gray-500 dark:text-gray-400",children:"allowed once that device has been idle for a few minutes"})]}),t.connected&&!s.grid.entitled&&!s.grid.providedBy&&!c&&s.grid.reason&&e.jsx("p",{className:"mt-3 text-sm text-gray-500 dark:text-gray-400",children:s.grid.reason.message}),!t.connected&&e.jsx("p",{className:"mt-3 text-sm text-gray-500 dark:text-gray-400",children:"A prepaid add-on to a paid plan: buy parallel browsers on testver.com. Connects here unless another installation already holds your connection — then you choose whether to take it over."}),t.connected&&!c&&(s.grid.on||s.grid.providedBy)&&e.jsx("p",{className:"mt-4 text-sm text-gray-500 dark:text-gray-400",children:"Only one installation holds the connection at a time."})]}),e.jsxs(R,{dim:!t.connected,dashed:c,footer:t.connected&&!c&&(s.mail.on||s.mail.providedBy)&&e.jsx(B,{to:"/settings?tab=connectors",children:"Manage connectors"}),children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(D,{tone:"emerald",children:e.jsx(Oe,{size:15})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[15px] font-semibold text-gray-900 dark:text-gray-100",children:"Testver Mail"}),e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Reports & notifications through Testver's mail server · no SMTP setup"})]})]}),t.connected?c?e.jsx(o,{tone:"team",children:"Managed by your team owner"}):s.mail.providedBy==="system"&&!u?e.jsx(P,{on:!0,disabled:!0,label:"Testver Mail (system)",onChange:()=>{}}):s.mail.entitled?e.jsx(P,{on:s.mail.on,busy:p==="mail",disabled:!s.mail.manageable,label:"Testver Mail",onChange:x=>void U("mail",x)}):e.jsx(o,{tone:"off",children:"Not in your plan"}):e.jsx(o,{tone:"off",children:"Connects automatically"})]}),t.connected&&s.mail.providedBy==="system"&&!u&&e.jsx("div",{className:"mt-3",children:e.jsx(o,{tone:"sys",children:"Provided by the system connection"})}),t.connected&&(s.mail.on||s.mail.providedBy)&&!c&&e.jsxs("div",{className:"mt-3.5 space-y-1.5",children:[e.jsx(L,{k:"Sends as",v:e.jsx("span",{className:"font-mono text-[12px]",children:s.mail.from??s.mail.fromAddress})}),e.jsx(L,{k:"Replies go to",v:e.jsx("span",{className:"font-mono text-[12px]",children:s.mail.replyTo??"—"})})]}),t.connected&&c&&e.jsxs("p",{className:"mt-3 text-sm text-gray-500 dark:text-gray-400 leading-relaxed",children:["Enabled on the team's Testver installation and sends as ",e.jsx("span",{className:"font-mono",children:s.mail.fromAddress??"tool@testver.com"}),". Your own SMTP connectors keep working here."]}),t.connected&&!s.mail.entitled&&!s.mail.providedBy&&!c&&s.mail.reason&&e.jsx("p",{className:"mt-3 text-sm text-gray-500 dark:text-gray-400",children:s.mail.reason.message}),!t.connected&&e.jsx("p",{className:"mt-3 text-sm text-gray-500 dark:text-gray-400",children:"Included with paid plans. Becomes the default sender; no SMTP host, port or password to enter."}),t.connected&&!c&&(s.mail.on||s.mail.providedBy)&&e.jsx("div",{className:"mt-4 text-sm",children:s.mail.connectorConnected?e.jsxs(o,{tone:"info",children:[e.jsx(ye,{size:11})," Default sender for notifications & reports"]}):e.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"Connector is off"})})]}),e.jsxs(R,{dim:!t.connected,dashed:c,footer:e.jsx(B,{href:((te=s.cloud.workspace)==null?void 0:te.url)??(s.cloud.entitled?"https://testver.com/dashboard/cloud":"https://testver.com/pricing"),children:s.cloud.workspace?"Open workspace":s.cloud.entitled?"Manage on testver.com":"See plans"}),children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(D,{tone:"sky",children:e.jsx(H,{size:15})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[15px] font-semibold text-gray-900 dark:text-gray-100",children:"Testver Cloud"}),e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Your always-on Testver · managed on testver.com"})]})]}),t.connected?c?e.jsx(o,{tone:"team",children:"Managed by your team owner"}):s.cloud.workspace?e.jsx(o,{tone:s.cloud.workspace.status==="active"?"ok":"warn",children:s.cloud.workspace.status==="active"?"Healthy":s.cloud.workspace.status}):s.cloud.entitled?e.jsx(o,{tone:"info",children:"Not created yet"}):e.jsx(o,{tone:"off",children:"Not in your plan"}):e.jsx(o,{tone:"off",children:"Shown after connecting"})]}),t.connected&&s.cloud.workspace&&e.jsx("div",{className:"mt-3.5 space-y-1.5",children:e.jsx(L,{k:"Workspace",v:e.jsxs("span",{className:"font-mono text-[12px]",children:[s.cloud.workspace.subdomain,".cloud.testver.com"]})})}),e.jsx("p",{className:"mt-4 text-sm text-gray-500 dark:text-gray-400",children:t.connected?c?"Sign in there with the workspace login.":s.cloud.workspace?"Restart, repository and backups live in your dashboard.":s.cloud.entitled?"Create it from your dashboard in about a minute.":"Testver Cloud is a prepaid add-on to a paid plan — add it from Billing → Add-ons on testver.com.":"A prepaid add-on to your plan, bought on testver.com. This page shows your workspace's health and links to the dashboard."})]})]}),e.jsx(Ee,{open:w,title:"Disconnect from Testver?",description:u?"AI requests, Testver Grid and Testver mail will stop for everyone on this server until you reconnect. The connection is revoked on testver.com too.":"AI requests on your account will stop here until you reconnect, and your connection is revoked on testver.com.",confirmLabel:"Disconnect",onConfirm:()=>{E(!1),be()},onCancel:()=>E(!1)})]})}function ht({size:t=18}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 1200 1227",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M714.163 519.284 1160.89 0h-105.86L667.137 450.887 357.328 0H0l468.492 681.821L0 1226.37h105.866l409.625-476.152 327.181 476.152H1200L714.137 519.284h.026Zm-145.087 168.62-47.469-67.894L144.011 79.694h162.683l304.797 435.991 47.468 67.894 396.2 566.721h-162.68L569.076 687.929v-.025Z"})})}function gt(){const{data:t}=Ce({queryKey:["server-health-version"],queryFn:$e,staleTime:3e5,retry:1}),a=t!=null&&t.version&&t.version!=="0.0.0"?t.version:null;return e.jsxs("div",{className:"bg-surface-0 text-gray-200 animate-fade-in",children:[e.jsxs("div",{className:"relative overflow-hidden border-b border-white/5",children:[e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute -top-40 -right-40 w-[28rem] h-[28rem] rounded-full bg-blue-500/15 blur-3xl"}),e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute -bottom-40 -left-40 w-[28rem] h-[28rem] rounded-full bg-cyan-500/10 blur-3xl"}),e.jsxs("div",{className:"relative max-w-[1100px] mx-auto px-6 py-20 text-center",children:[e.jsxs("div",{className:"inline-flex items-center gap-3 mb-8",children:[e.jsx(Me,{className:"w-14 h-14 object-contain drop-shadow-[0_8px_20px_rgba(99,102,241,0.30)]"}),e.jsx("span",{className:"text-3xl font-bold bg-gradient-to-r from-blue-500 via-purple-500 to-emerald-500 bg-clip-text text-transparent",children:"Testver"})]}),a&&e.jsxs("div",{className:"-mt-3 mb-8 flex flex-wrap items-center justify-center gap-x-3 gap-y-2 text-sm",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full bg-surface-2 px-3.5 py-1.5 ring-1 ring-white/10",title:"The Testver version installed on this server",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"Version"}),e.jsxs("span",{className:"font-mono font-semibold text-gray-900 dark:text-gray-100","data-testid":"about-version",children:["v",a]})]}),e.jsxs("a",{href:"https://docs.testver.com/release-notes",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-medium text-blue-600 dark:text-blue-400 hover:underline",children:["What's new",e.jsx(ae,{size:14})]})]}),e.jsx("h1",{className:"text-4xl sm:text-5xl font-bold text-gray-100 leading-tight max-w-3xl mx-auto",children:"AI-powered test management & automation, in one workspace."}),e.jsx("p",{className:"mt-5 text-lg text-gray-500 dark:text-gray-400 max-w-2xl mx-auto leading-relaxed",children:"Plan, automate, execute, and report — across web, mobile, and API — without switching between half a dozen tools."}),e.jsxs("div",{className:"mt-9 flex flex-wrap items-center justify-center gap-3",children:[e.jsxs("a",{href:"https://testver.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-brand-500 hover:bg-brand-700 text-white text-sm font-semibold transition-colors shadow-lg shadow-brand-500/20",children:[e.jsx(ne,{size:16}),"Visit testver.com",e.jsx(z,{size:14,className:"opacity-80"})]}),e.jsxs("a",{href:"https://docs.testver.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-surface-2 hover:bg-surface-3 text-gray-700 dark:text-gray-200 text-sm font-medium transition-colors ring-1 ring-white/10",children:[e.jsx(ie,{size:16}),"Documentation",e.jsx(z,{size:14,className:"opacity-60"})]}),e.jsxs("a",{href:"https://docs.testver.com/video-tutorials",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-surface-2 hover:bg-surface-3 text-gray-700 dark:text-gray-200 text-sm font-medium transition-colors ring-1 ring-white/10",children:[e.jsx(Ke,{size:16}),"Video tutorials",e.jsx(z,{size:14,className:"opacity-60"})]}),e.jsxs("a",{href:"https://support.testver.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-surface-2 hover:bg-surface-3 text-gray-700 dark:text-gray-200 text-sm font-medium transition-colors ring-1 ring-white/10",children:[e.jsx(oe,{size:16}),"Support",e.jsx(z,{size:14,className:"opacity-60"})]})]})]})]}),e.jsx("div",{className:"border-b border-white/5 bg-surface-1/40",children:e.jsxs("div",{className:"max-w-[1100px] mx-auto px-6 py-14",children:[e.jsxs("div",{className:"text-center mb-9",children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"One engine. Three surfaces."}),e.jsx("p",{className:"text-base text-gray-500 dark:text-gray-400 mt-2.5 max-w-2xl mx-auto leading-relaxed",children:"The same suites, runs, reporting, and AI work whether you're testing a browser, a device, or an endpoint."})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsx(q,{icon:e.jsx(ne,{size:22}),title:"Web Automation",desc:"Playwright, Selenium, Cypress, and more — run locally or on a cloud grid, with screenshots, video, and traces captured per test.",tint:"sky"}),e.jsx(q,{icon:e.jsx(Ze,{size:22}),title:"Mobile Automation",desc:"Appium on real devices and emulators, with live device mirroring while the test runs and native-locator recording.",tint:"emerald"}),e.jsx(q,{icon:e.jsx(Je,{size:22}),title:"API Automation",desc:"A full REST/GraphQL workspace — collections, environments, auth profiles, schema validation, and chained requests.",tint:"violet"})]})]})}),e.jsxs("div",{className:"max-w-[1100px] mx-auto px-6 py-16",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"What's inside"}),e.jsx("p",{className:"text-base text-gray-500 dark:text-gray-400 mt-2.5 max-w-2xl mx-auto leading-relaxed",children:"The pillars covering the full QA lifecycle — from authoring a case to gating a production deploy."})]}),e.jsxs("div",{className:"flex flex-wrap justify-center gap-4",children:[e.jsx(g,{icon:e.jsx(W,{size:20}),title:"AI Assistant",desc:"Conversational AI that writes, refactors, and explains tests — and can drive a real browser to investigate a failure.",tint:"purple"}),e.jsx(g,{icon:e.jsx(Qe,{size:20}),title:"AI Record",desc:"Click through your app once, on web or a device; Testver generates a clean, locator-stable test script.",tint:"cyan"}),e.jsx(g,{icon:e.jsx(ue,{size:20}),title:"AI Test Gen",desc:"Turn requirements, documents, JIRA tickets, or OpenAPI specs into traceable test cases in seconds.",tint:"amber"}),e.jsx(g,{icon:e.jsx(Ve,{size:20}),title:"Test Cases, Plans & Cycles",desc:"A first-class test management system — cases, plans, execution cycles, and a built-in defect tracker.",tint:"emerald"}),e.jsx(g,{icon:e.jsx(le,{size:20}),title:"Test Suites",desc:"Group any tests into a reusable suite in Test Explorer, then run them together with your own browser matrix, concurrency, and retries.",tint:"sky"}),e.jsx(g,{icon:e.jsx(Xe,{size:20}),title:"CI/CD Pipelines",desc:"GitHub Actions, GitLab, Jenkins, Azure, Bitbucket, and CircleCI trigger runs that execute here — and gate the build on the verdict.",tint:"indigo"}),e.jsx(g,{icon:e.jsx(ce,{size:20}),title:"Runs, Reports & AI Fix",desc:"Live execution, per-run artifacts, baselines and comparisons, AI failure analysis, and self-healing that repairs and re-runs a broken test.",tint:"rose"}),e.jsx(g,{icon:e.jsx(de,{size:20}),title:"Coverage & Traceability",desc:"See exactly which requirements are covered, by which cases, executed by which scripts, with which results.",tint:"blue"}),e.jsx(g,{icon:e.jsx(et,{size:20}),title:"Connectors",desc:"JIRA, Slack, MS Teams, Email, BrowserStack, LambdaTest, Sauce Labs — wired into the toolchain you already use.",tint:"teal"}),e.jsx(g,{icon:e.jsx(tt,{size:20}),title:"Agent Skills",desc:"Teach the AI your team's conventions with reusable skills — the assistant applies them whenever it writes or fixes your tests.",tint:"fuchsia"}),e.jsx(g,{icon:e.jsx(pe,{size:20}),title:"Testver Grid",desc:"Testver's own cloud browsers — Chromium, Firefox and WebKit on machines that are not yours, with no vendor account, no keys and no test-code changes. A prepaid add-on to a paid plan; connect once on Testver → Connections.",tint:"violet"}),e.jsx(g,{icon:e.jsx(H,{size:20}),title:"Testver Cloud",desc:"Your own always-on Testver at your-team.cloud.testver.com — built, patched, backed up and repaired for you, so schedules fire and the whole team shares one workspace without anyone's laptop.",tint:"sky"})]})]}),e.jsx("div",{className:"border-y border-white/5 bg-surface-1/40",children:e.jsx("div",{className:"max-w-[1100px] mx-auto px-6 py-14",children:e.jsx("div",{className:"rounded-2xl border border-violet-500/20 bg-gradient-to-br from-violet-500/[0.08] via-transparent to-cyan-500/[0.06] p-8 sm:p-10",children:e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-8",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-2.5 py-1 rounded-full bg-violet-500/12 ring-1 ring-violet-500/30 text-violet-700 dark:text-violet-300 text-xs font-semibold mb-4",children:[e.jsx(xe,{size:13}),"Testver AI Credits"]}),e.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"AI that works out of the box — no API keys to manage."}),e.jsxs("p",{className:"mt-3 text-base text-gray-500 dark:text-gray-400 leading-relaxed max-w-2xl",children:["Connect your Testver account and every AI feature is ready immediately. Usage draws from a shared pool of ",e.jsx("strong",{className:"text-gray-700 dark:text-gray-200",children:"credits"})," on your plan — visible live in the header ring, so you always know what's left before a long run starts."]}),e.jsxs("div",{className:"mt-6 grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsx(C,{icon:e.jsx(W,{size:15}),title:"Zero setup",desc:"No provider accounts, no keys, no billing plumbing."}),e.jsx(C,{icon:e.jsx(ce,{size:15}),title:"Transparent usage",desc:"A live ring shows credits used and remaining at a glance."}),e.jsx(C,{icon:e.jsx(ye,{size:15}),title:"Managed by Testver",desc:"Models are chosen, tuned and kept current by Testver — nothing to pick, upgrade or maintain."})]})]}),e.jsxs("a",{href:"https://testver.com/pricing",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-brand-500 hover:bg-brand-700 text-white text-sm font-semibold transition-colors shadow-lg shadow-brand-500/20 flex-shrink-0 self-start lg:self-center",children:[e.jsx(xe,{size:16}),"View plans",e.jsx(z,{size:14,className:"opacity-80"})]})]})})})}),e.jsxs("div",{className:"max-w-[1100px] mx-auto px-6 py-16",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs uppercase tracking-widest text-gray-500 mb-3",children:[e.jsx(oe,{size:14,className:"text-emerald-500 dark:text-emerald-400"}),"Feedback & report issues"]}),e.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Found a bug or have an idea? Tell us on the Support portal."}),e.jsxs("p",{className:"mt-3 text-base text-gray-500 dark:text-gray-400 leading-relaxed max-w-3xl",children:["Sign in to ",e.jsx("span",{className:"text-gray-700 dark:text-gray-300 font-medium",children:"support.testver.com"})," with the same Testver account you use here and open a ticket. Every report gets a tracked ticket with its own history, so you can follow progress, add details and get a reply from the team in one place — no email threads to chase."]}),e.jsxs("div",{className:"mt-8 grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsx(O,{icon:e.jsx(st,{size:18}),tint:"rose",title:"Report an issue",desc:"Something failed, crashed or behaved unexpectedly — in the tool, the Grid, Cloud runs or Testver Mail."}),e.jsx(O,{icon:e.jsx(rt,{size:18}),tint:"amber",title:"Suggest a feature",desc:"A framework, integration or workflow you wish Testver supported. Ideas with a clear use case go to the top of the list."}),e.jsx(O,{icon:e.jsx(at,{size:18}),tint:"sky",title:"Ask a question",desc:"Not sure how something is meant to work? Ask — and check the docs first, most setup questions are answered there."})]}),e.jsxs("div",{className:"mt-6 rounded-2xl bg-surface-1 ring-1 ring-white/10 p-6 sm:p-7",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-6",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-semibold text-gray-800 dark:text-gray-200",children:"What to include in a bug report"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:"The more of this you attach, the faster we can reproduce and fix it."}),e.jsxs("div",{className:"mt-4 grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-3",children:[e.jsx(C,{icon:e.jsx(le,{size:15}),title:"Steps to reproduce",desc:"What you did, what you expected and what actually happened."}),e.jsx(C,{icon:e.jsx(de,{size:15}),title:"Framework and target",desc:"Playwright, Cypress, Appium… and whether it ran locally, on the Grid or in the cloud."}),e.jsx(C,{icon:e.jsx(nt,{size:15}),title:"Screenshots or a recording",desc:"A picture of the error or a short screen recording of the failure."}),e.jsx(C,{icon:e.jsx(it,{size:15}),title:"Logs and version",desc:"The run log or error text, and which Testver version and operating system you are on."})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row lg:flex-col gap-3 flex-shrink-0",children:[e.jsxs("a",{href:"https://support.testver.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-brand-500 hover:bg-brand-700 text-white text-sm font-semibold transition-colors shadow-lg shadow-brand-500/20",children:[e.jsx(ot,{size:16}),"Open the Support portal",e.jsx(z,{size:14,className:"opacity-80"})]}),e.jsxs("a",{href:"https://docs.testver.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-surface-2 hover:bg-surface-3 ring-1 ring-white/10 text-gray-800 dark:text-gray-200 text-sm font-semibold transition-colors",children:[e.jsx(ie,{size:16}),"Check the docs first",e.jsx(ae,{size:14,className:"opacity-70"})]})]})]}),e.jsx("p",{className:"mt-5 text-xs text-gray-500 dark:text-gray-500",children:"One account for Testver, the dashboard and the Support portal — if you can sign in here, you can sign in there. Please don't paste passwords, API keys or tokens into a ticket; mask them before attaching logs."})]})]}),e.jsx("div",{children:e.jsxs("div",{className:"max-w-[1100px] mx-auto px-6 py-12",children:[e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-800 dark:text-gray-200",children:"Follow us"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1.5",children:"News, releases, and behind-the-scenes from the Testver team."})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Y,{href:"https://www.youtube.com/@TestverAI",label:"YouTube",icon:e.jsx(lt,{size:18}),hoverIcon:"hover:text-[#FF0000]",hoverBg:"hover:bg-[#FF0000]/10",hoverRing:"hover:ring-[#FF0000]/40"}),e.jsx(Y,{href:"https://www.linkedin.com/company/testver-ai",label:"LinkedIn",icon:e.jsx(ct,{size:18}),hoverIcon:"hover:text-[#0A66C2]",hoverBg:"hover:bg-[#0A66C2]/10",hoverRing:"hover:ring-[#0A66C2]/40"}),e.jsx(Y,{href:"https://x.com/testverai",label:"X",icon:e.jsx(ht,{size:16}),hoverIcon:"hover:text-gray-900 dark:hover:text-white",hoverBg:"hover:bg-gray-900/10 dark:hover:bg-white/10",hoverRing:"hover:ring-gray-900/30 dark:hover:ring-white/40"})]})]}),e.jsx("div",{className:"mt-10 text-center text-xs text-gray-500",children:"© Testver. All rights reserved."})]})})]})}const A={blue:{iconBg:"bg-blue-500/15",iconColor:"text-blue-600 dark:text-blue-400",ring:"ring-blue-500/20"},purple:{iconBg:"bg-purple-500/15",iconColor:"text-purple-600 dark:text-purple-400",ring:"ring-purple-500/20"},cyan:{iconBg:"bg-cyan-500/15",iconColor:"text-cyan-600 dark:text-cyan-400",ring:"ring-cyan-500/20"},emerald:{iconBg:"bg-emerald-500/15",iconColor:"text-emerald-600 dark:text-emerald-400",ring:"ring-emerald-500/20"},amber:{iconBg:"bg-amber-500/15",iconColor:"text-amber-600 dark:text-amber-400",ring:"ring-amber-500/20"},violet:{iconBg:"bg-violet-500/15",iconColor:"text-violet-600 dark:text-violet-400",ring:"ring-violet-500/20"},rose:{iconBg:"bg-rose-500/15",iconColor:"text-rose-600 dark:text-rose-400",ring:"ring-rose-500/20"},sky:{iconBg:"bg-sky-500/15",iconColor:"text-sky-600 dark:text-sky-400",ring:"ring-sky-500/20"},indigo:{iconBg:"bg-indigo-500/15",iconColor:"text-indigo-600 dark:text-indigo-400",ring:"ring-indigo-500/20"},teal:{iconBg:"bg-teal-500/15",iconColor:"text-teal-600 dark:text-teal-400",ring:"ring-teal-500/20"},fuchsia:{iconBg:"bg-fuchsia-500/15",iconColor:"text-fuchsia-600 dark:text-fuchsia-400",ring:"ring-fuchsia-500/20"}};function q({icon:t,title:a,desc:r,tint:i}){const n=A[i]??A.brand;return e.jsxs("div",{className:"group bg-surface-1 rounded-2xl border border-white/5 p-6 hover:border-white/15 transition-colors",children:[e.jsx("div",{className:`w-12 h-12 rounded-xl ${n.iconBg} ${n.iconColor} ring-1 ${n.ring} flex items-center justify-center mb-4`,children:t}),e.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:a}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-2 leading-relaxed",children:r})]})}function g({icon:t,title:a,desc:r,tint:i}){const n=A[i]??A.brand;return e.jsxs("div",{className:"group bg-surface-1 rounded-2xl border border-white/5 p-6 hover:border-white/15 hover:bg-white/[0.02] transition-colors w-full sm:w-[calc(50%-0.5rem)] lg:w-[calc(33.333%-0.667rem)]",children:[e.jsx("div",{className:`w-11 h-11 rounded-xl ${n.iconBg} ${n.iconColor} ring-1 ${n.ring} flex items-center justify-center mb-4`,children:t}),e.jsx("h3",{className:"text-[15px] font-semibold text-gray-900 dark:text-gray-100",children:a}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-2 leading-relaxed",children:r})]})}function O({icon:t,title:a,desc:r,tint:i}){const n=A[i]??A.blue;return e.jsxs("div",{className:"rounded-2xl bg-surface-1 ring-1 ring-white/10 p-5",children:[e.jsx("span",{className:`w-10 h-10 rounded-xl flex items-center justify-center ring-1 ${n.iconBg} ${n.iconColor} ${n.ring}`,children:t}),e.jsx("div",{className:"mt-3 text-sm font-semibold text-gray-800 dark:text-gray-200",children:a}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400 leading-relaxed",children:r})]})}function C({icon:t,title:a,desc:r}){return e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx("span",{className:"mt-0.5 w-7 h-7 rounded-lg bg-surface-2 ring-1 ring-white/10 text-violet-600 dark:text-violet-300 flex items-center justify-center flex-shrink-0",children:t}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-semibold text-gray-800 dark:text-gray-200",children:a}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-0.5 leading-relaxed",children:r})]})]})}function Y({icon:t,label:a,href:r,hoverIcon:i,hoverBg:n,hoverRing:l}){return e.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer","aria-label":a,title:a,className:["w-10 h-10 rounded-full bg-surface-1 ring-1 ring-white/10 text-gray-500 dark:text-gray-400","flex items-center justify-center transition-colors",i??"hover:text-brand-300",n??"hover:bg-white/5",l??"hover:ring-white/20"].join(" "),children:t})}function wt(){const t=ke(),a=we(),r=/\/about\/?$/.test(t.pathname)?"about":"connections",{data:i}=ge(),n=v=>{a(v==="about"?"/testver/about":"/testver",{replace:!0})},l=v=>`inline-flex items-center gap-2 px-3.5 py-3 text-sm font-medium border-b-2 transition-colors ${v?"text-gray-900 dark:text-gray-100 border-sky-400":"text-gray-500 dark:text-gray-400 border-transparent hover:text-gray-800 dark:hover:text-gray-200"}`;return e.jsxs("div",{className:"min-h-screen bg-surface-0 text-gray-200",children:[e.jsx("div",{className:"sticky top-0 z-10 bg-surface-1 border-b border-black/5 dark:border-white/5",children:e.jsxs("div",{className:"max-w-[1100px] mx-auto px-6 flex items-center gap-1",children:[e.jsxs("button",{type:"button",onClick:()=>n("connections"),className:l(r==="connections"),children:[i!=null&&i.connected?e.jsx(He,{size:15,className:"text-emerald-500"}):e.jsx(We,{size:15}),"Connections",(i==null?void 0:i.connected)&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 shadow-[0_0_0_3px_rgba(52,211,153,0.15)]"})]}),e.jsxs("button",{type:"button",onClick:()=>n("about"),className:l(r==="about"),children:[e.jsx(Ue,{size:15}),"About"]})]})}),r==="about"?e.jsx(gt,{}):e.jsx(mt,{})]})}export{wt as AboutPage};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as n,j as e,u as at,n as wt}from"./vendor-react-DOVfxdUy.js";import{u as kt}from"./useTabParam-CyYAP90W.js";import{u as fe,a as Ct}from"./vendor-query-DkZSMtfn.js";import{s as St,k as rt,l as Rt,m as Pt,n as zt,o as Tt,p as Et,q as It,t as At,v as Le,w as $t,b as nt,c as Dt,d as Lt,x as lt,y as ot,z as it,R as Ft,A as Mt,C as Bt,D as qt,E as Vt,F as Kt,G as _t,H as Ht,I as Ot,J as We,K as Gt,M as Ut}from"./index-D6sQYc_0.js";import{p as Wt,s as Qt}from"./ansiToHtml-DYRzYQV1.js";import{av as Xt,u as ct,ap as ie,C as ae,a0 as ue,b1 as Jt,b2 as Yt,an as Zt,_ as es,at as oe,X as Fe,b3 as ts,S as Ie,o as ss,c as dt,y as as,v as rs,b4 as xe,ag as Qe,b5 as ns,b6 as ls,b7 as Ae,a2 as pe,b8 as Xe,b9 as $e,J as De,G as os,a3 as Ce,ba as Je,bb as is}from"./vendor-icons-D_Dmmj8d.js";import{M as mt,R as cs}from"./MobileRunTarget-DHDoDZ_F.js";import{L as ds}from"./LiveExecutionView-CaIf7Jux.js";import{R as ms}from"./RunState-CRuS_bC2.js";import{h as us}from"./aiHandoff-vhtR29Fh.js";import{e as xs,b as we}from"./runSelected-WlgnZcSF.js";import{C as ps}from"./ConfirmDialog-DtotgVmI.js";import{s as fs}from"./visibleInterval-BKsLfJZ3.js";import{f as Ye}from"./formatDate-T65-Y6Mi.js";import{C as hs,i as bs}from"./CronBuilder-D2fERHt9.js";import"./SearchableDevicePicker-DubIldKj.js";const ke=5e3;function gs(o){const[t,c]=n.useState(null),[r,m]=n.useState([]),[u,i]=n.useState(null),[f,y]=n.useState(null),p=n.useRef([]),g=n.useRef(null),h=n.useCallback(()=>{const d=g.current;(d==null?void 0:d.raf)!=null&&cancelAnimationFrame(d.raf),(d==null?void 0:d.timer)!=null&&clearTimeout(d.timer),g.current=null;const P=p.current;P.length!==0&&(p.current=[],m(L=>{const A=L.concat(P);return A.length>ke?A.slice(A.length-ke):A}))},[]),N=n.useCallback(()=>{g.current||(g.current=typeof document<"u"&&document.hidden?{timer:setTimeout(h,100)}:{raf:requestAnimationFrame(h)})},[h]),E=n.useCallback(()=>{const d=g.current;(d==null?void 0:d.raf)!=null&&cancelAnimationFrame(d.raf),(d==null?void 0:d.timer)!=null&&clearTimeout(d.timer),g.current=null,p.current=[],m([])},[]);n.useEffect(()=>()=>{const d=g.current;(d==null?void 0:d.raf)!=null&&cancelAnimationFrame(d.raf),(d==null?void 0:d.timer)!=null&&clearTimeout(d.timer)},[]),n.useEffect(()=>{const d=()=>{document.hidden||h()};return document.addEventListener("visibilitychange",d),()=>document.removeEventListener("visibilitychange",d)},[h]),n.useEffect(()=>o(d=>{d.type==="output"&&d.runId===(t==null?void 0:t.runId)&&(y(null),p.current.push({stream:d.stream,data:d.data}),p.current.length>ke&&(p.current=p.current.slice(p.current.length-ke)),N()),d.type==="run-waiting-input"&&d.runId===(t==null?void 0:t.runId)&&y(d.prompt),d.type==="complete"&&d.runId===(t==null?void 0:t.runId)&&(h(),i({runId:t.runId,command:t.command,startTime:"",status:d.exitCode===0?"completed":"failed",exitCode:d.exitCode,duration:d.duration}),c(null),y(null))}),[o,t,h,N]);const $=n.useCallback(async d=>{E(),i(null);const P=await St(d);return c({runId:P.runId,command:P.command}),P},[E]),D=n.useCallback(async()=>{t&&(await rt(t.runId),c(null),y(null))},[t]),x=n.useCallback(async(d,P=!1)=>{t&&(y(null),await Rt(t.runId,P?{eof:!0}:{data:d}))},[t]),b=n.useCallback((d,P)=>{E(),i(null),c({runId:d,command:P})},[E]);return{activeRun:t,output:r,runResult:u,run:$,cancel:D,attachToRun:b,waitingPrompt:f,sendInput:x}}function ys(){return fe({queryKey:["runHistory"],queryFn:Pt,refetchInterval:5e3})}function js(o,t){const[c,r]=n.useState({current:0,total:0,currentTestName:"",passed:0,failed:0,tests:[],elapsedMs:0,summary:null}),m=n.useRef(null),u=n.useRef(null),i=n.useCallback(()=>{m.current=null,u.current&&(clearInterval(u.current),u.current=null),r({current:0,total:0,currentTestName:"",passed:0,failed:0,tests:[],elapsedMs:0,summary:null})},[]);return n.useEffect(()=>(t?(r({current:0,total:0,currentTestName:"",passed:0,failed:0,tests:[],elapsedMs:0,summary:null}),m.current=Date.now(),u.current=setInterval(()=>{m.current&&r(f=>({...f,elapsedMs:Date.now()-m.current}))},500)):!t&&m.current&&u.current&&(clearInterval(u.current),u.current=null),()=>{u.current&&(clearInterval(u.current),u.current=null)}),[t]),n.useEffect(()=>{if(t)return o(f=>{const y=f.runId;if(!(y&&y!==t)&&(f.type==="test-progress"&&r(p=>({...p,current:f.current,total:f.total||p.total,currentTestName:f.testName})),f.type==="test-passed"&&r(p=>({...p,passed:p.passed+1,tests:[...p.tests,{name:f.testName,status:"passed",duration:f.duration}]})),f.type==="test-failed"&&r(p=>({...p,failed:p.failed+1,tests:[...p.tests,{name:f.testName,status:"failed",duration:f.duration}]})),f.type==="test-results")){const p=f.summary;r(g=>({...g,summary:{runId:t,...p}}))}})},[o,t]),{...c,reset:i}}function vs(o){const t=[];let c="",r="stdout";for(const m of o){if(m.stream!==r&&c){const u=c.split(`
|
|
2
|
-
`);for(const i of u)i&&t.push({stream:r,data:i});c=""}r=m.stream,c+=m.data}if(c){const m=c.split(`
|
|
3
|
-
`);for(const u of m)u&&t.push({stream:r,data:u})}return t}function Ns({output:o}){const t=n.useRef(null);n.useEffect(()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight)},[o]);const c=n.useMemo(()=>vs(o),[o]);return e.jsxs("div",{ref:t,className:"flex-1 overflow-auto bg-black/40 rounded-lg p-4 font-mono text-xs leading-5",children:[c.length===0&&e.jsx("span",{className:"text-gray-600",children:"Waiting for output..."}),c.map((r,m)=>e.jsx(ws,{data:r.data,stream:r.stream},m))]})}const ws=n.memo(function({data:t,stream:c}){var u,i,f;const r=n.useMemo(()=>Wt(t),[t]),m=c==="stderr"?"text-red-400":c==="stdin"?"text-cyan-300":"text-gray-200";return c==="stdin"?e.jsxs("div",{className:m,children:[e.jsx("span",{className:"text-cyan-500/70 select-none",children:"› "}),t==="^D"?"^D (end of input)":t]}):r.length<=1&&!((u=r[0])!=null&&u.style.color)&&!((i=r[0])!=null&&i.style.bold)&&!((f=r[0])!=null&&f.style.dim)?e.jsx("div",{className:m,children:t}):e.jsx("div",{className:m,children:r.map((y,p)=>{const g=Qt(y.style);return Object.keys(g).length>0?e.jsx("span",{style:g,children:y.text},p):e.jsx("span",{children:y.text},p)})})});function ks(){const{data:o,isLoading:t}=ys(),c=(o==null?void 0:o.history)??[];return t?e.jsx("div",{className:"text-xs text-gray-500 p-3",children:"Loading history..."}):c.length===0?e.jsx("div",{className:"text-xs text-gray-500 p-4 text-center",children:"No previous runs"}):e.jsx("div",{className:"space-y-1.5 max-h-72 overflow-y-auto",children:c.map(r=>e.jsx(Cs,{run:r},r.runId))})}function Cs({run:o}){const t={completed:e.jsx(ae,{size:14,className:"text-emerald-400"}),failed:e.jsx(ie,{size:14,className:"text-red-400"}),running:e.jsx(ct,{size:14,className:"text-amber-400 animate-pulse"}),cancelled:e.jsx(Xt,{size:14,className:"text-gray-400"})};return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-surface-2 border border-white/5 text-xs",children:[t[o.status],e.jsx("span",{className:"font-mono text-gray-300 flex-1 truncate",children:o.command}),o.duration!=null&&e.jsxs("span",{className:"text-gray-500",children:[(o.duration/1e3).toFixed(1),"s"]}),o.startTime&&e.jsx("span",{className:"text-gray-600 text-[10px]",children:new Date(o.startTime).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})}function Ss({current:o,passed:t,failed:c,currentTestName:r,tests:m,elapsedMs:u}){const i=t+c,f=Math.round(u/1e3);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex-1 bg-surface-2 rounded-full h-2 overflow-hidden",children:e.jsx("div",{className:"h-full flex",children:i>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bg-emerald-500 transition-all",style:{width:`${t/Math.max(i,1)*100}%`}}),e.jsx("div",{className:"bg-red-500 transition-all",style:{width:`${c/Math.max(i,1)*100}%`}})]})})}),e.jsxs("span",{className:"text-xs text-gray-500 flex-shrink-0",children:[f,"s"]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsxs("span",{className:"text-gray-400",children:["Test #",o]}),e.jsxs("span",{className:"text-emerald-400 flex items-center gap-1",children:[e.jsx(ae,{size:12})," ",t]}),e.jsxs("span",{className:"text-red-400 flex items-center gap-1",children:[e.jsx(ie,{size:12})," ",c]}),r&&e.jsxs("span",{className:"text-gray-500 flex items-center gap-1 truncate",children:[e.jsx(ue,{size:12,className:"animate-spin"}),e.jsx("span",{className:"truncate",children:r})]})]}),e.jsx("div",{className:"max-h-64 overflow-y-auto space-y-0.5",children:m.slice(-30).map((y,p)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs py-0.5 animate-slide-in",children:[y.status==="passed"?e.jsx(ae,{size:12,className:"text-emerald-400 flex-shrink-0"}):e.jsx(ie,{size:12,className:"text-red-400 flex-shrink-0"}),e.jsx("span",{className:`truncate ${y.status==="passed"?"text-gray-400":"text-red-300"}`,children:y.name})]},p))})]})}function Rs({runId:o,summary:t,onRerunFailed:c}){const r=at(),m=t.passRate>=90?"text-emerald-400":t.passRate>=70?"text-amber-400":"text-red-400",u=t.passRate>=90?"bg-emerald-500/10":t.passRate>=70?"bg-amber-500/10":"bg-red-500/10",i=t.failed===0,f=()=>r(`/results?runId=${encodeURIComponent(o)}`);return e.jsxs("div",{className:`rounded-xl border border-white/5 px-4 py-2.5 ${u} flex items-center gap-x-4 gap-y-2 flex-wrap`,children:[e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[i?e.jsx(ae,{size:16,className:"text-emerald-400"}):e.jsx(ie,{size:16,className:"text-red-400"}),e.jsx("span",{className:"text-sm font-semibold text-gray-200",children:"Run Complete"}),e.jsxs("span",{className:"text-xs text-gray-500",children:["· ",(t.duration/1e3).toFixed(1),"s"]})]}),e.jsx("span",{className:"w-px h-5 bg-white/10 hidden sm:block"}),e.jsxs("div",{className:"flex items-center gap-3.5 text-sm tabular-nums",children:[e.jsxs("span",{className:"text-gray-300",children:[e.jsx("span",{className:"font-bold text-gray-100",children:t.total})," ",e.jsx("span",{className:"text-gray-500 text-xs",children:"total"})]}),e.jsxs("span",{className:"flex items-center gap-1 text-emerald-400",title:"Passed",children:[e.jsx(ae,{size:13})," ",t.passed]}),e.jsxs("span",{className:`flex items-center gap-1 ${t.failed>0?"text-red-400":"text-gray-500"}`,title:"Failed",children:[e.jsx(ie,{size:13})," ",t.failed]}),e.jsxs("span",{className:"flex items-center gap-1 text-gray-500",title:"Skipped",children:[e.jsx(Jt,{size:13})," ",t.skipped]}),e.jsxs("span",{className:`font-bold ${m}`,children:[t.passRate,"%",e.jsx("span",{className:"text-gray-500 text-xs font-normal ml-1",children:"pass"})]})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2 flex-shrink-0",children:[t.failed>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:f,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-purple-500/15 text-purple-300 text-xs font-medium hover:bg-purple-500/25 transition-colors",children:[e.jsx(Yt,{size:12})," Analyze"]}),c&&e.jsxs("button",{onClick:c,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-surface-2 text-gray-300 text-xs font-medium hover:bg-surface-3 transition-colors",children:[e.jsx(Zt,{size:12})," Re-run Failed"]})]}),e.jsxs("button",{onClick:f,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-surface-2 text-gray-300 text-xs font-medium hover:bg-surface-3 transition-colors",children:[e.jsx(es,{size:12})," View Details"]})]})]})}function Ps({open:o,analysis:t,providerLabel:c,onAiFix:r,onSkipAndRun:m,onCancel:u}){return o?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:u}),e.jsxs("div",{className:"relative bg-surface-1 rounded-xl border border-white/10 p-0 w-[760px] max-w-[92vw] max-h-[85vh] animate-fade-in flex flex-col",children:[e.jsx("div",{className:"px-6 pt-5 pb-4 border-b border-white/5",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 bg-amber-500/15",children:e.jsx(oe,{size:20,className:"text-amber-400"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-base font-semibold text-gray-100",children:["Not connected to ",c," yet"]}),e.jsx("p",{className:"text-sm text-gray-400 mt-0.5",children:"This project's driver setup doesn't honor Testver's cloud settings — the run would silently execute on a local browser."})]})]}),e.jsx("button",{onClick:u,className:"text-gray-500 hover:text-gray-300 p-1",children:e.jsx(Fe,{size:18})})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:[e.jsxs("div",{className:"bg-surface-2 rounded-lg p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-gray-400 uppercase tracking-wide",children:[e.jsx(ts,{size:14}),"Detection Summary"]}),e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-x-4 gap-y-1.5 text-sm",children:[e.jsx("div",{className:"text-gray-500",children:"Framework:"}),e.jsx("div",{className:"text-gray-200",children:t.framework||"Unknown"}),e.jsx("div",{className:"text-gray-500",children:"Language:"}),e.jsx("div",{className:"text-gray-200",children:t.language||"Unknown"}),e.jsx("div",{className:"text-gray-500",children:"Driver file (guess):"}),e.jsx("div",{className:"text-gray-200 font-mono text-xs break-all",children:t.hookFile||"Not located"})]}),e.jsx("p",{className:"text-[11px] text-gray-500 pt-1",children:"The driver file is a best-guess from a code scan — the AI Assistant verifies it (and looks for other driver-creation sites) before touching anything."})]}),e.jsxs("div",{className:"bg-brand-500/10 border border-brand-500/20 rounded-lg p-4 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-brand-300",children:[e.jsx(Ie,{size:15}),"Fix with AI Assistant"]}),e.jsxs("p",{className:"text-sm text-gray-300",children:["The AI Assistant makes the smallest change that connects this framework to ",c,", runs one test to verify, and confirms real cloud execution from the run's ground-truth verdict — self-correcting if verification fails, and undoing everything if it can't succeed."]}),e.jsx("p",{className:"text-xs text-gray-500",children:"You'll see every edit and the verification run in the AI Assistance screen. Requires an AI provider (Settings → LLM). Verification runs use a small amount of cloud minutes."})]}),e.jsxs("div",{className:"bg-surface-2 rounded-lg p-3 flex items-start gap-2",children:[e.jsx(ss,{size:14,className:"text-gray-500 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-xs text-gray-500",children:'"Run anyway" injects the cloud environment variables and runs as-is — if your code already reads them this works, otherwise the run lands locally and its result will carry a "executed locally" warning.'})]})]}),e.jsxs("div",{className:"px-6 py-4 border-t border-white/5 flex justify-end gap-2",children:[e.jsx("button",{onClick:u,className:"px-4 py-2 text-sm rounded-lg bg-surface-2 hover:bg-surface-3 text-gray-300",children:"Cancel"}),e.jsx("button",{onClick:m,className:"px-4 py-2 text-sm rounded-lg bg-surface-2 hover:bg-surface-3 text-gray-300 border border-white/5",children:"Run Anyway"}),e.jsxs("button",{onClick:r,className:"flex items-center gap-1.5 px-4 py-2 text-sm rounded-lg bg-brand-600 hover:bg-brand-500 text-white font-medium",children:[e.jsx(Ie,{size:14}),"Fix with AI Assistant"]})]})]})]}):null}const zs="testver-runner-recent",Ze="testver-runner-recent",Ts=10;try{localStorage.getItem(Ze)!==null&&localStorage.removeItem(Ze)}catch{}function Es(o){return`${zs}:${o||"unknown"}`}function et(o){try{const t=localStorage.getItem(o),c=t?JSON.parse(t):[];return Array.isArray(c)?c.filter(r=>typeof r=="string"):[]}catch{return[]}}function ut(){const o=Ct(),{data:t}=fe({queryKey:["runner-commands"],queryFn:zt,staleTime:3e4}),c=(t==null?void 0:t.commands)||[],{data:r}=Tt(),m=Es(r==null?void 0:r.rootPath),u=n.useCallback(async(g,h)=>{const N=await Et(g,h);o.setQueryData(["runner-commands"],N)},[o]),i=n.useCallback(async(g,h)=>{const N=await It(g,h);o.setQueryData(["runner-commands"],N)},[o]),f=n.useCallback(async g=>{const h=await At(g);o.setQueryData(["runner-commands"],h)},[o]),y=n.useCallback(g=>{const h=g.trim();if(!h)return;const N=[h,...et(m).filter(E=>E!==h)].slice(0,Ts);try{localStorage.setItem(m,JSON.stringify(N))}catch{}},[m]);return{saved:[...c].sort((g,h)=>(h.pinned?1:0)-(g.pinned?1:0)||g.label.localeCompare(h.label)),add:u,update:i,remove:f,pushRecent:y,recent:et(m)}}function Is({framework:o,saved:t,recent:c,disabled:r,onPick:m,onRun:u,onSave:i,onUpdate:f,onDelete:y}){var X,w,ne;const[p,g]=n.useState(!1),[h,N]=n.useState(""),[E,$]=n.useState(!1),[D,x]=n.useState(""),[b,d]=n.useState(""),[P,L]=n.useState(null),[A,B]=n.useState(""),[z,U]=n.useState(""),[T,q]=n.useState(null),V=n.useRef(null);n.useEffect(()=>{if(!p)return;const l=S=>{T||V.current&&!V.current.contains(S.target)&&g(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[p,T]);const{data:_}=fe({queryKey:["run-commands-config"],queryFn:Le,staleTime:1e4}),W=(((w=(X=_==null?void 0:_.configured)==null?void 0:X.fullRun)==null?void 0:w.trim())||((ne=_==null?void 0:_.autoDetected)==null?void 0:ne.fullRun)||"").trim(),F=W?[{label:"Run All",command:W}]:[],a=h.trim().toLowerCase(),v=(l,S)=>!a||l.toLowerCase().includes(a)||S.toLowerCase().includes(a),I=t.filter(l=>v(l.label,l.command)),J=F.filter(l=>v(l.label,l.command)),H=c.filter(l=>v(l,l)),Y=l=>{m(l),g(!1)},O=l=>{u(l),g(!1)},re=()=>{$(!1),x(""),d("")},Q=()=>{const l=D.trim(),S=b.trim();l&&S&&(i(l,S),re())},he=l=>{L(l.id),B(l.label),U(l.command)},te=l=>{A.trim()&&z.trim()&&(f(l,{label:A.trim(),command:z.trim()}),L(null))};return e.jsxs("div",{className:"relative flex-shrink-0",ref:V,children:[e.jsxs("button",{type:"button",onClick:()=>g(l=>!l),disabled:r,title:"Saved commands, presets & recent",className:"flex items-center gap-1.5 px-3 py-2 rounded-xl bg-surface-2 border border-white/10 text-sm font-medium text-gray-300 hover:text-gray-100 hover:border-white/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(dt,{size:15}),e.jsx("span",{children:"Commands"}),e.jsx(as,{size:13,className:`transition-transform ${p?"rotate-180":""}`})]}),p&&e.jsxs("div",{className:"absolute right-0 top-full mt-2 z-50 w-[420px] max-h-[70vh] overflow-hidden flex flex-col rounded-xl bg-white dark:bg-surface-1 border border-gray-200 dark:border-white/10 shadow-2xl",children:[e.jsx("div",{className:"p-2 border-b border-gray-100 dark:border-white/5",children:e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 rounded-lg bg-gray-100 dark:bg-surface-2",children:[e.jsx(rs,{size:13,className:"text-gray-400"}),e.jsx("input",{autoFocus:!0,value:h,onChange:l=>N(l.target.value),placeholder:"Search commands…",className:"flex-1 bg-transparent text-sm text-gray-700 dark:text-gray-200 outline-none placeholder-gray-400"}),h&&e.jsx("button",{onClick:()=>N(""),children:e.jsx(Fe,{size:13,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-200"})})]})}),e.jsxs("div",{className:"overflow-y-auto",children:[e.jsx("div",{className:"p-2 border-b border-gray-100 dark:border-white/5",children:E?e.jsxs("div",{className:"space-y-2 px-1 py-1",children:[e.jsx("input",{autoFocus:!0,value:D,onChange:l=>x(l.target.value),onKeyDown:l=>{l.key==="Escape"&&re()},placeholder:"Command name (e.g. Smoke — headed)",className:"w-full bg-gray-100 dark:bg-surface-2 rounded-lg px-2.5 py-1.5 text-sm text-gray-700 dark:text-gray-200 outline-none placeholder-gray-400"}),e.jsx("input",{value:b,onChange:l=>d(l.target.value),onKeyDown:l=>{l.key==="Enter"&&Q(),l.key==="Escape"&&re()},placeholder:"Command (e.g. npx playwright test --headed)",className:"w-full bg-gray-100 dark:bg-surface-2 rounded-lg px-2.5 py-1.5 text-sm font-mono text-gray-700 dark:text-gray-200 outline-none placeholder-gray-400"}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{onClick:re,className:"px-2.5 py-1.5 rounded-lg text-sm text-gray-500 hover:bg-black/5 dark:hover:bg-white/5",children:"Cancel"}),e.jsxs("button",{onClick:Q,disabled:!D.trim()||!b.trim(),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-sm font-medium bg-brand-500/15 text-brand-500 hover:bg-brand-500/25 disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(Qe,{size:14})," Add"]})]})]}):e.jsxs("button",{onClick:()=>$(!0),className:"w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-sm font-medium text-brand-600 dark:text-brand-300 hover:bg-brand-500/10 transition-colors",children:[e.jsx(xe,{size:14})," Add Command"]})}),I.length>0&&e.jsx(Te,{title:"Saved",children:I.map(l=>P===l.id?e.jsxs("div",{className:"space-y-2 px-3 py-2 bg-white dark:bg-surface-1",children:[e.jsx("input",{autoFocus:!0,value:A,onChange:S=>B(S.target.value),onKeyDown:S=>{S.key==="Escape"&&L(null)},placeholder:"Command name",className:"w-full bg-gray-100 dark:bg-surface-2 rounded-lg px-2.5 py-1.5 text-sm text-gray-700 dark:text-gray-200 outline-none placeholder-gray-400"}),e.jsx("input",{value:z,onChange:S=>U(S.target.value),onKeyDown:S=>{S.key==="Enter"&&te(l.id),S.key==="Escape"&&L(null)},placeholder:"Command",className:"w-full bg-gray-100 dark:bg-surface-2 rounded-lg px-2.5 py-1.5 text-sm font-mono text-gray-700 dark:text-gray-200 outline-none placeholder-gray-400"}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{onClick:()=>L(null),className:"px-2.5 py-1.5 rounded-lg text-sm text-gray-500 hover:bg-black/5 dark:hover:bg-white/5",children:"Cancel"}),e.jsxs("button",{onClick:()=>te(l.id),disabled:!A.trim()||!z.trim(),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-sm font-medium bg-brand-500/15 text-brand-500 hover:bg-brand-500/25 disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(Qe,{size:14})," Save"]})]})]},l.id):e.jsx(Ee,{label:l.label,command:l.command,onPick:()=>Y(l.command),onRun:()=>O(l.command),actions:e.jsxs(e.Fragment,{children:[e.jsx(le,{title:l.pinned?"Unpin":"Pin",onClick:()=>f(l.id,{pinned:!l.pinned}),children:e.jsx(ns,{size:13,className:l.pinned?"fill-amber-400 text-amber-400":""})}),e.jsx(le,{title:"Edit",onClick:()=>he(l),children:e.jsx(ls,{size:13})}),e.jsx(le,{title:"Delete",onClick:()=>q(l),children:e.jsx(Ae,{size:13})})]})},l.id))}),J.length>0&&e.jsx(Te,{title:"Presets",children:J.map(l=>e.jsx(Ee,{label:l.label,command:l.command,onPick:()=>Y(l.command),onRun:()=>O(l.command),actions:e.jsx(le,{title:"Save to my commands",onClick:()=>i(l.label,l.command),children:e.jsx(xe,{size:13})})},l.label))}),H.length>0&&e.jsx(Te,{title:"Recent",children:H.map((l,S)=>e.jsx(Ee,{label:l,command:l,mono:!0,onPick:()=>Y(l),onRun:()=>O(l),actions:e.jsx(le,{title:"Save to my commands",onClick:()=>i(l.length>40?l.slice(0,40)+"…":l,l),children:e.jsx(xe,{size:13})})},`${l}-${S}`))}),I.length===0&&J.length===0&&H.length===0&&e.jsxs("p",{className:"px-4 py-6 text-center text-sm text-gray-400",children:["No commands match “",h,"”."]})]})]}),e.jsx(ps,{open:!!T,title:"Delete command?",description:T?`“${T.label}” (${T.command}) will be permanently removed from your saved commands. This can’t be undone.`:"",confirmLabel:"Delete",onConfirm:()=>{T&&y(T.id),q(null)},onCancel:()=>q(null)})]})}function Te({title:o,children:t}){return e.jsxs("div",{className:"py-1",children:[e.jsx("p",{className:"px-3 pt-2 pb-1 text-[10px] font-semibold uppercase tracking-wider text-gray-400 capitalize",children:o}),t]})}function le({title:o,onClick:t,children:c}){return e.jsx("button",{type:"button",title:o,onClick:r=>{r.stopPropagation(),t()},className:"p-1.5 rounded-md text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-black/5 dark:hover:bg-white/10 transition-colors",children:c})}function Ee({label:o,command:t,mono:c,onPick:r,onRun:m,actions:u}){return e.jsxs("div",{className:"group flex items-center gap-1 pl-3 pr-2 py-1.5 hover:bg-black/[0.04] dark:hover:bg-white/5 transition-colors",children:[e.jsxs("button",{type:"button",onClick:r,className:"flex-1 min-w-0 text-left",title:t,children:[e.jsx("span",{className:`block text-sm text-gray-700 dark:text-gray-200 truncate ${c?"font-mono text-[13px]":"font-medium"}`,children:o}),!c&&e.jsx("span",{className:"block text-[11px] text-gray-400 font-mono truncate",children:t})]}),e.jsxs("div",{className:"flex items-center flex-shrink-0",children:[u,e.jsx(le,{title:"Run now",onClick:m,children:e.jsx(pe,{size:13,className:"text-brand-500"})})]})]})}const se={browserstack:"BrowserStack",lambdatest:"LambdaTest",saucelabs:"Sauce Labs","local-appium":"Local Devices","testver-grid":"Testver Grid"};function As(){var He,Oe,Ge,Ue;const{project:o,subscribe:t}=wt(),{runs:c}=$t(),{toast:r}=nt(),m=Dt(),u=at(),{activeRun:i,output:f,runResult:y,run:p,cancel:g,attachToRun:h,waitingPrompt:N,sendInput:E}=gs(t),[$,D]=n.useState(""),[x,b]=n.useState(!1),[d,P]=n.useState(null),L=n.useRef(null);n.useEffect(()=>{var s;N&&((s=L.current)==null||s.focus())},[N]),n.useEffect(()=>{i||(D(""),P(null))},[i]);const A=async(s=!1)=>{var j;if(!(!i||x)){b(!0),P(null);try{await E(s?"":$,s),s||D("")}catch(k){P(String((k==null?void 0:k.message)||k))}finally{b(!1),(j=L.current)==null||j.focus()}}},B=(c??[]).filter(s=>s.runId!==(i==null?void 0:i.runId)),z=js(t,(i==null?void 0:i.runId)??null),{data:U}=Lt(),T=ut(),[q,V]=n.useState(""),[_,W]=n.useState(!1),{data:F}=fe({queryKey:["run-commands-config"],queryFn:Le,staleTime:1e4}),a=(((Oe=(He=F==null?void 0:F.configured)==null?void 0:He.fullRun)==null?void 0:Oe.trim())||((Ge=F==null?void 0:F.autoDetected)==null?void 0:Ge.fullRun)||"").trim(),v=((Ue=F==null?void 0:F.autoDetected)==null?void 0:Ue.wdioSuites)??[],I=new Set(v.map(s=>s.config)).size>1,J=[...a?[{id:"preset-run-all",label:"Run All",command:a,preset:!0}]:[],...v.map(s=>({id:`preset-wdio-suite-${s.config}-${s.name}`,label:`Suite: ${s.name}${I?` (${s.config.split("/").pop()})`:""}`,command:s.command,preset:!0})),...T.saved.map(s=>({id:s.id,label:s.label,command:s.command}))],H=q.trim().toLowerCase(),Y=H?J.filter(s=>s.command.toLowerCase()!==H&&(s.command.toLowerCase().includes(H)||s.label.toLowerCase().includes(H))):J,[O,re]=n.useState([]),[Q,he]=n.useState(!1),[te,X]=n.useState("local"),w=te,[ne,l]=n.useState(""),[S,xt]=n.useState(!1),[M,pt]=n.useState({deviceName:"",platformName:"Android",platformVersion:"",appId:"",appPath:""}),{showsMobile:Se,mode:Me}=lt(),ft=Me!=="mobile"&&/\bplaywright(\.cmd)?\s+test\b|\bcypress\s+run\b/i.test(q),K=Se&&!ft&&w!=="local"&&w!=="testver-grid",be=Me==="mobile",ge=be&&O.length===0&&!Q,Re=!K||!!M.deviceName&&(!!M.appId||!!M.appPath.trim()),[Z,Be]=n.useState(null);n.useEffect(()=>{if(!K){Be(null);return}let s=!1;const j=()=>{Mt().then(C=>{s||Be(C.ticket)}).catch(()=>{})};j();const k=fs(j,5e3);return()=>{s=!0,k()}},[K]);const[qe,ye]=n.useState(!1),[ce,je]=n.useState(null),[Ve,Ke]=n.useState(!1);n.useEffect(()=>{ot().then(s=>{const j=s.providers.filter(k=>k.enabled);re(j)}).catch(()=>{}),it().then(({config:s})=>he(!!s.enabled)).catch(()=>he(!1))},[]),n.useEffect(()=>{if(!(!be||w!=="local"))if(Q)X("local-appium");else{const s=O.filter(j=>j.id!=="testver-grid");s.length>0&&X(s[0].id)}},[be,Q,O,w]);const de=async(s,j)=>{const k=(s??q).trim(),C=j??te;try{const R={command:k,asTyped:!0,fromRunner:!0,...C==="local"?{plainCommand:!0}:{}};C!=="local"&&(R.cloudProvider=C,ne.trim()&&(R.buildName=ne.trim()),C==="testver-grid"&&S&&(R.gridTunnel=!0),K&&!j&&(M.deviceName&&(R.deviceName=M.deviceName),M.platformName&&(R.platformName=M.platformName),M.platformVersion&&(R.platformVersion=M.platformVersion),M.appId&&(R.appId=M.appId),M.appPath.trim()&&(R.appPath=M.appPath.trim()),Z&&!Z.claimed&&Date.now()<Z.expiresAt&&(R.reuseSessionId=Z.sessionId))),await p(R),T.pushRecent(k);const ee=C==="local"?"locally":`on ${se[C]||C}`;r("info",`Test run started ${ee}`)}catch(R){r("error",R.message||"The run could not be started")}},me=(s,j)=>m(()=>ht(s,j),{files:(s??q).split(/\s+/).filter(k=>/\.(spec|test)\.|\.(ts|tsx|js|jsx|py|java|cs|feature|robot)$/.test(k))}),ht=async(s,j)=>{const k=(s??q).trim(),C=j??te;if(!k){r("error","Please enter a run command");return}if(s!==void 0&&V(s),ge){r("error","Connect a device or enable a cloud grid in Connectors first");return}if(K&&!j&&!Re){r("error","Select a device and an app first");return}if(C==="local"){await de(k,j);return}if(K&&!j){await de(k,j);return}Ke(!0);try{const R=await Kt(C,k);je(R),R.cloudReady||R.alreadyPatched?await de(k,j):ye(!0)}catch(R){r("error",`Cloud analysis failed: ${R}`),await de(k,j)}finally{Ke(!1)}},bt=async s=>{try{const[{tests:j},k,C]=await Promise.all([Bt(s),qt(),Vt(s).catch(()=>null)]),R=j.filter(Ne=>Ne.status==="failed"||Ne.status==="error"),{tests:ee,unmatched:Pe}=xs(R,k.suites);if(ee.length===0){r("error","The failed tests were not found in Test Explorer — run them from there.");return}Pe>0&&r("info",`${Pe} failed test${Pe===1?" was":"s were"} not found in Test Explorer — re-running the other ${ee.length}.`);const G=C?C.source==="cloud"&&C.cloudProvider?String(C.cloudProvider):C.source==="local"||!C.source?"local":void 0:void 0;if(G&&G!==te){const Ne=G==="local"||(G==="local-appium"?Q:O.some(Nt=>Nt.id===G)),ze=G==="local"?"this machine":se[G]||G;if(!Ne){r("error",`That run ran on ${ze}, which is not set up now — pick a target and run the failed tests from the Run Command field.`),V(we(ee));return}if(C!=null&&C.targetDevice){X(G),V(we(ee)),r("info",`That run ran on ${ze} — check the device and app, then press Run.`);return}r("info",`Re-running on ${ze}, where the run executed.`),me(we(ee),G);return}me(we(ee))}catch(j){r("error",j.message||"The failed tests could not be re-run")}},gt=()=>{const s=(ce==null?void 0:ce.aiFixPrompt)||`Make this project run on ${se[w]||w} through Testver's cloud environment variables without changing local behavior, then verify with one test run and check the run's cloudExecution verdict.`;ye(!1),je(null),us(u,{prompt:s,mode:"web"})},yt=async()=>{ye(!1),je(null),await de()},jt=()=>{ye(!1),je(null)},vt=s=>{s.key==="Enter"&&!i&&me()},_e=!K&&w==="testver-grid"&&!!i,ve=K&&!!i||_e;return e.jsxs("div",{className:`h-full flex animate-fade-in ${ve?"":"flex-col"}`,children:[e.jsxs("div",{className:ve?"flex-1 flex flex-col overflow-hidden":"contents",children:[e.jsxs("div",{className:"px-6 py-4 border-b border-white/5 bg-surface-1 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("h1",{className:"text-2xl font-bold text-gray-100 flex items-center gap-2.5",children:[e.jsx(dt,{size:22,className:"text-brand-400"}),"Runner"]}),e.jsx(Is,{saved:T.saved,recent:T.recent,onPick:s=>V(s),onRun:s=>{if(i){r("error","A run is already in progress — stop it first");return}me(s)},onSave:T.add,onUpdate:T.update,onDelete:T.remove})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx("label",{className:"text-sm font-medium text-gray-400 block mb-1",children:"Enter any run command to execute on the connected server"}),e.jsx("input",{value:q,onChange:s=>{V(s.target.value),W(!0)},onKeyDown:vt,onFocus:()=>W(!0),onBlur:()=>setTimeout(()=>W(!1),120),placeholder:"e.g., npm install or npx playwright test --headed",className:"w-full bg-surface-2 border border-white/10 rounded-xl px-3.5 py-2.5 text-[15px] text-gray-200 font-mono outline-none placeholder-gray-600 focus:border-brand-500/50",disabled:!!i}),_&&!i&&Y.length>0&&e.jsxs("div",{className:"absolute left-0 right-0 top-full mt-1 z-30 rounded-xl bg-white dark:bg-surface-1 border border-gray-200 dark:border-white/10 shadow-2xl py-1 overflow-hidden",children:[e.jsx("p",{className:"px-3 pt-1.5 pb-1 text-[10px] font-semibold uppercase tracking-wider text-gray-400",children:"Commands"}),e.jsx("div",{className:"max-h-[228px] overflow-y-auto",children:Y.map(s=>e.jsxs("button",{onMouseDown:j=>{j.preventDefault(),V(s.command),W(!1)},className:"w-full text-left px-3 py-1.5 hover:bg-black/[0.04] dark:hover:bg-white/5 transition-colors",title:s.command,children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-200 truncate",children:s.label}),s.preset&&e.jsx("span",{className:"px-1.5 py-0 rounded text-[9px] font-semibold bg-brand-500/15 text-brand-500 flex-shrink-0",children:"preset"})]}),e.jsx("span",{className:"block text-[11px] font-mono text-gray-400 truncate",children:s.command})]},s.id))})]})]}),e.jsx("div",{className:"flex items-end gap-2",children:i?e.jsxs("button",{onClick:g,className:"flex items-center justify-center gap-2 px-5 py-2.5 rounded-xl bg-red-600 hover:bg-red-500 text-white text-[15px] font-medium",children:[e.jsx(Xe,{size:14}),"Stop"]}):e.jsx("button",{onClick:()=>me(),disabled:Ve||ge||K&&!Re,title:ge?"Connect a local device or enable a cloud grid in Connectors first":K&&!Re?"Select a device and an app first":void 0,className:"flex items-center justify-center gap-2 px-5 py-2.5 rounded-xl bg-brand-600 hover:bg-brand-500 text-white text-[15px] font-medium disabled:opacity-60 disabled:cursor-not-allowed",children:Ve?e.jsxs(e.Fragment,{children:[e.jsx(oe,{size:14,className:"animate-pulse"}),"Checking..."]}):e.jsxs(e.Fragment,{children:[e.jsx(pe,{size:14}),"Run"]})})})]}),(O.length>0||Se&&Q)&&e.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-gray-400",children:"Run on:"}),e.jsxs("div",{className:"flex gap-1.5",children:[!be&&e.jsxs("button",{onClick:()=>X("local"),disabled:!!i,className:`flex items-center gap-1.5 px-2.5 h-8 text-xs rounded-lg border transition-colors ${w==="local"?"border-brand-500/50 bg-brand-500/10 text-brand-400 font-medium":"border-white/5 bg-surface-2 text-gray-400 hover:text-gray-300 hover:border-white/10"} disabled:opacity-50`,children:[e.jsx($e,{size:12}),"Local"]}),O.map(s=>e.jsxs("button",{onClick:()=>X(s.id),disabled:!!i,className:`flex items-center gap-1.5 px-2.5 h-8 text-xs rounded-lg border transition-colors ${w===s.id?"border-blue-500/50 bg-blue-500/10 text-blue-300 font-medium":"border-white/5 bg-surface-2 text-gray-400 hover:text-gray-300 hover:border-white/10"} disabled:opacity-50`,children:[e.jsx(oe,{size:12}),se[s.id]]},s.id)),Se&&Q&&e.jsxs("button",{onClick:()=>X("local-appium"),disabled:!!i,className:`flex items-center gap-1.5 px-2.5 h-8 text-xs rounded-lg border transition-colors ${w==="local-appium"?"border-gray-300 dark:border-white/25 bg-gray-100/70 dark:bg-white/[0.08] text-gray-800 dark:text-gray-100 font-medium":"border-white/5 bg-surface-2 text-gray-400 hover:text-gray-300 hover:border-white/10"} disabled:opacity-50`,children:[e.jsx(De,{size:12}),"Local Devices"]})]}),w==="testver-grid"&&e.jsx("div",{className:"flex flex-wrap items-center gap-3",children:e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-gray-400 cursor-pointer select-none",title:"Let grid browsers reach your localhost / private apps — outbound tunnel, scoped to localhost + your baseURL host, closed when the run ends",children:[e.jsx("input",{type:"checkbox",checked:S,onChange:s=>xt(s.target.checked),disabled:!!i,className:"rounded border-gray-600 bg-surface-2 text-brand-500 focus:ring-brand-500"}),"Local tunnel"]})}),w!=="local"&&w!=="local-appium"&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-sm text-gray-500",children:"Build:"}),e.jsx("input",{value:ne,onChange:s=>l(s.target.value),placeholder:"auto",className:"w-36 bg-surface-2 border border-white/10 rounded-xl px-3 py-1.5 text-sm text-gray-300 outline-none placeholder-gray-600 focus:border-brand-500/50",disabled:!!i})]})]}),ge&&e.jsxs("div",{className:"mt-3 flex items-start gap-2.5 px-3.5 py-3 rounded-xl border border-amber-500/25 bg-amber-500/10 text-sm text-amber-700 dark:text-amber-200",children:[e.jsx(De,{size:15,className:"mt-0.5 flex-shrink-0 text-amber-600 dark:text-amber-300"}),e.jsxs("span",{children:["No device target available. To run mobile tests, connect a local device or enable a cloud device grid in"," ",e.jsx("span",{className:"font-semibold",children:"Connectors"}),"."]})]}),K&&!i&&e.jsxs(e.Fragment,{children:[e.jsx(mt,{providerId:w,disabled:!!i,value:M,onChange:pt}),Z&&!Z.claimed&&Date.now()<Z.expiresAt&&e.jsxs("div",{className:"mt-2 flex items-center gap-2 px-3 py-1.5 rounded-lg bg-emerald-500/10 border border-emerald-500/25 text-xs",children:[e.jsx(Ie,{size:12,className:"text-emerald-300 flex-shrink-0"}),e.jsx("span",{className:"text-emerald-200",children:"Reusing live recording session"}),e.jsxs("span",{className:"text-emerald-400/70 ml-auto",children:["saves ~45s · expires in ",Math.max(0,Math.round((Z.expiresAt-Date.now())/1e3)),"s"]})]})]}),e.jsxs("div",{className:"mt-2 text-sm text-gray-500 flex items-center gap-3 flex-wrap",children:[(U==null?void 0:U.branch)&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-sky-400/70",children:[e.jsx(os,{size:10})," ",U.branch]}),w!=="local"&&!i&&e.jsxs("span",{className:w==="local-appium"?"text-gray-400":"text-blue-400",children:[w==="local-appium"?"Target":"Cloud",": ",se[w]||w]}),i&&e.jsxs("span",{className:"inline-flex items-center gap-2 min-w-0",children:[e.jsx(ms,{size:"xs"}),e.jsx("span",{className:"font-mono text-gray-400 truncate",title:i.command,children:i.command})]}),y&&!i&&e.jsxs("span",{className:y.status==="completed"?"text-emerald-400":"text-red-400",children:["Last run: ",y.status,typeof y.exitCode=="number"?` · exit code ${y.exitCode}`:""," ",y.duration?`(${(y.duration/1e3).toFixed(1)}s)`:""]})]})]}),e.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e.jsxs("div",{className:"flex-1 flex flex-col p-4 gap-3 overflow-hidden",children:[i&&z.current>0&&e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-2",children:"Live Progress"}),e.jsx(Ss,{current:z.current,passed:z.passed,failed:z.failed,currentTestName:z.currentTestName,tests:z.tests,elapsedMs:z.elapsedMs})]}),!i&&z.summary&&e.jsx(Rs,{summary:z.summary,runId:z.summary.runId,onRerunFailed:()=>void bt(z.summary.runId)}),e.jsx("h3",{className:"text-sm font-semibold text-gray-400 uppercase",children:"Output"}),e.jsx(Ns,{output:f}),i&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[N&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-300",children:[e.jsx(ue,{size:12,className:"animate-pulse"}),e.jsxs("span",{children:["The command looks like it is waiting for an answer: ",e.jsx("span",{className:"font-mono text-amber-200",children:N})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-cyan-500/70 text-sm select-none",children:"›"}),e.jsx("input",{ref:L,type:"text",value:$,onChange:s=>D(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),A(!1))},disabled:x,placeholder:N?"Type your answer and press Enter (empty Enter accepts the default)":"Send a line to the running command — press Enter","aria-label":"Input to the running command",spellCheck:!1,autoComplete:"off",className:"flex-1 h-9 px-3 rounded-lg bg-black/40 border border-white/10 focus:border-cyan-500/40 focus:outline-none font-mono text-sm text-gray-100 placeholder:text-gray-600 placeholder:font-sans disabled:opacity-60"}),e.jsx("button",{onClick:()=>void A(!1),disabled:x,className:"h-9 px-3 rounded-lg bg-cyan-600/20 text-cyan-300 border border-cyan-500/30 hover:bg-cyan-600/30 text-sm font-medium disabled:opacity-50",title:"Send the line followed by Enter",children:"Enter"}),e.jsx("button",{onClick:()=>void A(!0),disabled:x,className:"h-9 px-3 rounded-lg border border-white/10 text-gray-400 hover:text-gray-200 hover:bg-white/5 text-sm disabled:opacity-50",title:"Close the command's input (Ctrl-D) — for programs that read until input ends",children:"Send EOF"})]}),e.jsx("p",{className:"text-[11px] text-gray-600",children:d?e.jsx("span",{className:"text-red-400",children:d}):"What you type is echoed into the log above, so passwords will be visible there. Use Stop for Ctrl-C."})]})]}),!ve&&e.jsxs("div",{className:"w-80 border-l border-white/5 bg-surface-1 p-4 overflow-y-auto flex-shrink-0",children:[B.length>0&&e.jsxs("div",{className:"mb-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-amber-400 uppercase mb-3",children:"Current Runs"}),e.jsx("div",{className:"space-y-1.5",children:B.map(s=>e.jsxs("div",{className:"px-3 py-2.5 rounded-lg bg-amber-500/5 border border-amber-500/20 cursor-pointer hover:bg-amber-500/10 transition-colors",onClick:()=>h(s.runId,s.command),title:"Click to view output",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsxs("span",{className:"relative flex h-2 w-2 flex-shrink-0",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-amber-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-amber-400"})]}),e.jsx("span",{className:"font-mono text-gray-300 text-xs flex-1 truncate",children:s.command})]}),e.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[s.cloudProvider&&e.jsxs("span",{className:"flex items-center gap-0.5 text-blue-400",children:[e.jsx(oe,{size:8}),se[s.cloudProvider]||s.cloudProvider]}),s.source==="scheduler"&&e.jsxs("span",{className:"flex items-center gap-0.5 text-gray-500",children:[e.jsx(Ce,{size:8})," Scheduled"]}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"text-emerald-400 flex items-center gap-0.5",children:[e.jsx(ae,{size:8})," ",s.passed]}),e.jsxs("span",{className:"text-red-400 flex items-center gap-0.5",children:[e.jsx(ie,{size:8})," ",s.failed]}),e.jsx("span",{className:"text-gray-500 tabular-nums font-mono",children:e.jsx(Ft,{run:s,format:j=>`${Math.floor(j/1e3)}s`})}),e.jsx("button",{onClick:j=>{j.stopPropagation(),rt(s.runId).catch(()=>{})},className:"text-red-400 hover:text-red-300 p-0.5",title:"Cancel run",children:e.jsx(Xe,{size:8})})]})]},s.runId))})]}),e.jsx("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-3",children:"Run History"}),e.jsx(ks,{})]})]})]}),ve&&e.jsx("div",{className:"w-[35%] min-w-[380px] max-w-[560px] border-l border-white/5 bg-surface-1 flex-shrink-0",children:_e?e.jsx(ds,{runId:(i==null?void 0:i.runId)??null,layout:"panel"}):e.jsx(cs,{testRunning:!!i})}),qe&&ce&&e.jsx(Ps,{open:qe,analysis:ce,providerLabel:se[w]||w,onAiFix:gt,onSkipAndRun:yt,onCancel:jt})]})}const $s="w-full bg-surface-2 border border-white/10 rounded-xl px-3.5 py-2.5 text-[15px] text-gray-200 font-mono outline-none placeholder-gray-600 focus:border-brand-500/50";function Ds({value:o,onChange:t,placeholder:c,disabled:r,className:m,hint:u}){var $,D,x;const[i,f]=n.useState(!1),{saved:y}=ut(),{data:p}=fe({queryKey:["run-commands-config"],queryFn:Le,staleTime:1e4}),g=(((D=($=p==null?void 0:p.configured)==null?void 0:$.fullRun)==null?void 0:D.trim())||((x=p==null?void 0:p.autoDetected)==null?void 0:x.fullRun)||"").trim(),h=[...g?[{id:"preset-run-all",label:"Run All",command:g,preset:!0}]:[],...y.map(b=>({id:b.id,label:b.label,command:b.command}))],N=o.trim().toLowerCase(),E=N?h.filter(b=>b.command.toLowerCase()!==N&&(b.command.toLowerCase().includes(N)||b.label.toLowerCase().includes(N))):h;return e.jsxs("div",{className:"relative",children:[e.jsx("input",{value:o,disabled:r,onChange:b=>{t(b.target.value),f(!0)},onFocus:()=>f(!0),onBlur:()=>setTimeout(()=>f(!1),120),placeholder:c,className:m||$s}),i&&!r&&E.length>0&&e.jsxs("div",{className:"absolute left-0 right-0 top-full mt-1 z-30 rounded-xl bg-white dark:bg-surface-1 border border-gray-200 dark:border-white/10 shadow-2xl py-1 overflow-hidden",children:[e.jsxs("p",{className:"px-3 pt-1.5 pb-1 text-[10px] font-semibold uppercase tracking-wider text-gray-400",children:["Commands",u&&e.jsxs("span",{className:"ml-1.5 normal-case font-normal tracking-normal text-gray-400/80",children:["· ",u]})]}),e.jsx("div",{className:"max-h-[228px] overflow-y-auto",children:E.map(b=>e.jsxs("button",{type:"button",onMouseDown:d=>{d.preventDefault(),t(b.command),f(!1)},className:"w-full text-left px-3 py-1.5 hover:bg-black/[0.04] dark:hover:bg-white/5 transition-colors",title:b.command,children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-200 truncate",children:b.label}),b.preset&&e.jsx("span",{className:"px-1.5 py-0 rounded text-[9px] font-semibold bg-brand-500/15 text-brand-500 flex-shrink-0",children:"preset"})]}),e.jsx("span",{className:"block text-[11px] font-mono text-gray-400 truncate",children:b.command})]},b.id))})]})]})}const Ls=[{label:"Every 5 minutes",cron:"*/5 * * * *"},{label:"Every 15 minutes",cron:"*/15 * * * *"},{label:"Every 30 minutes",cron:"*/30 * * * *"},{label:"Every hour",cron:"0 * * * *"},{label:"Every 2 hours",cron:"0 */2 * * *"},{label:"Daily at 8 AM",cron:"0 8 * * *"},{label:"Daily at 10 PM",cron:"0 22 * * *"},{label:"Weekdays at 9 AM",cron:"0 9 * * 1-5"},{label:"Weekly Sunday midnight",cron:"0 0 * * 0"},{label:"Custom",cron:""}],tt={browserstack:"BrowserStack",lambdatest:"LambdaTest",saucelabs:"Sauce Labs","local-appium":"Local Devices","testver-grid":"Testver Grid"},st=()=>({name:"",command:"",cron:"0 8 * * *",cloudProvider:"",enabled:!0,appPath:"",appId:"",deviceName:"",platformName:"Android",platformVersion:""});function Fs(o){const t=o.trim().split(/\s+/);if(t.length!==5)return o;const[c,r,m,u,i]=t;return c==="*"&&r==="*"&&m==="*"&&u==="*"&&i==="*"?"Every minute":c!=null&&c.startsWith("*/")&&r==="*"&&m==="*"&&u==="*"&&i==="*"?`Every ${c.slice(2)} min`:/^\d+$/.test(c)&&r==="*"&&m==="*"&&u==="*"&&i==="*"?`Hourly at :${c.padStart(2,"0")}`:/^\d+$/.test(c)&&/^\d+$/.test(r)&&m==="*"&&u==="*"&&i==="*"?`Daily ${r.padStart(2,"0")}:${c.padStart(2,"0")}`:/^\d+$/.test(c)&&/^\d+$/.test(r)&&m==="*"&&u==="*"&&bs(i)?`Weekdays ${r.padStart(2,"0")}:${c.padStart(2,"0")}`:/^\d+$/.test(c)&&/^\d+$/.test(r)&&m==="*"&&u==="*"&&i==="0"?`Sundays ${r.padStart(2,"0")}:${c.padStart(2,"0")}`:/^\d+$/.test(c)&&(r!=null&&r.startsWith("*/"))&&m==="*"&&u==="*"&&i==="*"?`Every ${r.slice(2)}h at :${c.padStart(2,"0")}`:o}function Ms(){const{toast:o}=nt(),[t,c]=n.useState([]),[r,m]=n.useState([]),[u,i]=n.useState(!1),{showsMobile:f}=lt(),[y,p]=n.useState(!0),[g,h]=n.useState(!1),[N,E]=n.useState(null),[$,D]=n.useState(null),[x,b]=n.useState(st()),[d,P]=n.useState(!1),[L,A]=n.useState({}),B=n.useCallback(async()=>{var a,v;try{const[I,J,H]=await Promise.all([_t().catch(()=>Ht()),ot().catch(()=>({providers:[]})),it().catch(()=>({config:{enabled:!1}}))]);c(I.schedules||[]),m(((a=J.providers)==null?void 0:a.filter(Y=>Y.enabled))||[]),i(!!((v=H.config)!=null&&v.enabled))}catch{}finally{p(!1)}},[]);n.useEffect(()=>{B()},[B]);const z=()=>{D(null),b(st()),h(!0)},U=a=>{D(a.id),b({name:a.name,command:a.command,cron:a.cron,cloudProvider:a.cloudProvider||"",enabled:a.enabled,appPath:a.appPath??"",appId:a.appId??"",deviceName:a.deviceName??"",platformName:a.platformName??"Android",platformVersion:a.platformVersion??""}),h(!0)},T=async()=>{if(!x.name.trim()){o("error","Name is required");return}if(!x.command.trim()){o("error","Command is required");return}if(!x.cron.trim()){o("error","Cron expression is required");return}P(!0);try{const v=f&&!!x.cloudProvider?{appPath:x.appPath.trim()||void 0,appId:x.appId||void 0,deviceName:x.deviceName||void 0,platformName:x.deviceName?x.platformName:void 0,platformVersion:x.platformVersion||void 0}:{};$?(await We($,{name:x.name.trim(),command:x.command.trim(),cron:x.cron.trim(),cloudProvider:x.cloudProvider||void 0,enabled:x.enabled,...v}),o("success","Schedule updated")):(await Ut({id:"",name:x.name.trim(),command:x.command.trim(),cron:x.cron.trim(),cloudProvider:x.cloudProvider||void 0,enabled:x.enabled,...v}),o("success","Schedule created")),h(!1),await B()}catch(a){o("error",`Save failed: ${a}`)}finally{P(!1)}},q=(a,v)=>{E({id:a,name:v})},V=async()=>{if(N){try{await Gt(N.id),o("info",`Schedule '${N.name}' deleted`),await B()}catch(a){o("error",`Delete failed: ${a}`)}E(null)}},_=async a=>{try{await We(a.id,{enabled:!a.enabled}),await B()}catch(v){o("error",`Toggle failed: ${v}`)}},W=async(a,v)=>{A(I=>({...I,[a]:!0}));try{const I=await Ot(a);I.runId?o("success",`'${v}' triggered (run: ${I.runId.slice(0,8)}...)`):o("info",I.message),await B()}catch(I){o("error",`Run failed: ${I}`)}finally{A(I=>({...I,[a]:!1}))}},F=Ls.find(a=>a.cron===x.cron);return!F||F.label,e.jsxs("div",{className:"min-h-screen bg-surface-0 text-gray-200 animate-fade-in",children:[e.jsx("div",{className:"border-b border-white/5 bg-surface-1",children:e.jsx("div",{className:"max-w-[1400px] mx-auto px-6 py-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold text-gray-100 flex items-center gap-3",children:[e.jsx(Ce,{size:24,className:"text-brand-300"}),"Schedules",e.jsxs("span",{className:"text-sm font-normal bg-brand-500/15 text-brand-300 px-2.5 py-0.5 rounded-full",children:[t.length," schedules"]})]}),e.jsx("p",{className:"text-sm text-gray-400 mt-1",children:"Schedule any run command to execute automatically on the connected server."})]}),e.jsxs("button",{onClick:z,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-brand-600 hover:bg-brand-500 rounded-lg transition-colors",children:[e.jsx(xe,{size:16}),"Add Schedule"]})]})})}),e.jsx("div",{className:"max-w-[1400px] mx-auto px-6 py-8",children:y?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(ue,{size:20,className:"animate-spin text-gray-500"})}):t.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx(Ce,{size:40,className:"text-gray-600 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-400 text-[15px]",children:"No schedules configured yet."}),e.jsx("p",{className:"text-gray-600 text-sm mt-1",children:"Create a schedule to automatically run tests on a recurring basis."}),e.jsxs("button",{onClick:z,className:"mt-4 flex items-center gap-1.5 px-5 py-2.5 rounded-xl bg-brand-600 hover:bg-brand-500 text-white text-[15px] font-medium mx-auto",children:[e.jsx(xe,{size:14}),"Create Schedule"]})]}):e.jsx("div",{className:"space-y-3",children:t.map(a=>e.jsx("div",{className:`bg-surface-1 rounded-xl border border-white/5 p-4 transition-opacity ${a.enabled?"":"opacity-50"}`,children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-200 truncate",children:a.name}),a.enabled?e.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-emerald-500/15 text-emerald-400",children:[e.jsx(ae,{size:8})," Active"]}):e.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-500/15 text-gray-500",children:[e.jsx(Je,{size:8})," Paused"]}),a.cloudProvider?e.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-blue-500/15 text-blue-400",children:[e.jsx(oe,{size:8})," ",tt[a.cloudProvider]||a.cloudProvider]}):e.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-500/15 text-gray-400",children:[e.jsx($e,{size:8})," Local"]})]}),e.jsx("p",{className:"text-xs text-gray-400 font-mono truncate mb-1",children:a.command}),e.jsxs("div",{className:"flex items-center gap-4 text-[11px] text-gray-500",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ct,{size:10}),Fs(a.cron),e.jsxs("span",{className:"text-gray-600",children:["(",a.cron,")"]})]}),a.lastRunTime&&e.jsxs("span",{children:["Last: ",Ye(a.lastRunTime)]}),a.nextRunTime&&e.jsxs("span",{className:"text-brand-400",children:["Next: ",Ye(a.nextRunTime)]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsxs("button",{onClick:()=>W(a.id,a.name),disabled:L[a.id],className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg bg-brand-600/20 hover:bg-brand-600/30 text-brand-400 text-xs border border-brand-500/20 disabled:opacity-50",title:"Run Now",children:[L[a.id]?e.jsx(ue,{size:12,className:"animate-spin"}):e.jsx(pe,{size:12}),"Run"]}),e.jsx("button",{onClick:()=>_(a),className:"px-2.5 py-1.5 rounded-lg bg-surface-2 hover:bg-surface-3 text-gray-400 text-xs border border-white/5",title:a.enabled?"Pause":"Enable",children:a.enabled?e.jsx(Je,{size:12}):e.jsx(pe,{size:12})}),e.jsx("button",{onClick:()=>U(a),className:"px-2.5 py-1.5 rounded-lg bg-surface-2 hover:bg-surface-3 text-gray-400 text-xs border border-white/5",title:"Edit",children:e.jsx(is,{size:12})}),e.jsx("button",{onClick:()=>q(a.id,a.name),className:"px-2.5 py-1.5 rounded-lg bg-red-600/20 hover:bg-red-600/30 text-red-400 text-xs border border-red-500/20",title:"Delete",children:e.jsx(Ae,{size:12})})]})]})},a.id))})}),N&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 animate-fade-in",children:e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/10 w-full max-w-sm mx-4 p-5",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500/15 flex items-center justify-center flex-shrink-0",children:e.jsx(Ae,{size:18,className:"text-red-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Delete Schedule"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"This action cannot be undone"})]})]}),e.jsxs("p",{className:"text-sm text-gray-400 mb-5",children:["Are you sure you want to delete ",e.jsxs("span",{className:"font-medium text-gray-200",children:['"',N.name,'"']}),"? All scheduled runs for this schedule will be cancelled."]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>E(null),className:"px-4 py-2 rounded-lg text-sm text-gray-400 hover:text-gray-200 hover:bg-white/5 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:V,className:"px-4 py-2 rounded-lg text-sm font-medium text-white bg-red-600 hover:bg-red-500 transition-colors",children:"Delete"})]})]})}),g&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 animate-fade-in overflow-y-auto py-6",children:e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/10 w-full max-w-lg mx-4 my-auto max-h-[calc(100vh-48px)] flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-white/5",children:[e.jsx("h2",{className:"text-base font-semibold text-gray-200",children:$?"Edit Schedule":"New Schedule"}),e.jsx("button",{onClick:()=>h(!1),className:"text-gray-500 hover:text-gray-300",children:e.jsx(Fe,{size:16})})]}),e.jsxs("div",{className:"p-4 space-y-4 overflow-y-auto flex-1",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-gray-400 block mb-1",children:"Schedule Name"}),e.jsx("input",{value:x.name,onChange:a=>b(v=>({...v,name:a.target.value})),placeholder:"e.g., Nightly Regression",className:"w-full bg-surface-2 border border-white/10 rounded-xl px-3.5 py-2.5 text-[15px] text-gray-200 outline-none placeholder-gray-600 focus:border-brand-500/50"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-gray-400 block mb-1",children:"Run Command"}),e.jsx(Ds,{value:x.command,onChange:a=>b(v=>({...v,command:a})),placeholder:"e.g., npx playwright test --headed",hint:"Add commands from the Runner screen"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-gray-400 block mb-2",children:"Schedule"}),e.jsx(hs,{value:x.cron,onChange:a=>b(v=>({...v,cron:a}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-gray-400 block mb-1",children:"Run On"}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs("button",{onClick:()=>b(a=>({...a,cloudProvider:""})),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg border transition-colors ${x.cloudProvider?"border-white/5 bg-surface-2 text-gray-400 hover:text-gray-300":"border-brand-500/50 bg-brand-500/10 text-brand-400"}`,children:[e.jsx($e,{size:12})," Local"]}),r.map(a=>e.jsxs("button",{onClick:()=>b(v=>({...v,cloudProvider:a.id})),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg border transition-colors ${x.cloudProvider===a.id?"border-blue-500/60 bg-blue-500/15 text-blue-300 font-medium shadow-[0_0_0_1px_rgba(59,130,246,0.15)]":"border-white/5 bg-surface-2 text-gray-400 hover:text-gray-300"}`,children:[e.jsx(oe,{size:12})," ",tt[a.id]||a.id]},a.id)),f&&u&&e.jsxs("button",{onClick:()=>b(a=>({...a,cloudProvider:"local-appium"})),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg border transition-colors ${x.cloudProvider==="local-appium"?"border-gray-400 dark:border-white/30 bg-gray-100 dark:bg-white/10 text-gray-800 dark:text-gray-100 font-medium shadow-sm":"border-white/5 bg-surface-2 text-gray-400 hover:text-gray-300"}`,children:[e.jsx(De,{size:12})," Local Devices"]})]})]}),f&&x.cloudProvider&&e.jsx(mt,{providerId:x.cloudProvider,value:{deviceName:x.deviceName,platformName:x.platformName,platformVersion:x.platformVersion,appId:x.appId,appPath:x.appPath},onChange:a=>b(v=>({...v,deviceName:a.deviceName,platformName:a.platformName,platformVersion:a.platformVersion,appId:a.appId,appPath:a.appPath}))}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-300 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:x.enabled,onChange:a=>b(v=>({...v,enabled:a.target.checked})),className:"rounded border-gray-600 bg-surface-2 text-brand-500 focus:ring-brand-500"}),"Enable schedule immediately"]})]}),e.jsxs("div",{className:"flex justify-end gap-2 p-4 border-t border-white/5",children:[e.jsx("button",{onClick:()=>h(!1),className:"px-5 py-2.5 text-[15px] rounded-xl bg-surface-2 hover:bg-surface-3 text-gray-300 border border-white/5",children:"Cancel"}),e.jsxs("button",{onClick:T,disabled:d,className:"flex items-center gap-1.5 px-5 py-2.5 text-[15px] rounded-xl bg-brand-600 hover:bg-brand-500 text-white font-medium disabled:opacity-50",children:[d&&e.jsx(ue,{size:14,className:"animate-spin"}),$?"Update":"Create"]})]})]})})]})}function ta(){const[o,t]=kt("tab",["runner","schedules"],"runner"),c=(r,m,u)=>e.jsxs("button",{onClick:()=>t(r),className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${o===r?"border-brand-400 text-brand-300":"border-transparent text-gray-400 hover:text-gray-200 hover:border-white/10"}`,children:[u,m]});return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-1 px-5 border-b border-white/5 bg-surface-1 flex-shrink-0",children:[c("runner","Runner",e.jsx(pe,{size:15})),c("schedules","Schedules",e.jsx(Ce,{size:15}))]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:o==="runner"?e.jsx(As,{}):e.jsx(Ms,{})})]})}export{ta as AdvancedPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as j,j as e}from"./vendor-react-DOVfxdUy.js";import{f as R}from"./formatDate-T65-Y6Mi.js";import{u as w}from"./vendor-query-DkZSMtfn.js";import{fD as M,fK as P,fL as D,fM as q}from"./index-D6sQYc_0.js";import{k as A,a5 as J,y as $,t as k,ce as G,j as f,S as z,aZ as S,ab as L,a as u,a2 as K,d8 as F,aC as o,z as B,ai as Z}from"./vendor-icons-D_Dmmj8d.js";const O={"auth.login":{icon:e.jsx(Z,{size:14}),color:"text-emerald-400"},"auth.logout":{icon:e.jsx(B,{size:14}),color:"text-gray-400"},"auth.login_failed":{icon:e.jsx(u,{size:14}),color:"text-red-400"},"auth.password_change":{icon:e.jsx(o,{size:14}),color:"text-amber-400"},"auth.setup":{icon:e.jsx(o,{size:14}),color:"text-brand-400"},"auth.2fa_enabled":{icon:e.jsx(o,{size:14}),color:"text-emerald-400"},"auth.2fa_disabled":{icon:e.jsx(o,{size:14}),color:"text-amber-400"},"auth.2fa_failed":{icon:e.jsx(u,{size:14}),color:"text-red-400"},"auth.2fa_recovery_used":{icon:e.jsx(o,{size:14}),color:"text-amber-400"},"user.2fa_reset":{icon:e.jsx(o,{size:14}),color:"text-amber-400"},"user.create":{icon:e.jsx(F,{size:14}),color:"text-brand-400"},"user.update":{icon:e.jsx(f,{size:14}),color:"text-sky-400"},"user.delete":{icon:e.jsx(u,{size:14}),color:"text-red-400"},"user.role_change":{icon:e.jsx(o,{size:14}),color:"text-amber-400"},"user.disable":{icon:e.jsx(u,{size:14}),color:"text-red-400"},"user.enable":{icon:e.jsx(F,{size:14}),color:"text-emerald-400"},"run.start":{icon:e.jsx(K,{size:14}),color:"text-emerald-400"},"run.cancel":{icon:e.jsx(u,{size:14}),color:"text-amber-400"},"file.create":{icon:e.jsx(L,{size:14}),color:"text-sky-400"},"file.update":{icon:e.jsx(L,{size:14}),color:"text-sky-400"},"file.delete":{icon:e.jsx(L,{size:14}),color:"text-red-400"},"git.commit":{icon:e.jsx(S,{size:14}),color:"text-emerald-400"},"git.push":{icon:e.jsx(S,{size:14}),color:"text-brand-400"},"git.pull":{icon:e.jsx(S,{size:14}),color:"text-sky-400"},"ai.generate":{icon:e.jsx(z,{size:14}),color:"text-purple-400"},"ai.fix":{icon:e.jsx(z,{size:14}),color:"text-purple-400"},"ai.chat":{icon:e.jsx(z,{size:14}),color:"text-purple-400"}};function H(t){return O[t]?O[t]:t.startsWith("settings.")?/_(delete|remove|disconnect|reset)$/.test(t)?{icon:e.jsx(f,{size:14}),color:"text-red-400"}:{icon:e.jsx(f,{size:14}),color:"text-sky-400"}:{icon:e.jsx(f,{size:14}),color:"text-gray-400"}}const h=50,Q=[{value:"",label:"All Actions"},{value:"auth.*",label:"Authentication"},{value:"user.*",label:"User Management"},{value:"run.*",label:"Test Runs"},{value:"file.*",label:"File Operations"},{value:"git.*",label:"Git Operations"},{value:"ai.*",label:"AI Actions"},{value:"settings.*",label:"Settings"}];function le(){const[t,a]=j.useState(0),[i,r]=j.useState(""),[l,y]=j.useState(""),[T,_]=j.useState(null),{data:N}=w({queryKey:["users"],queryFn:M}),{data:n}=w({queryKey:["audit-stats"],queryFn:P}),{data:c,isLoading:I,isFetching:p}=w({queryKey:["audit",t,i,l],placeholderData:s=>s,queryFn:()=>D({limit:h,offset:t*h,action:i||void 0,userId:l||void 0})}),C=(c==null?void 0:c.entries)??[],m=(c==null?void 0:c.total)??0,d=Math.ceil(m/h),U=async()=>{try{const s=await q(),g=new Blob([JSON.stringify(s,null,2)],{type:"application/json"}),x=URL.createObjectURL(g),v=document.createElement("a");v.href=x,v.download=`audit-log-${new Date().toISOString().slice(0,10)}.json`,v.click(),URL.revokeObjectURL(x)}catch{}};return e.jsxs("div",{className:"min-h-screen bg-surface-0 text-gray-200",children:[e.jsx("div",{className:"border-b border-white/5 bg-surface-1",children:e.jsx("div",{className:"max-w-[1400px] mx-auto px-6 py-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold text-gray-100 flex items-center gap-3",children:[e.jsx(A,{size:24,className:"text-brand-300"}),"Audit Log",e.jsxs("span",{className:"text-sm font-normal bg-brand-500/15 text-brand-300 px-2.5 py-0.5 rounded-full",children:[m.toLocaleString()," ",m===1?"entry":"entries"]})]}),e.jsx("p",{className:"text-sm text-gray-400 mt-1",children:"Track all user actions and system events"})]}),e.jsxs("button",{onClick:U,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-brand-600 hover:bg-brand-500 rounded-lg transition-colors",children:[e.jsx(J,{size:16}),"Export JSON"]})]})})}),e.jsxs("div",{className:"max-w-[1400px] mx-auto px-6 py-8 space-y-6",children:[n&&e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsx(b,{label:"Total Events",value:n.totalEntries}),e.jsx(b,{label:"Unique Users",value:n.uniqueUsers}),e.jsx(b,{label:"Logins (24h)",value:n.recentLoginCount,color:"emerald"}),e.jsx(b,{label:"Failed Logins (24h)",value:n.recentFailedLogins,color:n.recentFailedLogins>0?"red":"gray"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("select",{value:i,onChange:s=>{r(s.target.value),a(0)},className:"px-3.5 py-2 bg-surface-2 border border-white/10 rounded-xl text-[15px] text-gray-300 focus:outline-none focus:border-brand-500/50",children:Q.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs("select",{value:l,onChange:s=>{y(s.target.value),a(0)},className:"px-3.5 py-2 bg-surface-2 border border-white/10 rounded-xl text-[15px] text-gray-300 focus:outline-none focus:border-brand-500/50",children:[e.jsx("option",{value:"",children:"All Users"}),N==null?void 0:N.users.map(s=>e.jsxs("option",{value:s.id,children:[s.displayName," (@",s.username,")"]},s.id))]})]}),I?e.jsx("div",{className:"text-sm text-gray-500",children:"Loading audit log..."}):C.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(A,{size:40,className:"mx-auto text-gray-600 mb-3"}),e.jsx("p",{className:"text-gray-400",children:"No audit entries found"}),e.jsx("p",{className:"text-xs text-gray-600 mt-1",children:"Entries will appear as users perform actions"})]}):e.jsx("div",{className:"bg-surface-1 rounded-xl border border-white/5 overflow-hidden",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-white/5 text-sm text-gray-500",children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium w-8"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Timestamp"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"User"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Action"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Resource"})]})}),e.jsx("tbody",{className:"divide-y divide-white/5",children:C.map(s=>{const g=H(s.action),x=T===s.id;return e.jsxs(V,{children:[e.jsxs("tr",{className:"hover:bg-white/[0.02] cursor-pointer",onClick:()=>_(x?null:s.id),children:[e.jsx("td",{className:"px-4 py-2.5 text-gray-500",children:s.details?x?e.jsx($,{size:14}):e.jsx(k,{size:14}):null}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-gray-400 whitespace-nowrap",children:X(s.timestamp)}),e.jsxs("td",{className:"px-4 py-2.5 text-sm text-gray-300",children:["@",s.username]}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsxs("span",{className:`flex items-center gap-1.5 text-sm ${g.color}`,children:[g.icon,Y(s.action)]})}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-gray-500",children:s.resourceType&&e.jsxs("span",{children:[s.resourceType,s.resourceId&&e.jsxs("span",{className:"text-gray-600",children:[" / ",s.resourceId]})]})})]}),x&&s.details&&e.jsx("tr",{className:"bg-surface-2/50",children:e.jsx("td",{colSpan:5,className:"px-8 py-3",children:e.jsx(W,{details:s.details})})})]},s.id)})})]})}),d>1&&e.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[e.jsxs("span",{className:"text-gray-500",children:["Showing ",(t*h+1).toLocaleString(),"–",Math.min((t+1)*h,m).toLocaleString()," of ",m.toLocaleString()]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>a(0),disabled:t===0||p,className:"h-8 px-3 rounded-lg border border-white/10 text-gray-300 hover:bg-white/5 disabled:opacity-40 disabled:cursor-not-allowed",children:"First"}),e.jsxs("button",{onClick:()=>a(Math.max(0,t-1)),disabled:t===0||p,className:"flex items-center gap-1 h-8 px-3 rounded-lg border border-white/10 text-gray-300 hover:bg-white/5 disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(G,{size:14})," Previous"]}),e.jsxs("span",{className:"text-gray-400 tabular-nums min-w-[96px] text-center",children:["Page ",t+1," of ",d]}),e.jsxs("button",{onClick:()=>a(Math.min(d-1,t+1)),disabled:t>=d-1||p,className:"flex items-center gap-1 h-8 px-3 rounded-lg border border-white/10 text-gray-300 hover:bg-white/5 disabled:opacity-40 disabled:cursor-not-allowed",children:["Next ",e.jsx(k,{size:14})]}),e.jsx("button",{onClick:()=>a(d-1),disabled:t>=d-1||p,className:"h-8 px-3 rounded-lg border border-white/10 text-gray-300 hover:bg-white/5 disabled:opacity-40 disabled:cursor-not-allowed",children:"Last"})]})]})]})]})}function V({children:t}){return e.jsx(e.Fragment,{children:t})}function E(t){return t===void 0?"":typeof t=="string"?t:JSON.stringify(t)}function W({details:t}){const a=Array.isArray(t.changes)?t.changes:null,i=Object.fromEntries(Object.entries(t).filter(([l])=>!["changes","tab","item","moreChanges"].includes(l))),r=Object.keys(i).length>0;return!a&&typeof t.tab!="string"?e.jsx("pre",{className:"text-xs text-gray-400 font-mono whitespace-pre-wrap",children:JSON.stringify(t,null,2)}):e.jsxs("div",{className:"space-y-3",children:[typeof t.tab=="string"&&e.jsxs("p",{className:"text-xs text-gray-400",children:["Settings › ",e.jsx("span",{className:"text-gray-300",children:t.tab}),typeof t.item=="string"&&e.jsxs(e.Fragment,{children:[" › ",e.jsx("span",{className:"text-gray-300",children:t.item})]})]}),a&&a.length>0&&e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-gray-500 text-left",children:[e.jsx("th",{className:"py-1 pr-4 font-medium w-1/3",children:"Field"}),e.jsx("th",{className:"py-1 pr-4 font-medium w-1/3",children:"Before"}),e.jsx("th",{className:"py-1 font-medium w-1/3",children:"After"})]})}),e.jsx("tbody",{className:"divide-y divide-white/5",children:a.map((l,y)=>e.jsxs("tr",{className:"align-top",children:[e.jsx("td",{className:"py-1.5 pr-4 font-mono text-gray-300 break-all",children:l.field}),e.jsx("td",{className:"py-1.5 pr-4 font-mono break-all",children:l.from===void 0?e.jsx("span",{className:"text-gray-600 italic",children:"not set"}):e.jsx("span",{className:"text-red-400",children:E(l.from)})}),e.jsx("td",{className:"py-1.5 font-mono break-all",children:l.to===void 0?e.jsx("span",{className:"text-gray-600 italic",children:"removed"}):e.jsx("span",{className:"text-emerald-400",children:E(l.to)})})]},y))})]}),typeof t.moreChanges=="number"&&t.moreChanges>0&&e.jsxs("p",{className:"text-xs text-gray-500",children:["…and ",t.moreChanges," more field(s)"]}),r&&e.jsx("pre",{className:"text-xs text-gray-400 font-mono whitespace-pre-wrap",children:JSON.stringify(i,null,2)})]})}function b({label:t,value:a,color:i="gray"}){const r={gray:"text-gray-200",emerald:"text-emerald-400",red:"text-red-400",brand:"text-brand-400"};return e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-4",children:[e.jsx("p",{className:"text-sm text-gray-500",children:t}),e.jsx("p",{className:`text-2xl font-bold mt-1 ${r[i]??r.gray}`,children:a.toLocaleString()})]})}function X(t){const a=new Date(t),r=new Date().getTime()-a.getTime();return r<6e4?"Just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:R(a)}function Y(t){return t.replace(/\./g," ").replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase()).replace(/\b2fa\b/gi,"2FA")}export{le as AuditLogPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,j as t}from"./vendor-react-DOVfxdUy.js";import{y as P,z as S,A as I}from"./index-D6sQYc_0.js";import{M as E}from"./MobileRunTarget-DHDoDZ_F.js";import{J as N,at as C}from"./vendor-icons-D_Dmmj8d.js";const L={browserstack:"BrowserStack",saucelabs:"Sauce Labs",lambdatest:"LambdaTest","local-appium":"Local Devices"};function $({disabled:p,initial:e,compact:u=!1,onChange:y}){const[c,x]=o.useState([]),[l,f]=o.useState(!1),[s,n]=o.useState((e==null?void 0:e.cloudProvider)||""),[a,j]=o.useState({deviceName:(e==null?void 0:e.deviceName)||"",platformName:(e==null?void 0:e.platformName)==="iOS"?"iOS":"Android",platformVersion:(e==null?void 0:e.platformVersion)||"",appId:(e==null?void 0:e.appId)||"",appPath:(e==null?void 0:e.appPath)||""}),[h,g]=o.useState();o.useEffect(()=>{P().then(r=>x(r.providers.filter(d=>d.enabled&&d.id!=="testver-grid"))).catch(()=>x([])),S().then(({config:r})=>f(!!r.enabled)).catch(()=>f(!1))},[]),o.useEffect(()=>{s||(l?n("local-appium"):c.length>0&&n(c[0].id))},[l,c,s]),o.useEffect(()=>{if(!s){g(void 0);return}let r=!1;const d=()=>{I().then(w=>{if(r)return;const m=w.ticket;g(m&&!m.claimed&&Date.now()<m.expiresAt?m.sessionId:void 0)}).catch(()=>{})};d();const k=window.setInterval(d,5e3);return()=>{r=!0,window.clearInterval(k)}},[s]);const b=c.length===0&&!l;if(o.useEffect(()=>{const r=!!s&&!!a.deviceName&&(!!a.appId||!!a.appPath.trim()),d=s?{cloudProvider:s,deviceName:a.deviceName,platformName:a.platformName,platformVersion:a.platformVersion,appId:a.appId,appPath:a.appPath,reuseSessionId:h}:null;y({payload:d,active:!!s,blocked:b,ready:r})},[s,a,h,b]),b)return t.jsxs("div",{className:"mt-3 flex items-start gap-2.5 px-3.5 py-3 rounded-xl border border-amber-500/25 bg-amber-500/10 text-sm text-amber-700 dark:text-amber-200",children:[t.jsx(N,{size:15,className:"mt-0.5 flex-shrink-0 text-amber-600 dark:text-amber-300"}),t.jsxs("span",{children:["No device target available. To run this test, connect a local device or enable a cloud device grid in ",t.jsx("span",{className:"font-semibold",children:"Connectors"}),"."]})]});const v=u?"flex items-center gap-1 px-2.5 py-1 text-xs rounded-lg border transition-colors":"flex items-center gap-1.5 px-2.5 h-8 text-xs rounded-lg border transition-colors",i=12;return t.jsxs("div",{className:u?"space-y-2":"mt-3 space-y-2",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:`${u?"text-xs":"text-sm"} text-gray-400`,children:"Run on:"}),t.jsxs("div",{className:"flex gap-1.5 flex-wrap",children:[c.map(r=>t.jsxs("button",{onClick:()=>n(r.id),disabled:p,className:`${v} ${s===r.id?"border-blue-500/50 bg-blue-500/10 text-blue-300 font-medium":"border-white/5 bg-surface-2 text-gray-400 hover:text-gray-300 hover:border-white/10"} disabled:opacity-50`,children:[t.jsx(C,{size:i}),L[r.id]||r.id]},r.id)),l&&t.jsxs("button",{onClick:()=>n("local-appium"),disabled:p,className:`${v} ${s==="local-appium"?"border-gray-300 dark:border-white/25 bg-gray-100/70 dark:bg-white/[0.08] text-gray-800 dark:text-gray-100 font-medium":"border-white/5 bg-surface-2 text-gray-400 hover:text-gray-300 hover:border-white/10"} disabled:opacity-50`,children:[t.jsx(N,{size:i}),"Local Devices"]})]})]}),s&&t.jsx(E,{providerId:s,disabled:p,value:a,onChange:j})]})}export{$ as M};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{r as i,j as e}from"./vendor-react-DOVfxdUy.js";import{T as O,bJ as _,bK as V,U as B,S as E,X as K}from"./index-D6sQYc_0.js";import{J as M,_ as H,a0 as U,dg as J,y as X,ag as W,bd as Y}from"./vendor-icons-D_Dmmj8d.js";import{a as z}from"./formatDate-T65-Y6Mi.js";import{S as q,L as G}from"./SearchableDevicePicker-DubIldKj.js";const P=1e3;function ae({testRunning:c,hideHeader:j=!1}){const[s,h]=i.useState(null),[x,A]=i.useState(null),[v,m]=i.useState(null),[N,w]=i.useState(null),[b,k]=i.useState(!1),[g,f]=i.useState(P),y=i.useRef(null),o=i.useRef(0),d=i.useRef(c);i.useEffect(()=>{d.current=c},[c]),i.useEffect(()=>{let l=!1;return O().then(p=>{l||h(p.session)}).catch(()=>{}),()=>{l=!0}},[]),i.useEffect(()=>{let l=!1;const p=async()=>{if(!l)try{const r=await _({timeoutMs:15e3,since:o.current||void 0});!l&&r.unchanged?m(null):l||(o.current=r.capturedAt||0,A(r.image),m(null),k(!!r.delayed),r.dashboardUrl&&w(r.dashboardUrl),f(d.current?500:P))}catch(r){!l&&V(r)?(m(null),f(P)):l||(m(r.message),f(Math.min(g*2,d.current?4e3:1e4)))}finally{l||(y.current=window.setTimeout(p,g))}};return p(),()=>{l=!0,y.current&&window.clearTimeout(y.current)}},[]);const S=!s;return e.jsxs("div",{className:"h-full flex flex-col bg-surface-1",children:[!j&&e.jsxs("div",{className:"px-3 py-2 border-b border-white/5 flex items-center gap-2",children:[e.jsx(M,{size:13,className:"text-indigo-300"}),e.jsx("span",{className:"text-xs font-medium text-gray-200",children:c?"Live Device — Execution view":"Live Device"}),s&&e.jsx("span",{className:"text-[10px] text-gray-500 truncate",children:s.device}),b&&x&&e.jsx("span",{className:"text-[9px] px-1 py-0.5 rounded bg-amber-500/10 text-amber-400/80 border border-amber-500/20 flex-shrink-0",title:"Cloud preview frames are captured between test commands and are a few seconds behind the device. Use the provider link for their real-time view.",children:"~few sec behind"}),e.jsx("div",{className:"flex-1"}),((s==null?void 0:s.dashboardUrl)||N)&&e.jsxs("a",{href:(s==null?void 0:s.dashboardUrl)||N,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-[10px] text-indigo-300 hover:text-indigo-200",title:"Open the cloud provider's session view — their stream is real-time",children:["Live on provider ",e.jsx(H,{size:9})]})]}),e.jsx("div",{className:"flex-1 overflow-hidden relative flex items-center justify-center bg-black/40",children:S&&!c?e.jsxs("div",{className:"text-center px-4 py-8",children:[e.jsx(M,{size:28,className:"text-gray-600 mx-auto mb-2"}),e.jsx("p",{className:"text-xs text-gray-400",children:"No active mobile session"}),e.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"Click Run to start a test (a device session opens automatically), or connect a device in AI Assistant."}),v&&e.jsx("p",{className:"text-[10px] text-red-400 mt-2",children:v})]}):x?e.jsx("img",{src:`data:image/png;base64,${x}`,alt:"Live device",className:"max-h-full max-w-full object-contain",style:c?{filter:"saturate(0.85) brightness(0.95)"}:void 0}):e.jsxs("div",{className:"flex flex-col items-center gap-2 text-xs text-gray-500 px-4 py-8 text-center",children:[e.jsx(U,{size:14,className:"animate-spin"}),e.jsx("span",{children:"Waiting for the test's device session…"}),e.jsx("span",{className:"text-[10px] text-gray-600",children:"First frame appears within a few seconds of session creation."})]})})]})}function ie({providerId:c,disabled:j,value:s,onChange:h}){const[x,A]=i.useState([]),[v,m]=i.useState(!1),[N,w]=i.useState(null),[b,k]=i.useState([]),[g,f]=i.useState(null),[y,o]=i.useState(!1),[d,S]=i.useState(!1),[l,p]=i.useState(null),r=i.useRef(null);i.useEffect(()=>{let t=!1;return m(!0),w(null),B(c).then(a=>{t||A(a.devices||[])}).catch(a=>{t||w(a.message)}).finally(()=>{t||m(!1)}),()=>{t=!0}},[c]),i.useEffect(()=>{let t=!1;return E().then(a=>{t||k(a.apps||[])}).catch(a=>{t||f(a.message)}),()=>{t=!0}},[]);const $=i.useMemo(()=>{if(!s.deviceName)return"";const t=x.find(a=>(a.rawDeviceKey===s.deviceName||a.name===s.deviceName)&&a.os===s.platformVersion);return t?t.id:""},[x,s.deviceName,s.platformVersion]),n=i.useMemo(()=>b.find(t=>t.id===s.appId)??null,[b,s.appId]),L=n?n.label||n.filename:s.appPath.trim()?s.appPath.trim():"Pick app or upload…",D=(()=>{if(n){const t=(n.size/1048576).toFixed(1),a=n.kind==="ipa"?"iOS":"Android",u=n.uploadedAt?z(n.uploadedAt):"";return[n.label||n.filename,n.filename,`${a} · ${t} MB${u?` · uploaded ${u}`:""}`].join(`
|
|
2
|
-
`)}return s.appPath.trim()?s.appPath.trim():"Pick app or upload…"})(),C=t=>{h({...s,deviceName:c==="local-appium"?t.rawDeviceKey:t.name,platformName:t.platform==="ios"?"iOS":"Android",platformVersion:t.os})},I=t=>{h({...s,appId:t.id,appPath:""}),o(!1)},R=()=>{h({...s,appId:"",appPath:""}),o(!1)},T=async t=>{S(!0),f(null),p(0);try{const a=await K(t,void 0,F=>p(F)),u=await E();k(u.apps||[]),h({...s,appId:a.id,appPath:""}),o(!1)}catch(a){f(a.message)}finally{S(!1),p(null),r.current&&(r.current.value="")}};return e.jsxs("div",{className:"mt-2 flex items-center gap-2 flex-wrap max-w-full min-w-0",children:[e.jsx("span",{title:"Mobile device target",className:"flex-shrink-0",children:e.jsx(M,{size:13,className:"text-indigo-400 dark:text-indigo-300"})}),e.jsx("div",{className:"flex-1 min-w-[13rem]",children:e.jsx(q,{devices:x,selectedId:$,onSelect:C,loading:v,disabled:j,errorText:N,placeholder:"Select a device…",emptyText:c==="local-appium"?G:void 0,variant:"compact"})}),e.jsxs("div",{className:"relative flex-1 min-w-[13rem]",children:[e.jsxs("button",{type:"button",disabled:j||d,onClick:()=>o(!y),title:`${D?D+`
|
|
3
|
-
|
|
4
|
-
`:""}Shared app library — apps uploaded in AI Assistant / AI Record appear here. Uploads are cached by SHA-256, so repeat runs skip re-upload.`,className:"w-full h-8 flex items-center justify-between gap-1.5 px-2.5 text-xs rounded-lg bg-white dark:bg-white/[0.04] border border-gray-200 dark:border-white/10 text-gray-800 dark:text-gray-200 hover:border-gray-300 dark:hover:border-white/20 transition-colors disabled:opacity-50",children:[e.jsxs("span",{className:"flex items-center gap-1.5 truncate min-w-0",children:[e.jsx(J,{size:11,className:`flex-shrink-0 ${n?"text-indigo-500 dark:text-indigo-300":"text-gray-500"}`}),e.jsx("span",{className:`truncate ${n||s.appPath.trim()?"":"text-gray-500"}`,children:d?`Uploading… ${l!==null?Math.round(l*100)+"%":""}`:L})]}),d?e.jsx(U,{size:11,className:"animate-spin flex-shrink-0 text-gray-500"}):e.jsx(X,{size:11,className:"flex-shrink-0 text-gray-500"})]}),y&&!d&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-30",onClick:()=>o(!1)}),e.jsxs("div",{className:"absolute top-full left-0 mt-1 w-full max-h-72 bg-surface-1 border border-white/10 rounded-lg shadow-xl z-40 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex-1 overflow-y-auto py-1",children:[g&&e.jsx("div",{className:"px-3 py-2 text-xs text-red-300",children:g}),!g&&b.length===0&&e.jsx("div",{className:"px-3 py-2 text-xs text-gray-500",children:"No apps in the library yet — upload an .apk or .ipa below."}),b.map(t=>{const a=t.id===s.appId;return e.jsxs("button",{onClick:()=>I(t),title:`${t.label||t.filename}
|
|
5
|
-
${t.filename}
|
|
6
|
-
${t.kind==="ipa"?"iOS":"Android"} · ${(t.size/1024/1024).toFixed(1)} MB${t.uploadedAt?` · uploaded ${z(t.uploadedAt)}`:""}`,className:`w-full flex items-center justify-between gap-2 px-3 py-1.5 text-xs transition-colors ${a?"bg-indigo-500/15 text-indigo-200":"text-gray-300 hover:bg-white/5"}`,children:[e.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[a&&e.jsx(W,{size:11,className:"text-indigo-300 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:t.label||t.filename})]}),e.jsxs("span",{className:"text-[10px] text-gray-500 flex-shrink-0",children:[t.kind," · ",(t.size/1024/1024).toFixed(1)," MB"]})]},t.id)}),s.appId&&e.jsx("button",{onClick:R,className:"w-full text-left px-3 py-1.5 text-xs text-gray-500 hover:bg-white/5 border-t border-white/5",children:"Clear selection"})]}),e.jsxs("div",{className:"border-t border-white/10 px-2 py-1.5 bg-surface-1/50",children:[e.jsxs("button",{type:"button",onClick:t=>{var a;t.stopPropagation(),(a=r.current)==null||a.click()},className:"w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-[11px] rounded-md bg-indigo-500/10 text-indigo-300 hover:bg-indigo-500/20 transition-colors",children:[e.jsx(Y,{size:11})," ",e.jsx("span",{title:"Android: .apk or .aab · real iPhone / iPad: .ipa · iOS simulator: the .app zipped",children:"Upload app build"})]}),e.jsx("p",{className:"mt-1.5 px-1 text-[10px] text-gray-500 leading-relaxed",children:"Shared with AI Assistant + AI Record — apps uploaded there appear here. Uploads are cached by SHA-256, so repeat runs skip re-upload."})]})]})]})]}),e.jsx("input",{ref:r,type:"file",accept:".apk,.aab,.ipa,.zip,application/vnd.android.package-archive,application/zip,application/octet-stream",className:"hidden",onChange:t=>{var u;const a=(u=t.target.files)==null?void 0:u[0];a&&T(a)}})]})}export{ie as M,ae as R};
|