@capagents/forgeqe 2.8.3 → 2.8.5

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 (77) hide show
  1. package/HOW_TO_USE.md +5 -0
  2. package/dist/docs-site/docs/index.html +4 -0
  3. package/dist/docs-site/docs/search.js +1 -1
  4. package/dist/forgeqe.js +1605 -1603
  5. package/dist/web/assets/Agent-D8H4GQqN.js +4 -0
  6. package/dist/web/assets/ApiTests-CWqanyU_.js +10 -0
  7. package/dist/web/assets/Chat-C0xpL7po.js +3 -0
  8. package/dist/web/assets/{CommandPalette-BhfezPoz.js → CommandPalette-KUx-yMp_.js} +1 -1
  9. package/dist/web/assets/{Cost-Cc_L26oj.js → Cost-CkRettF6.js} +1 -1
  10. package/dist/web/assets/Data-DNzLSp63.js +6 -0
  11. package/dist/web/assets/Evidence-DzzA0pJV.js +1 -0
  12. package/dist/web/assets/{Explore-sox3fD4D.js → Explore-DEpzpdkj.js} +2 -2
  13. package/dist/web/assets/Features-Bzje_5As.js +1 -0
  14. package/dist/web/assets/Flags-xUvz1QHr.js +2 -0
  15. package/dist/web/assets/Flaky-BFnVLi7W.js +1 -0
  16. package/dist/web/assets/{ForceGraph-2aiOo87M.js → ForceGraph-DVfDfy7Y.js} +1 -1
  17. package/dist/web/assets/Impact-BvRUudsB.js +3 -0
  18. package/dist/web/assets/Jobs-DLPS5xnJ.js +5 -0
  19. package/dist/web/assets/KindPage-BFX76RUt.js +6 -0
  20. package/dist/web/assets/Migration-64HvSMZo.js +2 -0
  21. package/dist/web/assets/Product-07coKIAf.js +7 -0
  22. package/dist/web/assets/Production-Bj_uz9hT.js +1 -0
  23. package/dist/web/assets/Quality-De99Esv0.js +1 -0
  24. package/dist/web/assets/{Readiness-C1N9Zp2l.js → Readiness-CwdvybGl.js} +1 -1
  25. package/dist/web/assets/Record-CxbGHIHP.js +2 -0
  26. package/dist/web/assets/Regression-CRE2UEhg.js +5 -0
  27. package/dist/web/assets/{Reports-CgOedv6o.js → Reports-NMLgQnIX.js} +2 -2
  28. package/dist/web/assets/Response-B_YF1EA8.js +4 -0
  29. package/dist/web/assets/{RunDiff-BbBgHbMC.js → RunDiff-DF8c2dBn.js} +1 -1
  30. package/dist/web/assets/Runs-CBuhWb7S.js +2 -0
  31. package/dist/web/assets/TestCases-CKTFzk6l.js +1 -0
  32. package/dist/web/assets/TestData-DoYuREXo.js +2 -0
  33. package/dist/web/assets/TestDebt-Ce7PUROD.js +1 -0
  34. package/dist/web/assets/Tosca-DBj7j-jL.js +2 -0
  35. package/dist/web/assets/{WhatsNew-BsvxN0Yt.js → WhatsNew-DwoYoM_4.js} +1 -1
  36. package/dist/web/assets/agentIconBodies-Cpn22UTR.js +1 -0
  37. package/dist/web/assets/{dataParts-ETs85ZuU.js → dataParts-CsXXLImJ.js} +3 -3
  38. package/dist/web/assets/{families-Ch_yMomw.js → families-D1xiKkTa.js} +1 -1
  39. package/dist/web/assets/frame-D6-mukAC.js +4 -0
  40. package/dist/web/assets/index-CQaKWOwX.js +45 -0
  41. package/dist/web/assets/index-D2XiTaRH.css +2 -0
  42. package/dist/web/assets/{logos-BfGnwAtP.js → logos-CAM1NTNS.js} +1 -1
  43. package/dist/web/assets/{parts-CpuOW4Wd.js → parts-C-cHoGBa.js} +1 -1
  44. package/dist/web/assets/{productParts-DdgyljLs.js → productParts-DxYwA64l.js} +1 -1
  45. package/dist/web/assets/{qualityParts-H50uxgIc.js → qualityParts-BDSq6Q05.js} +1 -1
  46. package/dist/web/assets/{segmented-DVt7_NPz.js → segmented-CqVJLxy-.js} +1 -1
  47. package/dist/web/assets/{thread-CvTcakQw.js → thread-Cqqn51v8.js} +1 -1
  48. package/dist/web/assets/{usePageChat-CiEt74za.js → usePageChat-BiWHDk1V.js} +1 -1
  49. package/dist/web/index.html +3 -3
  50. package/docs/CUSTOM_AGENTS_FIRST_RUN.md +10 -0
  51. package/package.json +1 -1
  52. package/dist/web/assets/Agent-soXhY9g_.js +0 -4
  53. package/dist/web/assets/ApiTests-BcC3NDc-.js +0 -10
  54. package/dist/web/assets/Chat-DDo__FJs.js +0 -3
  55. package/dist/web/assets/Data-guLRqAf5.js +0 -6
  56. package/dist/web/assets/Evidence-BXMNm-K9.js +0 -1
  57. package/dist/web/assets/Features-B6J6SNuK.js +0 -1
  58. package/dist/web/assets/Flags-DEwb0FYm.js +0 -2
  59. package/dist/web/assets/Flaky-BgxKLCzC.js +0 -1
  60. package/dist/web/assets/Impact-Bs0qSabB.js +0 -3
  61. package/dist/web/assets/Jobs-B6azw_sf.js +0 -5
  62. package/dist/web/assets/KindPage-C3dRZIbc.js +0 -6
  63. package/dist/web/assets/Migration-Cag9T0yR.js +0 -2
  64. package/dist/web/assets/Product-WaYVsMcG.js +0 -7
  65. package/dist/web/assets/Production-C9Lx2TVR.js +0 -1
  66. package/dist/web/assets/Quality-B98dlQzR.js +0 -1
  67. package/dist/web/assets/Record-ChP3_Hcg.js +0 -2
  68. package/dist/web/assets/Regression-UxRIR6bf.js +0 -5
  69. package/dist/web/assets/Response-DGb8gRCU.js +0 -4
  70. package/dist/web/assets/Runs-ukSjEJSA.js +0 -2
  71. package/dist/web/assets/TestCases-Q82IxEjr.js +0 -1
  72. package/dist/web/assets/TestData-BHCcKNhO.js +0 -2
  73. package/dist/web/assets/TestDebt-DK4tT8Yz.js +0 -1
  74. package/dist/web/assets/Tosca-BVHomdto.js +0 -2
  75. package/dist/web/assets/frame-I2oY7L19.js +0 -4
  76. package/dist/web/assets/index-BOLnH0rJ.js +0 -45
  77. package/dist/web/assets/index-D_Rdwtap.css +0 -2
