@testver/testver 1.3.1 → 1.4.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.
Files changed (98) hide show
  1. package/bin/testver.js +8 -1
  2. package/dist/index.js +1414 -793
  3. package/dist/py-agent/__pycache__/testver_appium.cpython-313.pyc +0 -0
  4. package/package.json +7 -6
  5. package/src/ui/static/assets/AIPanel-D09Ni3a4.js +32 -0
  6. package/src/ui/static/assets/AIRecordPanel-DZtUZnRe.js +40 -0
  7. package/src/ui/static/assets/AIStreamUI-BsxKziYG.js +9 -0
  8. package/src/ui/static/assets/AITestGenPage-Cg21-P1W.js +5 -0
  9. package/src/ui/static/assets/APITestingPage-Cdc8EZz2.js +19 -0
  10. package/src/ui/static/assets/AboutPage-yJLCr2_q.js +1 -0
  11. package/src/ui/static/assets/AdvancedPage-DB-6sJ6s.js +3 -0
  12. package/src/ui/static/assets/AnalyticsPage-gTPFsiLZ.js +1 -0
  13. package/src/ui/static/assets/AuditLogPage-DE45E_PV.js +1 -0
  14. package/src/ui/static/assets/ChangesSummary-C-7oi_sx.js +2 -0
  15. package/src/ui/static/assets/CodeMapPage-DgU6ZYBO.js +3 -0
  16. package/src/ui/static/assets/ConfirmDialog-DNU3qoAP.js +1 -0
  17. package/src/ui/static/assets/CoveragePage-BpTjgcdV.js +2 -0
  18. package/src/ui/static/assets/CronBuilder-DsnX-vRr.js +1 -0
  19. package/src/ui/static/assets/Dashboard-DRWbVyTb.js +1 -0
  20. package/src/ui/static/assets/DefectsPage-BtMNbq6Z.js +72 -0
  21. package/src/ui/static/assets/DiffViewer-DPglzjPH.js +2 -0
  22. package/src/ui/static/assets/EmptyState-BH_aDO0P.js +1 -0
  23. package/src/ui/static/assets/ExportButton-Ce_MxnM1.js +1 -0
  24. package/src/ui/static/assets/FileViewer-iYL0lxyY.js +18 -0
  25. package/src/ui/static/assets/GitPage-CQqV8JBC.js +12 -0
  26. package/src/ui/static/assets/ImportExportPage-DXk7Koaq.js +36 -0
  27. package/src/ui/static/assets/JiraPushDialog-CqftoLh8.js +1 -0
  28. package/src/ui/static/assets/LiveExecutionView-BD0wE8sz.js +1 -0
  29. package/src/ui/static/assets/ManagePage-B8iG6Q0B.js +1 -0
  30. package/src/ui/static/assets/MediaModal-DiSINwmh.js +1 -0
  31. package/src/ui/static/assets/MobileRunPicker-BNs2lZFf.js +1 -0
  32. package/src/ui/static/assets/MobileRunTarget-D2Nqcj10.js +6 -0
  33. package/src/ui/static/assets/ModuleExplorer-BmkoQrHb.js +1 -0
  34. package/src/ui/static/assets/OutputPage-Dcsr7cmr.js +1 -0
  35. package/src/ui/static/assets/PipelinesPanel-CMMXCSda.js +1 -0
  36. package/src/ui/static/assets/ProfilePage-ByshrcwC.js +1 -0
  37. package/src/ui/static/assets/ProjectExplorer-B9B___ij.js +1 -0
  38. package/src/ui/static/assets/RemoteFileStrip-DbPnaZ-v.js +1 -0
  39. package/src/ui/static/assets/ReportCard-BbNfk85h.js +2 -0
  40. package/src/ui/static/assets/ReportFullView-Cg1rggho.js +1 -0
  41. package/src/ui/static/assets/ReportsPage-CFv3OAhe.js +48 -0
  42. package/src/ui/static/assets/ResultsPage-B4LwZH-R.js +115 -0
  43. package/src/ui/static/assets/RunTargets-C7Vqd4TU.js +1 -0
  44. package/src/ui/static/assets/ScriptMappingPage-BrANeHv0.js +1 -0
  45. package/src/ui/static/assets/SearchableDevicePicker-CFJ_DUAA.js +1 -0
  46. package/src/ui/static/assets/SettingsPage-BwOiebKG.js +83 -0
  47. package/src/ui/static/assets/SharedReportView-BAbW1WOs.js +1 -0
  48. package/src/ui/static/assets/SourcesPage-C_QVQwiA.js +14 -0
  49. package/src/ui/static/assets/TestExplorerPage-BRRWtwde.js +7 -0
  50. package/src/ui/static/assets/TestManagementPage-Ch4PthuU.js +10 -0
  51. package/src/ui/static/assets/TestPlansPage-Bno2vpGd.js +5 -0
  52. package/src/ui/static/assets/TestverCreditsDetail-cSW0SpNx.js +1 -0
  53. package/src/ui/static/assets/TestverCreditsRing-CUsMGEe3.js +1 -0
  54. package/src/ui/static/assets/UncommittedDiffViewer-B5HSURk8.js +2 -0
  55. package/src/ui/static/assets/UserManagementPage-BjY3ftxf.js +10 -0
  56. package/src/ui/static/assets/WorkflowsPage-BUu-LjZ8.js +83 -0
  57. package/src/ui/static/assets/aiHandoff-vhtR29Fh.js +1 -0
  58. package/src/ui/static/assets/ansiToHtml-DYRzYQV1.js +1 -0
  59. package/src/ui/static/assets/dark-logo-DCPcGDyT.svg +1 -0
  60. package/src/ui/static/assets/excel-BrxuVus5.js +1 -0
  61. package/src/ui/static/assets/formatDate-T65-Y6Mi.js +1 -0
  62. package/src/ui/static/assets/formatTestName-BKd2Uqhs.js +1 -0
  63. package/src/ui/static/assets/hiddenLlmProviders-setxgY_B.js +1 -0
  64. package/src/ui/static/assets/index-B0klHYbO.css +1 -0
  65. package/src/ui/static/assets/index-DpQhqcHv.js +11 -0
  66. package/src/ui/static/assets/index-DtBWNlVD.js +47 -0
  67. package/src/ui/static/assets/logo-C7ltqfpq.svg +1 -0
  68. package/src/ui/static/assets/runSelected-WlgnZcSF.js +1 -0
  69. package/src/ui/static/assets/sandboxStorage-BrzaG3ny.js +1 -0
  70. package/src/ui/static/assets/simpleMarkdown-kWs-10D8.js +5 -0
  71. package/src/ui/static/assets/useChartTheme-BFz2QcND.js +1 -0
  72. package/src/ui/static/assets/useDebouncedValue-BsHptIvX.js +1 -0
  73. package/src/ui/static/assets/useFeatureFlags-DqhngqgG.js +1 -0
  74. package/src/ui/static/assets/useJiraConnector-TM1Rfj1s.js +1 -0
  75. package/src/ui/static/assets/useOwnership-eW6Egd7X.js +1 -0
  76. package/src/ui/static/assets/useSuites-CvtMGakZ.js +1 -0
  77. package/src/ui/static/assets/useTabParam-ChbOedP1.js +1 -0
  78. package/src/ui/static/assets/useTestExplorer-HqvURJAc.js +1 -0
  79. package/src/ui/static/assets/useTestLifecycle-CL7-zz0Q.js +1 -0
  80. package/src/ui/static/assets/useTestManagement-ZTA1_VUm.js +2 -0
  81. package/src/ui/static/assets/useTestResults-Bm-JyMhB.js +1 -0
  82. package/src/ui/static/assets/vendor-charts-DWFQlmCz.js +73 -0
  83. package/src/ui/static/assets/vendor-excel-BFHGVHVC.js +24 -0
  84. package/src/ui/static/assets/vendor-flow-BnuhLJ6X.css +1 -0
  85. package/src/ui/static/assets/vendor-flow-YGpC9U9I.js +23 -0
  86. package/src/ui/static/assets/vendor-icons-B0wLOBoh.js +1421 -0
  87. package/src/ui/static/assets/vendor-query-BrzmPFT3.js +1 -0
  88. package/src/ui/static/assets/vendor-quill-CTpA5PSA.css +7 -0
  89. package/src/ui/static/assets/{index-xlbWNOlh.js → vendor-quill-W-RoQfb6.js} +1 -1
  90. package/src/ui/static/assets/vendor-react-CTbHBddL.js +61 -0
  91. package/src/ui/static/assets/visibleInterval-BKsLfJZ3.js +1 -0
  92. package/src/ui/static/dark-logo.svg +1 -1
  93. package/src/ui/static/index.html +5 -2
  94. package/src/ui/static/logo.svg +1 -1
  95. package/src/ui/static/assets/dark-logo-BddlJH8z.svg +0 -1
  96. package/src/ui/static/assets/index-8gWK1fNb.js +0 -2250
  97. package/src/ui/static/assets/index-DMd4ynKJ.css +0 -7
  98. package/src/ui/static/assets/logo-DwQCjTm_.svg +0 -1
@@ -0,0 +1,47 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-DRWbVyTb.js","assets/vendor-react-CTbHBddL.js","assets/useTestExplorer-HqvURJAc.js","assets/vendor-query-BrzmPFT3.js","assets/vendor-icons-B0wLOBoh.js","assets/useTestLifecycle-CL7-zz0Q.js","assets/useTestResults-Bm-JyMhB.js","assets/useChartTheme-BFz2QcND.js","assets/vendor-charts-DWFQlmCz.js","assets/formatTestName-BKd2Uqhs.js","assets/useSuites-CvtMGakZ.js","assets/formatDate-T65-Y6Mi.js","assets/ModuleExplorer-BmkoQrHb.js","assets/FileViewer-iYL0lxyY.js","assets/RemoteFileStrip-DbPnaZ-v.js","assets/index-DpQhqcHv.js","assets/sandboxStorage-BrzaG3ny.js","assets/simpleMarkdown-kWs-10D8.js","assets/EmptyState-BH_aDO0P.js","assets/UncommittedDiffViewer-B5HSURk8.js","assets/ProjectExplorer-B9B___ij.js","assets/AdvancedPage-DB-6sJ6s.js","assets/useTabParam-ChbOedP1.js","assets/ansiToHtml-DYRzYQV1.js","assets/MobileRunTarget-D2Nqcj10.js","assets/SearchableDevicePicker-CFJ_DUAA.js","assets/LiveExecutionView-BD0wE8sz.js","assets/aiHandoff-vhtR29Fh.js","assets/runSelected-WlgnZcSF.js","assets/ConfirmDialog-DNU3qoAP.js","assets/visibleInterval-BKsLfJZ3.js","assets/CronBuilder-DsnX-vRr.js","assets/AIPanel-D09Ni3a4.js","assets/useFeatureFlags-DqhngqgG.js","assets/AIStreamUI-BsxKziYG.js","assets/ReportCard-BbNfk85h.js","assets/ChangesSummary-C-7oi_sx.js","assets/DiffViewer-DPglzjPH.js","assets/MediaModal-DiSINwmh.js","assets/hiddenLlmProviders-setxgY_B.js","assets/TestverCreditsRing-CUsMGEe3.js","assets/AIRecordPanel-DZtUZnRe.js","assets/ResultsPage-B4LwZH-R.js","assets/RunTargets-C7Vqd4TU.js","assets/useOwnership-eW6Egd7X.js","assets/excel-BrxuVus5.js","assets/vendor-excel-BFHGVHVC.js","assets/OutputPage-Dcsr7cmr.js","assets/TestExplorerPage-BRRWtwde.js","assets/MobileRunPicker-BNs2lZFf.js","assets/CodeMapPage-DgU6ZYBO.js","assets/vendor-flow-YGpC9U9I.js","assets/vendor-flow-BnuhLJ6X.css","assets/ManagePage-B8iG6Q0B.js","assets/PipelinesPanel-CMMXCSda.js","assets/SettingsPage-BwOiebKG.js","assets/TestverCreditsDetail-cSW0SpNx.js","assets/APITestingPage-Cdc8EZz2.js","assets/GitPage-CQqV8JBC.js","assets/UserManagementPage-BjY3ftxf.js","assets/AuditLogPage-DE45E_PV.js","assets/ProfilePage-ByshrcwC.js","assets/WorkflowsPage-BUu-LjZ8.js","assets/TestManagementPage-Ch4PthuU.js","assets/ImportExportPage-DXk7Koaq.js","assets/useTestManagement-ZTA1_VUm.js","assets/useDebouncedValue-BsHptIvX.js","assets/ExportButton-Ce_MxnM1.js","assets/useJiraConnector-TM1Rfj1s.js","assets/JiraPushDialog-CqftoLh8.js","assets/TestPlansPage-Bno2vpGd.js","assets/ScriptMappingPage-BrANeHv0.js","assets/AITestGenPage-Cg21-P1W.js","assets/CoveragePage-BpTjgcdV.js","assets/AnalyticsPage-gTPFsiLZ.js","assets/DefectsPage-BtMNbq6Z.js","assets/vendor-quill-W-RoQfb6.js","assets/vendor-quill-CTpA5PSA.css","assets/SourcesPage-C_QVQwiA.js","assets/SharedReportView-BAbW1WOs.js","assets/ReportsPage-CFv3OAhe.js","assets/ReportFullView-Cg1rggho.js","assets/AboutPage-yJLCr2_q.js"])))=>i.map(i=>d[i]);
2
+ import{r as p,j as s,N as Hn,b as Bt,u as H,d as Ft,O as Kn,L as ce,e as Vn,f as Yn,i as St,h as Qn,k as Xn,l as Q,m as Zn}from"./vendor-react-CTbHBddL.js";import{u as F,a as de,b as eo,c as Ve,k as to,Q as so,d as no}from"./vendor-query-BrzmPFT3.js";import{L as Gt,T as Ye,N as zt,G as ne,C as Le,a as qt,b as Qe,c as Ne,Z as Wt,B as Xe,d as Ht,H as Kt,e as Ze,S as et,f as Vt,F as Yt,g as tt,h as De,U as Me,i as Qt,P as oo,j as ao,A as _e,k as Ue,l as ro,I as Xt,X as st,m as io,n as vt,o as me,p as co,q as Zt,r as nt,s as es,t as ot,u as at,v as ts,W as lo,w as ss,R as ns,x as uo,M as mo,y as rt,z as it,D as po,E as ho,J as ke,K as ct,O as go,Q as fo,V as xo,Y as bo,_ as os,$ as as,a0 as yo,a1 as lt,a2 as wo,a3 as ve,a4 as So,a5 as vo,a6 as jo,a7 as rs,a8 as To,a9 as is,aa as No,ab as Je,ac as fe,ad as cs,ae as ls,af as ko,ag as ae,ah as Co,ai as Oo,aj as Po,ak as xe,al as dt,am as Eo,an as Ce,ao as Ro,ap as $o,aq as Ao,ar as Io,as as Lo}from"./vendor-icons-B0wLOBoh.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function o(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=o(l);fetch(l.href,i)}})();const Do="modulepreload",Mo=function(e){return"/"+e},jt={},I=function(t,o,r){let l=Promise.resolve();if(o&&o.length>0){let c=function(u){return Promise.all(u.map(h=>Promise.resolve(h).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),d=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));l=c(o.map(u=>{if(u=Mo(u),u in jt)return;jt[u]=!0;const h=u.endsWith(".css"),m=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${m}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":Do,h||(g.as="script"),g.crossOrigin="",g.href=u,d&&g.setAttribute("nonce",d),document.head.appendChild(g),h)return new Promise((b,N)=>{g.addEventListener("load",b),g.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(c){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=c,window.dispatchEvent(a),!a.defaultPrevented)throw c}return l.then(c=>{for(const a of c||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};let ds=Date.now(),Tt=!1;function us(){return ds}function _o(){if(Tt||typeof window>"u")return;Tt=!0;const e=()=>{ds=Date.now()};for(const t of["pointerdown","keydown","wheel","touchstart"])window.addEventListener(t,e,{capture:!0,passive:!0})}let pe=null,Oe=null;const Be=new Set;function Uo(){return pe}function Jo(){return Oe}function ms(e){e&&(Oe={idleHours:e.idleHours,maxDays:e.maxDays})}function oe(e){if(!(e&&(!Number.isFinite(e.expiresAt)||!Number.isFinite(e.absoluteExpiresAt)))&&!(e&&pe&&e.expiresAt===pe.expiresAt&&e.absoluteExpiresAt===pe.absoluteExpiresAt)){pe=e;for(const t of Be)t(e)}}function Bo(e){return Be.add(e),()=>{Be.delete(e)}}const Fe="testver.logoutReason";function Fo(e){try{sessionStorage.setItem(Fe,JSON.stringify({reason:e,policy:Oe}))}catch{}}function Go(){try{const e=sessionStorage.getItem(Fe);if(!e)return null;sessionStorage.removeItem(Fe);try{const t=JSON.parse(e);return t.reason?{reason:t.reason,policy:t.policy??null}:null}catch{return{reason:e,policy:null}}}catch{return null}}function zo(e,t=Oe){switch(e){case"idle":return`You were signed out after ${t?ps(t.idleHours):"a period"} without activity. Sign in to continue.`;case"max":return`Your sign-in reached its ${t?`${t.maxDays}-day`:"maximum"} limit. Please sign in again.`;case"revoked":return"Your session was ended — you signed out elsewhere, or an administrator signed you out.";case"invalid":case"required":return"Your session is no longer valid. Please sign in again.";default:return null}}function ps(e){return e%24===0&&e>=24?`${e/24} day${e===24?"":"s"}`:`${e} hour${e===1?"":"s"}`}const te="",ut="testver_token";function hs(e){if(!e.startsWith("/api/")||/[?&]token=/.test(e))return e;const t=G();return t?`${e}${e.includes("?")?"&":"?"}token=${encodeURIComponent(t)}`:e}function qo(e){const t=e.match(/\/api\/documents\/download\/[^\s"'<>)\]]+/);return hs(t?t[0]:e)}async function Se(e,t,o){var h;const r=G(),l=await fetch(`${te}${e}`,{...t,headers:{"Content-Type":"application/json",...r?{Authorization:`Bearer ${r}`}:{},...t.headers},cache:"no-store"});if(!l.ok){const m=await l.json().catch(()=>({error:l.statusText}));throw new Error(m.error||`Download failed (${l.status})`)}const c=((h=(l.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:h[1])||o,a=await l.blob(),d=URL.createObjectURL(a),u=document.createElement("a");u.href=d,u.download=c,document.body.appendChild(u),u.click(),u.remove(),URL.revokeObjectURL(d)}function G(){return localStorage.getItem(ut)}function je(e){localStorage.setItem(ut,e)}function Pe(){localStorage.removeItem(ut)}function Ee(e){Fo(e),Pe(),oe(null),window.location.pathname!=="/login"&&window.location.pathname!=="/setup"&&(window.location.href="/login")}function gs(e){const t=e.headers.get("x-testver-token");t&&G()&&je(t);const o=Number(e.headers.get("x-testver-session-expires")),r=Number(e.headers.get("x-testver-session-max"));o>0&&r>0&&oe({expiresAt:o,absoluteExpiresAt:r})}let Te=null;const Ge=[];function be(){return Te}function Wo(){try{const e=JSON.parse(sessionStorage.getItem("testver.previousClientIds")||"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}catch{return[]}}function ze(e){if(Te=e,e)for(;Ge.length>0;){const t=Ge.shift();try{t==null||t(e)}catch{}}}function re(e=5e3){return Te?Promise.resolve(Te):new Promise(t=>{let o=!1;const r=l=>{o||(o=!0,t(l))};Ge.push(l=>r(l)),setTimeout(()=>r(null),e)})}async function n(e,t){const o=G(),r={"Content-Type":"application/json",...t==null?void 0:t.headers};o&&(r.Authorization=`Bearer ${o}`);const l=be();l&&(r["X-Client-Id"]=l),r["X-Testver-Last-Activity"]=String(us());const i=await fetch(`${te}${e}`,{...t,headers:{...r,"Cache-Control":"no-cache"},cache:"no-store"});if(gs(i),i.status===401){const a=await i.json().catch(()=>({})),d=i.headers.get("x-testver-auth");if(d)throw Ee(d),new Error(a.error||"Session expired");const u=new Error(a.error||"Unauthorized");throw u.status=401,a.code&&(u.code=a.code),u.data=a,u}if(!i.ok){const a=await i.json().catch(()=>({error:i.statusText})),d=new Error(a.error||i.statusText);throw a.code&&(d.code=a.code),d.status=i.status,d.data=a,a.code==="TWO_FACTOR_SETUP_REQUIRED"&&window.dispatchEvent(new CustomEvent("testver:two-factor-setup-required")),d}const c=await i.json();if(c&&typeof c=="object"&&"setupRequired"in c&&c.setupRequired===!0)throw window.location.pathname!=="/setup"&&window.location.pathname!=="/login"&&(window.location.href="/setup"),new Error("Setup required");return c}const fs=()=>n("/api/project"),xs=()=>n("/api/project/rescan"),Ho=()=>n("/api/project/tree"),bs=()=>n("/api/system/app-mode"),ys=e=>n("/api/system/app-mode",{method:"POST",body:JSON.stringify({mode:e})}),ws=()=>n("/api/system/project-name"),Ss=e=>n("/api/system/project-name",{method:"PUT",body:JSON.stringify({name:e})}),Ko=()=>n("/api/system/features"),Vo=()=>n("/api/system/api-trace"),Yo=e=>n("/api/system/api-trace",{method:"PUT",body:JSON.stringify(e)}),Qo=(e=50)=>n(`/api/heal/history?limit=${e}`),Xo=(e,t)=>n(`/api/heal/status?runId=${encodeURIComponent(e)}&testName=${encodeURIComponent(t)}`),Zo=()=>n("/api/system/auto-heal"),ea=e=>n("/api/system/auto-heal",{method:"PUT",body:JSON.stringify(e)}),ta=(e,t)=>n("/api/heal/apply",{method:"POST",body:JSON.stringify({runId:e,testName:t})}),sa=(e,t)=>n("/api/heal/undo",{method:"POST",body:JSON.stringify({runId:e,testName:t})}),na=e=>n(`/api/project/modules/${e}/files`),oa=e=>n(`/api/files/${encodeURIComponent(e)}`),aa=(e,t)=>n("/api/files",{method:"POST",body:JSON.stringify({path:e,content:t})}),ra=(e,t)=>n(`/api/files/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({content:t})}),ia=e=>n(`/api/files/${encodeURIComponent(e)}`,{method:"DELETE"}),ca=(e,t)=>n("/api/files/search",{method:"POST",body:JSON.stringify({pattern:e,file_pattern:t})}),vs=(e,t)=>n(`/api/search/global?q=${encodeURIComponent(e)}`,{signal:t}),la=e=>n("/api/tests/ownership",{method:"POST",body:JSON.stringify({items:e})}),da=()=>n("/api/tests/ownership/all"),ua=()=>n("/api/tests/ownership/config"),ma=e=>n("/api/tests/ownership/config",{method:"POST",body:JSON.stringify(e)}),pa=()=>n("/api/tests/ownership/status"),ha=()=>n("/api/tests/ownership/scan/start",{method:"POST"}),ga=()=>n("/api/tests/ownership/scan/cancel",{method:"POST"});function fa(e){if(!e)return!1;const t=e.toLowerCase();return t==="appium"||t.startsWith("appium-")}const xa=()=>n("/api/runner/reuse-ticket"),ba=e=>n("/api/runner/run",{method:"POST",body:JSON.stringify(e)}),ya=e=>n(`/api/runner/status/${e}`),js=e=>n(`/api/runner/cancel/${e}`,{method:"POST"}),wa=(e,t)=>n(`/api/runner/runs/${e}/input`,{method:"POST",body:JSON.stringify(t)}),Sa=()=>n("/api/runner/history"),Ts=()=>n("/api/runner/active"),va=()=>n("/api/config/files"),ja=()=>n("/api/env"),Ta=(e,t)=>n("/api/env/compare",{method:"POST",body:JSON.stringify({file1:e,file2:t})}),Na=()=>n("/api/activity"),ka=(e=20,t=0,o)=>{const r=new URLSearchParams({limit:String(e),offset:String(t)});return o!=null&&o.status&&o.status!=="all"&&r.set("status",o.status),o!=null&&o.source&&(o.source==="cloud"||o.source==="local")&&r.set("source",o.source),n(`/api/results/runs?${r.toString()}`)},Ca=e=>{const t=e?`?source=${e}`:"";return Oa(t)},Oa=e=>n(`/api/results/runs/counts${e}`),Pa=e=>n(`/api/results/runs/${e}`),Ea=(e,t)=>n(`/api/results/runs/${e}/tests${t?`?status=${t}`:""}`),Ra=e=>n(`/api/results/runs/${e}/failures`),$a=(e=20)=>n(`/api/results/trends?count=${e}`),Aa=()=>n("/api/results/flaky"),Ia=(e=20)=>n(`/api/results/slowest?count=${e}`),La=(e=20)=>n(`/api/results/top-failures?count=${e}`),Da=e=>n(`/api/results/runs/${e}/analyze`,{method:"POST"}),Ma=e=>n(`/api/results/runs/${e}/analysis`),_a=(e,t)=>n(`/api/results/runs/${e}/assess`,{method:"POST",body:JSON.stringify(t===void 0?{}:{groupIndex:t})}),Ua=e=>n(`/api/results/runs/${e}/later-outcomes`),Ja=(e,t)=>n(`/api/results/test/${encodeURIComponent(e)}/history${t?`?file=${encodeURIComponent(t)}`:""}`),Ba=(e,t)=>n(`/api/results/compare/${e}/${t}`),Fa=e=>n(`/api/results/runs/${e}/new-failures`),Ga=(e=20)=>n(`/api/results/coverage?count=${e}`),za=(e=2)=>n(`/api/results/anomalies?threshold=${e}`),qa=(e=20)=>n(`/api/results/category-trends?count=${e}`),Wa=()=>n("/api/health"),Ha=(e=50)=>n(`/api/results/health-scores?count=${e}`),Ka=e=>n("/api/results/baseline",{method:"POST",body:JSON.stringify({runId:e}),headers:{"Content-Type":"application/json"}}),Va=()=>n("/api/results/baseline"),Ya=()=>n("/api/results/baseline",{method:"DELETE"}),Qa=(e,t)=>n(t?`/api/results/runs/${e}/console?testName=${encodeURIComponent(t)}`:`/api/results/runs/${e}/console`),Xa=()=>n("/api/llm/config"),Za=()=>n("/api/llm/testver/connect",{method:"POST"}),er=e=>n(`/api/llm/testver/connect/${encodeURIComponent(e)}`),tr=()=>n("/api/llm/testver/disconnect",{method:"POST"}),sr=(e=!1)=>n(`/api/llm/testver/status${e?"?fresh=1":""}`),Ns=(e=!1)=>n(`/api/testver/hub${e?"?fresh=1":""}`),nr=(e,t)=>n(`/api/testver/services/${e}`,{method:"PUT",body:JSON.stringify({enabled:t})}),or=()=>n("/api/testver/disconnect",{method:"POST"}),ar=e=>n("/api/llm/config",{method:"PUT",body:JSON.stringify(e)}),rr=e=>n("/api/llm/test-connection",{method:"POST",body:JSON.stringify(e)}),ir=(e,t)=>n("/api/llm/active-model",{method:"PUT",body:JSON.stringify({provider:e,model:t})}),cr=()=>n("/api/config/run-commands"),lr=e=>n("/api/config/run-commands",{method:"PUT",body:JSON.stringify(e)}),dr=e=>n("/api/config/test-command",{method:"POST",body:JSON.stringify({command:e})}),ur=()=>n("/api/config/run-commands/suggest",{method:"POST",body:"{}"}),mr=e=>n("/api/config/run-commands/suggest-targets",{method:"POST",body:JSON.stringify(e?{for:e}:{})}),pr=()=>n("/api/config/run-commands/check"),hr=()=>n("/api/codemap/coverage"),gr=(e=!1)=>n("/api/codemap"+(e?"?force=1":"")),fr=()=>n("/api/codemap/rebuild",{method:"POST",body:"{}"}),xr=e=>n("/api/codemap/symbol?id="+encodeURIComponent(e)),br=e=>n("/api/codemap/impact?id="+encodeURIComponent(e)),yr=()=>n("/api/codemap/quality"),wr=(e=!1)=>n("/api/datamap"+(e?"?force=1":"")),Sr=()=>n("/api/datamap/rebuild",{method:"POST",body:"{}"}),vr=e=>n("/api/datamap/source?id="+encodeURIComponent(e)),jr=(e,t=!1)=>n("/api/datamap/preview?id="+encodeURIComponent(e)+(t?"&reveal=1":"")),Tr=()=>n("/api/datamap/overrides"),Nr=e=>n("/api/datamap/include",{method:"POST",body:JSON.stringify({file:e})}),kr=e=>n("/api/datamap/ignore",{method:"POST",body:JSON.stringify({file:e})}),Cr=(e,t)=>n("/api/datamap/override",{method:"DELETE",body:JSON.stringify({file:e,list:t})}),Or=()=>n("/api/datamap/candidates"),Pr=()=>n("/api/env-config/files"),Er=e=>n("/api/env-config?file="+encodeURIComponent(e)),Rr=(e,t)=>n("/api/env-config",{method:"PUT",body:JSON.stringify({file:e,vars:t})}),$r=()=>n("/api/env-config/candidates"),Ar=e=>n("/api/env-config/load",{method:"POST",body:JSON.stringify({file:e})}),Ir=e=>n("/api/env-config/load",{method:"DELETE",body:JSON.stringify({file:e})}),Lr=()=>n("/api/tests/lifecycle"),Dr=(e,t,o)=>n("/api/tests/lifecycle",{method:"PUT",body:JSON.stringify({file:e,name:t,status:o})}),Mr=(e,t)=>n("/api/tests/lifecycle/bulk",{method:"POST",body:JSON.stringify({items:e,status:t})}),_r=()=>n("/api/runner/commands"),Ur=(e,t)=>n("/api/runner/commands",{method:"POST",body:JSON.stringify({label:e,command:t})}),Jr=(e,t)=>n(`/api/runner/commands/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),Br=e=>n(`/api/runner/commands/${encodeURIComponent(e)}`,{method:"DELETE"}),Fr=(e,t=2)=>n(`/api/codemap/graph?id=${encodeURIComponent(e)}&depth=${t}`),ye=(e,t)=>n(e,{method:"POST",body:JSON.stringify(t)}),Gr=e=>ye("/api/codemap/ai/explain",{id:e}),zr=e=>ye("/api/codemap/ai/document",{id:e}),qr=e=>ye("/api/codemap/ai/unused-verdict",{id:e}),Wr=e=>ye("/api/codemap/ai/suggest-test",{id:e}),Hr=e=>ye("/api/codemap/ai/consolidate",{ids:e}),Kr=e=>{const t=new URLSearchParams;return e.id&&t.set("id",e.id),e.name&&t.set("name",e.name),e.file&&t.set("file",e.file),n("/api/codemap/test-methods?"+t.toString())},ks="/api/codemap/export.csv";async function Vr(){const e=G(),t=await fetch(ks,{headers:e?{Authorization:`Bearer ${e}`}:{},cache:"no-store"});if(!t.ok)throw new Error(`Export failed (${t.status})`);const o=await t.blob(),r=URL.createObjectURL(o),l=document.createElement("a");l.href=r,l.download="code-map.csv",document.body.appendChild(l),l.click(),l.remove(),URL.revokeObjectURL(r)}const Yr=()=>n("/api/codemap/steps");async function Qr(){const e=G(),t=await fetch("/api/codemap/steps.csv",{headers:e?{Authorization:`Bearer ${e}`}:{},cache:"no-store"});if(!t.ok)throw new Error(`Export failed (${t.status})`);const o=await t.blob(),r=URL.createObjectURL(o),l=document.createElement("a");l.href=r,l.download="code-map-steps.csv",document.body.appendChild(l),l.click(),l.remove(),URL.revokeObjectURL(r)}const Xr=e=>n("/api/codemap/ai/explain-step",{method:"POST",body:JSON.stringify({id:e})}),Zr=e=>n("/api/codemap/ai/suggest-stepdef",{method:"POST",body:JSON.stringify({text:e})}),ei=e=>n("/api/codemap/ai/consolidate-steps",{method:"POST",body:JSON.stringify({ids:e})}),ti=()=>n("/api/tiers/config"),si=e=>n("/api/tiers/config",{method:"PUT",body:JSON.stringify(e)}),ni=()=>n("/api/tiers/reset",{method:"POST"}),oi=(e,t)=>n("/api/tiers/preview-prompt",{method:"POST",body:JSON.stringify({tier:e,toolNames:t})}),ai=e=>n("/api/ai/generate",{method:"POST",body:JSON.stringify(e)}),ri=e=>n("/api/ai/explain",{method:"POST",body:JSON.stringify(e)}),ii=e=>n("/api/ai/chat",{method:"POST",body:JSON.stringify(e)}),ci=()=>n("/api/ai/knowledge"),li=(e=[])=>n(`/api/ai/ask-feedback${e.length?`?answers=${encodeURIComponent(e.join(","))}`:""}`),di=e=>n("/api/ai/ask-feedback",{method:"POST",body:JSON.stringify(e)}),ui=e=>n(`/api/ai/ask-feedback/miss?query=${encodeURIComponent(e)}`,{method:"DELETE"}),mi=(e,t)=>n(`/api/ai/knowledge/run-file?run=${encodeURIComponent(e)}&file=${encodeURIComponent(t)}`),pi=()=>n("/api/mobile/providers"),hi=e=>n(`/api/mobile/test-credentials?provider=${encodeURIComponent(e)}`),gi=(e="browserstack")=>n(`/api/mobile/devices?provider=${encodeURIComponent(e)}`),fi=()=>n("/api/mobile/apps"),xi=async(e,t,o)=>{const r=new FormData;r.append("file",e),t&&r.append("label",t);const l=G(),i=be();return new Promise((c,a)=>{const d=new XMLHttpRequest;d.open("POST","/api/mobile/apps"),l&&d.setRequestHeader("Authorization",`Bearer ${l}`),i&&d.setRequestHeader("X-Client-Id",i),d.upload.onprogress=u=>{u.lengthComputable&&o&&o(u.loaded/u.total)},d.onerror=()=>a(new Error("Network error during upload. Check your connection and the server log.")),d.onabort=()=>a(new Error("Upload aborted.")),d.onload=()=>{const u=d.responseText||"";let h=null;try{h=u?JSON.parse(u):null}catch{}if(d.status>=200&&d.status<300&&(h!=null&&h.app)){c(h.app);return}const m=(h==null?void 0:h.error)||u.slice(0,300)||`HTTP ${d.status}`;a(new Error(`Upload failed (HTTP ${d.status}): ${m}`))},d.send(r)})},bi=e=>n(`/api/mobile/apps/${encodeURIComponent(e)}`,{method:"DELETE"}),yi=(e,t)=>n(`/api/mobile/apps/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({label:t})}),wi=async e=>{const t=await re();return n("/api/mobile/session",{method:"POST",body:JSON.stringify({...e,clientId:t})})},Si=()=>n("/api/mobile/session"),vi=()=>n("/api/mobile/session",{method:"DELETE"}),ji=(e={})=>n(`/api/mobile/session/screenshot${e.since?`?since=${e.since}`:""}`,e.timeoutMs?{signal:AbortSignal.timeout(e.timeoutMs)}:void 0);function Ti(e){const t=e;return!!t&&(t.status===503||t.code==="FRAME_PENDING"||t.name==="TimeoutError"||t.name==="AbortError")}const Ni=()=>n("/api/mobile/recording/start",{method:"POST",body:"{}"}),ki=()=>n("/api/mobile/recording"),Ci=(e,t)=>n("/api/mobile/recording/tap",{method:"POST",body:JSON.stringify({x:e,y:t})}),Oi=(e,t)=>n("/api/mobile/recording/type",{method:"POST",body:JSON.stringify({text:e,...t||{}})}),Pi=(e,t,o,r,l)=>n("/api/mobile/recording/swipe",{method:"POST",body:JSON.stringify({fromX:e,fromY:t,toX:o,toY:r,durationMs:l})}),Ei=(e,t)=>n("/api/mobile/recording/press-key",{method:"POST",body:JSON.stringify({key:e,...t||{}})}),Ri=e=>n("/api/mobile/session/press-key",{method:"POST",body:JSON.stringify({key:e})}),$i=e=>n("/api/mobile/recording/stop",{method:"POST",body:JSON.stringify(e)}),Ai=e=>n(`/api/mobile/recording/actions/${e}`,{method:"DELETE"}),Ii=()=>n("/api/mobile/recording/reset",{method:"POST",body:"{}"}),Li=e=>n("/api/mobile/recording/preview",{method:"POST",body:JSON.stringify(e)}),Di=()=>n("/api/mobile/recording/formatters"),Mi=(e,t)=>n(`/api/mobile/recording/actions/${e}`,{method:"PATCH",body:JSON.stringify(t)}),_i=e=>n("/api/mobile/recording/actions/reorder",{method:"POST",body:JSON.stringify({order:e})}),Ui=()=>n("/api/mobile/recording/end",{method:"POST",body:"{}"}),Ji=e=>n("/api/mobile/recording/pause",{method:"POST",body:JSON.stringify({paused:e})}),Bi=()=>n("/api/mobile/session/keepalive",{method:"POST",body:"{}"}),Fi=()=>n("/api/mobile/recording/resume",{method:"POST",body:"{}"}),Gi=(e,t,o)=>n("/api/mobile/recording/load",{method:"POST",body:JSON.stringify({actions:e,sessionInfo:t??void 0,settings:o??void 0})}),zi=(e,t)=>n("/api/mobile/recording/custom",{method:"POST",body:JSON.stringify({action:e,...t!==void 0?{afterIndex:t}:{}})}),qi=(e,t)=>n("/api/mobile/recording/actions/replace",{method:"POST",body:JSON.stringify({indexes:e,action:t})}),Wi=e=>n(`/api/mobile/recording/actions/${e}/restore`,{method:"POST",body:"{}"}),Hi=e=>n("/api/mobile/recording/settings",{method:"PUT",body:JSON.stringify({settings:e})}),Ki=e=>n("/api/mobile/recording/annotate",{method:"POST",body:JSON.stringify({text:e})}),Vi=()=>n("/api/mobile/session/elements"),Yi=e=>n("/api/mobile/recording/assertion",{method:"POST",body:JSON.stringify(e)}),Qi=e=>n("/api/mobile/recording/annotate",{method:"POST",body:JSON.stringify(e)}),Xi=e=>n("/api/mobile/recording/assert-mode",{method:"POST",body:JSON.stringify({enable:e})}),Zi=e=>n("/api/mobile/recording/annotate-mode",{method:"POST",body:JSON.stringify({enable:e})}),ec=(e=1,t=!1)=>n("/api/mobile/recording/playback",{method:"POST",body:JSON.stringify({speed:e,restart:t})}),tc=e=>n("/api/mobile/recording/generate",{method:"POST",body:JSON.stringify(e)}),sc=e=>n("/api/mobile/recording/generate/followup",{method:"POST",body:JSON.stringify(e)}),nc=e=>n("/api/mobile/recording/generate/stop",{method:"POST",body:JSON.stringify({requestId:e})}),oc=()=>n("/api/mobile/project/tests"),ac=(e={})=>{const t=new URLSearchParams;e.search&&t.set("search",e.search),e.tag&&t.set("tag",e.tag),e.limit&&t.set("limit",String(e.limit));const o=t.toString();return n(`/api/mobile/recordings${o?"?"+o:""}`)},rc=e=>n(`/api/mobile/recordings/${encodeURIComponent(e)}`),ic=e=>n("/api/mobile/recordings",{method:"POST",body:JSON.stringify(e)}),cc=(e,t)=>n(`/api/mobile/recordings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),Cs="testver.mobileRecordingId";function lc(){try{const t=sessionStorage.getItem(Cs);if(t)return t}catch{}const e=be();return e?`draft-${e}`:"draft-anonymous"}function dc(){const e=`mrec-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;try{sessionStorage.setItem(Cs,e)}catch{}return e}const uc=e=>n(`/api/mobile/recordings/${encodeURIComponent(e)}`,{method:"DELETE"}),mc=(e={})=>{const t=new URLSearchParams;e.includeArchived&&t.set("status","all"),e.type&&t.set("type",e.type),e.search&&t.set("search",e.search);const o=t.toString();return n(`/api/tm/source-summaries${o?`?${o}`:""}`)},pc=async e=>{const t=await re();return n("/api/ai/chat-stream",{method:"POST",body:JSON.stringify({...e,clientId:t})})},hc=()=>n("/api/ai/chat-reset",{method:"POST"}),gc=e=>n("/api/ai/chat-stream/stop",{method:"POST",body:JSON.stringify(e)}),fc=e=>n("/api/ai/new-test",{method:"POST",body:JSON.stringify(e)}),xc=e=>n("/api/ai/code-review",{method:"POST",body:JSON.stringify(e)}),bc=e=>n("/api/ai/apply-review-fixes",{method:"POST",body:JSON.stringify(e)}),yc=async(e,t)=>{const o=new FormData;for(const c of e)o.append("files",c);const r={},l=G();l&&(r.Authorization=`Bearer ${l}`);const i=await fetch(`/api/upload${t==="api"?"?mode=api":""}`,{method:"POST",body:o,headers:r});if(!i.ok){const c=await i.json().catch(()=>({error:i.statusText}));throw new Error(c.error||i.statusText)}return i.json()},wc=e=>n(`/api/upload/${e}`,{method:"DELETE"}),Sc=async e=>{const t=await re();return n("/api/browser/chat",{method:"POST",body:JSON.stringify({...e,clientId:t})})},vc=()=>n("/api/browser/status"),jc=()=>n("/api/browser/screenshot",{method:"POST"}),Tc=()=>n("/api/browser/viewport"),Nc=()=>n("/api/browser/close",{method:"POST"}),kc=()=>n("/api/browser/keepalive",{method:"POST"}),Cc=()=>n("/api/tests/explore"),Os=(e,t)=>n(`/api/tests/scenario/${encodeURIComponent(e)}/history${t?`?file=${encodeURIComponent(t)}`:""}`),Oc=(e,t,o,r)=>n(`/api/tests/source?file=${encodeURIComponent(e)}&startLine=${t}${o?`&endLine=${o}`:""}${r?`&framework=${encodeURIComponent(r)}`:""}`),Pc=(e,t)=>n(`/api/tests/source?file=${encodeURIComponent(e)}&testName=${encodeURIComponent(t)}`),Ec=(e,t)=>n(`/api/tests/step-definition?step=${encodeURIComponent(e)}${t?`&keyword=${encodeURIComponent(t)}`:""}`),Rc=e=>n("/api/tests/step-definitions",{method:"POST",body:JSON.stringify({steps:e})}),$c=Os,Ac=e=>n("/api/cicd/generate",{method:"POST",body:JSON.stringify(e)}),Ic=e=>n("/api/cicd/save",{method:"POST",body:JSON.stringify(e)}),Lc=()=>n("/api/cicd/pipelines"),Dc=e=>e.id?n(`/api/cicd/pipelines/${e.id}`,{method:"PUT",body:JSON.stringify(e)}):n("/api/cicd/pipelines",{method:"POST",body:JSON.stringify(e)}),Mc=e=>n(`/api/cicd/pipelines/${e}`,{method:"DELETE"}),_c=()=>n("/api/cicd/tokens"),Uc=e=>n("/api/cicd/tokens",{method:"POST",body:JSON.stringify(e)}),Jc=e=>n(`/api/cicd/pipelines/${e}/previous-names`,{method:"DELETE"}),Bc=e=>n(`/api/cicd/tokens/${e}`,{method:"DELETE"}),Fc=(e=50)=>n(`/api/cicd/ci-runs?limit=${e}`),Gc=e=>n(`/api/cicd/ci-runs/${e}/cancel`,{method:"POST"}),zc=()=>n("/api/cicd/ci-analytics"),qc=e=>n(`/api/cicd/trace?q=${encodeURIComponent(e)}`),Wc=()=>n("/api/chat/sessions"),Hc=e=>n(`/api/chat/sessions/${encodeURIComponent(e)}`),Kc=(e,t,o)=>n("/api/chat/sessions",{method:"POST",body:JSON.stringify({id:e,title:t,mode:o})}),Vc=()=>n(`/api/reports?_t=${Date.now()}`),Yc=()=>n(`/api/reports/shared?_t=${Date.now()}`),Qc=e=>n(`/api/reports/${encodeURIComponent(e)}?_t=${Date.now()}`),Xc=e=>n("/api/reports",{method:"POST",body:JSON.stringify(e)}),Zc=(e,t)=>n(`/api/reports/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),el=e=>n(`/api/reports/${encodeURIComponent(e)}`,{method:"DELETE"}),tl=e=>n(`/api/reports/${encodeURIComponent(e)}/regenerate`,{method:"POST",body:JSON.stringify({})}),sl=(e,t)=>n(`/api/reports/${encodeURIComponent(e)}/share`,{method:"POST",body:JSON.stringify(t?{expiresInDays:t}:{})}),nl=(e,t)=>"reportId"in t?Se(`/api/reports/${encodeURIComponent(t.reportId)}/export/${e}`,{method:"GET"},`report.${e}`):"shareToken"in t?Se(`/api/reports/share/${encodeURIComponent(t.shareToken)}/export/${e}`,{method:"GET"},`report.${e}`):Se(`/api/reports/export/${e}`,{method:"POST",body:JSON.stringify({spec:t.spec})},`${t.title||"report"}.${e}`),ol=e=>n(`/api/reports/${encodeURIComponent(e)}/share`,{method:"DELETE"}),al=e=>n(`/api/reports/share/${encodeURIComponent(e)}`),rl=()=>n(`/api/reports/schedules?_t=${Date.now()}`),il=e=>n(`/api/reports/schedules/${encodeURIComponent(e)}`),cl=e=>n("/api/reports/schedules",{method:"POST",body:JSON.stringify(e)}),ll=(e,t)=>n(`/api/reports/schedules/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),dl=e=>n(`/api/reports/schedules/${encodeURIComponent(e)}`,{method:"DELETE"}),ul=e=>n(`/api/reports/schedules/${encodeURIComponent(e)}/run-now`,{method:"POST",body:JSON.stringify({})}),ml=(e,t)=>n(`/api/chat/sessions/${encodeURIComponent(e)}/permission-mode`,{method:"PATCH",body:JSON.stringify({permissionMode:t})}),pl=(e,t)=>n("/api/ai/chat-stream/permission-mode",{method:"POST",body:JSON.stringify({requestId:e,permissionMode:t})}),hl=(e,t)=>n(`/api/chat/sessions/${encodeURIComponent(e)}/mode`,{method:"PATCH",body:JSON.stringify({mode:t})}),gl=(e,t,o)=>n(`/api/chat/sessions/${encodeURIComponent(e)}/messages`,{method:"POST",body:JSON.stringify({role:t,content:o})}),fl=(e,t)=>n(`/api/chat/sessions/${encodeURIComponent(e)}/timeline`,{method:"PUT",body:JSON.stringify({fullTimeline:t})}),xl=(e,t)=>n(`/api/chat/sessions/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({title:t})}),bl=e=>n(`/api/chat/sessions/${encodeURIComponent(e)}`,{method:"DELETE"}),yl=()=>n("/api/chat/sessions",{method:"DELETE"}),wl=async e=>{const t=await re();return n("/api/recorder/start",{method:"POST",body:JSON.stringify({...e,clientId:t})})},Sl=()=>n("/api/recorder/stop",{method:"POST"}),vl=()=>n("/api/recorder/status"),jl=e=>n("/api/recorder/load",{method:"POST",body:JSON.stringify({sessionId:e})}),Tl=()=>n("/api/recorder/actions"),Nl=async e=>{const t=await re();return n("/api/recorder/generate",{method:"POST",body:JSON.stringify({...e,clientId:t})})},kl=e=>n("/api/recorder/abort",{method:"POST",body:JSON.stringify(e)}),Cl=async e=>{const t=await re();return n("/api/recorder/followup",{method:"POST",body:JSON.stringify({...e,clientId:t})})},Ol=e=>n("/api/recorder/playback",{method:"POST",body:JSON.stringify(e)}),Pl=e=>n(`/api/recorder/actions/${encodeURIComponent(e)}`,{method:"DELETE"}),El=(e,t)=>n(`/api/recorder/actions/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({action:t})}),Rl=(e,t)=>n("/api/recorder/actions",{method:"POST",body:JSON.stringify({action:e,...t!==void 0?{afterId:t}:{}})}),$l=(e,t)=>n("/api/recorder/actions/replace",{method:"POST",body:JSON.stringify({actionIds:e,action:t})}),Al=e=>n(`/api/recorder/actions/${encodeURIComponent(e)}/restore`,{method:"POST",body:"{}"}),Il=(e,t,o)=>{const r=new URLSearchParams;return e&&r.set("q",e),t!=null&&t.length&&r.set("kinds",t.join(",")),o&&r.set("limit",String(o)),n(`/api/recorder/references?${r.toString()}`)},Ll=e=>n(`/api/recorder/test-data?file=${encodeURIComponent(e)}`),Dl=e=>n("/api/recorder/settings",{method:"PUT",body:JSON.stringify({settings:e})}),Ml=()=>n("/api/recorder/reinspect",{method:"POST"}),_l=e=>n("/api/recorder/reorder",{method:"POST",body:JSON.stringify({actionIds:e})}),Ul=()=>n("/api/recorder/pause",{method:"POST"}),Jl=()=>n("/api/recorder/resume",{method:"POST"}),Bl=()=>n("/api/recorder/resume-recording",{method:"POST"}),Fl=e=>{const t=new URLSearchParams;e!=null&&e.search&&t.set("search",e.search),(e==null?void 0:e.template)!==void 0&&t.set("template",String(e.template)),e!=null&&e.limit&&t.set("limit",String(e.limit));const o=t.toString();return n(`/api/recorder/history${o?"?"+o:""}`)},Gl=e=>n(`/api/recorder/history/${e}`),zl=e=>n("/api/recorder/history",{method:"POST",body:JSON.stringify(e)}),ql=(e,t)=>n(`/api/recorder/history/${e}`,{method:"PUT",body:JSON.stringify(t)}),Wl=e=>n(`/api/recorder/history/${e}`,{method:"DELETE"}),Hl=(e,t)=>n(`/api/recorder/history/compare/${e}/${t}`),Kl=e=>n("/api/recorder/assert-mode",{method:"POST",body:JSON.stringify({enable:e})}),Vl=e=>n("/api/recorder/annotate-mode",{method:"POST",body:JSON.stringify({enable:e})}),Yl=()=>n("/api/recorder/reset",{method:"POST"}),Ql=e=>n("/api/cloud/grid/connect",{method:"POST",body:JSON.stringify({takeover:(e==null?void 0:e.takeover)===!0})}),Xl=()=>n("/api/cloud/grid/connection",{method:"DELETE"}),Zl=()=>n("/api/cloud/grid/status"),ed=e=>n(`/api/runner/grid-browsers?command=${encodeURIComponent(e)}`),td=()=>n("/api/cloud/grid/usage"),sd=()=>n("/api/cloud/grid/test",{method:"POST"}),nd=e=>n(`/api/runner/runs/${encodeURIComponent(e)}/live`),od=()=>n("/api/runner/runs/live"),ad=()=>n("/api/cloud/grid/sessions"),rd=e=>n(`/api/cloud/grid/sessions/${e}`,{method:"DELETE"});function id(e){const t=G();return`/api/cloud/grid/live/${e}${t?`?token=${encodeURIComponent(t)}`:""}`}const cd=e=>n("/api/cloud/providers",{method:"POST",body:JSON.stringify({id:"testver-grid",...e})}),ld=()=>n("/api/mobile/local/status"),dd=()=>n("/api/mobile/local/config"),ud=e=>n("/api/mobile/local/config",{method:"POST",body:JSON.stringify(e)}),md=e=>n("/api/mobile/local/emulator/start",{method:"POST",body:JSON.stringify({avd:e})}),pd=e=>n("/api/mobile/local/emulator/stop",{method:"POST",body:JSON.stringify({serial:e})}),hd=e=>n("/api/mobile/local/simulator/start",{method:"POST",body:JSON.stringify({udid:e})}),gd=e=>n("/api/mobile/local/simulator/stop",{method:"POST",body:JSON.stringify({udid:e})}),fd=()=>n("/api/cloud/providers"),xd=e=>n(`/api/cloud/providers/${e}`),bd=e=>n("/api/cloud/providers",{method:"POST",body:JSON.stringify(e)}),yd=e=>n(`/api/cloud/providers/${e}`,{method:"DELETE"}),wd=e=>n("/api/cloud/default-provider",{method:"PUT",body:JSON.stringify({provider:e})}),Sd=e=>n("/api/cloud/test-connection",{method:"POST",body:JSON.stringify(e)}),vd=(e,t=10)=>n(`/api/cloud/providers/${e}/builds?limit=${t}`),jd=(e,t)=>n(`/api/cloud/providers/${e}/env-vars${t?`?buildName=${encodeURIComponent(t)}`:""}`),Td=e=>n(`/api/cloud/providers/${e}/hub-url`),Nd=()=>n("/api/cloud/schedules"),kd=e=>n("/api/cloud/schedules",{method:"POST",body:JSON.stringify(e)}),Cd=(e,t)=>n(`/api/cloud/schedules/${e}`,{method:"PUT",body:JSON.stringify(t)}),Od=e=>n(`/api/cloud/schedules/${e}`,{method:"DELETE"}),Pd=(e,t)=>n("/api/cloud/analyze",{method:"POST",body:JSON.stringify({provider:e,command:t||void 0})}),Ed=e=>n(`/api/results/runs/${e}/fetch-artifacts`,{method:"POST"}),Rd=e=>n(`/api/cloud/schedules/${e}/run-now`,{method:"POST"}),$d=()=>n("/api/cloud/schedules/next-runs"),Ad=()=>n("/api/api-testing/collections"),Id=e=>n(`/api/api-testing/collections/${e}`),Ld=e=>n("/api/api-testing/collections",{method:"POST",body:JSON.stringify(e)}),Dd=(e,t)=>n(`/api/api-testing/collections/${e}`,{method:"PUT",body:JSON.stringify(t)}),Md=e=>n(`/api/api-testing/collections/${e}`,{method:"DELETE"}),_d=(e,t,o)=>n(`/api/api-testing/collections/${e}/requests`,{method:"POST",body:JSON.stringify({request:t,folderId:o})}),Ud=(e,t)=>n(`/api/api-testing/collections/${e}/requests/${t}`,{method:"DELETE"}),Jd=(e,t)=>n(`/api/api-testing/collections/${e}/folders`,{method:"POST",body:JSON.stringify({name:t})}),Bd=(e,t,o)=>n(`/api/api-testing/collections/${e}/folders/${t}`,{method:"PUT",body:JSON.stringify(o)}),Fd=(e,t)=>n(`/api/api-testing/collections/${e}/folders/${t}`,{method:"DELETE"}),Gd=e=>n(`/api/api-testing/collections/${e}/environments`),zd=(e,t)=>n(`/api/api-testing/collections/${e}/environments`,{method:"POST",body:JSON.stringify(t)}),qd=(e,t,o)=>n(`/api/api-testing/collections/${e}/environments/${t}`,{method:"PUT",body:JSON.stringify(o)}),Wd=(e,t)=>n(`/api/api-testing/collections/${e}/environments/${t}`,{method:"DELETE"}),Hd=(e,t,o,r)=>n("/api/api-testing/send",{method:"POST",body:JSON.stringify({request:e,variables:t,collectionId:o,environmentId:r})}),Kd=(e,t)=>n("/api/api-testing/send-chain",{method:"POST",body:JSON.stringify({requests:e,variables:t})}),Vd=(e=50)=>n(`/api/api-testing/history?limit=${e}`),Yd=()=>n("/api/api-testing/history",{method:"DELETE"}),Qd=(e,t)=>n("/api/api-testing/import",{method:"POST",body:JSON.stringify({data:e,format:t})}),Xd=(e,t,o)=>n(`/api/api-testing/collections/${e}/requests/reorder`,{method:"PUT",body:JSON.stringify({folderId:t,requestIds:o})}),Zd=(e,t,o)=>n(`/api/api-testing/collections/${e}/requests/${t}/move`,{method:"POST",body:JSON.stringify({targetFolderId:o})}),eu=e=>n(`/api/api-testing/collections/${e}/export`),tu=async(e,t)=>{const o=G(),r=await fetch(`${te}/api/api-testing/collections/${e}/export`,{headers:o?{Authorization:`Bearer ${o}`}:{}});if(!r.ok)throw new Error("Export failed");const l=await r.json(),i={testver:!0,version:"1.0",exportedAt:new Date().toISOString(),collections:[l]},c=new Blob([JSON.stringify(i,null,2)],{type:"application/json"}),a=URL.createObjectURL(c),d=document.createElement("a");d.href=a,d.download=`${t.replace(/[^a-zA-Z0-9-_]/g,"_")}.testver.json`,document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(a)},su=async()=>{const e=G(),t=await fetch(`${te}/api/api-testing/export-all`,{headers:e?{Authorization:`Bearer ${e}`}:{}});if(!t.ok)throw new Error("Export failed");const o=await t.blob(),r=URL.createObjectURL(o),l=document.createElement("a");l.href=r,l.download=`testver-collections-${Date.now()}.testver.json`,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(r)},nu=e=>n("/api/ai/generate-api-test",{method:"POST",body:JSON.stringify(e)}),ou=(e,t)=>n("/api/api-testing/parse-spec",{method:"POST",body:JSON.stringify({content:e,format:t})}),au=e=>n("/api/ai/generate-api-scenarios",{method:"POST",body:JSON.stringify(e)}),mt=()=>n("/api/git/status"),Ps=e=>n(`/api/git/blame?file=${encodeURIComponent(e)}`),pt=(e=20,t)=>n(`/api/git/log?limit=${e}${t?`&file=${encodeURIComponent(t)}`:""}`),Es=e=>n(`/api/git/diff/${e}`),Rs=e=>n(`/api/git/diff/uncommitted${e?`?file=${encodeURIComponent(e)}`:""}`),$s=(e,t=30)=>n(`/api/git/churn?file=${encodeURIComponent(e)}&days=${t}`),As=e=>n(`/api/git/correlate/${e}`),Is=e=>n(`/api/git/ownership/${e}`),Ls=(e,t=!1)=>n("/api/git/stage",{method:"POST",body:JSON.stringify(t?{files:e,includeTestver:t}:{files:e})}),Ds=e=>n("/api/git/unstage",{method:"POST",body:JSON.stringify({files:e})}),Ms=(e,t={})=>n("/api/git/commit",{method:"POST",body:JSON.stringify({message:e,amend:!!t.amend,...t.confirmPushedAmend?{confirmPushedAmend:!0}:{},...t.includeTestver?{includeTestver:!0}:{}})}),_s=()=>n("/api/git/identity"),Us=()=>n("/api/git/last-commit"),Js=(e,t,o=!1)=>n("/api/git/discard",{method:"POST",body:JSON.stringify({files:e,...t?{scope:t}:{},...o?{includeTestver:o}:{}})}),Bs=()=>n("/api/git/stash"),Fs=(e,t=!0)=>n("/api/git/stash",{method:"POST",body:JSON.stringify({message:e,includeUntracked:t})}),Gs=(e,t)=>n("/api/git/stash/pop",{method:"POST",body:JSON.stringify({ref:e,sha:t})}),zs=(e,t)=>n("/api/git/stash/drop",{method:"POST",body:JSON.stringify({ref:e,sha:t})}),qs=()=>n("/api/git/stash/back-out",{method:"POST"}),Ws=()=>n("/api/git/operation/abort",{method:"POST"}),Hs=()=>n("/api/git/operation/skip",{method:"POST"}),Ks=()=>n("/api/git/operation/continue",{method:"POST"}),Vs=e=>n("/api/git/fetch",{method:"POST",body:JSON.stringify({remote:e})}),Ys=(e,t)=>n("/api/git/pull",{method:"POST",body:JSON.stringify({remote:e,branch:t})}),Qs=(e,t)=>n("/api/git/push",{method:"POST",body:JSON.stringify({remote:e,branch:t})}),Xs=()=>n("/api/git/remote-updates"),Zs=()=>n("/api/git/remote-updates/check",{method:"POST"}),en=()=>n("/api/git/remote-updates/incoming"),tn=()=>n("/api/git/remote-updates/stash-pull",{method:"POST"}),sn=()=>n("/api/git/remote-updates/match-remote",{method:"POST"}),nn=e=>n("/api/git/branch/delete",{method:"POST",body:JSON.stringify({name:e})}),ru=()=>n("/api/system/remote-updates"),iu=e=>n("/api/system/remote-updates",{method:"PUT",body:JSON.stringify(e)}),on=(e,t,o=!1)=>n("/api/askpass/answer",{method:"POST",body:JSON.stringify({requestId:e,value:t,remember:o})}),an=e=>n("/api/askpass/cancel",{method:"POST",body:JSON.stringify({requestId:e})}),cu=()=>n("/api/askpass/cache"),lu=()=>n("/api/askpass/forget",{method:"POST"}),du=e=>n(`/api/git/conflict?file=${encodeURIComponent(e)}`),rn=(e,t)=>n("/api/git/conflict/resolve",{method:"POST",body:JSON.stringify(typeof t=="string"?{path:e,content:t}:{path:e,...t})}),cn=()=>n("/api/git/branches"),ln=(e,t=!0)=>n("/api/git/branch/create",{method:"POST",body:JSON.stringify({name:e,checkout:t})}),dn=e=>n("/api/git/branch/switch",{method:"POST",body:JSON.stringify({name:e})});async function un(){const e=await n("/api/auth/session/extend",{method:"POST"});return oe({expiresAt:e.expiresAt,absoluteExpiresAt:e.absoluteExpiresAt}),e}const uu=()=>n("/api/system/session-policy");async function mu(e){const t=await n("/api/system/session-policy",{method:"PUT",body:JSON.stringify(e)});return ms(t),t}const ht=()=>n("/api/auth/status"),mn="testver.trustedBrowsers";function gt(){try{const e=JSON.parse(localStorage.getItem(mn)||"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string").slice(0,10):[]}catch{return[]}}function pn(e){try{localStorage.setItem(mn,JSON.stringify([e,...gt().filter(t=>t!==e)].slice(0,10)))}catch{}}const hn=(e,t)=>n("/api/auth/login",{method:"POST",body:JSON.stringify({username:e,password:t,trustedBrowsers:gt()})});async function gn(e){const t=await n("/api/auth/login/2fa",{method:"POST",body:JSON.stringify(e)});return t.trustedBrowser&&pn(t.trustedBrowser),t}const fn=e=>n("/api/auth/login/2fa/setup",{method:"POST",body:JSON.stringify({challenge:e})}),xn=(e,t)=>n("/api/auth/login/2fa/enable",{method:"POST",body:JSON.stringify({challenge:e,code:t})}),bn=e=>n("/api/auth/forgot-password",{method:"POST",body:JSON.stringify({identifier:e})}),yn=e=>n(`/api/auth/reset-password/${encodeURIComponent(e)}`),wn=(e,t)=>n("/api/auth/reset-password",{method:"POST",body:JSON.stringify({token:e,password:t})}),Sn=e=>n("/api/auth/setup",{method:"POST",body:JSON.stringify(e)}),vn=()=>n("/api/auth/logout",{method:"POST"}),pu=(e,t)=>n("/api/auth/change-password",{method:"POST",body:JSON.stringify({currentPassword:e,newPassword:t})}),hu=()=>n("/api/auth/me"),gu=()=>n("/api/auth/2fa"),jn=e=>n("/api/auth/2fa/setup",{method:"POST",body:JSON.stringify({password:e})}),Tn=(e,t)=>n("/api/auth/2fa/enable",{method:"POST",body:JSON.stringify({code:e,signOutOthers:t})}),fu=(e,t)=>n("/api/auth/2fa/recovery-codes",{method:"POST",body:JSON.stringify({password:e,...t})}),xu=(e,t)=>n("/api/auth/2fa/disable",{method:"POST",body:JSON.stringify({password:e,...t})}),bu=e=>n(`/api/auth/2fa/trusted-browsers/${encodeURIComponent(e)}`,{method:"DELETE"}),yu=()=>n("/api/auth/2fa/trusted-browsers",{method:"DELETE"}),wu=()=>n("/api/system/two-factor-policy"),Su=e=>n("/api/system/two-factor-policy",{method:"PUT",body:JSON.stringify(e)}),vu=()=>n("/api/system/auth-files"),ju=e=>n("/api/auth/profile",{method:"PUT",body:JSON.stringify(e)}),Tu=()=>n("/api/auth/sessions"),Nu=e=>n(`/api/auth/sessions/${e}`,{method:"DELETE"}),ku=()=>n("/api/auth/sessions/revoke-others",{method:"POST"}),Cu=(e=20,t=0)=>n(`/api/auth/activity?limit=${e}&offset=${t}`),Ou=()=>n("/api/auth/users"),Pu=e=>n("/api/auth/users",{method:"POST",body:JSON.stringify(e)}),Eu=(e,t)=>n(`/api/auth/users/${e}`,{method:"PUT",body:JSON.stringify(t)}),Ru=e=>n(`/api/auth/users/${e}`,{method:"DELETE"}),$u=(e,t)=>n(`/api/auth/users/${e}/reset-password`,{method:"POST",body:JSON.stringify({newPassword:t})}),Au=e=>n(`/api/auth/users/${e}/reset-2fa`,{method:"POST",body:"{}"}),Iu=e=>n(`/api/auth/users/${e}/revoke-sessions`,{method:"POST"}),Lu=e=>{const t=new URLSearchParams;if(e)for(const[r,l]of Object.entries(e))l!==void 0&&t.set(r,String(l));const o=t.toString();return n(`/api/audit${o?`?${o}`:""}`)},Du=()=>n("/api/audit/stats"),Mu=()=>n("/api/audit/export"),_u=()=>n("/api/skills"),Uu=e=>n(`/api/skills/${e}/preview`),Ju=e=>n(`/api/skills/${e}/enable`,{method:"PUT"}),Bu=e=>n(`/api/skills/${e}/disable`,{method:"PUT"}),Fu=e=>n("/api/skills/bulk",{method:"PUT",body:JSON.stringify(e)}),Gu=()=>n("/api/skills/reset",{method:"POST"}),zu=(e,t)=>n("/api/skills/create",{method:"POST",body:JSON.stringify({content:e,slug:t})}),qu=(e,t)=>n(`/api/skills/${e}/update`,{method:"PUT",body:JSON.stringify({content:t})}),Wu=e=>n(`/api/skills/${e}`,{method:"DELETE"}),Hu=(e,t)=>n("/api/skills/import",{method:"POST",body:JSON.stringify({content:e,filename:t})}),Ku=e=>n("/api/skills/import-url",{method:"POST",body:JSON.stringify({url:e})}),Vu=e=>n("/api/skills/discover",{method:"POST",body:JSON.stringify({catalogUrl:e})}),Yu=()=>n("/api/tools/categories"),Qu=e=>n("/api/skills/chat",{method:"POST",body:JSON.stringify(e)}),Xu=e=>`${te}/api/skills/${e}/export`,Zu=()=>n("/api/skills/chat/sessions"),em=e=>n(`/api/skills/chat/sessions/${encodeURIComponent(e)}`),tm=(e,t,o)=>n("/api/skills/chat/sessions",{method:"POST",body:JSON.stringify({id:e,title:t,...o})}),sm=(e,t,o)=>n(`/api/skills/chat/sessions/${encodeURIComponent(e)}/messages`,{method:"POST",body:JSON.stringify({role:t,content:o})}),nm=(e,t)=>n(`/api/skills/chat/sessions/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({title:t})}),om=e=>n(`/api/skills/chat/sessions/${encodeURIComponent(e)}`,{method:"DELETE"}),am=()=>n("/api/skills/chat/sessions",{method:"DELETE"}),rm=(e,t)=>n(`/api/skills/chat/sessions/${encodeURIComponent(e)}/selections`,{method:"PUT",body:JSON.stringify(t)}),im=()=>n("/api/mcp/servers"),cm=e=>n("/api/mcp/servers",{method:"POST",body:JSON.stringify(e)}),lm=(e,t)=>n(`/api/mcp/servers/${e}`,{method:"PUT",body:JSON.stringify(t)}),dm=e=>n(`/api/mcp/servers/${e}`,{method:"DELETE"}),um=e=>n(`/api/mcp/servers/${e}/connect`,{method:"POST"}),mm=e=>n(`/api/mcp/servers/${e}/disconnect`,{method:"POST"}),pm=e=>n(`/api/mcp/servers/${e}/test`,{method:"POST"}),hm=e=>n(`/api/mcp/servers/${e}/enable`,{method:"PUT"}),gm=e=>n(`/api/mcp/servers/${e}/disable`,{method:"PUT"}),fm=e=>n(`/api/mcp/servers/${e}/tools`),xm=()=>n("/api/mcp/tools"),bm=()=>n("/api/mcp/presets"),ym=e=>n(`/api/mcp/presets/${e}/add`,{method:"POST"}),wm=()=>n("/api/workflows"),Sm=e=>n(`/api/workflows/${encodeURIComponent(e)}`),vm=(e,t)=>n("/api/workflows",{method:"POST",body:JSON.stringify({yaml:e,id:t})}),jm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),Tm=e=>n(`/api/workflows/${encodeURIComponent(e)}`,{method:"DELETE"}),Nm=e=>n("/api/workflows/validate",{method:"POST",body:JSON.stringify({yaml:e})}),km=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/run`,{method:"POST",body:JSON.stringify({variables:t})}),Cm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/pause`,{method:"POST",body:JSON.stringify({runId:t})}),Om=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/resume`,{method:"POST",body:JSON.stringify({runId:t})}),Pm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/abort`,{method:"POST",body:JSON.stringify({runId:t})}),Em=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/runs${t?`?limit=${t}`:""}`),Rm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}`),$m=()=>n("/api/workflows/active/runs"),Am=()=>n("/api/workflows/templates/list"),Im=(e,t,o)=>n("/api/workflows/from-template",{method:"POST",body:JSON.stringify({templateId:e,parameters:t,id:o})}),Lm=e=>n("/api/workflows/generate",{method:"POST",body:JSON.stringify({description:e})}),Dm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/duplicate`,{method:"POST",body:JSON.stringify({id:t})}),Mm=e=>n("/api/workflows/import",{method:"POST",body:JSON.stringify(e)}),_m=(e,t,o)=>n(`/api/workflows/${encodeURIComponent(e)}/schedule`,{method:"POST",body:JSON.stringify({cron:t,enabled:o})}),Um=e=>n(`/api/workflows/${encodeURIComponent(e)}/schedule`,{method:"DELETE"}),Jm=e=>n(`/api/workflows/${encodeURIComponent(e)}/webhooks`),Bm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/webhooks`,{method:"POST",body:JSON.stringify(t)}),Fm=(e,t,o)=>n(`/api/workflows/${encodeURIComponent(e)}/webhooks/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(o)}),Gm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/webhooks/${encodeURIComponent(t)}`,{method:"DELETE"}),zm=e=>n(`/api/workflows/${encodeURIComponent(e)}/events`),qm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/events`,{method:"PUT",body:JSON.stringify({subscriptions:t})}),Wm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/dry-run`,{method:"POST",body:JSON.stringify({variables:t})}),Hm=e=>n(`/api/workflows/${encodeURIComponent(e)}/versions`),Km=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/versions/${t}/restore`,{method:"POST"}),Vm=e=>n(`/api/workflows/${encodeURIComponent(e)}/notifications`),Ym=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/notifications`,{method:"PUT",body:JSON.stringify({notifications:t})}),Qm=e=>n("/api/tm/folders",{method:"POST",body:JSON.stringify(e)}),Xm=()=>n("/api/tm/folders"),Zm=()=>n("/api/tm/folders/tree"),ep=e=>n(`/api/tm/folders/${e}`),tp=(e,t)=>n(`/api/tm/folders/${e}`,{method:"PUT",body:JSON.stringify(t)}),sp=e=>n(`/api/tm/folders/${e}`,{method:"DELETE"}),np=(e,t)=>n(`/api/tm/folders/${e}/move`,{method:"PUT",body:JSON.stringify({parentId:t})}),op=e=>n("/api/tm/test-cases",{method:"POST",body:JSON.stringify(e)}),ap=e=>{var i;const t=new URLSearchParams;(e==null?void 0:e.folderId)===null?t.set("folderId","__uncategorized__"):e!=null&&e.folderId&&t.set("folderId",e.folderId),e!=null&&e.priority&&t.set("priority",e.priority),e!=null&&e.type&&t.set("type",e.type),e!=null&&e.status&&t.set("status",e.status),e!=null&&e.automationStatus&&t.set("automationStatus",e.automationStatus),e!=null&&e.reviewStatus&&t.set("reviewStatus",e.reviewStatus),(i=e==null?void 0:e.tagIds)!=null&&i.length&&t.set("tagIds",e.tagIds.join(",")),e!=null&&e.sourceId&&t.set("sourceId",e.sourceId),e!=null&&e.search&&t.set("search",e.search);const o=e==null?void 0:e.limit;o&&t.set("limit",String(o));let r=e==null?void 0:e.offset;r===void 0&&(e!=null&&e.page)&&e.page>1&&o&&(r=(e.page-1)*o),r!==void 0&&t.set("offset",String(r)),e!=null&&e.sort&&t.set("sort",e.sort),e!=null&&e.order&&t.set("order",e.order);const l=t.toString();return n(`/api/tm/test-cases${l?`?${l}`:""}`)},rp=e=>n(`/api/tm/test-cases/${e}`),ip=(e,t)=>n(`/api/tm/test-cases/${e}`,{method:"PUT",body:JSON.stringify(t)}),cp=e=>n(`/api/tm/test-cases/${e}`,{method:"DELETE"}),lp=e=>n("/api/tm/test-cases/bulk-delete",{method:"POST",body:JSON.stringify({ids:e})}),dp=(e,t)=>n("/api/tm/test-cases/bulk-review",{method:"POST",body:JSON.stringify({ids:e,reviewStatus:t})}),up=e=>n("/api/tm/ai/fix-cases",{method:"POST",body:JSON.stringify({cases:e})}),mp=e=>n("/api/tm/test-cases/push-jira",{method:"POST",body:JSON.stringify(e)}),pp=(e,t)=>n("/api/tm/test-cases/bulk-move",{method:"POST",body:JSON.stringify({ids:e,folderId:t})}),hp=(e,t)=>n("/api/tm/test-cases/bulk-tag",{method:"POST",body:JSON.stringify({ids:e,tagIds:t})}),gp=e=>n(`/api/tm/test-cases/${e}/steps`),fp=(e,t)=>n(`/api/tm/test-cases/${e}/steps`,{method:"PUT",body:JSON.stringify({steps:t})}),xp=e=>n("/api/tm/tags",{method:"POST",body:JSON.stringify(e)}),bp=()=>n("/api/tm/tags"),yp=(e,t)=>n(`/api/tm/tags/${e}`,{method:"PUT",body:JSON.stringify(t)}),wp=e=>n(`/api/tm/tags/${e}`,{method:"DELETE"}),Sp=(e,t)=>n(`/api/tm/test-cases/${e}/tags`,{method:"PUT",body:JSON.stringify({tagIds:t})}),vp=e=>n("/api/tm/custom-fields",{method:"POST",body:JSON.stringify(e)}),jp=()=>n("/api/tm/custom-fields"),Tp=(e,t)=>n(`/api/tm/custom-fields/${e}`,{method:"PUT",body:JSON.stringify(t)}),Np=e=>n(`/api/tm/custom-fields/${e}`,{method:"DELETE"}),kp=(e,t)=>n(`/api/tm/test-cases/${e}/custom-fields`,{method:"PUT",body:JSON.stringify({values:t})}),Cp=e=>n(`/api/tm/test-cases/${e}/versions`),Op=(e,t)=>n(`/api/tm/test-cases/${e}/versions/${t}`),Pp=(e,t,o)=>n(`/api/tm/test-cases/${e}/rollback`,{method:"POST",body:JSON.stringify({version:t,changedBy:o})}),Ep=(e,t)=>n(`/api/tm/test-cases/${e}/mapping`,{method:"PUT",body:JSON.stringify(t)}),Rp=e=>n(`/api/tm/test-cases/${e}/mapping`),$p=e=>n(`/api/tm/test-cases/${e}/mapping`,{method:"DELETE"}),Ap=()=>n("/api/tm/mappings"),Ip=()=>n("/api/tm/stats"),Lp=e=>n("/api/tm/plans",{method:"POST",body:JSON.stringify(e)}),Dp=e=>{const t=e?`?status=${e}`:"";return n(`/api/tm/plans${t}`)},Mp=e=>n(`/api/tm/plans/${e}`),_p=(e,t)=>n(`/api/tm/plans/${e}`,{method:"PUT",body:JSON.stringify(t)}),Up=e=>n(`/api/tm/plans/${e}`,{method:"DELETE"}),Jp=(e,t,o)=>n(`/api/tm/plans/${e}/test-cases`,{method:"POST",body:JSON.stringify({testCaseIds:t,addedBy:o})}),Bp=(e,t)=>n(`/api/tm/plans/${e}/test-cases`,{method:"DELETE",body:JSON.stringify({testCaseIds:t})}),Fp=e=>n(`/api/tm/plans/${e}/test-cases`),Gp=(e,t)=>n(`/api/tm/plans/${e}/cycles`,{method:"POST",body:JSON.stringify(t)}),zp=e=>n(`/api/tm/plans/${e}/cycles`),qp=e=>n(`/api/tm/cycles/${e}`),Wp=(e,t)=>n(`/api/tm/cycles/${e}`,{method:"PUT",body:JSON.stringify(t)}),Hp=e=>n(`/api/tm/cycles/${e}`,{method:"DELETE"}),Kp=(e,t)=>n(`/api/tm/cycles/${e}/rerun-failed`,{method:"POST",body:JSON.stringify(t)}),Vp=(e,t)=>{const o=t?`?status=${t}`:"";return n(`/api/tm/cycles/${e}/executions${o}`)},Yp=e=>n(`/api/tm/executions/${e}`),Qp=(e,t)=>n(`/api/tm/executions/${e}`,{method:"PUT",body:JSON.stringify(t)}),Xp=e=>n(`/api/tm/executions/${e}/steps`),Zp=(e,t)=>n(`/api/tm/step-results/${e}`,{method:"PUT",body:JSON.stringify(t)}),eh=(e,t,o)=>n(`/api/tm/executions/${e}/steps/bulk`,{method:"PUT",body:JSON.stringify({status:t,executedBy:o})}),th=e=>n(`/api/tm/cycles/${e}/analytics`),sh=(e,t)=>n("/api/tm/cycles/compare",{method:"POST",body:JSON.stringify({cycleId1:e,cycleId2:t})}),nh=e=>n(`/api/tm/test-cases/${e}/execution-history`),oh=()=>n("/api/tm/execution-dots"),ah=()=>n("/api/tm/mappings/dashboard"),rh=()=>n("/api/tm/mappings/unmapped"),ih=()=>n("/api/tm/mappings/mapped"),ch=e=>n(`/api/tm/mappings/by-status/${e}`),lh=e=>n("/api/tm/mappings/bulk",{method:"POST",body:JSON.stringify({mappings:e})}),dh=e=>n("/api/tm/mappings/bulk",{method:"DELETE",body:JSON.stringify({testCaseIds:e})}),uh=(e,t,o)=>n("/api/tm/mappings/sync-status",{method:"PUT",body:JSON.stringify({testCaseId:e,syncStatus:t,scriptHash:o})}),mh=(e,t)=>n("/api/tm/mappings/bulk-sync-status",{method:"PUT",body:JSON.stringify({testCaseIds:e,syncStatus:t})}),ph=()=>n("/api/tm/mappings/check-sync",{method:"POST"}),hh=(e,t)=>n("/api/tm/mappings/execute",{method:"POST",body:JSON.stringify({testCaseId:e,...t})}),gh=e=>n(`/api/tm/mappings/search?q=${encodeURIComponent(e)}`),fh=e=>n(`/api/tm/sources/${encodeURIComponent(e)}/coverage-matrix`);async function*xh(e,t,o,r="POST"){const l=G(),i={"Content-Type":"application/json",Accept:"text/event-stream"};l&&(i.Authorization=`Bearer ${l}`);const c=be();c&&(i["X-Client-Id"]=c),i["X-Testver-Last-Activity"]=String(us()),r==="GET"&&delete i["Content-Type"];const a=await fetch(`${te}${e}`,{method:r,headers:i,body:r==="GET"?void 0:JSON.stringify(t),signal:o});if(gs(a),!a.ok||!a.body){const m=await a.text().catch(()=>"");let g={};try{g=JSON.parse(m)}catch{}if(a.status===401&&a.headers.get("x-testver-auth"))throw Ee(a.headers.get("x-testver-auth")),new Error(g.error||"Session expired");const b=new Error(g.error||m||a.statusText);throw b.status=a.status,g.code&&(b.code=g.code),b}const d=a.body.getReader(),u=new TextDecoder;let h="";try{for(;;){const{value:m,done:g}=await d.read();if(g)break;h+=u.decode(m,{stream:!0});let b;for(;(b=h.indexOf(`
3
+
4
+ `))>=0||(b=h.indexOf(`\r
5
+ \r
6
+ `))>=0;){const N=(h.indexOf(`
7
+
8
+ `)>=0,b),j=h.slice(0,N);h=h.slice(N+(h.slice(N).startsWith(`\r
9
+ \r
10
+ `)?4:2));const w=j.split(/\r?\n/);let R=null,O="";for(const C of w)C.startsWith("event:")?R=C.slice(6).trim():C.startsWith("data:")&&(O+=(O?`
11
+ `:"")+C.slice(5).trim());if(R&&O)try{const C=JSON.parse(O);yield{event:R,data:C}}catch{}}}}finally{try{d.releaseLock()}catch{}}}const bh=()=>n("/api/tm/ai/jobs/latest"),yh=e=>n(`/api/tm/ai/jobs/${encodeURIComponent(e)}/cancel`,{method:"POST",body:"{}"}),wh=e=>n(`/api/tm/ai/jobs/${encodeURIComponent(e)}/dismiss`,{method:"POST",body:"{}"}),Sh=e=>n("/api/tm/ai/estimate",{method:"POST",body:JSON.stringify(e)}),vh=(e,t={})=>n("/api/tm/ai/similar",{method:"POST",body:JSON.stringify({cases:e,...t})}),jh=e=>n("/api/tm/ai/save-generated",{method:"POST",body:JSON.stringify(e)}),Th=()=>n("/api/tm/ai/app-model"),Nh=e=>n("/api/tm/ai/grounding",{method:"POST",body:JSON.stringify(e)}),kh=e=>n("/api/tm/intelligence/predictive-selection",{method:"POST",body:JSON.stringify(e)}),Ch=e=>n("/api/tm/intelligence/suggest-plan",{method:"POST",body:JSON.stringify(e)}),Oh=e=>n("/api/tm/intelligence/nl-search",{method:"POST",body:JSON.stringify({query:e})}),Ph=e=>n("/api/tm/intelligence/auto-maintenance",{method:"POST",body:JSON.stringify({changes:e})}),Eh=e=>n("/api/tm/intelligence/risk-assessment",{method:"POST",body:JSON.stringify(e)}),Rh=e=>n("/api/tm/requirements",{method:"POST",body:JSON.stringify(e)}),$h=e=>{const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.priority&&t.set("priority",e.priority),e!=null&&e.search&&t.set("search",e.search);const o=t.toString()?`?${t}`:"";return n(`/api/tm/requirements${o}`)},Ah=e=>n(`/api/tm/requirements/${e}`),Ih=(e,t)=>n(`/api/tm/requirements/${e}`,{method:"PUT",body:JSON.stringify(t)}),Lh=e=>n(`/api/tm/requirements/${e}`,{method:"DELETE"}),Dh=(e,t)=>n(`/api/tm/requirements/${e}/test-cases`,{method:"POST",body:JSON.stringify({testCaseIds:t})}),Mh=(e,t)=>n(`/api/tm/requirements/${e}/test-cases`,{method:"DELETE",body:JSON.stringify({testCaseIds:t})}),_h=e=>n(`/api/tm/requirements/${e}/test-cases`),Uh=e=>n(`/api/tm/test-cases/${e}/requirements`),Jh=()=>n("/api/tm/traceability-matrix"),Bh=()=>n("/api/tm/coverage-stats"),Fh=()=>n("/api/tm/execution-analytics"),Gh=()=>n("/api/tm/health-score"),zh=()=>n("/api/tm/orphans"),qh=()=>n("/api/tm/source-traceability"),Wh=e=>n("/api/tm/reports/generate",{method:"POST",body:JSON.stringify(e)}),Hh=e=>n("/api/tm/defects",{method:"POST",body:JSON.stringify(e)}),Kh=e=>{const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.severity&&t.set("severity",e.severity),e!=null&&e.testCaseId&&t.set("testCaseId",e.testCaseId),e!=null&&e.search&&t.set("search",e.search);const o=t.toString()?`?${t}`:"";return n(`/api/tm/defects${o}`)},Vh=e=>n(`/api/tm/defects/${e}`),Yh=(e,t)=>n(`/api/tm/defects/${e}`,{method:"PUT",body:JSON.stringify(t)}),Qh=e=>n(`/api/tm/defects/${e}`,{method:"DELETE"}),Xh=()=>n("/api/tm/defects/stats"),Zh=(e,t)=>n("/api/tm/defects/from-execution",{method:"POST",body:JSON.stringify({executionId:e,createdBy:t})}),eg=e=>n("/api/tm/defects/by-executions",{method:"POST",body:JSON.stringify({executionIds:e})}),tg=(e,t,o)=>n(`/api/tm/defects/${e}/transition`,{method:"PUT",body:JSON.stringify({status:t,performedBy:o})}),sg=e=>n(`/api/tm/defects/${e}/activity`),ng=e=>n(`/api/tm/defects/${e}/comments`),og=(e,t,o)=>n(`/api/tm/defects/${e}/comments`,{method:"POST",body:JSON.stringify({content:t,author:o})}),ag=(e,t,o)=>n(`/api/tm/defects/${e}/comments/${t}${o?`?deletedBy=${encodeURIComponent(o)}`:""}`,{method:"DELETE"}),rg=e=>n("/api/tm/quality-gates",{method:"POST",body:JSON.stringify(e)}),ig=()=>n("/api/tm/quality-gates"),cg=e=>n(`/api/tm/quality-gates/${e}`),lg=(e,t)=>n(`/api/tm/quality-gates/${e}`,{method:"PUT",body:JSON.stringify(t)}),dg=e=>n(`/api/tm/quality-gates/${e}`,{method:"DELETE"}),ug=(e,t)=>n(`/api/tm/quality-gates/${e}/evaluate`,{method:"POST",body:JSON.stringify({cycleId:t})}),mg=e=>n("/api/tm/webhooks",{method:"POST",body:JSON.stringify(e)}),pg=()=>n("/api/tm/webhooks"),hg=(e,t)=>n(`/api/tm/webhooks/${e}`,{method:"PUT",body:JSON.stringify(t)}),gg=e=>n(`/api/tm/webhooks/${e}`,{method:"DELETE"}),fg=e=>{const t=e?`?folderId=${e}`:"";return n(`/api/tm/export${t}`)},xg=e=>n("/api/tm/import",{method:"POST",body:JSON.stringify(e)}),bg=(e,t)=>n(`/api/tm/test-cases/${e}/attachments`,{method:"POST",body:JSON.stringify(t)}),yg=e=>n(`/api/tm/test-cases/${e}/attachments`),wg=e=>n(`/api/tm/attachments/${e}`),Sg=e=>n(`/api/tm/attachments/${e}`,{method:"DELETE"}),vg=(e,t)=>n(`/api/tm/executions/${e}/attachments`,{method:"POST",body:JSON.stringify(t)}),jg=e=>n(`/api/tm/executions/${e}/attachments`),Tg=e=>n(`/api/tm/execution-attachments/${e}`),Ng=e=>n(`/api/tm/execution-attachments/${e}`,{method:"DELETE"}),kg=(e,t)=>n(`/api/tm/test-cases/${e}/links`,{method:"POST",body:JSON.stringify(t)}),Cg=e=>n(`/api/tm/test-cases/${e}/links`),Og=(e,t)=>n(`/api/tm/links/${e}`,{method:"PUT",body:JSON.stringify(t)}),Pg=e=>n(`/api/tm/links/${e}`,{method:"DELETE"}),Eg=e=>n("/api/tm/sources",{method:"POST",body:JSON.stringify(e)}),Rg=e=>{const t=new URLSearchParams;e!=null&&e.type&&t.set("type",e.type),e!=null&&e.status&&t.set("status",e.status),e!=null&&e.search&&t.set("search",e.search);const o=t.toString()?`?${t.toString()}`:"";return n(`/api/tm/sources${o}`)},$g=e=>n(`/api/tm/sources/${e}`),Ag=()=>n("/api/tm/sources-with-test-cases"),Ig=(e,t)=>n(`/api/tm/sources/${e}`,{method:"PUT",body:JSON.stringify(t)}),Lg=e=>n(`/api/tm/sources/${encodeURIComponent(e)}/refresh`,{method:"POST"}),Dg=e=>n("/api/tm/test-cases/clear-stale",{method:"POST",body:JSON.stringify({ids:e})}),Mg=e=>n(`/api/tm/sources/${e}`,{method:"DELETE"}),_g=(e,t,o,r)=>n(`/api/tm/sources/${e}/test-cases`,{method:"POST",body:JSON.stringify({testCaseIds:t,generationMethod:o,linkedBy:r})}),Ug=(e,t)=>n(`/api/tm/sources/${e}/test-cases`,{method:"DELETE",body:JSON.stringify({testCaseIds:t})}),Jg=e=>n(`/api/tm/sources/${e}/test-cases`),Bg=e=>n(`/api/tm/test-cases/${e}/sources`),Fg=()=>n("/api/tm/source-coverage"),Gg=e=>n(`/api/tm/executions/${e}/run-automation`,{method:"POST"}),zg=e=>n(`/api/tm/cycles/${e}/run-all-automation`,{method:"POST"}),qg=e=>n(`/api/tm/automation-runs/${e}`),Wg=e=>n(`/api/tm/cycles/${e}/automation-status`),Hg=e=>n(`/api/tm/cycles/${e}/cancel-automation`,{method:"POST"}),Kg=e=>n(`/api/tm/executions/${e}/cancel-automation`,{method:"POST"}),Vg=()=>n("/api/tm/cycle-run-settings"),Yg=e=>n("/api/tm/cycle-run-settings",{method:"PUT",body:JSON.stringify(e)}),Qg=()=>n("/api/connectors"),Xg=e=>n(`/api/connectors/${e}`),Zg=e=>n("/api/connectors",{method:"POST",body:JSON.stringify(e)}),ef=(e,t)=>n(`/api/connectors/${e}`,{method:"PUT",body:JSON.stringify(t)}),tf=e=>n(`/api/connectors/${e}`,{method:"DELETE"}),sf=e=>n(`/api/connectors/${e}/test`,{method:"POST"}),nf=(e,t)=>n(`/api/connectors/${e}/send-test`,{method:"POST",body:JSON.stringify(t||{})}),of=e=>n(`/api/connectors/${e}/jira/projects`),af=(e,t,o)=>n(`/api/connectors/${e}/jira/search`,{method:"POST",body:JSON.stringify({jql:t,maxResults:o})}),rf=(e,t)=>n(`/api/connectors/${e}/jira/create-issue`,{method:"POST",body:JSON.stringify(t)}),cf=(e,t)=>n(`/api/connectors/${e}/jira/issue/${t}`),lf=(e,t)=>n(`/api/connectors/${e}/jira/comment`,{method:"POST",body:JSON.stringify(t)}),df=e=>n(`/api/connectors/${e}/jira/issue-types`),uf=e=>n("/api/tm/quick-plan-from-source",{method:"POST",body:JSON.stringify(e)}),mf=()=>n("/api/tm/automation-usage"),pf=()=>n("/api/output/folders"),hf=e=>n("/api/output/folders",{method:"POST",body:JSON.stringify(e)}),gf=(e,t)=>n(`/api/output/folders/${e}`,{method:"PUT",body:JSON.stringify(t)}),ff=e=>n(`/api/output/folders/${e}`,{method:"DELETE"}),xf=e=>n("/api/output/folders/reorder",{method:"PUT",body:JSON.stringify({ids:e})}),bf=()=>n("/api/output/detect"),yf=(e,t)=>{const o=new URLSearchParams;t!=null&&t.sortBy&&o.set("sortBy",t.sortBy),t!=null&&t.sortDir&&o.set("sortDir",t.sortDir),t!=null&&t.filterExt&&o.set("filterExt",t.filterExt),t!=null&&t.depth&&o.set("depth",String(t.depth));const r=o.toString();return n(`/api/output/folders/${e}/files${r?`?${r}`:""}`)},wf=(e,t)=>{const o=new URLSearchParams({q:e});return t&&o.set("folderIds",t),n(`/api/output/search?${o.toString()}`)},Sf=(e,t,o=!1)=>{const r=G(),l=new URLSearchParams({folderId:e,path:t});return o&&l.set("download","true"),r&&l.set("token",r),`${te}/api/output/file?${l.toString()}`},vf=async(e,t)=>{const o=G(),r=await fetch(`${te}/api/output/zip`,{method:"POST",headers:{"Content-Type":"application/json",...o?{Authorization:`Bearer ${o}`}:{}},body:JSON.stringify({folderId:e,paths:t})});if(!r.ok)throw new Error("ZIP download failed");const l=await r.blob(),i=URL.createObjectURL(l),c=document.createElement("a");c.href=i,c.download=`output-${Date.now()}.zip`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(i)},jf=e=>n("/api/documents/generate",{method:"POST",body:JSON.stringify(e)}),Tf=()=>n("/api/documents/types"),Nf=()=>n("/api/suites"),kf=e=>n(`/api/suites/${e}`),Cf=e=>n("/api/suites",{method:"POST",body:JSON.stringify(e)}),Of=(e,t)=>n(`/api/suites/${e}`,{method:"PUT",body:JSON.stringify(t)}),Pf=(e,t)=>n(`/api/suites/${e}/notifications/test`,{method:"POST",body:JSON.stringify(t)}),Ef=(e,t)=>n(`/api/suites/${e}/tests`,{method:"POST",body:JSON.stringify({tests:t})}),Rf=(e,t,o)=>n(`/api/suites/${e}/tests`,{method:"DELETE",body:JSON.stringify({file:t,name:o})}),$f=e=>n(`/api/suites/${e}`,{method:"DELETE"}),Af=(e,t={})=>n(`/api/suites/${e}/run`,{method:"POST",body:JSON.stringify(t)}),If=e=>n(`/api/suites/${e}/run-status`),Lf=e=>n(`/api/tm/cycle-runs/${e}/status`),Df=e=>n(`/api/suites/${e}/cancel`,{method:"POST"}),Mf=e=>n(`/api/suites/${e}/runs`),_f=(e,t,o)=>n(`/api/suites/${e}/compare?a=${encodeURIComponent(t)}&b=${encodeURIComponent(o)}`),Y0=Object.freeze(Object.defineProperty({__proto__:null,abortWorkflow:Pm,addChatMessage:gl,addCustomStep:Rl,addMCPPreset:ym,addMobileCustomStep:zi,addRunnerCommand:Ur,addSkillsChatMessage:sm,addSuiteTests:Ef,aiApplyReviewFixes:bc,aiBrowserChat:Sc,aiChat:ii,aiChatReset:hc,aiChatStream:pc,aiCodeReview:xc,aiConsolidate:Hr,aiConsolidateSteps:ei,aiDocumentMethod:zr,aiExplain:ri,aiExplainMethod:Gr,aiExplainStep:Xr,aiGenerate:ai,aiNewTest:fc,aiSuggestStepDef:Zr,aiSuggestTest:Wr,aiUnusedVerdict:qr,analyzeCloudReadiness:Pd,analyzeFailures:Da,askPassAnswer:on,askPassCacheCount:cu,askPassCancel:an,askPassForget:lu,assessFailures:_a,authChangePassword:pu,authGetMe:hu,authLogin:hn,authLoginTwoFactor:gn,authLoginTwoFactorEnable:xn,authLoginTwoFactorSetup:fn,authLogout:vn,authSetup:Sn,authStatus:ht,awaitClientId:re,browserKeepAlive:kc,bulkUpdateSkills:Fu,cancelCiRun:Gc,cancelOwnershipScan:ga,cancelRun:js,cancelSuiteRun:Df,checkPasswordReset:yn,checkRemoteNow:Zs,checkRunTargets:pr,clearApiHistory:Yd,clearBaseline:Ya,clearChatSessions:yl,clearCiPipelinePreviousNames:Jc,clearSkillsChatSessions:am,clearStoredToken:Pe,closeBrowserSession:Nc,codeMapExportCsvUrl:ks,compareEnvs:Ta,compareRecordings:Hl,compareSuiteRuns:_f,connectMCPServer:um,createApiCollection:Ld,createApiFolder:Jd,createChatSession:Kc,createCiToken:Uc,createConnector:Zg,createFile:aa,createFromTemplate:Im,createMCPServer:cm,createOutputFolder:hf,createReportSchedule:cl,createReportShareToken:sl,createSkill:zu,createSkillsChatSession:tm,createSuite:Cf,createUser:Pu,createWorkflow:vm,createWorkflowWebhook:Bm,deleteApiCollection:Md,deleteApiEnvironment:Wd,deleteApiFolder:Fd,deleteApiRequest:Ud,deleteChatSession:bl,deleteCiPipeline:Mc,deleteCloudProvider:yd,deleteCloudSchedule:Od,deleteConnector:tf,deleteFile:ia,deleteMCPServer:dm,deleteMobileAction:Ai,deleteMobileApp:bi,deleteMobileRecording:uc,deleteOutputFolder:ff,deleteRecorderAction:Pl,deleteRecordingHistory:Wl,deleteReportSchedule:dl,deleteRunnerCommand:Br,deleteSavedReport:el,deleteSkill:Wu,deleteSkillsChatSession:om,deleteSuite:$f,deleteUploadedFile:wc,deleteUser:Ru,deleteWorkflow:Tm,deleteWorkflowWebhook:Gm,detectOutputFolders:bf,disableMCPServer:gm,disableSkill:Bu,disableTwoFactor:xu,disconnectMCPServer:mm,disconnectTestver:tr,disconnectTestverHub:or,discoverSkills:Vu,dismissAskMiss:ui,documentHref:qo,downloadAllApiCollections:su,downloadApiCollectionExport:tu,downloadCodeMapCsv:Vr,downloadCodeMapStepsCsv:Qr,downloadFromApi:Se,downloadOutputZip:vf,downloadReportExport:nl,dryRunWorkflow:Wm,duplicateWorkflow:Dm,enableMCPServer:hm,enableSkill:Ju,enableTwoFactor:Tn,endMobileRecording:Ui,endMobileSession:vi,endSession:Ee,exportApiCollection:eu,exportAuditLog:Mu,extendSession:un,fetchCloudArtifacts:Ed,followUpFromRecording:Cl,followupMobileRecordingGeneration:sc,forgotPassword:bn,generateApiScenarios:au,generateApiTest:nu,generateCICD:Ac,generateDocument:jf,generateFromRecording:Nl,generateMobileRecording:tc,generateWorkflow:Lm,getActiveRuns:Ts,getActiveWorkflowRuns:$m,getActivity:Na,getAllMCPTools:xm,getAllOwnership:da,getApiCollection:Id,getApiCollections:Ad,getApiEnvironments:Gd,getApiHistory:Vd,getApiTrace:Vo,getAppMode:bs,getAskFeedback:li,getAuditLog:Lu,getAuditStats:Du,getAuthFilesStatus:vu,getAutoHealConfig:Zo,getBaseline:Va,getBrowserScreenshot:jc,getBrowserStatus:vc,getBrowserViewport:Tc,getChatSession:Hc,getChatSessions:Wc,getCiAnalytics:zc,getCiPipelines:Lc,getCiRuns:Fc,getCiTokens:_c,getClientId:be,getCloudBuilds:vd,getCloudEnvVars:jd,getCloudHubUrl:Td,getCloudProvider:xd,getCloudProviders:fd,getCloudSchedules:Nd,getCodeMap:gr,getCodeMapCoverage:hr,getCodeMapGraph:Fr,getCodeMapImpact:br,getCodeMapQuality:yr,getCodeMapSteps:Yr,getCodeMapSymbol:xr,getConfigFiles:va,getConflictedFile:du,getConnector:Xg,getCoverageHistory:Ga,getCycleRunStatus:Lf,getDataMap:wr,getDataMapCandidates:Or,getDataMapOverrides:Tr,getDataMapPreview:jr,getDataMapSource:vr,getDocumentTypes:Tf,getDurationAnomalies:za,getEnvConfig:Er,getEnvConfigCandidates:$r,getEnvConfigFiles:Pr,getEnvFiles:ja,getExploreRunFile:mi,getFailureAnalysis:Ma,getFailureCategoryTrends:qa,getFeatureFlags:Ko,getFileTree:Ho,getFlakyTests:Aa,getGitBlame:Ps,getGitBranches:cn,getGitChurn:$s,getGitCorrelation:As,getGitDiff:Es,getGitIdentity:_s,getGitLastCommit:Us,getGitLog:pt,getGitOwnership:Is,getGitStatus:mt,getGitUncommittedDiff:Rs,getGridBrowserOptions:ed,getGridSessions:ad,getGridStatus:Zl,getGridUsage:td,getHealHistory:Qo,getHealStatus:Xo,getHealthScores:Ha,getKnowledgeInventory:ci,getLLMConfig:Xa,getLaterOutcomes:Ua,getLiveGridRuns:od,getLocalMobileConfig:dd,getLocalMobileStatus:ld,getMCPPresets:bm,getMCPServerTools:fm,getMCPServers:im,getMobileRecording:ki,getMobileRecordingHistory:rc,getMobileReuseTicket:xa,getMobileScreenshot:ji,getMobileSession:Si,getModuleFiles:na,getMyActivity:Cu,getMySessions:Tu,getNewFailures:Fa,getNextRuns:$d,getOutputFileUrl:Sf,getOutputFiles:yf,getOutputFolders:pf,getOwnershipConfig:ua,getOwnershipStatus:pa,getPreviousClientIds:Wo,getProject:fs,getProjectName:ws,getRecorderActions:Tl,getRecorderStatus:vl,getRecordingSession:Gl,getRemoteIncoming:en,getRemoteUpdates:Xs,getRemoteUpdatesConfig:ru,getReportSchedule:il,getResultFailures:Ra,getResultRun:Pa,getResultRunCounts:Ca,getResultRuns:ka,getResultTests:Ea,getResultTrends:$a,getRunCommandsConfig:cr,getRunComparison:Ba,getRunConsoleOutput:Qa,getRunHistory:Sa,getRunLive:nd,getRunStatus:ya,getRunnerCommands:_r,getSavedReport:Qc,getScenarioHistory:$c,getServerHealth:Wa,getSessionPolicy:uu,getSharedReport:al,getSkillExportUrl:Xu,getSkillPreview:Uu,getSkills:_u,getSkillsChatSession:em,getSkillsChatSessions:Zu,getSlowestTests:Ia,getSourceCoverageMatrix:fh,getSourceSummaries:mc,getStepReferences:Il,getStoredToken:G,getSuite:kf,getSuiteRunStatus:If,getSuiteRuns:Mf,getTestCaseHistory:Os,getTestDataColumns:Ll,getTestExplorer:Cc,getTestHistory:Ja,getTestLifecycle:Lr,getTestMethods:Kr,getTestOwnership:la,getTestSource:Oc,getTestSourceByName:Pc,getTestverHub:Ns,getTestverStatus:sr,getTierConfig:ti,getToolCategories:Yu,getTopFailures:La,getTwoFactor:gu,getTwoFactorPolicy:wu,getUsers:Ou,getWorkflow:Sm,getWorkflowEventSubscriptions:zm,getWorkflowNotifications:Vm,getWorkflowRun:Rm,getWorkflowRuns:Em,getWorkflowTemplates:Am,getWorkflowVersions:Hm,getWorkflowWebhooks:Jm,getWorkflows:wm,gitAbortOperation:Ws,gitCommit:Ms,gitContinueOperation:Ks,gitCreateBranch:ln,gitDeleteBranch:nn,gitDiscardFiles:Js,gitFetch:Vs,gitPull:Ys,gitPush:Qs,gitSkipOperationStep:Hs,gitStageFiles:Ls,gitStashBackOut:qs,gitStashDrop:zs,gitStashList:Bs,gitStashPop:Gs,gitStashSave:Fs,gitSwitchBranch:dn,gitUnstageFiles:Ds,globalSearch:vs,gridConnect:Ql,gridDisconnect:Xl,gridLiveUrl:id,healApply:ta,healUndo:sa,ignoreDataFile:kr,importApiCollection:Qd,importSkill:Hu,importSkillFromUrl:Ku,importWorkflow:Mm,includeDataFile:Nr,isAppiumFramework:fa,isFramePending:Ti,jiraAddComment:lf,jiraCreateIssue:rf,jiraGetIssue:cf,jiraGetIssueTypes:df,jiraGetProjects:of,jiraSearch:af,keepMobileSessionAlive:Bi,listConnectors:Qg,listMobileApps:fi,listMobileDevices:gi,listMobileFormatters:Di,listMobileProjectTests:oc,listMobileProviders:pi,listMobileRecordings:ac,listMobileSessionElements:Vi,listRecordingHistory:Fl,listReportSchedules:rl,listSavedReports:Vc,listSharedReports:Yc,listSuites:Nf,loadEnvConfig:Ar,loadMobileRecording:Gi,loadRecordingSession:jl,matchRemoteKeepingCommits:sn,mobileDraftId:lc,moveApiRequest:Zd,parseApiSpec:ou,patchMobileAction:Mi,pauseMobileRecording:Ji,pauseRecording:Ul,pauseWorkflow:Cm,playbackMobileRecording:ec,playbackRecording:Ol,pollTestverConnect:er,pressMobileKey:Ri,previewMobileRecording:Li,previewTierPrompt:oi,rateAskAnswer:di,readFile:oa,rebuildCodeMap:fr,rebuildDataMap:Sr,recordMobileAnnotation:Ki,recordMobileAnnotationForElement:Qi,recordMobileAssertion:Yi,recordMobilePressKey:Ei,recordMobileSwipe:Pi,recordMobileTap:Ci,recordMobileType:Oi,regenerateRecoveryCodes:fu,regenerateSavedReport:tl,rememberTrustedBrowser:pn,removeAllTrustedBrowsers:yu,removeDataMapOverride:Cr,removeSuiteTest:Rf,removeTrustedBrowser:bu,removeWorkflowSchedule:Um,renameChatSession:xl,renameMobileApp:yi,renameSkillsChatSession:nm,reorderApiRequests:Xd,reorderMobileActions:_i,reorderOutputFolders:xf,reorderRecorderActions:_l,replaceMobileWithCustomStep:qi,replaceRecorderAction:El,replaceWithCustomStep:$l,rescanProject:xs,resetMobileRecording:Ii,resetPassword:wn,resetRecording:Yl,resetSkills:Gu,resetTierConfig:ni,resetUserPassword:$u,resetUserTwoFactor:Au,resolveConflictedFile:rn,resolveStepDefinition:Ec,resolveStepDefinitions:Rc,restoreMobileReplacedSteps:Wi,restoreReplacedSteps:Al,restoreWorkflowVersion:Km,resumeMobileRecording:Fi,resumeRecording:Jl,resumeRecordingSession:Bl,resumeWorkflow:Om,revokeAllOtherSessions:ku,revokeCiToken:Bc,revokeMySession:Nu,revokeReportShareToken:ol,revokeUserSessions:Iu,runReportScheduleNow:ul,runScheduleNow:Rd,runSuite:Af,runWorkflow:km,saveApiEnvironment:zd,saveApiRequest:_d,saveCICDConfig:Ic,saveChatTimeline:fl,saveCiPipeline:Dc,saveCloudProvider:bd,saveCloudSchedule:kd,saveEnvConfig:Rr,saveGridProvider:cd,saveLLMConfig:ar,saveLocalMobileConfig:ud,saveMobileRecorderSettings:Hi,saveMobileRecording:ic,saveRecorderSettings:Dl,saveRecordingToHistory:zl,saveRemoteUpdatesConfig:iu,saveReport:Xc,saveRunCommandsConfig:lr,saveTierConfig:si,searchFiles:ca,searchOutputFiles:wf,sendApiChain:Kd,sendApiRequest:Hd,sendRunInput:wa,sendTestNotification:nf,setApiTrace:Yo,setAppMode:ys,setAutoHealConfig:ea,setBaseline:Ka,setChatStreamPermissionMode:pl,setClientId:ze,setDefaultCloudProvider:wd,setMobileAnnotateMode:Zi,setMobileAssertMode:Xi,setOwnershipConfig:ma,setProjectName:Ss,setSessionPolicy:mu,setStoredToken:je,setTestLifecycle:Dr,setTestLifecycleBulk:Mr,setTestverService:nr,setTwoFactorPolicy:Su,setWorkflowEventSubscriptions:qm,setWorkflowSchedule:_m,skillsChatStream:Qu,startLocalEmulator:md,startLocalSimulator:hd,startMobileRecording:Ni,startMobileSession:wi,startNewMobileRecordingId:dc,startOwnershipScan:ha,startRecording:wl,startReinspect:Ml,startRun:ba,startTestverConnect:Za,startTwoFactorSetup:jn,stashPullReapply:tn,stopChatGeneration:gc,stopGridSession:rd,stopLocalEmulator:pd,stopLocalSimulator:gd,stopMobileRecording:$i,stopMobileRecordingGeneration:nc,stopRecording:Sl,stopRecordingGeneration:kl,streamTMAIEvents:xh,suggestRunCommands:ur,suggestRunTargets:mr,switchActiveModel:ir,testCloudConnection:Sd,testConnector:sf,testGridConnection:sd,testLLMConnection:rr,testMCPConnection:pm,testMobileProviderCredentials:hi,testRunCommand:dr,testSuiteNotification:Pf,tmAIAppModel:Th,tmAIEstimate:Sh,tmAIFixCases:up,tmAIGrounding:Nh,tmAIJobCancel:yh,tmAIJobDismiss:wh,tmAIJobLatest:bh,tmAISaveGenerated:jh,tmAISimilar:vh,tmAddAttachment:bg,tmAddDefectComment:og,tmAddExecutionAttachment:vg,tmAddReferenceLink:kg,tmAddTestCasesToPlan:Jp,tmAutoMaintenance:Ph,tmBulkDeleteTestCases:lp,tmBulkMoveTestCases:pp,tmBulkRemoveMappings:dh,tmBulkReviewTestCases:dp,tmBulkSetMappings:lh,tmBulkTagTestCases:hp,tmBulkUpdateStepResults:eh,tmBulkUpdateSyncStatus:mh,tmCancelCycleAutomation:Hg,tmCancelExecutionAutomation:Kg,tmCheckSync:ph,tmClearStale:Dg,tmCompareCycles:sh,tmCreateCustomField:vp,tmCreateCycle:Gp,tmCreateDefect:Hh,tmCreateDefectFromExecution:Zh,tmCreateFolder:Qm,tmCreatePlan:Lp,tmCreateQualityGate:rg,tmCreateRequirement:Rh,tmCreateSource:Eg,tmCreateTag:xp,tmCreateTestCase:op,tmCreateWebhook:mg,tmDeleteAttachment:Sg,tmDeleteCustomField:Np,tmDeleteCycle:Hp,tmDeleteDefect:Qh,tmDeleteDefectComment:ag,tmDeleteExecutionAttachment:Ng,tmDeleteFolder:sp,tmDeletePlan:Up,tmDeleteQualityGate:dg,tmDeleteReferenceLink:Pg,tmDeleteRequirement:Lh,tmDeleteSource:Mg,tmDeleteTag:wp,tmDeleteTestCase:cp,tmDeleteWebhook:gg,tmEvaluateQualityGate:ug,tmExecuteMapping:hh,tmExportTestCases:fg,tmGenerateReport:Wh,tmGetAllMappings:Ap,tmGetAttachment:wg,tmGetAttachments:yg,tmGetAutomationRunStatus:qg,tmGetAutomationUsage:mf,tmGetCoverageStats:Bh,tmGetCustomFields:jp,tmGetCycle:qp,tmGetCycleAnalytics:th,tmGetCycleAutomationStatus:Wg,tmGetCycleExecutions:Vp,tmGetCycleRunSettings:Vg,tmGetCycles:zp,tmGetDefect:Vh,tmGetDefectActivity:sg,tmGetDefectComments:ng,tmGetDefectStats:Xh,tmGetDefects:Kh,tmGetDefectsByExecutions:eg,tmGetExecution:Yp,tmGetExecutionAnalytics:Fh,tmGetExecutionAttachment:Tg,tmGetExecutionAttachments:jg,tmGetExecutionDots:oh,tmGetExecutionHistory:nh,tmGetFolder:ep,tmGetFolderTree:Zm,tmGetFolders:Xm,tmGetHealthScore:Gh,tmGetMappedTestCases:ih,tmGetMapping:Rp,tmGetMappingDashboard:ah,tmGetMappingsByStatus:ch,tmGetOrphans:zh,tmGetPlan:Mp,tmGetPlanTestCases:Fp,tmGetPlans:Dp,tmGetQualityGate:cg,tmGetQualityGates:ig,tmGetReferenceLinks:Cg,tmGetRequirement:Ah,tmGetRequirementTestCases:_h,tmGetRequirements:$h,tmGetSource:$g,tmGetSourceCoverage:Fg,tmGetSourceTestCases:Jg,tmGetSourceTraceability:qh,tmGetSources:Rg,tmGetSourcesWithTestCases:Ag,tmGetStats:Ip,tmGetStepResults:Xp,tmGetSteps:gp,tmGetTags:bp,tmGetTestCase:rp,tmGetTestCaseRequirements:Uh,tmGetTestCaseSources:Bg,tmGetTestCases:ap,tmGetTraceabilityMatrix:Jh,tmGetUnmappedTestCases:rh,tmGetVersion:Op,tmGetVersions:Cp,tmGetWebhooks:pg,tmImportTestCases:xg,tmLinkSourceTestCases:_g,tmLinkTestCases:Dh,tmMoveFolder:np,tmNLSearch:Oh,tmPredictiveSelection:kh,tmPushCasesToJira:mp,tmQuickPlanFromSource:uf,tmRefreshSource:Lg,tmRemoveMapping:$p,tmRemoveTestCasesFromPlan:Bp,tmRerunFailed:Kp,tmRiskAssessment:Eh,tmRollbackTestCase:Pp,tmRunAutomation:Gg,tmRunCycleAutomation:zg,tmSaveCycleRunSettings:Yg,tmSearchMappings:gh,tmSetCustomFieldValues:kp,tmSetMapping:Ep,tmSetSteps:fp,tmSetTestCaseTags:Sp,tmSuggestPlan:Ch,tmTransitionDefect:tg,tmUnlinkSourceTestCases:Ug,tmUnlinkTestCases:Mh,tmUpdateCustomField:Tp,tmUpdateCycle:Wp,tmUpdateDefect:Yh,tmUpdateExecution:Qp,tmUpdateFolder:tp,tmUpdatePlan:_p,tmUpdateQualityGate:lg,tmUpdateReferenceLink:Og,tmUpdateRequirement:Ih,tmUpdateSource:Ig,tmUpdateStepResult:Zp,tmUpdateSyncStatus:uh,tmUpdateTag:yp,tmUpdateTestCase:ip,tmUpdateWebhook:hg,toggleAnnotateMode:Vl,toggleAssertMode:Kl,traceCiCommit:qc,trustedBrowserTokens:gt,unloadEnvConfig:Ir,updateApiCollection:Dd,updateApiEnvironment:qd,updateApiFolder:Bd,updateChatSessionMode:hl,updateChatSessionPermissionMode:ml,updateCloudSchedule:Cd,updateConnector:ef,updateFile:ra,updateMCPServer:lm,updateMobileRecording:cc,updateMyProfile:ju,updateOutputFolder:gf,updateRecordingHistory:ql,updateReportSchedule:ll,updateRunnerCommand:Jr,updateSavedReport:Zc,updateSkill:qu,updateSkillsChatSelections:rm,updateSuite:Of,updateUser:Eu,updateWorkflow:jm,updateWorkflowNotifications:Ym,updateWorkflowWebhook:Fm,uploadFiles:yc,uploadMobileApp:xi,validateWorkflowYaml:Nm,withSessionToken:hs},Symbol.toStringTag,{value:"Module"})),Nt={superadmin:4,admin:3,tester:2,viewer:1},Nn=p.createContext({user:null,token:null,isAuthenticated:!1,isSetupRequired:!1,isSetupLinkMissing:!1,isLoading:!0,login:async()=>({}),completeSignIn:()=>{},isTwoFactorSetupRequired:!1,logout:async()=>{},setup:async()=>{},hasRole:()=>!1,refreshStatus:async()=>{}}),qe="testver.setupToken";function Uf(){try{const e=new URL(window.location.href),t=e.searchParams.get("setup");return t?(sessionStorage.setItem(qe,t),e.searchParams.delete("setup"),window.history.replaceState(null,"",e.pathname+(e.search||"")+e.hash),t):sessionStorage.getItem(qe)}catch{return null}}function Jf({children:e}){const[t,o]=p.useState(null),[r,l]=p.useState(G()),[i,c]=p.useState(!1),[a,d]=p.useState(!1),[u]=p.useState(()=>Uf()),[h,m]=p.useState(!0),[g,b]=p.useState(!1),N=p.useCallback(async()=>{var T;try{const k=await ht();k.setupRequired?(c(!0),d(!!k.setupTokenRequired&&!u),o(null)):k.authenticated&&k.user?(c(!1),o(k.user),b(!!((T=k.twoFactor)!=null&&T.setupRequired)),k.session&&(ms(k.session),oe({expiresAt:k.session.expiresAt,absoluteExpiresAt:k.session.absoluteExpiresAt}))):(c(!1),o(null))}catch{o(null)}finally{m(!1)}},[u]);p.useEffect(()=>{_o(),N()},[N]);const j=p.useCallback(T=>{je(T.token),l(T.token),o(T.user),c(!1),b(!1),T.expiresAt&&T.absoluteExpiresAt&&oe({expiresAt:Date.parse(T.expiresAt),absoluteExpiresAt:Date.parse(T.absoluteExpiresAt)})},[]),w=p.useCallback(async(T,k)=>{const f=await hn(T,k);return!f.twoFactorRequired&&!f.twoFactorSetupRequired&&f.token&&j(f),f},[j]);p.useEffect(()=>{const T=()=>b(!0);return window.addEventListener("testver:two-factor-setup-required",T),()=>window.removeEventListener("testver:two-factor-setup-required",T)},[]);const R=p.useCallback(async()=>{try{await vn()}catch{}Pe(),oe(null),l(null),o(null),b(!1)},[]),O=p.useCallback(async(T,k,f,y,x,v)=>{const S=await Sn({username:T,displayName:k,email:y,password:f,appMode:x,projectName:v,setupToken:u??void 0});try{sessionStorage.removeItem(qe)}catch{}je(S.token),l(S.token),o(S.user),c(!1)},[u]),C=p.useCallback(T=>t?Nt[t.role]>=Nt[T]:!1,[t]),E={user:t,token:r,isAuthenticated:!!t,isSetupRequired:i,isSetupLinkMissing:a,isLoading:h,login:w,completeSignIn:j,isTwoFactorSetupRequired:g,logout:R,setup:O,hasRole:C,refreshStatus:N};return p.createElement(Nn.Provider,{value:E},e)}function Y(){return p.useContext(Nn)}const Bf={brand:"bg-brand-500/20 text-brand-300",green:"bg-emerald-500/20 text-emerald-300",red:"bg-red-500/20 text-red-300",yellow:"bg-amber-500/20 text-amber-300",gray:"bg-gray-500/20 text-gray-300",blue:"bg-sky-500/20 text-sky-300"};function Ff({label:e,color:t="brand"}){return s.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${Bf[t]}`,children:e})}function kt(){return document.documentElement.classList.contains("light")?"light":"dark"}function Gf(){const e=document.documentElement,t=e.classList.contains("light")?"dark":"light";e.classList.remove("dark","light"),e.classList.add(t),localStorage.setItem("testver-theme",t)}function zf(){const t=localStorage.getItem("testver-theme")??"light";document.documentElement.classList.remove("dark","light"),document.documentElement.classList.add(t)}const qf="/assets/logo-C7ltqfpq.svg",Wf="/assets/dark-logo-DCPcGDyT.svg";function ie({className:e="",alt:t="Testver logo"}){return s.jsxs(s.Fragment,{children:[s.jsx("img",{src:qf,alt:t,className:`block dark:hidden ${e}`}),s.jsx("img",{src:Wf,alt:t,className:`hidden dark:block ${e}`})]})}const kn=["testver-hub"];function Hf(e){return F({queryKey:kn,queryFn:()=>Ns(),refetchInterval:6e4,refetchOnWindowFocus:!0,staleTime:3e4,retry:1,enabled:(e==null?void 0:e.enabled)??!0})}function Q0(){const e=de();return()=>{e.invalidateQueries({queryKey:kn}),e.invalidateQueries({queryKey:["testver-status"]}),e.invalidateQueries({queryKey:["llm-config"]}),e.invalidateQueries({queryKey:["grid-status"]}),e.invalidateQueries({queryKey:["connectors"]}),e.invalidateQueries({queryKey:["cloud-providers"]})}}const Re=3e4;function Cn(){return F({queryKey:["git-status"],queryFn:mt,refetchInterval:3e4,refetchOnWindowFocus:!0})}const We="testver-git-include-testver";let we=(()=>{try{return sessionStorage.getItem(We)==="1"}catch{return!1}})();const He=new Set;function X0(e){we=e;try{e?sessionStorage.setItem(We,"1"):sessionStorage.removeItem(We)}catch{}He.forEach(t=>t())}function Kf(){return p.useSyncExternalStore(e=>(He.add(e),()=>{He.delete(e)}),()=>we)}function Vf(e,t){if(!t)return!1;const o=e.replace(/\\/g,"/").toLowerCase(),r=t.toLowerCase();return o.startsWith(r)||o===r.slice(0,-1)}function Z0(){const e=Cn(),t=Kf(),o=p.useMemo(()=>{var u;const r=e.data;if(!(r!=null&&r.available)||t||!r.testverPrefix)return r&&{...r,hiddenTestver:0};const l=r.uncommittedChanges??[],i=l.filter(h=>!Vf(h.path,r.testverPrefix)),c=Math.max(0,(r.stagedCount??0)-(r.testverStagedCount??0)),a=Math.max(0,(r.unstagedCount??0)-(r.testverUnstagedCount??0)),d=((u=r.conflictedPaths)==null?void 0:u.length)??0;return{...r,uncommittedChanges:i,stagedCount:c,unstagedCount:a,isClean:r.isClean||i.length===0&&d===0,hiddenTestver:l.length-i.length}},[e.data,t]);return{...e,data:o}}function On(){const{data:e}=F({queryKey:["git-status"],queryFn:mt,staleTime:3e4});return(e==null?void 0:e.available)===!0}function eb(e){return F({queryKey:["git-blame",e],queryFn:()=>Ps(e),enabled:!!e})}function tb(e=20,t){return F({queryKey:["git-log",e,t],queryFn:()=>pt(e,void 0),enabled:!0,placeholderData:to,refetchInterval:Re,refetchOnWindowFocus:!0})}function sb(e,t=20){return F({queryKey:["git-file-history",e,t],queryFn:()=>pt(t,e||void 0),enabled:!!e})}function nb(e){return F({queryKey:["git-diff",e],queryFn:()=>Es(e),enabled:!!e})}function ob(e,t=!0){return F({queryKey:["git-uncommitted-diff",e??"all"],queryFn:()=>Rs(e||void 0),enabled:t,refetchInterval:Re,refetchOnWindowFocus:!0})}function ab(e,t=30){return F({queryKey:["git-churn",e,t],queryFn:()=>$s(e,t),enabled:!!e})}function rb(e){return F({queryKey:["git-correlation",e],queryFn:()=>As(e),enabled:!!e})}function ib(e){return F({queryKey:["git-ownership",e],queryFn:()=>Is(e),enabled:!!e})}function cb(){return F({queryKey:["git-branches"],queryFn:cn,refetchInterval:Re,refetchOnWindowFocus:!0})}function lb(e=!0){return F({queryKey:["git-identity"],queryFn:_s,enabled:e})}function db(e){return F({queryKey:["git-last-commit"],queryFn:Us,enabled:e})}function Pn(e){for(const t of["git-status","git-log","git-uncommitted-diff","git-branches","git-file-history","git-blame","git-last-commit","git-stash","git-remote-updates","git-remote-incoming"])e.invalidateQueries({queryKey:[t]})}function ub(){const e=de();return p.useCallback(()=>Pn(e),[e])}function Yf(){return eo({mutationKey:["git"]})>0}function B(e){const t=de();return Ve({mutationKey:["git"],mutationFn:e,onSettled:()=>Pn(t)})}function mb(){return B(e=>Ls(e,we))}function pb(){return B(e=>rn(e.path,e.side?{side:e.side}:e.deleteFile?{delete:!0}:e.content??""))}function hb(){return B(e=>Ws())}function gb(){return B(e=>Ks())}function fb(){return B(e=>Hs())}function xb(){return B(e=>Ds(e))}function bb(){return B(e=>Ms(e.message,{amend:e.amend,confirmPushedAmend:e.confirmPushedAmend,includeTestver:we}))}function yb(){return B(e=>Js(e.files,e.scope,we))}function wb(){return B(e=>Vs(e))}function En(){return B(e=>Ys(e==null?void 0:e.remote,e==null?void 0:e.branch))}function Sb(){return B(e=>Qs(e==null?void 0:e.remote,e==null?void 0:e.branch))}function vb(){return B(e=>ln(e.name,e.checkout))}function jb(){return B(e=>dn(e))}function Tb(){return F({queryKey:["git-stash"],queryFn:Bs,refetchInterval:Re,refetchOnWindowFocus:!0})}function Nb(){return B(e=>Fs(e.message,e.includeUntracked))}function kb(){return B(e=>Gs(e==null?void 0:e.ref,e==null?void 0:e.sha))}function Cb(){return B(e=>qs())}function Ob(){return B(e=>zs(e==null?void 0:e.ref,e==null?void 0:e.sha))}function ft(e=!0){return F({queryKey:["git-remote-updates"],queryFn:Xs,enabled:e,refetchInterval:6e4,refetchOnWindowFocus:!0,staleTime:2e4})}function Pb(e){return F({queryKey:["git-remote-incoming"],queryFn:en,enabled:e})}function Eb(){return B(e=>Zs())}function Rb(){return B(e=>tn())}function $b(){return B(e=>sn())}function Ab(){return B(e=>nn(e))}function xt(e){return!!e&&e.ok&&!e.skipped&&e.behind>0&&e.verdict!=="deleted"}function Ct(e,t){const o=(e==null?void 0:e.projectPrefix)??"";return o?t.startsWith(o)?t.slice(o.length):null:t}const Rn="testver-remote-snooze";function Ib(e){if(!e)return 0;try{const t=JSON.parse(localStorage.getItem(Rn)||"null");return t&&t.sha===e&&t.until>Date.now()?t.until:0}catch{return 0}}function Lb(e,t){try{localStorage.setItem(Rn,JSON.stringify({sha:e,until:Date.now()+t*6e4}))}catch{}window.dispatchEvent(new CustomEvent("testver-remote-snooze"))}function Qf({modules:e,collapsed:t}){const{data:o}=Hf(),{hasRole:r,user:l}=Y(),i=r("admin"),c=({label:a,isFirst:d=!1})=>t?s.jsx("div",{className:`mx-3 ${d?"mt-2":"mt-3"} mb-1 h-px bg-white/5`,"aria-hidden":"true"}):s.jsx("div",{className:`px-3 ${d?"pt-2":"pt-4"} pb-1`,children:s.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-gray-500",children:a})});return s.jsxs("aside",{className:`flex flex-col bg-surface-1 border-r border-white/5 flex-shrink-0 transition-[width] duration-200 ease-out ${t?"w-14":"w-56"}`,children:[s.jsxs("nav",{className:"flex-1 overflow-y-auto py-2 space-y-0.5",children:[s.jsx(c,{label:"Test Automation",isFirst:!0}),s.jsx(U,{to:"/",icon:s.jsx(Gt,{size:18}),label:"Dashboard",collapsed:t}),s.jsx(U,{to:"/tests",icon:s.jsx(Ye,{size:18}),label:"Test Explorer",collapsed:t}),s.jsx(U,{to:"/code-map",icon:s.jsx(zt,{size:18}),label:"Code Map",collapsed:t}),s.jsx(U,{to:"/pipelines",icon:s.jsx(ne,{size:18}),label:"CI/CD Pipelines",collapsed:t}),s.jsx(U,{to:"/results",icon:s.jsx(Le,{size:18}),label:"Results",collapsed:t}),s.jsx(U,{to:"/advanced",icon:s.jsx(qt,{size:18}),label:"Advanced",collapsed:t}),s.jsx(c,{label:"Test Management"}),s.jsx(U,{to:"/test-cases",icon:s.jsx(Qe,{size:18}),label:"Test Cases",collapsed:t}),s.jsx(U,{to:"/test-plans",icon:s.jsx(Ne,{size:18}),label:"Test Plans",collapsed:t}),s.jsx(U,{to:"/ai-test-gen",icon:s.jsx(Wt,{size:18}),label:"AI Test Gen",collapsed:t}),s.jsx(U,{to:"/sources",icon:s.jsx(Xe,{size:18}),label:"Sources",collapsed:t}),s.jsx(U,{to:"/script-mapping",icon:s.jsx(Ht,{size:18}),label:"Script Mapping",collapsed:t}),s.jsx(U,{to:"/coverage",icon:s.jsx(Kt,{size:18}),label:"Coverage",collapsed:t}),s.jsx(U,{to:"/defects",icon:s.jsx(Ze,{size:18}),label:"Defects",collapsed:t}),s.jsx(c,{label:"Agents"}),s.jsx(U,{to:"/ai",icon:s.jsx(et,{size:18}),label:"AI Assistant",collapsed:t}),s.jsx(U,{to:"/ai-record",icon:s.jsx(Vt,{size:18}),label:"AI Record",collapsed:t}),s.jsx(c,{label:"Project"}),s.jsx(U,{to:"/explorer",icon:s.jsx(Yt,{size:18}),label:"Explorer",collapsed:t}),s.jsx(U,{to:"/git",icon:s.jsx(ne,{size:18}),label:"Git",collapsed:t,indicator:s.jsx(Xf,{})}),s.jsx(U,{to:"/reports",icon:s.jsx(tt,{size:18}),label:"Reports",collapsed:t}),!i&&s.jsxs(s.Fragment,{children:[s.jsx(c,{label:(l==null?void 0:l.role)==="viewer"?"Viewer":(l==null?void 0:l.role)==="tester"?"Tester":"Account"}),s.jsx(U,{to:"/settings",icon:s.jsx(De,{size:18}),label:"Settings",collapsed:t})]}),i&&s.jsxs(s.Fragment,{children:[s.jsx(c,{label:"Admin"}),s.jsx(U,{to:"/users",icon:s.jsx(Me,{size:18}),label:"Users",collapsed:t}),s.jsx(U,{to:"/audit",icon:s.jsx(Qt,{size:18}),label:"Audit Log",collapsed:t}),s.jsx(U,{to:"/settings",icon:s.jsx(De,{size:18}),label:"Settings",collapsed:t})]})]}),s.jsx("div",{className:"border-t border-white/5 py-1",children:s.jsx(U,{to:"/testver",icon:o!=null&&o.connected?s.jsx(oo,{size:18,className:"text-emerald-500"}):s.jsx(ao,{size:18}),label:"Testver",collapsed:t,indicator:o!=null&&o.connected?s.jsx("span",{className:"block h-2 w-2 rounded-full bg-emerald-400 shadow-[0_0_0_3px_rgba(52,211,153,0.15)]",title:"Connected to Testver"}):void 0})})]})}function U({to:e,icon:t,label:o,badge:r,collapsed:l,indicator:i,activeStyles:c}){const a=c||"bg-brand-500/15 text-brand-300 font-medium",d=p.useRef(null),[u,h]=p.useState(null),m=()=>{var N;if(!l)return;const b=(N=d.current)==null?void 0:N.getBoundingClientRect();b&&h({top:b.top+b.height/2,left:b.right+8})},g=()=>h(null);return s.jsxs(Hn,{to:e,end:e==="/",ref:d,onMouseEnter:m,onMouseLeave:g,onFocus:m,onBlur:g,className:({isActive:b})=>`flex items-center gap-3 mx-2 px-2.5 py-2 rounded-lg text-sm transition-colors
12
+ ${b?a:"text-gray-400 hover:text-gray-200 hover:bg-white/5"}
13
+ ${l?"justify-center":""}`,children:[s.jsxs("span",{className:"flex-shrink-0 relative",children:[t,i&&l&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5",children:i})]}),!l&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"flex-1 truncate",children:o}),i&&s.jsx("span",{className:"flex-shrink-0",children:i}),r!==void 0&&r>0&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-surface-2 text-gray-400",children:r})]}),l&&u&&s.jsx($n,{pos:u,label:o,badge:r})]})}function $n({pos:e,label:t,badge:o}){return Bt.createPortal(s.jsxs("span",{role:"tooltip",style:{top:e.top,left:e.left},className:`pointer-events-none fixed z-[60] -translate-y-1/2
14
+ whitespace-nowrap animate-tooltip-in`,children:[s.jsx("span",{className:"absolute -left-1 top-1/2 -translate-y-1/2 w-2 h-2 bg-[#111827] rotate-45 ring-1 ring-white/10"}),s.jsxs("span",{className:"relative inline-flex items-center gap-2 px-2.5 py-1.5 rounded-md bg-[#111827] text-white text-xs font-medium shadow-lg shadow-black/50 ring-1 ring-white/10",children:[t,o!==void 0&&o>0&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-white/15 text-white/90",children:o})]})]}),document.body)}function Xf(){const{data:e}=ft(On()),t=e==null?void 0:e.check;if(!t||!xt(t))return null;const o=t.verdict==="uncommitted_overlap"||t.verdict==="will_conflict";return s.jsxs("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded-full flex items-center gap-0.5 ${o?"bg-amber-500/15 text-amber-700 dark:text-amber-300":"bg-sky-500/15 text-sky-700 dark:text-sky-300"}`,title:`${t.behind} new commit${t.behind===1?"":"s"} on ${t.remoteLabel||t.remote||"the remote"}`,children:[s.jsx(_e,{size:10}),t.behind]})}const Db="This feature is not available for mobile at present";function Zf(){const{data:e,isLoading:t}=F({queryKey:["system","app-mode"],queryFn:bs,staleTime:6e4}),o=(e==null?void 0:e.mode)??null,r=o===null||o==="web"||o==="both",l=o===null||o==="mobile"||o==="both",i=o===null||o==="both";return{mode:o,setAt:(e==null?void 0:e.setAt)??null,isLoading:t,showsWeb:r,showsMobile:l,isAmbiguous:i}}function Mb(){const e=de();return Ve({mutationFn:t=>ys(t),onSuccess:t=>{e.setQueryData(["system","app-mode"],t)}})}const An=60;function ex(e=!0){const{data:t,isLoading:o}=F({queryKey:["system","project-name"],queryFn:ws,staleTime:6e4,enabled:e});return{name:(t==null?void 0:t.name)??null,maxLength:(t==null?void 0:t.maxLength)??An,isLoading:o}}function _b(){const e=de();return Ve({mutationFn:t=>Ss(t),onSuccess:t=>{e.setQueryData(["system","project-name"],t)}})}function tx(e){if(!e)return"";const t=e.split(/[\\/]+/).filter(Boolean);return t[t.length-1]??""}const In=p.createContext({toast:()=>{}}),bt=()=>p.useContext(In);function sx({children:e}){const[t,o]=p.useState([]),r=p.useCallback((i,c)=>{const a=Date.now().toString(36);o(d=>[...d,{id:a,type:i,message:c}]),setTimeout(()=>{o(d=>d.filter(u=>u.id!==a))},4e3)},[]),l=p.useCallback(i=>{o(c=>c.filter(a=>a.id!==i))},[]);return s.jsxs(In.Provider,{value:{toast:r},children:[e,s.jsx("div",{className:"fixed bottom-4 right-4 z-50 space-y-2",children:t.map(i=>s.jsxs("div",{className:`flex items-center gap-2 px-4 py-3 rounded-lg animate-slide-in text-sm
15
+ ${i.type==="success"?"bg-emerald-900/90 text-emerald-200 border border-emerald-700/50":""}
16
+ ${i.type==="error"?"bg-red-900/90 text-red-200 border border-red-700/50":""}
17
+ ${i.type==="info"?"bg-surface-2 text-gray-200 border border-white/10":""}`,children:[i.type==="success"&&s.jsx(Ue,{size:16}),i.type==="error"&&s.jsx(ro,{size:16}),i.type==="info"&&s.jsx(Xt,{size:16}),s.jsx("span",{className:"flex-1",children:i.message}),s.jsx("button",{onClick:()=>l(i.id),className:"text-white/50 hover:text-white",children:s.jsx(st,{size:14})})]},i.id))})]})}function nx(e){if(!e)return"";const t=Date.now()-new Date(e).getTime();if(!Number.isFinite(t))return"";const o=Math.round(t/6e4);if(o<1)return"just now";if(o<60)return`${o} min ago`;const r=Math.round(o/60);if(r<24)return`${r} h ago`;const l=Math.round(r/24);return`${l} day${l===1?"":"s"} ago`}function Ub(e){if(!e)return"";const t=Math.max(0,Math.round((new Date(e).getTime()-Date.now())/6e4));return t<1?"in under a minute":`in ${t} min`}function Ln(e){const t=[...new Set(e.incoming.map(o=>o.author).filter(Boolean))];return t.length===0?"Someone":t.length<=2?t.join(" and "):`${t.slice(0,2).join(", ")} and others`}function Dn(e){return(e==null?void 0:e.remoteLabel)||(e==null?void 0:e.remote)||"the remote"}const q=(e,t,o=`${t}s`)=>`${e} ${e===1?t:o}`;function ox(e,t=3){return e.slice(0,t).join(", ")+(e.length>t?` and ${e.length-t} more`:"")}const Jb="testver-open-incoming",V="flex items-center gap-1 h-7 px-2 rounded-md border text-[11px] font-medium whitespace-nowrap transition-colors";function ax(){var E,T;const e=H(),{toast:t}=bt(),{data:o}=Cn(),{data:r}=ft((o==null?void 0:o.available)===!0),l=En(),i=Yf(),[c,a]=p.useState(!1),d=p.useRef(null);if(p.useEffect(()=>()=>{d.current&&window.clearTimeout(d.current)},[]),!(o!=null&&o.available))return null;const u=(r==null?void 0:r.check)??null,h=Dn(u),m=(k=!1)=>e(k?"/git?incoming=1":"/git"),g=((E=o.conflictedPaths)==null?void 0:E.length)??0,b=o.operation,N=o.ahead??0,j=o.detached?s.jsxs("button",{className:`${V} bg-amber-500/15 border-amber-500/40 text-amber-700 dark:text-amber-300 hover:bg-amber-500/20`,onClick:()=>m(),title:"HEAD is on a commit, not a branch — open Git",children:[s.jsx(ne,{size:12}),s.jsxs("span",{className:"font-mono hidden xl:inline",children:["detached ",((T=o.lastCommit)==null?void 0:T.shortSha)??""]})]}):s.jsxs("button",{className:`${V} bg-surface-2 border-white/5 text-gray-300 hover:bg-surface-3`,onClick:()=>m(),title:`Current branch: ${o.branch??""}${N?` · ${q(N,"commit")} not pushed yet`:""} — open Git`,children:[s.jsx(ne,{size:12}),s.jsx("span",{className:"font-mono max-w-[10rem] truncate hidden xl:inline",children:o.branch}),N>0&&s.jsxs("span",{className:"flex items-center gap-0.5 text-emerald-600 dark:text-emerald-400",children:[s.jsx(io,{size:10}),N]})]});let w=null,R=!1;if(b&&g>0)w=s.jsxs("button",{className:`${V} bg-red-500/10 border-red-500/40 text-red-600 dark:text-red-300 hover:bg-red-500/15`,onClick:()=>m(),title:`A ${b.kind} is in progress with ${q(g,"conflicted file")} — open Git`,children:[s.jsx(vt,{size:12}),s.jsxs("span",{className:"hidden xl:inline",children:[b.kind[0].toUpperCase()+b.kind.slice(1)," — "]}),q(g,"conflict")]});else if(g>0){const k=!!o.pendingStash;w=s.jsxs("button",{className:`${V} bg-red-500/10 border-red-500/40 text-red-600 dark:text-red-300 hover:bg-red-500/15`,onClick:()=>m(),title:`${k?"Your stash came back with":"There are"} ${q(g,"conflicted file")} to resolve — open Git`,children:[s.jsx(me,{size:11}),s.jsx("span",{className:"hidden xl:inline",children:k?"Stash — ":""}),q(g,"conflict")]})}else if(b)w=s.jsxs("button",{className:`${V} bg-orange-500/10 border-orange-500/40 text-orange-600 dark:text-orange-300`,onClick:()=>m(),title:`A ${b.kind} is in progress — open Git`,children:[s.jsx(vt,{size:12}),s.jsxs("span",{className:"hidden xl:inline",children:[b.kind[0].toUpperCase()+b.kind.slice(1)," in progress"]})]});else if(u&&!u.skipped&&u.ok&&u.verdict==="rewritten")w=s.jsxs("button",{className:`${V} bg-red-500/10 border-red-500/40 text-red-600 dark:text-red-300`,onClick:()=>m(),title:`${u.upstream} was rewritten on ${h} — open Git`,children:[s.jsx(me,{size:11}),s.jsxs("span",{className:"hidden xl:inline",children:[h," history rewritten"]})]});else if(u&&!u.skipped&&u.verdict==="deleted")w=s.jsxs("button",{className:`${V} bg-amber-500/15 border-amber-500/40 text-amber-700 dark:text-amber-300`,onClick:()=>m(),title:`${u.upstream} was deleted on ${h} — open Git`,children:[s.jsx(ne,{size:12}),s.jsx("span",{className:"hidden xl:inline",children:"Remote branch deleted"})]});else if(u&&xt(u)){const k=u.verdict==="uncommitted_overlap"||u.verdict==="will_conflict",f=u.verdict==="uncommitted_overlap"?u.overlapFiles.length:u.conflictFiles.length;R=!0,w=s.jsxs("button",{className:`${V} ${k?"bg-amber-500/15 border-amber-500/40 text-amber-700 dark:text-amber-300 hover:bg-amber-500/20":"bg-sky-500/15 border-sky-500/40 text-sky-700 dark:text-sky-300 hover:bg-sky-500/20"}`,onClick:()=>m(!0),"aria-label":`${q(u.behind,"new commit")} on ${h}`,children:[s.jsx(_e,{size:12}),s.jsxs("span",{children:[u.behind,s.jsxs("span",{className:"hidden xl:inline",children:[" new on ",h]})]}),k&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"w-px h-3 bg-amber-500/40 mx-0.5"}),s.jsx(me,{size:11}),s.jsx("span",{className:"hidden xl:inline",children:q(f,"clash","clashes")})]})]})}else u&&!u.ok&&u.error&&(w=s.jsxs("button",{className:`${V} bg-surface-2 border-white/5 text-gray-500 hover:bg-surface-3`,onClick:()=>m(),title:u.error.message,children:[s.jsx(co,{size:12}),s.jsxs("span",{className:"hidden xl:inline",children:["Can't check ",h]})]}));const O=()=>{d.current&&window.clearTimeout(d.current),a(!0)},C=()=>{d.current=window.setTimeout(()=>a(!1),200)};return s.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0 relative",children:[j,w&&s.jsxs("div",{className:"relative",onMouseEnter:R?O:void 0,onMouseLeave:R?C:void 0,children:[w,R&&c&&u&&s.jsxs("div",{className:"absolute top-full mt-2 right-0 bg-surface-1 border border-white/10 rounded-xl shadow-2xl p-4 z-50 w-[430px] max-w-[90vw]",onMouseEnter:O,onMouseLeave:C,children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-gray-100",children:[s.jsx(_e,{size:15}),q(u.behind,"new commit")," on ",u.upstream]}),s.jsxs("div",{className:"mt-2 space-y-1.5 text-xs",children:[u.incoming.slice(0,3).map(k=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-mono text-brand-400",children:k.shortSha}),s.jsx("span",{className:"text-gray-300 truncate flex-1",children:k.message})]},k.sha)),u.behind>3&&s.jsxs("div",{className:"text-gray-500",children:["…and ",u.behind-3," more"]})]}),s.jsxs("div",{className:"mt-2 text-xs text-gray-500 flex items-center gap-1",children:[s.jsx(Zt,{size:11})," ",Ln(u)," · ",q(u.stats.files,"file")," · +",u.stats.additions," −",u.stats.deletions]}),u.verdict==="clean"?s.jsxs("div",{className:"mt-3 flex items-start gap-2 rounded-lg border border-emerald-500/30 bg-emerald-500/10 px-2.5 py-1.5 text-xs text-emerald-700 dark:text-emerald-300",children:[s.jsx(nt,{size:13,className:"shrink-0 mt-0.5"}),s.jsxs("span",{children:[s.jsx("b",{children:"Pulls cleanly"})," — nothing clashes with your work."]})]}):s.jsxs("div",{className:"mt-3 flex items-start gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-2.5 py-1.5 text-xs text-amber-700 dark:text-amber-300",children:[s.jsx(me,{size:13,className:"shrink-0 mt-0.5"}),s.jsx("span",{children:u.verdict==="uncommitted_overlap"?s.jsxs(s.Fragment,{children:["Changes ",ox(u.overlapFiles,2),", which you are editing — use ",s.jsx("b",{children:"Stash, pull & re-apply"})," on the Git page."]}):s.jsxs(s.Fragment,{children:["Pulling will need ",q(u.conflictFiles.length,"file")," resolved."]})})]}),s.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[u.verdict==="clean"&&s.jsxs("button",{disabled:i,onClick:()=>l.mutate(void 0,{onSuccess:k=>{var f;if(a(!1),k.conflicts&&((f=k.conflictedPaths)!=null&&f.length)){m();return}t("success",`Pulled ${q(u.behind,"commit")} from ${h}`)},onError:k=>t("error",`Pull failed: ${k.message}`)}),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-emerald-600 hover:bg-emerald-500 text-white whitespace-nowrap disabled:opacity-50",children:[s.jsx(es,{size:12})," Pull now"]}),s.jsxs("button",{onClick:()=>{a(!1),m(!0)},className:"flex items-center gap-1 px-3 py-1.5 rounded-lg text-xs font-medium bg-surface-2 hover:bg-surface-3 text-gray-300 border border-white/10 whitespace-nowrap",children:["Open Git ",s.jsx(ot,{size:12})]}),s.jsxs("span",{className:"ml-auto text-[11px] text-gray-500 flex items-center gap-1 whitespace-nowrap",children:[s.jsx(at,{size:11})," ",nx(u.checkedAt)]})]})]})]})]})}function Ot({collapsed:e,onToggle:t}){const o=p.useRef(null),[r,l]=p.useState(null),i=()=>{var u;const d=(u=o.current)==null?void 0:u.getBoundingClientRect();d&&l({top:d.top+d.height/2,left:d.right+8})},c=()=>l(null),a=e?"Expand sidebar":"Collapse sidebar";return s.jsxs(s.Fragment,{children:[s.jsx("button",{ref:o,type:"button",onClick:()=>{c(),t()},onMouseEnter:i,onMouseLeave:c,onFocus:i,onBlur:c,"aria-label":a,"aria-expanded":!e,className:"p-1.5 rounded-lg text-gray-500 hover:text-brand-300 hover:bg-white/[0.05] transition-colors flex-shrink-0",children:e?s.jsx(po,{size:17}):s.jsx(ho,{size:17})}),r&&s.jsx($n,{pos:r,label:`${a} (Ctrl+B)`})]})}function rx({rootPath:e,framework:t,language:o}){const{hasRole:r}=Y(),l=H(),{name:i,isLoading:c}=ex();if(c)return null;const a=i||tx(e);if(!a)return null;const d=r("admin"),u=[t,o].filter(Boolean).join(" · "),h=[`Project: ${a}`,u?`Stack: ${u}`:"",i?"":"No project name set yet — showing the folder name.",d?"Click to rename in Settings → General.":""].filter(Boolean).join(`
18
+ `),m=s.jsxs(s.Fragment,{children:[s.jsx(as,{size:16,"aria-hidden":!0,className:"flex-shrink-0 text-gray-400"}),s.jsx("span",{className:`text-sm font-semibold truncate flex-shrink-0 max-w-[7rem] lg:max-w-[11rem] xl:max-w-[16rem] ${i?"text-gray-100":"text-gray-400"}`,"data-testid":"header-project-name",children:a})]}),g="flex items-center gap-2 flex-shrink-0 h-8 px-2 rounded-lg";return d?s.jsx("button",{type:"button",onClick:()=>l("/settings?tab=general"),title:h,"aria-label":`Project ${a}. Open Settings to rename.`,className:`${g} hover:bg-white/[0.05] transition-colors`,children:m}):s.jsx("div",{title:h,"aria-label":`Project ${a}`,className:g,children:m})}function ix({framework:e,language:t,rootPath:o,connected:r,onRescan:l,onSearchOpen:i,sidebarCollapsed:c,onToggleSidebar:a}){var C,E,T,k;const[d,u]=p.useState(kt),{user:h,logout:m}=Y(),g=H(),[b,N]=p.useState(!1),j=p.useRef(null),w=()=>{Gf(),u(kt())},R=async()=>{N(!1),await m(),g("/login",{replace:!0})};p.useEffect(()=>{if(!b)return;const f=y=>{j.current&&!j.current.contains(y.target)&&N(!1)};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[b]);const O=((E=(C=h==null?void 0:h.displayName)==null?void 0:C.charAt(0))==null?void 0:E.toUpperCase())||((k=(T=h==null?void 0:h.username)==null?void 0:T.charAt(0))==null?void 0:k.toUpperCase())||"?";return s.jsxs("header",{className:"h-12 bg-surface-1 border-b border-white/5 flex items-center gap-3 flex-shrink-0",children:[s.jsxs("div",{className:"h-full flex items-center gap-3 flex-1",children:[s.jsxs("div",{className:`h-full flex items-center border-r border-white/5 flex-shrink-0 transition-[width] duration-200 ease-out ${c?"w-14 justify-center":"w-56 pl-4 pr-2 gap-2"}`,children:[s.jsx(ie,{className:"w-7 h-7 object-contain flex-shrink-0"}),!c&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"font-semibold text-gray-100 text-sm whitespace-nowrap",children:"Testver"}),s.jsx("div",{className:"flex-1"}),s.jsx(Ot,{collapsed:!1,onToggle:a})]})]}),c&&s.jsx(Ot,{collapsed:!0,onToggle:a}),s.jsxs("div",{className:"flex items-center gap-2.5 ml-1",children:[s.jsx(rx,{rootPath:o,framework:e,language:t}),s.jsx(lx,{})]})]}),s.jsx("div",{className:"flex justify-center flex-[0_1_460px] min-w-[180px] px-1",children:s.jsxs("button",{onClick:i,className:"header-search group w-full flex items-center gap-2 h-8 pl-3 pr-2 rounded-lg bg-surface-2 hover:bg-surface-3 border border-white/5 hover:border-white/10 text-gray-400 hover:text-gray-300 transition-colors",title:"Search pages, test cases, defects and files (Ctrl+K)",children:[s.jsx(ts,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"text-xs truncate",children:"Search pages, test cases, defects, files…"}),s.jsx("span",{className:"flex-1"}),s.jsx("kbd",{className:"flex-shrink-0 px-1.5 py-0.5 rounded bg-surface-3 text-[10px] font-mono text-gray-500 group-hover:text-gray-400",children:"Ctrl+K"})]})}),s.jsx(ax,{}),s.jsx("div",{className:"flex flex-1 justify-end",children:s.jsxs("div",{className:"flex items-center gap-3 pr-4",children:[s.jsxs("div",{className:`flex items-center gap-1.5 text-xs ${r?"text-emerald-400":"text-red-400"}`,children:[r?s.jsx(lo,{size:14}):s.jsx(ss,{size:14}),s.jsx("span",{className:"hidden sm:inline",children:r?"Live":"Offline"})]}),s.jsx(cx,{}),s.jsx("button",{onClick:l,className:"p-1.5 rounded-lg hover:bg-surface-2 text-gray-400 hover:text-gray-200",title:"Rescan project",children:s.jsx(ns,{size:16})}),s.jsx("button",{onClick:w,className:"p-1.5 rounded-lg hover:bg-surface-2 text-gray-400 hover:text-gray-200",title:"Toggle theme",children:d==="dark"?s.jsx(uo,{size:16}):s.jsx(mo,{size:16})}),h&&s.jsxs("div",{className:"relative",ref:j,children:[s.jsxs("button",{onClick:()=>N(!b),className:"flex items-center gap-1.5 px-2 py-1 rounded-lg hover:bg-surface-2 transition-colors",children:[s.jsx("div",{className:"w-6 h-6 rounded-full bg-brand-500/20 flex items-center justify-center text-brand-300 text-[11px] font-semibold",children:O}),s.jsx("span",{className:"text-xs text-gray-300 hidden sm:inline max-w-[80px] truncate",children:h.username}),s.jsx(rt,{size:12,className:`text-gray-500 transition-transform ${b?"rotate-180":""}`})]}),b&&s.jsxs("div",{className:"absolute right-0 top-full mt-1 w-56 bg-surface-1 border border-white/10 rounded-lg z-50 py-1",children:[s.jsxs("div",{className:"px-3 py-2 border-b border-white/5",children:[s.jsx("p",{className:"text-sm font-medium text-gray-200",children:h.displayName}),s.jsxs("p",{className:"text-xs text-gray-500",children:["@",h.username]}),s.jsx(Ff,{label:h.role==="superadmin"?"super admin":h.role,color:h.role==="superadmin"?"yellow":h.role==="admin"?"brand":h.role==="tester"?"green":"gray"})]}),s.jsxs("button",{onClick:()=>{N(!1),g("/profile")},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-gray-300 hover:bg-surface-2 hover:text-gray-100",children:[s.jsx(Zt,{size:14}),"Profile"]}),s.jsxs("button",{onClick:R,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-red-400 hover:bg-red-500/10",children:[s.jsx(it,{size:14}),"Sign Out"]})]})]})]})})]})}function cx(){const[e,t]=p.useState(!1),o=p.useRef(null);p.useEffect(()=>{if(!e)return;const i=c=>{o.current&&!o.current.contains(c.target)&&t(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[e]);const r=[{label:"Documentation",desc:"Guides & reference",href:"https://www.docs.testver.com/",Icon:fo,accent:"text-sky-500 bg-sky-500/10"},{label:"Support",desc:"Get help from our team",href:"https://support.testver.com/",Icon:xo,accent:"text-emerald-500 bg-emerald-500/10"},{label:"YouTube Channel",desc:"Tutorials & demos",href:"https://www.youtube.com/@TestverAI",Icon:bo,accent:"text-rose-500 bg-rose-500/10"}],l=i=>{t(!1),window.open(i,"_blank","noopener,noreferrer")};return s.jsxs("div",{className:"relative",ref:o,children:[s.jsx("button",{onClick:()=>t(i=>!i),className:`p-1.5 rounded-lg transition-colors ${e?"bg-surface-2 text-gray-200":"hover:bg-surface-2 text-gray-400 hover:text-gray-200"}`,title:"Help & resources","aria-label":"Help & resources",children:s.jsx(go,{size:19})}),e&&s.jsxs("div",{className:"absolute right-0 top-full mt-1.5 w-64 bg-surface-1 border border-white/10 rounded-xl shadow-xl z-50 py-1.5 animate-fade-in",children:[s.jsx("p",{className:"px-3 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-gray-500",children:"Help & Resources"}),r.map(({label:i,desc:c,href:a,Icon:d,accent:u})=>s.jsxs("button",{onClick:()=>l(a),className:"group w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-surface-2 transition-colors",children:[s.jsx("span",{className:`inline-flex h-8 w-8 items-center justify-center rounded-lg ${u}`,children:s.jsx(d,{size:15})}),s.jsxs("span",{className:"flex-1 min-w-0",children:[s.jsx("span",{className:"block text-sm font-medium text-gray-200",children:i}),s.jsx("span",{className:"block text-xs text-gray-500 truncate",children:c})]}),s.jsx(os,{size:13,className:"text-gray-600 group-hover:text-gray-400 transition-colors"})]},i))]})]})}function lx(){const{mode:e,isLoading:t}=Zf();if(t||!e)return null;const r={web:{label:"Web",Icon:ct,container:"bg-sky-500/15 text-sky-700 dark:text-sky-300",iconText:"text-sky-700 dark:text-sky-400",beta:!1},mobile:{label:"Mobile",Icon:ke,container:"bg-indigo-500/20 text-indigo-700 dark:text-indigo-300",iconText:"text-indigo-700 dark:text-indigo-400",beta:!0},both:{label:"Both",Icon:Ne,container:"bg-purple-500/15 text-purple-700 dark:text-purple-300",iconText:"text-purple-700 dark:text-purple-300",beta:!1}}[e],l=r.Icon;return s.jsxs("span",{title:`App mode: ${r.label}${r.beta?" (beta)":""} — change in Settings → General`,className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-[11px] ${r.container}`,children:[s.jsx(l,{size:11,className:r.iconText}),s.jsx("span",{className:"font-medium",children:r.label}),r.beta&&s.jsx("span",{className:"ml-1 text-[9px] font-bold uppercase tracking-wider text-amber-400",children:"Beta"})]})}function dx(e){const[t,o]=p.useState(new Map),r=p.useRef(new Set);return p.useEffect(()=>{Ts().then(i=>{const c=new Map;for(const a of i.runs){const d=new Date(a.startTime).getTime();c.set(a.runId,{runId:a.runId,command:a.command,startTime:a.startTime,framework:a.framework,cloudProvider:a.cloudProvider,source:a.source,plainCommand:a.plainCommand===!0,passed:0,failed:0,currentTest:0,currentTestName:"",elapsedMs:Date.now()-d,startMs:d})}c.size>0&&o(a=>{const d=new Map(c);for(const[u,h]of a)d.set(u,h);return d})}).catch(()=>{});const l=r.current;return()=>{for(const i of l)clearTimeout(i);l.clear()}},[]),p.useEffect(()=>{const l=(i,c)=>{o(a=>{const d=a.get(i);if(!d)return a;const u=new Map(a);return u.set(i,{...d,...c(d)}),u})};return e(i=>{if(i.type==="run-started"){const c=i.runId,a=i.startTime;o(d=>{const u=new Map(d);return u.set(c,{runId:c,command:i.command,startTime:a,framework:i.framework,cloudProvider:i.cloudProvider,source:i.source||"manual",plainCommand:i.plainCommand===!0,passed:0,failed:0,currentTest:0,currentTestName:"",elapsedMs:0,startMs:new Date(a).getTime()}),u})}if(i.type==="complete"){const c=i.runId,a=i.passed,d=i.failed,u=Date.now();l(c,m=>({passed:a??m.passed,failed:d??m.failed,exitCode:typeof i.exitCode=="number"?i.exitCode:m.exitCode,currentTestName:"Completed",endMs:m.endMs??u,elapsedMs:(m.endMs??u)-m.startMs}));const h=setTimeout(()=>{r.current.delete(h),o(m=>{if(!m.has(c))return m;const g=new Map(m);return g.delete(c),g})},8e3);r.current.add(h)}if(i.type==="error"&&i.runId){const c=i.runId;o(a=>{if(!a.has(c))return a;const d=new Map(a);return d.delete(c),d})}if(i.type==="test-passed"&&i.runId&&l(i.runId,c=>({passed:c.passed+1})),i.type==="test-failed"&&i.runId&&l(i.runId,c=>({failed:c.failed+1})),i.type==="test-results"&&i.runId){const c=i.summary;c&&l(i.runId,()=>({passed:c.passed,failed:c.failed}))}if(i.type==="test-progress"&&i.runId){const c=i.current,a=i.testName;l(i.runId,()=>({currentTest:c,currentTestName:a}))}})},[e]),p.useMemo(()=>{const l=Array.from(t.values());return{runs:l,hasActiveRuns:l.length>0,activeRunCount:l.length}},[t])}const ux={runs:[],hasActiveRuns:!1,activeRunCount:0},Mn=p.createContext(ux);function mx(){return p.useContext(Mn)}function px(e){const t=!!e&&e.endMs==null&&Number.isFinite(e.startMs),[,o]=p.useState(0);return p.useEffect(()=>{if(!t)return;const r=setInterval(()=>o(l=>l+1),1e3);return()=>clearInterval(r)},[t]),e?Number.isFinite(e.startMs)?Math.max(0,(e.endMs??Date.now())-e.startMs):e.elapsedMs:0}function hx({subscribe:e,children:t}){const o=dx(e);return s.jsx(Mn.Provider,{value:o,children:t})}function gx({run:e,format:t}){return s.jsx(s.Fragment,{children:t(px(e))})}const fx={browserstack:"BrowserStack",lambdatest:"LambdaTest",saucelabs:"Sauce Labs","testver-grid":"Testver Grid"},xx={browserstack:"text-orange-400",lambdatest:"text-purple-400",saucelabs:"text-red-400","testver-grid":"text-emerald-400"},bx={manual:"Manual",scheduler:"Scheduled",cli:"CLI"};function yx(e){const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const o=Math.floor(t/60),r=t%60;return`${o}m ${String(r).padStart(2,"0")}s`}function wx({runs:e}){const t=mx(),o=e??t.runs,[r,l]=p.useState(null),i=H();if(o.length===0)return null;const c=async(a,d)=>{d.stopPropagation();try{await js(a)}catch{}};return s.jsx("div",{className:"flex-shrink-0 border-b border-white/5",children:o.map(a=>{const d=r===a.runId,u=!!a.cloudProvider,h=a.plainCommand===!0,m=h?(a.exitCode??0)!==0:a.failed>0;return s.jsxs("div",{className:a.currentTestName==="Completed"?"bg-surface-1 border-l-2 border-emerald-500/50":"bg-surface-1",children:[s.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 cursor-pointer hover:bg-surface-2 transition-colors",onClick:()=>l(d?null:a.runId),children:[a.currentTestName==="Completed"?s.jsx(Ue,{size:14,className:m?"text-red-400 flex-shrink-0":"text-emerald-400 flex-shrink-0"}):s.jsxs("div",{className:"relative flex-shrink-0",children:[s.jsx("div",{className:"w-2 h-2 rounded-full bg-amber-400"}),s.jsx("div",{className:"absolute inset-0 w-2 h-2 rounded-full bg-amber-400 animate-ping"})]}),s.jsx("span",{className:`text-xs font-medium flex-shrink-0 ${a.currentTestName==="Completed"?m?"text-red-400":"text-emerald-400":"text-amber-400"}`,children:a.currentTestName==="Completed"?h&&m?`Failed (exit ${a.exitCode})`:"Completed":"Running"}),s.jsx("span",{className:"text-xs text-gray-400 truncate font-mono max-w-[300px]",children:a.command}),u&&a.cloudProvider&&s.jsxs("span",{className:`flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-blue-500/15 ${xx[a.cloudProvider]||"text-blue-400"}`,children:[s.jsx(yo,{size:8}),fx[a.cloudProvider]||a.cloudProvider]}),a.source!=="manual"&&s.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:[a.source==="scheduler"?s.jsx(lt,{size:8}):s.jsx(qt,{size:8}),bx[a.source]]}),s.jsx("div",{className:"flex-1"}),!h&&s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsxs("span",{className:"text-emerald-400 flex items-center gap-0.5",children:[s.jsx(Ue,{size:10})," ",a.passed]}),s.jsxs("span",{className:"text-red-400 flex items-center gap-0.5",children:[s.jsx(wo,{size:10})," ",a.failed]})]}),a.currentTestName!=="Completed"&&s.jsxs("span",{className:"text-[10px] text-gray-500 truncate max-w-[180px] flex items-center gap-1",children:[s.jsx(ve,{size:8,className:"animate-spin"}),a.currentTestName||"Executing..."]}),s.jsx("span",{className:"text-xs text-gray-500 flex-shrink-0 tabular-nums font-mono",children:s.jsx(gx,{run:a,format:yx})}),d?s.jsx(So,{size:14,className:"text-gray-500 flex-shrink-0"}):s.jsx(rt,{size:14,className:"text-gray-500 flex-shrink-0"})]}),d&&s.jsx("div",{className:"px-4 pb-3 pt-2 border-t border-white/5 bg-surface-2/50",children:s.jsxs("div",{className:"flex items-center gap-4 text-xs",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("span",{className:"text-gray-500 block mb-1",children:"Command"}),s.jsx("code",{className:"text-gray-300 font-mono text-[11px] bg-surface-3 px-2 py-1 rounded block truncate",children:a.command})]}),a.framework&&s.jsxs("div",{className:"flex-shrink-0",children:[s.jsx("span",{className:"text-gray-500 block mb-1",children:"Framework"}),s.jsx("span",{className:"text-gray-300",children:a.framework})]}),!h&&s.jsxs("div",{className:"flex-shrink-0",children:[s.jsx("span",{className:"text-gray-500 block mb-1",children:"Tests"}),s.jsxs("span",{className:"text-gray-300",children:["#",a.currentTest]})]}),s.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[s.jsxs("button",{onClick:g=>{g.stopPropagation(),i("/advanced?tab=runner")},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg bg-brand-500/15 text-brand-400 hover:bg-brand-500/25 text-[11px] transition-colors",children:[s.jsx(os,{size:10})," View in Runner"]}),s.jsxs("button",{onClick:g=>c(a.runId,g),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg bg-red-500/15 text-red-400 hover:bg-red-500/25 text-[11px] transition-colors",children:[s.jsx(vo,{size:10})," Cancel"]})]})]})})]},a.runId)})})}function _n({text:e="Loading..."}){return s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 animate-fade-in",children:[s.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-brand-500 border-t-transparent animate-spin mb-4"}),s.jsx("p",{className:"text-sm text-gray-400",children:e})]})}const Sx=3e3,vx=5*6e4;function jx({disconnectedSince:e,onRetry:t}){const[o,r]=p.useState(()=>Date.now()),[l,i]=p.useState(!1),c=p.useRef(!1);p.useEffect(()=>{if(e===null)return;r(Date.now());const h=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(h)},[e]);const a=e===null?0:o-e,d=e!==null&&a>=Sx;if(p.useEffect(()=>{if(d){c.current=!0,i(!1);return}if(e===null&&c.current){c.current=!1,i(!0);const h=setTimeout(()=>i(!1),3e3);return()=>clearTimeout(h)}},[d,e]),l)return s.jsxs("div",{className:"flex-shrink-0 flex items-center gap-2 px-4 py-1.5 text-xs border-b bg-emerald-500/10 border-emerald-500/30 text-emerald-700 dark:text-emerald-300",role:"status",children:[s.jsx(nt,{size:14,className:"shrink-0"}),"Reconnected to Testver."]});if(!d)return null;const u=a>=vx;return s.jsxs("div",{className:"flex-shrink-0 flex items-center gap-2 px-4 py-1.5 text-xs border-b bg-amber-500/10 border-amber-500/30 text-amber-700 dark:text-amber-300",role:"status",children:[s.jsx(ss,{size:14,className:"shrink-0"}),s.jsx("span",{className:"flex-1 min-w-0",children:u?s.jsxs(s.Fragment,{children:["Still can't reach the Testver server after ",Math.floor(a/6e4)," minutes. Check your network, or whether the server is running. If only your connection dropped, tasks you started (AI Assistant, test runs) keep running on the server — their results and file changes are there when you reconnect."]}):s.jsx(s.Fragment,{children:"Reconnecting to Testver… Check your Wi-Fi or network connection. Anything running carries on meanwhile, and this page catches up when it is back."})}),s.jsxs("button",{onClick:t,className:"inline-flex items-center gap-1 px-2 py-0.5 rounded border border-amber-500/40 hover:bg-amber-500/20 font-medium shrink-0",children:[s.jsx(ns,{size:12})," Retry now"]})]})}const Pt=[{id:"dashboard",label:"Dashboard",hint:"Overview & health",path:"/",icon:s.jsx(Gt,{size:16}),keywords:"home overview",primary:!0},{id:"tests",label:"Test Explorer",hint:"Browse discovered tests",path:"/tests",icon:s.jsx(Ye,{size:16}),keywords:"suites specs",primary:!0},{id:"code-map",label:"Code Map",hint:"Codebase structure X-ray",path:"/code-map",icon:s.jsx(zt,{size:16}),keywords:"graph quality methods steps"},{id:"test-data",label:"Test Data",hint:"Test data map",path:"/code-map?view=data",icon:s.jsx(jo,{size:16}),keywords:"data map fixtures datasets"},{id:"runner",label:"Runner",hint:"Execute tests",path:"/advanced?tab=runner",icon:s.jsx(rs,{size:16}),keywords:"run execute advanced",primary:!0},{id:"results",label:"Results",hint:"Run history & analytics",path:"/results",icon:s.jsx(Le,{size:16}),keywords:"runs executions reports",primary:!0},{id:"schedules",label:"Schedules",hint:"Cron-based recurring runs",path:"/advanced?tab=schedules",icon:s.jsx(lt,{size:16}),keywords:"cron recurring advanced"},{id:"pipelines",label:"CI/CD Pipelines",hint:"Gate builds on Testver-executed runs",path:"/pipelines",icon:s.jsx(To,{size:16}),keywords:"ci cd cicd pipeline gate trigger token trace deploy orchestration dashboard github actions gitlab jenkins azure"},{id:"test-cases",label:"Test Cases",hint:"Manage test cases",path:"/test-cases",icon:s.jsx(Qe,{size:16}),keywords:"tm management tc",primary:!0},{id:"test-plans",label:"Test Plans",hint:"Plans, cycles & executions",path:"/test-plans",icon:s.jsx(Ne,{size:16}),keywords:"tp cycles"},{id:"ai-test-gen",label:"AI Test Gen",hint:"Generate test cases with AI",path:"/ai-test-gen",icon:s.jsx(Wt,{size:16}),keywords:"generate ai"},{id:"sources",label:"Sources",hint:"Requirements & documents",path:"/sources",icon:s.jsx(Xe,{size:16}),keywords:"requirements jira documents"},{id:"script-mapping",label:"Script Mapping",hint:"Link cases to automation",path:"/script-mapping",icon:s.jsx(Ht,{size:16}),keywords:"traceability link"},{id:"coverage",label:"Coverage",hint:"Traceability & gaps",path:"/coverage",icon:s.jsx(Kt,{size:16}),keywords:"gaps orphans"},{id:"analytics",label:"Analytics",hint:"Test management analytics",path:"/analytics",icon:s.jsx(Le,{size:16}),keywords:"charts trends"},{id:"defects",label:"Defects",hint:"Bug tracker & Kanban",path:"/defects",icon:s.jsx(Ze,{size:16}),keywords:"bugs issues kanban"},{id:"import-export",label:"Import / Export",hint:"TestRail, Zephyr, CSV…",path:"/import-export",icon:s.jsx(is,{size:16}),keywords:"testrail zephyr xray qtest csv"},{id:"explorer",label:"Project Explorer",hint:"Browse project files",path:"/explorer",icon:s.jsx(Yt,{size:16}),keywords:"files editor",primary:!0},{id:"api-testing",label:"API Testing",hint:"Collections & requests",path:"/api-testing",icon:s.jsx(No,{size:16}),keywords:"rest postman endpoints"},{id:"ai",label:"AI Assistant",hint:"AI chat copilot",path:"/ai",icon:s.jsx(et,{size:16}),keywords:"chat copilot",primary:!0},{id:"ai-record",label:"AI Record",hint:"Record & generate tests",path:"/ai-record",icon:s.jsx(Vt,{size:16}),keywords:"recorder capture"},{id:"reports",label:"Reports",hint:"Saved dashboards",path:"/reports",icon:s.jsx(tt,{size:16}),keywords:"dashboards export"},{id:"git",label:"Git",hint:"Stage, commit, push",path:"/git",icon:s.jsx(ne,{size:16}),keywords:"commit branch push"},{id:"connectors",label:"Connectors",hint:"JIRA, Slack, grids…",path:"/settings?tab=connectors",icon:s.jsx(Je,{size:16}),keywords:"jira slack integrations browserstack"},{id:"settings",label:"Settings",hint:"Configure Testver",path:"/settings",icon:s.jsx(De,{size:16}),keywords:"config llm providers preferences",primary:!0},{id:"users",label:"Users",hint:"User management (admin)",path:"/users",icon:s.jsx(Me,{size:16}),keywords:"admin roles accounts"},{id:"audit",label:"Audit Log",hint:"Activity log (admin)",path:"/audit",icon:s.jsx(Qt,{size:16}),keywords:"admin history"},{id:"profile",label:"Profile",hint:"Your account & password",path:"/profile",icon:s.jsx(Me,{size:16}),keywords:"account password sessions"},{id:"about",label:"Testver: About",hint:"About this app",path:"/testver/about",icon:s.jsx(Xt,{size:16}),keywords:"version help"},{id:"testver-connections",label:"Testver: Connections",hint:"Connect to Testver and manage AI credits, Grid and Mail",path:"/testver",icon:s.jsx(Je,{size:16}),keywords:"connect account grid mail cloud credits services"}],Et={testcase:{label:"Test Cases",icon:s.jsx(Qe,{size:16})},test:{label:"Tests",icon:s.jsx(Ye,{size:16})},testplan:{label:"Test Plans",icon:s.jsx(Ne,{size:16})},defect:{label:"Defects",icon:s.jsx(Ze,{size:16})},source:{label:"Sources",icon:s.jsx(Xe,{size:16})},schedule:{label:"Schedules",icon:s.jsx(lt,{size:16})},connector:{label:"Connectors",icon:s.jsx(Je,{size:16})},file:{label:"Files",icon:s.jsx(tt,{size:16})}},Tx=["testcase","test","testplan","defect","source","schedule","connector","file"];function Rt(e,t){const o=e.toLowerCase(),r=t.toLowerCase();if(!o)return 0;const l=r.indexOf(o);if(l===0)return 1e3;if(l>0)return 600-l;let i=0,c=0,a=0;for(;i<r.length&&c<o.length;)r[i]===o[c]?c++:a++,i++;return c===o.length?120-Math.min(a,119):-1}function Nx({open:e,onClose:t}){const[o,r]=p.useState(""),[l,i]=p.useState([]),[c,a]=p.useState(!1),[d,u]=p.useState(0),h=p.useRef(null),m=H(),g=p.useCallback(O=>{m(O),t()},[m,t]),b=p.useMemo(()=>{const O=o.trim(),C=E=>({id:`nav-${E.id}`,label:E.label,description:E.hint,icon:E.icon,action:()=>g(E.path)});return O?Pt.map(E=>({n:E,score:Math.max(Rt(O,E.label),Rt(O,E.keywords||"")-200)})).filter(E=>E.score>-1).sort((E,T)=>T.score-E.score).slice(0,8).map(E=>C(E.n)):Pt.filter(E=>E.primary).map(C)},[o,g]);p.useEffect(()=>{if(!e)return;const O=o.trim();if(O.length<2){i([]),a(!1);return}const C=new AbortController;a(!0);const E=setTimeout(()=>{vs(O,C.signal).then(T=>{i(T.results),a(!1)}).catch(T=>{(T==null?void 0:T.name)!=="AbortError"&&(i([]),a(!1))})},200);return()=>{clearTimeout(E),C.abort()}},[o,e]);const N=p.useMemo(()=>{const O=[];b.length&&O.push({key:"nav",label:"Navigation",items:b});for(const C of Tx){const E=l.filter(T=>T.type===C);E.length&&O.push({key:C,label:Et[C].label,items:E.map(T=>({id:`${T.type}-${T.id}`,label:T.title,description:T.subtitle||"",icon:Et[T.type].icon,action:()=>g(T.route)}))})}return O},[b,l,g]),j=p.useMemo(()=>N.flatMap(O=>O.items),[N]);if(p.useEffect(()=>{u(0)},[j.length,o]),p.useEffect(()=>{var O;e&&((O=h.current)==null||O.focus(),r(""),i([]),a(!1))},[e]),p.useEffect(()=>{if(!e)return;const O=C=>{C.key==="Escape"&&t(),C.key==="ArrowDown"&&(C.preventDefault(),u(E=>Math.min(E+1,j.length-1))),C.key==="ArrowUp"&&(C.preventDefault(),u(E=>Math.max(E-1,0))),C.key==="Enter"&&j[d]&&j[d].action()};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[e,j,d,t]),!e)return null;const w=j.length>0;let R=-1;return s.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",children:[s.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:t}),s.jsxs("div",{className:"relative w-[560px] bg-surface-1 rounded-xl border border-white/10 overflow-hidden animate-fade-in",children:[s.jsxs("div",{className:"flex items-center px-4 border-b border-white/5",children:[s.jsx(ts,{size:18,className:"text-gray-400 flex-shrink-0"}),s.jsx("input",{ref:h,value:o,onChange:O=>r(O.target.value),placeholder:"Search pages, test cases, defects, files…",className:"flex-1 bg-transparent border-none outline-none px-3 py-3.5 text-sm text-gray-100 placeholder-gray-500"}),c&&s.jsx(ve,{size:15,className:"text-gray-500 animate-spin flex-shrink-0 mr-1"}),s.jsx("button",{onClick:t,className:"text-gray-500 hover:text-gray-300",children:s.jsx(st,{size:16})})]}),s.jsxs("div",{className:"max-h-80 overflow-y-auto py-1",children:[!w&&s.jsx("div",{className:"px-4 py-8 text-center text-sm text-gray-500",children:c?"Searching…":o.trim()?"No results found":"Type to search"}),N.map(O=>s.jsxs("div",{children:[s.jsx("div",{className:"px-4 pt-2 pb-1 text-[10px] font-semibold uppercase tracking-wider text-gray-500",children:O.label}),O.items.map(C=>{R+=1;const E=R;return s.jsxs("button",{className:`w-full flex items-center gap-3 px-4 py-2.5 text-left text-sm transition-colors ${E===d?"bg-brand-500/15 text-brand-200":"text-gray-300 hover:bg-white/5"}`,onMouseEnter:()=>u(E),onClick:C.action,children:[s.jsx("span",{className:"text-gray-400 flex-shrink-0",children:C.icon}),s.jsx("span",{className:"font-medium flex-1 truncate",children:C.label}),C.description&&s.jsx("span",{className:"text-xs text-gray-500 truncate max-w-[240px]",children:C.description})]},C.id)})]},O.key))]}),s.jsxs("div",{className:"px-4 py-2 border-t border-white/5 flex gap-3 text-[10px] text-gray-500",children:[s.jsxs("span",{children:[s.jsx("kbd",{className:"px-1 py-0.5 rounded bg-surface-2 font-mono",children:"↑↓"})," Navigate"]}),s.jsxs("span",{children:[s.jsx("kbd",{className:"px-1 py-0.5 rounded bg-surface-2 font-mono",children:"Enter"})," Select"]}),s.jsxs("span",{children:[s.jsx("kbd",{className:"px-1 py-0.5 rounded bg-surface-2 font-mono",children:"Esc"})," Close"]})]})]})]})}function kx({subscribe:e}){const[t,o]=p.useState(null),[r,l]=p.useState(""),[i,c]=p.useState(!1),[a,d]=p.useState(!1),[u,h]=p.useState(!1),[m,g]=p.useState(!1),b=p.useRef(null);if(p.useEffect(()=>e(f=>{if(f.type==="askpass-request"){const{requestId:y,prompt:x}=f;typeof y=="string"&&typeof x=="string"&&(o({requestId:y,prompt:x}),l(""),c(!1),g(!1))}if(f.type==="askpass-closed"){const{requestId:y}=f;o(x=>x&&x.requestId===y?null:x),l("")}}),[e]),p.useEffect(()=>{t&&setTimeout(()=>{var f;return(f=b.current)==null?void 0:f.focus()},0)},[t]),!t)return null;const N=async()=>{if(!r||u)return;h(!0);let f=!1;try{f=(await on(t.requestId,r,a)).ok}catch{}if(h(!1),l(""),!f){g(!0);return}o(null),a&&window.dispatchEvent(new CustomEvent("askpass-cache-changed"))},j=async()=>{if(!m)try{await an(t.requestId)}catch{}o(null),l(""),g(!1)},w=/^\s*user ?name\b/i.test(t.prompt),R=/\(yes\/no/i.test(t.prompt)||/continue connecting/i.test(t.prompt),O=!w&&!R,C=/passphrase/i.test(t.prompt),E=/password/i.test(t.prompt),T=w?"Git username":C?"SSH passphrase":E?"Git password":"Git credentials",k=w?"Username (e.g. your GitHub user)":C?"Passphrase":E?"Password or personal access token":R?"yes / no":"Value";return s.jsx("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center bg-black/60 backdrop-blur-sm",children:s.jsxs("div",{className:"bg-surface-1 dark:bg-surface-1 rounded-xl border border-white/10 shadow-2xl w-full max-w-md mx-4 overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-2 px-5 py-3 border-b border-white/5 bg-surface-2/50",children:[s.jsx(fe,{size:16,className:"text-amber-400"}),s.jsx("h3",{className:"text-base font-semibold text-gray-100 flex-1",children:T}),s.jsx("button",{onClick:j,className:"text-gray-500 hover:text-gray-300 transition-colors",title:"Cancel","aria-label":"Cancel",children:s.jsx(st,{size:16})})]}),s.jsxs("div",{className:"px-5 py-4 space-y-3",children:[m&&s.jsx("p",{role:"alert",className:"text-sm text-red-600 dark:text-red-400 leading-relaxed",children:"This request has expired — git stopped waiting for an answer. Close this and run the action again."}),s.jsx("p",{className:"text-sm text-gray-300 leading-relaxed",children:"Git is asking for credentials to complete the operation:"}),s.jsx("div",{className:"bg-orange-100 dark:bg-orange-500/15 border border-orange-600 dark:border-orange-500/60 rounded-lg px-3 py-2 text-sm font-mono text-orange-800 dark:text-orange-200 break-all",children:t.prompt}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{ref:b,type:O&&!i?"password":"text",value:r,onChange:f=>l(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),N()),f.key==="Escape"&&(f.preventDefault(),j())},placeholder:k,className:`w-full bg-surface-2 border border-white/10 rounded-lg px-3 py-2.5 text-sm text-gray-100 placeholder-gray-500 focus:outline-none focus:border-sky-500/50 font-mono ${O?"pr-9":""}`,autoComplete:"off",spellCheck:!1}),O&&s.jsx("button",{type:"button",tabIndex:-1,onClick:()=>c(f=>!f),"aria-label":i?"Hide":"Show",title:i?"Hide":"Show",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-200 focus:outline-none",children:i?s.jsx(cs,{size:16}):s.jsx(ls,{size:16})})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-300 cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:a,onChange:f=>d(f.target.checked),className:"rounded border-white/20 bg-surface-2 text-sky-500 focus:ring-sky-500 focus:ring-offset-0"}),"Remember for this session"]}),s.jsxs("p",{className:"text-xs text-gray-500 leading-relaxed",children:["Your input is sent only to the local git process. Remembered values live in memory only and are wiped when the server restarts or you click ",s.jsx("em",{children:"Clear saved credentials"}),"."]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-white/5 bg-surface-2/30",children:[s.jsx("button",{onClick:j,disabled:u,className:"px-3 py-1.5 rounded-lg text-sm text-gray-300 hover:bg-white/5 transition-colors",children:m?"Close":"Cancel"}),s.jsx("button",{onClick:N,disabled:!r||u||m,className:"px-4 py-1.5 rounded-lg text-sm font-medium bg-sky-600 hover:bg-sky-500 text-white disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:u?"Submitting…":"Submit"})]})]})})}const Un=p.createContext(e=>{e()});function Bb(){return p.useContext(Un)}const Jn="testver-run-warning-quiet",Bn=()=>new Date().toISOString().slice(0,10);function Cx(){try{return localStorage.getItem(Jn)===Bn()}catch{return!1}}function Ox({children:e}){const t=On(),{data:o}=ft(t),[r,l]=p.useState(null),i=p.useCallback((c,a)=>{const d=o==null?void 0:o.check;if(!(o!=null&&o.settings.warnBeforeRuns)||!d||!xt(d)||Cx()){c();return}l({run:c,files:(a==null?void 0:a.files)??[],check:d})},[o]);return s.jsxs(Un.Provider,{value:i,children:[e,r&&s.jsx(Px,{...r,onClose:()=>l(null)})]})}function Px({run:e,files:t,check:o,onClose:r}){const l=H(),{toast:i}=bt(),c=En(),[a,d]=p.useState(!1),u=Dn(o),h=()=>{if(a)try{localStorage.setItem(Jn,Bn())}catch{}r()},m=new Set(t.map(w=>w.replace(/\\/g,"/"))),g=w=>{const R=Ct(o,w)??w;return[...m].some(O=>O===R||O.endsWith(`/${R}`)||R.endsWith(`/${O}`))},b=[];for(const w of o.incoming)for(const R of w.files){if(b.length>=5)break;(m.size===0||g(R.path))&&b.push({path:Ct(o,R.path)??R.path,msg:w.message})}const N=m.size>0?o.incoming.filter(w=>w.files.some(R=>g(R.path))).length:0,j=o.verdict==="uncommitted_overlap"||o.verdict==="will_conflict";return Bt.createPortal(s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:r}),s.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"run-warning-title",className:"relative bg-surface-1 rounded-xl border border-white/10 p-6 w-[640px] max-w-[90vw] animate-fade-in",children:[s.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-full bg-amber-500/15 flex items-center justify-center flex-shrink-0 text-amber-500",children:s.jsx(ne,{size:20})}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("h3",{id:"run-warning-title",className:"text-base font-semibold text-gray-100",children:["Your code is ",q(o.behind,"commit")," behind ",u]}),s.jsxs("p",{className:"text-sm text-gray-400 mt-1",children:[o.upstream," has newer commits by ",Ln(o),"."," ",N>0?s.jsxs(s.Fragment,{children:[s.jsxs("b",{className:"text-gray-200",children:[q(N,"of them changes","of them change")," files these tests use"]}),", so this run may not test the latest code:"]}):s.jsx(s.Fragment,{children:"This run may not test the latest code. The newest changes:"})]}),b.length>0&&s.jsx("ul",{className:"mt-2 space-y-1 text-xs font-mono text-gray-300",children:b.map((w,R)=>s.jsxs("li",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(ko,{size:12,className:"text-amber-500 shrink-0"}),s.jsx("span",{className:"truncate",children:w.path}),s.jsxs("span",{className:"font-sans text-gray-500 truncate",children:["— “",w.msg,"”"]})]},R))}),j&&s.jsx("p",{className:"mt-2 text-xs text-amber-600 dark:text-amber-300",children:o.verdict==="uncommitted_overlap"?"Some of these change files you are editing — pull from the Git page with Stash, pull & re-apply.":"Pulling will need conflicts resolved — do it from the Git page."}),s.jsxs("label",{className:"mt-3 flex items-center gap-2 text-xs text-gray-500",children:[s.jsx("input",{type:"checkbox",checked:a,onChange:w=>d(w.target.checked),className:"rounded border-white/20"})," Don't warn me again today"]})]})]}),s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx("button",{onClick:h,className:"px-4 py-2 text-sm rounded-lg bg-surface-2 hover:bg-surface-3 text-gray-300",children:"Cancel"}),s.jsxs("button",{onClick:()=>{h(),e()},className:"px-4 py-2 text-sm rounded-lg bg-surface-2 hover:bg-surface-3 text-gray-300 border border-white/10 flex items-center gap-1.5",children:[s.jsx(rs,{size:13})," Run anyway"]}),j?s.jsxs("button",{onClick:()=>{h(),l("/git")},className:"px-4 py-2 text-sm rounded-lg bg-amber-600 hover:bg-amber-500 text-white font-medium flex items-center gap-1.5",children:["Open Git ",s.jsx(ot,{size:14})]}):s.jsxs("button",{disabled:c.isPending,onClick:()=>c.mutate(void 0,{onSuccess:w=>{var R;if(h(),w.conflicts&&((R=w.conflictedPaths)!=null&&R.length)){i("error","The pull stopped on conflicts — resolve them on the Git page, then run."),l("/git");return}i("success",`Pulled ${q(o.behind,"commit")} — starting the run`),e()},onError:w=>i("error",`Pull failed: ${w.message}`)}),className:"px-4 py-2 text-sm rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white font-medium flex items-center gap-1.5 disabled:opacity-50",children:[s.jsx(es,{size:14,className:c.isPending?"animate-pulse":""})," Pull, then run"]})]})]})]}),document.body)}function Ex(){return F({queryKey:["project"],queryFn:fs,staleTime:3e4})}const Rx=[{id:"scanning",label:"Scanning project files",detail:"Walking your project directory to discover tests, page objects, and configs.",Icon:Oo},{id:"detecting",label:"Detecting test frameworks",detail:"Looking for Playwright, WebdriverIO, Appium, Selenium, Cypress, pytest, JUnit, and more.",Icon:Po},{id:"discovering",label:"Discovering modules",detail:"Organizing files into modules — tests, fixtures, helpers, configs, and the rest.",Icon:as},{id:"ready",label:"Almost ready ✨",detail:"Just a moment while we get everything in place for you…",Icon:et}],Fn=[{id:"connecting",label:"Connecting to Testver",detail:"Establishing a secure session with the workspace.",Icon:ae},{id:"identity",label:"Verifying your identity",detail:"Checking your saved session token against the server.",Icon:fe},{id:"profile",label:"Loading your profile",detail:"Pulling your role, preferences, and recent activity.",Icon:Co}],$x=1500,Ax=250;function Gn({title:e="Getting your project ready",subtitle:t="Hang tight — we're loading everything Testver needs to help you write, run, and analyze tests.",phases:o=Rx,footerHint:r="Larger projects can take a few seconds — the first scan is the slow one; subsequent restarts are instant."}={}){const[l,i]=p.useState(0),[c,a]=p.useState(!1);return p.useEffect(()=>{const d=setTimeout(()=>a(!0),Ax);return()=>clearTimeout(d)},[]),p.useEffect(()=>{if(!c)return;const d=setInterval(()=>{i(u=>Math.min(u+1,o.length-1))},$x);return()=>clearInterval(d)},[c,o.length]),c?s.jsxs("div",{className:"h-screen flex items-center justify-center bg-surface-0 px-4",children:[s.jsxs("div",{className:"w-full max-w-lg",children:[s.jsxs("div",{className:"flex flex-col items-center mb-8",children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-0 bg-brand-500/20 blur-2xl rounded-full animate-pulse-soft"}),s.jsx(ie,{className:"relative w-16 h-16 object-contain animate-breathe"})]}),s.jsx("h1",{className:"mt-5 text-xl font-semibold text-gray-100",children:e}),s.jsx("p",{className:"mt-1.5 text-sm text-gray-500 text-center max-w-sm",children:t})]}),s.jsx("div",{className:"relative h-1.5 mb-7 rounded-full bg-surface-2 overflow-hidden",children:s.jsx("div",{className:"absolute inset-y-0 w-1/3 rounded-full bg-gradient-to-r from-transparent via-brand-500 to-transparent",style:{animation:"testverProgressSweep 1.6s ease-in-out infinite"}})}),s.jsx("div",{className:"relative h-[88px] mb-5",children:o.map((d,u)=>{const h=d.Icon,m=u===l,g=u<l;return s.jsxs("div",{className:`absolute inset-0 flex items-start gap-3 p-3.5 rounded-lg border bg-brand-500/10 border-brand-500/30 transition-all duration-500 ${m?"opacity-100 translate-y-0":g?"opacity-0 -translate-y-3 pointer-events-none":"opacity-0 translate-y-3 pointer-events-none"}`,"aria-hidden":!m,children:[s.jsx("div",{className:"mt-0.5 w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 bg-brand-500/20 text-brand-300 animate-pulse-soft",children:s.jsx(h,{size:16})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-brand-200",children:d.label}),s.jsx("p",{className:"text-[11px] text-gray-500 leading-snug mt-1",children:d.detail})]})]},d.id)})}),s.jsx("div",{className:"flex items-center justify-center gap-2 mb-2",children:o.map((d,u)=>{const h=u<=l;return s.jsx("span",{className:`rounded-full transition-all duration-500 ${h?u===l?"w-6 h-1.5 bg-brand-500":"w-1.5 h-1.5 bg-brand-500/70":"w-1.5 h-1.5 bg-white/10"}`},u)})}),r&&l===o.length-1&&s.jsx("p",{className:"mt-4 text-center text-[11px] text-gray-500",children:r})]}),s.jsx("style",{children:`
19
+ @keyframes testverProgressSweep {
20
+ 0% { transform: translateX(-100%); }
21
+ 100% { transform: translateX(400%); }
22
+ }
23
+ `})]}):s.jsx("div",{className:"h-screen bg-surface-0"})}const Ke="testver.clientId",$t="testver.previousClientIds";function Ix(){try{return sessionStorage.getItem(Ke)}catch{return null}}function Lx(e){try{const t=sessionStorage.getItem(Ke);if(t&&t!==e){const o=JSON.parse(sessionStorage.getItem($t)||"[]");sessionStorage.setItem($t,JSON.stringify([t,...o.filter(r=>r!==t)].slice(0,5)))}sessionStorage.setItem(Ke,e)}catch{}}const At=[1e3,2e3,5e3,1e4];function Dx(){const e=p.useRef(null),t=p.useRef(new Set),[o,r]=p.useState(!1),[l,i]=p.useState(null),c=p.useRef(null),a=p.useRef(0),d=p.useRef(!1),u=p.useRef(null),h=p.useCallback(()=>{if(d.current)return;c.current&&(clearTimeout(c.current),c.current=null);const N=window.location.protocol==="https:"?"wss:":"ws:",j=G(),w=new URLSearchParams;j&&w.set("token",j);const R=Ix();R&&(w.set("resume",R),u.current!==null&&w.set("after",String(u.current)));const O=w.toString()?`?${w.toString()}`:"",C=new WebSocket(`${N}//${window.location.host}/ws${O}`);C.onopen=()=>{e.current===C&&(a.current=0,r(!0),i(null))},C.onclose=E=>{if(e.current!==C)return;if(r(!1),i(k=>k??Date.now()),ze(null),E.code===4001){Pe(),window.location.href="/login";return}if(d.current)return;const T=At[Math.min(a.current,At.length-1)];a.current++,c.current=setTimeout(h,T)},C.onerror=()=>C.close(),C.onmessage=E=>{try{const T=JSON.parse(E.data),k=T.__seq;if(typeof k=="number"){if(u.current!==null&&k<=u.current)return;u.current=k}T.type==="client-id"&&T.clientId&&(T.resumed||(u.current=null),ze(T.clientId),Lx(T.clientId));for(const f of t.current)try{f(T)}catch(y){console.error("[ws] message handler failed:",y)}}catch{}},e.current=C},[]),m=p.useCallback(()=>{const N=e.current;N&&(N.readyState===WebSocket.OPEN||N.readyState===WebSocket.CONNECTING)||(a.current=0,h())},[h]);p.useEffect(()=>{d.current=!1,h();const N=()=>m(),j=()=>{document.visibilityState==="visible"&&m()};return window.addEventListener("online",N),document.addEventListener("visibilitychange",j),()=>{d.current=!0,window.removeEventListener("online",N),document.removeEventListener("visibilitychange",j),c.current&&clearTimeout(c.current);const w=e.current;e.current=null,w==null||w.close()}},[h,m]);const g=p.useCallback(N=>(t.current.add(N),()=>{t.current.delete(N)}),[]),b=p.useCallback(N=>{var j;((j=e.current)==null?void 0:j.readyState)===WebSocket.OPEN&&e.current.send(JSON.stringify(N))},[]);return{connected:o,subscribe:g,send:b,disconnectedSince:l,reconnectNow:m}}const It={"/":"Dashboard","/explorer":"Project Explorer","/advanced":"Advanced","/tests":"Test Explorer","/test-cases":"Test Cases","/test-plans":"Test Plans","/script-mapping":"Script Mapping","/ai-test-gen":"AI Test Generation","/sources":"Sources","/coverage":"Coverage","/analytics":"Analytics","/defects":"Defects","/import-export":"Import / Export","/connectors":"Connectors","/results":"Results","/output":"Output","/api-testing":"API Testing","/git":"Git","/ai":"AI Assistant","/skills":"Skills & MCPs","/workflows":"Workflows","/settings":"Settings","/profile":"Profile","/users":"User Management","/audit":"Audit Log","/login":"Login","/setup":"Setup"};function Mx(){const{pathname:e}=Ft();p.useEffect(()=>{let t=It[e];if(!t){const o="/"+e.split("/").filter(Boolean)[0];t=It[o]}!t&&e.startsWith("/module")&&(t="Module Explorer"),document.title=t?`${t} - Testver`:"Testver"},[e])}const _x=p.memo(ix),Ux=p.memo(Qf),Jx=2e3;function Bx(){const{data:e,isLoading:t}=Ex(),{connected:o,subscribe:r,send:l,disconnectedSince:i,reconnectNow:c}=Dx(),a="testver-sidebar-collapsed",[d,u]=p.useState(()=>{try{return localStorage.getItem(a)==="1"}catch{return!1}});p.useEffect(()=>{try{localStorage.setItem(a,d?"1":"0")}catch{}},[d]);const[h,m]=p.useState(!1),g=de(),{toast:b}=bt();Mx(),p.useEffect(()=>{const T=k=>{if((k.ctrlKey||k.metaKey)&&k.key==="k")k.preventDefault(),m(f=>!f);else if((k.ctrlKey||k.metaKey)&&(k.key==="b"||k.key==="B")){const f=k.target,y=f==null?void 0:f.tagName;if(y==="INPUT"||y==="TEXTAREA"||f!=null&&f.isContentEditable)return;k.preventDefault(),u(x=>!x)}};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[]);const N=p.useRef(new Set),j=p.useRef(null),w=p.useCallback(T=>{const k=y=>{for(const x of y)g.invalidateQueries({queryKey:[x]})};if(j.current){for(const y of T)N.current.add(y);return}k(T);const f=()=>{j.current=setTimeout(()=>{if(N.current.size===0){j.current=null;return}const y=[...N.current];N.current.clear(),k(y),f()},Jx)};f()},[g]);p.useEffect(()=>()=>{j.current&&clearTimeout(j.current)},[]),p.useEffect(()=>r(T=>{if(T.type==="modules-updated"&&w(["project","fileTree","moduleFiles","test-explorer"]),T.type==="test-results"&&w(["test-trends","top-failures","flaky-tests","slowest-tests","result-runs","result-run","test-explorer","runHistory"]),T.type==="healing-event"&&(g.invalidateQueries({queryKey:["healing-events"]}),g.invalidateQueries({queryKey:["healing-analytics"]}),g.invalidateQueries({queryKey:["healing-stats"]}),g.invalidateQueries({queryKey:["healing-fingerprints"]})),T.type==="schedule-skipped"){const k=T.scheduleName||"Scheduled run";b("info",`${k} skipped — its previous run is still in progress.`)}}),[r,g,b,w]);const R=p.useCallback(async()=>{await xs(),g.invalidateQueries({queryKey:["project"]})},[g]),O=p.useCallback(()=>m(!0),[]),C=p.useCallback(()=>u(T=>!T),[]),E=p.useMemo(()=>({project:e,connected:o,subscribe:r,send:l}),[e,o,r,l]);return t||!e?s.jsx(Gn,{title:"Welcome back to Testver",subtitle:"One moment — loading your workspace and recent activity.",phases:Fn,footerHint:void 0}):s.jsx(hx,{subscribe:r,children:s.jsxs("div",{className:"h-screen flex flex-col overflow-hidden bg-surface-0",children:[s.jsx(_x,{framework:e.framework||"",language:e.language,rootPath:e.rootPath,connected:o,onRescan:R,onSearchOpen:O,sidebarCollapsed:d,onToggleSidebar:C}),s.jsx(jx,{disconnectedSince:i,onRetry:c}),s.jsx(wx,{}),s.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[s.jsx(Ux,{modules:e.modules,collapsed:d}),s.jsx("main",{className:"flex-1 overflow-y-auto",children:s.jsx(Ox,{children:s.jsx(p.Suspense,{fallback:s.jsx(_n,{}),children:s.jsx(Kn,{context:E})})})})]}),s.jsx(Nx,{open:h,onClose:()=>m(!1),modules:e.modules}),s.jsx(kx,{subscribe:r})]})})}const le=p.forwardRef(function({className:t="",wrapperClassName:o="",...r},l){const[i,c]=p.useState(!1);return s.jsxs("div",{className:`relative ${o}`,children:[s.jsx("input",{...r,ref:l,type:i?"text":"password",className:`${t} pr-9`}),s.jsx("button",{type:"button",tabIndex:-1,onClick:()=>c(a=>!a),"aria-label":i?"Hide password":"Show password",title:i?"Hide":"Show",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 focus:outline-none",children:i?s.jsx(cs,{size:16}):s.jsx(ls,{size:16})})]})}),ue=function(e,t){let l=e;const i=he[t];let c=null,a=0,d=null;const u=[],h={},m=function(f,y){a=l*4+17,c=(function(x){const v=new Array(x);for(let S=0;S<x;S+=1){v[S]=new Array(x);for(let P=0;P<x;P+=1)v[S][P]=null}return v})(a),g(0,0),g(a-7,0),g(0,a-7),j(),N(),R(f,y),l>=7&&w(f),d==null&&(d=E(l,i,u)),O(d,y)},g=function(f,y){for(let x=-1;x<=7;x+=1)if(!(f+x<=-1||a<=f+x))for(let v=-1;v<=7;v+=1)y+v<=-1||a<=y+v||(0<=x&&x<=6&&(v==0||v==6)||0<=v&&v<=6&&(x==0||x==6)||2<=x&&x<=4&&2<=v&&v<=4?c[f+x][y+v]=!0:c[f+x][y+v]=!1)},b=function(){let f=0,y=0;for(let x=0;x<8;x+=1){m(!0,x);const v=Z.getLostPoint(h);(x==0||f>v)&&(f=v,y=x)}return y},N=function(){for(let f=8;f<a-8;f+=1)c[f][6]==null&&(c[f][6]=f%2==0);for(let f=8;f<a-8;f+=1)c[6][f]==null&&(c[6][f]=f%2==0)},j=function(){const f=Z.getPatternPosition(l);for(let y=0;y<f.length;y+=1)for(let x=0;x<f.length;x+=1){const v=f[y],S=f[x];if(c[v][S]==null)for(let P=-2;P<=2;P+=1)for(let $=-2;$<=2;$+=1)P==-2||P==2||$==-2||$==2||P==0&&$==0?c[v+P][S+$]=!0:c[v+P][S+$]=!1}},w=function(f){const y=Z.getBCHTypeNumber(l);for(let x=0;x<18;x+=1){const v=!f&&(y>>x&1)==1;c[Math.floor(x/3)][x%3+a-8-3]=v}for(let x=0;x<18;x+=1){const v=!f&&(y>>x&1)==1;c[x%3+a-8-3][Math.floor(x/3)]=v}},R=function(f,y){const x=i<<3|y,v=Z.getBCHTypeInfo(x);for(let S=0;S<15;S+=1){const P=!f&&(v>>S&1)==1;S<6?c[S][8]=P:S<8?c[S+1][8]=P:c[a-15+S][8]=P}for(let S=0;S<15;S+=1){const P=!f&&(v>>S&1)==1;S<8?c[8][a-S-1]=P:S<9?c[8][15-S-1+1]=P:c[8][15-S-1]=P}c[a-8][8]=!f},O=function(f,y){let x=-1,v=a-1,S=7,P=0;const $=Z.getMaskFunction(y);for(let D=a-1;D>0;D-=2)for(D==6&&(D-=1);;){for(let M=0;M<2;M+=1)if(c[v][D-M]==null){let J=!1;P<f.length&&(J=(f[P]>>>S&1)==1),$(v,D-M)&&(J=!J),c[v][D-M]=J,S-=1,S==-1&&(P+=1,S=7)}if(v+=x,v<0||a<=v){v-=x,x=-x;break}}},C=function(f,y){let x=0,v=0,S=0;const P=new Array(y.length),$=new Array(y.length);for(let A=0;A<y.length;A+=1){const _=y[A].dataCount,W=y[A].totalCount-_;v=Math.max(v,_),S=Math.max(S,W),P[A]=new Array(_);for(let K=0;K<P[A].length;K+=1)P[A][K]=255&f.getBuffer()[K+x];x+=_;const $e=Z.getErrorCorrectPolynomial(W),yt=ge(P[A],$e.getLength()-1).mod($e);$[A]=new Array($e.getLength()-1);for(let K=0;K<$[A].length;K+=1){const wt=K+yt.getLength()-$[A].length;$[A][K]=wt>=0?yt.getAt(wt):0}}let D=0;for(let A=0;A<y.length;A+=1)D+=y[A].totalCount;const M=new Array(D);let J=0;for(let A=0;A<v;A+=1)for(let _=0;_<y.length;_+=1)A<P[_].length&&(M[J]=P[_][A],J+=1);for(let A=0;A<S;A+=1)for(let _=0;_<y.length;_+=1)A<$[_].length&&(M[J]=$[_][A],J+=1);return M},E=function(f,y,x){const v=Lt.getRSBlocks(f,y),S=Dt();for(let $=0;$<x.length;$+=1){const D=x[$];S.put(D.getMode(),4),S.put(D.getLength(),Z.getLengthInBits(D.getMode(),f)),D.write(S)}let P=0;for(let $=0;$<v.length;$+=1)P+=v[$].dataCount;if(S.getLengthInBits()>P*8)throw"code length overflow. ("+S.getLengthInBits()+">"+P*8+")";for(S.getLengthInBits()+4<=P*8&&S.put(0,4);S.getLengthInBits()%8!=0;)S.putBit(!1);for(;!(S.getLengthInBits()>=P*8||(S.put(236,8),S.getLengthInBits()>=P*8));)S.put(17,8);return C(S,v)};h.addData=function(f,y){y=y||"Byte";let x=null;switch(y){case"Numeric":x=Fx(f);break;case"Alphanumeric":x=Gx(f);break;case"Byte":x=zx(f);break;case"Kanji":x=qx(f);break;default:throw"mode:"+y}u.push(x),d=null},h.isDark=function(f,y){if(f<0||a<=f||y<0||a<=y)throw f+","+y;return c[f][y]},h.getModuleCount=function(){return a},h.make=function(){if(l<1){let f=1;for(;f<40;f++){const y=Lt.getRSBlocks(f,i),x=Dt();for(let S=0;S<u.length;S++){const P=u[S];x.put(P.getMode(),4),x.put(P.getLength(),Z.getLengthInBits(P.getMode(),f)),P.write(x)}let v=0;for(let S=0;S<y.length;S++)v+=y[S].dataCount;if(x.getLengthInBits()<=v*8)break}l=f}m(!1,b())},h.createTableTag=function(f,y){f=f||2,y=typeof y>"u"?f*4:y;let x="";x+='<table style="',x+=" border-width: 0px; border-style: none;",x+=" border-collapse: collapse;",x+=" padding: 0px; margin: "+y+"px;",x+='">',x+="<tbody>";for(let v=0;v<h.getModuleCount();v+=1){x+="<tr>";for(let S=0;S<h.getModuleCount();S+=1)x+='<td style="',x+=" border-width: 0px; border-style: none;",x+=" border-collapse: collapse;",x+=" padding: 0px; margin: 0px;",x+=" width: "+f+"px;",x+=" height: "+f+"px;",x+=" background-color: ",x+=h.isDark(v,S)?"#000000":"#ffffff",x+=";",x+='"/>';x+="</tr>"}return x+="</tbody>",x+="</table>",x},h.createSvgTag=function(f,y,x,v){let S={};typeof arguments[0]=="object"&&(S=arguments[0],f=S.cellSize,y=S.margin,x=S.alt,v=S.title),f=f||2,y=typeof y>"u"?f*4:y,x=typeof x=="string"?{text:x}:x||{},x.text=x.text||null,x.id=x.text?x.id||"qrcode-description":null,v=typeof v=="string"?{text:v}:v||{},v.text=v.text||null,v.id=v.text?v.id||"qrcode-title":null;const P=h.getModuleCount()*f+y*2;let $,D,M,J,A="",_;for(_="l"+f+",0 0,"+f+" -"+f+",0 0,-"+f+"z ",A+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',A+=S.scalable?"":' width="'+P+'px" height="'+P+'px"',A+=' viewBox="0 0 '+P+" "+P+'" ',A+=' preserveAspectRatio="xMinYMin meet"',A+=v.text||x.text?' role="img" aria-labelledby="'+T([v.id,x.id].join(" ").trim())+'"':"",A+=">",A+=v.text?'<title id="'+T(v.id)+'">'+T(v.text)+"</title>":"",A+=x.text?'<description id="'+T(x.id)+'">'+T(x.text)+"</description>":"",A+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',A+='<path d="',M=0;M<h.getModuleCount();M+=1)for(J=M*f+y,$=0;$<h.getModuleCount();$+=1)h.isDark(M,$)&&(D=$*f+y,A+="M"+D+","+J+_);return A+='" stroke="transparent" fill="black"/>',A+="</svg>",A},h.createDataURL=function(f,y){f=f||2,y=typeof y>"u"?f*4:y;const x=h.getModuleCount()*f+y*2,v=y,S=x-y;return Vx(x,x,function(P,$){if(v<=P&&P<S&&v<=$&&$<S){const D=Math.floor((P-v)/f),M=Math.floor(($-v)/f);return h.isDark(M,D)?0:1}else return 1})},h.createImgTag=function(f,y,x){f=f||2,y=typeof y>"u"?f*4:y;const v=h.getModuleCount()*f+y*2;let S="";return S+="<img",S+=' src="',S+=h.createDataURL(f,y),S+='"',S+=' width="',S+=v,S+='"',S+=' height="',S+=v,S+='"',x&&(S+=' alt="',S+=T(x),S+='"'),S+="/>",S};const T=function(f){let y="";for(let x=0;x<f.length;x+=1){const v=f.charAt(x);switch(v){case"<":y+="&lt;";break;case">":y+="&gt;";break;case"&":y+="&amp;";break;case'"':y+="&quot;";break;default:y+=v;break}}return y},k=function(f){f=typeof f>"u"?2:f;const x=h.getModuleCount()*1+f*2,v=f,S=x-f;let P,$,D,M,J;const A={"██":"█","█ ":"▀"," █":"▄"," ":" "},_={"██":"▀","█ ":"▀"," █":" "," ":" "};let W="";for(P=0;P<x;P+=2){for(D=Math.floor((P-v)/1),M=Math.floor((P+1-v)/1),$=0;$<x;$+=1)J="█",v<=$&&$<S&&v<=P&&P<S&&h.isDark(D,Math.floor(($-v)/1))&&(J=" "),v<=$&&$<S&&v<=P+1&&P+1<S&&h.isDark(M,Math.floor(($-v)/1))?J+=" ":J+="█",W+=f<1&&P+1>=S?_[J]:A[J];W+=`
24
+ `}return x%2&&f>0?W.substring(0,W.length-x-1)+Array(x+1).join("▀"):W.substring(0,W.length-1)};return h.createASCII=function(f,y){if(f=f||1,f<2)return k(y);f-=1,y=typeof y>"u"?f*2:y;const x=h.getModuleCount()*f+y*2,v=y,S=x-y;let P,$,D,M;const J=Array(f+1).join("██"),A=Array(f+1).join(" ");let _="",W="";for(P=0;P<x;P+=1){for(D=Math.floor((P-v)/f),W="",$=0;$<x;$+=1)M=1,v<=$&&$<S&&v<=P&&P<S&&h.isDark(D,Math.floor(($-v)/f))&&(M=0),W+=M?J:A;for(D=0;D<f;D+=1)_+=W+`
25
+ `}return _.substring(0,_.length-1)},h.renderTo2dContext=function(f,y){y=y||2;const x=h.getModuleCount();for(let v=0;v<x;v++)for(let S=0;S<x;S++)f.fillStyle=h.isDark(v,S)?"black":"white",f.fillRect(S*y,v*y,y,y)},h};ue.stringToBytes=function(e){const t=[];for(let o=0;o<e.length;o+=1){const r=e.charCodeAt(o);t.push(r&255)}return t};ue.createStringToBytes=function(e,t){const o=(function(){const l=Hx(e),i=function(){const d=l.read();if(d==-1)throw"eof";return d};let c=0;const a={};for(;;){const d=l.read();if(d==-1)break;const u=i(),h=i(),m=i(),g=String.fromCharCode(d<<8|u),b=h<<8|m;a[g]=b,c+=1}if(c!=t)throw c+" != "+t;return a})(),r=63;return function(l){const i=[];for(let c=0;c<l.length;c+=1){const a=l.charCodeAt(c);if(a<128)i.push(a);else{const d=o[l.charAt(c)];typeof d=="number"?(d&255)==d?i.push(d):(i.push(d>>>8),i.push(d&255)):i.push(r)}}return i}};const z={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},he={L:1,M:0,Q:3,H:2},X={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Z=(function(){const e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,o=7973,r=21522,l={},i=function(c){let a=0;for(;c!=0;)a+=1,c>>>=1;return a};return l.getBCHTypeInfo=function(c){let a=c<<10;for(;i(a)-i(t)>=0;)a^=t<<i(a)-i(t);return(c<<10|a)^r},l.getBCHTypeNumber=function(c){let a=c<<12;for(;i(a)-i(o)>=0;)a^=o<<i(a)-i(o);return c<<12|a},l.getPatternPosition=function(c){return e[c-1]},l.getMaskFunction=function(c){switch(c){case X.PATTERN000:return function(a,d){return(a+d)%2==0};case X.PATTERN001:return function(a,d){return a%2==0};case X.PATTERN010:return function(a,d){return d%3==0};case X.PATTERN011:return function(a,d){return(a+d)%3==0};case X.PATTERN100:return function(a,d){return(Math.floor(a/2)+Math.floor(d/3))%2==0};case X.PATTERN101:return function(a,d){return a*d%2+a*d%3==0};case X.PATTERN110:return function(a,d){return(a*d%2+a*d%3)%2==0};case X.PATTERN111:return function(a,d){return(a*d%3+(a+d)%2)%2==0};default:throw"bad maskPattern:"+c}},l.getErrorCorrectPolynomial=function(c){let a=ge([1],0);for(let d=0;d<c;d+=1)a=a.multiply(ge([1,ee.gexp(d)],0));return a},l.getLengthInBits=function(c,a){if(1<=a&&a<10)switch(c){case z.MODE_NUMBER:return 10;case z.MODE_ALPHA_NUM:return 9;case z.MODE_8BIT_BYTE:return 8;case z.MODE_KANJI:return 8;default:throw"mode:"+c}else if(a<27)switch(c){case z.MODE_NUMBER:return 12;case z.MODE_ALPHA_NUM:return 11;case z.MODE_8BIT_BYTE:return 16;case z.MODE_KANJI:return 10;default:throw"mode:"+c}else if(a<41)switch(c){case z.MODE_NUMBER:return 14;case z.MODE_ALPHA_NUM:return 13;case z.MODE_8BIT_BYTE:return 16;case z.MODE_KANJI:return 12;default:throw"mode:"+c}else throw"type:"+a},l.getLostPoint=function(c){const a=c.getModuleCount();let d=0;for(let m=0;m<a;m+=1)for(let g=0;g<a;g+=1){let b=0;const N=c.isDark(m,g);for(let j=-1;j<=1;j+=1)if(!(m+j<0||a<=m+j))for(let w=-1;w<=1;w+=1)g+w<0||a<=g+w||j==0&&w==0||N==c.isDark(m+j,g+w)&&(b+=1);b>5&&(d+=3+b-5)}for(let m=0;m<a-1;m+=1)for(let g=0;g<a-1;g+=1){let b=0;c.isDark(m,g)&&(b+=1),c.isDark(m+1,g)&&(b+=1),c.isDark(m,g+1)&&(b+=1),c.isDark(m+1,g+1)&&(b+=1),(b==0||b==4)&&(d+=3)}for(let m=0;m<a;m+=1)for(let g=0;g<a-6;g+=1)c.isDark(m,g)&&!c.isDark(m,g+1)&&c.isDark(m,g+2)&&c.isDark(m,g+3)&&c.isDark(m,g+4)&&!c.isDark(m,g+5)&&c.isDark(m,g+6)&&(d+=40);for(let m=0;m<a;m+=1)for(let g=0;g<a-6;g+=1)c.isDark(g,m)&&!c.isDark(g+1,m)&&c.isDark(g+2,m)&&c.isDark(g+3,m)&&c.isDark(g+4,m)&&!c.isDark(g+5,m)&&c.isDark(g+6,m)&&(d+=40);let u=0;for(let m=0;m<a;m+=1)for(let g=0;g<a;g+=1)c.isDark(g,m)&&(u+=1);const h=Math.abs(100*u/a/a-50)/5;return d+=h*10,d},l})(),ee=(function(){const e=new Array(256),t=new Array(256);for(let r=0;r<8;r+=1)e[r]=1<<r;for(let r=8;r<256;r+=1)e[r]=e[r-4]^e[r-5]^e[r-6]^e[r-8];for(let r=0;r<255;r+=1)t[e[r]]=r;const o={};return o.glog=function(r){if(r<1)throw"glog("+r+")";return t[r]},o.gexp=function(r){for(;r<0;)r+=255;for(;r>=256;)r-=255;return e[r]},o})(),ge=function(e,t){if(typeof e.length>"u")throw e.length+"/"+t;const o=(function(){let l=0;for(;l<e.length&&e[l]==0;)l+=1;const i=new Array(e.length-l+t);for(let c=0;c<e.length-l;c+=1)i[c]=e[c+l];return i})(),r={};return r.getAt=function(l){return o[l]},r.getLength=function(){return o.length},r.multiply=function(l){const i=new Array(r.getLength()+l.getLength()-1);for(let c=0;c<r.getLength();c+=1)for(let a=0;a<l.getLength();a+=1)i[c+a]^=ee.gexp(ee.glog(r.getAt(c))+ee.glog(l.getAt(a)));return ge(i,0)},r.mod=function(l){if(r.getLength()-l.getLength()<0)return r;const i=ee.glog(r.getAt(0))-ee.glog(l.getAt(0)),c=new Array(r.getLength());for(let a=0;a<r.getLength();a+=1)c[a]=r.getAt(a);for(let a=0;a<l.getLength();a+=1)c[a]^=ee.gexp(ee.glog(l.getAt(a))+i);return ge(c,0).mod(l)},r},Lt=(function(){const e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(l,i){const c={};return c.totalCount=l,c.dataCount=i,c},o={},r=function(l,i){switch(i){case he.L:return e[(l-1)*4+0];case he.M:return e[(l-1)*4+1];case he.Q:return e[(l-1)*4+2];case he.H:return e[(l-1)*4+3];default:return}};return o.getRSBlocks=function(l,i){const c=r(l,i);if(typeof c>"u")throw"bad rs block @ typeNumber:"+l+"/errorCorrectionLevel:"+i;const a=c.length/3,d=[];for(let u=0;u<a;u+=1){const h=c[u*3+0],m=c[u*3+1],g=c[u*3+2];for(let b=0;b<h;b+=1)d.push(t(m,g))}return d},o})(),Dt=function(){const e=[];let t=0;const o={};return o.getBuffer=function(){return e},o.getAt=function(r){const l=Math.floor(r/8);return(e[l]>>>7-r%8&1)==1},o.put=function(r,l){for(let i=0;i<l;i+=1)o.putBit((r>>>l-i-1&1)==1)},o.getLengthInBits=function(){return t},o.putBit=function(r){const l=Math.floor(t/8);e.length<=l&&e.push(0),r&&(e[l]|=128>>>t%8),t+=1},o},Fx=function(e){const t=z.MODE_NUMBER,o=e,r={};r.getMode=function(){return t},r.getLength=function(c){return o.length},r.write=function(c){const a=o;let d=0;for(;d+2<a.length;)c.put(l(a.substring(d,d+3)),10),d+=3;d<a.length&&(a.length-d==1?c.put(l(a.substring(d,d+1)),4):a.length-d==2&&c.put(l(a.substring(d,d+2)),7))};const l=function(c){let a=0;for(let d=0;d<c.length;d+=1)a=a*10+i(c.charAt(d));return a},i=function(c){if("0"<=c&&c<="9")return c.charCodeAt(0)-48;throw"illegal char :"+c};return r},Gx=function(e){const t=z.MODE_ALPHA_NUM,o=e,r={};r.getMode=function(){return t},r.getLength=function(i){return o.length},r.write=function(i){const c=o;let a=0;for(;a+1<c.length;)i.put(l(c.charAt(a))*45+l(c.charAt(a+1)),11),a+=2;a<c.length&&i.put(l(c.charAt(a)),6)};const l=function(i){if("0"<=i&&i<="9")return i.charCodeAt(0)-48;if("A"<=i&&i<="Z")return i.charCodeAt(0)-65+10;switch(i){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+i}};return r},zx=function(e){const t=z.MODE_8BIT_BYTE,o=ue.stringToBytes(e),r={};return r.getMode=function(){return t},r.getLength=function(l){return o.length},r.write=function(l){for(let i=0;i<o.length;i+=1)l.put(o[i],8)},r},qx=function(e){const t=z.MODE_KANJI,o=ue.stringToBytes;(function(i,c){const a=o(i);if(a.length!=2||(a[0]<<8|a[1])!=c)throw"sjis not supported."})("友",38726);const r=o(e),l={};return l.getMode=function(){return t},l.getLength=function(i){return~~(r.length/2)},l.write=function(i){const c=r;let a=0;for(;a+1<c.length;){let d=(255&c[a])<<8|255&c[a+1];if(33088<=d&&d<=40956)d-=33088;else if(57408<=d&&d<=60351)d-=49472;else throw"illegal char at "+(a+1)+"/"+d;d=(d>>>8&255)*192+(d&255),i.put(d,13),a+=2}if(a<c.length)throw"illegal char at "+(a+1)},l},zn=function(){const e=[],t={};return t.writeByte=function(o){e.push(o&255)},t.writeShort=function(o){t.writeByte(o),t.writeByte(o>>>8)},t.writeBytes=function(o,r,l){r=r||0,l=l||o.length;for(let i=0;i<l;i+=1)t.writeByte(o[i+r])},t.writeString=function(o){for(let r=0;r<o.length;r+=1)t.writeByte(o.charCodeAt(r))},t.toByteArray=function(){return e},t.toString=function(){let o="";o+="[";for(let r=0;r<e.length;r+=1)r>0&&(o+=","),o+=e[r];return o+="]",o},t},Wx=function(){let e=0,t=0,o=0,r="";const l={},i=function(a){r+=String.fromCharCode(c(a&63))},c=function(a){if(a<0)throw"n:"+a;if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47;throw"n:"+a};return l.writeByte=function(a){for(e=e<<8|a&255,t+=8,o+=1;t>=6;)i(e>>>t-6),t-=6},l.flush=function(){if(t>0&&(i(e<<6-t),e=0,t=0),o%3!=0){const a=3-o%3;for(let d=0;d<a;d+=1)r+="="}},l.toString=function(){return r},l},Hx=function(e){const t=e;let o=0,r=0,l=0;const i={};i.read=function(){for(;l<8;){if(o>=t.length){if(l==0)return-1;throw"unexpected end of file./"+l}const d=t.charAt(o);if(o+=1,d=="=")return l=0,-1;if(d.match(/^\s$/))continue;r=r<<6|c(d.charCodeAt(0)),l+=6}const a=r>>>l-8&255;return l-=8,a};const c=function(a){if(65<=a&&a<=90)return a-65;if(97<=a&&a<=122)return a-97+26;if(48<=a&&a<=57)return a-48+52;if(a==43)return 62;if(a==47)return 63;throw"c:"+a};return i},Kx=function(e,t){const o=e,r=t,l=new Array(e*t),i={};i.setPixel=function(u,h,m){l[h*o+u]=m},i.write=function(u){u.writeString("GIF87a"),u.writeShort(o),u.writeShort(r),u.writeByte(128),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(255),u.writeByte(255),u.writeByte(255),u.writeString(","),u.writeShort(0),u.writeShort(0),u.writeShort(o),u.writeShort(r),u.writeByte(0);const h=2,m=a(h);u.writeByte(h);let g=0;for(;m.length-g>255;)u.writeByte(255),u.writeBytes(m,g,255),g+=255;u.writeByte(m.length-g),u.writeBytes(m,g,m.length-g),u.writeByte(0),u.writeString(";")};const c=function(u){const h=u;let m=0,g=0;const b={};return b.write=function(N,j){if(N>>>j)throw"length over";for(;m+j>=8;)h.writeByte(255&(N<<m|g)),j-=8-m,N>>>=8-m,g=0,m=0;g=N<<m|g,m=m+j},b.flush=function(){m>0&&h.writeByte(g)},b},a=function(u){const h=1<<u,m=(1<<u)+1;let g=u+1;const b=d();for(let O=0;O<h;O+=1)b.add(String.fromCharCode(O));b.add(String.fromCharCode(h)),b.add(String.fromCharCode(m));const N=zn(),j=c(N);j.write(h,g);let w=0,R=String.fromCharCode(l[w]);for(w+=1;w<l.length;){const O=String.fromCharCode(l[w]);w+=1,b.contains(R+O)?R=R+O:(j.write(b.indexOf(R),g),b.size()<4095&&(b.size()==1<<g&&(g+=1),b.add(R+O)),R=O)}return j.write(b.indexOf(R),g),j.write(m,g),j.flush(),N.toByteArray()},d=function(){const u={};let h=0;const m={};return m.add=function(g){if(m.contains(g))throw"dup key:"+g;u[g]=h,h+=1},m.size=function(){return h},m.indexOf=function(g){return u[g]},m.contains=function(g){return typeof u[g]<"u"},m};return i},Vx=function(e,t,o){const r=Kx(e,t);for(let a=0;a<t;a+=1)for(let d=0;d<e;d+=1)r.setPixel(d,a,o(d,a));const l=zn();r.write(l);const i=Wx(),c=l.toByteArray();for(let a=0;a<c.length;a+=1)i.writeByte(c[a]);return i.flush(),"data:image/gif;base64,"+i};ue.stringToBytes;function Yx({value:e,size:t=184}){const{count:o,path:r}=p.useMemo(()=>{const l=ue(0,"M");l.addData(e),l.make();const i=l.getModuleCount();let c="";for(let a=0;a<i;a++)for(let d=0;d<i;d++)l.isDark(a,d)&&(c+=`M${d+4} ${a+4}h1v1h-1z`);return{count:i+8,path:c}},[e]);return s.jsxs("svg",{role:"img","aria-label":"QR code for your authenticator app",viewBox:`0 0 ${o} ${o}`,width:t,height:t,shapeRendering:"crispEdges",className:"rounded-lg","data-testid":"two-factor-qr",children:[s.jsx("rect",{width:o,height:o,fill:"#ffffff"}),s.jsx("path",{d:r,fill:"#111827"})]})}function qn({value:e,onChange:t,onComplete:o,disabled:r,autoFocus:l=!0,id:i}){const c=p.useRef(null);return p.useEffect(()=>{var a;l&&((a=c.current)==null||a.focus())},[l]),s.jsx("input",{ref:c,id:i,type:"text",inputMode:"numeric",autoComplete:"one-time-code","aria-label":"6-digit code",placeholder:"······",maxLength:7,value:e,disabled:r,onChange:a=>{const d=a.target.value.replace(/\D/g,"").slice(0,6);t(d),d.length===6&&(o==null||o(d))},className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-center text-xl font-mono tracking-[0.5em]\r
26
+ focus:outline-none focus:border-brand-500/50 placeholder-gray-600 disabled:opacity-50`})}function Qx({codes:e,onDone:t,doneLabel:o="Done",account:r}){const[l,i]=p.useState(!1),[c,a]=p.useState(!1),d=[`Testver recovery codes${r?` — ${r}`:""}`,"Each code signs you in once if you cannot use your authenticator app.","",...e,""].join(`
27
+ `),u=async()=>{try{await navigator.clipboard.writeText(d),a(!0),setTimeout(()=>a(!1),2e3)}catch{}},h=()=>{const m=URL.createObjectURL(new Blob([d],{type:"text/plain"})),g=document.createElement("a");g.href=m,g.download="testver-recovery-codes.txt",g.click(),URL.revokeObjectURL(m)};return s.jsxs("div",{className:"space-y-4","data-testid":"recovery-codes",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-gray-100",children:"Save your recovery codes"}),s.jsx("p",{className:"mt-1 text-[13px] text-gray-400 leading-relaxed",children:"If you lose your phone, each of these codes signs you in once. Keep them somewhere safe — a password manager is ideal. They are shown only now."})]}),s.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-1.5 rounded-lg bg-surface-2 border border-white/10 px-4 py-3 font-mono text-[14px] text-gray-100",children:e.map(m=>s.jsx("span",{children:m},m))}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs("button",{type:"button",onClick:u,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-white/10 text-[13px] text-gray-300 hover:bg-white/5",children:[c?s.jsx(xe,{size:14,className:"text-emerald-400"}):s.jsx(dt,{size:14})," ",c?"Copied":"Copy"]}),s.jsxs("button",{type:"button",onClick:h,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-white/10 text-[13px] text-gray-300 hover:bg-white/5",children:[s.jsx(is,{size:14})," Download"]})]}),s.jsxs("label",{className:"flex items-start gap-2 text-[13px] text-gray-300 cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:l,onChange:m=>i(m.target.checked),className:"mt-0.5 accent-brand-500"}),"I have saved my recovery codes"]}),s.jsxs("button",{type:"button",disabled:!l,onClick:t,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(ae,{size:16})," ",o]})]})}function Wn({start:e,confirm:t,onFinished:o,doneLabel:r,beforeCode:l}){const[i,c]=p.useState(null),[a,d]=p.useState(""),[u,h]=p.useState(""),[m,g]=p.useState(""),[b,N]=p.useState(!1),[j,w]=p.useState(null),[R,O]=p.useState(!1),C=p.useRef(!1);p.useEffect(()=>{C.current||(C.current=!0,e().then(c).catch(T=>d(T.message||"Could not start the setup.")))},[e]);const E=async(T=u)=>{if(!(T.length!==6||b)){N(!0),g("");try{w(await t(T))}catch(k){g(k.message||"That code did not work."),h("")}finally{N(!1)}}};return j?s.jsx(Qx,{codes:j,onDone:o,doneLabel:r,account:i==null?void 0:i.account}):a?s.jsx("p",{className:"p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:a}):i?s.jsxs("form",{onSubmit:T=>{T.preventDefault(),E()},className:"space-y-4","data-testid":"two-factor-setup",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-center sm:items-start",children:[s.jsx("div",{className:"p-2 bg-white rounded-xl flex-shrink-0",children:s.jsx(Yx,{value:i.otpauthUri})}),s.jsxs("div",{className:"space-y-2 text-[13px] text-gray-400 leading-relaxed",children:[s.jsxs("p",{className:"flex items-center gap-1.5 text-gray-200 font-medium",children:[s.jsx(ke,{size:14})," 1. Scan with your authenticator app"]}),s.jsx("p",{children:"Google Authenticator, Microsoft Authenticator, Authy, 1Password or Bitwarden all work. In the app, add an account and scan this code."}),s.jsx("p",{className:"text-gray-500",children:"Can't scan? Enter this key instead (time-based):"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("code",{className:"px-2 py-1 rounded bg-surface-2 border border-white/10 font-mono text-[13px] text-gray-100 whitespace-normal break-normal","data-testid":"two-factor-key",children:i.secretGrouped.split(" ").map((T,k)=>s.jsx("span",{className:"inline-block whitespace-nowrap mr-[0.6ch] last:mr-0",children:T},k))}),s.jsx("button",{type:"button",title:"Copy the key",onClick:async()=>{try{await navigator.clipboard.writeText(i.secret),O(!0),setTimeout(()=>O(!1),2e3)}catch{}},className:"p-1.5 rounded-md text-gray-400 hover:text-gray-200 hover:bg-white/5",children:R?s.jsx(xe,{size:14,className:"text-emerald-400"}):s.jsx(dt,{size:14})})]})]})]}),l,s.jsxs("div",{children:[s.jsx("label",{htmlFor:"two-factor-first-code",className:"block text-[13px] text-gray-200 font-medium mb-1.5",children:"2. Enter the 6-digit code the app shows for Testver"}),s.jsx(qn,{id:"two-factor-first-code",value:u,onChange:h,onComplete:T=>void E(T),disabled:b,autoFocus:!1})]}),m&&s.jsx("p",{className:"p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:m}),s.jsxs("button",{type:"submit",disabled:b||u.length!==6,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[b?s.jsx(ve,{size:16,className:"animate-spin"}):s.jsx(ae,{size:16})," Turn on two-factor authentication"]})]}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[s.jsx(ve,{size:14,className:"animate-spin"})," Preparing…"]})}function Xx(){const{login:e,completeSignIn:t,isSetupRequired:o,isAuthenticated:r}=Y(),l=H(),[i,c]=p.useState(""),[a,d]=p.useState(""),[u,h]=p.useState(""),[m,g]=p.useState(!1),[b,N]=p.useState({kind:"password"}),[j]=p.useState(()=>{const C=Go();return C?zo(C.reason,C.policy):null});if(o)return l("/setup",{replace:!0}),null;if(r)return l("/",{replace:!0}),null;const w=(C="")=>{N({kind:"password"}),d(""),h(C)},R=async C=>{if(C.preventDefault(),!(!i.trim()||!a)){g(!0),h("");try{const E=await e(i.trim(),a);E.twoFactorRequired?N({kind:"code",challenge:E.challenge,allowTrustBrowser:E.allowTrustBrowser,trustBrowserDays:E.trustBrowserDays}):E.twoFactorSetupRequired?N({kind:"setup",challenge:E.challenge,requiredFor:E.requiredFor}):l("/",{replace:!0})}catch(E){h(E.message||"Login failed")}finally{g(!1)}}},O=C=>{t(C),l("/",{replace:!0})};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-surface-0 px-4",children:s.jsxs("div",{className:`w-full ${b.kind==="setup"?"max-w-lg":"max-w-sm"} bg-surface-1 rounded-xl border border-white/5 p-8`,children:[s.jsxs("div",{className:"flex flex-col items-center mb-8",children:[s.jsx(ie,{className:"w-14 h-14 object-contain"}),s.jsx("h1",{className:"mt-4 text-xl font-semibold text-gray-100",children:b.kind==="password"?"Sign in to Testver":b.kind==="code"?"Two-factor authentication":"Set up two-factor authentication"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500 text-center",children:b.kind==="password"?"Test automation dashboard":b.kind==="code"?"Enter the code from your authenticator app":`Your administrator requires it for ${b.requiredFor==="admins"?"administrator accounts":"every account"} — it takes a minute.`})]}),b.kind==="password"&&s.jsxs("form",{onSubmit:R,children:[j&&!u&&s.jsxs("div",{className:"mb-4 p-3 flex items-start gap-2 bg-amber-500/10 border border-amber-500/20 rounded-lg text-amber-600 dark:text-amber-300 text-sm",children:[s.jsx(at,{size:14,className:"mt-0.5 flex-shrink-0"}),s.jsx("span",{children:j})]}),u&&s.jsx("div",{className:"mb-4 p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:u}),s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5",children:"Username or email"}),s.jsx("input",{type:"text",value:i,onChange:C=>c(C.target.value),className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
28
+ focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"Username or email",autoFocus:!0,autoComplete:"username"})]}),s.jsxs("div",{className:"mb-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[s.jsx("label",{className:"block text-xs text-gray-400",children:"Password"}),s.jsx(ce,{to:"/forgot-password",className:"text-xs text-brand-400 hover:text-brand-300",children:"Forgot password?"})]}),s.jsx(le,{value:a,onChange:C=>d(C.target.value),className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
29
+ focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"Enter password",autoComplete:"current-password"})]}),s.jsxs("button",{type:"submit",disabled:m||!i.trim()||!a,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500\r
30
+ text-white text-sm font-medium rounded-lg transition-colors\r
31
+ disabled:opacity-50 disabled:cursor-not-allowed`,children:[m?s.jsx("span",{className:"animate-spin w-4 h-4 border-2 border-white/30 border-t-white rounded-full"}):s.jsx(Eo,{size:16}),m?"Signing in...":"Sign In"]})]}),b.kind==="code"&&s.jsx(Zx,{step:b,onSignedIn:O,onRestart:w}),b.kind==="setup"&&s.jsx(e0,{challenge:b.challenge,onSignedIn:O,onRestart:w})]})})}function Zx({step:e,onSignedIn:t,onRestart:o}){const[r,l]=p.useState(!1),[i,c]=p.useState(""),[a,d]=p.useState(""),[u,h]=p.useState(!1),[m,g]=p.useState(""),[b,N]=p.useState(!1),j=async w=>{var O;if(b)return;const R=w??i;if(!(!r&&R.length!==6)&&!(r&&!a.trim())){N(!0),g("");try{const C=await gn({challenge:e.challenge,...r?{recoveryCode:a.trim()}:{code:R},trustBrowser:e.allowTrustBrowser&&u});t(C)}catch(C){if(C.code==="AUTH_2FA_EXPIRED"||C.code==="AUTH_LOCKED"){o(C.message);return}const E=(O=C.data)==null?void 0:O.attemptsLeft;g(`${C.message||"That did not work."}${typeof E=="number"?` ${E} attempt${E===1?"":"s"} left.`:""}`),c("")}finally{N(!1)}}};return s.jsxs("form",{onSubmit:w=>{w.preventDefault(),j()},className:"space-y-4",children:[m&&s.jsx("div",{className:"p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:m}),r?s.jsxs("div",{children:[s.jsx("label",{htmlFor:"recovery-code",className:"block text-xs text-gray-400 mb-1.5",children:"Recovery code"}),s.jsx("input",{id:"recovery-code",type:"text",autoFocus:!0,autoComplete:"off",spellCheck:!1,value:a,onChange:w=>d(w.target.value),placeholder:"xxxxx-xxxxx",className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-center font-mono text-base tracking-wider\r
32
+ focus:outline-none focus:border-brand-500/50 placeholder-gray-600`}),s.jsx("p",{className:"mt-1.5 text-xs text-gray-500",children:"Each recovery code works once."})]}):s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5",children:"6-digit code"}),s.jsx(qn,{value:i,onChange:c,onComplete:w=>void j(w),disabled:b})]}),e.allowTrustBrowser&&s.jsxs("label",{className:"flex items-start gap-2 text-[13px] text-gray-300 cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:u,onChange:w=>h(w.target.checked),className:"mt-0.5 accent-brand-500"}),s.jsxs("span",{children:["Trust this browser for ",e.trustBrowserDays," days ",s.jsx("span",{className:"block text-xs text-gray-500",children:"Only on a computer you alone use. You can remove it in Profile."})]})]}),s.jsxs("button",{type:"submit",disabled:b||(r?!a.trim():i.length!==6),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[b?s.jsx("span",{className:"animate-spin w-4 h-4 border-2 border-white/30 border-t-white rounded-full"}):s.jsx(ae,{size:16}),"Verify"]}),s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsxs("button",{type:"button",onClick:()=>o(),className:"flex items-center gap-1 text-gray-500 hover:text-gray-300",children:[s.jsx(Ce,{size:12})," Back"]}),s.jsxs("button",{type:"button",onClick:()=>{l(w=>!w),g("")},className:"flex items-center gap-1 text-brand-400 hover:text-brand-300",children:[s.jsx(fe,{size:12})," ",r?"Use the code from my app":"Use a recovery code"]})]})]})}function e0({challenge:e,onSignedIn:t,onRestart:o}){const[r,l]=p.useState(null);return s.jsxs("div",{className:"space-y-4",children:[s.jsx(Wn,{start:()=>fn(e).catch(i=>{throw i.code==="AUTH_2FA_EXPIRED"&&o(i.message),i}),confirm:async i=>{try{const c=await xn(e,i);return l(c),c.recoveryCodes??[]}catch(c){throw(c.code==="AUTH_2FA_EXPIRED"||c.code==="AUTH_LOCKED")&&o(c.message),c}},doneLabel:"Continue to Testver",onFinished:()=>{r&&t(r)}}),!r&&s.jsxs("button",{type:"button",onClick:()=>o(),className:"flex items-center gap-1 text-xs text-gray-500 hover:text-gray-300",children:[s.jsx(Ce,{size:12})," Back to sign in"]})]})}function t0(){const[e,t]=p.useState(""),[o,r]=p.useState(""),[l,i]=p.useState(!1),[c,a]=p.useState(!1),d=async u=>{if(u.preventDefault(),!(!e.trim()||c)){a(!0),r("");try{await bn(e.trim()),i(!0)}catch(h){r(h.message||"Could not send the reset email")}finally{a(!1)}}};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-surface-0",children:s.jsxs("form",{onSubmit:d,className:"w-full max-w-sm bg-surface-1 rounded-xl border border-white/5 p-8",children:[s.jsxs("div",{className:"flex flex-col items-center mb-8",children:[s.jsx(ie,{className:"w-14 h-14 object-contain"}),s.jsx("h1",{className:"mt-4 text-xl font-semibold text-gray-100",children:"Forgot your password?"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500 text-center",children:"Enter your username or email and we will send a link to choose a new one."})]}),l?s.jsxs("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/10 p-4 text-sm text-emerald-300 flex items-start gap-2.5",children:[s.jsx(Ro,{size:18,className:"mt-0.5 shrink-0"}),s.jsx("span",{children:"If that account has an email address on file, a reset link is on its way. It works once and expires in 60 minutes."})]}):s.jsxs(s.Fragment,{children:[o&&s.jsx("div",{className:"mb-4 p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:o}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5",children:"Username or email"}),s.jsx("input",{type:"text",value:e,onChange:u=>t(u.target.value),className:"w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm focus:outline-none focus:border-brand-500/50 placeholder-gray-600",placeholder:"you@company.com",autoFocus:!0,autoComplete:"username"})]}),s.jsxs("button",{type:"submit",disabled:c||!e.trim(),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[c?s.jsx("span",{className:"animate-spin w-4 h-4 border-2 border-white/30 border-t-white rounded-full"}):s.jsx(fe,{size:16}),c?"Sending…":"Send reset link"]})]}),s.jsx("p",{className:"mt-5 rounded-lg border border-white/5 bg-surface-2 px-3 py-2.5 text-xs text-gray-500 leading-relaxed",children:"The reset link is sent through the email service connected to this Testver (Testver Mail or an SMTP connector), to the email address on your account. If neither is set up, ask an administrator to reset your password."}),s.jsx("p",{className:"mt-4 text-center text-xs text-gray-500",children:s.jsx(ce,{to:"/login",className:"text-brand-400 hover:text-brand-300",children:"Back to sign in"})})]})})}function s0(){const[e]=Vn(),t=e.get("token")??"",[o,r]=p.useState("checking"),[l,i]=p.useState(null),[c,a]=p.useState(""),[d,u]=p.useState(""),[h,m]=p.useState(""),[g,b]=p.useState(!1);p.useEffect(()=>{if(!t){r("invalid");return}yn(t).then(j=>{i(j.username),r("ready")}).catch(()=>r("invalid"))},[t]);const N=async j=>{if(j.preventDefault(),!g){if(c.length<6){m("Password must be at least 6 characters");return}if(c!==d){m("The two passwords do not match");return}b(!0),m("");try{await wn(t,c),r("done")}catch(w){m(w.message||"Could not reset the password")}finally{b(!1)}}};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-surface-0",children:s.jsxs("form",{onSubmit:N,className:"w-full max-w-sm bg-surface-1 rounded-xl border border-white/5 p-8",children:[s.jsxs("div",{className:"flex flex-col items-center mb-8",children:[s.jsx(ie,{className:"w-14 h-14 object-contain"}),s.jsx("h1",{className:"mt-4 text-xl font-semibold text-gray-100",children:"Choose a new password"}),l&&o==="ready"&&s.jsxs("p",{className:"mt-1 text-sm text-gray-500",children:["for @",l]})]}),o==="checking"&&s.jsx("p",{className:"text-sm text-gray-500 text-center",children:"Checking your link…"}),o==="invalid"&&s.jsxs("div",{className:"rounded-lg border border-amber-500/20 bg-amber-500/10 p-4 text-sm text-amber-300",children:["This reset link has expired or was already used."," ",s.jsx(ce,{to:"/forgot-password",className:"underline underline-offset-2 hover:text-amber-200",children:"Request a new one"}),"."]}),o==="done"&&s.jsxs("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/10 p-4 text-sm text-emerald-300 flex items-start gap-2.5",children:[s.jsx(nt,{size:18,className:"mt-0.5 shrink-0"}),s.jsxs("span",{children:["Your password has been changed and every other session was signed out. ",s.jsx(ce,{to:"/login",className:"underline underline-offset-2",children:"Sign in"})," with the new one."]})]}),o==="ready"&&s.jsxs(s.Fragment,{children:[h&&s.jsx("div",{className:"mb-4 p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:h}),s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5",children:"New password"}),s.jsx(le,{value:c,onChange:j=>a(j.target.value),className:"w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm focus:outline-none focus:border-brand-500/50 placeholder-gray-600",placeholder:"At least 6 characters",autoComplete:"new-password"})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5",children:"Confirm new password"}),s.jsx(le,{value:d,onChange:j=>u(j.target.value),className:"w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm focus:outline-none focus:border-brand-500/50 placeholder-gray-600",placeholder:"Repeat the password",autoComplete:"new-password"})]}),s.jsxs("button",{type:"submit",disabled:g||!c||!d,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[g?s.jsx("span",{className:"animate-spin w-4 h-4 border-2 border-white/30 border-t-white rounded-full"}):s.jsx(fe,{size:16}),g?"Saving…":"Set new password"]})]}),o!=="done"&&s.jsx("p",{className:"mt-6 text-center text-xs text-gray-500",children:s.jsx(ce,{to:"/login",className:"text-brand-400 hover:text-brand-300",children:"Back to sign in"})})]})})}const n0=[{value:"web",label:"Web Testing",Icon:ct,blurb:"Supports all major web automation frameworks — Playwright, Selenium, Cypress, and more. Run tests locally, on a server, or in the cloud.",selectedClasses:"bg-sky-500/15 border-sky-500/60 ring-1 ring-sky-500/40",selectedIconClasses:"bg-sky-500/25 text-sky-700 dark:text-sky-300",selectedTitleClasses:"text-sky-700 dark:text-sky-200",selectedCheckClasses:"text-sky-700 dark:text-sky-300",badge:null},{value:"mobile",label:"Mobile Testing",Icon:ke,blurb:"Supports all major Appium frameworks for Android and iOS. Runs on your local devices and emulators, or on cloud device grids.",selectedClasses:"bg-indigo-500/15 border-indigo-500/60 ring-1 ring-indigo-500/40",selectedIconClasses:"bg-indigo-500/25 text-indigo-700 dark:text-indigo-300",selectedTitleClasses:"text-indigo-700 dark:text-indigo-200",selectedCheckClasses:"text-indigo-700 dark:text-indigo-300",badge:"Beta"}];function o0(){const{setup:e,isSetupRequired:t,isAuthenticated:o,isSetupLinkMissing:r}=Y(),l=H(),[i,c]=p.useState("mode"),[a,d]=p.useState(null),[u,h]=p.useState(""),[m,g]=p.useState(""),[b,N]=p.useState(""),[j,w]=p.useState(""),[R,O]=p.useState(""),[C,E]=p.useState(""),[T,k]=p.useState(""),[f,y]=p.useState(!1);if(!t&&o)return l("/",{replace:!0}),null;const x=()=>{if(k(""),!u.trim()){k("Please enter a project name");return}if(!a){k("Please pick what you will be testing");return}c("account")},v=async S=>{if(S.preventDefault(),k(""),!a||!u.trim()){c("mode");return}if(!m.trim()){k("Username is required");return}if(!b.trim()){k("Display name is required");return}if(!j.trim()){k("Email is required");return}if(R.length<6){k("Password must be at least 6 characters");return}if(R!==C){k("Passwords do not match");return}y(!0);try{await e(m.trim(),b.trim(),R,j.trim()||void 0,a,u.trim()),l("/",{replace:!0})}catch(P){k(P.message||"Setup failed")}finally{y(!1)}};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-surface-0 px-4 py-8",children:s.jsxs("div",{className:"w-full max-w-2xl bg-surface-1 rounded-xl border border-white/5 p-8",children:[s.jsxs("div",{className:"flex flex-col items-center mb-6",children:[s.jsx(ie,{className:"w-14 h-14 object-contain"}),s.jsx("h1",{className:"mt-4 text-xl font-semibold text-gray-100",children:"Welcome to Testver"}),s.jsx("p",{className:"mt-1.5 text-[15px] text-gray-500 text-center",children:i==="mode"?"Let's start with your project and what you'll be testing":"Now create your super admin account"})]}),s.jsx(i0,{step:i}),r&&s.jsxs("div",{className:"mb-4 p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg text-amber-300 text-sm",children:["This workspace can only be set up from its setup link. Open it from your Testver dashboard (Cloud → ",s.jsx("b",{children:"Open workspace"}),") — the link carries the one-time key that lets you create the super admin."]}),T&&s.jsx("div",{className:"mb-4 p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:T}),i==="mode"?s.jsx(a0,{projectName:u,onProjectNameChange:h,value:a,onChange:d,onNext:x}):s.jsx(r0,{appMode:a,projectName:u.trim(),username:m,setUsername:g,displayName:b,setDisplayName:N,email:j,setEmail:w,password:R,setPassword:O,confirmPassword:C,setConfirmPassword:E,loading:f,onBack:()=>{k(""),c("mode")},onSubmit:v})]})})}function a0({projectName:e,onProjectNameChange:t,value:o,onChange:r,onNext:l}){return s.jsxs("div",{children:[s.jsxs("div",{className:"mb-5",children:[s.jsxs("label",{htmlFor:"setup-project-name",className:"block text-xs text-gray-400 mb-1.5",children:["Project name ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{id:"setup-project-name",type:"text",value:e,onChange:i=>t(i.target.value),onKeyDown:i=>{i.key==="Enter"&&(i.preventDefault(),l())},maxLength:An,className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
33
+ focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"e.g. Customer Portal",autoFocus:!0,autoComplete:"off","data-testid":"setup-project-name"}),s.jsx("p",{className:"mt-1.5 text-[11px] text-gray-500",children:"Shown at the top of every screen so your team knows which project they are in."})]}),s.jsx("p",{className:"text-sm text-gray-500 mb-4",children:"This controls which Testver surfaces (Runner, Recorder, Schedules, AI Assistant) you'll see. You can change it later in Settings → General."}),s.jsx("div",{className:"grid grid-cols-2 gap-3 mb-6",children:n0.map(({value:i,label:c,Icon:a,blurb:d,badge:u,selectedClasses:h,selectedIconClasses:m,selectedTitleClasses:g,selectedCheckClasses:b})=>{const N=o===i;return s.jsxs("button",{type:"button",onClick:()=>r(i),className:`relative text-left flex flex-col gap-3 p-5 rounded-lg border transition-all ${N?h:"bg-white/[0.03] border-white/10 hover:bg-white/[0.06] hover:border-white/20"}`,children:[u&&s.jsx("span",{className:"absolute top-2.5 right-2.5 text-[10px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded bg-amber-500/15 text-amber-400 border border-amber-500/30",children:u}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:`w-12 h-12 rounded-lg flex items-center justify-center transition-colors ${N?m:"bg-white/[0.06] text-gray-400"}`,children:s.jsx(a,{size:24})}),N&&s.jsx(xe,{size:18,className:b})]}),s.jsxs("div",{children:[s.jsx("div",{className:`text-base font-semibold ${N?g:"text-gray-200"}`,children:c}),s.jsx("p",{className:"text-sm text-gray-500 leading-relaxed mt-1.5",children:d})]})]},i)})}),s.jsxs("button",{type:"button",onClick:l,disabled:!o||!e.trim(),className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500\r
34
+ text-white text-sm font-medium rounded-lg transition-colors\r
35
+ disabled:opacity-40 disabled:cursor-not-allowed`,children:["Next",s.jsx($o,{size:16})]})]})}function r0(e){const{appMode:t,projectName:o,username:r,setUsername:l,displayName:i,setDisplayName:c,email:a,setEmail:d,password:u,setPassword:h,confirmPassword:m,setConfirmPassword:g,loading:b,onBack:N,onSubmit:j}=e,w=t==="mobile"?ke:ct,R=t==="mobile"?"Mobile Testing":"Web Testing",O=t==="mobile"?"bg-indigo-500/10 border-indigo-500/30":"bg-sky-500/10 border-sky-500/30",C=t==="mobile"?"text-indigo-700 dark:text-indigo-300":"text-sky-700 dark:text-sky-300",E=t==="mobile"?"text-indigo-700 dark:text-indigo-200":"text-sky-700 dark:text-sky-200",T=t==="mobile"?"text-indigo-700 hover:text-indigo-600 dark:text-indigo-300 dark:hover:text-indigo-200":"text-sky-700 hover:text-sky-600 dark:text-sky-300 dark:hover:text-sky-200";return s.jsxs("form",{onSubmit:j,children:[s.jsxs("div",{className:`mb-4 p-3 rounded-lg border flex items-center gap-2.5 ${O}`,children:[s.jsx(w,{size:16,className:`flex-shrink-0 ${C}`}),s.jsxs("div",{className:"flex-1 min-w-0 text-xs truncate",children:[s.jsx("span",{className:`font-medium ${E}`,children:o}),s.jsx("span",{className:"text-gray-500 mx-1.5",children:"·"}),s.jsx("span",{className:`font-medium ${E}`,children:R})]}),s.jsx("button",{type:"button",onClick:N,className:`text-[11px] font-medium ${T}`,children:"Change"})]}),s.jsxs("div",{className:"mb-5 p-3 bg-surface-2 border border-white/5 rounded-lg flex items-start gap-2",children:[s.jsx(ae,{size:14,className:"text-gray-400 mt-0.5 flex-shrink-0"}),s.jsx("p",{className:"text-[11px] text-gray-400",children:"This account becomes the super admin — it owns system-level settings and is the only account that can create admins. You can create more users after setup."})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4 mb-6",children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs text-gray-400 mb-1.5",children:["Username ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:r,onChange:k=>l(k.target.value),className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
36
+ focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"e.g. admin",autoFocus:!0,autoComplete:"username"})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs text-gray-400 mb-1.5",children:["Display Name ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:i,onChange:k=>c(k.target.value),className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
37
+ focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"e.g. Admin User",autoComplete:"name"})]}),s.jsxs("div",{className:"col-span-2",children:[s.jsxs("label",{className:"block text-xs text-gray-400 mb-1.5",children:["Email ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"email",required:!0,value:a,onChange:k=>d(k.target.value),className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
38
+ focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"admin@company.com",autoComplete:"email"})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs text-gray-400 mb-1.5",children:["Password ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx(le,{value:u,onChange:k=>h(k.target.value),className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
39
+ focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"Min. 6 characters",autoComplete:"new-password"})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs text-gray-400 mb-1.5",children:["Confirm Password ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx(le,{value:m,onChange:k=>g(k.target.value),className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
40
+ focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"Re-enter password",autoComplete:"new-password"})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("button",{type:"button",onClick:N,disabled:b,className:`flex items-center justify-center gap-2 px-4 py-2.5 bg-surface-2 hover:bg-surface-3\r
41
+ text-gray-300 text-sm font-medium rounded-lg border border-white/10 transition-colors\r
42
+ disabled:opacity-50`,children:[s.jsx(Ce,{size:16}),"Back"]}),s.jsxs("button",{type:"submit",disabled:b,className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500\r
43
+ text-white text-sm font-medium rounded-lg transition-colors\r
44
+ disabled:opacity-50 disabled:cursor-not-allowed`,children:[b?s.jsx("span",{className:"animate-spin w-4 h-4 border-2 border-white/30 border-t-white rounded-full"}):s.jsx(ae,{size:16}),b?"Creating Account...":"Create Super Admin Account"]})]})]})}function i0({step:e}){return s.jsxs("div",{className:"flex items-center justify-center gap-2.5 mb-6",children:[s.jsxs("div",{className:`flex items-center gap-2 text-xs ${e==="mode"?"text-brand-300":"text-emerald-400"}`,children:[s.jsx("span",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[11px] font-semibold ${e==="mode"?"bg-brand-500/20 border border-brand-500/50":"bg-emerald-500/20 border border-emerald-500/40"}`,children:e==="mode"?"1":s.jsx(xe,{size:12})}),s.jsx("span",{children:"Project & focus"})]}),s.jsx("div",{className:`h-px w-8 ${e==="account"?"bg-emerald-500/40":"bg-white/10"}`}),s.jsxs("div",{className:`flex items-center gap-2 text-xs ${e==="account"?"text-brand-300":"text-gray-500"}`,children:[s.jsx("span",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[11px] font-semibold ${e==="account"?"bg-brand-500/20 border border-brand-500/50":"bg-surface-2 border border-white/10"}`,children:"2"}),s.jsx("span",{children:"Super admin account"})]})]})}const Mt=300*1e3;function _t(e){const t=Math.max(0,Math.ceil(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function c0(){const{logout:e}=Y(),[t,o]=p.useState(Uo()),[r,l]=p.useState(Date.now()),[i,c]=p.useState(!1),[a,d]=p.useState(null),u=p.useRef(0),h=p.useRef(!1);p.useEffect(()=>Bo(o),[]),p.useEffect(()=>{const j=setInterval(()=>l(Date.now()),1e3);return()=>clearInterval(j)},[]);const m=t?t.expiresAt-r:1/0,g=!!t&&t.expiresAt>=t.absoluteExpiresAt-1e3;if(p.useEffect(()=>{!t||m>Mt||!(m<=0?!h.current:r-u.current>6e4)||(u.current=r,m<=0&&(h.current=!0),ht().then(w=>{w.authenticated&&w.session&&w.session.expiresAt>Date.now()?(h.current=!1,oe({expiresAt:w.session.expiresAt,absoluteExpiresAt:w.session.absoluteExpiresAt})):(m<=0||!w.authenticated)&&Ee(g?"max":"idle")}).catch(()=>{h.current=!1}))},[t,m,r,g]),!t||m>Mt||m<=0)return null;const b=Jo(),N=async()=>{c(!0),d(null);try{await un()}catch(j){d(j.message)}finally{c(!1)}};return s.jsx("div",{role:"alertdialog","aria-live":"assertive",className:"fixed bottom-5 left-1/2 -translate-x-1/2 z-[9999] w-[min(560px,calc(100vw-32px))] rounded-xl border border-amber-500/30 bg-surface-1 shadow-2xl p-4",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(at,{size:18,className:"text-amber-500 mt-0.5 flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[g?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-sm font-semibold text-gray-100",children:["You'll need to sign in again in ",_t(m)]}),s.jsxs("p",{className:"text-sm text-gray-400 mt-1",children:["Sign-ins last at most ",b?`${b.maxDays} day${b.maxDays===1?"":"s"}`:"the configured number of days",". Save what you're working on. Runs keep going on the server while you sign in."]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-sm font-semibold text-gray-100",children:["You'll be signed out in ",_t(m)]}),s.jsxs("p",{className:"text-sm text-gray-400 mt-1",children:["There's been no activity for ",b?ps(b.idleHours):"a while",". Runs keep going on the server either way."]})]}),a&&s.jsx("p",{className:"text-sm text-red-400 mt-1.5",children:a}),s.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[!g&&s.jsx("button",{onClick:N,disabled:i,className:"px-3.5 py-1.5 rounded-lg text-sm font-medium text-white bg-brand-600 hover:bg-brand-500 disabled:opacity-50",children:"Stay signed in"}),s.jsxs("button",{onClick:()=>{e().then(()=>{window.location.href="/login"})},className:"flex items-center gap-1.5 px-3.5 py-1.5 rounded-lg text-sm text-gray-300 hover:bg-white/5",children:[s.jsx(it,{size:13})," ",g?"Sign in again now":"Sign out"]})]})]})]})})}function l0({children:e}){const{isAuthenticated:t,isLoading:o,isSetupRequired:r,isTwoFactorSetupRequired:l}=Y(),i=H();return p.useEffect(()=>{o||(r?i("/setup",{replace:!0}):t||i("/login",{replace:!0}))},[o,t,r,i]),o?s.jsx(Gn,{title:"Welcome back to Testver",subtitle:"One moment — verifying your session.",phases:Fn,footerHint:void 0}):t?l?s.jsx(d0,{}):s.jsxs(s.Fragment,{children:[e,s.jsx(c0,{})]}):null}function d0(){const{user:e,logout:t,refreshStatus:o}=Y(),[r,l]=p.useState(""),[i,c]=p.useState(""),[a,d]=p.useState("");return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-surface-0 px-4","data-testid":"two-factor-gate",children:s.jsxs("div",{className:"w-full max-w-lg bg-surface-1 rounded-xl border border-white/5 p-8",children:[s.jsxs("div",{className:"flex flex-col items-center mb-6 text-center",children:[s.jsx(ie,{className:"w-12 h-12 object-contain"}),s.jsx("h1",{className:"mt-4 text-xl font-semibold text-gray-100",children:"Set up two-factor authentication"}),s.jsxs("p",{className:"mt-1 text-sm text-gray-500",children:["Your administrator now requires it",e?` for @${e.username}`:"",". Set it up to continue — it takes a minute."]})]}),i?s.jsx(Wn,{start:()=>jn(i).catch(u=>{throw d(u.message),c(""),l(""),u}),confirm:async u=>(await Tn(u,!1)).recoveryCodes,doneLabel:"Continue to Testver",onFinished:()=>{o()}}):s.jsxs("form",{onSubmit:u=>{u.preventDefault(),r&&(d(""),c(r))},className:"space-y-4",children:[a&&s.jsx("div",{className:"p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:a}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"two-factor-gate-password",className:"block text-xs text-gray-400 mb-1.5",children:"Confirm your password to start"}),s.jsx(le,{id:"two-factor-gate-password",value:r,onChange:u=>l(u.target.value),autoFocus:!0,autoComplete:"current-password",className:"w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm focus:outline-none focus:border-brand-500/50"})]}),s.jsxs("button",{type:"submit",disabled:!r,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50",children:[s.jsx(ae,{size:16})," Start"]})]}),s.jsxs("button",{type:"button",onClick:()=>void t(),className:"mt-5 flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300",children:[s.jsx(it,{size:12})," Sign out"]})]})})}function Ae({minRole:e,children:t}){const{hasRole:o}=Y();return o(e)?s.jsx(s.Fragment,{children:t}):s.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:s.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[s.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:s.jsx(Ao,{size:24,className:"text-red-400"})}),s.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Access Denied"}),s.jsx("p",{className:"text-sm text-gray-500 max-w-sm",children:"You don't have permission to access this page. Contact an administrator if you need access."})]})})}function se(){const e=Yn(),t=H(),o=Ft(),[r,l]=p.useState(!1),[i,c]=p.useState(!1),a=St(e)?e.status:void 0,d=St(e)?e.statusText:void 0,u=(e==null?void 0:e.message)||d||(typeof e=="string"?e:"An unexpected error occurred."),h=e==null?void 0:e.stack,m=a===404||e==null,g=m?"We couldn't find that page":a?`Something went wrong (${a})`:"Something went wrong",b=m?"The page you're looking for doesn't exist or may have moved.":"An unexpected error stopped this page from rendering. You can try reloading, going back, or returning to the dashboard.",N=[`URL: ${o.pathname}${o.search}`,a?`Status: ${a} ${d||""}`:"",`Message: ${u}`,h?`
45
+ Stack:
46
+ ${h}`:""].filter(Boolean).join(`
47
+ `),j=async()=>{try{await navigator.clipboard.writeText(N),c(!0),setTimeout(()=>c(!1),1500)}catch{}};return s.jsx("div",{className:"min-h-screen w-full flex items-center justify-center px-4 py-12 bg-surface-0 text-gray-200",children:s.jsxs("div",{className:"w-full max-w-xl",children:[s.jsxs("div",{className:"flex flex-col items-center text-center animate-fade-in",children:[s.jsx("div",{className:["w-16 h-16 rounded-2xl flex items-center justify-center mb-5 ring-1",m?"bg-brand-500/10 ring-brand-500/30 text-brand-400":"bg-rose-500/10 ring-rose-500/30 text-rose-400"].join(" "),children:s.jsx(me,{size:28,strokeWidth:2})}),s.jsx("h1",{className:"text-2xl font-semibold text-gray-100 mb-2",children:g}),s.jsx("p",{className:"text-sm text-gray-400 max-w-md leading-relaxed",children:b})]}),s.jsxs("div",{className:"mt-7 flex flex-wrap items-center justify-center gap-2",children:[s.jsxs("button",{type:"button",onClick:()=>window.location.reload(),className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium bg-brand-500 hover:bg-brand-400 text-white transition-colors",children:[s.jsx(Io,{size:16}),"Reload page"]}),s.jsxs("button",{type:"button",onClick:()=>t(-1),className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium bg-surface-2 hover:bg-surface-3 text-gray-200 ring-1 ring-white/10 transition-colors",children:[s.jsx(Ce,{size:16}),"Go back"]}),s.jsxs(ce,{to:"/",className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium bg-surface-2 hover:bg-surface-3 text-gray-200 ring-1 ring-white/10 transition-colors",children:[s.jsx(Lo,{size:16}),"Dashboard"]})]}),!m&&s.jsxs("div",{className:"mt-8 rounded-xl bg-surface-1 ring-1 ring-white/10 overflow-hidden",children:[s.jsxs("button",{type:"button",onClick:()=>l(w=>!w),className:"w-full flex items-center justify-between px-4 py-3 text-left text-sm text-gray-300 hover:bg-surface-2/60 transition-colors",children:[s.jsxs("span",{className:"inline-flex items-center gap-2",children:[r?s.jsx(rt,{size:16}):s.jsx(ot,{size:16}),"Technical details"]}),r&&s.jsxs("span",{role:"button",tabIndex:0,onClick:w=>{w.stopPropagation(),j()},onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),w.stopPropagation(),j())},className:"inline-flex items-center gap-1.5 text-xs text-gray-400 hover:text-gray-200 cursor-pointer",children:[i?s.jsx(xe,{size:14,className:"text-emerald-400"}):s.jsx(dt,{size:14}),i?"Copied":"Copy"]})]}),r&&s.jsx("div",{className:"border-t border-white/10 bg-surface-0/40",children:s.jsx("pre",{className:"px-4 py-3 text-xs leading-relaxed text-gray-300 whitespace-pre-wrap break-words font-mono max-h-72 overflow-auto",children:N})})]}),!m&&s.jsx("p",{className:"mt-6 text-center text-xs text-gray-500",children:"If this keeps happening, copy the technical details above and share them with your administrator."})]})})}function L(e,t){const o=r=>{try{sessionStorage.removeItem(Ie)}catch{}return{default:t(r)}};return p.lazy(()=>e().then(o,async r=>{if(!await Ut()){for(;!await Ut();)await new Promise(i=>setTimeout(i,2e3));try{return o(await e())}catch{}}let l=!1;try{l=sessionStorage.getItem(Ie)==="1"}catch{}if(!l){try{sessionStorage.setItem(Ie,"1")}catch{}return window.location.reload(),new Promise(()=>{})}throw r}))}async function Ut(){try{return(await fetch("/api/health",{cache:"no-store"})).ok}catch{return!1}}const Ie="testver.chunkReload",u0=L(()=>I(()=>import("./Dashboard-DRWbVyTb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),e=>e.Dashboard),m0=L(()=>I(()=>import("./ModuleExplorer-BmkoQrHb.js"),__vite__mapDeps([12,1,3,13,4,14,15,7,16,17,18,11,19])),e=>e.ModuleExplorer),p0=L(()=>I(()=>import("./ProjectExplorer-B9B___ij.js"),__vite__mapDeps([20,1,3,13,4,14,15,7,16,17,18,11,19])),e=>e.ProjectExplorer),h0=L(()=>I(()=>import("./AdvancedPage-DB-6sJ6s.js"),__vite__mapDeps([21,1,22,3,23,4,24,11,25,26,27,28,29,30,31])),e=>e.AdvancedPage),g0=L(()=>I(()=>import("./AIPanel-D09Ni3a4.js"),__vite__mapDeps([32,1,14,4,25,29,30,9,2,3,33,34,35,11,8,36,22,37,38,39,40,15,7])),e=>e.AIPanel),f0=L(()=>I(()=>import("./AIRecordPanel-DZtUZnRe.js"),__vite__mapDeps([41,1,9,11,3,29,4,36,22,37,38,34,39,40,25,2])),e=>e.AIRecordPanel),x0=L(()=>I(()=>import("./ResultsPage-B4LwZH-R.js").then(e=>e.R),__vite__mapDeps([42,1,11,23,6,3,22,29,4,27,43,9,10,26,2,44,38,45,46,18])),e=>e.ResultsPage),b0=L(()=>I(()=>import("./OutputPage-Dcsr7cmr.js"),__vite__mapDeps([47,1,3,15,7,16,4])),e=>e.OutputPage),y0=L(()=>I(()=>import("./TestExplorerPage-BRRWtwde.js"),__vite__mapDeps([48,1,45,46,2,3,44,5,22,11,9,4,15,6,43,42,23,29,27,10,26,38,18,7,49,24,25,31,28])),e=>e.TestExplorerPage),w0=L(()=>I(()=>import("./CodeMapPage-DgU6ZYBO.js"),__vite__mapDeps([50,1,51,8,52,22,27,9,4,34,3])),e=>e.CodeMapPage),S0=L(()=>I(()=>import("./ManagePage-B8iG6Q0B.js"),__vite__mapDeps([53,1])),e=>e.ManagePage),v0=L(()=>I(()=>import("./PipelinesPanel-CMMXCSda.js"),__vite__mapDeps([54,1,3,29,4,43,22])),e=>e.PipelinesPage),j0=L(()=>I(()=>import("./SettingsPage-BwOiebKG.js"),__vite__mapDeps([55,1,11,3,4,22,43,17,30,33,29,39,27,44,40,56])),e=>e.SettingsPage),T0=L(()=>I(()=>import("./APITestingPage-Cdc8EZz2.js"),__vite__mapDeps([57,1,3,4,22,15,7,11,34,37])),e=>e.APITestingPage),N0=L(()=>I(()=>import("./GitPage-CQqV8JBC.js"),__vite__mapDeps([58,1,4,29,6,3,19,11])),e=>e.GitPage),k0=L(()=>I(()=>import("./UserManagementPage-BjY3ftxf.js"),__vite__mapDeps([59,1,11,3,4])),e=>e.UserManagementPage),C0=L(()=>I(()=>import("./AuditLogPage-DE45E_PV.js"),__vite__mapDeps([60,1,11,3,4])),e=>e.AuditLogPage),O0=L(()=>I(()=>import("./ProfilePage-ByshrcwC.js"),__vite__mapDeps([61,1,3,4])),e=>e.ProfilePage),P0=L(()=>I(()=>import("./WorkflowsPage-BUu-LjZ8.js"),__vite__mapDeps([62,1,11,22,4,34,3,8])),e=>e.WorkflowsPage),E0=L(()=>I(()=>import("./TestManagementPage-Ch4PthuU.js"),__vite__mapDeps([63,1,11,64,45,46,65,3,27,4,22,66,9,67,68,69])),e=>e.TestManagementPage),R0=L(()=>I(()=>import("./TestPlansPage-Bno2vpGd.js"),__vite__mapDeps([70,1,11,3,22,29,4,2,43,65,9,49,24,25,68,63,64,45,46,27,66,67,69,26])),e=>e.TestPlansPage),$0=L(()=>I(()=>import("./ScriptMappingPage-BrANeHv0.js"),__vite__mapDeps([71,1,22,29,4,65,3,9])),e=>e.ScriptMappingPage),A0=L(()=>I(()=>import("./AITestGenPage-Cg21-P1W.js"),__vite__mapDeps([72,1,3,65,4,27,69,68])),e=>e.AITestGenPage),I0=L(()=>I(()=>import("./CoveragePage-BpTjgcdV.js"),__vite__mapDeps([73,1,67,4,22,65,3,11])),e=>e.CoveragePage),L0=L(()=>I(()=>import("./AnalyticsPage-gTPFsiLZ.js"),__vite__mapDeps([74,1,3,22,67,4,65])),e=>e.AnalyticsPage),D0=L(()=>I(()=>import("./DefectsPage-BtMNbq6Z.js"),__vite__mapDeps([75,1,76,77,22,66,67,4,65,3,68])),e=>e.DefectsPage),M0=L(()=>I(()=>import("./ImportExportPage-DXk7Koaq.js"),__vite__mapDeps([64,1,45,46,65,3,27,4])),e=>e.ImportExportPage),_0=L(()=>I(()=>import("./SourcesPage-C_QVQwiA.js"),__vite__mapDeps([78,1,11,22,65,3,29,4,68])),e=>e.default),U0=L(()=>I(()=>import("./SharedReportView-BAbW1WOs.js"),__vite__mapDeps([79,1,11,35,4,8,34,3])),e=>e.SharedReportView),J0=L(()=>I(()=>import("./ReportsPage-CFv3OAhe.js"),__vite__mapDeps([80,1,11,30,29,4,31,27,3])),e=>e.ReportsPage),B0=L(()=>I(()=>import("./ReportFullView-Cg1rggho.js"),__vite__mapDeps([81,1,29,4,35,11,8,34,3])),e=>e.ReportFullView),Jt=L(()=>I(()=>import("./AboutPage-yJLCr2_q.js"),__vite__mapDeps([82,1,3,40,11,56,29,4])),e=>e.AboutPage),F0=e=>s.jsx(p.Suspense,{fallback:s.jsx(_n,{}),children:e}),G0=new so({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),z0=Qn([{path:"login",element:s.jsx(Xx,{}),errorElement:s.jsx(se,{})},{path:"forgot-password",element:s.jsx(t0,{}),errorElement:s.jsx(se,{})},{path:"reset-password",element:s.jsx(s0,{}),errorElement:s.jsx(se,{})},{path:"setup",element:s.jsx(o0,{}),errorElement:s.jsx(se,{})},{path:"reports/share/:token",element:F0(s.jsx(U0,{})),errorElement:s.jsx(se,{})},{element:s.jsx(l0,{children:s.jsx(Bx,{})}),errorElement:s.jsx(se,{}),children:[{index:!0,element:s.jsx(u0,{})},{path:"explorer",element:s.jsx(p0,{})},{path:"module/:moduleId",element:s.jsx(m0,{})},{path:"advanced",element:s.jsx(h0,{})},{path:"runner",element:s.jsx(Q,{to:"/advanced?tab=runner",replace:!0})},{path:"tests",element:s.jsx(y0,{})},{path:"code-map",element:s.jsx(w0,{})},{path:"data-map",element:s.jsx(Q,{to:"/code-map?view=data",replace:!0})},{path:"manage",element:s.jsx(S0,{})},{path:"environments",element:s.jsx(Q,{to:"/manage",replace:!0})},{path:"test-cases",element:s.jsx(E0,{})},{path:"test-plans",element:s.jsx(R0,{})},{path:"script-mapping",element:s.jsx($0,{})},{path:"ai-test-gen",element:s.jsx(A0,{})},{path:"sources",element:s.jsx(_0,{})},{path:"coverage",element:s.jsx(I0,{})},{path:"analytics",element:s.jsx(L0,{})},{path:"defects",element:s.jsx(D0,{})},{path:"import-export",element:s.jsx(M0,{})},{path:"connectors",element:s.jsx(Q,{to:"/settings?tab=connectors",replace:!0})},{path:"results",element:s.jsx(x0,{})},{path:"output",element:s.jsx(b0,{})},{path:"api-testing",element:s.jsx(T0,{})},{path:"cicd",element:s.jsx(Q,{to:"/pipelines",replace:!0})},{path:"pipelines",element:s.jsx(v0,{})},{path:"schedules",element:s.jsx(Q,{to:"/advanced?tab=schedules",replace:!0})},{path:"git",element:s.jsx(N0,{})},{path:"ai",element:s.jsx(g0,{})},{path:"ai-record",element:s.jsx(f0,{})},{path:"reports",element:s.jsx(J0,{})},{path:"reports/view/:id",element:s.jsx(B0,{})},{path:"skills",element:s.jsx(Q,{to:"/ai",replace:!0})},{path:"workflows",element:s.jsx(P0,{})},{path:"settings",element:s.jsx(Ae,{minRole:"viewer",children:s.jsx(j0,{})})},{path:"profile",element:s.jsx(O0,{})},{path:"testver",element:s.jsx(Jt,{})},{path:"testver/about",element:s.jsx(Jt,{})},{path:"about",element:s.jsx(Q,{to:"/testver/about",replace:!0})},{path:"users",element:s.jsx(Ae,{minRole:"admin",children:s.jsx(k0,{})})},{path:"audit",element:s.jsx(Ae,{minRole:"admin",children:s.jsx(C0,{})})},{path:"*",element:s.jsx(se,{})}]}]);function q0(){return s.jsx(no,{client:G0,children:s.jsx(sx,{children:s.jsx(Jf,{children:s.jsx(Xn,{router:z0})})})})}zf();Zn.createRoot(document.getElementById("root")).render(s.jsx(p.StrictMode,{children:s.jsx(q0,{})}));export{di as $,xa as A,Ff as B,Ea as C,Cc as D,Pa as E,Pd as F,$d as G,Nd as H,Rd as I,Cd as J,Od as K,_n as L,kd as M,En as N,Yf as O,nx as P,pi as Q,gx as R,fi as S,Si as T,gi as U,vi as V,wi as W,xi as X,ci as Y,li as Z,ui as _,Ho as a,Oi as a$,Qc as a0,qo as a1,mc as a2,ft as a3,On as a4,_u as a5,im as a6,Xa as a7,Y as a8,hc as a9,re as aA,ki as aB,Di as aC,lc as aD,Ji as aE,Ui as aF,Li as aG,dc as aH,ic as aI,ec as aJ,Fi as aK,Xi as aL,Zi as aM,$i as aN,Mi as aO,nc as aP,sc as aQ,tc as aR,Pc as aS,Ii as aT,Gi as aU,Ni as aV,zi as aW,qi as aX,Ai as aY,Wi as aZ,Ki as a_,ml as aa,pl as ab,hl as ac,Wc as ad,gl as ae,fl as af,Kc as ag,pc as ah,yc as ai,um as aj,gc as ak,xl as al,Hc as am,bl as an,xt as ao,Ct as ap,Fl as aq,Wl as ar,ql as as,Gl as at,ac as au,uc as av,cc as aw,rc as ax,Il as ay,Ll as az,bt as b,Lf as b$,Ri as b0,Ei as b1,Hi as b2,_i as b3,I as b4,be as b5,vc as b6,vl as b7,Wo as b8,zl as b9,Ti as bA,Yi as bB,Qi as bC,Bi as bD,pf as bE,yf as bF,wf as bG,Sf as bH,gf as bI,hf as bJ,ff as bK,bf as bL,gh as bM,hs as bN,Kr as bO,rp as bP,gp as bQ,Zo as bR,Qg as bS,Pf as bT,Db as bU,Lr as bV,Dr as bW,Mr as bX,Qo as bY,ta as bZ,sa as b_,Vl as ba,Kl as bb,Tl as bc,Jl as bd,Ul as be,Sl as bf,Bl as bg,Yl as bh,jl as bi,wl as bj,Al as bk,El as bl,Ml as bm,Pl as bn,_l as bo,Dl as bp,Nl as bq,Cl as br,kl as bs,Rl as bt,$l as bu,Tc as bv,kc as bw,Nc as bx,Vi as by,ji as bz,Bb as c,Ic as c$,Kh as c0,Hh as c1,eb as c2,ab as c3,Ed as c4,Qa as c5,Xo as c6,ib as c7,Ba as c8,Va as c9,Qr as cA,Fr as cB,xr as cC,Hr as cD,Zr as cE,ei as cF,Xr as cG,Gr as cH,zr as cI,qr as cJ,Wr as cK,Lc as cL,_c as cM,Fc as cN,zc as cO,qp as cP,Jc as cQ,Mc as cR,Bc as cS,Gc as cT,Dc as cU,Dp as cV,zp as cW,Wg as cX,Ac as cY,Uc as cZ,qc as c_,rb as ca,Ya as cb,Ka as cc,Cf as cd,Of as ce,Ef as cf,Rf as cg,$f as ch,Af as ci,Df as cj,Nf as ck,If as cl,jr as cm,wr as cn,Tr as co,Sr as cp,Cr as cq,kr as cr,Nr as cs,Or as ct,Vr as cu,gr as cv,hr as cw,fr as cx,yr as cy,Yr as cz,Cn as d,ex as d$,mt as d0,Eb as d1,ru as d2,q as d3,Ub as d4,iu as d5,Xu as d6,Uu as d7,Bu as d8,Ju as d9,gd as dA,hd as dB,Zl as dC,td as dD,id as dE,ad as dF,od as dG,Ql as dH,sd as dI,cd as dJ,rd as dK,Zg as dL,ef as dM,tf as dN,sf as dO,nf as dP,Hf as dQ,Sd as dR,bd as dS,yd as dT,bi as dU,yi as dV,kt as dW,tx as dX,mr as dY,ar as dZ,pr as d_,qu as da,zu as db,Ku as dc,Hu as dd,Gu as de,Wu as df,bm as dg,gm as dh,hm as di,mm as dj,cm as dk,lm as dl,ym as dm,dm as dn,pm as dp,Pr as dq,Er as dr,Rr as ds,$r as dt,Ir as du,Ar as dv,ld as dw,ud as dx,pd as dy,md as dz,sb as e,wb as e$,_b as e0,lr as e1,ur as e2,dr as e3,Vo as e4,uu as e5,wu as e6,gu as e7,Mb as e8,sr as e9,Bd as eA,Xd as eB,Zd as eC,le as eD,nu as eE,Kd as eF,ou as eG,Qd as eH,au as eI,tu as eJ,su as eK,Wd as eL,qd as eM,zd as eN,X0 as eO,Sb as eP,jb as eQ,Ab as eR,$b as eS,Ib as eT,Ln as eU,ox as eV,Lb as eW,Pb as eX,Z0 as eY,cb as eZ,Tb as e_,rr as ea,Yo as eb,ea as ec,mu as ed,Su as ee,vu as ef,Ko as eg,ie as eh,ua as ei,la as ej,pa as ek,ma as el,ha as em,ga as en,Ad as eo,Id as ep,_d as eq,Hd as er,Ld as es,Md as et,Dd as eu,Jd as ev,Fd as ew,Ud as ex,Vd as ey,Yd as ez,ob as f,wm as f$,vb as f0,Nb as f1,kb as f2,Ob as f3,lu as f4,cu as f5,bb as f6,lb as f7,db as f8,pb as f9,Eu as fA,Ru as fB,$u as fC,Au as fD,Iu as fE,Du as fF,Lu as fG,Mu as fH,bu as fI,yu as fJ,Wn as fK,Tn as fL,jn as fM,Qx as fN,fu as fO,xu as fP,qn as fQ,hu as fR,Tu as fS,Cu as fT,ju as fU,pu as fV,Nu as fW,ku as fX,Gf as fY,ti as fZ,xm as f_,ub as fa,du as fb,Kf as fc,tb as fd,Vf as fe,mb as ff,xb as fg,yb as fh,hb as fi,gb as fj,Jb as fk,Rb as fl,Cb as fm,fb as fn,ka as fo,Ca as fp,$a as fq,La as fr,Aa as fs,Ia as ft,Ja as fu,Ua as fv,Da as fw,_a as fx,Ou as fy,Pu as fz,na as g,hp as g$,Em as g0,km as g1,Cm as g2,Pm as g3,Om as g4,Am as g5,Im as g6,Jm as g7,zm as g8,Fm as g9,yh as gA,xh as gB,Th as gC,Nh as gD,vh as gE,mp as gF,fh as gG,mi as gH,nl as gI,sl as gJ,ol as gK,Xc as gL,Rg as gM,Eg as gN,Ig as gO,Mg as gP,Ag as gQ,Zm as gR,Qm as gS,sp as gT,bp as gU,Ip as gV,ap as gW,cp as gX,lp as gY,pp as gZ,dp as g_,Gm as ga,Bm as gb,qm as gc,Rm as gd,Sm as ge,Nm as gf,jm as gg,Dm as gh,Wm as gi,vm as gj,Lm as gk,Mm as gl,Um as gm,_m as gn,Tm as go,eg as gp,Tg as gq,nd as gr,Os as gs,Oc as gt,Rc as gu,Dg as gv,up as gw,bh as gx,Sh as gy,wh as gz,Dn as h,sg as h$,Mp as h0,Fp as h1,Vp as h2,Up as h3,Bp as h4,Hp as h5,Qp as h6,Kp as h7,Gg as h8,zg as h9,yg as hA,Cg as hB,nh as hC,Bg as hD,bg as hE,Sg as hF,kg as hG,Pg as hH,Xp as hI,Zp as hJ,eh as hK,th as hL,Vg as hM,Yg as hN,Lp as hO,_p as hP,Gp as hQ,Wp as hR,Jp as hS,$h as hT,Lh as hU,qh as hV,Jh as hW,Bh as hX,zh as hY,Gh as hZ,Fh as h_,Hg as ha,Kg as hb,Zh as hc,ah as hd,ih as he,rh as hf,lh as hg,dh as hh,ph as hi,uh as hj,jh as hk,Xh as hl,Yh as hm,Qh as hn,tg as ho,fg as hp,xg as hq,Jg as hr,tp as hs,op as ht,ip as hu,fp as hv,Sp as hw,xp as hx,Cp as hy,Rp as hz,ra as i,ng as i0,og as i1,ag as i2,Pp as i3,jg as i4,vg as i5,Ng as i6,_h as i7,Mh as i8,Rh as i9,nr as iA,or as iB,Za as iC,er as iD,Wa as iE,Y0 as iF,Ih as ia,Dh as ib,jf as ic,of as id,af as ie,lf as ig,cf as ih,df as ii,rf as ij,mf as ik,uf as il,Lg as im,al as io,rl as ip,Yc as iq,Vc as ir,Zc as is,el as it,ul as iu,ll as iv,dl as iw,cl as ix,tl as iy,Q0 as iz,G as j,js as k,wa as l,Sa as m,_r as n,Ex as o,Ur as p,Jr as q,oa as r,ba as s,Br as t,nb as u,cr as v,mx as w,Zf as x,fd as y,dd as z};