@@ -1 +0,0 @@
1
- import{$i as e,Fr as t,Jr as n,Ln as r,Nt as i,Yr as a,ct as o,en as s,ft as c,ga as l,ho as u,it as d,kt as f,lo as p,ma as m,nr as h,nt as g,ot as _,po as v,r as y,t as b,tt as x,vo as S,vt as C,wa as w,yt as T}from"./frame-I2oY7L19.js";import{d as E,r as D}from"./index-BOLnH0rJ.js";var O=S(u(),1),k=v(),A=[{id:`azure_devops`,label:`Azure DevOps`},{id:`jira`,label:`Jira`},{id:`testrail`,label:`TestRail`},{id:`zephyr`,label:`Zephyr Scale`},{id:`qtest`,label:`qTest`}],j=e=>A.some(t=>t.id===e),M=e=>e&&E(e)===`web`?e:void 0,N=(e,t)=>`${e} ${t}${e===1?``:`s`}`,P=e=>`${e.kind}:${e.id}`;function F(e){return e.found===`reuse`||e.kind===`link`?`Link`:e.found===`extends`||e.kind===`extend`?`Add ${N((e.insert??[]).reduce((e,t)=>e+t.steps.length,0),`step`)}`:`Update steps`}function I(e,t){let n=`Story ${t} asks for it: ${e.wrote}`,r=e.link?{link:!0}:{};return e.kind===`link`?{kind:`link`,id:e.id}:e.kind===`extend`?{kind:`extend`,id:e.id,insert:e.insert??[],reason:n,...r}:{kind:`update`,id:e.id,steps:e.steps??[],reason:n,...r}}function L(){let[e,t]=(0,O.useState)(A.map(e=>e.id)),[n,r]=(0,O.useState)(``);return(0,O.useEffect)(()=>{w.settings().then(e=>{let n=e.config.sources??{},r=A.map(e=>e.id).filter(e=>n[e]&&typeof n[e]==`object`);r.length&&t(r)},e=>r(`The settings could not be read, so every system is offered: ${e.message}`))},[]),{systems:A.filter(t=>e.includes(t.id)),error:n}}function R({id:e,icon:t,title:n,children:r}){return(0,k.jsxs)(`section`,{"aria-labelledby":e,className:`flex min-w-0 flex-col gap-3`,children:[(0,k.jsxs)(`h2`,{id:e,className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[(0,k.jsx)(s,{icon:t,size:18,className:`text-accent-fg`}),n]}),r]})}function z({view:i,onApplied:o,onError:s}){let[c,u]=(0,O.useState)([]),[f,v]=(0,O.useState)(null),[y,b]=(0,O.useState)(!1),[S,C]=(0,O.useState)(null),w=i.story.id,T=i.proposals.filter(e=>c.includes(P(e))),E=async()=>{let e=T.map(e=>I(e,w));b(!0);try{let t=await p.preview(i.system,w,e);v({lines:t.lines,changes:e}),s(``)}catch(e){s(e.message)}finally{b(!1)}},j=async()=>{if(f){b(!0);try{let e=await p.apply(i.system,w,f.changes);C({applied:e.applied,failed:e.failed}),v(null),u([]),s(``),o()}catch(e){s(e.message)}finally{b(!1)}}},L=M(i.story.url);return(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,k.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-lg font-semibold [overflow-wrap:anywhere]`,children:[L?(0,k.jsxs)(`a`,{href:L,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[w,(0,k.jsx)(h,{size:14,"aria-hidden":`true`})]}):(0,k.jsx)(`span`,{children:w}),i.story.title&&(0,k.jsx)(`span`,{className:`font-normal text-ink-2`,children:i.story.title})]}),i.changed&&(0,k.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,"data-tip":new Date(i.changed.when).toLocaleString(),children:[`The story's `,i.changed.field,` changed `,D(i.changed.when),`.`]})]}),(0,k.jsx)(R,{id:`cases-h`,icon:n,title:`Linked cases`,children:(0,k.jsx)(x,{label:`Linked cases`,empty:`No test case is linked to this story.`,head:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`th`,{className:d,children:`Case`}),(0,k.jsx)(`th`,{className:d,children:`Title`}),(0,k.jsx)(`th`,{className:l(d,`text-right`),children:`Steps`}),(0,k.jsx)(`th`,{className:d,children:`State`})]}),children:i.cases.map(t=>{let n=M(t.url);return(0,k.jsxs)(`tr`,{className:_,children:[(0,k.jsx)(`td`,{className:l(g,`whitespace-nowrap`),children:n?(0,k.jsxs)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[t.id,(0,k.jsx)(h,{size:12,"aria-hidden":`true`})]}):t.id}),(0,k.jsx)(`td`,{className:l(g,`[overflow-wrap:anywhere]`),children:t.title}),(0,k.jsx)(`td`,{className:l(g,`text-right tabular-nums`),children:t.steps}),(0,k.jsx)(`td`,{className:l(g,t.stale?`text-warn`:`text-muted`),children:t.stale?(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,k.jsx)(e,{size:13,"aria-hidden":`true`,className:`flex-none`}),`older than the story's last change`]}):t.changed?(0,k.jsxs)(`span`,{"data-tip":new Date(t.changed).toLocaleString(),children:[`changed `,D(t.changed)]}):`–`})]},t.id)})})}),(0,k.jsx)(R,{id:`criteria-h`,icon:r,title:`Acceptance criteria`,children:(0,k.jsx)(x,{label:`Acceptance criteria`,empty:`No acceptance criteria were read for this story.`,head:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`th`,{className:d,children:`Criterion`}),(0,k.jsx)(`th`,{className:d,children:`Cases`})]}),children:i.criteria.map((e,t)=>(0,k.jsxs)(`tr`,{className:_,children:[(0,k.jsx)(`td`,{className:l(g,`[overflow-wrap:anywhere]`),children:e.text}),(0,k.jsx)(`td`,{className:l(g,e.cases.length?`text-ink-2`:`text-warn`),children:e.cases.length?e.cases.join(`, `):`no case`})]},t))})}),(0,k.jsxs)(R,{id:`proposals-h`,icon:a,title:`Proposed changes`,children:[(0,k.jsx)(x,{label:`Proposed changes`,empty:`No change is waiting. save_test_cases in a chat proposes them.`,tools:(0,k.jsxs)(m,{size:`sm`,variant:`primary`,disabled:y||!T.length||!!f,onClick:()=>void E(),children:[`Review `,N(T.length,`change`)]}),head:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`th`,{className:l(d,`w-10`),children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Pick`})}),(0,k.jsx)(`th`,{className:d,children:`Change`}),(0,k.jsx)(`th`,{className:d,children:`Existing case`}),(0,k.jsx)(`th`,{className:d,children:`The agent wrote`})]}),children:i.proposals.map(e=>{let t=P(e);return(0,k.jsxs)(`tr`,{className:_,children:[(0,k.jsx)(`td`,{className:g,children:(0,k.jsx)(`input`,{type:`checkbox`,"aria-label":`${F(e)}: ${e.id} ${e.title}`,checked:c.includes(t),disabled:y||!!f,onChange:e=>u(e.target.checked?[...c,t]:c.filter(e=>e!==t))})}),(0,k.jsxs)(`td`,{className:l(g,`whitespace-nowrap font-medium`),children:[F(e),e.link&&e.kind!==`link`&&(0,k.jsx)(`span`,{className:`block text-[12px] font-normal text-muted`,children:`and link it`})]}),(0,k.jsxs)(`td`,{className:l(g,`[overflow-wrap:anywhere]`),children:[(0,k.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2`,children:e.id}),` `,e.title]}),(0,k.jsx)(`td`,{className:l(g,`text-ink-2 [overflow-wrap:anywhere]`),children:e.wrote})]},t)})}),f&&(0,k.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Apply the changes`,className:`flex flex-col gap-2 rounded-[10px] border border-accent-line bg-accent-soft p-3 text-[13px]`,children:[(0,k.jsxs)(`span`,{className:`font-medium`,children:[`Apply `,N(f.changes.length,`change`),` to `,A.find(e=>e.id===i.system)?.label,`?`]}),(0,k.jsx)(`ul`,{className:`m-0 flex flex-col gap-1 pl-5 text-ink-2`,children:f.lines.map((e,t)=>(0,k.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}),(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,k.jsx)(m,{size:`sm`,variant:`primary`,disabled:y,onClick:()=>void j(),children:`Apply`}),(0,k.jsx)(m,{size:`sm`,disabled:y,onClick:()=>v(null),children:`Cancel`})]})]}),S&&S.applied.length>0&&(0,k.jsxs)(`p`,{role:`status`,className:`m-0 text-[13px] text-pass`,children:[`Applied: `,S.applied.join(`, `)]}),S&&S.failed.length>0&&(0,k.jsxs)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:[`Not applied: `,S.failed.map(e=>`${e.id||`a change`}: ${e.error}`).join(`; `)]})]}),(0,k.jsx)(R,{id:`changes-h`,icon:t,title:`Recent changes`,children:i.changes.length?(0,k.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px] text-ink-2`,children:i.changes.map((e,t)=>(0,k.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}):(0,k.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`ForgeQE has not changed this story's cases.`})}),i.notes.map((e,t)=>(0,k.jsx)(`p`,{className:`m-0 text-[13px] text-muted [overflow-wrap:anywhere]`,children:e},t))]})}function B({sub:e}){let{systems:t,error:r}=L(),a=e?e.indexOf(`/`):-1,s=a>0?e.slice(0,a):e,u=j(s)?s:void 0,d=u&&a>0?decodeURIComponent(e.slice(a+1)):``,[h,g]=(0,O.useState)(u??`azure_devops`),[_,v]=(0,O.useState)(d),[x,S]=(0,O.useState)(null),[w,E]=(0,O.useState)(``),[D,A]=(0,O.useState)(!1);(0,O.useEffect)(()=>{u&&g(u),v(d)},[u,d]),(0,O.useEffect)(()=>{!u&&t.length&&!t.some(e=>e.id===h)&&g(t[0].id)},[t,h,u]);let M=(0,O.useCallback)(()=>{!u||!d?S(null):(A(!0),p.view(u,d).then(e=>{S(e),E(``),A(!1)},e=>{E(e.message),A(!1)}))},[u,d]);return(0,O.useEffect)(()=>S(null),[u,d]),(0,O.useEffect)(M,[M]),(0,k.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,k.jsx)(y,{}),(0,k.jsxs)(`main`,{className:l(b,`@container flex-auto gap-4`),children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(f,{pixel:T[`test-cases`],size:`lg`}),(0,k.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Test cases`})]}),(0,k.jsxs)(`p`,{className:`m-0 max-w-[80ch] text-[13px] leading-relaxed text-ink-2`,children:[`A story's test cases in your test management system: which are older than the story's last change, which acceptance criteria no case covers, and the changes save_test_cases proposed. Tick the ones to make; nothing is written until you review and apply them. The tests that run them are on `,(0,k.jsx)(`a`,{href:i(`regression`),children:`Regression`}),`; their results on `,(0,k.jsx)(`a`,{href:i(`runs`),children:`Runs`}),`.`]}),(0,k.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=_.trim();if(!t)return;let n=i(`test-cases`,h,encodeURIComponent(t));location.hash===n?M():location.hash=n},className:`flex flex-col gap-3`,children:[(0,k.jsx)(`div`,{role:`group`,"aria-label":`System`,className:`flex flex-wrap gap-1.5`,children:(0,k.jsx)(o,{items:t,value:h,onChange:g})}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,k.jsxs)(`label`,{className:`flex min-w-0 flex-[0_1_320px] flex-col gap-1 text-[13px] font-medium`,children:[`Story`,(0,k.jsx)(c,{value:_,maxLength:120,spellCheck:!1,placeholder:h===`azure_devops`?`1234`:h===`qtest`?`5678`:h===`testrail`?`R12`:`SHOP-12`,onChange:e=>v(e.target.value)})]}),(0,k.jsx)(m,{type:`submit`,variant:`primary`,disabled:!_.trim()||D,children:`Open`})]})]}),[r,w].filter(Boolean).map(e=>(0,k.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:e},e)),D&&(0,k.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),x&&(0,k.jsx)(z,{view:x,onApplied:M,onError:E},`${x.system}:${x.story.id}`),!d&&!x&&(0,k.jsx)(C,{icon:n,title:`No story opened yet`,children:`Pick the system and type a story's id to see its linked test cases, its acceptance criteria and which cases trace to them. When save_test_cases runs in a chat for a story, the changes it proposes to existing cases show here to apply.`})]})]})}export{B as TestCases};
@@ -1,2 +0,0 @@
1
- import{En as e,Na as t,Nt as n,Ri as r,Xi as i,_a as a,_o as o,_t as s,an as c,at as l,ct as u,en as d,ft as f,ga as p,ha as m,ho as h,it as g,ka as _,kt as v,ma as y,nt as b,po as x,pt as S,r as C,ri as w,rt as T,st as E,t as D,tt as O,vo as k,vr as A,vt as j,wi as M,wn as N,yt as P}from"./frame-I2oY7L19.js";import{r as F}from"./index-BOLnH0rJ.js";import{n as I}from"./segmented-DVt7_NPz.js";import{a as L,c as R,f as z,i as B,n as V,o as H,r as U,s as W,t as G,u as K}from"./dataParts-ETs85ZuU.js";var q=o({Requests:()=>$,TestData:()=>ie}),J=k(h(),1),Y=x(),X=[`requests`,`kept`,`specs`,`batches`],Z={fetch:`kept`,request:`requests`,gen:`specs`,files:`specs`,insert:`specs`,batches:`batches`,clean:`batches`},Q=e=>Object.values(e.row_counts||{}).reduce((e,t)=>e+t,0);function ee({e,kept:t,busy:n,act:r}){return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 px-1 py-2`,children:[(0,Y.jsxs)(`dl`,{className:`m-0 grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-[13px]`,children:[(0,Y.jsx)(`dt`,{className:`text-muted`,children:`Asked for`}),(0,Y.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:e.need}),(0,Y.jsx)(`dt`,{className:`text-muted`,children:`When`}),(0,Y.jsxs)(`dd`,{className:`m-0`,children:[new Date(e.at).toLocaleString(),e.ms===void 0?``:` · answered in ${(e.ms/1e3).toFixed(1)} s`]}),(0,Y.jsx)(`dt`,{className:`text-muted`,children:`How`}),(0,Y.jsxs)(`dd`,{className:`m-0`,children:[e.source===`fetch`?`A kept request fetched again, with no model`:`Asked the DB agent for ${e.asked===`existing`?`existing rows`:e.asked===`new`?`new rows`:`either`}`,e.name?(0,Y.jsxs)(Y.Fragment,{children:[` · `,(0,Y.jsx)(`span`,{className:`font-mono text-[12px]`,children:e.name})]}):null]}),e.why&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`dt`,{className:`text-muted`,children:`The answer`}),(0,Y.jsx)(`dd`,{className:`m-0`,children:e.why})]})]}),e.error&&(0,Y.jsx)(R,{text:e.error}),Object.entries(e.sample||{}).map(([t,n])=>(0,Y.jsx)(K,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium`,children:`The query`}),(0,Y.jsx)(V,{label:`SQL`,children:e.sql})]}),e.script_preview?.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script`}),(0,Y.jsx)(V,{label:`INSERT script`,children:e.script_preview.join(`
2
- `)})]}):null,t&&e.name&&(0,Y.jsx)(`div`,{children:(0,Y.jsxs)(y,{size:`sm`,disabled:n,onClick:()=>r(`fetch`,{name:e.name}),children:[(0,Y.jsx)(M,{"aria-hidden":`true`}),`Fetch again`]})})]})}function $({view:t,log:r,busy:i,act:a}){let[o,c]=(0,J.useState)(`all`),[d,f]=(0,J.useState)(``),[h,_]=(0,J.useState)(``),[v,y]=(0,J.useState)(``),x=r??[],C=(0,J.useMemo)(()=>[...new Set(x.map(e=>e.requester))].sort(),[r]),w=(0,J.useMemo)(()=>[...new Set(x.map(e=>e.database).filter(Boolean))].sort(),[r]),D=x.filter(e=>!e.ok).length,k=x.filter(e=>(o===`all`||o===`ok`===e.ok)&&(!d||e.requester===d)&&(!h||e.database===h)),M=new Set(t.requests.map(e=>e.name));return r===null?(0,Y.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading the requests…`}):x.length?(0,Y.jsx)(O,{label:`Requests`,resetKey:`${o}|${d}|${h}`,minWidth:760,fixed:!0,placeholder:`Find a request`,tools:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(u,{value:o,onChange:c,items:[{id:`all`,label:`All`,n:x.length},{id:`ok`,label:`Answered`,n:x.length-D},{id:`failed`,label:`Failed`,n:D,alert:!0}]}),C.length>1&&(0,Y.jsxs)(S,{size:`sm`,"aria-label":`Who asked`,value:d,onChange:e=>f(e.target.value),className:`w-[180px]`,children:[(0,Y.jsx)(`option`,{value:``,children:`Anyone`}),C.map(e=>(0,Y.jsx)(`option`,{children:e},e))]}),w.length>1&&(0,Y.jsxs)(S,{size:`sm`,"aria-label":`Database`,value:h,onChange:e=>_(e.target.value),className:`w-[160px]`,children:[(0,Y.jsx)(`option`,{value:``,children:`Any database`}),w.map(e=>(0,Y.jsx)(`option`,{children:e},e))]})]}),head:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`th`,{className:p(g,`w-9`),children:(0,Y.jsx)(`span`,{className:`sr-only`,children:`Open`})}),(0,Y.jsx)(`th`,{className:p(g,`w-[110px]`),children:`When`}),(0,Y.jsx)(`th`,{className:p(g,`w-[150px]`),children:`Who asked`}),(0,Y.jsx)(`th`,{className:g,children:`What for`}),(0,Y.jsx)(`th`,{className:p(g,`w-[110px]`),children:`Database`}),(0,Y.jsx)(`th`,{className:p(g,`w-[140px]`),children:`Answer`}),(0,Y.jsx)(`th`,{className:p(l,`w-[70px]`),children:`Rows`})]}),empty:`No requests match these filters. Pick All and Anyone to see every request.`,children:k.map(t=>{let n=v===t.id;return(0,Y.jsxs)(J.Fragment,{children:[(0,Y.jsxs)(`tr`,{className:p(E,n&&`bg-surface-muted`),onClick:()=>y(n?``:t.id),children:[(0,Y.jsx)(`td`,{className:p(b,`pr-0`),children:(0,Y.jsx)(`button`,{type:`button`,"aria-expanded":n,"aria-label":n?`Close the request`:`Open the request`,onClick:e=>(e.stopPropagation(),y(n?``:t.id)),className:`flex cursor-pointer items-center border-0 bg-transparent p-0 text-muted`,children:n?(0,Y.jsx)(N,{size:16,"aria-hidden":`true`}):(0,Y.jsx)(e,{size:16,"aria-hidden":`true`})})}),(0,Y.jsx)(`td`,{className:p(b,`whitespace-nowrap text-muted`),"data-tip":new Date(t.at).toLocaleString(),children:F(t.at)}),(0,Y.jsx)(`td`,{className:p(b,`truncate`),"data-tip":t.requester,children:t.requester}),(0,Y.jsxs)(`td`,{className:p(b,`truncate`),"data-tip":t.need,children:[t.need,t.source===`fetch`?(0,Y.jsx)(`span`,{className:`text-muted`,children:` · fetched again`}):null]}),(0,Y.jsx)(`td`,{className:p(b,`truncate`),"data-tip":t.database,children:t.database||(0,Y.jsx)(`span`,{className:`text-muted`,children:`—`})}),(0,Y.jsx)(`td`,{className:p(b,`whitespace-nowrap`),children:(0,Y.jsx)(s,{tone:t.ok?`pass`:`fail`,children:t.ok?H[t.kind||``]||`Answered`:`Failed`})}),(0,Y.jsx)(`td`,{className:T,children:t.ok?Q(t):``})]}),n&&(0,Y.jsx)(`tr`,{className:`border-t border-line-soft bg-surface-muted/40`,children:(0,Y.jsx)(`td`,{colSpan:7,className:`max-w-0 px-4 py-2`,children:(0,Y.jsx)(ee,{e:t,kept:!!t.name&&M.has(t.name),busy:i,act:a})})})]},t.id)})}):(0,Y.jsx)(j,{icon:A,title:`No test data asked for yet`,action:(0,Y.jsxs)(`a`,{href:n(`data`,`ask`,`test-data`),className:p(m({size:`sm`}),`no-underline`),children:[(0,Y.jsx)(A,{"aria-hidden":`true`}),`Ask for test data`]}),children:`The agents ask before a test runs, or you can ask yourself.`})}function te({view:e,job:t,busy:r,act:i,onNote:o}){let s=t&&!t.running&&t.kind===`fetch`?t:null,c=s?.result;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:`Each request is kept in test-data/requests with its query or INSERT script. Fetch one again to get the same data with no model: a query reads the rows there now, a spec makes the same rows.`}),s&&(0,Y.jsxs)(`section`,{"aria-label":`Fetched ${s.target}`,className:`flex flex-col gap-3 rounded-[14px] card border p-4`,children:[(0,Y.jsx)(`h2`,{className:`m-0 text-base font-semibold [overflow-wrap:anywhere]`,children:s.target}),c&&!c.ok&&(0,Y.jsx)(R,{text:c.error||`It could not fetch the data.`}),c?.ok&&(0,Y.jsx)(G,{r:c,onNote:o})]}),e.requests.length===0?(0,Y.jsxs)(j,{className:`py-3`,children:[`No kept requests yet. Each request the DB agent answers is kept here; `,(0,Y.jsx)(`a`,{href:n(`data`,`ask`,`test-data`),children:`ask for test data`}),` to make the first.`]}):(0,Y.jsx)(W,{items:e.requests,text:e=>`${e.need} ${e.name} ${e.database} ${e.requester||``}`,label:`Kept requests`,size:15,children:e=>(0,Y.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-3 border-t border-line-soft py-2.5 text-sm first:border-t-0`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-0.5`,children:[(0,Y.jsx)(`span`,{className:`text-[14px] font-medium [overflow-wrap:anywhere]`,children:e.need}),(0,Y.jsxs)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:[(0,Y.jsx)(`span`,{className:`font-mono`,children:e.name}),` · `,e.database,` · `,H[e.kind],e.rows?` · ${a(e.rows,`row`)}`:``,e.created?` · ${F(e.created)}`:``,e.requester?` · asked by ${e.requester}`:``]})]}),(0,Y.jsxs)(y,{size:`sm`,disabled:r,onClick:()=>i(`fetch`,{name:e.name}),children:[(0,Y.jsx)(M,{"aria-hidden":`true`}),`Fetch again`]})]},e.name)})]})}function ne({view:e,job:t,busy:i,act:a,onNote:o}){let[s,c]=(0,J.useState)(e.specs[0]??``),[l,u]=(0,J.useState)(``),[p,m]=(0,J.useState)(``),[h,g]=(0,J.useState)(`csv`),[v,b]=(0,J.useState)(!1),x={spec:s,...l?{db:l}:{},...p?{seed:p}:{}},C=t&&!t.running?t:null,T=C&&[`gen`,`files`,`insert`].includes(C.kind)&&C.target===s?C.result:void 0,E=e.databases.find(e=>e.name===l),D=async()=>{try{let{id:e}=await _.start(`Write a test data spec for this project (a YAML file with tables: under test-data/), from the database's schema. Show me the spec and a preview before you save it.`,{});location.hash=n(`chats`,e)}catch(e){o(e.message)}};return(0,Y.jsxs)(`section`,{"aria-labelledby":`spec-h`,className:`flex flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Y.jsxs)(`h2`,{id:`spec-h`,className:`m-0 flex flex-1 items-center gap-2 text-lg font-semibold`,children:[(0,Y.jsx)(d,{icon:A,size:18,className:`text-accent-fg`}),`Make test data from a spec`]}),(0,Y.jsxs)(y,{variant:`ghost`,onClick:()=>void D(),children:[(0,Y.jsx)(w,{"aria-hidden":`true`}),`Write a spec in a chat`]})]}),(0,Y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:`A spec is a YAML file with tables: and what goes in each column. The same spec and seed make the same data again, so a test or a pipeline can rely on it. No model is used.`}),e.specs.length===0?(0,Y.jsx)(j,{className:`py-3`,children:`No specs in this project yet: a YAML file with tables: in test-data/, data/ or specs/. Write one in a chat, from a database's schema.`}):(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-[14px] card border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,Y.jsxs)(`label`,{className:`flex min-w-0 flex-[2_1_260px] flex-col gap-1.5 text-sm font-medium`,children:[`Spec`,(0,Y.jsx)(S,{value:s,onChange:e=>c(e.target.value),children:e.specs.map(e=>(0,Y.jsx)(`option`,{children:e},e))})]}),(0,Y.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_180px] flex-col gap-1.5 text-sm font-medium`,children:[`Database`,(0,Y.jsxs)(S,{value:l,onChange:e=>u(e.target.value),children:[(0,Y.jsx)(`option`,{value:``,children:`The spec's own`}),e.databases.map(e=>(0,Y.jsxs)(`option`,{value:e.name,children:[e.name,e.writable?``:` (read only)`]},e.name))]})]}),(0,Y.jsxs)(`label`,{className:`flex w-[120px] flex-col gap-1.5 text-sm font-medium`,children:[`Seed`,(0,Y.jsx)(f,{value:p,inputMode:`numeric`,placeholder:`Random`,onChange:e=>m(e.target.value.replace(/\D/g,``).slice(0,9))})]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsxs)(y,{variant:v?void 0:`primary`,disabled:i||!s,onClick:()=>a(`gen`,x),children:[(0,Y.jsx)(A,{"aria-hidden":`true`}),`Preview`]}),(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,Y.jsx)(y,{disabled:i||!s,onClick:()=>a(`gen`,{...x,mode:`files`,format:h}),children:`Write files`}),(0,Y.jsx)(S,{"aria-label":`File format`,value:h,onChange:e=>g(e.target.value),className:`w-[88px]`,children:[`csv`,`json`,`sql`].map(e=>(0,Y.jsx)(`option`,{children:e},e))})]}),(0,Y.jsxs)(y,{disabled:i||!s||!E?.writable,"data-tip":E?.writable?void 0:`Pick a writable database to insert into`,onClick:()=>b(!0),children:[(0,Y.jsx)(r,{"aria-hidden":`true`}),`Insert into `,E?.writable?E.name:`a database`]})]}),v&&E&&(0,Y.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Insert test data`,className:`flex flex-col gap-3 rounded-[12px] border border-warn bg-warn-soft p-4`,children:[(0,Y.jsxs)(`span`,{className:`font-medium`,children:[`Insert the rows of `,s,` into `,E.name,`?`]}),(0,Y.jsx)(`span`,{className:`text-sm text-ink-2`,children:`They go in as one batch, which you can remove again under Batches. Only on a test database.`}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsx)(y,{variant:`primary`,onClick:()=>{b(!1),a(`gen`,{...x,mode:`insert`,confirmed:!0})},children:`Insert`}),(0,Y.jsx)(y,{onClick:()=>b(!1),children:`Don't insert`})]})]}),T&&!T.ok&&(0,Y.jsx)(R,{text:T.error||`It did not make the data.`}),T?.ok&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[T.batch&&(0,Y.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-3 py-2 text-sm text-pass`,children:[`Inserted as batch `,(0,Y.jsx)(`span`,{className:`font-mono text-[13px]`,children:T.batch}),`.`]}),T.files?.length?(0,Y.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Wrote`,T.files.map(e=>(0,Y.jsx)(U,{file:e,onNote:o},e))]}):null,(0,Y.jsx)(B,{r:T})]})]})]})}function re({view:e,job:t,busy:n,act:a}){let o=e.databases.filter(e=>e.writable),[s,c]=(0,J.useState)(o[0]?.name??``),[l,u]=(0,J.useState)(``),f=t&&!t.running?t:null,p=f?.kind===`batches`?(Array.isArray(f.result)?f.result.flatMap(e=>e.batches||[]):f.result?.batches)??[]:null;return(0,Y.jsxs)(`section`,{"aria-labelledby":`batch-h`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`h2`,{id:`batch-h`,className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[(0,Y.jsx)(d,{icon:r,size:18,className:`text-accent-fg`}),`Inserted batches`]}),(0,Y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:`Rows inserted from a spec go in as a batch. Remove a batch to take exactly those rows out again, children first.`}),o.length===0?(0,Y.jsx)(j,{className:`py-3`,children:`No writable database: test data is inserted only into one marked writable in Settings, Databases.`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(S,{"aria-label":`Database`,value:s,onChange:e=>c(e.target.value),className:`w-[220px]`,children:o.map(e=>(0,Y.jsx)(`option`,{children:e.name},e.name))}),(0,Y.jsx)(y,{disabled:n||!s,onClick:()=>a(`batches`,{db:s}),children:`List batches`})]}),p&&p.length===0&&(0,Y.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[`No batches in `,f?.target,`.`]}),p&&p.length>0&&(0,Y.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:p.map(e=>(0,Y.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-3 border-t border-line-soft py-2.5 text-sm first:border-t-0`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-0.5`,children:[(0,Y.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.batch}),(0,Y.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[(0,Y.jsx)(`span`,{"data-tip":new Date(e.created).toLocaleString(),children:F(e.created)}),e.spec?` · ${e.spec}`:``,` ·`,` `,Object.entries(e.rows).map(([e,t])=>`${e} ${t}`).join(`, `)]})]}),l===e.batch?(0,Y.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Y.jsxs)(`span`,{className:`text-[13px] text-warn`,children:[`Remove its rows from `,f?.target,`?`]}),(0,Y.jsx)(y,{variant:`danger`,size:`sm`,onClick:()=>{u(``),a(`clean`,{db:f?.target,batch:e.batch,confirmed:!0})},children:`Remove`}),(0,Y.jsx)(y,{size:`sm`,onClick:()=>u(``),children:`Keep`})]}):(0,Y.jsxs)(y,{size:`sm`,disabled:n,onClick:()=>u(e.batch),children:[(0,Y.jsx)(i,{"aria-hidden":`true`}),`Remove`]})]},e.batch))}),f?.kind===`clean`&&f.result?.ok&&(0,Y.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-3 py-2 text-sm text-pass`,children:[`Removed:`,` `,Object.entries(f.result.removed||{}).map(([e,t])=>`${e} ${t}`).join(`, `)]})]})]})}function ie({sub:e}){let{view:r,error:i,busy:o,act:s,stop:l,job:u}=z(),[d,f]=(0,J.useState)(null),[h,g]=(0,J.useState)(``),_=X.includes(e)?e:`requests`,y=u&&!u.running?u.endedAt:``;(0,J.useEffect)(()=>{t.log().then(f,e=>g(e.message))},[y]);let b=(d||[]).filter(e=>!e.ok).length,x=new Set((d||[]).map(e=>e.requester)).size,S={requests:`Requests${d?` (${d.length})`:``}`,kept:`Kept${r?` (${r.requests.length})`:``}`,specs:`Specs${r?` (${r.specs.length})`:``}`,batches:`Batches`};return(0,Y.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,Y.jsx)(C,{}),(0,Y.jsxs)(`main`,{className:p(D,`@container flex-auto gap-4`),children:[(0,Y.jsxs)(`a`,{href:n(`data`,`databases`),className:`inline-flex w-fit items-center gap-1.5 text-sm`,children:[(0,Y.jsx)(c,{size:16,"aria-hidden":`true`}),`All databases`]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Y.jsx)(v,{pixel:P[`test-data`],size:`lg`}),(0,Y.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`Test data`}),(0,Y.jsxs)(`a`,{href:n(`data`,`ask`,`test-data`),className:p(m(),`no-underline`),children:[(0,Y.jsx)(A,{"aria-hidden":`true`}),`Ask for test data`]})]}),(0,Y.jsx)(`p`,{className:`m-0 max-w-[74ch] text-sm leading-relaxed text-ink-2`,children:`Every request for test data: which agent asked, what for, when, and what the DB agent sent back. Kept requests fetch the same data again with no model; specs make data you can insert as batches and remove again.`}),d&&d.length>0&&(0,Y.jsxs)(`p`,{className:`m-0 text-sm text-ink-2 tabular-nums`,children:[a(d.length,`request`),` · `,a(x,`asker`),` · `,(0,Y.jsxs)(`span`,{className:b?`text-fail`:``,children:[b,` failed`]}),r?` · ${r.requests.length} kept`:``]}),(i||h)&&(0,Y.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i||h}),!r&&!i&&(0,Y.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),r&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(I,{label:`Test data`,current:_,onPick:e=>location.hash=n(`test-data`,e),tabs:X.map(e=>({id:e,label:S[e]}))}),u&&(u.running?Z[u.kind]!==void 0:Z[u.kind]===_)&&(0,Y.jsx)(L,{job:u,onStop:l}),(0,Y.jsxs)(`div`,{role:`tabpanel`,id:`panel-${_}`,"aria-labelledby":`tab-${_}`,children:[_===`requests`&&(0,Y.jsx)($,{view:r,log:d,busy:o,act:s}),_===`kept`&&(0,Y.jsx)(te,{view:r,job:u,busy:o,act:s,onNote:g}),_===`specs`&&(0,Y.jsx)(ne,{view:r,job:u,busy:o,act:s,onNote:g}),_===`batches`&&(0,Y.jsx)(re,{view:r,job:u,busy:o,act:s})]})]})]})]})}export{q as n,$ as t};
@@ -1 +0,0 @@
1
- import{$i as e,An as t,In as n,Jn as r,Jr as i,Nt as a,Oa as o,bi as s,ct as c,ft as ee,ga as l,ha as u,ho as d,jn as f,ka as te,kt as ne,ma as p,po as m,pt as h,r as g,ri as re,t as ie,tt as _,vo as v,vt as y,yt as b}from"./frame-I2oY7L19.js";import{r as x}from"./index-BOLnH0rJ.js";import{_ as S,o as C}from"./qualityParts-H50uxgIc.js";var w=v(d(),1),T={view:()=>o(`GET`,`/api/testdebt`),refresh:()=>o(`POST`,`/api/testdebt/refresh`,{}),readCases:(e,t)=>o(`POST`,`/api/testdebt/cases`,{source:e,scope:t})},E=m(),D=[`untested`,`signal`,`duplicates`,`cases`],O={endpoint:`Endpoint`,screen:`Screen`,file:`Code file`},k={test:`Test`,recording:`Recording`,case:`Test case`},A={azure_devops:`Azure DevOps`,jira:`Jira`,xray:`Xray`,testrail:`TestRail`,zephyr:`Zephyr Scale`,qtest:`qTest`,other:`Other`},j={azure_devops:`plan=12/suite=34`,testrail:`run=7`,zephyr:`cycle=SHOP-R12`,qtest:`cycle=12`,xray:`plan=SHOP-100`},M=e=>`${Math.round(e*100)}%`,ae=e=>D.includes(e)?e:`untested`;function N({part:t,what:n,action:r}){return(0,E.jsxs)(y,{icon:e,title:t.state===`empty`?`No ${n} yet`:`${n[0].toUpperCase()}${n.slice(1)}: not connected`,action:(0,E.jsx)(`a`,{className:u({size:`sm`}),href:r.to,children:r.label}),children:[`To see this list, set `,t.set,`.`]})}function P({text:e,tip:t}){return(0,E.jsx)(`span`,{"data-tip":t??e,className:`block truncate`,children:e})}function F({sub:e}){let[o,d]=(0,w.useState)(null),[m,v]=(0,w.useState)(``),[D,F]=(0,w.useState)(!1),[I,L]=(0,w.useState)(``),R=ae(e),[z,B]=(0,w.useState)(`all`),[V,H]=(0,w.useState)(`manual`),[U,W]=(0,w.useState)(``),[G,K]=(0,w.useState)(``);(0,w.useEffect)(()=>{T.view().then(e=>{d(e),v(``)},e=>v(e.message))},[]);let q=(0,w.useCallback)(async(e,t)=>{F(!0),L(``);try{d(await e()),v(``),t&&L(t)}catch(e){v(e.message)}finally{F(!1)}},[]),oe=async e=>{if(e){F(!0);try{let{id:t}=await te.start(e,{});location.hash=a(`chats`,t)}catch(e){v(e.message),F(!1)}}},J=(e,t)=>(0,E.jsxs)(p,{size:`sm`,variant:`ghost`,disabled:D||!e,onClick:()=>void oe(e),"data-tip":e?`Ask in a chat to draft a test for this ${t}`:`Its id or file is not of a plain shape, so no chat request names it: open it where it lives instead.`,children:[(0,E.jsx)(re,{"aria-hidden":`true`}),`Draft the test`]}),Y=o?.sources.filter(e=>e.connected&&e.id!==`jira`)??[],X=U||Y[0]?.id||``,Z=o?.cases.filter(e=>!e.automated).length??0,se=o?.areas.filter(e=>z===`all`||e.kind===z)??[],ce=o?.cases.filter(e=>V===`all`||(V===`manual`?!e.automated:e.automated))??[],Q=`py-2 pr-3 text-right tabular-nums`,$={untested:(o?.areas.length??0)+(o?.rules.length??0),signal:(o?.quiet.length??0)+(o?.gone.length??0),duplicates:o?.duplicates.length??0,cases:Z};return(0,E.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,E.jsx)(g,{}),(0,E.jsxs)(`main`,{className:l(ie,`@container max-w-[1320px] flex-auto gap-4`),children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,E.jsx)(ne,{pixel:b[`test-debt`],size:`lg`}),(0,E.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Test debt`}),o&&(0,E.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 text-[13px] text-muted`,children:[(0,E.jsxs)(`span`,{"data-tip":S(o.at),children:[`Worked out `,x(o.at)]}),(0,E.jsxs)(p,{size:`sm`,disabled:D,onClick:()=>void q(T.refresh,`Worked out again.`),children:[(0,E.jsx)(s,{"aria-hidden":`true`}),`Refresh`]})]})]}),(0,E.jsxs)(`p`,{className:`m-0 max-w-[80ch] text-[13px] leading-relaxed text-ink-2`,children:[`What no test checks yet, and tests that tell little: code and business rules no test reaches in the `,(0,E.jsx)(`a`,{href:a(`product`),children:`product graph`}),`, tests that passed every one of their last 30 runs or whose file is gone from `,o?.repo&&o.repo!==`.`?(0,E.jsx)(`code`,{className:`font-mono text-[12.5px]`,children:o.repo}):`the test repository`,`, tests that read alike, and each test case with whether it is automated. It only reads; Draft the test asks in a chat, and nothing changes until you agree there.`]}),m&&(0,E.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-3 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:m}),!o&&!m&&(0,E.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),I&&(0,E.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-ink-2`,children:I}),o&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:`grid grid-cols-2 overflow-hidden border-y border-line-soft @xl:grid-cols-6 @xl:divide-x @xl:divide-line-soft`,children:[(0,E.jsx)(C,{label:`Untested code`,value:o.graph.state===`ok`?o.areas.length:`–`,tone:o.areas.length?`text-warn`:void 0,sub:o.graph.state===`ok`?`of ${o.graph.checked} areas`:`graph not built`}),(0,E.jsx)(C,{label:`Untested rules`,value:o.rules.length,tone:o.rules.length?`text-warn`:void 0,sub:`of ${o.graph.rulesChecked} rules`}),(0,E.jsx)(C,{label:`Never fail`,value:o.quiet.length,sub:`30 passes in a row`}),(0,E.jsx)(C,{label:`Code gone`,value:o.gone.length,tone:o.gone.length?`text-fail`:void 0,sub:`of ${o.files.count} files listed`}),(0,E.jsx)(C,{label:`Near-duplicates`,value:o.duplicates.length,sub:`from ${M(o.threshold)} alike`}),(0,E.jsx)(C,{label:`Not automated`,value:Z,tone:Z?`text-warn`:void 0,sub:`of ${o.cases.length} test cases`})]}),(0,E.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,E.jsx)(c,{items:[{id:`untested`,label:`Untested code and rules`,n:$.untested},{id:`signal`,label:`Low-signal tests`,n:$.signal},{id:`duplicates`,label:`Near-duplicates`,n:$.duplicates},{id:`cases`,label:`Test cases`,n:$.cases}],value:R,onChange:e=>location.hash=a(`test-debt`,e)})}),o.notes.map(e=>(0,E.jsx)(`p`,{className:`m-0 text-[12.5px] text-ink-2`,children:e},e)),R===`untested`&&(0,E.jsxs)(E.Fragment,{children:[o.graph.state===`ok`?(0,E.jsx)(_,{label:`Code no test reaches`,placeholder:`Find an endpoint, screen or file`,resetKey:z,empty:o.areas.length?`Nothing matches.`:`Every endpoint, screen and code file the graph holds is reached by a test.`,tools:(0,E.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,E.jsx)(c,{items:[{id:`all`,label:`All`,n:o.areas.length},...[`endpoint`,`screen`,`file`].map(e=>({id:e,label:`${O[e]}s`,n:o.areas.filter(t=>t.kind===e).length}))],value:z,onChange:B})}),head:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`th`,{className:`w-[34%] py-1.5 pr-3 pl-3 font-medium`,children:`Code`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Kind`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Where`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 text-right font-medium @2xl:table-cell`,children:`Used by`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:se.map(e=>(0,E.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,E.jsx)(`td`,{className:`max-w-0 py-2 pr-3 pl-3`,children:(0,E.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(f,{size:15,"aria-label":`No test reaches it`,className:`flex-none text-warn`}),(0,E.jsx)(P,{text:e.name,tip:`${e.name} · ${e.known===`observed`?`read in the code`:`worked out from the code`}`})]})}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-[12.5px] whitespace-nowrap`,children:O[e.kind]}),(0,E.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-3 font-mono text-[12px] text-ink-2 @xl:table-cell`,children:(0,E.jsx)(P,{text:e.where})}),(0,E.jsx)(`td`,{className:l(Q,`hidden text-muted @2xl:table-cell`),children:e.users}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:J(e.draft,O[e.kind].toLowerCase())})]},e.id))}):(0,E.jsx)(N,{part:o.graph,what:`product graph`,action:{label:`Open Product`,to:a(`product`)}}),(0,E.jsx)(_,{label:`Business rules no test checks`,placeholder:`Find a rule`,empty:o.graph.rulesChecked?`Every business rule found is checked by a test.`:`No business rules found: the product graph's rules come from the code; the knowledge folder's from a business-rules.md file.`,head:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`th`,{className:`w-[46%] py-1.5 pr-3 pl-3 font-medium`,children:`Rule`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`From`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Where`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @2xl:table-cell`,children:`Closest test`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:o.rules.map(e=>(0,E.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,E.jsx)(`td`,{className:`max-w-0 py-2 pr-3 pl-3`,children:(0,E.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(f,{size:15,"aria-label":`No test checks it`,className:`flex-none text-warn`}),(0,E.jsx)(P,{text:e.text,tip:e.endpoint?`${e.text} · checked by ${e.endpoint}`:e.text})]})}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-[12.5px] whitespace-nowrap`,"data-tip":e.from===`graph`?`Found in the code by forgeqe knowledge build`:`A rule of the knowledge folder, matched to tests by its words`,children:e.from===`graph`?`Code`:`Knowledge`}),(0,E.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-3 font-mono text-[12px] text-ink-2 @xl:table-cell`,children:(0,E.jsx)(P,{text:e.where})}),(0,E.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-3 text-[12.5px] text-ink-2 @2xl:table-cell`,children:e.nearest?(0,E.jsx)(P,{text:`${e.nearest.name} (${M(e.nearest.score)})`,tip:`${M(e.nearest.score)} of the rule's words are in ${e.nearest.name}`}):`–`}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:J(e.draft,`rule`)})]},e.id))})]}),R===`signal`&&(o.history.state===`ok`?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(_,{label:`Tests that never fail`,placeholder:`Find a test`,empty:`No test has passed 30 runs in a row without a failure or a retry.`,head:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`th`,{className:`w-[50%] py-1.5 pr-3 pl-3 font-medium`,children:`Test`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 text-right font-medium`,children:`Passes`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Since`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:o.quiet.map(e=>(0,E.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,E.jsx)(`td`,{className:`max-w-0 py-2 pr-3 pl-3`,children:(0,E.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(t,{size:15,"aria-label":`Always passed`,className:`flex-none text-muted`}),(0,E.jsx)(P,{text:e.name,tip:e.file?`${e.name} · ${e.file}`:e.name})]})}),(0,E.jsx)(`td`,{className:l(Q,`text-muted`),children:e.runs}),(0,E.jsx)(`td`,{className:`hidden py-2 pr-3 text-[12.5px] whitespace-nowrap text-muted @xl:table-cell`,"data-tip":e.since?S(e.since):void 0,children:e.since?x(e.since):`–`}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:J(e.draft,`test`)})]},e.key))}),(0,E.jsx)(_,{label:`Tests whose file is gone`,placeholder:`Find a test or file`,empty:`Every test file the history names is in the test repository (${o.files.count} files, listed by ${o.files.by===`git`?`git`:`walking the folder`}).`,head:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`th`,{className:`w-[40%] py-1.5 pr-3 pl-3 font-medium`,children:`Test`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`File`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Last run`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:o.gone.map(e=>(0,E.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,E.jsx)(`td`,{className:`max-w-0 py-2 pr-3 pl-3`,children:(0,E.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(n,{size:15,"aria-label":`Its file is gone`,className:`flex-none text-fail`}),(0,E.jsx)(P,{text:e.name})]})}),(0,E.jsx)(`td`,{className:`max-w-0 py-2 pr-3 font-mono text-[12px] text-ink-2`,children:(0,E.jsx)(P,{text:e.file})}),(0,E.jsx)(`td`,{className:`hidden py-2 pr-3 text-[12.5px] whitespace-nowrap text-muted @xl:table-cell`,"data-tip":e.last?S(e.last):void 0,children:e.last?x(e.last):`–`}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:J(e.draft,`test`)})]},e.key))})]}):(0,E.jsx)(N,{part:o.history,what:`test history`,action:{label:`Open Regression`,to:a(`regression`)}})),R===`duplicates`&&(0,E.jsx)(_,{label:`Tests that read alike`,placeholder:`Find a test, recording or case`,empty:`No two tests, recordings or test cases share ${M(o.threshold)} of their words (${o.compared} pairs compared).`,head:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 text-right font-medium`,children:`Alike`}),(0,E.jsx)(`th`,{className:`w-[30%] py-1.5 pr-3 font-medium`,children:`First`}),(0,E.jsx)(`th`,{className:`w-[30%] py-1.5 pr-3 font-medium`,children:`Second`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @2xl:table-cell`,children:`Shared words`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:o.duplicates.map(e=>(0,E.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,E.jsx)(`td`,{className:l(Q,`pl-3`,e.score>=.85?`text-warn`:`text-muted`),children:(0,E.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,E.jsx)(r,{size:14,"aria-hidden":`true`}),M(e.score)]})}),[e.a,e.b].map((e,t)=>(0,E.jsxs)(`td`,{className:`max-w-0 py-2 pr-3`,children:[(0,E.jsx)(P,{text:e.name,tip:`${k[e.kind]}: ${e.name}${e.where?` · ${e.where}`:``}`}),(0,E.jsx)(`span`,{className:`block text-[12px] text-muted`,children:k[e.kind]})]},t)),(0,E.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-3 text-[12.5px] text-ink-2 @2xl:table-cell`,children:(0,E.jsx)(P,{text:e.shared.join(`, `)})}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:J(e.draft,`pair`)})]},`${e.a.kind}:${e.a.key}|${e.b.kind}:${e.b.key}`))}),R===`cases`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,E.jsx)(`span`,{className:`text-[13px] font-medium`,children:`Test management`}),(0,E.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,children:o.sources.map(e=>(0,E.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[e.connected?(0,E.jsx)(t,{size:15,"aria-label":`Connected`,className:`flex-none text-pass`}):(0,E.jsx)(f,{size:15,"aria-label":`Not connected`,className:`flex-none text-muted`}),(0,E.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,E.jsx)(`span`,{className:`text-ink-2`,children:e.connected?e.scopes.length?e.scopes.map(e=>`${e.scope}: ${e.cases} read ${x(e.at)}`).join(` · `):e.id===`jira`?`connected: its cases show once ForgeQE has indexed or automated them`:`connected`:`not connected: set ${e.set}`})]},e.id))})]}),Y.length>0&&(0,E.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),X&&q(()=>T.readCases(X,G.trim()),`Test cases read.`)},children:[(0,E.jsx)(h,{size:`sm`,"aria-label":`Source`,value:X,onChange:e=>W(e.target.value),children:Y.map(e=>(0,E.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,E.jsx)(ee,{size:`sm`,"aria-label":`Scope`,placeholder:X&&X!==`jira`?j[X]:``,value:G,maxLength:80,onChange:e=>K(e.target.value),className:`w-full max-w-[240px] flex-[0_1_240px]`}),(0,E.jsxs)(p,{size:`sm`,type:`submit`,disabled:D||!G.trim(),children:[(0,E.jsx)(i,{"aria-hidden":`true`}),`Read cases`]})]}),o.cases.length?(0,E.jsx)(_,{label:`Test cases`,placeholder:`Find a test case by id or title`,resetKey:V,empty:`Nothing matches.`,tools:(0,E.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(0,E.jsx)(c,{items:[{id:`manual`,label:`Not automated`,n:Z,alert:!0},{id:`automated`,label:`Automated`,n:o.cases.length-Z},{id:`all`,label:`All`,n:o.cases.length}],value:V,onChange:H})}),head:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 font-medium`,children:`Case`}),(0,E.jsx)(`th`,{className:`w-[36%] py-1.5 pr-3 font-medium`,children:`Title`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Source`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Automated`}),(0,E.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @2xl:table-cell`,children:`Test`}),(0,E.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:(0,E.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:ce.map(e=>(0,E.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,E.jsx)(`td`,{className:`py-2 pr-3 pl-3 font-mono text-[12.5px] whitespace-nowrap`,children:/^https?:\/\//i.test(e.url)?(0,E.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:e.id}):e.id}),(0,E.jsx)(`td`,{className:`max-w-0 py-2 pr-3`,children:(0,E.jsx)(P,{text:e.title||`–`})}),(0,E.jsx)(`td`,{className:`hidden py-2 pr-3 text-[12.5px] whitespace-nowrap @xl:table-cell`,"data-tip":`From ${e.scope}`,children:A[e.source]}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-[12.5px] whitespace-nowrap`,children:(0,E.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,"data-tip":e.how===`mapping`?`Its test is in the automated tests' mapping`:e.how===`name`?`A test in the history names its id`:`No automated test names it`,children:[e.automated?(0,E.jsx)(t,{size:15,"aria-hidden":`true`,className:`text-pass`}):(0,E.jsx)(f,{size:15,"aria-hidden":`true`,className:`text-muted`}),e.automated?`Yes`:`No`]})}),(0,E.jsx)(`td`,{className:`hidden max-w-0 py-2 pr-3 text-[12.5px] text-ink-2 @2xl:table-cell`,children:e.test?(0,E.jsx)(P,{text:e.test,tip:e.file?`${e.test} · ${e.file}`:e.test}):`–`}),(0,E.jsx)(`td`,{className:`py-2 pr-3 text-right whitespace-nowrap`,children:!e.automated&&J(e.draft,`test case`)})]},`${e.source}|${e.id}`))}):(0,E.jsx)(y,{icon:i,title:`No test cases yet`,action:(0,E.jsx)(`a`,{className:u({size:`sm`}),href:a(`settings`,`integrations`),children:`Open Settings`}),children:`Test cases show here from ForgeQE's case index, the automated tests' mapping (.forgeqe/test-cases.json), and the plans, runs or cycles you read above from a connected source.`})]})]})]})]})}export{F as TestDebt};
@@ -1,2 +0,0 @@
1
- import{$i as e,At as t,B as n,Gr as r,Mt as i,Nt as a,R as o,Sn as s,Xi as c,Xr as l,Zr as u,_t as d,an as f,bi as p,cr as m,da as h,do as g,dt as _,en as v,fa as y,ft as b,ga as x,hi as S,ho as C,kt as w,ma as T,mr as E,mt as D,nt as O,on as k,ot as A,po as j,r as M,st as N,t as P,tt as F,vi as ee,vo as I,vt as L,wn as R,yt as te,zi as ne}from"./frame-I2oY7L19.js";import{o as re,r as ie,u as ae}from"./index-BOLnH0rJ.js";import{t as oe}from"./segmented-DVt7_NPz.js";import{n as se}from"./families-Ch_yMomw.js";import{r as ce,s as z,t as le}from"./logos-BfGnwAtP.js";import{d as B,o as ue,p as de,r as V,s as fe,t as pe}from"./parts-CpuOW4Wd.js";var H=I(C(),1),U=j(),W=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,me={ok:{label:`Ready to start`,tone:`pass`},limits:{label:`Ready, with limits`,tone:`warn`},blocked:{label:`Not possible`,tone:`fail`}},he={converted:{label:`Converted`,tone:`pass`},partial:{label:`Needs review`,tone:`warn`},failed:{label:`Failed`,tone:`fail`},stopped:{label:`Stopped`,tone:`neutral`},running:{label:`Running`,tone:`running`}},G={converted:{label:`Converted`,tone:`pass`},written:{label:`Written`,tone:`neutral`},failed:{label:`Failed`,tone:`fail`},blocked:{label:`Not possible`,tone:`warn`},skipped:{label:`Skipped`,tone:`neutral`}},ge={setup:`Set-up`,page:`Page`,test:`Test`},_e={matched:{label:`In the test`,dot:`bg-pass`},missing:{label:`Missing from the test`,dot:`bg-fail`},elided:{label:`Not needed: this branch never runs`,dot:`bg-line-strong`},marked:{label:`Left for a person to finish`,dot:`bg-warn`}},K={web:`Web`,api:`API`,desktop:`Desktop`,mobile:`Mobile`,data:`Data`,mixed:`Mixed`,unsupported:`Not supported`},ve={prepare:`Prepare`,setup:`Set up`,pages:`Pages`,tests:`Tests`,validate:`Validate`,review:`Review`},q=[`prepare`,`setup`,`pages`,`tests`,`validate`,`review`];function ye(e,t){if(!t)return 0;if(t.status===`converted`||t.stages?.review.status===`done`)return 100;let n=t.stages?.validate.status===`done`?8:0,r=Math.min(t.units.length,e.units.length);return Math.min(99,Math.round(r/Math.max(1,e.units.length)*90+n))}function be(e){let t=e?.status||`pending`,n=e?.startedAt&&e?.endedAt?B(Date.parse(e.endedAt)-Date.parse(e.startedAt)):``;return t===`running`?e?.startedAt?`Running · ${B(Date.now()-Date.parse(e.startedAt))}`:`Running`:t===`done`?e?.note||(n?`Done · ${n}`:`Done`):t===`failed`?e?.note||`Did not finish`:t===`skipped`?e?.note||`Skipped`:`Waiting`}function xe({states:e}){return(0,U.jsx)(`ol`,{"aria-label":`Stages`,className:`m-0 flex w-full min-w-0 list-none items-center gap-1 p-0 @xl:gap-2`,children:q.map((t,n)=>{let r=e?.[t],i=r?.status||`pending`,a=i===`done`||i===`skipped`,o=i===`running`||i===`failed`,c=be(r);return(0,U.jsxs)(`li`,{"data-tip":`${ve[t]}: ${c}`,className:x(`relative flex items-center gap-1 @xl:gap-2`,n<q.length-1&&`flex-1`),"aria-current":i===`running`?`step`:void 0,children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:x(`inline-flex size-5 flex-none items-center justify-center rounded-full text-[11px] font-semibold tabular-nums @xl:size-6`,a?`bg-pass text-white`:i===`running`?`border-2 border-accent bg-accent-soft text-accent-fg`:i===`failed`?`bg-fail text-white`:`border border-line bg-bg text-muted`),children:a?(0,U.jsx)(s,{size:12,strokeWidth:3}):i===`failed`?(0,U.jsx)(y,{size:12,strokeWidth:3}):i===`running`?(0,U.jsx)(u,{size:12,strokeWidth:2.5,className:`animate-spin`}):n+1}),(0,U.jsxs)(`span`,{className:x(`flex-none text-[13px] whitespace-nowrap`,o?`inline`:`hidden @xl:inline`,i===`running`?`font-medium text-accent-fg`:i===`failed`?`font-medium text-fail`:i===`pending`?`text-muted`:`text-ink`),children:[ve[t],o&&(0,U.jsx)(`span`,{className:`ml-1.5 hidden font-normal text-muted @3xl:inline`,children:c})]}),(0,U.jsxs)(`span`,{className:`sr-only`,children:[ve[t],`: `,c]}),n<q.length-1&&(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`h-0.5 min-w-4 flex-1 overflow-hidden rounded-full bg-line @xl:min-w-8`,children:(0,U.jsx)(`span`,{className:x(`block h-full rounded-full bg-pass transition-[width] duration-500`,a?`w-full`:`w-0`)})})]},t)})})}function J(e){return e?`literal`in e?JSON.stringify(e.literal):`env`in e?`env ${String(e.env)}${e.secret?` (secret)`:``}`:`var`in e?`variable ${String(e.var)}`:`param`in e?`parameter ${String(e.param)}`:`data`in e?`test data ${String(e.data)}`:`expr`in e?`expression ${String(e.expr)}`:`concat`in e&&Array.isArray(e.concat)?e.concat.map(J).join(` + `):``:``}function Se(e){let t=e.target?e.target.slice(e.target.indexOf(`.`)+1).replace(/_/g,` `):``;if(e.kind===`action`){let n=e.op===`navigate`?`Open ${J(e.value)}`:e.op===`close`?`Close the browser`:e.op===`fill`?`Fill ${t} with ${J(e.value)}`:e.op===`press`?`Press ${e.key} on ${t}`:e.op===`select`?`Select in ${t}`:`${e.op[0].toUpperCase()}${e.op.slice(1)} ${t}`;return e.optional?`${n} (if it is there)`:n}return e.kind===`assert`?`Check ${t} ${e.op===`text`||e.op===`value`?`${e.match===`contains`?`contains`:`is`} ${J(e.expected)}`:`is ${e.op}`}${e.wait?`, waiting`:``}`:e.kind===`store`?`Read ${t} into ${e.var}`:e.kind===`set_var`?`Set ${e.var} to ${J(e.value)}`:e.kind===`wait`?`Wait ${e.ms} ms`:e.kind===`unsupported`?e.reason||`Cannot be converted`:e.name||e.kind}var Ce={before:`Before`,after:`After`,block:`Reusable block`,folder:`Folder`};function we({nodes:e,status:t,pick:n,onPick:r,depth:i=0}){return(0,U.jsx)(`ul`,{className:x(`m-0 flex list-none flex-col p-0`,i>0&&`ml-3 border-l border-line-soft pl-3`),children:e.map((e,a)=>{if(e.kind===`group`)return(0,U.jsxs)(`li`,{className:`flex flex-col gap-1 py-1`,children:[(0,U.jsxs)(`span`,{className:`text-[12px] font-medium text-muted`,children:[Ce[e.role||`folder`]||`Folder`,`: `,(0,U.jsx)(`span`,{className:`text-ink-2`,children:e.name})]}),(0,U.jsx)(we,{nodes:e.body||[],status:t,pick:n,onPick:r,depth:i+1})]},`g${a}`);if(e.kind===`if`||e.kind===`loop`){let o=e.condition;return(0,U.jsxs)(`li`,{className:`flex flex-col gap-1 py-1`,children:[(0,U.jsxs)(`span`,{className:`text-[12px] font-medium text-muted`,children:[e.kind===`if`?`If`:`Loop`,` `,e.name,`: `,(0,U.jsx)(`code`,{className:`font-mono text-[12px] text-ink-2`,children:o?.tosca}),o?.constant!==void 0&&(0,U.jsxs)(`span`,{children:[` · always `,o.constant?`true`:`false`]})]}),[`then`,`else`,`loop`].map(a=>e[a]?.length?(0,U.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,U.jsx)(`span`,{className:`ml-3 text-[12px] text-muted`,children:a===`then`?`Then`:a===`else`?`Else`:`Each time`}),(0,U.jsx)(we,{nodes:e[a],status:t,pick:n,onPick:r,depth:i+1})]},a):null)]},`i${a}`)}let o=e.id?t.get(e.id):void 0,s=o?_e[o]:void 0;return(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,"aria-pressed":n===e.id,onClick:()=>r(e),className:x(`flex w-full min-w-0 cursor-pointer items-start gap-2 rounded-[8px] border-0 px-2 py-1.5 text-left text-[13px]`,n===e.id?`bg-accent-soft`:`bg-transparent hover:bg-surface-muted`),children:[(0,U.jsx)(`span`,{role:`img`,"aria-label":s?.label||`Not converted yet`,"data-tip":s?.label||`Not converted yet`,className:x(`mt-1.5 size-2 flex-none rounded-full`,s?.dot||`bg-line`)}),(0,U.jsx)(`span`,{className:`w-9 flex-none font-mono text-[12px] text-muted`,children:e.id}),(0,U.jsxs)(`span`,{className:x(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.kind===`unsupported`?`text-warn`:`text-ink`),children:[Se(e),e.tosca?.step&&(0,U.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[`Tosca step "`,e.tosca.step,`"`]})]})]})},e.id||a)})})}function Te(e,t){for(let n of e){if(n.id===t)return n;for(let e of[`body`,`then`,`else`,`loop`]){let r=n[e]&&Te(n[e],t);if(r)return r}}}function Ee({view:e,pick:t}){let n=e.target,r=n?.text||``,i=r.split(`
2
- `),a=(0,H.useMemo)(()=>r?ae(r,n?.lang||`plaintext`):null,[r,n?.lang]),o=(0,H.useMemo)(()=>{if(!t)return new Set;let e=RegExp(`tosca:[\\sn\\d,]*\\b${t}\\b`,`i`);return new Set(i.flatMap((t,n)=>e.test(t)?[n]:[]))},[t,r]),s=(0,H.useRef)(null);(0,H.useEffect)(()=>{s.current?.scrollIntoView({block:`center`,behavior:`smooth`})},[t,o.size]);let c=Math.min(...o);return(0,U.jsxs)(`figure`,{className:`m-0 flex min-h-0 min-w-0 flex-col overflow-hidden rounded-[12px] card border`,children:[(0,U.jsxs)(`figcaption`,{className:`flex min-h-10 items-center gap-2 border-b border-line-soft pr-1 pl-3`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-semibold tracking-[0.04em] text-muted uppercase`,children:`Converted test`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[12px] text-ink-2`,"data-tip":n?.path,children:n?.path||``}),r&&(0,U.jsx)(re,{text:r,label:`Copy ${n?.path||`the test`}`})]}),r?(0,U.jsxs)(`div`,{className:`flex min-h-[260px] flex-1 overflow-auto font-mono text-[12.5px] leading-[1.6]`,children:[(0,U.jsx)(`pre`,{"aria-hidden":`true`,className:`m-0 min-h-full flex-none self-stretch border-r border-line-soft py-3 text-right text-muted select-none`,children:i.map((e,t)=>(0,U.jsx)(`span`,{ref:t===c?s:void 0,className:x(`block px-3`,o.has(t)&&`bg-accent-soft font-semibold text-accent-fg`),children:t+1},t))}),(0,U.jsx)(`pre`,{className:`m-0 min-w-0 flex-1 px-3 py-3`,children:(0,U.jsx)(`code`,{className:`hljs`,children:a})})]}):(0,U.jsx)(`p`,{className:`m-0 flex min-h-[260px] flex-1 items-center justify-center px-4 text-center text-sm text-muted`,children:n?`Not written yet.`:`This test case is left out of the plan.`}),t&&r&&(0,U.jsx)(`p`,{role:`status`,className:`m-0 border-t border-line-soft px-3 py-2 text-[12.5px] text-muted`,children:o.size?`${t} is done on line ${[...o].map(e=>e+1).join(`, `)}.`:`No line of the test is marked ${t}.`})]})}function De({view:e,node:t}){if(!t?.target)return null;let[n,r]=t.target.split(`.`),i=e.pages.find(e=>e.id===n),a=i?.elements.find(e=>e.id===r);return a?(0,U.jsxs)(`section`,{"aria-label":`Locators Tosca recorded`,className:`flex flex-col gap-2 rounded-[12px] card border px-4 py-3 text-[13px]`,children:[(0,U.jsxs)(`span`,{className:`font-medium`,children:[a.name,` `,(0,U.jsxs)(`span`,{className:`font-normal text-muted`,children:[`on `,i?.name,a.scope?.length?`, inside ${a.scope.join(` › `)}`:``,a.nth===void 0?``:`, number ${a.nth+1}`]})]}),a.locators.length?(0,U.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:a.locators.slice(0,6).map((e,t)=>(0,U.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`w-14 flex-none text-[12px] text-muted`,children:e.strategy}),(0,U.jsx)(`code`,{className:`min-w-0 flex-1 font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:e.strategy===`role`?`${e.role} "${e.name}"`:e.attr?`[${e.attr}="${e.value}"]`:e.value}),e.fragile&&(0,U.jsx)(d,{tone:`warn`,children:`Fragile`})]},t))}):(0,U.jsx)(`span`,{className:`text-muted`,children:`Tosca recorded no locator for it.`})]}):null}function Oe({id:e,plan:t,result:n,initial:r}){let i=t.cases.filter(e=>e.included),[a,o]=(0,H.useState)(``),[s,c]=(0,H.useState)(r||i[0]?.id||``),[l,u]=(0,H.useState)(null),[d,f]=(0,H.useState)(``),[p,m]=(0,H.useState)(``);(0,H.useEffect)(()=>{s&&(m(``),g.case(e,s).then(u,e=>m(e.message)))},[e,s,n?.units.length,n?.status]),(0,H.useEffect)(()=>{f(``)},[s]);let h=new Map((l?.fidelity||[]).map(e=>[e.id,e.status])),v=i.filter(e=>!a||e.name.toLowerCase().includes(a.toLowerCase())),y=e=>n?.units.find(t=>t.kind===`test`&&t.case===e);return i.length?(0,U.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] gap-4 @5xl:h-[calc(var(--screen)-320px)] @5xl:min-h-[540px] @5xl:grid-cols-[220px_minmax(0,1fr)_minmax(0,1fr)]`,children:[(0,U.jsxs)(`nav`,{"aria-label":`Test cases`,className:`flex max-h-[320px] min-h-0 min-w-0 flex-col gap-2 overflow-hidden rounded-[14px] card border p-3 @5xl:max-h-none`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-0.5 px-1`,children:[(0,U.jsx)(`span`,{className:`text-sm font-semibold`,children:`Test cases`}),(0,U.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[i.filter(e=>y(e.id)?.status===`converted`).length,` converted · `,i.filter(e=>[`failed`,`blocked`].includes(y(e.id)?.status||``)).length,` failed · `,W(i.length,`test case`)]})]}),(0,U.jsx)(_,{id:`find-a-case`,label:`Find a test case`,value:a,onChange:o,className:`max-w-none flex-none`}),(0,U.jsxs)(`ul`,{className:`m-0 flex min-h-0 flex-1 list-none flex-col gap-0.5 overflow-y-auto p-0`,children:[v.map(e=>{let t=y(e.id);return(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,"aria-pressed":s===e.id,onClick:()=>c(e.id),className:x(`flex w-full cursor-pointer items-start gap-2 rounded-[8px] border-0 px-2 py-1.5 text-left text-[13px]`,s===e.id?`bg-accent-soft text-ink`:`bg-transparent text-ink-2 hover:bg-surface-muted`),children:[(0,U.jsx)(`span`,{role:`img`,"aria-label":t?G[t.status].label:`Waiting`,className:x(`mt-1.5 size-2 flex-none rounded-full`,t?.status===`converted`?`bg-pass`:t?.status===`failed`?`bg-fail`:t?.status===`blocked`?`bg-warn`:`bg-line`)}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[e.name,(0,U.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[W(e.steps,`step`),` · `,W(e.asserts,`check`),t?.fidelity?` · ${t.fidelity.matched}/${t.fidelity.required} in the test`:``]})]})]})},e.id)}),!v.length&&(0,U.jsx)(`li`,{className:`px-2 py-3 text-[13px] text-muted`,children:`No test case matches.`})]})]}),(0,U.jsxs)(`section`,{"aria-label":`Tosca steps`,className:`flex min-h-[360px] min-w-0 flex-col gap-3 overflow-hidden`,children:[p&&(0,U.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:p}),(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-[12px] card border`,children:[(0,U.jsxs)(`header`,{className:`flex min-h-10 flex-wrap items-center gap-2 border-b border-line-soft px-3 py-1.5`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-semibold tracking-[0.04em] text-muted uppercase`,children:`Tosca steps`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:l?.name}),l&&t.cases.find(e=>e.id===s)&&(0,U.jsx)(`span`,{className:`text-[12px] text-muted`,children:K[t.cases.find(e=>e.id===s).route]||``})]}),(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 py-2`,children:l?(0,U.jsx)(we,{nodes:l.body,status:h,pick:d,onPick:e=>f(e.id||``)}):p?(0,U.jsx)(`p`,{className:`m-0 px-2 text-sm text-muted`,children:`Nothing to show.`}):(0,U.jsx)(`p`,{role:`status`,className:`m-0 px-2 text-sm text-muted`,children:`Loading…`})}),l&&(l.env.length>0||l.warnings.length>0)&&(0,U.jsxs)(`footer`,{className:`flex flex-col gap-1 border-t border-line-soft px-3 py-2 text-[12.5px] text-ink-2`,children:[l.env.length>0&&(0,U.jsxs)(`span`,{children:[`Environment variables: `,l.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),`.`]}),l.warnings.slice(0,3).map(e=>(0,U.jsx)(`span`,{className:`text-warn`,children:e},e))]})]}),l&&(0,U.jsx)(De,{view:l,node:Te(l.body,d)})]}),l?(0,U.jsx)(Ee,{view:l,pick:d}):(0,U.jsx)(`p`,{className:`m-0 flex min-h-[260px] items-center justify-center rounded-[12px] card border px-4 text-center text-sm text-muted`,children:p?`Nothing to show.`:`Loading…`})]}):(0,U.jsx)(L,{center:!0,className:`py-6`,children:`No test case of this plan is converted.`})}function ke(e){if(e.job?.running)return{label:e.job.kind===`fix`?`Fixing`:e.job.kind===`verify`?`Running tests`:`Running`,tone:`running`};let t=e.result;return t?.status===`running`?{label:t.stage===`validate`?`Validating`:`Running`,tone:`running`}:t?he[t.status]:e.job?.last?{label:`Did not start`,tone:`fail`}:e.confirmed?{label:`Confirmed`,tone:`neutral`}:me[e.plan.feasibility.verdict]}var Y=e=>e.slice(e.lastIndexOf(`/`)+1);function Ae({id:e,title:t,targetDir:n,onClose:r}){let[o,s]=(0,H.useState)(``),[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(``),p=async()=>{u(!0),f(``);try{await g.delete(e,o),location.hash=a(`tosca`)}catch(e){f(e.message),u(!1)}};return(0,U.jsx)(i,{open:!0,onClose:r,title:`Delete this conversion`,description:`${t}. Removes the plan and its run history from the list. Files already written under ${n} stay.`,footer:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(T,{variant:`ghost`,onClick:r,children:`Keep it`}),(0,U.jsxs)(T,{variant:`danger`,disabled:l||o!==e,onClick:()=>void p(),children:[(0,U.jsx)(c,{"aria-hidden":`true`}),`Delete`]})]}),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,U.jsxs)(`span`,{children:[`Type `,(0,U.jsx)(`span`,{className:`font-mono`,children:e}),` to confirm`]}),(0,U.jsx)(b,{value:o,onChange:e=>s(e.target.value),autoComplete:`off`,spellCheck:!1})]}),d?(0,U.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:d}):null]})})}function je({d:e,unit:t,onClose:n,onSend:r}){let[a,o]=(0,H.useState)(``),s=e.plan.units.find(e=>e.id===t),c=e.result?.units.find(e=>e.id===t);return(0,U.jsx)(i,{open:!0,onClose:n,title:`Fix ${s?Y(s.target):t}`,description:`The Tosca agent works on this file again, with ForgeQE's last check and your note. It runs in the background.`,footer:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(T,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,U.jsxs)(T,{variant:`primary`,onClick:()=>r(a.trim()),children:[(0,U.jsx)(h,{"aria-hidden":`true`}),`Send to the agent`]})]}),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[c?.problems?.length?(0,U.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:c.problems[0]}):null,(0,U.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:`What should change? (optional)`}),(0,U.jsx)(D,{value:a,rows:4,maxLength:2e3,placeholder:`The cart badge is a span now, not a button.`,onChange:e=>o(e.target.value)})]})]})})}function Me({d:e,unit:t,onClose:n}){let r=e.result?.units.find(e=>e.id===t),a=e.plan.units.find(e=>e.id===t);return(0,U.jsx)(i,{open:!0,onClose:n,wide:!0,title:`Output of ${a?Y(a.target):t}`,description:r?.checkedAt?`Run again ${de(r.checkedAt)}`:`From the conversion's own run`,footer:(0,U.jsx)(T,{onClick:n,children:`Close`}),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[r?.problems?.length?(0,U.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r.problems.join(` `)}):r?.status===`converted`?(0,U.jsx)(`p`,{className:`m-0 text-sm text-pass`,children:`Passes, with every Tosca step in the test.`}):null,r?.command&&(0,U.jsxs)(`code`,{className:`block font-mono text-[12px] text-muted`,children:[`$ `,r.command]}),(0,U.jsx)(`pre`,{className:`m-0 max-h-[60vh] overflow-auto rounded-[12px] bg-surface-muted px-3 py-2 font-mono text-[12.5px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:r?.output||`No output.`})]})})}function Ne(e){let t=Object.fromEntries(q.map(e=>[e,{status:e===`prepare`?`running`:`pending`,...e===`prepare`?{startedAt:new Date().toISOString()}:{}}]));return{status:`running`,plan:e.plan.id,target:e.plan.target,units:[],reverted:[],model:``,startedAt:e.job?.last?.startedAt||new Date().toISOString(),ms:0,stage:`prepare`,stages:t,notes:``}}function Pe({d:e,planView:t,busy:n,onFix:r,onSteps:i,onOutput:a,onRun:o}){let s=e.result||(e.job?.running?Ne(e):null);if(!s)return(0,U.jsx)(U.Fragment,{children:t});let c=new Map(s.units.map(e=>[e.id,e])),u=e.plan.units.filter(e=>e.kind===`test`),f=s.units.filter(e=>e.kind===`test`&&e.status===`converted`).length,p=s.units.reduce((e,t)=>t.fidelity?{m:e.m+t.fidelity.matched,n:e.n+t.fidelity.required}:e,{m:0,n:0}),m=s.units.filter(e=>e.status===`failed`||e.status===`blocked`).length,[g,..._]=e.plan.target.id.split(`-`);return(0,U.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,U.jsxs)(ue,{children:[(0,U.jsx)(V,{label:`Tests passing`,value:`${f} / ${u.length}`,tone:f===u.length&&u.length?`text-pass`:void 0}),(0,U.jsx)(V,{label:`Tosca steps in the tests`,value:p.n?`${p.m} / ${p.n}`:`–`,tone:p.n&&p.m===p.n?`text-pass`:void 0}),(0,U.jsx)(V,{label:`Need attention`,value:m,tone:m?`text-fail`:void 0}),(0,U.jsx)(V,{label:s.status===`running`?`Running for`:`Took`,value:B(s.status===`running`?Date.now()-Date.parse(s.startedAt):s.ms)})]}),s.notes&&(0,U.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:s.notes}),(0,U.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-5 @5xl:grid-cols-[minmax(0,1fr)_320px]`,children:[(0,U.jsx)(F,{label:`Files`,placeholder:`Find a file`,empty:`No files.`,head:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`th`,{className:`py-2 pr-3 pl-3 font-medium`,children:`File`}),(0,U.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:`Status`}),(0,U.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @2xl:table-cell`,children:`Tosca steps`}),(0,U.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @3xl:table-cell`,children:`Note`}),(0,U.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:(0,U.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:e.plan.units.map(t=>{let o=c.get(t.id),s=o?G[o.status]:null,u=t.case?e.plan.cases.find(e=>e.id===t.case):void 0;return(0,U.jsxs)(`tr`,{className:A,children:[(0,U.jsxs)(`td`,{className:O,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:t.kind===`setup`?`Project set-up`:Y(t.target)}),(0,U.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[u?u.name:`${ge[t.kind]} · ${t.target}`,u?.suites?.length?` · ${u.suites.join(`, `)}`:``]})]}),(0,U.jsxs)(`td`,{className:x(O,`whitespace-nowrap`),children:[s?(0,U.jsx)(d,{tone:s.tone,children:s.label}):(0,U.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Waiting`}),o?.checkedAt&&(0,U.jsxs)(`span`,{className:`block pt-1 text-[12px] text-muted`,children:[`Run again `,ie(o.checkedAt)]})]}),(0,U.jsx)(`td`,{className:x(O,`hidden text-[13px] whitespace-nowrap @2xl:table-cell`),children:o?.fidelity?(0,U.jsxs)(`span`,{className:o.fidelity.missing.length?`text-fail`:`text-ink-2`,children:[o.fidelity.matched,` of `,o.fidelity.required]}):(0,U.jsx)(`span`,{className:`text-muted`,children:`–`})}),(0,U.jsx)(`td`,{className:x(O,`hidden text-[13px] text-ink-2 @3xl:table-cell`),children:(0,U.jsx)(`span`,{className:`line-clamp-2`,children:o?.problems?.[0]||o?.reason||``})}),(0,U.jsx)(`td`,{className:x(O,`whitespace-nowrap text-right`),children:(0,U.jsxs)(`span`,{className:`inline-flex gap-1`,children:[t.kind===`test`&&(o?.output||o?.problems?.length)&&(0,U.jsxs)(T,{size:`sm`,variant:`ghost`,"aria-label":`Output of ${Y(t.target)}`,onClick:()=>a(t.id),children:[(0,U.jsx)(E,{"aria-hidden":`true`}),`Output`]}),t.case&&(0,U.jsxs)(T,{size:`sm`,variant:`ghost`,"aria-label":`Steps of ${Y(t.target)}`,onClick:()=>i(t.case),children:[(0,U.jsx)(l,{"aria-hidden":`true`}),`Steps`]}),o&&(o.status===`failed`||o.status===`blocked`)&&t.kind!==`setup`&&(0,U.jsxs)(T,{size:`sm`,disabled:n,"aria-label":`Fix ${Y(t.target)}`,onClick:()=>r(t.id),children:[(0,U.jsx)(h,{"aria-hidden":`true`}),`Fix`]})]})})]},t.id)})}),(0,U.jsxs)(`aside`,{"aria-label":`Details`,className:`flex flex-col gap-4 rounded-[14px] card border p-5 text-sm`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`From`}),(0,U.jsxs)(`span`,{className:`font-medium`,children:[`Tricentis Tosca`,e.plan.source.project?` · ${e.plan.source.project}`:``]}),(0,U.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:e.plan.source.file})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`To`}),(0,U.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,U.jsx)(z,{framework:g,language:_.join(`-`)}),e.plan.target.title]}),(0,U.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:e.targetPath})]}),(e.plan.suites||[]).length>0&&(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Suites`}),(0,U.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1.5 p-0`,children:e.plan.suites.map(e=>{let t=new Set(e.cases),r=s.units.filter(e=>e.kind===`test`&&e.case&&t.has(e.case)&&e.status===`converted`).length;return(0,U.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,U.jsx)(`span`,{className:`truncate`,children:e.name}),(0,U.jsxs)(`span`,{className:x(`text-[12px]`,r===e.cases.length?`text-pass`:`text-muted`),children:[r,` of `,W(e.cases.length,`test`),` pass · @`,e.tag]})]}),(0,U.jsxs)(T,{size:`sm`,variant:`ghost`,disabled:n,"aria-label":`Run the ${e.name} suite`,onClick:()=>o(e.name),children:[(0,U.jsx)(S,{"aria-hidden":`true`}),`Run`]})]},e.name)})})]}),e.plan.env.length>0&&(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Environment variables`}),(0,U.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:e.plan.env.map(e=>(0,U.jsxs)(`li`,{className:`flex flex-col`,children:[(0,U.jsxs)(`span`,{className:`font-mono text-[12px]`,children:[e.name,e.secret?(0,U.jsx)(`span`,{className:`font-sans text-muted`,children:` · secret`}):null]}),(0,U.jsx)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:e.from})]},e.name))})]}),(0,U.jsxs)(`dl`,{className:`m-0 grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 border-t border-line-soft pt-4`,children:[(0,U.jsx)(`dt`,{className:`text-muted`,children:`Started`}),(0,U.jsx)(`dd`,{className:`m-0 text-right`,children:de(s.startedAt)}),s.model&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{className:`text-muted`,children:`Agent`}),(0,U.jsx)(`dd`,{className:`m-0 truncate text-right`,"data-tip":s.model,children:s.model})]}),s.reverted.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{className:`text-muted`,children:`Put back`}),(0,U.jsxs)(`dd`,{className:`m-0 text-right`,children:[s.reverted.length,` edits outside the target`]})]})]})]})]})]})}var Fe={ok:{mark:`✓`,cls:`text-pass`},fail:{mark:`✗`,cls:`text-fail`},info:{mark:`•`,cls:`text-muted`},agent:{mark:`•`,cls:`text-accent-fg`},tool:{mark:`·`,cls:`text-muted`}};function Ie({events:e,running:t}){let n=(0,H.useRef)(null);(0,H.useEffect)(()=>{t&&n.current&&(n.current.scrollTop=n.current.scrollHeight)},[e.length,t]);let r=e.filter(e=>e.kind!==`tool`);return(0,U.jsxs)(`ol`,{ref:n,"aria-live":t?`polite`:void 0,"aria-label":`Activity`,className:`m-0 flex max-h-[60vh] list-none flex-col overflow-y-auto rounded-[12px] card border p-0`,children:[r.map((e,t)=>(0,U.jsxs)(`li`,{className:`flex gap-3 border-b border-line-soft px-4 py-2 text-[13px] last:border-b-0`,children:[(0,U.jsx)(`span`,{className:`w-[64px] flex-none text-[12px] text-muted tabular-nums`,children:new Date(e.ts).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:x(`w-3 flex-none text-center`,Fe[e.kind].cls),children:Fe[e.kind].mark}),(0,U.jsx)(`span`,{className:x(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.kind===`fail`?`text-fail`:e.kind===`ok`?`text-ink`:`text-ink-2`),children:e.text})]},t)),!r.length&&(0,U.jsx)(`li`,{className:`px-4 py-8 text-center text-sm text-muted`,children:`Nothing yet.`})]})}function Le({id:e,plan:t}){let[n,r]=(0,H.useState)(null),[i,o]=(0,H.useState)(``),[s,l]=(0,H.useState)(`overview`),[u,m]=(0,H.useState)(),[h,_]=(0,H.useState)(null),[v,y]=(0,H.useState)(null),[b,x]=(0,H.useState)([]),[S,C]=(0,H.useState)(!1),[w,E]=(0,H.useState)(!1),D=(0,H.useRef)(0),O=(0,H.useCallback)(()=>{g.detail(e).then(e=>{r(e),o(``)},e=>o(e.message)),g.events(e,D.current).then(e=>{e.next<D.current?(D.current=0,x([])):(D.current=e.next,e.events.length&&x(t=>[...t,...e.events].slice(-2e3)))},()=>{})},[e]);(0,H.useEffect)(O,[O]);let A=!!(n?.job?.running||n?.result?.status===`running`);(0,H.useEffect)(()=>{if(!A)return;let e=setInterval(O,1500);return()=>clearInterval(e)},[A,O]);let j=(0,H.useCallback)(e=>{r(e),o(``),l(`overview`),setTimeout(O,800)},[O]),M=async e=>{C(!0),o(``);try{r(await e()),setTimeout(O,800)}catch(e){o(e.message)}finally{C(!1)}};if(!n)return i?(0,U.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i}):(0,U.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});let N=ke(n),P=ye(n.plan,n.result),F=n.result,ee=(F?.units||[]).filter(e=>e.kind===`test`&&(e.status===`failed`||e.status===`blocked`)).length,I=n.plan.cases.filter(e=>e.included).length,L=[{id:`overview`,label:`Overview`},{id:`steps`,label:`Steps`,n:I?String(I):void 0,tone:ee?`text-fail`:void 0},{id:`activity`,label:`Activity`}];return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`a`,{href:a(`tosca`),className:`inline-flex items-center gap-1.5 self-start text-sm`,children:[(0,U.jsx)(f,{size:16,"aria-hidden":`true`}),`Tosca`]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 @3xl:flex-row @3xl:items-start`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsxs)(`h2`,{className:`m-0 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[20px] leading-snug font-semibold tracking-[-0.01em]`,children:[(0,U.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:Y(n.plan.source.file)}),(0,U.jsx)(k,{size:18,"aria-hidden":`true`,className:`text-muted`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,U.jsx)(z,{framework:n.plan.target.id.split(`-`)[0],language:n.plan.target.id.split(`-`).slice(1).join(`-`),size:20}),n.plan.target.title]})]}),(0,U.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-1.5 text-sm text-muted`,children:[(0,U.jsxs)(`span`,{children:[`Tricentis Tosca`,n.plan.source.project?` · ${n.plan.source.project}`:``]}),(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,U.jsxs)(`span`,{children:[`into `,(0,U.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:n.plan.target.dir})]})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(d,{tone:N.tone,children:N.label}),A?(0,U.jsxs)(T,{variant:`danger`,disabled:S,onClick:()=>void M(()=>g.stop(e)),children:[(0,U.jsx)(ne,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]}):(0,U.jsxs)(U.Fragment,{children:[F?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(T,{variant:`ghost`,onClick:()=>location.hash=a(`tosca`,e,`report`),children:`Report`}),(0,U.jsxs)(T,{disabled:S,onClick:()=>void M(()=>g.verify(e)),"data-tip":`Run every converted test again, no agent`,children:[(0,U.jsx)(p,{"aria-hidden":`true`}),`Run tests again`]})]}):null,(0,U.jsxs)(T,{variant:`ghost`,disabled:S,onClick:()=>E(!0),"data-tip":`Remove this plan from the list. Converted tests stay.`,children:[(0,U.jsx)(c,{"aria-hidden":`true`}),`Delete`]})]})]})]}),w&&(0,U.jsx)(Ae,{id:e,title:`${Y(n.plan.source.file)} → ${n.plan.target.title}`,targetDir:n.plan.target.dir,onClose:()=>E(!1)}),F&&(0,U.jsxs)(`div`,{className:`flex items-center gap-3 rounded-[12px] card border px-3 py-2.5 @xl:gap-4 @xl:px-4`,children:[(0,U.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,U.jsx)(xe,{states:F.stages})}),A&&(0,U.jsxs)(`span`,{className:`flex-none text-[13px] font-semibold tabular-nums text-accent-fg`,"aria-label":`${Math.round(P)}% done`,children:[Math.round(P),`%`]})]}),i&&(0,U.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i}),(0,U.jsx)(fe,{tabs:L,tab:s,onTab:l,label:`Tosca conversion`}),(0,U.jsxs)(`div`,{role:`tabpanel`,id:`mpanel-${s}`,"aria-labelledby":`mtab-${s}`,className:`flex min-w-0 flex-col gap-4`,children:[s===`overview`&&(0,U.jsx)(Pe,{d:n,planView:t(n,j),busy:S||A,onFix:_,onSteps:e=>(m(e),l(`steps`)),onOutput:y,onRun:t=>void M(()=>g.verify(e,t))}),s===`steps`&&(0,U.jsx)(Oe,{id:e,plan:n.plan,result:F,initial:u}),s===`activity`&&(0,U.jsx)(Ie,{events:b,running:A})]}),v&&(0,U.jsx)(Me,{d:n,unit:v,onClose:()=>y(null)}),h&&(0,U.jsx)(je,{d:n,unit:h,onClose:()=>_(null),onSend:t=>{_(null),M(()=>g.fix(e,[h],t))}})]})}var Re=e=>e.slice(e.lastIndexOf(`/`)+1),ze={prepare:`Prepare`,setup:`Set up`,pages:`Pages`,tests:`Tests`,validate:`Validate`,review:`Review`};function Be(e){return e===`converted`?G.converted:e===`failed`?G.failed:e===`blocked`?G.blocked:e===`left out`||e===`skipped`||e===`not run`?{label:e===`left out`?`Left out`:e===`not run`?`Not run`:`Skipped`,tone:`neutral`}:{label:e,tone:`neutral`}}function Ve(e){for(let t of q){let n=e[t];if(n?.status===`failed`)return{id:t,...n.note?{note:n.note}:{}}}return null}function He({title:e,children:n,defaultOpen:r}){let[i,a]=(0,H.useState)(!!r),o=(0,H.useId)();return(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-controls":o,onClick:()=>a(!i),className:`inline-flex min-h-8 cursor-pointer items-center gap-1.5 self-start rounded-[8px] border-0 bg-transparent px-1 text-sm font-medium text-ink hover:bg-surface-strong`,children:[(0,U.jsx)(R,{size:15,"aria-hidden":`true`,className:x(`transition-transform`,i&&`rotate-180`)}),e]}),(0,U.jsx)(t,{open:i,id:o,children:n})]})}function Ue({planId:e,unit:t,file:n}){let[r,i]=(0,H.useState)(``),[a,o]=(0,H.useState)(!1),s=/\.(webm|mp4)$/i.test(n);return(0,H.useEffect)(()=>{let r=!1;return i(``),o(!1),g.evidence(e,t,n).then(e=>!r&&i(e),()=>!r&&o(!0)),()=>{r=!0}},[e,t,n]),(0,U.jsxs)(`li`,{className:`flex max-w-[320px] flex-col gap-1`,children:[r?s?(0,U.jsx)(`video`,{controls:!0,src:r,className:`max-h-[220px] w-full rounded-[10px] border border-line-soft bg-surface-muted`}):(0,U.jsx)(`img`,{src:r,alt:n,className:`max-h-[220px] w-full rounded-[10px] border border-line-soft object-contain`}):(0,U.jsx)(`span`,{className:`flex h-[120px] items-center justify-center rounded-[10px] border border-line-soft bg-surface-muted text-[12px] text-muted`,children:a?`Not available`:`Loading…`}),(0,U.jsx)(`span`,{className:`font-mono text-[11px] text-muted`,children:n})]})}function We({planId:e,unit:t,files:n}){return!t||!n.length?null:(0,U.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-3 p-0`,children:n.map(n=>(0,U.jsx)(Ue,{planId:e,unit:t,file:n},n))})}function Ge({planId:e,t}){let n=t.fidelity,r=t.status===`failed`||t.status===`blocked`,i=t.problems?.length?t.problems.join(` `):r&&t.reason?t.reason:``;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-[14px] card border p-5`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`h3`,{className:`m-0 text-[16px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:t.name}),(0,U.jsxs)(`p`,{className:`m-0 pt-1 text-[13px] text-muted`,children:[t.file?(0,U.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:t.file}):`No file`,t.suites.length?` · ${t.suites.join(`, `)}`:``,t.folders.length?` · ${t.folders.join(` / `)}`:``]})]}),(0,U.jsx)(d,{tone:Be(t.status).tone,children:Be(t.status).label}),t.ms>0&&(0,U.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:B(t.ms)})]}),i&&(0,U.jsx)(`p`,{role:`status`,className:x(`m-0 rounded-[10px] px-3 py-2 text-sm [overflow-wrap:anywhere]`,r?`bg-fail-soft text-fail`:`bg-surface-muted text-ink-2`),children:i}),n&&n.rows.length>0&&(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`span`,{className:`text-[12px] font-medium text-muted`,children:[`Tosca steps (`,n.matched,` of `,n.required,`)`]}),(0,U.jsx)(`ol`,{className:`m-0 flex list-none flex-col rounded-[10px] border border-line-soft p-0 text-[13px]`,children:n.rows.map(e=>{let t=_e[e.status]||_e.matched;return(0,U.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-3 border-b border-line-soft px-3 py-2 last:border-b-0`,children:[(0,U.jsx)(`span`,{className:x(`mt-1.5 h-2 w-2 flex-none rounded-full`,t.dot),"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`w-12 flex-none font-mono text-[12px] text-muted`,children:e.id}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[e.kind===`assert`?`check ${e.op}`:e.op,` on `,e.element||`—`,(0,U.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[t.label,e.step?` · Tosca “${e.step}”`:``]})]})]},e.id)})})]}),t.media.length>0?(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Screenshots and video`}),(0,U.jsx)(We,{planId:e,unit:t.unit,files:t.media})]}):r?(0,U.jsx)(`p`,{className:`m-0 text-[12.5px] text-muted`,children:`No screenshot or video was kept for this failure.`}):null,t.command&&(0,U.jsxs)(`code`,{className:`block font-mono text-[12px] text-muted`,children:[`$ `,t.command]}),t.output&&(0,U.jsx)(He,{title:`Test output`,defaultOpen:r,children:(0,U.jsx)(`pre`,{className:`m-0 max-h-[40vh] overflow-auto rounded-[10px] bg-surface-muted px-3 py-2 font-mono text-[12.5px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:t.output})})]})}function Ke({id:e}){let[t,r]=(0,H.useState)(null),[i,s]=(0,H.useState)(``),[c,l]=(0,H.useState)(!0),[u,p]=(0,H.useState)(`all`),[m,h]=(0,H.useState)(``);(0,H.useEffect)(()=>{l(!0),g.report(e).then(e=>{if(r(e.report),s(e.report?``:`No report yet. Start the conversion first.`),l(!1),e.report){let t=e.report.tests.filter(e=>e.status!==`left out`),n=t.find(e=>e.status===`failed`||e.status===`blocked`);h(n?.case||t[0]?.case||``),p(n?`attention`:`all`)}},e=>{s(e.message),l(!1)})},[e]);let _=(0,H.useMemo)(()=>t?t.tests.filter(e=>e.status!==`left out`):[],[t]),v=(0,H.useMemo)(()=>_.filter(e=>!(u===`attention`&&e.status!==`failed`&&e.status!==`blocked`||u===`converted`&&e.status!==`converted`)),[_,u]);if((0,H.useEffect)(()=>{m&&(v.some(e=>e.case===m)||h(v[0]?.case||``))},[v,m]),c)return(0,U.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading report…`});if(i||!t)return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`a`,{href:a(`tosca`,e),className:`inline-flex items-center gap-1.5 self-start text-sm`,children:[(0,U.jsx)(f,{size:16,"aria-hidden":`true`}),`Conversion`]}),(0,U.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i||`No report.`})]});let y=_.filter(e=>e.status===`converted`).length,b=_.filter(e=>e.status===`failed`||e.status===`blocked`).length,S=_.reduce((e,t)=>t.fidelity?{m:e.m+t.fidelity.matched,n:e.n+t.fidelity.required}:e,{m:0,n:0}),C=_.reduce((e,t)=>e+t.media.length,0),w=he[t.status]||{label:t.status,tone:`neutral`},[T,...D]=t.target.id.split(`-`),j=Ve(t.stages),M=_.find(e=>e.case===m)||null,N=[{id:`all`,label:`All (${_.length})`},{id:`attention`,label:`Needs attention (${b})`},{id:`converted`,label:`Converted (${y})`}];return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`a`,{href:a(`tosca`,e),className:`inline-flex items-center gap-1.5 self-start text-sm`,children:[(0,U.jsx)(f,{size:16,"aria-hidden":`true`}),`Conversion`]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 @3xl:flex-row @3xl:items-start`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsx)(`p`,{className:`m-0 text-[12px] font-medium tracking-wide text-muted uppercase`,children:`Conversion report`}),(0,U.jsxs)(`h2`,{className:`m-0 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[20px] leading-snug font-semibold tracking-[-0.01em]`,children:[(0,U.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:Re(t.source.file)}),(0,U.jsx)(k,{size:18,"aria-hidden":`true`,className:`text-muted`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,U.jsx)(z,{framework:T,language:D.join(`-`),size:20}),t.target.title]})]}),(0,U.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-1.5 text-sm text-muted`,children:[(0,U.jsxs)(`span`,{children:[`Tricentis Tosca`,t.source.project?` · ${t.source.project}`:``]}),(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,U.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:t.id}),(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,U.jsxs)(`span`,{children:[`Started `,de(t.startedAt)]})]})]}),(0,U.jsx)(d,{tone:w.tone,children:w.label})]}),j&&(0,U.jsxs)(`p`,{role:`status`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[`Failed in `,ze[j.id],j.note?`: ${j.note}`:``]}),(0,U.jsxs)(ue,{children:[(0,U.jsx)(V,{label:`Tests passing`,value:`${y} / ${_.length}`,tone:y===_.length&&_.length?`text-pass`:void 0}),(0,U.jsx)(V,{label:`Total time`,value:B(t.ms)}),(0,U.jsx)(V,{label:`Tosca steps`,value:S.n?`${S.m} / ${S.n}`:`–`,tone:S.n&&S.m===S.n?`text-pass`:void 0}),(0,U.jsx)(V,{label:`Media`,value:C,sub:C?`screenshots / video`:`only on failure`})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-5 @5xl:grid-cols-[minmax(0,1fr)_300px]`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,U.jsx)(F,{label:`Test cases`,placeholder:`Find a test case`,empty:_.length?`No test case matches.`:`No test cases.`,resetKey:u,tools:(0,U.jsx)(`div`,{role:`group`,"aria-label":`Filter test cases`,className:`flex flex-wrap gap-1`,children:N.map(e=>(0,U.jsx)(`button`,{type:`button`,"aria-pressed":u===e.id,onClick:()=>p(e.id),className:x(`min-h-8 cursor-pointer rounded-[8px] border px-2.5 text-[13px]`,u===e.id?`border-accent bg-accent-soft font-medium text-accent-fg`:`border-line bg-transparent text-ink-2 hover:bg-surface-muted`),children:e.label},e.id))}),head:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`th`,{className:`py-2 pr-3 pl-3 font-medium`,children:`Test case`}),(0,U.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:`Status`}),(0,U.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @2xl:table-cell`,children:`Steps`}),(0,U.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @3xl:table-cell`,children:`Time`})]}),children:v.map(e=>{let t=Be(e.status),n=m===e.case;return(0,U.jsxs)(`tr`,{className:x(A,`cursor-pointer hover:bg-surface-muted`,n&&`bg-accent-soft`),onClick:()=>h(e.case),"aria-selected":n,children:[(0,U.jsxs)(`td`,{className:O,children:[(0,U.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.name}),(0,U.jsx)(`span`,{className:`block font-mono text-[12px] text-muted`,children:e.file||`No file`})]}),(0,U.jsxs)(`td`,{className:x(O,`whitespace-nowrap`),children:[(0,U.jsx)(d,{tone:t.tone,children:t.label}),e.media.length>0&&(0,U.jsx)(`span`,{className:`block pt-1 text-[12px] text-muted`,children:W(e.media.length,`file`)})]}),(0,U.jsx)(`td`,{className:x(O,`hidden text-[13px] whitespace-nowrap tabular-nums @2xl:table-cell`,e.fidelity?.missing.length?`text-fail`:`text-ink-2`),children:e.fidelity?`${e.fidelity.matched}/${e.fidelity.required}`:`–`}),(0,U.jsx)(`td`,{className:x(O,`hidden text-[13px] whitespace-nowrap text-muted tabular-nums @3xl:table-cell`),children:e.ms>0?B(e.ms):`–`})]},e.case)})}),M?(0,U.jsx)(Ge,{planId:t.id,t:M}):v.length?(0,U.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Select a test case for steps, output, and media.`}):null,t.personSteps.length>0&&(0,U.jsxs)(`section`,{className:`flex flex-col gap-2 rounded-[14px] bg-warn-soft px-5 py-4`,children:[(0,U.jsx)(`h3`,{className:`m-0 text-sm font-semibold text-warn`,children:`Steps a person has to finish`}),(0,U.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-5 text-sm text-ink`,children:t.personSteps.map(e=>(0,U.jsxs)(`li`,{children:[e.case,` / `,e.id,`: Tosca step “`,e.step,`” on “`,e.element,`”`]},`${e.case}-${e.id}`))})]})]}),(0,U.jsxs)(`aside`,{"aria-label":`Summary`,className:`flex flex-col gap-4 rounded-[14px] card border p-5 text-sm @5xl:sticky @5xl:top-6`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`From`}),(0,U.jsxs)(`span`,{className:`font-medium`,children:[`Tricentis Tosca`,t.source.project?` · ${t.source.project}`:``]}),(0,U.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:t.source.file}),t.source.baseUrl&&(0,U.jsx)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:t.source.baseUrl})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`To`}),(0,U.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,U.jsx)(z,{framework:T,language:D.join(`-`)}),t.target.title]}),(0,U.jsxs)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:[t.target.dir,`/`]})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`LLM`}),(0,U.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:t.model||`—`}),t.usage.input||t.usage.output?(0,U.jsxs)(`dl`,{className:`m-0 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-[12.5px]`,children:[(0,U.jsx)(`dt`,{className:`text-muted`,children:`Tokens`}),(0,U.jsx)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:n(t.usage.input+t.usage.output)}),(0,U.jsx)(`dt`,{className:`text-muted`,children:`Read`}),(0,U.jsxs)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:[n(t.usage.input),t.usage.cached?(0,U.jsxs)(`span`,{className:`text-muted`,children:[` · `,n(t.usage.cached),` cached`]}):null]}),(0,U.jsx)(`dt`,{className:`text-muted`,children:`Written`}),(0,U.jsx)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:n(t.usage.output)}),(0,U.jsx)(`dt`,{className:`text-muted`,children:`Cost`}),(0,U.jsx)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:t.cost?(0,U.jsxs)(U.Fragment,{children:[t.cost.estimate?`≈`:``,o(t.cost.amount,t.cost.currency)]}):`—`})]}):(0,U.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`No usage recorded.`})]}),t.env.length>0&&(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Environment variables`}),(0,U.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:t.env.map(e=>(0,U.jsxs)(`li`,{className:`flex flex-col`,children:[(0,U.jsxs)(`span`,{className:`font-mono text-[12px]`,children:[e.name,e.secret?(0,U.jsx)(`span`,{className:`font-sans text-muted`,children:` · secret`}):null]}),(0,U.jsx)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:e.from})]},e.name))})]}),t.reverted.length>0&&(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Put back`}),(0,U.jsxs)(`span`,{className:`text-[12.5px] text-ink-2`,children:[t.reverted.length,` edit`,t.reverted.length===1?``:`s`,` outside the target`]})]}),t.notes&&(0,U.jsxs)(`p`,{className:`m-0 border-t border-line-soft pt-4 text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:[(0,U.jsx)(E,{size:14,"aria-hidden":`true`,className:`mr-1 inline align-text-bottom`}),t.notes]})]})]})]})}var qe=[`Export`,`Target`,`Instructions`,`Review`],Je=[`The Tosca export and its test cases`,`Framework and language`,`Your rules, optional`,`Check and start`],Ye=[`Keep one page object per Tosca module, in pages/.`,`Name each test after its Tosca test case.`,`Read the base URL from BASE_URL.`],Xe={playwright:`Microsoft`,cypress:`JavaScript only`,webdriverio:`WebDriver and BiDi`,selenium:`WebDriver`};function Ze({at:e,reached:t,onGo:n}){return(0,U.jsx)(`nav`,{"aria-label":`Steps`,children:(0,U.jsx)(`ol`,{className:`m-0 flex list-none items-center gap-2 p-0`,children:qe.map((r,i)=>{let a=i<=t,o=i===e,c=i<t&&!o;return(0,U.jsxs)(`li`,{className:x(`flex items-center gap-2`,i<qe.length-1&&`flex-1`),children:[(0,U.jsxs)(`button`,{type:`button`,disabled:!a,"aria-current":o?`step`:void 0,onClick:()=>n(i),"aria-label":r,"data-tip":Je[i],className:x(`inline-flex min-h-8 flex-none items-center gap-2 rounded-[8px] border-0 bg-transparent px-1 text-[13px] whitespace-nowrap`,a&&!o?`cursor-pointer hover:bg-surface-strong`:``),children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:x(`inline-flex size-6 flex-none items-center justify-center rounded-full text-[11px] font-semibold tabular-nums`,c?`bg-pass text-white`:o?`bg-accent text-accent-ink`:`border border-line bg-bg text-muted`),children:c?(0,U.jsx)(s,{size:13,strokeWidth:3}):i+1}),(0,U.jsx)(`span`,{className:x(o?`font-medium text-ink`:a?`text-ink-2`:`text-muted`,!o&&`hidden @xl:inline`),children:r})]}),i<qe.length-1&&(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`h-0.5 min-w-4 flex-1 overflow-hidden rounded-full bg-line @xl:min-w-8`,children:(0,U.jsx)(`span`,{className:x(`block h-full rounded-full bg-pass transition-[width] duration-500`,i<t?`w-full`:`w-0`)})})]},r)})})})}function X({id:e,label:t,help:n,children:r}){return(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:e,className:`text-sm font-medium`,children:t}),r,n&&(0,U.jsx)(`span`,{className:`text-[13px] text-muted`,children:n})]})}function Z({busy:e,onBack:t,next:n,onNext:r,disabled:i,aside:a}){return(0,U.jsxs)(`div`,{className:`sticky bottom-0 flex flex-wrap items-center gap-3 border-t border-line-soft bg-bg py-3`,children:[(0,U.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px]`,children:a}),t&&(0,U.jsx)(T,{variant:`ghost`,disabled:e,onClick:t,children:`Back`}),(0,U.jsx)(T,{variant:`primary`,disabled:e||i,onClick:r,children:n})]})}function Qe({on:e,onPick:t,logo:n,title:r,sub:i,label:a}){return(0,U.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":e,"aria-label":a,onClick:t,className:x(`flex min-h-[72px] min-w-0 cursor-pointer items-center gap-3 rounded-[12px] border px-3.5 py-3 text-left transition-colors`,e?`border-accent bg-accent-soft ring-1 ring-accent`:`border-line-soft bg-bg hover:border-line hover:bg-surface-muted`),children:[(0,U.jsx)(`span`,{className:`inline-flex size-9 flex-none items-center justify-center rounded-[10px] bg-surface-muted`,children:n}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,U.jsx)(`span`,{className:`truncate text-sm font-medium text-ink`,children:r}),i&&(0,U.jsx)(`span`,{className:`truncate text-[12px] text-muted`,children:i})]})]})}var $e=e=>e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;function et({s:e}){return(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-[12px] bg-surface-muted px-4 py-3 text-sm`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:e.project||e.file}),(0,U.jsxs)(`span`,{className:`text-ink-2`,children:[W(e.test_cases.length,`test case`),` · `,W(e.pages.length,`module`),` · `,W(e.totals.steps,`step`),` · `,W(e.totals.asserts,`check`)]}),e.suites.length>0&&(0,U.jsxs)(`span`,{className:`text-ink-2`,children:[`· `,W(e.suites.length,`execution list`)]}),e.totals.unsupported>0&&(0,U.jsxs)(`span`,{className:`text-warn`,children:[`· `,e.totals.unsupported===1?`1 step value cannot`:`${e.totals.unsupported} step values cannot`,` be converted`]})]})}function tt({view:e,file:t,setFile:n,found:r,setFound:i,only:a,setOnly:o}){let[s,c]=(0,H.useState)(e.exports.some(e=>e.path===t)?``:t),[l,u]=(0,H.useState)(!1),[f,p]=(0,H.useState)(``),h=async e=>{if(n(e),i(null),p(``),e){u(!0);try{let t=await g.inspect(e);i(t),o(new Set(t.test_cases.filter(e=>e.route===`web`||(e.routes?.web??0)>0).map(e=>e.id)))}catch(e){p(e.message)}finally{u(!1)}}},_=e=>{let t=new Set(a);t.has(e)?t.delete(e):t.add(e),o(t)};return(0,U.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[e.exports.length>0?(0,U.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2.5 border-0 p-0`,children:[(0,U.jsx)(`legend`,{className:`mb-2.5 text-sm font-medium`,children:`Tosca exports in this project`}),(0,U.jsx)(`div`,{role:`radiogroup`,"aria-label":`Tosca exports`,className:`grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-2.5`,children:e.exports.map(e=>(0,U.jsx)(Qe,{on:t===e.path,onPick:()=>void h(e.path),logo:(0,U.jsx)(m,{size:18,"aria-hidden":`true`,className:`text-ink-2`}),title:e.path.slice(e.path.lastIndexOf(`/`)+1),sub:`${e.path.includes(`/`)?e.path.slice(0,e.path.lastIndexOf(`/`)):`.`} · ${$e(e.bytes)}`,label:e.path},e.path))})]}):(0,U.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-3 text-sm text-ink-2`,children:[`No Tosca export (.tsu) in this project yet. Export the test cases from Tosca Commander, put the file inside the project, for example `,(0,U.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:`tosca/checkout.tsu`}),`, and type its path below.`]}),(0,U.jsx)(X,{id:`tsc-path`,label:e.exports.length?`Or type its path`:`Path of the export`,help:`Inside the project. Secrets in it stay encrypted: they become environment variables.`,children:(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,U.jsx)(b,{id:`tsc-path`,value:s,spellCheck:!1,maxLength:300,placeholder:`tosca/checkout.tsu`,onChange:e=>c(e.target.value),className:`min-w-0 flex-[1_1_300px]`}),(0,U.jsx)(T,{disabled:l||!s.trim(),onClick:()=>void h(s.trim()),children:l?`Reading…`:`Read it`})]})}),f&&(0,U.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:f}),l&&!f&&(0,U.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Reading the export…`}),r&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(et,{s:r}),(0,U.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,U.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:`Test cases to convert`}),(0,U.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:r.test_cases.map(e=>{let t=e.route===`web`||(e.routes?.web??0)>0;return(0,U.jsx)(`li`,{className:`border-b border-line-soft last:border-b-0`,children:(0,U.jsxs)(`label`,{className:x(`flex min-h-11 items-start gap-3 px-4 py-2.5`,t?`cursor-pointer`:``),children:[(0,U.jsx)(`input`,{type:`checkbox`,className:`mt-0.5`,disabled:!t,checked:t&&a.has(e.id),onChange:()=>_(e.id)}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`font-medium text-ink [overflow-wrap:anywhere]`,children:e.name}),(0,U.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[e.folders.join(` / `)||`–`,` · `,W(e.steps,`step`),` · `,W(e.asserts,`check`),e.unsupported?` · ${e.unsupported} not convertible`:``,e.suites.length?` · in ${e.suites.join(`, `)}`:``]})]}),(0,U.jsx)(d,{tone:t?`neutral`:`warn`,children:e.route===`web`?K.web:t?`${K.web} + notes`:`${K[e.route]||e.route}: later`})]})},e.id)})})]}),r.env.length>0&&(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:`Environment variables`}),(0,U.jsxs)(`span`,{className:`text-[13px] text-ink-2`,children:[r.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),`. Their values are never in the export; you set them before the tests run.`]})]})]})]})}function nt({view:e,to:t,setTo:n,into:r,setInto:i,attr:a,setAttr:o}){let s=e=>e.split(`-`)[0],c=e=>e.split(`-`).slice(1).join(`-`),l=[...new Map(e.targets.map(e=>[s(e.id),e.framework])).entries()],u=e.targets.filter(e=>s(e.id)===s(t));return(0,U.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,U.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2.5 border-0 p-0`,children:[(0,U.jsx)(`legend`,{className:`mb-2.5 text-sm font-medium`,children:`Framework`}),(0,U.jsx)(`div`,{role:`radiogroup`,"aria-label":`Framework`,className:`grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2.5`,children:l.map(([r,i])=>{let a=le[r];return(0,U.jsx)(Qe,{on:s(t)===r,onPick:()=>n((e.targets.find(e=>s(e.id)===r&&c(e.id)===c(t))||e.targets.find(e=>s(e.id)===r)).id),logo:a?(0,U.jsx)(a,{width:22,height:22,"aria-hidden":`true`}):null,title:i,sub:Xe[r],label:i},r)})})]}),(0,U.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2.5 border-0 p-0`,children:[(0,U.jsx)(`legend`,{className:`mb-2.5 text-sm font-medium`,children:`Language`}),(0,U.jsx)(`div`,{role:`radiogroup`,"aria-label":`Language`,className:`grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2.5`,children:u.map(e=>{let r=ce[c(e.id)];return(0,U.jsx)(Qe,{on:t===e.id,onPick:()=>n(e.id),logo:r?(0,U.jsx)(r,{width:22,height:22,"aria-hidden":`true`}):null,title:e.language,label:e.language},e.id)})})]}),(0,U.jsxs)(`div`,{className:`grid gap-4 @2xl:grid-cols-2`,children:[(0,U.jsx)(X,{id:`tsc-into`,label:`Output folder`,help:`A new folder. Empty: named after the target.`,children:(0,U.jsx)(b,{id:`tsc-into`,value:r,spellCheck:!1,maxLength:300,placeholder:`tosca-${t}`,onChange:e=>i(e.target.value)})}),(0,U.jsx)(X,{id:`tsc-attr`,label:`Test id attribute (optional)`,help:`When the app's is not data-test-id, data-testid, data-test, data-cy or data-qa.`,children:(0,U.jsx)(b,{id:`tsc-attr`,value:a,spellCheck:!1,maxLength:40,placeholder:`data-automation-id`,onChange:e=>o(e.target.value.replace(/[^A-Za-z0-9_-]/g,``))})})]})]})}function rt({view:e,file:t,found:n,only:r,to:i,instructions:a}){let o=e.targets.find(e=>e.id===i),s=(e,t)=>(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-b border-line-soft py-3.5 first:pt-0 last:border-b-0 last:pb-0`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:e}),(0,U.jsx)(`div`,{className:`text-sm`,children:t})]});return(0,U.jsxs)(`aside`,{"aria-label":`Summary`,className:`flex flex-col rounded-[14px] card border p-5`,children:[s(`Export`,t?(0,U.jsx)(`span`,{className:`font-mono text-[12.5px] [overflow-wrap:anywhere]`,children:t}):(0,U.jsx)(`span`,{className:`text-muted`,children:`Not picked yet`})),s(`Test cases`,n?(0,U.jsxs)(`span`,{children:[r.size,` of `,n.test_cases.length,` picked`]}):(0,U.jsx)(`span`,{className:`text-muted`,children:`–`})),s(`Target`,o?(0,U.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,U.jsx)(z,{framework:o.id.split(`-`)[0],language:o.id.split(`-`).slice(1).join(`-`)}),o.title]}):(0,U.jsx)(`span`,{className:`text-muted`,children:`–`})),s(`Instructions`,a.trim()?(0,U.jsx)(`span`,{className:`line-clamp-3 text-ink-2`,children:a.trim()}):(0,U.jsx)(`span`,{className:`text-muted`,children:`None`}))]})}function it({view:e,review:t,onStart:n}){let[r,i]=(0,H.useState)(0),[a,o]=(0,H.useState)(0),[s,c]=(0,H.useState)(``),[l,u]=(0,H.useState)(null),[d,f]=(0,H.useState)(new Set),[p,m]=(0,H.useState)(e.targets[0]?.id||``),[h,_]=(0,H.useState)(``),[y,b]=(0,H.useState)(``),[x,C]=(0,H.useState)(``),[w,T]=(0,H.useState)(null),[E,O]=(0,H.useState)(!1),[k,A]=(0,H.useState)(!1),[j,M]=(0,H.useState)(``),N=[...d].sort().join(`,`);(0,H.useEffect)(()=>{T(null),O(!1),o(e=>Math.min(e,2))},[s,N,p,h,y,x]);let P=e=>{i(e),o(t=>Math.max(t,e)),M(``)},F=async()=>{A(!0),M(``);try{let e=!l||l.test_cases.filter(e=>e.route===`web`||(e.routes?.web??0)>0).every(e=>d.has(e.id)),t=await g.plan({file:s,to:p,...h.trim()?{into:h.trim()}:{},...e?{}:{only:[...d]},...x.trim()?{instructions:x.trim()}:{},...y?{testAttributes:[y]}:{}});T(t),P(3)}catch(e){M(e.message)}finally{A(!1)}},I=w?.plan,L=I?.feasibility.findings.some(e=>e.level===`limit`),R=I?.feasibility.verdict===`blocked`;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,U.jsx)(Ze,{at:r,reached:a,onGo:e=>!k&&(e<3||w)&&i(e)}),(0,U.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-6 @5xl:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,U.jsxs)(`section`,{"aria-labelledby":`tsc-step`,className:`flex min-w-0 flex-col gap-5`,children:[(0,U.jsx)(`h2`,{id:`tsc-step`,className:`m-0 text-[22px] font-semibold tracking-[-0.01em]`,children:[`Which Tosca export?`,`What should the tests become?`,`Anything the agent should know?`,`Review and start`][r]}),j&&(0,U.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:j}),r===0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(tt,{view:e,file:s,setFile:c,found:l,setFound:u,only:d,setOnly:f}),(0,U.jsx)(Z,{busy:k,next:`Continue`,onNext:()=>P(1),disabled:!l||!d.size,aside:l&&!d.size?(0,U.jsx)(`span`,{className:`text-muted`,children:`Pick at least one web test case.`}):void 0})]}),r===1&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(nt,{view:e,to:p,setTo:m,into:h,setInto:_,attr:y,setAttr:b}),(0,U.jsx)(Z,{busy:k,onBack:()=>i(0),next:`Continue`,onNext:()=>P(2),disabled:!p})]}),r===2&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(X,{id:`tsc-instructions`,label:`Instructions (optional)`,help:`Style and structure for the new code. Every Tosca step and check is kept either way.`,children:(0,U.jsx)(D,{id:`tsc-instructions`,value:x,rows:6,maxLength:4e3,placeholder:`Page objects go in pages/, one class per Tosca module.`,onChange:e=>C(e.target.value)})}),(0,U.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Ye.map(e=>(0,U.jsxs)(`button`,{type:`button`,disabled:x.includes(e),onClick:()=>C(x.trim()?`${x.trim()}\n${e}`:e),className:`inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-[8px] border-0 bg-surface-strong px-2.5 text-[13px] text-ink hover:bg-line disabled:cursor-default disabled:opacity-50`,children:[(0,U.jsx)(ee,{size:13,"aria-hidden":`true`}),e]},e))}),(0,U.jsx)(Z,{busy:k,onBack:()=>i(1),next:k?`Checking…`:`Check the plan`,onNext:()=>void F(),aside:(0,U.jsx)(`span`,{className:`text-muted`,children:`Nothing is changed yet.`})})]}),r===3&&I&&(0,U.jsxs)(U.Fragment,{children:[t(I,E,O),(0,U.jsx)(Z,{busy:k,onBack:()=>i(2),next:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(v,{icon:S,size:15}),`Start conversion`]}),disabled:R||L&&!E,onNext:()=>n(w,!!L&&E),aside:(0,U.jsx)(`span`,{className:`text-muted`,children:R?`Change what is not possible first.`:L&&!E?`Accept the limits to start.`:`Runs in the background.`})})]})]}),(0,U.jsx)(`div`,{className:`@5xl:sticky @5xl:top-6`,children:(0,U.jsx)(rt,{view:e,file:s,found:l,only:d,to:p,instructions:x})})]})]})}function Q({children:e,wide:t}){return(0,U.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,U.jsx)(M,{}),(0,U.jsx)(`main`,{className:x(P,`@container flex-auto gap-5`,t?`max-w-[1480px]`:`max-w-[1180px]`),children:e})]})}function $({action:e}){return(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(w,{pixel:te.tosca,size:`lg`}),(0,U.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Tosca`})]}),(0,U.jsx)(oe,{label:`Migration`,links:se,current:`tosca`}),(0,U.jsx)(`span`,{className:`flex-1`}),e]})}function at({error:e}){return e?(0,U.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e}):null}function ot({title:e,children:n}){let[r,i]=(0,H.useState)(!1),a=(0,H.useId)();return(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":a,onClick:()=>i(!r),className:`inline-flex min-h-8 cursor-pointer items-center gap-1.5 self-start rounded-[8px] border-0 bg-transparent px-1 text-sm font-medium text-ink hover:bg-surface-strong`,children:[(0,U.jsx)(R,{size:15,"aria-hidden":`true`,className:x(`transition-transform`,r&&`rotate-180`)}),e]}),(0,U.jsx)(t,{open:r,id:a,children:n})]})}function st({plan:t,accepted:n,onAccept:r}){let i=t.feasibility.findings.filter(e=>e.level===`blocker`),a=t.feasibility.findings.filter(e=>e.level===`limit`),o=t.cases.filter(e=>e.included),s=t.units.filter(e=>e.kind===`page`).length;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,U.jsxs)(`dl`,{className:`m-0 grid gap-x-6 gap-y-2.5 rounded-[14px] card border px-5 py-4 text-sm @xl:grid-cols-[auto_1fr]`,children:[(0,U.jsx)(`dt`,{className:`text-muted`,children:`From`}),(0,U.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[`Tricentis Tosca`,(0,U.jsxs)(`span`,{className:`text-muted`,children:[` `,`· `,(0,U.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:t.source.file}),t.source.project?` · ${t.source.project}`:``]})]}),(0,U.jsx)(`dt`,{className:`text-muted`,children:`To`}),(0,U.jsxs)(`dd`,{className:`m-0`,children:[t.target.title,(0,U.jsxs)(`span`,{className:`text-muted`,children:[` · `,t.target.dir]})]}),(0,U.jsx)(`dt`,{className:`text-muted`,children:`Files`}),(0,U.jsxs)(`dd`,{className:`m-0`,children:[o.length,` test`,o.length===1?``:`s`,` of `,t.cases.length,` test case`,t.cases.length===1?``:`s`,`, `,s,` page object`,s===1?``:`s`]}),(t.suites||[]).length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{className:`text-muted`,children:`Suites`}),(0,U.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[t.suites.map(e=>`${e.name} (${W(e.cases.length,`test`)})`).join(`, `),(0,U.jsxs)(`span`,{className:`block text-[12.5px] text-muted`,children:[`Tosca's execution lists, as tags on the tests: `,t.suites.map(e=>`@${e.tag}`).join(`, `),`.`]})]})]}),t.env.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{className:`text-muted`,children:`Environment variables`}),(0,U.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[t.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),(0,U.jsx)(`span`,{className:`block text-[12.5px] text-muted`,children:`Never in the export: you set them before the tests run.`})]})]}),t.instructions&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{className:`text-muted`,children:`Instructions`}),(0,U.jsx)(`dd`,{className:`m-0 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:t.instructions})]})]}),i.length>0&&(0,U.jsxs)(`section`,{"aria-labelledby":`tsc-blockers`,className:`flex flex-col gap-2 rounded-[14px] bg-fail-soft px-5 py-4`,children:[(0,U.jsxs)(`h3`,{id:`tsc-blockers`,className:`m-0 flex items-center gap-2 text-sm font-semibold text-fail`,children:[(0,U.jsx)(e,{size:16,"aria-hidden":`true`}),`Not possible`]}),(0,U.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-5 text-sm text-ink`,children:i.map(e=>(0,U.jsx)(`li`,{children:e.text},e.code))})]}),a.length>0&&(0,U.jsxs)(`section`,{"aria-labelledby":`tsc-limits`,className:`flex flex-col gap-3 rounded-[14px] bg-warn-soft px-5 py-4`,children:[(0,U.jsxs)(`h3`,{id:`tsc-limits`,className:`m-0 flex items-center gap-2 text-sm font-semibold text-warn`,children:[(0,U.jsx)(e,{size:16,"aria-hidden":`true`}),`Before you start`]}),(0,U.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1.5 pl-5 text-sm text-ink`,children:a.map(e=>(0,U.jsx)(`li`,{children:e.text},e.code))}),r&&!i.length&&(0,U.jsxs)(`label`,{className:`flex min-h-9 cursor-pointer items-center gap-2 text-sm font-medium`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:!!n,onChange:e=>r(e.target.checked)}),`I understand`]})]}),(0,U.jsx)(ot,{title:`Test cases (${t.cases.length})`,children:(0,U.jsx)(`ol`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:t.cases.map(e=>(0,U.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-3 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,U.jsx)(`span`,{className:x(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.included?`text-ink`:`text-muted`),children:e.name}),(0,U.jsx)(`span`,{className:`text-muted`,children:e.included?`${W(e.steps,`step`)} · ${W(e.asserts,`check`)}`:e.why}),(0,U.jsx)(`span`,{className:`w-16 flex-none text-right text-muted`,children:K[e.route]||e.route})]},e.id))})}),(0,U.jsx)(ot,{title:`Files, in order (${t.units.length})`,children:(0,U.jsx)(`ol`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:t.units.map(e=>(0,U.jsxs)(`li`,{className:`flex flex-wrap gap-x-3 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,U.jsx)(`span`,{className:`w-16 flex-none text-muted`,children:ge[e.kind]}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:e.target})]},e.id))})})]})}function ct({plan:e,acceptLimits:t,onClose:n,onStarted:r}){let[a,o]=(0,H.useState)(``),[s,c]=(0,H.useState)(!1),[l,u]=(0,H.useState)(``),d=async()=>{c(!0),u(``);try{r((await g.start(e.id,a,t)).detail)}catch(e){u(e.message),c(!1)}};return(0,U.jsx)(i,{open:!0,onClose:n,title:`Start the conversion`,description:`The Tosca test cases are written as ${e.target.title} tests in ${e.target.dir}, and ForgeQE runs each one. It runs in the background; the Tosca export is not changed.`,footer:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(T,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,U.jsx)(T,{variant:`primary`,disabled:s||a!==e.id,onClick:()=>void d(),children:`Start conversion`})]}),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,U.jsxs)(`span`,{children:[`Type `,(0,U.jsx)(`span`,{className:`font-mono`,children:e.id}),` to confirm`]}),(0,U.jsx)(b,{value:a,onChange:e=>o(e.target.value),autoComplete:`off`,spellCheck:!1})]}),(0,U.jsx)(at,{error:l})]})})}function lt({d:e,onStarted:t}){let[n,r]=(0,H.useState)(!1),[i,a]=(0,H.useState)(!1),o=e.plan.feasibility.findings.some(e=>e.level===`limit`),s=e.plan.feasibility.verdict===`blocked`,c=!!e.job?.running;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[e.job?.last&&!c&&(0,U.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:`The last start did not run. Its job's log on the Jobs page says why.`}),(0,U.jsx)(st,{plan:e.plan,accepted:e.confirmed||n,onAccept:e.confirmed?void 0:r}),!s&&!c&&(0,U.jsx)(`div`,{children:(0,U.jsxs)(T,{variant:`primary`,disabled:!e.confirmed&&o&&!n,onClick:()=>a(!0),children:[(0,U.jsx)(S,{"aria-hidden":`true`}),`Start conversion`]})}),i&&(0,U.jsx)(ct,{plan:e.plan,acceptLimits:o&&(e.confirmed||n),onClose:()=>a(!1),onStarted:e=>{a(!1),t(e)}})]})}function ut(e){return e.result?.status===`running`?`running`:e.result?.status===`converted`?`done`:e.result?`review`:`planned`}function dt(e){return e.result?he[e.result.status]:e.confirmed?{label:`Confirmed`,tone:`neutral`}:me[e.verdict]}var ft=e=>e.slice(e.lastIndexOf(`/`)+1);function pt({view:e}){let[t,n]=(0,H.useState)(`all`),r=t=>t===`all`?e.plans.length:e.plans.filter(e=>ut(e)===t).length,i=e.plans.filter(e=>t===`all`||ut(e)===t),o=e=>location.hash=a(`tosca`,e);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(ue,{children:[(0,U.jsx)(V,{label:`All`,value:r(`all`),onClick:()=>n(`all`),on:t===`all`}),(0,U.jsx)(V,{label:`Running`,value:r(`running`),onClick:()=>n(`running`),on:t===`running`}),(0,U.jsx)(V,{label:`Converted`,value:r(`done`),tone:r(`done`)?`text-pass`:void 0,onClick:()=>n(`done`),on:t===`done`}),(0,U.jsx)(V,{label:`Needs review`,value:r(`review`),tone:r(`review`)?`text-warn`:void 0,onClick:()=>n(`review`),on:t===`review`})]}),(0,U.jsx)(F,{label:`Conversions`,placeholder:`Find a conversion`,empty:t===`all`?`No conversions.`:`None here.`,resetKey:t,head:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 font-medium`,children:`Conversion`}),(0,U.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Tests`}),(0,U.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Status`}),(0,U.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Updated`})]}),children:i.map(e=>{let t=dt(e),n=e.result?e.result.status===`converted`||e.result.endedAt?100:Math.min(99,Math.round(e.result.done/Math.max(1,e.units||e.tests+1)*95)):0;return(0,U.jsxs)(`tr`,{onClick:()=>o(e.id),className:N,children:[(0,U.jsx)(`td`,{className:O,children:(0,U.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`span`,{className:`hidden flex-none items-center gap-1 @xl:inline-flex`,"aria-hidden":`true`,children:(0,U.jsx)(z,{framework:e.targetId.split(`-`)[0],language:e.targetId.split(`-`).slice(1).join(`-`),size:18})}),(0,U.jsxs)(`span`,{className:`min-w-0`,children:[(0,U.jsxs)(`a`,{href:a(`tosca`,e.id),onClick:e=>e.stopPropagation(),className:`font-medium text-ink no-underline hover:underline`,children:[ft(e.file),` to `,e.target]}),(0,U.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[e.project?`${e.project} · `:``,e.into]})]})]})}),(0,U.jsx)(`td`,{className:x(O,`w-[180px] text-[13px]`),children:e.result?.status===`running`?(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(pe,{value:n,label:`${ft(e.file)} to ${e.target}: progress`}),(0,U.jsxs)(`span`,{className:`w-9 flex-none text-right text-[12px] text-muted tabular-nums`,children:[n,`%`]})]}):e.result?(0,U.jsxs)(`span`,{className:e.result.converted===e.tests?`text-pass`:`text-ink-2`,children:[e.result.converted,` of `,e.tests,` pass`]}):(0,U.jsx)(`span`,{className:`text-muted`,children:`Not started`})}),(0,U.jsx)(`td`,{className:x(O,`whitespace-nowrap`),children:(0,U.jsx)(d,{tone:t.tone,children:t.label})}),(0,U.jsx)(`td`,{className:x(O,`hidden text-[12.5px] whitespace-nowrap text-muted @xl:table-cell`),children:ie(e.result?.endedAt||e.result?.at||e.createdAt)})]},e.id)})})]})}function mt({sub:e}){let[t,n]=(0,H.useState)(null),[i,o]=(0,H.useState)(``),[s,c]=(0,H.useState)(null),l=(0,H.useCallback)(()=>{g.list().then(e=>{n(e),o(``)},e=>o(e.message))},[]);(0,H.useEffect)(l,[l,e]);let u=t?.plans.some(e=>e.result?.status===`running`);(0,H.useEffect)(()=>{if(!u||e)return;let t=setInterval(l,3e3);return()=>clearInterval(t)},[u,e,l]);let d=e?.match(/^(tsc-\d{8}-\d{6}-[0-9a-f]{4})\/report$/),f=e&&/^tsc-\d{8}-\d{6}-[0-9a-f]{4}$/.test(e)?e:d?.[1]||``,p=!!d,m=()=>location.hash=a(`tosca`,`new`),h=!t&&!i&&(0,U.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});return e===`new`?(0,U.jsxs)(Q,{children:[(0,U.jsx)($,{}),(0,U.jsx)(at,{error:i}),h,t&&(0,U.jsx)(it,{view:t,review:(e,t,n)=>(0,U.jsx)(st,{plan:e,accepted:t,onAccept:n}),onStart:(e,t)=>c({d:e,accept:t})}),s&&(0,U.jsx)(ct,{plan:s.d.plan,acceptLimits:s.accept,onClose:()=>c(null),onStarted:e=>{c(null),location.hash=a(`tosca`,e.plan.id)}})]}):f&&p?(0,U.jsxs)(Q,{wide:!0,children:[(0,U.jsx)($,{}),(0,U.jsx)(Ke,{id:f},f)]}):f?(0,U.jsxs)(Q,{wide:!0,children:[(0,U.jsx)($,{}),(0,U.jsx)(at,{error:i}),h,t&&(0,U.jsx)(Le,{id:f,plan:(e,t)=>(0,U.jsx)(lt,{d:e,onStarted:t})},f)]}):(0,U.jsxs)(Q,{children:[(0,U.jsx)($,{action:t&&!t.plans.length?void 0:(0,U.jsx)(T,{variant:`primary`,disabled:!t,onClick:m,children:`New conversion`})}),(0,U.jsx)(at,{error:i}),h,t&&(t.plans.length?(0,U.jsx)(pt,{view:t}):(0,U.jsx)(L,{icon:r,title:`No Tosca conversions yet`,action:(0,U.jsx)(T,{size:`sm`,onClick:m,children:`New conversion`}),children:`Pick a Tosca export (.tsu) in this project and the framework its test cases become. Every Tosca step and check is kept, and nothing starts until you confirm.`}))]})}export{mt as Tosca};