@piwitests/server 0.23.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{Clg2Qx0r.js → -COcylA_.js} +1 -1
  3. package/.output/public/_nuxt/03FA4-rI.js +1 -0
  4. package/.output/public/_nuxt/{B7tiBVLW.js → 5a7jHE9s.js} +1 -1
  5. package/.output/public/_nuxt/{roaTZkYi.js → 6Z_ZwH8I.js} +1 -1
  6. package/.output/public/_nuxt/{xZQGtnVA.js → 7ZHq6PCI.js} +1 -1
  7. package/.output/public/_nuxt/{5SkLJHl8.js → 98sAB6Gu.js} +1 -1
  8. package/.output/public/_nuxt/{DnxrNGE_.js → B--J7VNt.js} +1 -1
  9. package/.output/public/_nuxt/{DJzFYrBt.js → B1LUinhp.js} +1 -1
  10. package/.output/public/_nuxt/{axj2iIDK.js → B33YjaHr.js} +1 -1
  11. package/.output/public/_nuxt/B69RP95P.js +1 -0
  12. package/.output/public/_nuxt/{DNKZmhbX.js → B8H4XydJ.js} +1 -1
  13. package/.output/public/_nuxt/{DmqCquDx.js → B8Xm4_S_.js} +1 -1
  14. package/.output/public/_nuxt/{Ya8ZzWuY.js → BBhrClA9.js} +1 -1
  15. package/.output/public/_nuxt/{BZFiz2UB.js → BCGljaM0.js} +1 -1
  16. package/.output/public/_nuxt/{oSLbl-p0.js → BFxvHlO9.js} +1 -1
  17. package/.output/public/_nuxt/{PDSNX4Te.js → BKrWWV14.js} +1 -1
  18. package/.output/public/_nuxt/BN1zZw5b.js +9 -0
  19. package/.output/public/_nuxt/{Dbf8eT28.js → BPXqL9vK.js} +1 -1
  20. package/.output/public/_nuxt/{DgEa6_av.js → BUnwEAjq.js} +1 -1
  21. package/.output/public/_nuxt/{CUOS6S13.js → BVLqydCr.js} +1 -1
  22. package/.output/public/_nuxt/{CvVbKrcH.js → BWMSVSNM.js} +1 -1
  23. package/.output/public/_nuxt/{Wk7ZKG4B.js → B_r0xHVS.js} +1 -1
  24. package/.output/public/_nuxt/{DAhv9aNg.js → BakMHV79.js} +1 -1
  25. package/.output/public/_nuxt/{BDUfBn3i.js → Bd8B-yeR.js} +1 -1
  26. package/.output/public/_nuxt/{sqqg4oXL.js → BevElZaK.js} +1 -1
  27. package/.output/public/_nuxt/{B0tmRAhY.js → BfA6lfg4.js} +1 -1
  28. package/.output/public/_nuxt/{D3SJGdl4.js → Bg93Rnts.js} +1 -1
  29. package/.output/public/_nuxt/{Ck_fTH5z.js → BgABj4Ty.js} +1 -1
  30. package/.output/public/_nuxt/{B2L0-Lzp.js → BkM2KXUo.js} +1 -1
  31. package/.output/public/_nuxt/{CBJFORiZ.js → BkxRbXIj.js} +1 -1
  32. package/.output/public/_nuxt/{Bsc11YIJ.js → Bme1UkOl.js} +1 -1
  33. package/.output/public/_nuxt/{BfcMJBTf.js → BmzxRbcg.js} +1 -1
  34. package/.output/public/_nuxt/{D7fxV-UA.js → Bn0jaRxI.js} +1 -1
  35. package/.output/public/_nuxt/{C77tM5Hz.js → BoNKdx5o.js} +1 -1
  36. package/.output/public/_nuxt/{Bb2mDqKr.js → Bp3FRuEm.js} +1 -1
  37. package/.output/public/_nuxt/{BjOFxi54.js → BrUBOQ0y.js} +1 -1
  38. package/.output/public/_nuxt/{DXkFgrsT.js → BtSGUY-7.js} +1 -1
  39. package/.output/public/_nuxt/{QZYo3ErV.js → BtbpLWDs.js} +1 -1
  40. package/.output/public/_nuxt/{Bag08cIY.js → BvAfKk6C.js} +1 -1
  41. package/.output/public/_nuxt/{BOvtXn3m.js → BwEN1fJ1.js} +1 -1
  42. package/.output/public/_nuxt/{DYjxDsYC.js → C-XjxjG5.js} +1 -1
  43. package/.output/public/_nuxt/{RkNtgoTD.js → C3W_wyr9.js} +1 -1
  44. package/.output/public/_nuxt/{CNu3kken.js → C5TrTuWv.js} +3 -3
  45. package/.output/public/_nuxt/{B4mZElvM.js → C7D5Wl7T.js} +1 -1
  46. package/.output/public/_nuxt/{ZLfZolDM.js → C7fq_rHE.js} +1 -1
  47. package/.output/public/_nuxt/{B_JSV0yG.js → C8Paf_V1.js} +1 -1
  48. package/.output/public/_nuxt/{C2_7XZo0.js → CD8ZzAFC.js} +1 -1
  49. package/.output/public/_nuxt/{CTTmX4gy.js → CDTeSrLO.js} +1 -1
  50. package/.output/public/_nuxt/{CLWMETf9.js → CGHV0Y2d.js} +1 -1
  51. package/.output/public/_nuxt/{AQ86C4c2.js → CIpF9l75.js} +1 -1
  52. package/.output/public/_nuxt/{jR2xm3_t.js → CJ1rmnk4.js} +1 -1
  53. package/.output/public/_nuxt/{7_9fts7T.js → CMuzkARi.js} +1 -1
  54. package/.output/public/_nuxt/{a8Z6VC7V.js → COuZu9FO.js} +1 -1
  55. package/.output/public/_nuxt/{D7t0Dn3h.js → CX5Q0dZ8.js} +1 -1
  56. package/.output/public/_nuxt/{9_aJhhcm.js → CX_G-FHC.js} +14 -14
  57. package/.output/public/_nuxt/{C9I1Dp3S.js → Ce5_Tq63.js} +1 -1
  58. package/.output/public/_nuxt/{BtZNYmZO.js → Cf4MFOuf.js} +1 -1
  59. package/.output/public/_nuxt/{mi22nGUC.js → CgkXEZMo.js} +1 -1
  60. package/.output/public/_nuxt/{Ce89VyHE.js → CjBktNrC.js} +1 -1
  61. package/.output/public/_nuxt/{Bj_v57Zu.js → CjtjQV60.js} +1 -1
  62. package/.output/public/_nuxt/{BuGAn4f7.js → CpcrljrH.js} +1 -1
  63. package/.output/public/_nuxt/{6vX5JdHr.js → Cq33x7yV.js} +1 -1
  64. package/.output/public/_nuxt/{jxc14CqP.js → CsV7pmcT.js} +1 -1
  65. package/.output/public/_nuxt/{DTrPCv7R.js → Cu2Q4iPh.js} +1 -1
  66. package/.output/public/_nuxt/{DylyATWU.js → CyLcEDg2.js} +1 -1
  67. package/.output/public/_nuxt/{Ce_j5NtN.js → D0Kop4bS.js} +1 -1
  68. package/.output/public/_nuxt/{DCE2_MKD.js → D1Y43xM1.js} +1 -1
  69. package/.output/public/_nuxt/{499RbBSX.js → D1vqYZsL.js} +1 -1
  70. package/.output/public/_nuxt/{BjMo2tKC.js → D2rZosKf.js} +1 -1
  71. package/.output/public/_nuxt/D7jpwkRG.js +5 -0
  72. package/.output/public/_nuxt/{BFYkWpPx.js → D8NAb7VE.js} +1 -1
  73. package/.output/public/_nuxt/{CIQeRUSy.js → D8vguZKg.js} +1 -1
  74. package/.output/public/_nuxt/{Bq4_kqIp.js → DEvYVl9M.js} +1 -1
  75. package/.output/public/_nuxt/{DBWM_xs-.js → DF6Mes5z.js} +1 -1
  76. package/.output/public/_nuxt/{CGDPUNcO.js → DGq4A2Pd.js} +1 -1
  77. package/.output/public/_nuxt/{CF_eDZHu.js → DH5H1DJh.js} +1 -1
  78. package/.output/public/_nuxt/{kWnH8yJq.js → DL8knjzi.js} +1 -1
  79. package/.output/public/_nuxt/{CC8wk-N0.js → DM3bDZC6.js} +1 -1
  80. package/.output/public/_nuxt/{Ce47NgZw.js → DMAiMrNr.js} +1 -1
  81. package/.output/public/_nuxt/{HbnAkiyK.js → DMWfVJCj.js} +1 -1
  82. package/.output/public/_nuxt/{B3AG2m76.js → DMsm-RGQ.js} +1 -1
  83. package/.output/public/_nuxt/{DeewM3Wg.js → DMtrFQqi.js} +1 -1
  84. package/.output/public/_nuxt/{D1Ucra3E.js → DPZBpFOX.js} +1 -1
  85. package/.output/public/_nuxt/{DiWxW-w3.js → DVEGfqtt.js} +1 -1
  86. package/.output/public/_nuxt/{DZ-KbUZi.js → D_y2VS8k.js} +1 -1
  87. package/.output/public/_nuxt/DaNC-xl1.js +1 -0
  88. package/.output/public/_nuxt/{DZECGgZm.js → DbmGeOus.js} +1 -1
  89. package/.output/public/_nuxt/{HIGGZ_c-.js → DcLbz6DV.js} +1 -1
  90. package/.output/public/_nuxt/{B_MVJP17.js → DcR0Mmdl.js} +1 -1
  91. package/.output/public/_nuxt/{DNqm5cWU.js → DhYznn-U.js} +1 -1
  92. package/.output/public/_nuxt/DhuRRlmK.js +1 -0
  93. package/.output/public/_nuxt/{pZbe82l5.js → Drw8yQg6.js} +1 -1
  94. package/.output/public/_nuxt/{CPQRQqXU.js → DuO5wfAC.js} +1 -1
  95. package/.output/public/_nuxt/{FJTsZ5Aa.js → DuOH5jcQ.js} +1 -1
  96. package/.output/public/_nuxt/{BM5BPKlc.js → DvEsAuE9.js} +1 -1
  97. package/.output/public/_nuxt/{dUPMBJ4f.js → Dz6g_QJT.js} +1 -1
  98. package/.output/public/_nuxt/{BAbrtVp3.js → DzZpIs4W.js} +1 -1
  99. package/.output/public/_nuxt/DzzNS-K1.js +1 -0
  100. package/.output/public/_nuxt/{BwwfasRt.js → Fsw2W4TA.js} +1 -1
  101. package/.output/public/_nuxt/{CdEzDaDI.js → LwoTUb-r.js} +1 -1
  102. package/.output/public/_nuxt/{DuBtaw3j.js → OfPjZaky.js} +1 -1
  103. package/.output/public/_nuxt/{LTMoFvEY.js → P5uOaRUZ.js} +1 -1
  104. package/.output/public/_nuxt/{B3G-TIoP.js → Qo6oszaF.js} +1 -1
  105. package/.output/public/_nuxt/{DprkT7rM.js → T5UuMUxA.js} +1 -1
  106. package/.output/public/_nuxt/UY8pjaZA.js +1 -0
  107. package/.output/public/_nuxt/{CmTzxoQt.js → V9p3z39z.js} +1 -1
  108. package/.output/public/_nuxt/{5QBnDbs_.js → VACXezo0.js} +1 -1
  109. package/.output/public/_nuxt/{6sA-GK37.js → YmCeJkZ2.js} +1 -1
  110. package/.output/public/_nuxt/builds/latest.json +1 -1
  111. package/.output/public/_nuxt/builds/meta/70224ee0-4d1f-45d2-b380-2ecb18064bf1.json +1 -0
  112. package/.output/public/_nuxt/entry.DzPSf_u5.css +1 -0
  113. package/.output/public/_nuxt/fXUwH_3d.js +1 -0
  114. package/.output/public/_nuxt/{CAoQUDI4.js → opwuUqHG.js} +1 -1
  115. package/.output/public/_nuxt/{2yLW7WU0.js → opyDpgSw.js} +1 -1
  116. package/.output/public/_nuxt/{B070fjS-.js → sVV8xB9f.js} +1 -1
  117. package/.output/public/_nuxt/{C6t4kxaa.js → xa5UHCot.js} +1 -1
  118. package/.output/server/chunks/_/collect.mjs +1 -1
  119. package/.output/server/chunks/_/markers.mjs +1 -1
  120. package/.output/server/chunks/_/quarantine.mjs +1 -1
  121. package/.output/server/chunks/_/users.mjs +1 -1
  122. package/.output/server/chunks/build/Checkbox-BisdHf8n.mjs +1 -1
  123. package/.output/server/chunks/build/CodeBlock-B8BNtZAe.mjs +1 -1
  124. package/.output/server/chunks/build/DashboardSidebarToggle-C3HdHvlE.mjs +1 -1
  125. package/.output/server/chunks/build/DiagnosisPanel-BVb2LgHu.mjs +1 -1
  126. package/.output/server/chunks/build/DiagnosisResult-xVgZlfKK.mjs +1 -1
  127. package/.output/server/chunks/build/EntityLinks-Dzn73fbq.mjs +1 -1
  128. package/.output/server/chunks/build/HelpHint-plioHKA0.mjs +27 -0
  129. package/.output/server/chunks/build/NavigationMenu-RfBOyS32.mjs +1 -1
  130. package/.output/server/chunks/build/OpenInIdeLink-Jp6SzEtD.mjs +1 -1
  131. package/.output/server/chunks/build/RunReports-nuLb-Nm3.mjs +1 -1
  132. package/.output/server/chunks/build/Select-CEyw7HGK.mjs +1 -1
  133. package/.output/server/chunks/build/SelectMenu-C02Hs2_F.mjs +1 -1
  134. package/.output/server/chunks/build/Table-qZdnm9t2.mjs +1 -1
  135. package/.output/server/chunks/build/Tooltip-BI3WQErw.mjs +1 -1
  136. package/.output/server/chunks/build/{_id_-D7UtAIPR.mjs → _id_-26komi8G.mjs} +15 -8
  137. package/.output/server/chunks/build/{_id_-D7UtAIPR.mjs.map → _id_-26komi8G.mjs.map} +1 -1
  138. package/.output/server/chunks/build/{_id_-CrGTZymJ.mjs → _id_-w7YCSiiy.mjs} +2 -2
  139. package/.output/server/chunks/build/{_id_-CrGTZymJ.mjs.map → _id_-w7YCSiiy.mjs.map} +1 -1
  140. package/.output/server/chunks/build/_id_-wiULjAVc.mjs +1 -1
  141. package/.output/server/chunks/build/ai-DYhpzbqp.mjs +1 -1
  142. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  143. package/.output/server/chunks/build/{db.client-Bdqk_eYQ.mjs → db.client-DijpEH6i.mjs} +3 -1
  144. package/.output/server/chunks/build/db.client-DijpEH6i.mjs.map +1 -0
  145. package/.output/server/chunks/build/{default-DO1izI2V.mjs → default-CQa_bmAf.mjs} +2 -2
  146. package/.output/server/chunks/build/{default-DO1izI2V.mjs.map → default-CQa_bmAf.mjs.map} +1 -1
  147. package/.output/server/chunks/build/fetch-tkz5_OA-.mjs +1 -1
  148. package/.output/server/chunks/build/import-B27Sv7h5.mjs +1 -1
  149. package/.output/server/chunks/build/{index-vRwzDXLs.mjs → index-Dq6nk6OB.mjs} +367 -87
  150. package/.output/server/chunks/build/index-Dq6nk6OB.mjs.map +1 -0
  151. package/.output/server/chunks/build/isValueEqualOrExist-D4lZ8uRY.mjs +1 -1
  152. package/.output/server/chunks/build/login-hxCF06JT.mjs +1 -1
  153. package/.output/server/chunks/build/mcp-BVW1llyW.mjs +1 -1
  154. package/.output/server/chunks/build/server.mjs +6 -6
  155. package/.output/server/chunks/build/settings-metadata-DnAK4Rzg.mjs +1 -1
  156. package/.output/server/chunks/build/storage-zN92cA9q.mjs +1 -1
  157. package/.output/server/chunks/build/test-functions-DVRJgiWo.mjs +1 -1
  158. package/.output/server/chunks/build/{useCopyRich-CZxJ7IY_.mjs → useCopyRich-BM9GTjJi.mjs} +64 -18
  159. package/.output/server/chunks/build/{useCopyRich-CZxJ7IY_.mjs.map → useCopyRich-BM9GTjJi.mjs.map} +1 -1
  160. package/.output/server/chunks/nitro/nitro.mjs +1037 -733
  161. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  162. package/.output/server/chunks/routes/__piwi/session.get.mjs +1 -1
  163. package/.output/server/chunks/routes/api/ai/step-resolution.post.mjs +88 -0
  164. package/.output/server/chunks/routes/api/ai/step-resolution.post.mjs.map +1 -0
  165. package/.output/server/chunks/routes/api/analytics/_widget_.get.mjs +1 -1
  166. package/.output/server/chunks/routes/api/auth/change-password.post.mjs +1 -1
  167. package/.output/server/chunks/routes/api/auth/forgot-password.post.mjs +1 -1
  168. package/.output/server/chunks/routes/api/auth/login.post.mjs +1 -1
  169. package/.output/server/chunks/routes/api/auth/logout.post.mjs +1 -1
  170. package/.output/server/chunks/routes/api/auth/me.get.mjs +1 -1
  171. package/.output/server/chunks/routes/api/auth/oauth/_provider/callback.get.mjs +1 -1
  172. package/.output/server/chunks/routes/api/auth/oauth/_provider/login.get.mjs +1 -1
  173. package/.output/server/chunks/routes/api/auth/oauth/_provider/unlink.post.mjs +1 -1
  174. package/.output/server/chunks/routes/api/auth/reset-password.post.mjs +1 -1
  175. package/.output/server/chunks/routes/api/auth/send-verify-email.post.mjs +1 -1
  176. package/.output/server/chunks/routes/api/auth/setup.get.mjs +1 -1
  177. package/.output/server/chunks/routes/api/auth/setup.post.mjs +1 -1
  178. package/.output/server/chunks/routes/api/auth/verify-email.get.mjs +1 -1
  179. package/.output/server/chunks/routes/api/channels/_id/test.post.mjs +1 -1
  180. package/.output/server/chunks/routes/api/channels/_id_.delete.mjs +1 -1
  181. package/.output/server/chunks/routes/api/cluster-merge-suggestions/_id/approve.post.mjs +1 -1
  182. package/.output/server/chunks/routes/api/cluster-merge-suggestions/_id/reject.post.mjs +1 -1
  183. package/.output/server/chunks/routes/api/desktop/import-local.post.mjs +1 -1
  184. package/.output/server/chunks/routes/api/failure-clusters/_id/base-commit.patch.mjs +1 -1
  185. package/.output/server/chunks/routes/api/failure-clusters/_id/branches.get.mjs +1 -1
  186. package/.output/server/chunks/routes/api/failure-clusters/_id/commit-diff.get.mjs +1 -1
  187. package/.output/server/chunks/routes/api/failure-clusters/_id/commits.get.mjs +1 -1
  188. package/.output/server/chunks/routes/api/failure-clusters/_id/context.get.mjs +1 -1
  189. package/.output/server/chunks/routes/api/failure-clusters/_id/diagnose/stream.post.mjs +1 -1
  190. package/.output/server/chunks/routes/api/failure-clusters/_id/diagnose.post.mjs +1 -1
  191. package/.output/server/chunks/routes/api/failure-clusters/_id/diagnoses.get.mjs +1 -1
  192. package/.output/server/chunks/routes/api/failure-clusters/_id/diagnosis.get.mjs +1 -1
  193. package/.output/server/chunks/routes/api/failure-clusters/_id/export.get.mjs +1 -1
  194. package/.output/server/chunks/routes/api/failure-clusters/_id/extract-cases.post.mjs +1 -1
  195. package/.output/server/chunks/routes/api/failure-clusters/_id/fix-plan.get.mjs +1 -1
  196. package/.output/server/chunks/routes/api/failure-clusters/_id/status.patch.mjs +1 -1
  197. package/.output/server/chunks/routes/api/failure-clusters/_id_.get.mjs +1 -1
  198. package/.output/server/chunks/routes/api/failure-diagnoses/_id/feedback.patch.mjs +1 -1
  199. package/.output/server/chunks/routes/api/files/_...path_.get.mjs +1 -1
  200. package/.output/server/chunks/routes/api/health.get.mjs +1 -1
  201. package/.output/server/chunks/routes/api/index.get.mjs +1 -1
  202. package/.output/server/chunks/routes/api/index.get2.mjs +1 -1
  203. package/.output/server/chunks/routes/api/index.get3.mjs +1 -1
  204. package/.output/server/chunks/routes/api/index.get4.mjs +1 -1
  205. package/.output/server/chunks/routes/api/index.get5.mjs +1 -1
  206. package/.output/server/chunks/routes/api/index.post.mjs +1 -1
  207. package/.output/server/chunks/routes/api/index.post2.mjs +1 -1
  208. package/.output/server/chunks/routes/api/index.post3.mjs +1 -1
  209. package/.output/server/chunks/routes/api/index.post4.mjs +1 -1
  210. package/.output/server/chunks/routes/api/index.post5.mjs +1 -1
  211. package/.output/server/chunks/routes/api/index.post6.mjs +1 -1
  212. package/.output/server/chunks/routes/api/links/_id/refresh.post.mjs +1 -1
  213. package/.output/server/chunks/routes/api/links/_id_.delete.mjs +1 -1
  214. package/.output/server/chunks/routes/api/links/_id_.patch.mjs +1 -1
  215. package/.output/server/chunks/routes/api/markers/_id_.delete.mjs +1 -1
  216. package/.output/server/chunks/routes/api/markers/_id_.put.mjs +1 -1
  217. package/.output/server/chunks/routes/api/notifications/stream.get.mjs +1 -1
  218. package/.output/server/chunks/routes/api/projects/_id/ai-steps.get.mjs +63 -0
  219. package/.output/server/chunks/routes/api/projects/_id/ai-steps.get.mjs.map +1 -0
  220. package/.output/server/chunks/routes/api/projects/_id/cluster-merge-suggestions.get.mjs +1 -1
  221. package/.output/server/chunks/routes/api/projects/_id/failure-clusters.get.mjs +1 -1
  222. package/.output/server/chunks/routes/api/projects/_id/flaky-classify.post.mjs +1 -1
  223. package/.output/server/chunks/routes/api/projects/_id/flaky-tests.get.mjs +1 -1
  224. package/.output/server/chunks/routes/api/projects/_id/latest-run.get.mjs +1 -1
  225. package/.output/server/chunks/routes/api/projects/_id/markers.get.mjs +1 -1
  226. package/.output/server/chunks/routes/api/projects/_id/markers.post.mjs +1 -1
  227. package/.output/server/chunks/routes/api/projects/_id/members.get.mjs +1 -1
  228. package/.output/server/chunks/routes/api/projects/_id/members.put.mjs +1 -1
  229. package/.output/server/chunks/routes/api/projects/_id/performance.get.mjs +1 -1
  230. package/.output/server/chunks/routes/api/projects/_id/quarantine/_testCaseId_.delete.mjs +1 -1
  231. package/.output/server/chunks/routes/api/projects/_id/quarantine.get.mjs +1 -1
  232. package/.output/server/chunks/routes/api/projects/_id/quarantine.post.mjs +1 -1
  233. package/.output/server/chunks/routes/api/projects/_id/slow-tests.get.mjs +1 -1
  234. package/.output/server/chunks/routes/api/projects/_id/spec-health.get.mjs +1 -1
  235. package/.output/server/chunks/routes/api/projects/_id/test-cases.get.mjs +1 -1
  236. package/.output/server/chunks/routes/api/projects/_id/test-functions/extract.post.mjs +1 -1
  237. package/.output/server/chunks/routes/api/projects/_id/test-functions/validate-proposal.post.mjs +1 -1
  238. package/.output/server/chunks/routes/api/projects/_id/test-functions.get.mjs +1 -1
  239. package/.output/server/chunks/routes/api/projects/_id/test-functions.post.mjs +1 -1
  240. package/.output/server/chunks/routes/api/projects/_id/timeout-opportunities.get.mjs +1 -1
  241. package/.output/server/chunks/routes/api/projects/_id_.delete.mjs +1 -1
  242. package/.output/server/chunks/routes/api/projects/_id_.get.mjs +1 -1
  243. package/.output/server/chunks/routes/api/projects/_id_.put.mjs +1 -1
  244. package/.output/server/chunks/routes/api/projects/menu.get.mjs +1 -1
  245. package/.output/server/chunks/routes/api/projects/overview.get.mjs +1 -1
  246. package/.output/server/chunks/routes/api/projects.get.mjs +1 -1
  247. package/.output/server/chunks/routes/api/search.get.mjs +1 -1
  248. package/.output/server/chunks/routes/api/settings/ai/limits.get.mjs +1 -1
  249. package/.output/server/chunks/routes/api/settings/ai/limits.put.mjs +1 -1
  250. package/.output/server/chunks/routes/api/settings/ai/test.post.mjs +1 -1
  251. package/.output/server/chunks/routes/api/settings/ai/usage.get.mjs +1 -1
  252. package/.output/server/chunks/routes/api/settings/ai.get.mjs +1 -1
  253. package/.output/server/chunks/routes/api/settings/ai.put.mjs +1 -1
  254. package/.output/server/chunks/routes/api/settings/pr-feedback.get.mjs +1 -1
  255. package/.output/server/chunks/routes/api/settings/pr-feedback.put.mjs +1 -1
  256. package/.output/server/chunks/routes/api/settings/smtp/test.post.mjs +1 -1
  257. package/.output/server/chunks/routes/api/settings/smtp.get.mjs +1 -1
  258. package/.output/server/chunks/routes/api/settings/timeout-hygiene.get.mjs +1 -1
  259. package/.output/server/chunks/routes/api/settings/timeout-hygiene.put.mjs +1 -1
  260. package/.output/server/chunks/routes/api/settings/wasted-waits.get.mjs +1 -1
  261. package/.output/server/chunks/routes/api/settings/wasted-waits.put.mjs +1 -1
  262. package/.output/server/chunks/routes/api/setup-status.get.mjs +1 -1
  263. package/.output/server/chunks/routes/api/stream.get.mjs +1 -1
  264. package/.output/server/chunks/routes/api/subscriptions/_id_.delete.mjs +1 -1
  265. package/.output/server/chunks/routes/api/subscriptions/_id_.patch.mjs +1 -1
  266. package/.output/server/chunks/routes/api/tags/_id_.delete.mjs +1 -1
  267. package/.output/server/chunks/routes/api/tags/_id_.put.mjs +1 -1
  268. package/.output/server/chunks/routes/api/test-cases/_id/history.get.mjs +1 -1
  269. package/.output/server/chunks/routes/api/test-cases/_id/stability-trend.get.mjs +1 -1
  270. package/.output/server/chunks/routes/api/test-cases/_id_.get.mjs +1 -1
  271. package/.output/server/chunks/routes/api/test-functions/_id_.delete.mjs +1 -1
  272. package/.output/server/chunks/routes/api/test-functions/_id_.put.mjs +1 -1
  273. package/.output/server/chunks/routes/api/test-run-cases/_id/diagnose.post.mjs +1 -1
  274. package/.output/server/chunks/routes/api/test-run-cases/_id/diagnosis-context.get.mjs +1 -1
  275. package/.output/server/chunks/routes/api/test-run-cases/_id/diagnosis.get.mjs +1 -1
  276. package/.output/server/chunks/routes/api/test-run-cases/_id/export.get.mjs +1 -1
  277. package/.output/server/chunks/routes/api/test-run-cases/_id/traces.get.mjs +1 -1
  278. package/.output/server/chunks/routes/api/test-run-cases/_id_.get.mjs +1 -1
  279. package/.output/server/chunks/routes/api/test-runs/_id/begin.post.mjs +1 -1
  280. package/.output/server/chunks/routes/api/test-runs/_id/case-files.post.mjs +1 -1
  281. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/dom-snapshot.get.mjs +1 -1
  282. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/environment-diff.get.mjs +1 -1
  283. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/locator-healing.get.mjs +1 -1
  284. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/locator-pick.post.mjs +1 -1
  285. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/trace-network-body.get.mjs +1 -1
  286. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/trace-network.get.mjs +1 -1
  287. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/trace-stacks.get.mjs +1 -1
  288. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/visual-diff.get.mjs +1 -1
  289. package/.output/server/chunks/routes/api/test-runs/_id/events.post.mjs +1 -1
  290. package/.output/server/chunks/routes/api/test-runs/_id/failure-groups.get.mjs +1 -1
  291. package/.output/server/chunks/routes/api/test-runs/_id/finish.post.mjs +1 -1
  292. package/.output/server/chunks/routes/api/test-runs/_id/gate.post.mjs +1 -1
  293. package/.output/server/chunks/routes/api/test-runs/_id/heartbeat.post.mjs +1 -1
  294. package/.output/server/chunks/routes/api/test-runs/_id/insights.get.mjs +1 -1
  295. package/.output/server/chunks/routes/api/test-runs/_id/network-requests.get.mjs +1 -1
  296. package/.output/server/chunks/routes/api/test-runs/_id/regression-context.get.mjs +1 -1
  297. package/.output/server/chunks/routes/api/test-runs/_id/stream.get.mjs +1 -1
  298. package/.output/server/chunks/routes/api/test-runs/_id/summary.get.mjs +1 -1
  299. package/.output/server/chunks/routes/api/test-runs/_id_.delete.mjs +1 -1
  300. package/.output/server/chunks/routes/api/test-runs/_id_.get.mjs +1 -1
  301. package/.output/server/chunks/routes/api/test-runs/_id_.patch.mjs +1 -1
  302. package/.output/server/chunks/routes/api/test-runs/import/check.post.mjs +1 -1
  303. package/.output/server/chunks/routes/api/test-runs/import.post.mjs +1 -1
  304. package/.output/server/chunks/routes/api/test-runs/recent.get.mjs +1 -1
  305. package/.output/server/chunks/routes/api/test-runs/setup.post.mjs +1 -1
  306. package/.output/server/chunks/routes/api/test-runs/start.post.mjs +1 -1
  307. package/.output/server/chunks/routes/api/test-runs/submit.post.mjs +3 -1
  308. package/.output/server/chunks/routes/api/test-runs/submit.post.mjs.map +1 -1
  309. package/.output/server/chunks/routes/api/test-runs/upload.post.mjs +2 -1
  310. package/.output/server/chunks/routes/api/test-runs/upload.post.mjs.map +1 -1
  311. package/.output/server/chunks/routes/api/tests/cleanup.delete.mjs +2 -1
  312. package/.output/server/chunks/routes/api/tests/cleanup.delete.mjs.map +1 -1
  313. package/.output/server/chunks/routes/api/traces/check.post.mjs +1 -1
  314. package/.output/server/chunks/routes/api/users/_id/api-keys/_keyId_.delete.mjs +1 -1
  315. package/.output/server/chunks/routes/api/users/_id/index.get.mjs +1 -1
  316. package/.output/server/chunks/routes/api/users/_id/index.post.mjs +1 -1
  317. package/.output/server/chunks/routes/api/users/_id/invite.post.mjs +1 -1
  318. package/.output/server/chunks/routes/api/users/_id/projects.get.mjs +1 -1
  319. package/.output/server/chunks/routes/api/users/_id/projects.put.mjs +1 -1
  320. package/.output/server/chunks/routes/api/users/_id_.delete.mjs +1 -1
  321. package/.output/server/chunks/routes/api/users/_id_.patch.mjs +1 -1
  322. package/.output/server/chunks/routes/api/version.get.mjs +1 -1
  323. package/.output/server/chunks/routes/mcp.post.mjs +1 -1
  324. package/.output/server/chunks/routes/renderer.mjs +1 -1
  325. package/.output/server/database/migrations/0045_productive_stingray.sql +1 -0
  326. package/.output/server/database/migrations/meta/0045_snapshot.json +3779 -0
  327. package/.output/server/database/migrations/meta/_journal.json +7 -0
  328. package/.output/server/database/migrations-pg/0046_gorgeous_hercules.sql +1 -0
  329. package/.output/server/database/migrations-pg/meta/0046_snapshot.json +4486 -0
  330. package/.output/server/database/migrations-pg/meta/_journal.json +7 -0
  331. package/.output/server/index.mjs +1 -1
  332. package/.output/server/package.json +1 -1
  333. package/package.json +1 -1
  334. package/.output/public/_nuxt/BNyTWIad.js +0 -9
  335. package/.output/public/_nuxt/BVyjw9Bi.js +0 -1
  336. package/.output/public/_nuxt/BZOykMLD.js +0 -1
  337. package/.output/public/_nuxt/CEai-PWF.js +0 -1
  338. package/.output/public/_nuxt/CYhm2FBS.js +0 -5
  339. package/.output/public/_nuxt/CfhOanaF.js +0 -1
  340. package/.output/public/_nuxt/Cz7SCzdW.js +0 -1
  341. package/.output/public/_nuxt/DFfqRQxk.js +0 -1
  342. package/.output/public/_nuxt/builds/meta/6d1766a0-0aba-46b8-9d97-7dd174130359.json +0 -1
  343. package/.output/public/_nuxt/eT2oObCh.js +0 -1
  344. package/.output/public/_nuxt/entry.D_eWXrnD.css +0 -1
  345. package/.output/server/chunks/build/db.client-Bdqk_eYQ.mjs.map +0 -1
  346. package/.output/server/chunks/build/index-vRwzDXLs.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import{_ as ee,a as te}from"./2yLW7WU0.js";import{_ as se}from"./Ya8ZzWuY.js";import{d as B,b as re,B as oe,ak as D,k as o,o as r,f as w,g as d,c as a,j as c,p as E,m as s,F as _,y as O,q as ie,i as t,t as l,s as ne,v as g,_ as F,r as U,w as ae,e as ce,A as pe,h as x}from"./CNu3kken.js";import{_ as G}from"./Ce47NgZw.js";import{e as N}from"./DeewM3Wg.js";import{_ as de}from"./DJzFYrBt.js";import{_ as le}from"./DNqm5cWU.js";import{E as ue}from"./DWwiVTZX.js";import{u as me}from"./DFfqRQxk.js";import{a as ge,u as fe}from"./DprkT7rM.js";import"./BZFiz2UB.js";import"./CfhOanaF.js";import"./BjaRappk.js";import"./B_JSV0yG.js";import"./Bq4_kqIp.js";import"./DGnQ69wW.js";const ye={key:0,class:"flex items-center gap-2 text-sm text-muted"},he={key:1,class:"space-y-2"},be=["data-testid"],xe={class:"min-w-0 flex-1"},_e={class:"flex items-center gap-2"},ve={class:"text-sm font-medium"},ke={key:0,class:"text-xs text-muted truncate"},we={key:1,class:"text-xs text-warning"},je={class:"flex items-center gap-1.5 shrink-0"},Ie=B({__name:"DesktopMcpClientsCard",setup(M){const v=re(),C=U(!1),S=U(!0),j=U([]),f=U(null);async function A(){const n=D();if(n)try{j.value=await n.invoke("desktop_mcp_clients"),C.value=!0}catch{C.value=!1}finally{S.value=!1}}oe(()=>{D()?A():S.value=!1});async function y(n,p){const h=D();if(h){f.value=n.id;try{const k=await h.invoke(p?"desktop_mcp_connect":"desktop_mcp_disconnect",{clientId:n.id});j.value=j.value.map(b=>b.id===k.id?k:b),v.add({title:p?`${n.label} connected`:`${n.label} disconnected`,description:p?`Restart ${n.label} to pick up the new server.`:void 0,color:"success",icon:"i-lucide-plug"})}catch(k){v.add({title:`Could not update ${n.label}`,description:N(k),color:"error"})}finally{f.value=null}}}async function u(n){const p=D();if(p)try{await p.invoke("desktop_mcp_reveal",{clientId:n.id})}catch(h){v.add({title:"Could not open the file",description:N(h),color:"error"})}}function q(n){switch(n.status){case"connected":return{label:"Connected",color:"success"};case"stale":return{label:"Needs update",color:"warning"};case"manual":return{label:"Manual setup",color:"warning"};case"not_installed":return{label:"Not detected",color:"neutral"};default:return null}}return(n,p)=>{const h=E,k=ne,b=F,$=G;return o(C)?(r(),w($,{key:0,icon:"i-lucide-plug-zap",title:"Connect a client on this machine"},{subtitle:d(()=>[...p[0]||(p[0]=[s(" One click writes the ",-1),t("code",null,"piwi",-1),s(" entry into the client's own config file (a backup is kept next to it), and entries are kept current when this app's address changes. Restart the client after connecting. ",-1)])]),default:d(()=>[o(S)?(r(),a("div",ye,[c(h,{name:"i-lucide-loader-2",class:"size-4 animate-spin"}),p[1]||(p[1]=s(" Detecting clients… ",-1))])):(r(),a("div",he,[(r(!0),a(_,null,O(o(j),i=>(r(),a("div",{key:i.id,"data-testid":`mcp-client-${i.id}`,class:ie(["flex items-center gap-3 rounded-md border border-default p-2.5",i.status==="not_installed"?"opacity-60":""])},[c(h,{name:"i-lucide-bot",class:"size-4 text-gray-400 shrink-0"}),t("div",xe,[t("div",_e,[t("p",ve,l(i.label),1),q(i)?(r(),w(k,{key:0,color:q(i).color,variant:"subtle",size:"sm"},{default:d(()=>[s(l(q(i).label),1)]),_:2},1032,["color"])):g("",!0)]),i.config_path?(r(),a("p",ke,l(i.config_path),1)):g("",!0),i.detail?(r(),a("p",we,l(i.detail),1)):g("",!0)]),t("div",je,[i.status==="not_connected"?(r(),w(b,{key:0,size:"xs",icon:"i-lucide-plug",loading:o(f)===i.id,onClick:P=>y(i,!0)},{default:d(()=>[...p[2]||(p[2]=[s(" Connect ",-1)])]),_:1},8,["loading","onClick"])):i.status==="stale"?(r(),w(b,{key:1,size:"xs",color:"warning",icon:"i-lucide-refresh-cw",loading:o(f)===i.id,onClick:P=>y(i,!0)},{default:d(()=>[...p[3]||(p[3]=[s(" Update ",-1)])]),_:1},8,["loading","onClick"])):g("",!0),i.status==="connected"||i.status==="stale"?(r(),w(b,{key:2,size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-unplug",loading:o(f)===i.id,onClick:P=>y(i,!1)},{default:d(()=>[...p[4]||(p[4]=[s(" Disconnect ",-1)])]),_:1},8,["loading","onClick"])):g("",!0),i.status!=="not_installed"&&i.config_path?(r(),w(b,{key:3,size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-folder-open","aria-label":"Reveal config file",title:"Reveal config file",onClick:P=>u(i)},null,8,["onClick"])):g("",!0)])],10,be))),128)),p[5]||(p[5]=t("p",{class:"text-xs text-muted"}," A client that is not listed — or marked manual — can always be connected with the snippets below. ",-1))]))]),_:1})):g("",!0)}}}),Ce=Object.assign(Ie,{__name:"DesktopMcpClientsCard"}),Se=[{name:"list_projects",description:"List all projects with stats: total runs, test cases, latest run status and branch. Use this first to discover available projects and their IDs.",inputSchema:{type:"object",properties:{}}},{name:"get_project",description:"Get project details and its recent test runs with pass/fail counts. Results are paginated — use pageSize and cursor for the runs list.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Project ID from list_projects"},pageSize:{type:"number",description:"Runs per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page of runs"}},required:["id"]}},{name:"list_runs",description:"List test runs for a project with filters.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},status:{type:"string",enum:["passed","failed","running","initialising","aborted"],description:"Filter by status"},branch:{type:"string",description:"Filter by branch name (exact match against SCM metadata)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}},required:["projectId"]}},{name:"get_run",description:"Get a test run summary plus its test cases (paginated), with status, truncated error text, and failure cluster IDs. Filter by status and page with pageSize/cursor.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"},status_filter:{type:"string",enum:["failed","flaky","all"],description:'Which test cases to include (default: "failed" — only failed+timedOut; "flaky" — only flaky; "all" — every case)'},pageSize:{type:"number",description:"Cases per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response for the next page of cases"}},required:["id"]}},{name:"list_failed_cases",description:"List failed and timed-out test cases across recent runs for a project.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"},runId:{type:"number",description:"Optional: restrict to a specific run"}},required:["projectId"]}},{name:"list_flaky_tests",description:"List flaky tests for a project with flakiness scores.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},runs:{type:"number",description:"Number of recent runs to analyze (default 50, max 200)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response. Cursor is the flakyScore value (descending)."}},required:["projectId"]}},{name:"get_test_case",description:"Get test case details including aggregated pass/fail stats, flakiness metrics, and recent executions (paginated). Use testCaseId (stable identity), not the per-run caseId.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test case ID (testCaseId from list_failed_cases or list_flaky_tests)"},pageSize:{type:"number",description:"Executions per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page of executions"}},required:["id"]}},{name:"list_clusters",description:"List failure clusters for a project. Each cluster groups similar failures by error fingerprint.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},status:{type:"string",enum:["open","resolved","ignored"],description:"Filter by triage status (default: all statuses)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}},required:["projectId"]}},{name:"get_cluster",description:"Get full details for a failure cluster including all affected test cases, a compact diagnosis summary, and locator healing suggestions for up to 5 affected cases. Each healing entry includes the failing locator, the recommended fix, and the number of alternatives available. Use get_cluster_diagnosis for the full diagnosis text, or get_cluster_context for the raw AI evidence.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID from list_clusters"}},required:["id"]}},{name:"get_fix_plan",description:"Everything needed to fix one failure cluster, in a single answer: the diagnosis and its validated patch, ranked locator replacements with the exact file and line to edit, the failing tests, the owning team, and the command that verifies the work. `verify.expectation` states what the dashboard records once those tests pass, so you can confirm the fix landed rather than guessing. Prefer this over assembling get_cluster + get_cluster_diagnosis + get_locator_healing yourself.",inputSchema:{type:"object",properties:{clusterId:{type:"number",description:"Cluster ID from list_clusters or list_open_clusters"}},required:["clusterId"]}},{name:"get_cluster_diagnosis",description:"Get the stored AI diagnosis for a failure cluster. Returns category, confidence, root cause, evidence, and suggested fix. Returns null if no diagnosis has been run yet.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"}},required:["id"]}},{name:"get_test_case_context",description:"Get the AI evidence context for a specific test-run-case (execution scope). Use this when debugging a single test failure — it provides the execution-scoped evidence including steps, console, network, and SCM diff.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run case ID"}},required:["id"]}},{name:"get_case_screenshots",description:"Get screenshots for a test-run-case. By default returns metadata only (name, type, size). Set content=true to include base64-encoded image data (max 3, capped at ~100 KB each). Call metadata-only first to discover what exists, then request content for the ones you need.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID"},content:{type:"boolean",description:"Include base64 image data (default false — metadata only)"}},required:["testRunsCaseId"]}},{name:"get_cluster_context",description:"Get the full AI evidence context for a failure cluster — the same data sent to the diagnosis AI. Includes error samples, stack traces, test steps, console logs, network failures, ARIA snapshots, SCM diff (changed files since last green run), and a per-section breakdown with char counts and truncation flags. This is the richest available evidence for debugging a failure.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},baseCommit:{type:"string",description:"Optional: override the baseline commit SHA for SCM diff comparison"},selectedCommitShas:{type:"array",items:{type:"string"},description:"Optional: specific commit SHAs to include in the diff context (max 10)"}},required:["id"]}},{name:"search_test_cases",description:"Search test cases by title or file path within a project. Accepts a free-text query and returns matching test cases with basic stats. Use this to find a test case when you don't know its ID.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},q:{type:"string",description:"Search query — matched against title and file path (case-insensitive)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}},required:["projectId","q"]}},{name:"get_test_run_case",description:"Get a single test-run-case execution record with full (untruncated) error text plus steps, console logs, web vitals, and ARIA snapshot. Use include to fetch only the blobs you need. The ID is the executionId from get_run.cases or testRunsCaseId from get_cluster.affectedTestCases.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run case ID (executionId from get_run.cases or testRunsCaseId from get_cluster.affectedTestCases)"},include:{type:"array",items:{type:"string",enum:["steps","console","webVitals","aria","source"]},description:"Optional: which heavy blobs to include (default: all). The error, status, and summary are always returned."}},required:["id"]}},{name:"list_recent_activity",description:"List the most recent test runs across all projects. No projectId required — returns a cross-project view of recent CI activity. Paginated by startTime descending.",inputSchema:{type:"object",properties:{pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}}}},{name:"get_repo_commits",description:"List recent commits for a project's repository. Requires SCM token configuration (per-project or global). Returns commit details (SHA, message, author, date).",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},branch:{type:"string",description:"Branch name (default: repository default branch)"},limit:{type:"number",description:"Max commits (default 20, max 100)"}},required:["projectId"]}},{name:"get_repo_diff",description:"Get the diff (changed files with patches) for a single commit in a project's repository. Requires SCM token configuration (per-project or global). Useful for inspecting what code changed in a specific commit suspected of causing a failure.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},sha:{type:"string",description:"Full commit SHA"}},required:["projectId","sha"]}},{name:"get_run_insights",description:'Compare a run to its last green baseline: pass-rate delta, new regressions, recurrences, recovered tests, new flaky tests, biggest perf improvements/regressions, worker imbalance, and newly opened clusters. Use this to answer "what changed?" and "did my fix work?".',inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"}},required:["id"]}},{name:"get_spec_health",description:"Per-spec-file health for a project: pass rate, flaky rate, failure count, test count, and average duration grouped by spec-file prefix over the last N days. Use to find which areas of the suite are unhealthy.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},days:{type:"number",description:"Lookback window in days (default 30, max 90)"}},required:["projectId"]}},{name:"get_slow_tests",description:"Slowest test cases in a project by average duration, with max/min and trend direction across recent runs. Use to target performance work.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},runs:{type:"number",description:"Recent runs to analyze (default 50, max 100)"}},required:["projectId"]}},{name:"get_performance_trend",description:'Time series of run duration, average test duration, and p90 test duration for a project. Use to answer "is the suite getting slower?".',inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},limit:{type:"number",description:"Number of recent runs (default 30, max 100)"}},required:["projectId"]}},{name:"get_test_stability_trend",description:'Time-series stability for a single test case: flaky rate, pass rate, and average duration bucketed over its recent execution history. Use to answer "is this test getting flakier?".',inputSchema:{type:"object",properties:{id:{type:"number",description:"Test case ID (stable testCaseId)"},buckets:{type:"number",description:"Number of time buckets (default 20, 5–50)"}},required:["id"]}},{name:"get_network_requests",description:"A run's network requests aggregated by method + normalized route, sorted by average duration, with status codes and captured backend server logs. Use to pin a UI failure on a slow or failing endpoint.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"}},required:["id"]}},{name:"get_failure_groups",description:"One run's failures grouped by failure cluster, with per-group affected cases and worker correlation. Run-scoped counterpart to list_clusters.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"}},required:["id"]}},{name:"get_locator_healing",description:"Ranked alternative locators for a failing test-run-case: the failing locator, the recommended durable fix, and the full alternative lists (from prior success, element match, and ARIA snapshot). Use when fixing a broken selector.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID (executionId)"}},required:["testRunsCaseId"]}},{name:"search",description:"Global search across all in-scope projects, runs (by label or numeric id), and test cases (by title). Use to find a run by its label or locate an entity across projects.",inputSchema:{type:"object",properties:{q:{type:"string",description:"Search query (min 2 chars)"}},required:["q"]}},{name:"list_case_traces",description:"List Playwright trace files for a test-run-case, with a download path for each. Fetch the bytes via GET /api/files/<path>.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID (executionId)"}},required:["testRunsCaseId"]}},{name:"list_links",description:"List external entity links (Jira, GitHub PR/issue, etc.) attached to a run, test-run-case, or test case, with provider and unfurled status.",inputSchema:{type:"object",properties:{entityType:{type:"string",enum:["test_run","test_runs_case","test_case"],description:"Which entity the links are attached to"},id:{type:"number",description:"The entity ID matching entityType"}},required:["entityType","id"]}},{name:"list_tags",description:"List the project tag catalog (id, text, color).",inputSchema:{type:"object",properties:{}}},{name:"get_project_test_catalog",description:"The full test-case catalog for a project with aggregated pass/fail/flaky counts, average duration, and last status per test. Offset-paginated bulk companion to get_test_case.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},offset:{type:"number",description:"Row offset for paging (default 0)"},query:{type:"string",description:"Optional case-insensitive substring filter on title or file path"},tags:{type:"string",description:"Comma-separated tags; a test must carry every one of them. A leading @ is optional."},owner:{type:"string",description:"Exact owner declared via the piwi:owner annotation"},priority:{type:"string",enum:["critical","high","medium","low"],description:"Priority declared via the piwi:priority annotation"}},required:["projectId"]}},{name:"list_open_clusters",description:"Open failure clusters across all in-scope projects, ranked by occurrences — a cross-project triage queue. Filter by status; paginate with pageSize/cursor.",inputSchema:{type:"object",properties:{status:{type:"string",enum:["open","resolved","ignored"],description:"Triage status (default: open)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}}}},{name:"get_instance_stats",description:"Instance-wide counts (projects, runs, test cases, executions, files) and total storage size. Admin only.",inputSchema:{type:"object",properties:{}}},{name:"explain_failure",description:"One-call evidence bundle for a single failing execution: error, steps, console, ARIA snapshot, the recommended locator fix, a screenshot count, and the AI diagnosis context. Prefer this over chaining get_test_run_case + get_locator_healing + get_test_case_context.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID (executionId)"}},required:["testRunsCaseId"]}},{name:"set_cluster_status",description:"Triage a failure cluster: set its status to open, resolved, or ignored with an optional note. Requires reporter or admin access. Use after fixing the underlying issue.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},status:{type:"string",enum:["open","resolved","ignored"],description:"New triage status"},triageNote:{type:"string",description:"Optional note explaining the status change"}},required:["id","status"]}},{name:"set_cluster_base_commit",description:'Pin the baseline commit SHA a cluster uses for its SCM-diff diagnosis context, so "what changed since green" is accurate. Requires reporter or admin access.',inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},commit:{type:"string",description:"Baseline commit SHA (empty to clear)"}},required:["id","commit"]}},{name:"submit_diagnosis_feedback",description:"Record thumbs up/down feedback on a stored diagnosis, with an optional note. Requires reporter or admin access.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Diagnosis ID"},feedback:{type:"string",enum:["up","down"],description:"Rating (omit to clear)"},feedbackNote:{type:"string",description:"Optional note"}},required:["id"]}},{name:"run_cluster_diagnosis",description:"Trigger an AI diagnosis for a failure cluster and return the result (category, confidence, root cause, suggested fix). Returns the existing completed diagnosis unless force is set. Requires reporter or admin access and a configured AI provider.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},force:{type:"boolean",description:"Re-run even if a completed diagnosis exists (default false)"},baseCommit:{type:"string",description:"Optional baseline commit SHA for SCM-diff context"}},required:["id"]}},{name:"create_test_function",description:`Register a page-object method or helper in a project's test-function catalog, so the Piwi Picker browser extension (and its recorder) can match a live page or a recorded session against it and substitute a call to your own code instead of raw locator lines. This tool does not call an AI itself — you (the calling agent) read the function's real source in your own context and fill in these fields directly; the tool only validates the shape and persists it. Follow these extraction rules when deciding the field values:
1
+ import{_ as ee,a as te}from"./opyDpgSw.js";import{_ as se}from"./BBhrClA9.js";import{d as B,b as re,B as oe,ak as D,k as o,o as r,f as w,g as d,c as a,j as c,p as E,m as s,F as _,y as O,q as ie,i as t,t as l,s as ne,v as g,_ as F,r as U,w as ae,e as ce,A as pe,h as x}from"./C5TrTuWv.js";import{_ as G}from"./DMAiMrNr.js";import{e as N}from"./DMtrFQqi.js";import{_ as de}from"./B1LUinhp.js";import{_ as le}from"./DhYznn-U.js";import{E as ue}from"./DWwiVTZX.js";import{u as me}from"./fXUwH_3d.js";import{a as ge,u as fe}from"./T5UuMUxA.js";import"./BCGljaM0.js";import"./B69RP95P.js";import"./BjaRappk.js";import"./C8Paf_V1.js";import"./DEvYVl9M.js";import"./DGnQ69wW.js";const ye={key:0,class:"flex items-center gap-2 text-sm text-muted"},he={key:1,class:"space-y-2"},be=["data-testid"],xe={class:"min-w-0 flex-1"},_e={class:"flex items-center gap-2"},ve={class:"text-sm font-medium"},ke={key:0,class:"text-xs text-muted truncate"},we={key:1,class:"text-xs text-warning"},je={class:"flex items-center gap-1.5 shrink-0"},Ie=B({__name:"DesktopMcpClientsCard",setup(M){const v=re(),C=U(!1),S=U(!0),j=U([]),f=U(null);async function A(){const n=D();if(n)try{j.value=await n.invoke("desktop_mcp_clients"),C.value=!0}catch{C.value=!1}finally{S.value=!1}}oe(()=>{D()?A():S.value=!1});async function y(n,p){const h=D();if(h){f.value=n.id;try{const k=await h.invoke(p?"desktop_mcp_connect":"desktop_mcp_disconnect",{clientId:n.id});j.value=j.value.map(b=>b.id===k.id?k:b),v.add({title:p?`${n.label} connected`:`${n.label} disconnected`,description:p?`Restart ${n.label} to pick up the new server.`:void 0,color:"success",icon:"i-lucide-plug"})}catch(k){v.add({title:`Could not update ${n.label}`,description:N(k),color:"error"})}finally{f.value=null}}}async function u(n){const p=D();if(p)try{await p.invoke("desktop_mcp_reveal",{clientId:n.id})}catch(h){v.add({title:"Could not open the file",description:N(h),color:"error"})}}function q(n){switch(n.status){case"connected":return{label:"Connected",color:"success"};case"stale":return{label:"Needs update",color:"warning"};case"manual":return{label:"Manual setup",color:"warning"};case"not_installed":return{label:"Not detected",color:"neutral"};default:return null}}return(n,p)=>{const h=E,k=ne,b=F,$=G;return o(C)?(r(),w($,{key:0,icon:"i-lucide-plug-zap",title:"Connect a client on this machine"},{subtitle:d(()=>[...p[0]||(p[0]=[s(" One click writes the ",-1),t("code",null,"piwi",-1),s(" entry into the client's own config file (a backup is kept next to it), and entries are kept current when this app's address changes. Restart the client after connecting. ",-1)])]),default:d(()=>[o(S)?(r(),a("div",ye,[c(h,{name:"i-lucide-loader-2",class:"size-4 animate-spin"}),p[1]||(p[1]=s(" Detecting clients… ",-1))])):(r(),a("div",he,[(r(!0),a(_,null,O(o(j),i=>(r(),a("div",{key:i.id,"data-testid":`mcp-client-${i.id}`,class:ie(["flex items-center gap-3 rounded-md border border-default p-2.5",i.status==="not_installed"?"opacity-60":""])},[c(h,{name:"i-lucide-bot",class:"size-4 text-gray-400 shrink-0"}),t("div",xe,[t("div",_e,[t("p",ve,l(i.label),1),q(i)?(r(),w(k,{key:0,color:q(i).color,variant:"subtle",size:"sm"},{default:d(()=>[s(l(q(i).label),1)]),_:2},1032,["color"])):g("",!0)]),i.config_path?(r(),a("p",ke,l(i.config_path),1)):g("",!0),i.detail?(r(),a("p",we,l(i.detail),1)):g("",!0)]),t("div",je,[i.status==="not_connected"?(r(),w(b,{key:0,size:"xs",icon:"i-lucide-plug",loading:o(f)===i.id,onClick:P=>y(i,!0)},{default:d(()=>[...p[2]||(p[2]=[s(" Connect ",-1)])]),_:1},8,["loading","onClick"])):i.status==="stale"?(r(),w(b,{key:1,size:"xs",color:"warning",icon:"i-lucide-refresh-cw",loading:o(f)===i.id,onClick:P=>y(i,!0)},{default:d(()=>[...p[3]||(p[3]=[s(" Update ",-1)])]),_:1},8,["loading","onClick"])):g("",!0),i.status==="connected"||i.status==="stale"?(r(),w(b,{key:2,size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-unplug",loading:o(f)===i.id,onClick:P=>y(i,!1)},{default:d(()=>[...p[4]||(p[4]=[s(" Disconnect ",-1)])]),_:1},8,["loading","onClick"])):g("",!0),i.status!=="not_installed"&&i.config_path?(r(),w(b,{key:3,size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-folder-open","aria-label":"Reveal config file",title:"Reveal config file",onClick:P=>u(i)},null,8,["onClick"])):g("",!0)])],10,be))),128)),p[5]||(p[5]=t("p",{class:"text-xs text-muted"}," A client that is not listed — or marked manual — can always be connected with the snippets below. ",-1))]))]),_:1})):g("",!0)}}}),Ce=Object.assign(Ie,{__name:"DesktopMcpClientsCard"}),Se=[{name:"list_projects",description:"List all projects with stats: total runs, test cases, latest run status and branch. Use this first to discover available projects and their IDs.",inputSchema:{type:"object",properties:{}}},{name:"get_project",description:"Get project details and its recent test runs with pass/fail counts. Results are paginated — use pageSize and cursor for the runs list.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Project ID from list_projects"},pageSize:{type:"number",description:"Runs per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page of runs"}},required:["id"]}},{name:"list_runs",description:"List test runs for a project with filters.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},status:{type:"string",enum:["passed","failed","running","initialising","aborted"],description:"Filter by status"},branch:{type:"string",description:"Filter by branch name (exact match against SCM metadata)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}},required:["projectId"]}},{name:"get_run",description:"Get a test run summary plus its test cases (paginated), with status, truncated error text, and failure cluster IDs. Filter by status and page with pageSize/cursor.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"},status_filter:{type:"string",enum:["failed","flaky","all"],description:'Which test cases to include (default: "failed" — only failed+timedOut; "flaky" — only flaky; "all" — every case)'},pageSize:{type:"number",description:"Cases per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response for the next page of cases"}},required:["id"]}},{name:"list_failed_cases",description:"List failed and timed-out test cases across recent runs for a project.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"},runId:{type:"number",description:"Optional: restrict to a specific run"}},required:["projectId"]}},{name:"list_flaky_tests",description:"List flaky tests for a project with flakiness scores.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},runs:{type:"number",description:"Number of recent runs to analyze (default 50, max 200)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response. Cursor is the flakyScore value (descending)."}},required:["projectId"]}},{name:"get_test_case",description:"Get test case details including aggregated pass/fail stats, flakiness metrics, and recent executions (paginated). Use testCaseId (stable identity), not the per-run caseId.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test case ID (testCaseId from list_failed_cases or list_flaky_tests)"},pageSize:{type:"number",description:"Executions per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page of executions"}},required:["id"]}},{name:"list_clusters",description:"List failure clusters for a project. Each cluster groups similar failures by error fingerprint.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},status:{type:"string",enum:["open","resolved","ignored"],description:"Filter by triage status (default: all statuses)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}},required:["projectId"]}},{name:"get_cluster",description:"Get full details for a failure cluster including all affected test cases, a compact diagnosis summary, and locator healing suggestions for up to 5 affected cases. Each healing entry includes the failing locator, the recommended fix, and the number of alternatives available. Use get_cluster_diagnosis for the full diagnosis text, or get_cluster_context for the raw AI evidence.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID from list_clusters"}},required:["id"]}},{name:"get_fix_plan",description:"Everything needed to fix one failure cluster, in a single answer: the diagnosis and its validated patch, ranked locator replacements with the exact file and line to edit, the failing tests, the owning team, and the command that verifies the work. `verify.expectation` states what the dashboard records once those tests pass, so you can confirm the fix landed rather than guessing. Prefer this over assembling get_cluster + get_cluster_diagnosis + get_locator_healing yourself.",inputSchema:{type:"object",properties:{clusterId:{type:"number",description:"Cluster ID from list_clusters or list_open_clusters"}},required:["clusterId"]}},{name:"get_cluster_diagnosis",description:"Get the stored AI diagnosis for a failure cluster. Returns category, confidence, root cause, evidence, and suggested fix. Returns null if no diagnosis has been run yet.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"}},required:["id"]}},{name:"get_test_case_context",description:"Get the AI evidence context for a specific test-run-case (execution scope). Use this when debugging a single test failure — it provides the execution-scoped evidence including steps, console, network, and SCM diff.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run case ID"}},required:["id"]}},{name:"get_case_screenshots",description:"Get screenshots for a test-run-case. By default returns metadata only (name, type, size). Set content=true to include base64-encoded image data (max 3, capped at ~100 KB each). Call metadata-only first to discover what exists, then request content for the ones you need.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID"},content:{type:"boolean",description:"Include base64 image data (default false — metadata only)"}},required:["testRunsCaseId"]}},{name:"get_cluster_context",description:"Get the full AI evidence context for a failure cluster — the same data sent to the diagnosis AI. Includes error samples, stack traces, test steps, console logs, network failures, ARIA snapshots, SCM diff (changed files since last green run), and a per-section breakdown with char counts and truncation flags. This is the richest available evidence for debugging a failure.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},baseCommit:{type:"string",description:"Optional: override the baseline commit SHA for SCM diff comparison"},selectedCommitShas:{type:"array",items:{type:"string"},description:"Optional: specific commit SHAs to include in the diff context (max 10)"}},required:["id"]}},{name:"search_test_cases",description:"Search test cases by title or file path within a project. Accepts a free-text query and returns matching test cases with basic stats. Use this to find a test case when you don't know its ID.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},q:{type:"string",description:"Search query — matched against title and file path (case-insensitive)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}},required:["projectId","q"]}},{name:"get_test_run_case",description:"Get a single test-run-case execution record with full (untruncated) error text plus steps, console logs, web vitals, and ARIA snapshot. Use include to fetch only the blobs you need. The ID is the executionId from get_run.cases or testRunsCaseId from get_cluster.affectedTestCases.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run case ID (executionId from get_run.cases or testRunsCaseId from get_cluster.affectedTestCases)"},include:{type:"array",items:{type:"string",enum:["steps","console","webVitals","aria","source"]},description:"Optional: which heavy blobs to include (default: all). The error, status, and summary are always returned."}},required:["id"]}},{name:"list_recent_activity",description:"List the most recent test runs across all projects. No projectId required — returns a cross-project view of recent CI activity. Paginated by startTime descending.",inputSchema:{type:"object",properties:{pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}}}},{name:"get_repo_commits",description:"List recent commits for a project's repository. Requires SCM token configuration (per-project or global). Returns commit details (SHA, message, author, date).",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},branch:{type:"string",description:"Branch name (default: repository default branch)"},limit:{type:"number",description:"Max commits (default 20, max 100)"}},required:["projectId"]}},{name:"get_repo_diff",description:"Get the diff (changed files with patches) for a single commit in a project's repository. Requires SCM token configuration (per-project or global). Useful for inspecting what code changed in a specific commit suspected of causing a failure.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},sha:{type:"string",description:"Full commit SHA"}},required:["projectId","sha"]}},{name:"get_run_insights",description:'Compare a run to its last green baseline: pass-rate delta, new regressions, recurrences, recovered tests, new flaky tests, biggest perf improvements/regressions, worker imbalance, and newly opened clusters. Use this to answer "what changed?" and "did my fix work?".',inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"}},required:["id"]}},{name:"get_spec_health",description:"Per-spec-file health for a project: pass rate, flaky rate, failure count, test count, and average duration grouped by spec-file prefix over the last N days. Use to find which areas of the suite are unhealthy.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},days:{type:"number",description:"Lookback window in days (default 30, max 90)"}},required:["projectId"]}},{name:"get_slow_tests",description:"Slowest test cases in a project by average duration, with max/min and trend direction across recent runs. Use to target performance work.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},runs:{type:"number",description:"Recent runs to analyze (default 50, max 100)"}},required:["projectId"]}},{name:"get_performance_trend",description:'Time series of run duration, average test duration, and p90 test duration for a project. Use to answer "is the suite getting slower?".',inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},limit:{type:"number",description:"Number of recent runs (default 30, max 100)"}},required:["projectId"]}},{name:"get_test_stability_trend",description:'Time-series stability for a single test case: flaky rate, pass rate, and average duration bucketed over its recent execution history. Use to answer "is this test getting flakier?".',inputSchema:{type:"object",properties:{id:{type:"number",description:"Test case ID (stable testCaseId)"},buckets:{type:"number",description:"Number of time buckets (default 20, 5–50)"}},required:["id"]}},{name:"get_network_requests",description:"A run's network requests aggregated by method + normalized route, sorted by average duration, with status codes and captured backend server logs. Use to pin a UI failure on a slow or failing endpoint.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"}},required:["id"]}},{name:"get_failure_groups",description:"One run's failures grouped by failure cluster, with per-group affected cases and worker correlation. Run-scoped counterpart to list_clusters.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"}},required:["id"]}},{name:"get_locator_healing",description:"Ranked alternative locators for a failing test-run-case: the failing locator, the recommended durable fix, and the full alternative lists (from prior success, element match, and ARIA snapshot). Use when fixing a broken selector.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID (executionId)"}},required:["testRunsCaseId"]}},{name:"search",description:"Global search across all in-scope projects, runs (by label or numeric id), and test cases (by title). Use to find a run by its label or locate an entity across projects.",inputSchema:{type:"object",properties:{q:{type:"string",description:"Search query (min 2 chars)"}},required:["q"]}},{name:"list_case_traces",description:"List Playwright trace files for a test-run-case, with a download path for each. Fetch the bytes via GET /api/files/<path>.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID (executionId)"}},required:["testRunsCaseId"]}},{name:"list_links",description:"List external entity links (Jira, GitHub PR/issue, etc.) attached to a run, test-run-case, or test case, with provider and unfurled status.",inputSchema:{type:"object",properties:{entityType:{type:"string",enum:["test_run","test_runs_case","test_case"],description:"Which entity the links are attached to"},id:{type:"number",description:"The entity ID matching entityType"}},required:["entityType","id"]}},{name:"list_tags",description:"List the project tag catalog (id, text, color).",inputSchema:{type:"object",properties:{}}},{name:"get_project_test_catalog",description:"The full test-case catalog for a project with aggregated pass/fail/flaky counts, average duration, and last status per test. Offset-paginated bulk companion to get_test_case.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},offset:{type:"number",description:"Row offset for paging (default 0)"},query:{type:"string",description:"Optional case-insensitive substring filter on title or file path"},tags:{type:"string",description:"Comma-separated tags; a test must carry every one of them. A leading @ is optional."},owner:{type:"string",description:"Exact owner declared via the piwi:owner annotation"},priority:{type:"string",enum:["critical","high","medium","low"],description:"Priority declared via the piwi:priority annotation"}},required:["projectId"]}},{name:"list_open_clusters",description:"Open failure clusters across all in-scope projects, ranked by occurrences — a cross-project triage queue. Filter by status; paginate with pageSize/cursor.",inputSchema:{type:"object",properties:{status:{type:"string",enum:["open","resolved","ignored"],description:"Triage status (default: open)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}}}},{name:"get_instance_stats",description:"Instance-wide counts (projects, runs, test cases, executions, files) and total storage size. Admin only.",inputSchema:{type:"object",properties:{}}},{name:"explain_failure",description:"One-call evidence bundle for a single failing execution: error, steps, console, ARIA snapshot, the recommended locator fix, a screenshot count, and the AI diagnosis context. Prefer this over chaining get_test_run_case + get_locator_healing + get_test_case_context.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID (executionId)"}},required:["testRunsCaseId"]}},{name:"set_cluster_status",description:"Triage a failure cluster: set its status to open, resolved, or ignored with an optional note. Requires reporter or admin access. Use after fixing the underlying issue.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},status:{type:"string",enum:["open","resolved","ignored"],description:"New triage status"},triageNote:{type:"string",description:"Optional note explaining the status change"}},required:["id","status"]}},{name:"set_cluster_base_commit",description:'Pin the baseline commit SHA a cluster uses for its SCM-diff diagnosis context, so "what changed since green" is accurate. Requires reporter or admin access.',inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},commit:{type:"string",description:"Baseline commit SHA (empty to clear)"}},required:["id","commit"]}},{name:"submit_diagnosis_feedback",description:"Record thumbs up/down feedback on a stored diagnosis, with an optional note. Requires reporter or admin access.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Diagnosis ID"},feedback:{type:"string",enum:["up","down"],description:"Rating (omit to clear)"},feedbackNote:{type:"string",description:"Optional note"}},required:["id"]}},{name:"run_cluster_diagnosis",description:"Trigger an AI diagnosis for a failure cluster and return the result (category, confidence, root cause, suggested fix). Returns the existing completed diagnosis unless force is set. Requires reporter or admin access and a configured AI provider.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},force:{type:"boolean",description:"Re-run even if a completed diagnosis exists (default false)"},baseCommit:{type:"string",description:"Optional baseline commit SHA for SCM-diff context"}},required:["id"]}},{name:"create_test_function",description:`Register a page-object method or helper in a project's test-function catalog, so the Piwi Picker browser extension (and its recorder) can match a live page or a recorded session against it and substitute a call to your own code instead of raw locator lines. This tool does not call an AI itself — you (the calling agent) read the function's real source in your own context and fill in these fields directly; the tool only validates the shape and persists it. Follow these extraction rules when deciding the field values:
2
2
 
3
3
  ${ue}
4
4
 
@@ -1,4 +1,4 @@
1
- import{_ as ie}from"./a8Z6VC7V.js";import{d as re,b as de,w as A,c as r,j as a,ac as ce,k as s,g as d,F as y,f as v,h as D,r as k,o as l,i,E as ue,l as me,_ as pe,m as c,p as fe,t as p,v as _,y as R,s as _e,q as ge,M as ye,A as ve}from"./CNu3kken.js";import{_ as he}from"./DJzFYrBt.js";import{_ as ke}from"./CfhOanaF.js";import{_ as xe}from"./Ce47NgZw.js";import{_ as be}from"./CF_eDZHu.js";import{_ as Se}from"./C9I1Dp3S.js";import{_ as we}from"./FJTsZ5Aa.js";import{_ as Te}from"./Ya8ZzWuY.js";import{u as F}from"./DprkT7rM.js";import"./DeewM3Wg.js";import"./BjaRappk.js";import"./B_JSV0yG.js";import"./DZ-KbUZi.js";import"./BVyjw9Bi.js";const Pe={class:"space-y-6"},Ue={class:"space-y-3"},Ce={key:0,class:"flex items-center gap-2 text-sm text-success-600 dark:text-success-400"},Ie={key:1,class:"flex items-center gap-2 text-sm text-warning-600 dark:text-warning-400"},Me={key:2,class:"grid grid-cols-2 gap-2 text-sm"},$e={class:"font-mono"},Ve={class:"font-mono"},Ee={key:3,class:"text-sm text-muted space-y-1"},Ne={class:"flex items-center gap-2 w-full"},ze={key:0,class:"mb-4 p-4 rounded-lg border border-primary/30 bg-primary/5 space-y-3"},Ae={class:"grid grid-cols-2 gap-3"},De={class:"flex justify-end gap-2"},Re={key:1,class:"text-sm text-muted py-4 text-center"},Fe={class:"space-y-2"},We={class:"flex-1 min-w-0"},Le={class:"font-medium text-sm flex items-center gap-1.5"},Oe={class:"text-xs text-muted"},Be={key:3,class:"ml-1 text-primary text-xs"},je={class:"flex items-center gap-1"},He={key:0,class:"text-sm text-muted py-4 text-center"},qe={class:"space-y-2"},Ye={class:"flex-1 min-w-0 space-y-0.5"},Je={class:"font-medium text-sm"},Qe={class:"text-xs text-muted flex flex-wrap gap-x-3"},Xe={key:0},Ge={key:1},Ke={key:2,class:"text-warning-500"},Ze={class:"flex flex-wrap gap-1 mt-1"},et={class:"flex items-center gap-1"},yt=re({__name:"notifications",async setup(tt){let f,x;const u=de(),j=ve(),I=D(()=>j.public.authEnabled),H=["PIWI_SMTP_HOST","PIWI_SMTP_PORT","PIWI_SMTP_USER","PIWI_SMTP_PASS","PIWI_SMTP_FROM","PIWI_SMTP_FROM_NAME","PIWI_SMTP_SECURE"],{data:m}=([f,x]=A(()=>F("/api/settings/smtp","$v5NL0FLSog")),f=await f,x(),f),h=k(""),M=k(!1);async function q(){if(h.value){M.value=!0;try{const o=await $fetch("/api/settings/smtp/test",{method:"POST",body:{to:h.value}});o.success?u.add({title:"Test email sent",description:`Check ${h.value}`,color:"success"}):u.add({title:"Send failed",description:o.error||"Unknown error",color:"error"})}catch(o){u.add({title:"Send failed",description:String(o?.message??o),color:"error"})}finally{M.value=!1}}}const{data:Y,refresh:W}=I.value?([f,x]=A(()=>F("/api/channels","$rT8YNpmgfl")),f=await f,x(),f):{data:k(null),refresh:()=>{}},$=D(()=>Y.value?.channels??[]),b=k(!1),n=ye({name:"",type:"email",address:"",webhookUrl:"",url:"",secret:"",global:!1}),V=k(!1),E=k(null),J=[{label:"Email",value:"email"},{label:"Slack webhook",value:"slack"},{label:"Webhook",value:"webhook"}];async function Q(){V.value=!0;try{const o={};n.type==="email"?o.address=n.address:n.type==="slack"?o.webhookUrl=n.webhookUrl:n.type==="webhook"&&(o.url=n.url,n.secret&&(o.secret=n.secret)),await $fetch("/api/channels",{method:"POST",body:{name:n.name,type:n.type,config:o,global:n.global}}),b.value=!1,Object.assign(n,{name:"",type:"email",address:"",webhookUrl:"",url:"",secret:"",global:!1}),await W(),u.add({title:"Channel created",color:"success"})}catch(o){u.add({title:"Failed to create channel",description:String(o?.message??o),color:"error"})}finally{V.value=!1}}async function X(o){try{await $fetch(`/api/channels/${o}`,{method:"DELETE"}),await W(),u.add({title:"Channel deleted",color:"success"})}catch(e){u.add({title:"Failed to delete channel",description:String(e?.message??e),color:"error"})}}async function G(o){E.value=o;try{const e=await $fetch(`/api/channels/${o}/test`,{method:"POST"});e.success?u.add({title:"Test notification sent",color:"success"}):u.add({title:"Test failed",description:e.error,color:"error"})}catch(e){u.add({title:"Test failed",description:String(e?.message??e),color:"error"})}finally{E.value=null}}const{data:K,refresh:L}=I.value?([f,x]=A(()=>F("/api/subscriptions","$J_5QzL_eLh")),f=await f,x(),f):{data:k(null),refresh:()=>{}},N=D(()=>K.value?.subscriptions??[]);async function Z(o){try{await $fetch(`/api/subscriptions/${o}`,{method:"DELETE"}),await L(),u.add({title:"Subscription removed",color:"success"})}catch(e){u.add({title:"Failed to remove subscription",description:String(e?.message??e),color:"error"})}}async function ee(o){const e=o.mutedUntil&&new Date(o.mutedUntil)>new Date;try{await $fetch(`/api/subscriptions/${o.id}`,{method:"PATCH",body:{mutedUntil:e?null:new Date(Date.now()+10080*60*1e3).toISOString()}}),await L(),u.add({title:e?"Unmuted":"Muted for 7 days",color:"success"})}catch(U){u.add({title:"Failed to update subscription",description:String(U?.message??U),color:"error"})}}function P(o){return o.mutedUntil&&new Date(o.mutedUntil)>new Date}function O(o){return o==="personal_email"?"i-lucide-user-round":o==="email"?"i-lucide-mail":o==="slack"?"i-lucide-slack":"i-lucide-webhook"}function te(o){return o.replace(/\./g," › ")}return(o,e)=>{const U=ie,C=fe,se=he,oe=ke,S=ue,g=pe,z=xe,w=be,le=Se,B=_e,ne=we,ae=Te;return l(),r("div",Pe,[a(z,{icon:"i-lucide-mail",title:"SMTP email delivery",help:"settings.smtp"},ce({subtitle:d(()=>[e[9]||(e[9]=c(" Configure SMTP via environment variables. The connection cannot be changed here. ",-1))]),actions:d(()=>[s(m)?.configured?(l(),v(U,{key:0,"env-vars":H,size:"md"})):_("",!0)]),default:d(()=>[i("div",Ue,[s(m)?.configured?(l(),r("div",Ce,[a(C,{name:"i-lucide-circle-check-big",class:"size-4"}),e[10]||(e[10]=c(" Configured ",-1))])):(l(),r("div",Ie,[a(C,{name:"i-lucide-circle-alert",class:"size-4"}),e[11]||(e[11]=c(" Not configured ",-1))])),s(m)?.configured?(l(),r("div",Me,[e[12]||(e[12]=i("div",{class:"text-muted"},"Host",-1)),i("div",$e,p(s(m)?.host)+":"+p(s(m)?.port),1),e[13]||(e[13]=i("div",{class:"text-muted"},"From",-1)),i("div",null,p(s(m)?.fromName?`${s(m).fromName} <${s(m).from}>`:s(m)?.from),1),e[14]||(e[14]=i("div",{class:"text-muted"},"User",-1)),i("div",Ve,p(s(m)?.user),1),e[15]||(e[15]=i("div",{class:"text-muted"},"TLS",-1)),i("div",null,p(s(m)?.secure?"Yes (port 465)":"STARTTLS / plain"),1)])):_("",!0),s(m)?.configured?_("",!0):(l(),r("div",Ee,[e[16]||(e[16]=i("p",null,"Set these environment variables to enable email notifications:",-1)),a(se,{code:`PIWI_SMTP_HOST=smtp.example.com
1
+ import{_ as ie}from"./COuZu9FO.js";import{d as re,b as de,w as A,c as r,j as a,ac as ce,k as s,g as d,F as y,f as v,h as D,r as k,o as l,i,E as ue,l as me,_ as pe,m as c,p as fe,t as p,v as _,y as R,s as _e,q as ge,M as ye,A as ve}from"./C5TrTuWv.js";import{_ as he}from"./B1LUinhp.js";import{_ as ke}from"./B69RP95P.js";import{_ as xe}from"./DMAiMrNr.js";import{_ as be}from"./DH5H1DJh.js";import{_ as Se}from"./Ce5_Tq63.js";import{_ as we}from"./DuOH5jcQ.js";import{_ as Te}from"./BBhrClA9.js";import{u as F}from"./T5UuMUxA.js";import"./DMtrFQqi.js";import"./BjaRappk.js";import"./C8Paf_V1.js";import"./D_y2VS8k.js";import"./DaNC-xl1.js";const Pe={class:"space-y-6"},Ue={class:"space-y-3"},Ce={key:0,class:"flex items-center gap-2 text-sm text-success-600 dark:text-success-400"},Ie={key:1,class:"flex items-center gap-2 text-sm text-warning-600 dark:text-warning-400"},Me={key:2,class:"grid grid-cols-2 gap-2 text-sm"},$e={class:"font-mono"},Ve={class:"font-mono"},Ee={key:3,class:"text-sm text-muted space-y-1"},Ne={class:"flex items-center gap-2 w-full"},ze={key:0,class:"mb-4 p-4 rounded-lg border border-primary/30 bg-primary/5 space-y-3"},Ae={class:"grid grid-cols-2 gap-3"},De={class:"flex justify-end gap-2"},Re={key:1,class:"text-sm text-muted py-4 text-center"},Fe={class:"space-y-2"},We={class:"flex-1 min-w-0"},Le={class:"font-medium text-sm flex items-center gap-1.5"},Oe={class:"text-xs text-muted"},Be={key:3,class:"ml-1 text-primary text-xs"},je={class:"flex items-center gap-1"},He={key:0,class:"text-sm text-muted py-4 text-center"},qe={class:"space-y-2"},Ye={class:"flex-1 min-w-0 space-y-0.5"},Je={class:"font-medium text-sm"},Qe={class:"text-xs text-muted flex flex-wrap gap-x-3"},Xe={key:0},Ge={key:1},Ke={key:2,class:"text-warning-500"},Ze={class:"flex flex-wrap gap-1 mt-1"},et={class:"flex items-center gap-1"},yt=re({__name:"notifications",async setup(tt){let f,x;const u=de(),j=ve(),I=D(()=>j.public.authEnabled),H=["PIWI_SMTP_HOST","PIWI_SMTP_PORT","PIWI_SMTP_USER","PIWI_SMTP_PASS","PIWI_SMTP_FROM","PIWI_SMTP_FROM_NAME","PIWI_SMTP_SECURE"],{data:m}=([f,x]=A(()=>F("/api/settings/smtp","$v5NL0FLSog")),f=await f,x(),f),h=k(""),M=k(!1);async function q(){if(h.value){M.value=!0;try{const o=await $fetch("/api/settings/smtp/test",{method:"POST",body:{to:h.value}});o.success?u.add({title:"Test email sent",description:`Check ${h.value}`,color:"success"}):u.add({title:"Send failed",description:o.error||"Unknown error",color:"error"})}catch(o){u.add({title:"Send failed",description:String(o?.message??o),color:"error"})}finally{M.value=!1}}}const{data:Y,refresh:W}=I.value?([f,x]=A(()=>F("/api/channels","$rT8YNpmgfl")),f=await f,x(),f):{data:k(null),refresh:()=>{}},$=D(()=>Y.value?.channels??[]),b=k(!1),n=ye({name:"",type:"email",address:"",webhookUrl:"",url:"",secret:"",global:!1}),V=k(!1),E=k(null),J=[{label:"Email",value:"email"},{label:"Slack webhook",value:"slack"},{label:"Webhook",value:"webhook"}];async function Q(){V.value=!0;try{const o={};n.type==="email"?o.address=n.address:n.type==="slack"?o.webhookUrl=n.webhookUrl:n.type==="webhook"&&(o.url=n.url,n.secret&&(o.secret=n.secret)),await $fetch("/api/channels",{method:"POST",body:{name:n.name,type:n.type,config:o,global:n.global}}),b.value=!1,Object.assign(n,{name:"",type:"email",address:"",webhookUrl:"",url:"",secret:"",global:!1}),await W(),u.add({title:"Channel created",color:"success"})}catch(o){u.add({title:"Failed to create channel",description:String(o?.message??o),color:"error"})}finally{V.value=!1}}async function X(o){try{await $fetch(`/api/channels/${o}`,{method:"DELETE"}),await W(),u.add({title:"Channel deleted",color:"success"})}catch(e){u.add({title:"Failed to delete channel",description:String(e?.message??e),color:"error"})}}async function G(o){E.value=o;try{const e=await $fetch(`/api/channels/${o}/test`,{method:"POST"});e.success?u.add({title:"Test notification sent",color:"success"}):u.add({title:"Test failed",description:e.error,color:"error"})}catch(e){u.add({title:"Test failed",description:String(e?.message??e),color:"error"})}finally{E.value=null}}const{data:K,refresh:L}=I.value?([f,x]=A(()=>F("/api/subscriptions","$J_5QzL_eLh")),f=await f,x(),f):{data:k(null),refresh:()=>{}},N=D(()=>K.value?.subscriptions??[]);async function Z(o){try{await $fetch(`/api/subscriptions/${o}`,{method:"DELETE"}),await L(),u.add({title:"Subscription removed",color:"success"})}catch(e){u.add({title:"Failed to remove subscription",description:String(e?.message??e),color:"error"})}}async function ee(o){const e=o.mutedUntil&&new Date(o.mutedUntil)>new Date;try{await $fetch(`/api/subscriptions/${o.id}`,{method:"PATCH",body:{mutedUntil:e?null:new Date(Date.now()+10080*60*1e3).toISOString()}}),await L(),u.add({title:e?"Unmuted":"Muted for 7 days",color:"success"})}catch(U){u.add({title:"Failed to update subscription",description:String(U?.message??U),color:"error"})}}function P(o){return o.mutedUntil&&new Date(o.mutedUntil)>new Date}function O(o){return o==="personal_email"?"i-lucide-user-round":o==="email"?"i-lucide-mail":o==="slack"?"i-lucide-slack":"i-lucide-webhook"}function te(o){return o.replace(/\./g," › ")}return(o,e)=>{const U=ie,C=fe,se=he,oe=ke,S=ue,g=pe,z=xe,w=be,le=Se,B=_e,ne=we,ae=Te;return l(),r("div",Pe,[a(z,{icon:"i-lucide-mail",title:"SMTP email delivery",help:"settings.smtp"},ce({subtitle:d(()=>[e[9]||(e[9]=c(" Configure SMTP via environment variables. The connection cannot be changed here. ",-1))]),actions:d(()=>[s(m)?.configured?(l(),v(U,{key:0,"env-vars":H,size:"md"})):_("",!0)]),default:d(()=>[i("div",Ue,[s(m)?.configured?(l(),r("div",Ce,[a(C,{name:"i-lucide-circle-check-big",class:"size-4"}),e[10]||(e[10]=c(" Configured ",-1))])):(l(),r("div",Ie,[a(C,{name:"i-lucide-circle-alert",class:"size-4"}),e[11]||(e[11]=c(" Not configured ",-1))])),s(m)?.configured?(l(),r("div",Me,[e[12]||(e[12]=i("div",{class:"text-muted"},"Host",-1)),i("div",$e,p(s(m)?.host)+":"+p(s(m)?.port),1),e[13]||(e[13]=i("div",{class:"text-muted"},"From",-1)),i("div",null,p(s(m)?.fromName?`${s(m).fromName} <${s(m).from}>`:s(m)?.from),1),e[14]||(e[14]=i("div",{class:"text-muted"},"User",-1)),i("div",Ve,p(s(m)?.user),1),e[15]||(e[15]=i("div",{class:"text-muted"},"TLS",-1)),i("div",null,p(s(m)?.secure?"Yes (port 465)":"STARTTLS / plain"),1)])):_("",!0),s(m)?.configured?_("",!0):(l(),r("div",Ee,[e[16]||(e[16]=i("p",null,"Set these environment variables to enable email notifications:",-1)),a(se,{code:`PIWI_SMTP_HOST=smtp.example.com
2
2
  PIWI_SMTP_PORT=465
3
3
  PIWI_SMTP_USER=user@example.com
4
4
  PIWI_SMTP_PASS=secret
@@ -0,0 +1,5 @@
1
+ import{d as pe,b as Je,o,f as F,g as A,j as k,_ as Ie,m as P,i as p,k as t,l as Le,r as G,K as xt,h as L,A as ze,c as u,P as vt,V as Oe,ae as bt,S as _e,C as $e,p as we,q as me,v as C,t as _,F as te,L as kt,y as ge,s as Pe,H as at,J as Ee,af as Ae,B as rt,E as _t,R as et,I as We,ac as Re,G as $t,W as Ne,ag as Se,T as wt,ad as Ct,ah as Tt,ai as St,aj as At,a0 as Lt,a1 as Rt}from"./C5TrTuWv.js";import{_ as it,a as It}from"./B69RP95P.js";import{_ as zt}from"./BrUBOQ0y.js";import{u as Pt}from"./CsV7pmcT.js";import{a as He,u as Ue}from"./T5UuMUxA.js";import{e as lt,u as Bt,v as Et,f as Ye,w as ct,n as Me,x as Ot}from"./DMtrFQqi.js";import{_ as Ge}from"./BBhrClA9.js";import{_ as je}from"./DMAiMrNr.js";import{_ as Mt}from"./6Z_ZwH8I.js";import{_ as Nt}from"./DhYznn-U.js";import{_ as Ut}from"./DuOH5jcQ.js";import{_ as jt}from"./B1LUinhp.js";import{u as Dt,i as Kt,b as Vt}from"./CX_G-FHC.js";import{f as Ht}from"./D-c8ZSws.js";import{_ as ut}from"./D0Kop4bS.js";import{_ as Ft}from"./C8Paf_V1.js";const qt={class:"w-64 p-1 space-y-0.5"},Zt={class:"flex items-center justify-between px-2 pt-1 pb-1"},Wt=pe({__name:"ExportMenu",props:{endpoint:{},baseName:{}},setup(e){const r=e,{download:a}=Pt(),{copy:c}=He(),n=Je(),s=G(!1),l=G(""),f=L(()=>(ze().app?.baseURL??"/").replace(/\/$/,""));function i(T){return`${f.value}${T}`}async function m(T){s.value=!1,await a(i(`${r.endpoint}?format=${T}`),`${r.baseName}.${T}`,{binary:T==="zip"})}function v(){s.value=!1,window.open(i(`${r.endpoint}?format=html&print=1`),"_blank")}async function R(T,$,S){l.value=$;try{const K=await fetch(i(T));if(!K.ok)throw new Error(`Request failed (${K.status})`);const M=await K.text();c(S?S(M):M,{toast:`${$} copied`}),s.value=!1}catch(K){n.add({title:`Could not copy ${$.toLowerCase()}`,description:lt(K),color:"error"})}finally{l.value=""}}function g(){return R(`${r.endpoint}?format=md`,"Report")}return(T,$)=>{const S=Ie,K=it,M=zt,Z=xt;return o(),F(Z,{open:t(s),"onUpdate:open":$[4]||($[4]=E=>Le(s)?s.value=E:null)},{content:A(()=>[p("div",qt,[p("div",Zt,[$[6]||($[6]=p("p",{class:"text-xs font-medium text-gray-500"},"Download",-1)),k(K,{topic:"export.offline"})]),k(S,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-file-code",title:"One self-contained HTML file with screenshots and video embedded",onClick:$[0]||($[0]=E=>m("html"))},{default:A(()=>[...$[7]||($[7]=[P(" HTML — single file ",-1)])]),_:1}),k(S,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-file-archive",title:"Report plus the raw artifacts, including trace archives and data.json",onClick:$[1]||($[1]=E=>m("zip"))},{default:A(()=>[...$[8]||($[8]=[P(" ZIP — with all evidence ",-1)])]),_:1}),k(S,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-printer",title:"Opens the report with your browser's print dialog, for Save as PDF",onClick:v},{default:A(()=>[...$[9]||($[9]=[P(" PDF — via print ",-1)])]),_:1}),k(S,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-file-text",title:"The Markdown report as a file",onClick:$[2]||($[2]=E=>m("md"))},{default:A(()=>[...$[10]||($[10]=[P(" Markdown ",-1)])]),_:1}),k(S,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-file-json",title:"Everything the report contains, machine-readable",onClick:$[3]||($[3]=E=>m("json"))},{default:A(()=>[...$[11]||($[11]=[P(" JSON ",-1)])]),_:1}),k(M,{class:"my-1"}),$[13]||($[13]=p("p",{class:"text-xs font-medium text-gray-500 px-2 pt-1 pb-1"},"Copy to clipboard",-1)),k(S,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-clipboard-list",loading:t(l)==="Report",title:"The whole investigation as Markdown, for an issue or a chat",onClick:g},{default:A(()=>[...$[12]||($[12]=[P(" Report (Markdown) ",-1)])]),_:1},8,["loading"])])]),default:A(()=>[k(S,{icon:"i-lucide-share",size:"xs",color:"neutral",variant:"outline",title:"Take this investigation away"},{default:A(()=>[...$[5]||($[5]=[P(" Export ",-1)])]),_:1})]),_:1},8,["open"])}}}),ja=Object.assign(Wt,{__name:"ExportMenu"}),Jt={class:"flex items-center justify-between gap-2"},Yt=["aria-expanded","title"],Gt={class:"text-lg font-medium inline-flex items-center gap-1 shrink-0"},Qt={key:2,class:"min-w-0 flex-1 truncate text-sm text-gray-500 dark:text-gray-400"},Xt={key:0,class:"flex items-center gap-1 shrink-0"},en={key:0,class:"text-sm text-gray-500 mt-1 ml-11"},tn=pe({__name:"CollapsibleSectionCard",props:{title:{},icon:{},subtitle:{},count:{},iconClass:{default:"text-primary"},help:{},storageKey:{},defaultFolded:{type:Boolean,default:!0}},setup(e,{expose:r}){const a=e,{folded:c,toggle:n,setFolded:s}=Dt(`piwi-section-fold-${a.storageKey}`,a.defaultFolded),l=G(null);function f(){s(!1),kt(()=>l.value?.scrollIntoView({behavior:"smooth",block:"start"}))}return r({setFolded:s,reveal:f}),(i,m)=>{const v=we,R=it,g=Ft;return o(),u("div",{ref_key:"rootEl",ref:l,class:"scroll-mt-4"},[k(g,{ui:{header:"p-3 sm:px-4 sm:py-3",body:t(c)?"p-0 sm:p-0":""},class:me(t(c)&&"divide-y-0")},{header:A(()=>[p("div",Jt,[p("div",{class:"flex items-center gap-2 min-w-0 flex-1 cursor-pointer select-none rounded-sm outline-none focus-visible:outline-2 focus-visible:outline-primary",role:"button",tabindex:"0","aria-expanded":!t(c),title:t(c)?"Expand section":"Collapse section",onClick:m[1]||(m[1]=(...T)=>t(n)&&t(n)(...T)),onKeydown:[m[2]||(m[2]=_e((...T)=>t(n)&&t(n)(...T),["enter"])),m[3]||(m[3]=_e($e((...T)=>t(n)&&t(n)(...T),["prevent"]),["space"]))]},[k(v,{name:t(c)?"i-lucide-chevron-right":"i-lucide-chevron-down",class:"size-4 shrink-0 text-gray-400"},null,8,["name"]),e.icon?(o(),F(v,{key:0,name:e.icon,class:me(["size-5 shrink-0",e.iconClass])},null,8,["name","class"])):C("",!0),p("h3",Gt,[P(_(e.title),1),e.count!=null?(o(),u(te,{key:0},[P(" ("+_(e.count)+")",1)],64)):C("",!0)]),e.help?(o(),u("span",{key:1,onClick:m[0]||(m[0]=$e(()=>{},["stop"]))},[k(R,{topic:e.help},null,8,["topic"])])):C("",!0),t(c)&&i.$slots.folded?(o(),u("span",Qt,[Oe(i.$slots,"folded")])):C("",!0)],40,Yt),i.$slots.actions?(o(),u("div",Xt,[Oe(i.$slots,"actions")])):C("",!0)]),!t(c)&&(e.subtitle||i.$slots.subtitle)?(o(),u("p",en,[Oe(i.$slots,"subtitle",{},()=>[P(_(e.subtitle),1)])])):C("",!0)]),default:A(()=>[vt(p("div",null,[Oe(i.$slots,"default")],512),[[bt,!t(c)]])]),_:3},8,["ui","class"])],512)}}}),De=Object.assign(tn,{__name:"CollapsibleSectionCard"}),nn=/('(?:\\.|[^'])*'|"(?:\\.|[^"])*")|([A-Za-z_$][\w$]*)(?=\s*\()|([A-Za-z_$][\w$]*)(?=\s*:)|(true|false|null|\d+)|([{}(),.])/g;function on(e){const r=[],a=new RegExp(nn.source,"g");let c=0,n;for(;(n=a.exec(e))!==null;){n.index>c&&r.push({kind:"plain",text:e.slice(c,n.index)});const s=n[1]?"string":n[2]?"method":n[3]?"option":n[4]?"literal":"punctuation";r.push({kind:s,text:n[0]}),c=a.lastIndex}return c<e.length&&r.push({kind:"plain",text:e.slice(c)}),r}const sn=["title"],an=pe({__name:"LocatorCode",props:{locator:{},truncate:{type:Boolean,default:!1}},setup(e){const r=e,a={method:"text-violet-700 dark:text-violet-300",string:"text-green-700 dark:text-green-300",option:"text-blue-700 dark:text-blue-300",literal:"text-amber-700 dark:text-amber-300",punctuation:"text-gray-500 dark:text-gray-400",plain:""},c=L(()=>on(r.locator));return(n,s)=>(o(),u("code",{class:me(["font-mono",e.truncate?"block truncate":"break-words"]),title:e.locator},[(o(!0),u(te,null,ge(t(c),(l,f)=>(o(),u("span",{key:f,class:me(a[l.kind])},_(l.text),3))),128))],10,sn))}}),Qe=Object.assign(an,{__name:"LocatorCode"}),rn={class:"overflow-x-auto text-xs font-mono"},ln=pe({__name:"DiffPatch",props:{patch:{}},setup(e){return(r,a)=>(o(),u("div",rn,[(o(!0),u(te,null,ge(("parsePatchLines"in r?r.parsePatchLines:t(Et))(e.patch),(c,n)=>(o(),u("div",{key:n,class:me(["px-3 py-px whitespace-pre leading-5 min-w-0",("patchLineClass"in r?r.patchLineClass:t(Bt))[c.type]])},_(c.text||" "),3))),128))]))}}),cn=Object.assign(ln,{__name:"DiffPatch"}),un=["role","aria-checked","tabindex"],dn={class:"flex-1 min-w-0"},pn={key:0,class:"text-[11px] leading-4 text-gray-500 truncate"},fn=pe({__name:"LocatorAlternativeRow",props:{alt:{},note:{default:void 0},copied:{type:Boolean,default:!1},dense:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},selected:{type:Boolean,default:!1}},emits:["copy","select"],setup(e){const r=e;function a(s){return s>=80?"success":s>=50?"warning":"error"}function c(s){const{method:l,score:f,args:i}=s;return i&&(i.anchorTestId||i.anchorSelector||i.anchorRole)?"scoped to a stable ancestor — survives renames":f>=100?"most stable — purpose-built for testing":l==="getByRole"&&i&&!("name"in i)?"name-free role — survives renames":l==="getByRole"?"browser ARIA tree — semantic and stable":l==="getByLabel"?"associated <label> element":l==="getByPlaceholder"?"input placeholder":l==="getByText"?"visible text":l==="getByAltText"?"image alt text":l==="getByTitle"?"title attribute":l==="locator"&&f>=50?"stable selector":l==="locator"?"CSS class — may be fragile":""}const n=L(()=>r.note??c(r.alt));return(s,l)=>{const f=Pe,i=Qe,m=we,v=Ie;return o(),u("div",{class:me(["flex items-center gap-2 rounded border",[e.dense?"py-1 px-2":"py-1.5 px-2.5",e.selectable?"cursor-pointer hover:bg-elevated transition-colors focus-visible:outline-2 focus-visible:outline-primary":"",e.selectable&&e.selected?"border-primary/60 ring-1 ring-primary/50":"border-default/50"]]),role:e.selectable?"radio":void 0,"aria-checked":e.selectable?e.selected:void 0,tabindex:e.selectable?0:void 0,onClick:l[1]||(l[1]=R=>e.selectable&&s.$emit("select")),onKeydown:[l[2]||(l[2]=_e($e(R=>e.selectable&&s.$emit("select"),["prevent"]),["enter"])),l[3]||(l[3]=_e($e(R=>e.selectable&&s.$emit("select"),["prevent"]),["space"]))]},[k(f,{size:"xs",color:a(e.alt.score),variant:"subtle",class:me(["shrink-0 font-mono tabular-nums cursor-default text-center",e.dense?"min-w-[2.25rem]":"min-w-[2.5rem]"]),title:`Stability score: ${e.alt.score}/100`},{default:A(()=>[P(_(e.alt.score),1)]),_:1},8,["color","class","title"]),p("div",dn,[k(i,{locator:e.alt.locator,truncate:"",class:"text-xs"},null,8,["locator"]),t(n)?(o(),u("p",pn,_(t(n)),1)):C("",!0)]),e.alt.pickedByUser&&e.dense?(o(),F(m,{key:0,name:"i-lucide-user-check",class:"size-3.5 text-primary shrink-0",title:"Confirmed with the locator picker"})):e.alt.pickedByUser?(o(),F(f,{key:1,size:"xs",color:"primary",variant:"subtle",icon:"i-lucide-user-check",class:"shrink-0",title:"Confirmed with the locator picker on the failing page"})):C("",!0),k(v,{size:"xs",variant:"ghost",color:"neutral",icon:e.copied?"i-lucide-check":"i-lucide-copy",title:e.copied?"Copied!":"Copy",class:"shrink-0",onClick:l[0]||(l[0]=$e(R=>s.$emit("copy"),["stop"]))},null,8,["icon","title"])],42,un)}}}),dt=Object.assign(fn,{__name:"LocatorAlternativeRow"}),tt={getByTestId:"testid",getByRole:"semantic",getByLabel:"label",getByPlaceholder:"label",getByText:"text",getByAltText:"text",getByTitle:"text",locator:"css","page.locator":"css"},mn=50;function pt(e,r,a=mn){const c=r[0]??null;if(!c)return{recommended:null,durable:null,preservesConvention:!1,hasDurableAlternative:!1,suggestAddTestId:!1};const n=e?tt[e]:void 0,s=(e?r.find(i=>i.method===e&&i.score>=a):void 0)??(n?r.find(i=>tt[i.method]===n&&i.score>=a):void 0),f=r.find(i=>i.pickedByUser)??s??c;return{recommended:f,durable:c,preservesConvention:!!s&&f===s,hasDurableAlternative:f.locator!==c.locator,suggestAddTestId:c.score<a}}const ft={a:"link",button:"button",nav:"navigation",main:"main",article:"article",section:"region",form:"form",img:"img",figure:"figure",figcaption:"caption",blockquote:"blockquote",table:"table",caption:"caption",thead:"rowgroup",tbody:"rowgroup",tfoot:"rowgroup",tr:"row",td:"cell",ul:"list",ol:"list",li:"listitem",dialog:"dialog",output:"status",progress:"progressbar",meter:"meter",textarea:"textbox",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",details:"group",summary:"button",search:"search"},gn={button:"button",submit:"button",reset:"button",image:"button",checkbox:"checkbox",radio:"radio",range:"slider",search:"searchbox",number:"spinbutton",text:"textbox",email:"textbox",tel:"textbox",url:"textbox",password:"textbox"},hn=["id","class","name","data-testid","placeholder","alt","title","aria-label","aria-level","role","type","href","multiple"];function yn(e){const r=e.attributes.role;if(r)return r;const a=e.tagName;if(!a)return null;if(a==="input"){const c=(e.attributes.type??"text").toLowerCase();return gn[c]??"textbox"}return a==="select"?e.attributes.multiple!=null?"listbox":"combobox":a==="a"?e.attributes.href!=null?"link":null:ft[a]??null}function xn(e,r){if(r!=="heading")return null;const a=e.tagName.match(/^h([1-6])$/);if(a)return Number(a[1]);const c=e.attributes["aria-level"];return c&&/^\d+$/.test(c)?Number(c):null}const Ce=(e,r)=>e.attributes[r]||null,xe=e=>e.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),Ve=e=>e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),nt=e=>/^[A-Za-z][A-Za-z0-9_-]*$/.test(e);function vn(e){return/[a-f0-9]{8,}/i.test(e)?10:/^(?:css|sc|emotion|styled)-/i.test(e)?15:/^(bg|text|border|shadow|opacity|font|w-|h-|m[tblrxy]?-|p[tblrxy]?-|flex|grid|gap|rounded|absolute|relative|fixed|sticky|block|inline|hidden|overflow|z-|top-|right-|bottom-|left-|inset-|justify-|items-|self-|content-|order-|col-|row-)/.test(e)?25:/__/.test(e)||/--/.test(e)?35:/^[a-z]+(-[a-z]+)+$/.test(e)||/^[a-z]+[A-Z][a-zA-Z]+$/.test(e)?40:(e.includes("_")||/^[a-z]+-[a-z0-9]{5,}$/.test(e)&&/[0-9]/.test(e),15)}function ot(e){return!!(/^[a-f0-9]{8}-([a-f0-9]{4}-){3}[a-f0-9]{12}$/i.test(e)||/^[a-f0-9]{8,}$/i.test(e)||/^[a-z]+-\d{4,}$/.test(e)||/^(tab|panel|input|select|option|dialog|modal|popup|tooltip|menu|listbox|combobox|checkbox|radio|textarea|button|field|label|accordion|collapse|step|slider|toggle|switch|dropdown|overlay|portal|layer)-\d+$/i.test(e)||/^(emotion-|styled-|css-|sc-)/.test(e)||e.startsWith("ng-")||/^(radix-|headlessui-|mui-|mantine-|chakra-)/i.test(e)||/^:r[0-9a-z]+:$/i.test(e)||/^«r[0-9a-z]+»$/i.test(e))}const bn=new Set(["data-test","data-test-id","data-qa","data-qa-id","data-cy","data-e2e"]);function kn(e){const r=[],a=new Set,c=h=>{a.has(h.locator)||(a.add(h.locator),r.push(h))},{accessibleName:n}=e,s=e.tagName,l=yn(e),f=e.selectorCounts,i=h=>h==null||h<=1,m=h=>h!=null&&h>1?45:0,v=e.textContent?e.textContent.replace(/\s+/g," ").trim():null,R=Ce(e,"data-testid");R&&i(f?.testId)&&c({locator:`getByTestId('${xe(R)}')`,method:"getByTestId",args:{testId:R},score:100});const g=xn(e,l),T=g!=null?`, level: ${g}`:"",$=h=>g!=null?{...h,level:g}:h;l&&n&&c({locator:`getByRole('${l}', { name: '${xe(n)}'${T} })`,method:"getByRole",args:$({role:l,name:n}),score:90-m(f?.roleName)});const S=Ce(e,"aria-label");if(l&&S&&S!==n&&c({locator:`getByRole('${l}', { name: '${xe(S)}'${T} })`,method:"getByRole",args:$({role:l,name:S}),score:85-m(f?.roleName)}),n&&["input","select","textarea"].includes(s)){const h=Ce(e,"aria-label");(e.hasLabel===void 0||e.hasLabel===!0||h===n)&&c({locator:`getByLabel('${xe(n)}')`,method:"getByLabel",args:{label:n},score:85})}const K=Ce(e,"placeholder");K&&c({locator:`getByPlaceholder('${xe(K)}')`,method:"getByPlaceholder",args:{placeholder:K},score:80-m(f?.placeholder)}),v&&v.length<80&&c({locator:`getByText('${xe(v)}')`,method:"getByText",args:{text:v},score:75-m(f?.text)});const M=Ce(e,"id");if(M&&!ot(M)&&i(f?.id)){const h=nt(M)?`#${M}`:`[id="${Ve(M)}"]`;c({locator:`locator('${xe(h)}')`,method:"locator",args:{selector:h},score:65})}const Z=Ce(e,"name");if(Z&&i(f?.name)){const h=`[name="${Ve(Z)}"]`;c({locator:`locator('${xe(h)}')`,method:"locator",args:{selector:h},score:60})}const E=Ce(e,"alt");E&&c({locator:`getByAltText('${xe(E)}')`,method:"getByAltText",args:{text:E},score:60-m(f?.alt)});const W=Ce(e,"title");W&&c({locator:`getByTitle('${xe(W)}')`,method:"getByTitle",args:{title:W},score:50-m(f?.title)});const J=!!(R&&i(f?.testId)),x=(h,V,O)=>{let N=!1,Q=!1,ve=!1,he=!1,ue=!1;for(const Y of e.ancestors??[]){if(V(Y)!==1)continue;if(!N&&Y.testId&&Y.testIdCount===1&&(N=!0,c({locator:`getByTestId('${xe(Y.testId)}').${h.expr}`,method:h.method,args:{...h.args,anchorTestId:Y.testId},score:O.testId})),!Q&&Y.id&&!ot(Y.id)&&Y.idCount===1){Q=!0;const B=nt(Y.id)?`#${Y.id}`:`[id="${Ve(Y.id)}"]`;c({locator:`locator('${xe(B)}').${h.expr}`,method:h.method,args:{...h.args,anchorSelector:B},score:O.id})}if(!he&&Y.dataAttr&&Y.dataAttrCount===1){he=!0;const{name:B,value:ae}=Y.dataAttr,w=`[${B}="${Ve(ae)}"]`;c({locator:`locator('${xe(w)}').${h.expr}`,method:h.method,args:{...h.args,anchorSelector:w},score:bn.has(B)?O.testData:O.data})}const de=Y.role||ft[Y.tag]||null;!ve&&de&&de!==h.role&&Y.roleCount===1&&(ve=!0,c({locator:`getByRole('${xe(de)}').${h.expr}`,method:h.method,args:{...h.args,anchorRole:de},score:O.role})),!ue&&de&&Y.filterText&&Y.filterRoleCount===1&&(ue=!0,c({locator:`getByRole('${xe(de)}').filter({ hasText: '${xe(Y.filterText)}' }).${h.expr}`,method:h.method,args:{...h.args,anchorRole:de,anchorHasText:Y.filterText},score:O.filter}))}};if(l&&!J){const h=g!=null?`'${l}', { level: ${g} }`:`'${l}'`,V=$({role:l});x({expr:`getByRole(${h})`,method:"getByRole",args:V,role:l},N=>N.scopedRoleCount,{testId:72,testData:70,id:64,data:60,role:55,filter:53});const O=e.rolePosition;O&&O.role===l&&(O.count===1||g!=null&&O.levelCount===1)&&c({locator:`getByRole(${h})`,method:"getByRole",args:V,score:58})}else!l&&v&&v.length<80&&!J&&x({expr:`getByText('${xe(v)}')`,method:"getByText",args:{text:v},role:null},h=>h.scopedTextCount,{testId:68,testData:66,id:60,data:56,role:51,filter:49});const j=Ce(e,"class");if(j){const h=f?.classes,V=j.split(/\s+/).filter(O=>O.length>1&&/^[A-Za-z_-][A-Za-z0-9_-]*$/.test(O)&&i(h?.[O])).map(O=>({cls:O,score:vn(O)})).sort((O,N)=>N.score-O.score).slice(0,3);for(const{cls:O,score:N}of V)c({locator:`locator('.${xe(O)}')`,method:"locator",args:{selector:`.${O}`},score:N})}return r.sort((h,V)=>V.score-h.score)}function _n(e){const r=e.attributes,a=r["aria-label"];if(a)return a;if(e.textContent)return e.textContent;const c=r.title;if(c)return c;const n=r.placeholder;return n||null}function $n(e,r){const{keep:a,tagRoles:c,inputRoles:n,roleSources:s,includeStructural:l,includeLabelText:f}=r,i={};for(const S of a){const K=e.getAttribute(S)??e[S];i[S]=typeof K=="string"?K.slice(0,200):K?String(K).slice(0,200):null}const m=e.getBoundingClientRect(),v={};try{const S=e.ownerDocument,K=E=>S.defaultView.CSS.escape(E),M=E=>{try{return S.querySelectorAll(E).length}catch{return}};i["data-testid"]&&(v.testId=M(`[data-testid=${JSON.stringify(i["data-testid"])}]`)),i.id&&(v.id=M(`#${K(i.id)}`)),i.name&&(v.name=M(`[name=${JSON.stringify(i.name)}]`)),i.placeholder&&(v.placeholder=M(`[placeholder=${JSON.stringify(i.placeholder)}]`)),i.alt&&(v.alt=M(`[alt=${JSON.stringify(i.alt)}]`)),i.title&&(v.title=M(`[title=${JSON.stringify(i.title)}]`));const Z=(i.class||"").split(/\s+/).filter(E=>E.length>1).slice(0,10);if(Z.length>0){const E={};for(const W of Z){const J=M(`.${K(W)}`);J!==void 0&&(E[W]=J)}v.classes=E}}catch{}let R=null;const g=[];if(l&&c&&n&&s)try{const S=e.ownerDocument,K=B=>S.defaultView.CSS.escape(B),M=B=>{try{return S.querySelectorAll(B).length}catch{return}},Z=new Map,E=new Map,W=B=>{const ae=Z.get(B);if(ae!==void 0)return ae;let w;const d=B.getAttribute("role");if(d)w=d;else{const q=(B.tagName||"").toLowerCase();q==="input"?w=n[(B.getAttribute("type")||"text").toLowerCase()]??"textbox":q==="select"?w=B.getAttribute("multiple")!=null?"listbox":"combobox":q==="a"?w=B.getAttribute("href")!=null?"link":null:w=c[q]??null}return Z.set(B,w),w},J=B=>{const ae=/^h([1-6])$/.exec((B.tagName||"").toLowerCase());if(ae)return Number(ae[1]);const w=B.getAttribute("aria-level");return w&&/^\d+$/.test(w)?Number(w):null},x=W(e),j=x==="heading"?J(e):null,h=B=>{const ae=B.getAttribute("aria-label");if(ae)return ae;const w=(B.textContent||"").replace(/\s+/g," ").trim();return w||B.getAttribute("title")||B.getAttribute("placeholder")||null},V=h(e),O=(e.textContent||"").replace(/\s+/g," ").trim(),N=O?O.toLowerCase():null,Q=B=>{const ae=E.get(B);if(ae!==void 0)return ae;const w=(B.textContent||"").replace(/\s+/g," ").trim().toLowerCase();return E.set(B,w),w},ve=2,he=(B,ae)=>{if(!N)return-1;const w=B.querySelectorAll("*");if(w.length>ae)return-1;let d=0;for(let q=0;q<w.length;q++){const ne=w[q];if(Q(ne).indexOf(N)===-1)continue;let y=!1;const z=ne.children;for(let D=0;D<z.length;D++)if(Q(z[D]).indexOf(N)!==-1){y=!0;break}if(y||d++,d>=ve)return d}return d},ue=S.querySelectorAll(s),Y=ue.length<=4e3,de=!!x&&Y;if(de){let B=0,ae=-1,w=0,d=0;for(let q=0;q<ue.length;q++){const ne=ue[q];W(ne)===x&&(ne===e&&(ae=B),B++,j!=null&&J(ne)===j&&w++,V!=null&&h(ne)===V&&d++)}V!=null&&(v.roleName=d),ae!==-1&&(R={role:x,count:B,index:ae,...j!=null?{levelCount:w}:{}})}if(N){const B=he(S.body||S.documentElement,4e3);B>=0&&(v.text=B)}if(de||N){const B=["form","nav","main","article","section","dialog","table","li","tr"],ae=/^data-(v-[0-9a-f]+|reactid|react-checksum|svelte-\w+|ng-\w+|ember\w*)$/i,w=/^data-(index|idx|i|key|row|rownum|col|column|position|pos|order|sort|offset|page)$/i,d=["data-test","data-test-id","data-qa","data-qa-id","data-cy","data-e2e"],q=(U,se)=>!U||U.slice(0,5)!=="data-"||U==="data-testid"||ae.test(U)||w.test(U)?!1:!!se&&se.length<=120,ne=U=>{const se=U.attributes;if(!se)return null;let le=null;for(let fe=0;fe<se.length;fe++){const ce=se[fe].name,ye=se[fe].value;if(q(ce,ye)){if(d.indexOf(ce.toLowerCase())!==-1)return{name:ce,value:ye};le||(le={name:ce,value:ye})}}return le},y=U=>{let se=0;for(let le=0;le<ue.length;le++)W(ue[le])===U&&se++;return se},z=U=>(U.textContent||"").replace(/\s+/g," ").trim(),D=U=>{const se=U.replace(/[^A-Za-z]/g,"").length;return se<2?!1:U.replace(/[^0-9]/g,"").length<=se},H=U=>!!U&&U.length<=60&&U!==O&&D(U),re=U=>{const se=U.querySelector('h1,h2,h3,h4,h5,h6,[role="heading"]');if(se){const fe=z(se);if(H(fe))return fe}const le=U.querySelectorAll("*");if(le.length>200)return null;for(let fe=0;fe<le.length;fe++){const ce=le[fe];if(ce===e||ce.children.length>0)continue;const ye=z(ce);if(H(ye))return ye}return null},X=(U,se)=>{const le=se.toLowerCase();let fe=0;for(let ce=0;ce<ue.length;ce++)W(ue[ce])===U&&Q(ue[ce]).indexOf(le)!==-1&&fe++;return fe};let oe=e.parentElement,ee=0;for(;oe&&ee<12&&g.length<4;){ee++;const U=(oe.tagName||"").toLowerCase();if(U==="body"||U==="html")break;const se=oe.getAttribute("data-testid"),le=oe.getAttribute("id"),fe=oe.getAttribute("role"),ce=oe.getAttribute("aria-label"),ye=fe||(B.includes(U)?c[U]:null)||null,Te=ne(oe);if(se||le||ye||ce||Te){let I=-1;if(de){const be=oe.querySelectorAll(s);if(be.length<=2e3){I=0;for(let Be=0;Be<be.length;Be++){const Ke=be[Be];W(Ke)===x&&(j!=null&&J(Ke)!==j||I++)}}}const b=he(oe,2e3);let ie=null;try{ye&&Y&&(ie=re(oe))}catch{ie=null}g.push({tag:U,depth:ee,testId:se||null,id:le||null,role:fe||null,ariaLabel:ce||null,...I>=0?{scopedRoleCount:I}:{},...b>=0?{scopedTextCount:b}:{},...se?{testIdCount:M(`[data-testid=${JSON.stringify(se)}]`)}:{},...le?{idCount:M(`#${K(le)}`)}:{},...ye&&Y?{roleCount:y(ye)}:{},...ie?{filterText:ie,filterRoleCount:X(ye,ie)}:{},...Te?{dataAttr:Te,dataAttrCount:M(`[${Te.name}=${JSON.stringify(Te.value)}]`)}:{}})}oe=oe.parentElement}}}catch{}const T=!!(e.labels&&e.labels.length>0),$=f?T&&(e.labels[0].textContent||"").replace(/\s+/g," ").trim().slice(0,120)||null:void 0;return{tagName:e.tagName?.toLowerCase?.()??"unknown",attributes:i,textContent:(e.textContent||"").replace(/\s+/g," ").trim().slice(0,80),center:{x:Math.round(m.x+m.width/2),y:Math.round(m.y+m.height/2)},hasLabel:T,...f?{labelText:$}:{},selectorCounts:v,...l?{rolePosition:R,ancestors:g}:{}}}function wn(e){const r=globalThis,a=r.document;if(!a||!a.body){e.transport==="postMessage"?r.parent.postMessage({type:"pickerClosed"},"*"):r.__piwiPickState="skipped";return}const c=2147483600,n=a.createElement("div");n.id="__piwi_picker_highlight",n.style.cssText=`position:fixed;pointer-events:none;z-index:${c};display:none;box-sizing:border-box;border:2px solid #a855f7;background:rgba(168,85,247,.14);border-radius:4px;box-shadow:0 0 0 1px rgba(255,255,255,.9),0 0 0 3px rgba(59,7,100,.55),inset 0 0 0 1px rgba(255,255,255,.5);`;const s=a.createElement("div");s.id="__piwi_picker_banner",s.style.cssText=`position:fixed;top:12px;left:50%;transform:translateX(-50%);z-index:${c+2};background:#111827;color:#f9fafb;font:13px/1.5 system-ui,sans-serif;border:1px solid #312e81;padding:10px 16px;border-radius:10px;box-shadow:0 4px 24px rgba(0,0,0,.5);max-width:min(680px,86vw);`;const l=y=>{const z=oe=>oe.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),D=/('(?:\\.|[^'])*'|"(?:\\.|[^"])*")|([A-Za-z_$][\w$]*)(?=\s*\()|([A-Za-z_$][\w$]*)(?=\s*:)|(true|false|null|\d+)|([{}(),.])/g;let H="",re=0,X;for(;(X=D.exec(y))!==null;){X.index>re&&(H+=z(y.slice(re,X.index)));const oe=X[1]?"#86efac":X[2]?"#d8b4fe":X[3]?"#93c5fd":X[4]?"#fcd34d":"#9ca3af";H+=`<span style="color:${oe}">${z(X[0])}</span>`,re=D.lastIndex}return re<y.length&&(H+=z(y.slice(re))),H},f="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace",i=y=>`<code style="font-family:${f}">${l(y)}</code>`,m=a.createElement("div");m.innerHTML=e.transport==="postMessage"?"Click an element to generate locators":e.failing?`Piwi locator picker — click the element that should replace ${i(e.failing)}`:"Piwi inspector — click any element to generate locators for it";const v=a.createElement("div");v.id="__piwi_picker_locator",v.style.cssText=`display:none;margin-top:7px;padding:5px 9px;border-radius:7px;background:#0b1120;border:1px solid #4c1d95;font:13.5px/1.55 ${f};word-break:break-word;overflow-wrap:anywhere;`;const R=a.createElement("div");R.id="__piwi_picker_foot",R.style.cssText="color:#9ca3af;margin-top:6px;font-size:12px;",R.textContent="↑ parent · ↓ child · Esc skip",s.appendChild(m),s.appendChild(v),s.appendChild(R);const g=a.createElement("div");g.id="__piwi_picker_label",g.style.cssText=`position:fixed;pointer-events:none;z-index:${c+1};display:none;box-sizing:border-box;max-width:min(620px,92vw);background:#0b1120;color:#f9fafb;border:1px solid #7c3aed;border-radius:7px;padding:4px 8px;font:12.5px/1.45 ${f};white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:0 4px 18px rgba(0,0,0,.5);`,a.body.appendChild(n),a.body.appendChild(g),a.body.appendChild(s);const T=y=>y.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),$=y=>{const z=(y.tagName||"?").toLowerCase(),D=y.getAttribute&&y.getAttribute("data-testid");if(D)return`getByTestId('${T(D)}')`;if(y.labels&&y.labels.length>0){const U=(y.labels[0].textContent||"").replace(/\s+/g," ").trim().slice(0,80);if(U)return`getByLabel('${T(U)}')`}const H=y.getAttribute&&y.getAttribute("aria-label");if(H)return`getByLabel('${T(H)}')`;const re=y.getAttribute&&y.getAttribute("placeholder");if(re)return`getByPlaceholder('${T(re)}')`;const X=y.getAttribute&&y.getAttribute("alt");if(X)return`getByAltText('${T(X)}')`;const oe=y.getAttribute&&y.getAttribute("title");if(oe)return`getByTitle('${T(oe)}')`;if(y.id)return`locator('#${T(y.id)}')`;const ee=(y.getAttribute&&y.getAttribute("class")||"").split(/\s+/).find(U=>U.length>1);return ee?`locator('.${T(ee)}')`:z},S=y=>{const z=[];let D=y;for(;D&&z.length<15;){const H=(D.tagName||"").toLowerCase();if(H==="body"||H==="html")break;z.push(D),D=D.parentElement}return z.length?z:[y]},K=["button","a","input","select","textarea","summary","option"],M=y=>{for(let z=0;z<Math.min(y.length,4);z++){const D=y[z],H=(D.tagName||"").toLowerCase();if(K.includes(H)||D.getAttribute&&(D.getAttribute("role")||D.getAttribute("data-testid")))return z}return 0},Z=y=>{const z=r.__piwiDescribeElement;if(typeof z=="function")try{const D=z(y);if(typeof D=="string"&&D)return D}catch{}return $(y)};let E=[],W=0,J=null,x=null;const j=y=>{g.style.display="block";const z=g.getBoundingClientRect(),D=r.innerWidth||a.documentElement.clientWidth||0,H=r.innerHeight||a.documentElement.clientHeight||0;let re=y.top-z.height-6;re<4&&(re=y.bottom+6),re+z.height>H-4&&(re=Math.max(4,H-z.height-4));let X=y.left;X+z.width>D-6&&(X=D-z.width-6),X<6&&(X=6),g.style.left=X+"px",g.style.top=re+"px"},h=()=>E[W]??null,V=()=>{const y=h();if(!y){n.style.display="none",g.style.display="none";return}const z=y.getBoundingClientRect();if(n.style.display="block",n.style.left=z.left+"px",n.style.top=z.top+"px",n.style.width=z.width+"px",n.style.height=z.height+"px",y!==x){x=y;const D=(y.tagName||"?").toLowerCase(),H=l(Z(y));g.innerHTML=`<span style="color:#c4b5fd">&lt;${D}&gt;</span> ${H}`,v.innerHTML=H,v.style.display="block"}j(z),R.textContent="click to pick · ↑ parent · ↓ child · Esc skip"},O=y=>{y.preventDefault(),y.stopImmediatePropagation()},N=y=>y===s||y===n||y===g||s.contains&&s.contains(y)||!!(y&&y.__piwiHint);let Q="top";const ve=y=>{Q!==y&&(Q=y,y==="bottom"?(s.style.top="auto",s.style.bottom="12px"):(s.style.top="12px",s.style.bottom="auto"))},he=y=>{const z=y.target;if(!z||N(z)){n.style.display="none",g.style.display="none";return}z!==J&&(J=z,E=S(z),W=M(E)),V();const D=h();if(D){const H=D.getBoundingClientRect(),re=s.getBoundingClientRect(),X=8;H.left<re.right+X&&H.right>re.left-X&&H.top<re.bottom+X&&H.bottom>re.top-X&&ve(Q==="top"?"bottom":"top")}},ue=["mousedown","mouseup","pointerdown","pointerup","auxclick","dblclick"],Y=()=>{a.removeEventListener("mousemove",he,!0),a.removeEventListener("click",d,!0),a.removeEventListener("keydown",q,!0),e.transport==="postMessage"&&r.removeEventListener("message",ne,!1)},de=()=>{for(const y of ue)a.removeEventListener(y,O,!0)},B=()=>{n.remove(),g.remove(),s.remove()},ae=y=>{if(Y(),n.style.display="none",g.style.display="none",e.transport==="postMessage"){const z=r.__piwiProbe,D=typeof z=="function"?z(y,e.probeArg):null;r.__piwiSnapshotExtras?.onPick?.(),a.addEventListener("click",O,!0),a.addEventListener("keydown",O,!0),R.textContent="Analyzing element…",r.parent.postMessage({type:"elementPicked",attrs:D},"*")}else de(),r.__piwiPickedElement=y,r.__piwiPickState="picked",R.textContent="Analyzing element…"},w=()=>{Y(),e.transport==="postMessage"?(a.removeEventListener("click",O,!0),a.removeEventListener("keydown",O,!0),de(),r.__piwiSnapshotExtras?.onClose?.(),B(),r.parent.postMessage({type:"pickerClosed"},"*")):(de(),r.__piwiPickState="skipped",B())},d=y=>{O(y);const z=h();!z||N(y.target)||ae(z)},q=y=>{if(y.key==="Escape"){O(y),w();return}(y.key==="ArrowUp"||y.key==="ArrowDown")&&(O(y),y.key==="ArrowUp"?W=Math.min(W+1,E.length-1):W=Math.max(W-1,0),V())},ne=y=>{const z=y.data;!z||typeof z.type!="string"||z.type!=="piwiPickerKey"||typeof z.key!="string"||q({key:z.key,preventDefault(){},stopImmediatePropagation(){}})};r.__piwiPickCleanup=B,a.addEventListener("mousemove",he,!0),a.addEventListener("click",d,!0),a.addEventListener("keydown",q,!0);for(const y of ue)a.addEventListener(y,O,!0);e.transport==="postMessage"&&(r.addEventListener("message",ne,!1),r.parent.postMessage({type:"pickerReady"},"*"))}function Cn(){var e=document,r=window,a=2147483600,c=[];function n(){for(var x=0;x<c.length;x++)c[x].parentNode&&c[x].parentNode.removeChild(c[x]);c=[]}function s(x){return(x||"").replace(/\s+/g," ").trim().toLowerCase()}function l(x){var j=s(x);if(j.length<2)return[];for(var h=e.querySelectorAll("button,a,[role],h1,h2,h3,h4,h5,h6,label,summary,input,textarea,select,option,span,li,td,th,p"),V=[],O=[],N=0;N<h.length;N++){var Q=h[N],ve=s(Q.textContent);if(!ve){var he=s(Q.getAttribute&&(Q.getAttribute("placeholder")||Q.getAttribute("aria-label"))||"");he&&(he===j||he.indexOf(j)!==-1)&&V.push(Q);continue}ve.length>120||(ve===j?V.push(Q):ve.indexOf(j)!==-1&&ve.length<j.length+30&&O.push(Q))}return V.concat(O)}function f(x,j){var h=x.getBoundingClientRect();if(h.width===0&&h.height===0)return null;var V=e.createElement("div");return V.__piwiHint=!0,V.style.cssText="position:fixed;pointer-events:none;z-index:"+(a+1)+";box-sizing:border-box;border-radius:3px;transition:opacity .3s;border:2px solid "+j+";box-shadow:0 0 0 3px "+j+"55;left:"+h.left+"px;top:"+h.top+"px;width:"+h.width+"px;height:"+h.height+"px;",e.body.appendChild(V),c.push(V),V}function i(x){var j=x.getBoundingClientRect();r.parent.postMessage({type:"piwiScrollTo",y:j.top},"*")}function m(x){if(n(),!(!x||!x.length)){for(var j=null,h=0;h<x.length;h++)for(var V=x[h],O=l(V&&V.text),N=0;N<Math.min(O.length,3);N++)f(O[N],"#f59e0b"),j||(j=O[N]);j&&i(j),setTimeout(function(){for(var Q=0;Q<c.length;Q++)c[Q].style.opacity="0"},2600),setTimeout(n,3e3)}}var v=[],R=0;function g(){r.parent.postMessage({type:"piwiSearchResult",count:v.length,index:v.length?R:-1},"*")}function T(){n();var x=v[R];x&&(f(x,"#7c3aed"),i(x),g())}function $(x){if(v=l(x),R=0,!v.length){n(),g();return}T()}function S(){v.length&&(R=(R+1)%v.length,T())}function K(x){var j=x.data;if(!(!j||typeof j.type!="string")){if(j.type==="piwiHighlight")try{m(j.hints)}catch{}else if(j.type==="piwiSearch")try{$(j.q)}catch{}else if(j.type==="piwiSearchNext")try{S()}catch{}else if(j.type==="piwiClearHints")try{n()}catch{}}}r.addEventListener("message",K,!1);function M(x){x.preventDefault(),x.stopImmediatePropagation()}for(var Z=["mousedown","mouseup","pointerdown","pointerup","auxclick","dblclick","contextmenu","submit","beforeinput","input","change","paste","cut","drop","dragstart","keypress","keyup","touchstart","touchend"],E=0;E<Z.length;E++)e.addEventListener(Z[E],M,!0);r.__piwiSnapshotExtras={onPick:function(){n()},onClose:function(){n(),r.removeEventListener("message",K,!1);for(var x=0;x<Z.length;x++)e.removeEventListener(Z[x],M,!0)}};function W(){var x=Math.max(e.documentElement?e.documentElement.scrollHeight:0,e.body?e.body.scrollHeight:0);x>0&&r.parent.postMessage({type:"piwiContentHeight",height:x},"*")}W();try{if(r.ResizeObserver){var J=new r.ResizeObserver(W);e.documentElement&&J.observe(e.documentElement),e.body&&J.observe(e.body)}}catch{}}function Tn(e){const r=[],a=new Set,c=s=>{if(typeof s!="string")return;const l=s.trim();if(l.length<2||l.length>80)return;const f=l.toLowerCase();a.has(f)||(a.add(f),r.push({text:l}))},n=s=>s&&(s.name??s.text??s.label??s.placeholder??s.alt??s.title);c(n(e.failingLocator?.args));for(const s of e.fromElementMatch??[])c(n(s.args));for(const s of e.fromAriaSnapshot??[])c(n(s.args));return r.slice(0,6)}const qe=e=>e.replace(/<\/(script)/gi,"<\\/$1");function Sn(e){const a={transport:"postMessage",probeArg:{keep:e.probedAttrs,includeStructural:!1,includeLabelText:!0}},c=qe(String($n)),n=qe(String(Cn)),s=qe(String(wn));return`<script>globalThis.__piwiProbe = (${c});(${n})();(${s})(${JSON.stringify(a)});<\/script>`}function An(e){return e.replace(/<base\b[^>]*>/gi,"")}function Ln(e,r){return An(e)+Sn(r)}const Rn={key:0,class:"flex items-center justify-center py-20"},In={key:1,class:"py-8 text-center"},zn={class:"text-xs text-gray-400 mt-1"},Pn={key:2,class:"py-8 text-center"},Bn={class:"mb-2 flex items-center gap-2 flex-wrap"},En={key:1,class:"ml-auto inline-flex rounded-md border border-default overflow-hidden text-xs"},On={key:0,class:"flex items-center gap-1 mb-1.5 text-xs text-gray-500"},Mn={class:"tabular-nums w-11 text-center select-none"},Nn={class:"ml-auto text-gray-400 tabular-nums"},Un={key:1,class:"flex items-center gap-2 mb-1.5"},jn={key:0,class:"text-xs text-gray-500 tabular-nums"},Dn={key:1,class:"text-xs text-gray-400"},Kn={key:0,class:"absolute inset-0 flex items-center justify-center bg-white dark:bg-gray-900 z-10"},Vn=["src"],Hn={key:2,class:"mt-4 space-y-3"},Fn={class:"flex items-center gap-3 bg-elevated rounded-lg p-3"},qn={class:"flex-1 min-w-0"},Zn={class:"text-sm font-medium"},Wn={class:"text-xs"},Jn={key:0,class:"text-xs text-gray-400 ml-1"},Yn={key:0,class:"text-xs text-gray-500 mt-0.5 truncate"},Gn={class:"space-y-1",role:"radiogroup","aria-label":"Alternative locators"},Qn={class:"flex-1 min-w-0"},Xn={class:"text-xs font-medium text-primary"},eo={class:"flex justify-between w-full"},to={key:1},no={class:"flex gap-2"},oo=pe({__name:"SnapshotLocatorPicker",props:We({runId:{},testRunsCaseId:{},failingLocator:{},healing:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:We(["close","confirmed"],["update:open"]),setup(e,{emit:r}){const a=e,c=r,n=at(e,"open"),s=G(!1),l=G(null),f=G(null),i=G(void 0);async function m(){s.value=!0,f.value=null;try{const I=new URLSearchParams({inlineStyles:"1"});i.value&&I.set("source",i.value);const b=`?${I.toString()}`;l.value=await $fetch(`/api/test-runs/${a.runId}/cases/${a.testRunsCaseId}/dom-snapshot${b}`),l.value?.source&&(i.value=l.value.source)}catch(I){f.value=I instanceof Error?I.message:"Unknown error"}finally{s.value=!1}}const v=L(()=>l.value?.availableSources??[]);function R(I){I===i.value||s.value||(i.value=I,$.value=!1,g.value="pick-element",J.value=0,j.value=!1,S.value=null,K.value=[],H.value=null,w.value="",d.value=0,q.value=-1,m())}Ee(n,I=>{I&&(l.value=null,$.value=!1,g.value="pick-element",J.value=0,j.value=!1,i.value=void 0,S.value=null,K.value=[],H.value=null,w.value="",d.value=0,q.value=-1,m())});const g=G("pick-element"),T=G(null),$=G(!1),S=G(null),K=G([]),M=G(void 0);function Z(I){return URL.createObjectURL(new Blob([Ln(I,{probedAttrs:hn})],{type:"text/html"}))}Ee(()=>l.value?.html,I=>{M.value&&(URL.revokeObjectURL(M.value),M.value=void 0),I&&(M.value=Z(I))},{immediate:!0});const E=G(null),W=G(0),J=G(0),x=G(1),j=G(!1),h=L(()=>l.value?.viewport??null),V=L(()=>{const I=h.value;return!I?.width||!W.value?1:Math.min(W.value/I.width,1)}),O=L(()=>{const I=h.value;if(!I)return{width:"100%",height:J.value?`${J.value}px`:"100%"};const b=J.value||I.height;return{width:`${Math.round(I.width*x.value)}px`,height:`${Math.round(b*x.value)}px`}}),N=L(()=>{const I=h.value;if(!I)return{width:"100%",height:J.value?`${J.value}px`:"100%",border:"0"};const b=J.value||I.height;return{width:`${I.width}px`,height:`${b}px`,transform:`scale(${x.value})`,transformOrigin:"top left",border:"0"}}),Q=L(()=>Math.round(x.value*100)),ve=I=>Math.min(4,Math.max(.1,I));function he(I){j.value=!0,x.value=ve(x.value*I)}function ue(){j.value=!1,x.value=V.value}Ee([V,h],()=>{j.value||(x.value=V.value)});let Y=null;Ee(E,I=>{Y?.disconnect(),I&&(W.value=I.clientWidth,Y=new ResizeObserver(b=>{for(const ie of b)W.value=ie.contentRect.width}),Y.observe(I))}),Ae(()=>{Y?.disconnect()}),Ae(()=>{M.value&&URL.revokeObjectURL(M.value)});function de(I){if(!T.value||I.source!==T.value.contentWindow)return;const b=I.data;if(b?.type==="pickerReady"){$.value=!0,ae();return}if(b?.type==="piwiContentHeight"&&typeof b.height=="number"){J.value=Math.max(b.height,h.value?.height??0);return}if(b?.type==="piwiScrollTo"&&typeof b.y=="number"){const ie=E.value;ie&&ie.scrollTo({top:Math.max(0,b.y*x.value-80),behavior:"smooth"});return}if(b?.type==="piwiSearchResult"){d.value=typeof b.count=="number"?b.count:0,q.value=typeof b.index=="number"?b.index:-1;return}if(b?.type==="elementPicked"&&b.attrs){const{labelText:ie,...be}=b.attrs;S.value={...be,accessibleName:ie??_n(be)},K.value=kn(S.value),H.value=null,g.value="review"}b?.type==="pickerClosed"&&se()}function B(I){T.value?.contentWindow?.postMessage(I,"*")}function ae(){const I=Tn({failingLocator:a.failingLocator,fromElementMatch:a.healing?.fromElementMatch??null,fromAriaSnapshot:a.healing?.fromAriaSnapshot??null});I.length&&B({type:"piwiHighlight",hints:I})}const w=G(""),d=G(0),q=G(-1);let ne=null;Ee(w,I=>{ne&&clearTimeout(ne),ne=setTimeout(()=>B({type:"piwiSearch",q:I}),180)});function y(){B({type:"piwiSearchNext"})}Ae(()=>{ne&&clearTimeout(ne)});function z(I){if(!n.value||g.value!=="pick-element"||!$.value||I.key!=="ArrowUp"&&I.key!=="ArrowDown")return;const b=(document.activeElement?.tagName??"").toLowerCase();if(b==="input"||b==="textarea")return;const ie=T.value?.contentWindow;ie&&(I.preventDefault(),ie.postMessage({type:"piwiPickerKey",key:I.key},"*"))}function D(){T.value&&(T.value.src="about:blank")}rt(()=>{window.addEventListener("message",de),window.addEventListener("keydown",z,!0)}),Ae(()=>{window.removeEventListener("message",de),window.removeEventListener("keydown",z,!0)});const H=G(null),re=G(!1);function X(I){H.value=I}const oe=L(()=>pt(a.failingLocator.method,K.value)),ee=Je();async function U(){if(H.value){re.value=!0;try{(await $fetch(`/api/test-runs/${a.runId}/cases/${a.testRunsCaseId}/locator-pick`,{method:"POST",body:{failingLocator:a.failingLocator,pickedLocator:H.value,element:S.value}})).status==="ok"?c("confirmed",H.value):ee.add({title:"Pick not saved",description:"This failure has no call-site or locator signature to attach the pick to.",color:"warning",icon:"i-lucide-alert-triangle"}),n.value=!1}catch(I){ee.add({title:"Could not save the pick",description:lt(I),color:"error",icon:"i-lucide-alert-triangle"})}finally{re.value=!1}}}function se(){D(),n.value=!1}function le(){S.value=null,K.value=[],H.value=null,g.value="pick-element",$.value=!1,w.value="",d.value=0,q.value=-1;const I=l.value?.html;I&&(M.value&&URL.revokeObjectURL(M.value),M.value=Z(I))}const{copy:fe}=He(),ce=G(null);let ye=null;function Te(I,b){fe(I,{toast:"Locator copied"}),ce.value=b,ye&&clearTimeout(ye),ye=setTimeout(()=>{ce.value=null},2e3)}return Ae(()=>{ye&&clearTimeout(ye)}),(I,b)=>{const ie=we,be=Ie,Be=_t,Ke=Pe,gt=Qe,ht=Mt;return o(),F(ht,{open:n.value,"onUpdate:open":b[8]||(b[8]=ke=>n.value=ke),ui:{content:"max-w-6xl w-[95vw]"},onAfterLeave:se},{header:A(()=>[...b[9]||(b[9]=[p("div",null,[p("h3",{class:"text-lg font-medium"},"Pick a locator from the DOM snapshot"),p("p",{class:"text-sm text-gray-500 mt-0.5"}," Click the element the failing locator should target. Use ↑↓ to walk the DOM tree. ")],-1)])]),body:A(()=>[t(s)?(o(),u("div",Rn,[k(ie,{name:"i-lucide-loader",class:"size-6 animate-spin text-gray-400"}),b[10]||(b[10]=p("span",{class:"ml-2 text-sm text-gray-500"},"Loading DOM snapshot...",-1))])):t(f)?(o(),u("div",In,[k(ie,{name:"i-lucide-alert-triangle",class:"size-8 text-red-300 mx-auto mb-2"}),b[12]||(b[12]=p("p",{class:"text-sm text-red-500"},"Failed to load snapshot",-1)),p("p",zn,_(t(f)),1),k(be,{size:"xs",variant:"outline",color:"neutral",class:"mt-3",onClick:m},{default:A(()=>[...b[11]||(b[11]=[P("Retry",-1)])]),_:1})])):t(l)?.status!=="ok"||!t(l).html?(o(),u("div",Pn,[k(ie,{name:"i-lucide-file-x",class:"size-8 text-gray-300 mx-auto mb-2"}),b[13]||(b[13]=p("p",{class:"text-sm text-gray-500"},"No DOM snapshot or ARIA data available for this execution",-1)),b[14]||(b[14]=p("p",{class:"text-xs text-gray-400 mt-1"},"This test run has no stored trace or ARIA snapshot to pick from.",-1))])):(o(),u(te,{key:3},[p("div",Bn,[t(l).source?(o(),u("div",{key:0,class:me(["text-xs flex items-center gap-1",t(l).source==="aria"?"text-amber-600 dark:text-amber-400":"text-green-600 dark:text-green-400"])},[k(ie,{name:t(l).source==="aria"?"i-lucide-accessibility":"i-lucide-check",class:"size-3.5 shrink-0"},null,8,["name"]),t(l).source==="aria"?(o(),u(te,{key:0},[P(" Accessibility tree from the failure-time ARIA snapshot — element styles are approximate ")],64)):(o(),u(te,{key:1},[P(" Rendered from the failure-time DOM snapshot ")],64))],2)):C("",!0),t(v).length>1?(o(),u("div",En,[p("button",{type:"button",class:me(["px-2 py-1 flex items-center gap-1 transition-colors",t(i)==="dom"?"bg-primary/10 text-primary font-medium":"text-gray-500 hover:bg-elevated"]),title:"Rendered page from the trace",onClick:b[0]||(b[0]=ke=>R("dom"))},[k(ie,{name:"i-lucide-layout-panel-top",class:"size-3.5"}),b[15]||(b[15]=P(" DOM ",-1))],2),p("button",{type:"button",class:me(["px-2 py-1 flex items-center gap-1 border-l border-default transition-colors",t(i)==="aria"?"bg-primary/10 text-primary font-medium":"text-gray-500 hover:bg-elevated"]),title:"Accessibility tree from the ARIA snapshot",onClick:b[1]||(b[1]=ke=>R("aria"))},[k(ie,{name:"i-lucide-accessibility",class:"size-3.5"}),b[16]||(b[16]=P(" Tree ",-1))],2)])):C("",!0)]),t(h)?(o(),u("div",On,[k(be,{size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-zoom-out",title:"Zoom out",onClick:b[2]||(b[2]=ke=>he(1/1.25))}),p("span",Mn,_(t(Q))+"%",1),k(be,{size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-zoom-in",title:"Zoom in",onClick:b[3]||(b[3]=ke=>he(1.25))}),k(be,{size:"xs",variant:"outline",color:"neutral",class:"ml-1",onClick:ue},{default:A(()=>[...b[17]||(b[17]=[P("Fit",-1)])]),_:1}),p("span",Nn,_(t(h).width)+"×"+_(t(h).height),1)])):C("",!0),t(g)==="pick-element"?(o(),u("div",Un,[k(Be,{modelValue:t(w),"onUpdate:modelValue":b[4]||(b[4]=ke=>Le(w)?w.value=ke:null),size:"xs",icon:"i-lucide-search",placeholder:"Find an element by its text…",class:"max-w-xs",onKeydown:_e($e(y,["prevent"]),["enter"])},null,8,["modelValue","onKeydown"]),t(w)&&t(d)>0?(o(),u("span",jn,_(t(q)+1)+"/"+_(t(d)),1)):t(w)?(o(),u("span",Dn,"no matches")):C("",!0),t(d)>1?(o(),F(be,{key:2,size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-chevron-down",title:"Next match (Enter)",onClick:y})):C("",!0)])):C("",!0),p("div",{ref_key:"stageRef",ref:E,class:me(["relative border border-default rounded-lg overflow-auto",[t(g)==="pick-element"?"h-[75vh]":"h-80",t(h)?"bg-gray-100 dark:bg-gray-800":""]])},[t($)?C("",!0):(o(),u("div",Kn,[k(ie,{name:"i-lucide-loader",class:"size-5 animate-spin text-gray-400"}),b[18]||(b[18]=p("span",{class:"ml-2 text-sm text-gray-500"},"Initializing picker...",-1))])),p("div",{style:et(t(O))},[p("iframe",{ref_key:"iframeRef",ref:T,src:t(M),style:et(t(N)),class:"bg-white",sandbox:"allow-scripts",title:"DOM snapshot"},null,12,Vn)],4)],2),t(g)==="review"&&t(S)?(o(),u("div",Hn,[p("div",Fn,[k(ie,{name:"i-lucide-crosshair",class:"size-5 text-primary shrink-0"}),p("div",qn,[p("p",Zn,[b[19]||(b[19]=P(" Picked: ",-1)),p("code",Wn,_(t(S).tagName),1),t(S).attributes.id?(o(),u("code",Jn,"#"+_(t(S).attributes.id),1)):C("",!0),t(S).attributes["data-testid"]?(o(),F(Ke,{key:1,size:"xs",color:"primary",variant:"subtle",class:"ml-1"},{default:A(()=>[P(_(t(S).attributes["data-testid"]),1)]),_:1})):C("",!0)]),t(S).textContent?(o(),u("p",Yn,' "'+_(t(S).textContent)+'" ',1)):C("",!0)]),k(be,{size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-rotate-ccw",title:"Pick a different element",onClick:le})]),p("div",Gn,[(o(!0),u(te,null,ge(t(K),(ke,Fe)=>(o(),F(dt,{key:Fe,alt:ke,copied:t(ce)===`picked-${Fe}`,dense:!0,selectable:!0,selected:t(H)?.locator===ke.locator,onCopy:yt=>Te(ke.locator,`picked-${Fe}`),onSelect:yt=>X(ke)},null,8,["alt","copied","selected","onCopy","onSelect"]))),128))]),t(oe).recommended?(o(),u("div",{key:0,class:"rounded-lg border border-primary/40 bg-primary/5 p-3 flex items-center gap-3 cursor-pointer",role:"button",tabindex:"0",title:"Select this locator for Confirm",onClick:b[6]||(b[6]=ke=>X(t(oe).recommended)),onKeydown:b[7]||(b[7]=_e($e(ke=>X(t(oe).recommended),["prevent"]),["enter"]))},[k(ie,{name:"i-lucide-star",class:"size-5 text-primary shrink-0"}),p("div",Qn,[p("p",Xn," Recommended (score: "+_(t(oe).recommended.score)+") ",1),k(gt,{locator:t(oe).recommended.locator,truncate:"",class:"text-sm mt-0.5"},null,8,["locator"])]),k(be,{size:"sm",color:"primary",variant:"solid","trailing-icon":t(ce)==="rec"?"i-lucide-check":"i-lucide-copy",onClick:b[5]||(b[5]=$e(ke=>Te(t(oe).recommended.locator,"rec"),["stop"]))},{default:A(()=>[...b[20]||(b[20]=[P(" Copy ",-1)])]),_:1},8,["trailing-icon"])],32)):C("",!0)])):C("",!0)],64))]),footer:A(()=>[p("div",eo,[t(g)==="review"?(o(),F(be,{key:0,size:"sm",variant:"outline",color:"neutral",icon:"i-lucide-rotate-ccw",onClick:le},{default:A(()=>[...b[21]||(b[21]=[P(" Pick a different element ",-1)])]),_:1})):(o(),u("div",to)),p("div",no,[k(be,{size:"sm",variant:"outline",color:"neutral",onClick:se},{default:A(()=>[...b[22]||(b[22]=[P("Cancel",-1)])]),_:1}),t(g)==="review"?(o(),F(be,{key:0,size:"sm",color:"primary",loading:t(re),disabled:!t(H),onClick:U},{default:A(()=>[...b[23]||(b[23]=[P(" Confirm pick ",-1)])]),_:1},8,["loading","disabled"])):C("",!0)])])]),_:1},8,["open"])}}}),so=Object.assign(oo,{__name:"SnapshotLocatorPicker"});function ao(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ro(e,r){let a=0,c=null;for(let n=r;n<e.length;n++){const s=e[n];if(c){if(s==="\\"){n++;continue}s===c&&(c=null);continue}if(s==="'"||s==='"'||s==="`"){c=s;continue}if(s==="(")a++;else if(s===")"&&(a--,a===0))return n}return-1}function io(e,r,a){if(!e||!r||!a)return null;const c=new RegExp(`${ao(r)}\\s*\\(`,"g");let n;for(;(n=c.exec(e))!==null;){const s=n.index,l=s>0?e[s-1]:"";if(l&&/[A-Za-z0-9_$]/.test(l))continue;const f=s+n[0].lastIndexOf("("),i=ro(e,f);if(i===-1)return null;const m=e.slice(0,s)+a+e.slice(i+1);return m===e?null:{old:e,new:m}}return null}function lo(e,r){return`${r?`@@ ${r} @@
2
+ `:""}-${e.old.trimEnd()}
3
+ +${e.new.trimEnd()}`}function co(e,r){const a=e??{},c=r??{},n=l=>l==null?null:typeof l=="string"?l:JSON.stringify(l),s=[];for(const l of new Set([...Object.keys(a),...Object.keys(c)])){const f=n(a[l]),i=n(c[l]);f!==i&&s.push({key:l,from:f,to:i})}return s}function uo(e){const a=[`In ${e.location??(e.sourceLine?`line ${e.sourceLine.line}`:"the failing test")}, the Playwright locator \`${e.failing}\` no longer matches its element.`,`Replace it with \`${e.recommended}\`.`];return e.sourceLine&&a.push("","Current line:",e.sourceLine.text.trim()),a.join(`
4
+ `)}const po={key:1},fo={class:"flex items-center gap-1"},mo={key:1,class:"rounded-lg border border-primary/50 bg-primary/10 p-3 mb-3 flex items-center gap-3"},go={class:"flex-1 min-w-0"},ho={class:"text-xs font-medium text-primary flex items-center gap-1.5"},yo={key:2,class:"bg-elevated rounded p-2 mb-3 border border-red-200 dark:border-red-800"},xo={class:"flex items-center gap-2"},vo={class:"text-xs font-mono text-red-600 dark:text-red-400 flex-1 truncate"},bo={key:0,class:"flex items-center gap-2 mt-1.5 pl-6"},ko={class:"text-xs text-gray-500"},_o={class:"font-medium text-gray-700 dark:text-gray-300"},$o={key:4,class:"rounded-lg border border-primary/40 bg-primary/5 p-3 mb-3 space-y-2"},wo={class:"flex items-center gap-2 min-w-0"},Co={key:0,class:"text-[11px] text-gray-500 truncate min-w-0"},To={key:0,class:"rounded border border-default overflow-hidden bg-default"},So={key:0,class:"text-xs flex flex-wrap items-center gap-x-1.5 gap-y-0.5"},Ao={class:"font-mono text-gray-500"},Lo={key:0,class:"font-mono text-red-500 line-through"},Ro={key:1,class:"text-gray-400"},Io={key:2,class:"font-mono text-green-600 dark:text-green-400"},zo={key:3,class:"text-gray-400"},Po={key:2,class:"text-xs text-gray-500"},Bo={key:3,class:"text-xs text-primary/90 flex items-center gap-1"},Eo={class:"flex items-center gap-2"},Oo={key:5,class:"rounded-lg border border-default bg-elevated p-3 mb-3 flex items-center gap-3"},Mo={class:"flex-1 min-w-0"},No={class:"text-xs font-medium text-success-600 dark:text-success-400"},Uo={class:"space-y-2"},jo={key:6,class:"mt-3"},Do={class:"space-y-2"},Ko={class:"flex items-center gap-1"},st=3,Vo=pe({__name:"LocatorHealingPanel",props:{runId:{},testRunsCaseId:{},storageKey:{},affectedCount:{},aiIntents:{}},setup(e){const r=e,a=L(()=>r.storageKey?De:je),c=L(()=>r.storageKey?{storageKey:r.storageKey}:{}),{data:n,pending:s,error:l}=Ue(()=>`/api/test-runs/${r.runId}/cases/${r.testRunsCaseId}/locator-healing`,{lazy:!0},"$Zgad3xb7ix"),f=L(()=>!!n.value&&n.value.source!=="none"&&!!(n.value.fromElementMatch?.length||n.value.fromPriorSuccess?.length||n.value.fromAriaSnapshot?.length)),i=L(()=>n.value?n.value.fromElementMatch??n.value.fromPriorSuccess??n.value.fromAriaSnapshot??[]:[]),m=L(()=>i.value.find(w=>w.pickedByUser)??null),v=L(()=>n.value?.recommendation?n.value.recommendation:n.value?.priorNameMayBeStale||!i.value.length?null:pt(n.value?.failingLocator?.method,i.value)),R=L(()=>n.value?.priorNameMayBeStale&&n.value.fromPriorSuccess?.length?n.value.fromAriaSnapshot??[]:[]),g=L(()=>{const w=v.value;return w?.recommended?w.recommended.pickedByUser?"Confirmed with the locator picker on the failing page":w.preservesConvention?"Keeps your original locator style — minimal, idiomatic edit":w.suggestAddTestId?"Most stable available, but still fragile":"Most stable available — a sturdier style than the original":""}),T=L(()=>{const w=n.value?.priorNameMayBeStale,d=(()=>{switch(n.value?.source){case"prior-run":return w?"Pre-captured from the last passing run — the element looks changed since":"Pre-captured from the last passing run — highest confidence";case"element-match":return"The element looks renamed or moved — these are fresh locators for its current identity on the failing page";case"fingerprint":return"Matched by locator signature (line numbers shifted)";case"cross-test":return"Captured by another test in this project that uses the same locator";case"aria-snapshot":return"Generated from the failure-time ARIA snapshot — limited, no HTML attributes";default:return""}})(),q=n.value?.capturedAt;return q?`${d} · captured ${Ye(q)}`:d}),$=L(()=>{if(n.value?.priorNameMayBeStale)return"text-warning-600 dark:text-warning-400";switch(n.value?.source){case"prior-run":case"fingerprint":case"cross-test":return"text-success-600 dark:text-success-400";case"element-match":return"text-primary-600 dark:text-primary-400";default:return"text-warning-600 dark:text-warning-400"}}),S=L(()=>{const w=n.value?.failingLocator;return w?`${w.method}(${JSON.stringify(w.args)})`:""});function K(w){return w.toLowerCase().replace(/[\s'"`{}[\]]/g,"")}const M=L(()=>{if(!r.aiIntents?.length||!S.value)return null;const w=K(S.value);return r.aiIntents.find(d=>K(d.locator)===w)??null}),Z=ze(),{data:E}=Ue(()=>`/api/test-run-cases/${r.testRunsCaseId}/traces`,{lazy:!0},"$eLKRphd7VZ"),W=L(()=>{const w=E.value?.[0];if(!w)return null;const d=!!Z.public.demoMode&&w.filePath.startsWith("demo/");return ct(w.filePath,Z.app?.baseURL,d)}),J=G(!1);async function x(){await wt(`/api/test-runs/${r.runId}/cases/${r.testRunsCaseId}/locator-healing`)}const{copy:j}=He(),h=G(null);let V=null;function O(w,d,q){j(w,{toast:q}),h.value=d,V&&clearTimeout(V),V=setTimeout(()=>{h.value=null},2e3)}function N(w,d){O(w,d,"Locator copied")}Ae(()=>{V&&clearTimeout(V)});const Q=L(()=>v.value?.recommended??null),ve=L(()=>r.affectedCount&&r.affectedCount>1&&Q.value?`Same break affects ${r.affectedCount} tests in this cluster — one fix`:""),he=L(()=>{if(Q.value?.pickedByUser)return"your confirmed pick";switch(n.value?.source){case"prior-run":return"from the last passing run";case"fingerprint":return"from a prior run (line shifted)";case"cross-test":return"from another test in this project";case"element-match":return"from the current failing page";case"aria-snapshot":return"from the ARIA snapshot";default:return""}}),ue=L(()=>{const w=n.value?.sourceLine,d=Q.value;if(!w||!d)return null;const q=io(w.text,n.value?.failingLocator?.method,d.locator);return q?{edit:q,patch:lo(q,n.value?.location??null)}:null}),Y=L(()=>{if(ue.value)return[];const w=n.value?.failingLocator,d=Q.value;return!w||!d||d.method!==w.method?[]:co(w.args,d.args)});function de(){const w=Q.value;!w||!n.value||O(uo({location:n.value.location??null,sourceLine:n.value.sourceLine??null,failing:S.value,recommended:w.locator}),"fix-prompt","Fix prompt copied")}const B=G(!1),ae=L(()=>B.value?i.value:i.value.slice(0,st));return(w,d)=>{const q=Qe,ne=Ie,y=$t,z=Ge,D=we,H=Pe,re=cn,X=dt,oe=It;return o(),u(te,null,[!t(s)&&!t(l)&&t(f)?(o(),F(Se(t(a)),Ne({key:0},t(c),{icon:"i-lucide-bandage",title:"Alternative locators",count:t(i).length,help:"locator-healing"}),Re({subtitle:A(()=>[p("span",{class:me(t($))},_(t(T)),3)]),default:A(()=>[t(n)?.healedInRunId?(o(),F(z,{key:0,class:"mb-3",color:"success",icon:"i-lucide-circle-check",variant:"subtle",title:"Locator healed"},{description:A(()=>[d[11]||(d[11]=P(" The recommended locator now passes at this call site — ",-1)),k(y,{to:`/test-runs/${t(n).healedInRunId}`,class:"underline font-medium"},{default:A(()=>[P(" see run #"+_(t(n).healedInRunId),1)]),_:1},8,["to"]),d[12]||(d[12]=P(". ",-1))]),_:1})):C("",!0),t(m)?(o(),u("div",mo,[k(D,{name:"i-lucide-user-check",class:"size-5 text-primary shrink-0"}),p("div",go,[p("p",ho,[d[14]||(d[14]=P(" Your pick ",-1)),k(H,{size:"sm",color:"primary",variant:"subtle"},{default:A(()=>[...d[13]||(d[13]=[P("confirmed on the failing page",-1)])]),_:1})]),k(q,{locator:t(m).locator,truncate:"",class:"text-sm mt-0.5"},null,8,["locator"])]),k(ne,{size:"sm",color:"primary",variant:"solid","trailing-icon":t(h)==="user-pick"?"i-lucide-check":"i-lucide-copy",onClick:d[1]||(d[1]=ee=>N(t(m).locator,"user-pick"))},{default:A(()=>[...d[15]||(d[15]=[P(" Copy ",-1)])]),_:1},8,["trailing-icon"])])):C("",!0),t(n)?.failingLocator?(o(),u("div",yo,[p("div",xo,[k(D,{name:"i-lucide-x-circle",class:"size-4 text-red-500 shrink-0"}),p("code",vo,_(t(S)),1),k(ne,{size:"xs",variant:"ghost",color:"neutral",icon:t(h)==="failing"?"i-lucide-check":"i-lucide-copy",title:t(h)==="failing"?"Copied!":"Copy",onClick:d[2]||(d[2]=ee=>N(t(S),"failing"))},null,8,["icon","title"])]),t(M)?(o(),u("div",bo,[k(D,{name:"i-lucide-wand-sparkles",class:"size-3.5 text-primary shrink-0"}),p("span",ko,[d[19]||(d[19]=P(" Compiled from prompt ",-1)),p("span",_o,"“"+_(t(M).template)+"”",1),t(M).kind==="run"?(o(),u(te,{key:0},[d[16]||(d[16]=P(" (a ",-1)),d[17]||(d[17]=p("code",{class:"text-xs"},"piwiRun",-1)),d[18]||(d[18]=P(" flow step)",-1))],64)):C("",!0)])])):C("",!0)])):C("",!0),t(n)?.priorNameMayBeStale?(o(),F(z,{key:3,class:"mb-3",color:"warning",icon:"i-lucide-alert-triangle",variant:"subtle",title:"The element's name looks changed",description:"The captured accessible name no longer appears on the failing page, so name-based alternatives (and the failing locator itself) probably no longer match. Prefer the structural options, or the failing-page candidates below."})):C("",!0),t(Q)?(o(),u("div",$o,[p("div",wo,[k(D,{name:"i-lucide-star",class:"size-4 text-primary shrink-0"}),d[20]||(d[20]=p("p",{class:"text-xs font-medium text-primary shrink-0"},"Recommended fix",-1)),t(he)?(o(),u("span",Co," · "+_(t(he)),1)):C("",!0),d[21]||(d[21]=p("span",{class:"flex-1"},null,-1)),k(H,{size:"xs",color:"primary",variant:"subtle",class:"font-mono tabular-nums shrink-0"},{default:A(()=>[P(_(t(Q).score),1)]),_:1})]),t(ue)?(o(),u("div",To,[k(re,{patch:t(ue).patch},null,8,["patch"])])):(o(),u(te,{key:1},[k(q,{locator:t(Q).locator,truncate:"",class:"text-sm"},null,8,["locator"]),t(Y).length?(o(),u("p",So,[(o(!0),u(te,null,ge(t(Y),(ee,U)=>(o(),u(te,{key:U},[p("span",Ao,_(ee.key)+":",1),ee.from?(o(),u("span",Lo,_(ee.from),1)):(o(),u("span",Ro,"—")),k(D,{name:"i-lucide-arrow-right",class:"size-3 text-gray-400"}),ee.to?(o(),u("span",Io,_(ee.to),1)):(o(),u("span",zo,"removed"))],64))),128))])):C("",!0)],64)),t(g)?(o(),u("p",Po,_(t(g)),1)):C("",!0),t(ve)?(o(),u("p",Bo,[k(D,{name:"i-lucide-layers",class:"size-3 shrink-0"}),P(_(t(ve)),1)])):C("",!0),p("div",Eo,[k(ne,{size:"xs",color:"primary",variant:"solid","trailing-icon":t(h)==="top"?"i-lucide-check":"i-lucide-copy",onClick:d[3]||(d[3]=ee=>N(t(Q).locator,"top"))},{default:A(()=>[...d[22]||(d[22]=[P(" Copy locator ",-1)])]),_:1},8,["trailing-icon"]),k(ne,{size:"xs",color:"neutral",variant:"outline",icon:t(h)==="fix-prompt"?"i-lucide-check":"i-lucide-sparkles",title:"Copy an instruction an AI coding agent can apply directly to the test",onClick:de},{default:A(()=>[...d[23]||(d[23]=[P(" Copy fix prompt ",-1)])]),_:1},8,["icon"])])])):C("",!0),t(v)?.hasDurableAlternative&&t(v).durable?(o(),u("div",Oo,[k(D,{name:"i-lucide-shield-check",class:"size-5 text-success shrink-0"}),p("div",Mo,[p("p",No," Most stable option (score: "+_(t(v).durable.score)+") ",1),k(q,{locator:t(v).durable.locator,truncate:"",class:"text-sm mt-0.5"},null,8,["locator"]),d[24]||(d[24]=p("p",{class:"text-xs text-gray-500 mt-0.5"},"Sturdier, but changes the locator style",-1))]),k(ne,{size:"sm",color:"neutral",variant:"outline","trailing-icon":t(h)==="durable"?"i-lucide-check":"i-lucide-copy",onClick:d[4]||(d[4]=ee=>N(t(v).durable.locator,"durable"))},{default:A(()=>[...d[25]||(d[25]=[P(" Copy ",-1)])]),_:1},8,["trailing-icon"])])):C("",!0),p("div",Uo,[d[26]||(d[26]=p("p",{class:"text-xs font-medium text-gray-500"},"All alternatives",-1)),(o(!0),u(te,null,ge(t(ae),(ee,U)=>(o(),F(X,{key:U,alt:ee,copied:t(h)===`alt-${U}`,onCopy:se=>N(ee.locator,`alt-${U}`)},null,8,["alt","copied","onCopy"]))),128)),t(i).length>st?(o(),F(ne,{key:0,size:"xs",variant:"ghost",color:"neutral",block:"",icon:t(B)?"i-lucide-chevron-up":"i-lucide-chevron-down",onClick:d[5]||(d[5]=ee=>B.value=!t(B))},{default:A(()=>[P(_(t(B)?"Show fewer":`Show all ${t(i).length} alternatives`),1)]),_:1},8,["icon"])):C("",!0)]),t(R).length?(o(),u("div",jo,[d[27]||(d[27]=p("p",{class:"text-xs font-medium text-gray-500 mb-2"},"From the failing page",-1)),p("div",Do,[(o(!0),u(te,null,ge(t(R),(ee,U)=>(o(),F(X,{key:U,alt:ee,note:"candidate from the failure-time ARIA snapshot",copied:t(h)===`supp-${U}`,onCopy:se=>N(ee.locator,`supp-${U}`)},null,8,["alt","copied","onCopy"]))),128))])])):C("",!0),t(v)?.suggestAddTestId?(o(),F(z,{key:7,class:"mt-3",color:"warning",icon:"i-lucide-info",variant:"subtle",title:"All alternatives are fragile",description:"Every captured locator scores below 50. Add a stable data-testid attribute to this element in the app for a durable fix."})):C("",!0),t(n)?.source==="aria-snapshot"?(o(),F(z,{key:8,class:"mt-3",color:"info",icon:"i-lucide-info",variant:"subtle"},{description:A(()=>[d[29]||(d[29]=P(" No HTML attributes were available. ",-1)),k(oe,{to:"capture-fixtures","no-icon":"",class:"text-primary hover:underline"},{default:A(()=>[...d[28]||(d[28]=[P("Enable Piwi fixture capture",-1)])]),_:1}),d[30]||(d[30]=P(" for full alternatives including data-testid and CSS selectors. ",-1))]),_:1})):C("",!0)]),_:2},[e.storageKey?{name:"folded",fn:A(()=>[t(v)?.recommended?(o(),F(q,{key:0,locator:t(v).recommended.locator,class:"text-xs"},null,8,["locator"])):(o(),u("span",po,_(t(i).length)+" alternative"+_(t(i).length===1?"":"s"),1))]),key:"0"}:void 0,t(W)||t(n)?.failingLocator?{name:"actions",fn:A(()=>[p("div",fo,[t(n)?.failingLocator?(o(),F(ne,{key:0,size:"xs",color:"neutral",variant:"outline",icon:"i-lucide-mouse-pointer",title:"Open the failure-time DOM snapshot and click the element to pick a locator",onClick:d[0]||(d[0]=ee=>J.value=!0)},{default:A(()=>[...d[9]||(d[9]=[P(" Pick from snapshot ",-1)])]),_:1})):C("",!0),t(W)?(o(),F(ne,{key:1,to:t(W),target:"_blank",size:"xs",color:"neutral",variant:"outline",icon:"i-lucide-crosshair",title:"Open the failure trace in the trace viewer — its Pick locator tool works on the recorded page snapshots"},{default:A(()=>[...d[10]||(d[10]=[P(" Pick from trace ",-1)])]),_:1},8,["to"])):C("",!0)])]),key:"1"}:void 0]),1040,["count"])):!t(s)&&!t(l)&&!t(f)?(o(),F(Se(t(a)),Ne({key:1},t(c),{icon:"i-lucide-bandage",title:"Alternative locators",subtitle:"No alternatives available",help:"locator-healing"}),Re({default:A(()=>[k(z,{color:"neutral",icon:"i-lucide-info",variant:"subtle"},{description:A(()=>[d[35]||(d[35]=P(" No pre-captured alternatives — this locator has never passed in a previous run. ",-1)),k(oe,{to:"capture-fixtures","no-icon":"",class:"text-primary hover:underline"},{default:A(()=>[...d[34]||(d[34]=[P("Enable Piwi dashboard fixtures",-1)])]),_:1}),d[36]||(d[36]=P(" to capture element attributes at test time, or use “Pick from snapshot” above to choose a locator by hand on the failure-time page. ",-1))]),_:1})]),_:2},[e.storageKey?{name:"folded",fn:A(()=>[d[31]||(d[31]=p("span",null,"No alternatives available",-1))]),key:"0"}:void 0,t(W)||t(n)?.failingLocator?{name:"actions",fn:A(()=>[p("div",Ko,[t(n)?.failingLocator?(o(),F(ne,{key:0,size:"xs",color:"neutral",variant:"outline",icon:"i-lucide-mouse-pointer",title:"Open the failure-time DOM snapshot and click the element to pick a locator",onClick:d[6]||(d[6]=ee=>J.value=!0)},{default:A(()=>[...d[32]||(d[32]=[P(" Pick from snapshot ",-1)])]),_:1})):C("",!0),t(W)?(o(),F(ne,{key:1,to:t(W),target:"_blank",size:"xs",color:"neutral",variant:"outline",icon:"i-lucide-crosshair",title:"Open the failure trace in the trace viewer — its Pick locator tool works on the recorded page snapshots"},{default:A(()=>[...d[33]||(d[33]=[P(" Pick from trace ",-1)])]),_:1},8,["to"])):C("",!0)])]),key:"1"}:void 0]),1040)):C("",!0),t(n)?.failingLocator?(o(),F(so,{key:2,open:t(J),"onUpdate:open":d[7]||(d[7]=ee=>Le(J)?J.value=ee:null),"run-id":e.runId,"test-runs-case-id":e.testRunsCaseId,"failing-locator":t(n).failingLocator,healing:t(n),onConfirmed:x,onClose:d[8]||(d[8]=ee=>J.value=!1)},null,8,["open","run-id","test-runs-case-id","failing-locator","healing"])):C("",!0)],64)}}}),Da=Object.assign(Vo,{__name:"LocatorHealingPanel"}),Ho={key:1,class:"space-y-2"},Fo={class:"text-xs font-medium text-gray-500 dark:text-gray-400 sm:w-40 shrink-0"},qo={class:"flex flex-wrap items-center gap-1.5 min-w-0 text-xs font-mono"},Zo={class:"rounded bg-red-50 px-1.5 py-0.5 text-red-700 dark:bg-red-950/30 dark:text-red-400 break-all"},Wo={class:"rounded bg-green-50 px-1.5 py-0.5 text-green-700 dark:bg-green-950/30 dark:text-green-400 break-all"},Jo={key:0,class:"text-xs text-gray-400 dark:text-gray-500"},Yo={key:0},Go=pe({__name:"EnvironmentDiffCard",props:{runId:{},testRunsCaseId:{},storageKey:{}},setup(e,{expose:r}){const a=e,c=L(()=>a.storageKey?De:je),n=L(()=>a.storageKey?{storageKey:a.storageKey}:{}),{data:s,pending:l,error:f}=Ue(()=>`/api/test-runs/${a.runId}/cases/${a.testRunsCaseId}/environment-diff`,{lazy:!0},"$0pD8W6UYqF"),i=L(()=>s.value?.entries??[]),m=L(()=>i.value.filter($=>!$.informational)),v=L(()=>i.value.filter($=>$.informational)),R=L(()=>{const $=s.value?.baseline;if(!$)return"";const S=$.startTime?` · ${Ye(new Date($.startTime))}`:"";return`vs last pass in run #${$.runId}${S}`}),g=L(()=>{if(s.value?.status!=="ok")return"No passing baseline to compare against";const $=m.value.length;return $===0?"Identical to last pass — no environment drift":`${$} change${$===1?"":"s"}: ${m.value.map(S=>S.label).join(", ")}`}),T=G(null);return r({reveal:()=>T.value?.reveal?.()}),($,S)=>{const K=Ge,M=we;return!t(l)&&!t(f)&&t(s)?.status==="ok"?(o(),F(Se(t(c)),Ne({key:0,ref_key:"card",ref:T},t(n),{icon:"i-lucide-git-compare-arrows",title:"Environment diff",count:t(m).length||void 0,help:"environment-diff",subtitle:t(R)}),Re({default:A(()=>[t(i).length===0?(o(),F(K,{key:0,color:"success",icon:"i-lucide-check-circle",variant:"subtle",description:"The environment is identical to the last passing run — environment drift is unlikely to explain this failure."})):(o(),u("div",Ho,[(o(!0),u(te,null,ge(t(m),Z=>(o(),u("div",{key:Z.key,class:"rounded-lg border border-default p-3 flex flex-col gap-1 sm:flex-row sm:items-center sm:gap-3"},[p("span",Fo,_(Z.label),1),p("div",qo,[p("code",Zo,_(Z.failing??"(unset)"),1),k(M,{name:"i-lucide-arrow-left",class:"size-3 shrink-0 text-gray-400"}),p("code",Wo,_(Z.baseline??"(unset)"),1)])]))),128)),t(v).length>0?(o(),u("p",Jo,[S[0]||(S[0]=P(" Also changed (varies naturally between runs): ",-1)),(o(!0),u(te,null,ge(t(v),(Z,E)=>(o(),u("span",{key:Z.key},[P(_(Z.label.toLowerCase())+" "+_(Z.baseline??"—")+" → "+_(Z.failing??"—"),1),E<t(v).length-1?(o(),u("span",Yo,", ")):C("",!0)]))),128))])):C("",!0)]))]),_:2},[e.storageKey?{name:"folded",fn:A(()=>[p("span",null,_(t(g)),1)]),key:"0"}:void 0]),1040,["count","subtitle"])):C("",!0)}}}),Ka=Object.assign(Go,{__name:"EnvironmentDiffCard"}),Qo={class:"absolute top-4 left-4 text-white/70 text-sm font-medium"},Xo=["src","alt"],es=pe({__name:"ScreenshotLightbox",props:{images:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:r}){const a=e,c=r,n=L(()=>a.modelValue!==null);function s(){c("update:modelValue",null)}function l(){a.modelValue!==null&&a.modelValue>0&&c("update:modelValue",a.modelValue-1)}function f(){a.modelValue!==null&&a.modelValue<a.images.length-1&&c("update:modelValue",a.modelValue+1)}const i=L(()=>a.modelValue===null?null:a.images[a.modelValue]??null);function m(v){n.value&&(v.key==="Escape"&&s(),v.key==="ArrowLeft"&&l(),v.key==="ArrowRight"&&f())}return rt(()=>window.addEventListener("keydown",m)),Ct(()=>window.removeEventListener("keydown",m)),(v,R)=>{const g=we;return o(),F(Tt,{to:"body"},[k(St,{name:"lightbox"},{default:A(()=>[n.value?(o(),u("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/90",onClick:$e(s,["self"])},[p("button",{class:"absolute top-4 right-4 size-10 flex items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/20 transition-colors",onClick:s},[k(g,{name:"i-lucide-x",class:"size-6"})]),p("div",Qo,_((e.modelValue??0)+1)+" / "+_(e.images.length),1),e.images.length>1&&(e.modelValue??0)>0?(o(),u("button",{key:0,class:"absolute left-4 size-10 flex items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/20 transition-colors",onClick:l},[k(g,{name:"i-lucide-chevron-left",class:"size-6"})])):C("",!0),i.value?(o(),u("img",{key:1,src:i.value.src,alt:i.value.name,class:"max-h-[90vh] max-w-[90vw] object-contain rounded-lg",onClick:R[0]||(R[0]=$e(()=>{},["stop"]))},null,8,Xo)):C("",!0),e.images.length>1&&(e.modelValue??0)<e.images.length-1?(o(),u("button",{key:2,class:"absolute right-4 size-10 flex items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/20 transition-colors",onClick:f},[k(g,{name:"i-lucide-chevron-right",class:"size-6"})])):C("",!0)])):C("",!0)]),_:1})])}}}),mt=Object.assign(At(es,[["__scopeId","data-v-c02b1e9b"]]),{__name:"ScreenshotLightbox"}),ts={class:"flex justify-end mb-2"},ns={key:1,class:"rounded overflow-hidden border border-default bg-gray-50 dark:bg-gray-900"},os=["src"],ss={key:2,class:"grid grid-cols-1 sm:grid-cols-2 gap-2"},as={class:"rounded overflow-hidden border border-red-200 dark:border-red-900 bg-gray-50 dark:bg-gray-900"},rs=["src"],is={class:"rounded overflow-hidden border border-green-200 dark:border-green-900 bg-gray-50 dark:bg-gray-900"},ls={class:"px-2 py-1 text-[10px] font-medium text-green-600 dark:text-green-400"},cs=["src"],us=pe({__name:"VisualDiffCard",props:{runId:{},testRunsCaseId:{},storageKey:{}},setup(e,{expose:r}){const a=e,c=L(()=>a.storageKey?De:je),n=L(()=>a.storageKey?{storageKey:a.storageKey}:{}),s=ze(),{data:l,pending:f,error:i}=Ue(()=>`/api/test-runs/${a.runId}/cases/${a.testRunsCaseId}/visual-diff`,{lazy:!0},"$QAhY8Q5pJg"),m=L(()=>l.value?.status==="ok"?l.value.diff??null:null),v=G("overlay"),R=[{label:"Overlay",value:"overlay"},{label:"Side by side",value:"side-by-side"}],g=L(()=>m.value?Me(m.value.path,"image/png",s.app?.baseURL):""),T=L(()=>m.value?Me(m.value.failingPath,null,s.app?.baseURL):""),$=L(()=>m.value?Me(m.value.baselinePath,null,s.app?.baseURL):""),S=L(()=>m.value?(m.value.changedPixelRatio*100).toFixed(2):"0"),K=L(()=>{const J=m.value?.changedPixelRatio??0;return J>.1?"error":J>.01?"warning":"success"}),M=L(()=>m.value?m.value.dimensionMismatch?`${S.value}% changed — dimensions differ, unreliable`:`${S.value}% of pixels changed vs last pass`:"No comparable screenshots"),Z=L(()=>m.value?[{src:T.value,name:"Failing screenshot"},{src:$.value,name:"Last passing screenshot"},{src:g.value,name:"Diff overlay"}]:[]),E=G(null),W=G(null);return r({reveal:()=>W.value?.reveal?.()}),(J,x)=>{const j=Pe,h=Ge,V=Nt,O=mt;return!t(f)&&!t(i)&&t(m)?(o(),F(Se(t(c)),Ne({key:0,ref_key:"card",ref:W},t(n),{icon:"i-lucide-images",title:"Visual diff",help:"visual-diff"}),Re({subtitle:A(()=>[p("span",null,"vs last pass in run #"+_(t(m).baselineRunId),1)]),actions:A(()=>[k(j,{color:t(K),variant:"subtle",size:"sm",class:"font-mono tabular-nums"},{default:A(()=>[P(_(t(S))+"% changed ",1)]),_:1},8,["color"])]),default:A(()=>[t(m).dimensionMismatch?(o(),F(h,{key:0,class:"mb-3",color:"warning",icon:"i-lucide-alert-triangle",variant:"subtle",title:"Screenshot dimensions differ",description:"The failing and passing screenshots have different sizes (viewport change?). They are compared on a padded canvas, so the changed-pixel ratio is inflated and unreliable."})):C("",!0),p("div",ts,[k(V,{modelValue:t(v),"onUpdate:modelValue":x[0]||(x[0]=N=>Le(v)?v.value=N:null),items:R,size:"xs",content:!1,ui:{list:"overflow-x-auto",trigger:"shrink-0"}},null,8,["modelValue"])]),t(v)==="overlay"?(o(),u("div",ns,[p("img",{src:t(g),alt:"Diff overlay (red = changed pixels)",class:"w-full max-h-96 object-contain cursor-zoom-in outline-none focus-visible:outline-2 focus-visible:outline-primary",loading:"lazy",role:"button",tabindex:"0","aria-label":"Open diff overlay in lightbox",onClick:x[1]||(x[1]=N=>E.value=2),onKeydown:[x[2]||(x[2]=_e(N=>E.value=2,["enter"])),x[3]||(x[3]=_e($e(N=>E.value=2,["prevent"]),["space"]))]},null,40,os),x[11]||(x[11]=p("p",{class:"px-2 py-1 text-[10px] text-gray-500"},"Red pixels mark differences against the last passing run",-1))])):(o(),u("div",ss,[p("div",as,[x[12]||(x[12]=p("p",{class:"px-2 py-1 text-[10px] font-medium text-red-600 dark:text-red-400"},"Failing",-1)),p("img",{src:t(T),alt:"Failing screenshot",class:"w-full max-h-80 object-contain cursor-zoom-in outline-none focus-visible:outline-2 focus-visible:outline-primary",loading:"lazy",role:"button",tabindex:"0","aria-label":"Open failing screenshot in lightbox",onClick:x[4]||(x[4]=N=>E.value=0),onKeydown:[x[5]||(x[5]=_e(N=>E.value=0,["enter"])),x[6]||(x[6]=_e($e(N=>E.value=0,["prevent"]),["space"]))]},null,40,rs)]),p("div",is,[p("p",ls," Last pass (run #"+_(t(m).baselineRunId)+") ",1),p("img",{src:t($),alt:"Last passing screenshot",class:"w-full max-h-80 object-contain cursor-zoom-in outline-none focus-visible:outline-2 focus-visible:outline-primary",loading:"lazy",role:"button",tabindex:"0","aria-label":"Open last passing screenshot in lightbox",onClick:x[7]||(x[7]=N=>E.value=1),onKeydown:[x[8]||(x[8]=_e(N=>E.value=1,["enter"])),x[9]||(x[9]=_e($e(N=>E.value=1,["prevent"]),["space"]))]},null,40,cs)])])),k(O,{modelValue:t(E),"onUpdate:modelValue":x[10]||(x[10]=N=>Le(E)?E.value=N:null),images:t(Z)},null,8,["modelValue","images"])]),_:2},[e.storageKey?{name:"folded",fn:A(()=>[p("span",null,_(t(M)),1)]),key:"0"}:void 0]),1040)):C("",!0)}}}),Va=Object.assign(us,{__name:"VisualDiffCard"}),ds={class:"max-h-96 overflow-y-auto"},ps={key:0,class:"mt-2 text-xs text-gray-400 dark:text-gray-500"},Ze=2e4,fs=pe({__name:"DomSnapshotCard",props:{runId:{},testRunsCaseId:{},storageKey:{}},setup(e,{expose:r}){const a=e,c=L(()=>a.storageKey?De:je),n=L(()=>a.storageKey?{storageKey:a.storageKey}:{}),{data:s,pending:l,error:f}=Ue(()=>`/api/test-runs/${a.runId}/cases/${a.testRunsCaseId}/dom-snapshot`,{lazy:!0},"$rAu-vOWv77"),i=L(()=>(s.value?.html??"").slice(0,Ze)),m=L(()=>(s.value?.html?.length??0)>Ze),v=L(()=>{const $=s.value;return!$||$.status!=="ok"?"":`${Math.round(($.html?.length??0)/1024)} KB · rendered from the uploaded trace${$.snapshotName?` (${$.snapshotName})`:""}`}),{copy:R,copied:g}=He(),T=G(null);return r({reveal:()=>T.value?.reveal?.()}),($,S)=>{const K=Ie,M=Ut,Z=jt;return!t(l)&&!t(f)&&t(s)?.status==="ok"&&t(s).html?(o(),F(Se(t(c)),Ne({key:0,ref_key:"card",ref:T},t(n),{icon:"i-lucide-file-code",title:"DOM snapshot",help:"dom-snapshot",subtitle:t(v)}),Re({actions:A(()=>[k(M,{text:t(g)?"Copied!":"Copy full HTML"},{default:A(()=>[k(K,{size:"xs",variant:"ghost",color:"neutral",icon:t(g)?"i-lucide-check":"i-lucide-clipboard",onClick:S[0]||(S[0]=E=>t(R)(t(s).html))},null,8,["icon"])]),_:1},8,["text"])]),default:A(()=>[p("div",ds,[k(Z,{code:t(i),lang:"xml"},null,8,["code"])]),t(m)||t(s).truncated?(o(),u("p",ps,[t(m)?(o(),u(te,{key:0},[P("Showing the first "+_(Math.round(Ze/1e3))+"k characters — use Copy for the full document.",1)],64)):(o(),u(te,{key:1},[P("The snapshot was truncated to its size cap.")],64))])):C("",!0)]),_:2},[e.storageKey?{name:"folded",fn:A(()=>[p("span",null,"Failure-time HTML extracted from the trace — "+_(Math.round((t(s).html.length??0)/1024))+" KB",1)]),key:"0"}:void 0]),1040,["subtitle"])):C("",!0)}}}),Ha=Object.assign(fs,{__name:"DomSnapshotCard"}),ms={class:"rounded-md border border-default overflow-hidden"},gs={class:"text-xs font-semibold text-gray-600 dark:text-gray-300 flex-1"},hs={key:0,class:"text-gray-400 font-normal ml-1"},ys={key:0},xs=pe({__name:"TestEvidenceSection",props:We({icon:{},label:{},count:{},collapsible:{type:Boolean}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(e){const r=e,a=at(e,"open"),c=L(()=>r.collapsible===!1||a.value);return(n,s)=>{const l=we;return o(),u("div",ms,[(o(),F(Se(e.collapsible===!1?"div":"button"),{class:me(["w-full flex items-center gap-1.5 px-3 py-2 bg-elevated border-b border-default text-left",e.collapsible!==!1&&"hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors cursor-pointer"]),onClick:s[0]||(s[0]=f=>e.collapsible!==!1&&(a.value=!a.value))},{default:A(()=>[k(l,{name:e.icon,class:"size-3.5 shrink-0 text-primary/70"},null,8,["name"]),p("span",gs,[P(_(e.label),1),e.count!=null?(o(),u("span",hs,"("+_(e.count)+")",1)):C("",!0)]),e.collapsible!==!1?(o(),F(l,{key:0,name:a.value?"i-lucide-chevron-up":"i-lucide-chevron-down",class:"size-3.5 text-gray-400"},null,8,["name"])):C("",!0)]),_:1},8,["class"])),t(c)?(o(),u("div",ys,[Oe(n.$slots,"default")])):C("",!0)])}}}),Xe=Object.assign(xs,{__name:"TestEvidenceSection"}),vs={class:"grid grid-cols-2 gap-2 p-2 bg-gray-50 dark:bg-gray-900"},bs=["aria-label","onClick","onKeydown"],ks=["src","alt"],_s={class:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-black/30"},$s={class:"absolute bottom-0 inset-x-0 px-1.5 py-0.5 text-[10px] text-white bg-black/50 truncate"},ws=pe({__name:"TestEvidenceScreenshots",props:{attachments:{}},setup(e){const r=e,a=ze();function c(l){return l.split("/").pop()||l}const n=L(()=>r.attachments.filter(l=>Kt(l.path,l.contentType)).map(l=>({src:Me(l.path,l.contentType,a.app?.baseURL),name:l.name||c(l.path)}))),s=G(null);return(l,f)=>{const i=we,m=mt,v=Xe;return t(n).length>0?(o(),F(v,{key:0,icon:"i-lucide-image",label:"Screenshots",count:t(n).length,collapsible:!1},{default:A(()=>[p("div",vs,[(o(!0),u(te,null,ge(t(n),(R,g)=>(o(),u("div",{key:R.src,class:"relative group cursor-pointer rounded overflow-hidden border border-default outline-none focus-visible:outline-2 focus-visible:outline-primary",role:"button",tabindex:"0","aria-label":`View screenshot ${R.name}`,onClick:T=>s.value=g,onKeydown:[_e(T=>s.value=g,["enter"]),_e($e(T=>s.value=g,["prevent"]),["space"])]},[p("img",{src:R.src,alt:R.name,class:"w-full h-28 object-cover object-top transition-opacity group-hover:opacity-80",loading:"lazy"},null,8,ks),p("div",_s,[k(i,{name:"i-lucide-zoom-in",class:"size-5 text-white"})]),p("p",$s,_(R.name),1)],40,bs))),128))]),k(m,{modelValue:t(s),"onUpdate:modelValue":f[0]||(f[0]=R=>Le(s)?s.value=R:null),images:t(n)},null,8,["modelValue","images"])]),_:1},8,["count"])):C("",!0)}}}),Fa=Object.assign(ws,{__name:"TestEvidenceScreenshots"}),Cs={class:"m-0"},Ts={class:"bg-black rounded overflow-hidden"},Ss=["src"],As=["title"],Ls=pe({__name:"VideoPlayer",props:{src:{},label:{}},setup(e){return(r,a)=>(o(),u("figure",Cs,[p("div",Ts,[p("video",{src:e.src,controls:"",preload:"metadata",class:"w-full max-h-96"}," Your browser does not support the video tag. ",8,Ss)]),e.label?(o(),u("figcaption",{key:0,class:"mt-1 text-xs text-gray-400 truncate",title:e.label},_(e.label),9,As)):C("",!0)]))}}),Rs=Object.assign(Ls,{__name:"VideoPlayer"}),Is={class:"space-y-2 p-2 bg-gray-50 dark:bg-gray-900"},zs=pe({__name:"TestEvidenceVideos",props:{attachments:{}},setup(e){const r=e,a=ze();function c(s){return s.split("/").pop()||s}const n=L(()=>r.attachments.filter(s=>Vt(s.path,s.contentType)).map(s=>({src:Me(s.path,s.contentType,a.app?.baseURL),name:s.name||c(s.path)})));return(s,l)=>{const f=Rs,i=Xe;return t(n).length>0?(o(),F(i,{key:0,icon:"i-lucide-video",label:"Videos",count:t(n).length,collapsible:!1},{default:A(()=>[p("div",Is,[(o(!0),u(te,null,ge(t(n),m=>(o(),F(f,{key:m.src,src:m.src,label:m.name},null,8,["src","label"]))),128))])]),_:1},8,["count"])):C("",!0)}}}),qa=Object.assign(zs,{__name:"TestEvidenceVideos"}),Ps={class:"flex items-center justify-between gap-2"},Bs={class:"flex items-center gap-2 min-w-0"},Es={class:"text-sm truncate"},Os={key:0,class:"text-xs text-gray-400 shrink-0"},Ms={key:1,class:"text-xs text-gray-400 shrink-0"},Ns={class:"flex items-center gap-1.5 shrink-0"},Us=pe({__name:"TraceListItem",props:{trace:{},showTime:{type:Boolean,default:!0}},setup(e){const r=e,a=ze(),c=L(()=>(a.app?.baseURL??"/").replace(/\/$/,"")),n=L(()=>!!a.public.demoMode&&r.trace.filePath.startsWith("demo/")),s=L(()=>r.trace.filePath.split("/").pop()||r.trace.filePath),l=L(()=>ct(r.trace.filePath,a.app?.baseURL,n.value)),f=L(()=>n.value?`${c.value}/${r.trace.filePath}`:`${c.value}/api/files/${Ot(r.trace.filePath)}`);return(i,m)=>{const v=we,R=Ie;return o(),u("div",Ps,[p("div",Bs,[k(v,{name:"i-lucide-file-archive",class:"size-4 text-gray-400 shrink-0"}),p("span",Es,_(t(s)),1),e.trace.size?(o(),u("span",Os,_(("formatBytes"in i?i.formatBytes:t(Ht))(e.trace.size)),1)):C("",!0),e.showTime?(o(),u("span",Ms,_(("formatRelativeTime"in i?i.formatRelativeTime:t(Ye))(e.trace.createdAt)),1)):C("",!0)]),p("div",Ns,[k(R,{to:t(l),target:"_blank",icon:"i-lucide-bug-play",size:"xs",label:"View trace"},null,8,["to"]),k(R,{to:t(f),target:"_blank",icon:"i-lucide-download",size:"xs",color:"neutral",variant:"soft",label:"Download"},null,8,["to"])])])}}}),js=Object.assign(Us,{__name:"TraceListItem"}),Ds={key:0,class:"flex items-center justify-center py-4"},Ks={key:1,class:"divide-y divide-default"},Vs=pe({__name:"TestEvidenceTraces",props:{traces:{},loading:{type:Boolean}},setup(e){return(r,a)=>{const c=we,n=js,s=Xe;return e.loading||e.traces.length>0?(o(),F(s,{key:0,icon:"i-lucide-bug-play",label:"Traces",count:e.traces.length||null,collapsible:!1},{default:A(()=>[e.loading&&!e.traces.length?(o(),u("div",Ds,[k(c,{name:"i-lucide-loader-circle",class:"size-4 animate-spin text-gray-400"})])):(o(),u("div",Ks,[(o(!0),u(te,null,ge(e.traces,l=>(o(),F(n,{key:l.id,trace:l,class:"px-3 py-2"},null,8,["trace"]))),128))]))]),_:1},8,["count"])):C("",!0)}}}),Za=Object.assign(Vs,{__name:"TestEvidenceTraces"}),Hs={class:"space-y-2"},Fs={key:0,class:"rounded-lg border border-default overflow-hidden"},qs=["title"],Zs={key:2,class:"truncate text-gray-400 dark:text-gray-500"},Ws={class:"font-mono"},Js={key:0,class:"overflow-x-auto text-xs font-mono leading-relaxed py-1"},Ys={class:"min-w-max"},Gs={key:1,class:"rounded-lg border border-dashed border-default"},Qs=["onClick"],Xs={key:0,class:"px-3 pb-2 space-y-1"},ea=["title"],ta={key:0,class:"truncate font-mono shrink-0"},na=pe({__name:"TraceCallStack",props:{frames:{},projectKey:{},projectName:{}},setup(e){const r=e,a=L(()=>{if(!r.frames.some(R=>R.inProject))return r.frames.map((R,g)=>({kind:"frame",frame:R,frameIndex:g}));const i=[];let m=[];const v=()=>{m.length!==0&&(i.push({kind:"group",frames:m,key:`group-${i.length}`}),m=[])};return r.frames.forEach((R,g)=>{R.inProject?(v(),i.push({kind:"frame",frame:R,frameIndex:g})):m.push(R)}),v(),i}),c=L(()=>{const f=r.frames.findIndex(i=>i.inProject);return f>=0?f:0}),n=G(new Set);function s(f){const i=new Set(n.value);i.has(f)?i.delete(f):i.add(f),n.value=i}function l(f){return f.source?f.source.lines.map((i,m)=>{const v=f.source.startLine+m;return{lineNo:v,text:i,failing:v===f.line}}):[]}return(f,i)=>{const m=we,v=ut,R=Pe;return o(),u("div",Hs,[(o(!0),u(te,null,ge(t(a),g=>(o(),u(te,{key:g.kind==="frame"?`f-${g.frameIndex}`:g.key},[g.kind==="frame"?(o(),u("div",Fs,[p("div",{class:me(["flex items-center gap-2 px-3 py-1.5 bg-elevated/40 text-xs",g.frame.source?"border-b border-default":""])},[k(m,{name:g.frameIndex===t(c)?"i-lucide-circle-x":"i-lucide-corner-left-up",class:me([g.frameIndex===t(c)?"text-red-500":"text-gray-400","size-3.5 shrink-0"])},null,8,["name","class"]),g.frame.inProject?(o(),F(v,{key:0,"file-path":g.frame.file,line:g.frame.line,column:g.frame.column,"project-key":e.projectKey,"project-name":e.projectName,class:"min-w-0"},null,8,["file-path","line","column","project-key","project-name"])):(o(),u("code",{key:1,class:"truncate text-gray-500 dark:text-gray-400",title:g.frame.absFile||g.frame.file},_(g.frame.file)+":"+_(g.frame.line),9,qs)),g.frame.functionName?(o(),u("span",Zs,[i[0]||(i[0]=P(" in ",-1)),p("span",Ws,_(g.frame.functionName),1)])):C("",!0),k(R,{color:g.frameIndex===t(c)?"error":"neutral",variant:"subtle",size:"xs",class:"ml-auto shrink-0"},{default:A(()=>[P(_(g.frameIndex===t(c)?"Failed here":"Caller"),1)]),_:2},1032,["color"])],2),g.frame.source?(o(),u("div",Js,[p("div",Ys,[(o(!0),u(te,null,ge(l(g.frame),T=>(o(),u("div",{key:T.lineNo,class:me(["px-3 whitespace-pre flex",T.failing?"bg-red-50 dark:bg-red-950/30 text-red-700 dark:text-red-300 font-medium":"text-gray-600 dark:text-gray-400"])},[p("span",{class:me(["w-10 shrink-0 text-right pr-3 tabular-nums select-none",T.failing?"text-red-400 dark:text-red-500":"text-gray-300 dark:text-gray-600"])},_(T.lineNo),3),p("span",null,_(T.text),1)],2))),128))])])):C("",!0)])):(o(),u("div",Gs,[p("button",{type:"button",class:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300",onClick:T=>s(g.key)},[k(m,{name:t(n).has(g.key)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3.5 shrink-0"},null,8,["name"]),P(" "+_(g.frames.length)+" frame"+_(g.frames.length===1?"":"s")+" in dependencies ",1)],8,Qs),t(n).has(g.key)?(o(),u("div",Xs,[(o(!0),u(te,null,ge(g.frames,(T,$)=>(o(),u("div",{key:$,class:"flex items-center gap-2 text-xs text-gray-400 dark:text-gray-500 min-w-0"},[k(m,{name:"i-lucide-corner-left-up",class:"size-3 shrink-0"}),p("code",{class:"truncate",title:T.absFile||T.file},_(T.file)+":"+_(T.line),9,ea),T.functionName?(o(),u("span",ta,_(T.functionName),1)):C("",!0)]))),128))])):C("",!0)]))],64))),128))])}}}),Wa=Object.assign(na,{__name:"TraceCallStack"}),oa={class:"space-y-2"},sa={class:"flex items-center gap-2 px-3 py-1.5 bg-elevated/40 border-b border-default text-xs"},aa={class:"overflow-x-auto text-xs font-mono leading-relaxed py-1"},ra={class:"min-w-max"},ia=pe({__name:"TestSourceStack",props:{frames:{},projectKey:{},projectName:{}},setup(e){function r(a){return a.split(`
5
+ `).map(c=>({text:c,failing:c.startsWith(">")}))}return(a,c)=>{const n=we,s=ut,l=Pe;return o(),u("div",oa,[(o(!0),u(te,null,ge(e.frames,(f,i)=>(o(),u("div",{key:`${f.file}:${f.line}:${i}`,class:"rounded-lg border border-default overflow-hidden"},[p("div",sa,[k(n,{name:i===0?"i-lucide-circle-x":"i-lucide-corner-left-up",class:me([i===0?"text-red-500":"text-gray-400","size-3.5 shrink-0"])},null,8,["name","class"]),k(s,{"file-path":f.file,line:f.line,"project-key":e.projectKey,"project-name":e.projectName,class:"min-w-0"},null,8,["file-path","line","project-key","project-name"]),k(l,{color:i===0?"error":"neutral",variant:"subtle",size:"xs",class:"ml-auto shrink-0"},{default:A(()=>[P(_(i===0?"Failed here":"Caller"),1)]),_:2},1032,["color"])]),p("div",aa,[p("div",ra,[(o(!0),u(te,null,ge(r(f.snippet),(m,v)=>(o(),u("div",{key:v,class:me(["px-3 whitespace-pre",m.failing?"bg-red-50 dark:bg-red-950/30 text-red-700 dark:text-red-300 font-medium":"text-gray-600 dark:text-gray-400"])},_(m.text),3))),128))])])]))),128))])}}}),Ja=Object.assign(ia,{__name:"TestSourceStack"}),la={class:"space-y-3 text-sm"},ca={key:0,class:"flex flex-col gap-0.5"},ua={class:"text-xs font-mono break-all"},da={key:1,class:"flex flex-col gap-0.5"},pa={class:"text-xs font-mono break-all"},fa={class:"grid grid-cols-1 gap-3 sm:grid-cols-2"},ma={class:"text-xs font-medium text-gray-500 dark:text-gray-400"},ga={key:0,class:"text-xs text-gray-400"},ha={key:1,class:"mt-1 space-y-0.5"},ya={class:"text-gray-400"},xa={class:"text-xs font-medium text-gray-500 dark:text-gray-400"},va={key:0,class:"text-xs text-gray-400"},ba={key:1,class:"mt-1 space-y-0.5"},ka={key:0,class:"text-gray-400"},_a={class:"text-gray-400"},$a=pe({__name:"PageStateCard",props:{pageState:{},storageKey:{},plain:{type:Boolean}},setup(e){const r=e,a=L(()=>r.plain?"div":r.storageKey?De:je),c=L(()=>r.plain?{}:{icon:"i-lucide-database",title:"App state at test end",help:"page-state",...r.storageKey?{storageKey:r.storageKey}:{}}),n=l=>[l.httpOnly?"HttpOnly":null,l.secure?"Secure":null,l.sameSite??null].filter(Boolean).join(", "),s=L(()=>{const l=r.pageState;return[`${l.localStorage.length} localStorage`,`${l.sessionStorage.length} sessionStorage`,`${l.cookies.length} cookie${l.cookies.length===1?"":"s"}`].join(" · ")});return(l,f)=>(o(),F(Se(t(a)),Lt(Rt(t(c))),Re({default:A(()=>[p("div",la,[e.pageState.url?(o(),u("div",ca,[f[0]||(f[0]=p("span",{class:"text-xs font-medium text-gray-500 dark:text-gray-400"},"URL",-1)),p("code",ua,_(e.pageState.url)+_(e.pageState.hash??""),1)])):C("",!0),e.pageState.historyState?(o(),u("div",da,[f[1]||(f[1]=p("span",{class:"text-xs font-medium text-gray-500 dark:text-gray-400"},"History state",-1)),p("code",pa,_(e.pageState.historyState),1)])):C("",!0),p("div",fa,[(o(!0),u(te,null,ge({localStorage:e.pageState.localStorage,sessionStorage:e.pageState.sessionStorage},(i,m)=>(o(),u("div",{key:m},[p("span",ma,_(m)+" ("+_(i.length)+")",1),i.length===0?(o(),u("p",ga,"empty")):(o(),u("ul",ha,[(o(!0),u(te,null,ge(i,v=>(o(),u("li",{key:v.key,class:"text-xs font-mono truncate"},[P(_(v.key)+" ",1),p("span",ya,"("+_(v.length)+" ch)",1)]))),128))]))]))),128))]),p("div",null,[p("span",xa,"Cookies ("+_(e.pageState.cookies.length)+")",1),e.pageState.cookies.length===0?(o(),u("p",va,"none")):(o(),u("ul",ba,[(o(!0),u(te,null,ge(e.pageState.cookies,i=>(o(),u("li",{key:i.name+i.domain,class:"text-xs font-mono truncate"},[P(_(i.name)+" ",1),n(i)?(o(),u("span",ka,"["+_(n(i))+"]",1)):C("",!0),p("span",_a,"· "+_(i.domain),1)]))),128))]))]),f[2]||(f[2]=p("p",{class:"text-[11px] text-gray-400 dark:text-gray-500"}," Storage values and cookie values are never captured — key names, lengths and flags only. ",-1))])]),_:2},[e.storageKey&&!e.plain?{name:"folded",fn:A(()=>[p("span",null,_(t(s)),1)]),key:"0"}:void 0]),1040))}}),Ya=Object.assign($a,{__name:"PageStateCard"});function Ga(e={}){const r=G(!1),a=Je();let c=null;async function n(s,l,f={}){try{typeof ClipboardItem<"u"?await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([s],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})})]):await navigator.clipboard.writeText(s),r.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{r.value=!1,c=null},e.duration??2e3),f.toast&&a.add({title:typeof f.toast=="string"?f.toast:"Copied to clipboard",icon:"i-lucide-check",color:"success",duration:2e3})}catch{}}return{copyRich:n,copied:r}}export{Xe as _,Fa as a,qa as b,Za as c,Wa as d,Ja as e,Ya as f,cn as g,De as h,Da as i,Ka as j,Va as k,Ha as l,ja as m,js as n,Rs as o,mt as p,Ga as u};
@@ -1 +1 @@
1
- import{d as h,b as U,c as r,j as t,g as s,o as i,k as l,F as _,i as o,G as $,m,C as B,E as V,l as C,_ as F,p as E,r as c}from"./CNu3kken.js";import{_ as N}from"./Ya8ZzWuY.js";import{_ as S}from"./CF_eDZHu.js";import{_ as I}from"./B_JSV0yG.js";import"./DZ-KbUZi.js";const T={class:"min-h-screen flex items-center justify-center bg-elevated/50"},j={class:"flex items-center gap-2"},P={class:"mt-4 text-center"},q={class:"mt-4 text-center"},D=h({__name:"forgot-password",setup(z){const f=U(),a=c(""),n=c(!1),d=c(!1);async function p(){if(a.value){n.value=!0;try{await $fetch("/api/auth/forgot-password",{method:"POST",body:{email:a.value}}),d.value=!0}catch{f.add({title:"Something went wrong",description:"Please try again.",color:"error"})}finally{n.value=!1}}}return(A,e)=>{const x=E,g=N,u=$,y=V,k=S,v=F,w=I;return i(),r("div",T,[t(w,{class:"w-full max-w-md"},{header:s(()=>[o("div",j,[t(x,{name:"i-lucide-key-round",class:"size-6"}),e[1]||(e[1]=o("h1",{class:"text-2xl font-bold"},"Forgot password",-1))])]),default:s(()=>[l(d)?(i(),r(_,{key:0},[t(g,{color:"success",icon:"i-lucide-mail-check",title:"Check your email",description:"If an account with that email exists, a reset link has been sent."}),o("div",P,[t(u,{to:"/login",class:"text-sm text-gray-500 hover:text-gray-700 dark:hover:text-gray-300"},{default:s(()=>[...e[2]||(e[2]=[m(" Back to login ",-1)])]),_:1})])],64)):(i(),r(_,{key:1},[e[5]||(e[5]=o("p",{class:"text-sm text-gray-500 mb-4"}," Enter your email address and we'll send you a link to reset your password. ",-1)),o("form",{class:"space-y-4",onSubmit:B(p,["prevent"])},[t(k,{label:"Email",name:"email",required:""},{default:s(()=>[t(y,{modelValue:l(a),"onUpdate:modelValue":e[0]||(e[0]=b=>C(a)?a.value=b:null),type:"email",placeholder:"you@example.com",autocomplete:"email",disabled:l(n),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),t(v,{type:"submit",block:"",loading:l(n)},{default:s(()=>[...e[3]||(e[3]=[m("Send reset link",-1)])]),_:1},8,["loading"])],32),o("div",q,[t(u,{to:"/login",class:"text-sm text-gray-500 hover:text-gray-700 dark:hover:text-gray-300"},{default:s(()=>[...e[4]||(e[4]=[m(" Back to login ",-1)])]),_:1})])],64))]),_:1})])}}});export{D as default};
1
+ import{d as h,b as U,c as r,j as t,g as s,o as i,k as l,F as _,i as o,G as $,m,C as B,E as V,l as C,_ as F,p as E,r as c}from"./C5TrTuWv.js";import{_ as N}from"./BBhrClA9.js";import{_ as S}from"./DH5H1DJh.js";import{_ as I}from"./C8Paf_V1.js";import"./D_y2VS8k.js";const T={class:"min-h-screen flex items-center justify-center bg-elevated/50"},j={class:"flex items-center gap-2"},P={class:"mt-4 text-center"},q={class:"mt-4 text-center"},D=h({__name:"forgot-password",setup(z){const f=U(),a=c(""),n=c(!1),d=c(!1);async function p(){if(a.value){n.value=!0;try{await $fetch("/api/auth/forgot-password",{method:"POST",body:{email:a.value}}),d.value=!0}catch{f.add({title:"Something went wrong",description:"Please try again.",color:"error"})}finally{n.value=!1}}}return(A,e)=>{const x=E,g=N,u=$,y=V,k=S,v=F,w=I;return i(),r("div",T,[t(w,{class:"w-full max-w-md"},{header:s(()=>[o("div",j,[t(x,{name:"i-lucide-key-round",class:"size-6"}),e[1]||(e[1]=o("h1",{class:"text-2xl font-bold"},"Forgot password",-1))])]),default:s(()=>[l(d)?(i(),r(_,{key:0},[t(g,{color:"success",icon:"i-lucide-mail-check",title:"Check your email",description:"If an account with that email exists, a reset link has been sent."}),o("div",P,[t(u,{to:"/login",class:"text-sm text-gray-500 hover:text-gray-700 dark:hover:text-gray-300"},{default:s(()=>[...e[2]||(e[2]=[m(" Back to login ",-1)])]),_:1})])],64)):(i(),r(_,{key:1},[e[5]||(e[5]=o("p",{class:"text-sm text-gray-500 mb-4"}," Enter your email address and we'll send you a link to reset your password. ",-1)),o("form",{class:"space-y-4",onSubmit:B(p,["prevent"])},[t(k,{label:"Email",name:"email",required:""},{default:s(()=>[t(y,{modelValue:l(a),"onUpdate:modelValue":e[0]||(e[0]=b=>C(a)?a.value=b:null),type:"email",placeholder:"you@example.com",autocomplete:"email",disabled:l(n),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),t(v,{type:"submit",block:"",loading:l(n)},{default:s(()=>[...e[3]||(e[3]=[m("Send reset link",-1)])]),_:1},8,["loading"])],32),o("div",q,[t(u,{to:"/login",class:"text-sm text-gray-500 hover:text-gray-700 dark:hover:text-gray-300"},{default:s(()=>[...e[4]||(e[4]=[m(" Back to login ",-1)])]),_:1})])],64))]),_:1})])}}});export{D as default};
@@ -1,4 +1,4 @@
1
- import{b as ie,J as H,B as ye,an as he,r as x,h as K,ao as be,N as Ve,d as _e,k as e,o as m,c as h,j as u,p as ke,m as C,i as a,t as $,g as B,_ as Ce,F as J,y as oe,q as Q,v as T,A as qe,f as X,l as He,G as We,L as Ye}from"./CNu3kken.js";import{_ as Ge}from"./CfhOanaF.js";import{i as Xe,g as Je,f as Ke,d as Qe,e as Ze,h as et}from"./9_aJhhcm.js";import{_ as tt}from"./B0tmRAhY.js";import{f as we,n as st}from"./DeewM3Wg.js";import{_ as nt}from"./Ya8ZzWuY.js";import{f as at}from"./D-c8ZSws.js";import{u as ot}from"./CLWMETf9.js";import{u as it}from"./CAoQUDI4.js";const rt=globalThis.setInterval,re=Symbol("cluster-diagnosis");function lt(g){const b=ie(),o=x(""),r=x(""),k=x([]),S=x([]),_=K(()=>!!r.value),R=x(null),P=x([]),E=x(0),U=x(0),O=x(null),l=x(null),p=x(!1),s=x(null),i=x(!1);let c=null,f=null,d=!0;function z(){const n={};return o.value.trim()&&(n.baseCommit=o.value.trim()),k.value.length&&(n.selectedCommitShas=k.value),n}async function D(){p.value=!0;try{const n=await $fetch(`/api/failure-clusters/${g}/context`,{query:{...z(),format:"json"}});R.value=n.text,P.value=n.sections,E.value=n.tokenEstimate,U.value=n.imageTokenEstimate??0,O.value=n.coverage,l.value=n.scmChanges??null}catch{R.value="(failed to load context)",P.value=[],E.value=0,U.value=0,O.value=null,l.value=null}finally{p.value=!1}}async function I(n){try{await $fetch(`/api/failure-clusters/${g}/base-commit`,{method:"PATCH",body:{commit:n||null}}),r.value=n}catch{}}function L(){c&&(clearInterval(c),c=null)}function j(){if(c)return;let n=0;c=rt(async()=>{n+=3e3,await q(),(!s.value||s.value.status!=="running"||n>=12e4)&&L()},3e3)}async function q(){try{const n=await $fetch(`/api/failure-clusters/${g}/diagnosis`);s.value=n.diagnosis}catch{}}async function W(n={}){i.value=!0;try{const w=n.force?`/api/failure-clusters/${g}/diagnose?force=true`:`/api/failure-clusters/${g}/diagnose`,F={};n.additionalContext&&(F.additionalContext=n.additionalContext),o.value.trim()&&(F.baseCommit=o.value.trim()),k.value.length&&(F.selectedCommitShas=k.value),n.images?.length&&(F.images=n.images),s.value=await $fetch(w,{method:"POST",body:Object.keys(F).length?F:void 0}),s.value?.status==="running"&&j()}catch(w){w?.statusCode===409?j():b.add({title:"Diagnosis failed",description:String(w?.message??w),color:"error"})}finally{i.value=!1}}return H(o,n=>{d||(f&&clearTimeout(f),f=setTimeout(()=>D(),900),n!==r.value&&I(n))}),H(k,()=>{d||D()},{deep:!0}),H(s,n=>{n?.status==="running"?j():L()}),ye(async()=>{try{const n=await $fetch(`/api/failure-clusters/${g}/diagnosis`);s.value=n.diagnosis,n.manualBaseCommit&&(r.value=n.manualBaseCommit,o.value=n.manualBaseCommit);const w=n.diagnosis?.details;w?.selectedCommitShas&&Array.isArray(w.selectedCommitShas)&&(k.value=w.selectedCommitShas),w?.autoSelectedCommits&&Array.isArray(w.autoSelectedCommits)&&(S.value=w.autoSelectedCommits)}catch{}d=!1,D(),s.value?.status==="running"&&j()}),he(()=>{L(),f&&clearTimeout(f)}),{clusterId:g,baseCommit:o,savedBaseCommit:r,selectedCommitShas:k,autoSelectedCommits:S,baseCommitIsPinned:_,contextText:R,contextSections:P,tokenEstimate:E,imageTokenEstimate:U,coverage:O,scmChanges:l,contextLoading:p,refreshContext:D,diagnosis:s,posting:i,runDiagnosis:W}}function ct(g){const b=lt(g);return Ve(re,b),b}function zs(){const g=be(re);if(!g)throw new Error("useClusterDiagnosis() must be used under a page that called provideClusterDiagnosis()");return g}function ut(g){const b=be(re,null);if(b)return b;if(g==null)throw new Error("useOrProvideClusterDiagnosis() requires a clusterId when used outside provideClusterDiagnosis()");return ct(g)}const dt={key:0,class:"flex items-center gap-1.5 text-xs text-gray-400 py-1"},ft={key:1,class:"space-y-1.5"},mt={class:"flex items-center justify-between"},gt={class:"text-xs font-medium text-gray-500"},pt={class:"text-gray-400 font-normal"},vt={class:"flex gap-0.5"},xt={class:"grid grid-cols-4 gap-1.5"},yt=["onClick"],ht={class:"relative"},bt=["src","alt"],_t={class:"absolute top-0.5 right-0.5"},kt={class:"px-1 py-0.5 bg-elevated space-y-0.5"},Ct=["title"],wt={class:"flex items-center gap-1 flex-wrap"},St={key:0,class:"text-[8px] text-gray-400 leading-tight"},Tt={key:1,class:"text-[8px] text-gray-400 leading-tight truncate"},$t={key:2,class:"text-[8px] text-gray-400 leading-tight ml-auto"},xe=8,Dt=_e({__name:"DiagnosisScreenshots",props:{affectedTestCases:{}},emits:["update:images"],setup(g,{emit:b}){const o=g,r=b,k=qe();async function S(s){const i=(s.type||"image/webp").split(";")[0].trim();return new Promise((c,f)=>{const d=new FileReader;d.onload=()=>{const z=d.result.split(",")[1];z!=null?c({data:z,mediaType:i}):f(new Error("Failed to read blob"))},d.onerror=f,d.readAsDataURL(s)})}const _=x([]),R=x(!1);async function P(){if(!o.affectedTestCases.length)return;R.value=!0,_.value=[];const s=[];for(const i of o.affectedTestCases){if(s.length>=xe)break;try{const c=await $fetch(`/api/test-run-cases/${i.recentTestRunsCaseId}`);for(const f of c.attachments??[]){if(!Xe(f.path,f.contentType))continue;if(s.length>=xe)break;const d=f.name||f.path.split("/").pop()||"screenshot",z=st(f.path,f.contentType,k.app?.baseURL,!0);try{const D=await fetch(z);if(!D.ok)continue;const I=await D.blob(),{data:L,mediaType:j}=await S(I);s.push({src:`data:${j};base64,${L}`,data:L,mediaType:j,name:d,selected:!0,caseTitle:i.title,status:c.status,retries:c.retries,browser:c.browser,startTime:c.testRun?.startTime??null})}catch{}}}catch{}}_.value=s,R.value=!1,E()}function E(){r("update:images",_.value.filter(s=>s.selected).map(({name:s,mediaType:i,data:c})=>({name:s,mediaType:i,data:c})))}function U(s){_.value[s].selected=!_.value[s].selected,E()}function O(){_.value.forEach(s=>s.selected=!0),E()}function l(){_.value.forEach(s=>s.selected=!1),E()}const p=K(()=>_.value.filter(s=>s.selected).length);return ye(P),(s,i)=>{const c=ke,f=Ce;return e(R)?(m(),h("div",dt,[u(c,{name:"i-lucide-loader-2",class:"size-3 animate-spin"}),i[0]||(i[0]=C(" Loading screenshots from test evidence… ",-1))])):e(_).length?(m(),h("div",ft,[a("div",mt,[a("span",gt,[i[1]||(i[1]=C(" Test screenshots ",-1)),a("span",pt,"("+$(e(p))+"/"+$(e(_).length)+" will be sent to AI)",1)]),a("div",vt,[u(f,{size:"xs",color:"neutral",variant:"ghost",onClick:O},{default:B(()=>[...i[2]||(i[2]=[C("All",-1)])]),_:1}),u(f,{size:"xs",color:"neutral",variant:"ghost",onClick:l},{default:B(()=>[...i[3]||(i[3]=[C("None",-1)])]),_:1})])]),a("div",xt,[(m(!0),h(J,null,oe(e(_),(d,z)=>(m(),h("div",{key:z,class:Q(["cursor-pointer rounded overflow-hidden border-2 transition-all",d.selected?"border-primary":"border-default opacity-50"]),onClick:D=>U(z)},[a("div",ht,[a("img",{src:d.src,alt:d.name,class:"w-full h-14 object-cover object-top"},null,8,bt),a("div",_t,[u(c,{name:d.selected?"i-lucide-check-circle-2":"i-lucide-circle",class:Q(["size-3.5 drop-shadow",d.selected?"text-primary":"text-gray-300"])},null,8,["name","class"])])]),a("div",kt,[a("p",{class:"text-[9px] text-gray-700 dark:text-gray-300 truncate font-medium leading-tight",title:d.caseTitle},$(d.caseTitle),9,Ct),a("div",wt,[a("span",{class:Q(["text-[8px] px-1 rounded leading-tight font-medium",d.status==="passed"?"bg-success/15 text-success":d.status==="failed"?"bg-error/15 text-error":"bg-neutral/15 text-gray-500"])},$(d.status),3),d.retries>0?(m(),h("span",St,"retry "+$(d.retries),1)):T("",!0),d.browser?(m(),h("span",Tt,$(d.browser),1)):T("",!0),d.startTime?(m(),h("span",$t,$(e(we)(d.startTime)),1)):T("",!0)])])],10,yt))),128))])])):T("",!0)}}}),At=Object.assign(Dt,{__name:"DiagnosisScreenshots"});function zt(g){const b=x(""),o=x(null),r=x("idle"),k=x(null),S=x(null);let _=null;function R(){_&&(_.abort(),_=null),r.value==="streaming"&&(r.value="cancelled")}function P(){R(),b.value="",o.value=null,r.value="idle",k.value=null,S.value=null}async function E(l={}){b.value="",o.value=null,S.value=null,k.value=null,r.value="streaming";const p=e(g);_=new AbortController;const s=new URLSearchParams;l.force&&s.set("force","true");const i=`/api/failure-clusters/${p}/diagnose/stream${s.toString()?"?"+s.toString():""}`;try{const c=await $fetch.raw(i,{method:"POST",body:{additionalContext:l.additionalContext,images:l.images,baseCommit:l.baseCommit,selectedCommitShas:l.selectedCommitShas,scope:l.scope,testRunsCaseId:l.testRunsCaseId},responseType:"stream",signal:_.signal,ignoreResponseError:!0}),f=c._data??c.body;if(!f)throw new Error("No response body from streaming endpoint");let d;if(f instanceof ReadableStream)d=f.getReader();else if(f instanceof Uint8Array||f instanceof ArrayBuffer){const L=new TextDecoder().decode(f instanceof ArrayBuffer?new Uint8Array(f):f);O(L),r.value==="streaming"&&(r.value="error",S.value="Stream ended without a result event");return}else if(typeof f?.getReader=="function")d=f.getReader();else if(f?.pipeThrough)d=f.getReader();else throw new Error("Unsupported stream response format");const z=new TextDecoder;let D="";for(;;){const{done:I,value:L}=await d.read();if(I)break;D+=z.decode(L,{stream:!0});const j=D.split(`
1
+ import{b as ie,J as H,B as ye,an as he,r as x,h as K,ao as be,N as Ve,d as _e,k as e,o as m,c as h,j as u,p as ke,m as C,i as a,t as $,g as B,_ as Ce,F as J,y as oe,q as Q,v as T,A as qe,f as X,l as He,G as We,L as Ye}from"./C5TrTuWv.js";import{_ as Ge}from"./B69RP95P.js";import{i as Xe,g as Je,f as Ke,d as Qe,e as Ze,h as et}from"./CX_G-FHC.js";import{_ as tt}from"./BfA6lfg4.js";import{f as we,n as st}from"./DMtrFQqi.js";import{_ as nt}from"./BBhrClA9.js";import{f as at}from"./D-c8ZSws.js";import{u as ot}from"./CGHV0Y2d.js";import{u as it}from"./opwuUqHG.js";const rt=globalThis.setInterval,re=Symbol("cluster-diagnosis");function lt(g){const b=ie(),o=x(""),r=x(""),k=x([]),S=x([]),_=K(()=>!!r.value),R=x(null),P=x([]),E=x(0),U=x(0),O=x(null),l=x(null),p=x(!1),s=x(null),i=x(!1);let c=null,f=null,d=!0;function z(){const n={};return o.value.trim()&&(n.baseCommit=o.value.trim()),k.value.length&&(n.selectedCommitShas=k.value),n}async function D(){p.value=!0;try{const n=await $fetch(`/api/failure-clusters/${g}/context`,{query:{...z(),format:"json"}});R.value=n.text,P.value=n.sections,E.value=n.tokenEstimate,U.value=n.imageTokenEstimate??0,O.value=n.coverage,l.value=n.scmChanges??null}catch{R.value="(failed to load context)",P.value=[],E.value=0,U.value=0,O.value=null,l.value=null}finally{p.value=!1}}async function I(n){try{await $fetch(`/api/failure-clusters/${g}/base-commit`,{method:"PATCH",body:{commit:n||null}}),r.value=n}catch{}}function L(){c&&(clearInterval(c),c=null)}function j(){if(c)return;let n=0;c=rt(async()=>{n+=3e3,await q(),(!s.value||s.value.status!=="running"||n>=12e4)&&L()},3e3)}async function q(){try{const n=await $fetch(`/api/failure-clusters/${g}/diagnosis`);s.value=n.diagnosis}catch{}}async function W(n={}){i.value=!0;try{const w=n.force?`/api/failure-clusters/${g}/diagnose?force=true`:`/api/failure-clusters/${g}/diagnose`,F={};n.additionalContext&&(F.additionalContext=n.additionalContext),o.value.trim()&&(F.baseCommit=o.value.trim()),k.value.length&&(F.selectedCommitShas=k.value),n.images?.length&&(F.images=n.images),s.value=await $fetch(w,{method:"POST",body:Object.keys(F).length?F:void 0}),s.value?.status==="running"&&j()}catch(w){w?.statusCode===409?j():b.add({title:"Diagnosis failed",description:String(w?.message??w),color:"error"})}finally{i.value=!1}}return H(o,n=>{d||(f&&clearTimeout(f),f=setTimeout(()=>D(),900),n!==r.value&&I(n))}),H(k,()=>{d||D()},{deep:!0}),H(s,n=>{n?.status==="running"?j():L()}),ye(async()=>{try{const n=await $fetch(`/api/failure-clusters/${g}/diagnosis`);s.value=n.diagnosis,n.manualBaseCommit&&(r.value=n.manualBaseCommit,o.value=n.manualBaseCommit);const w=n.diagnosis?.details;w?.selectedCommitShas&&Array.isArray(w.selectedCommitShas)&&(k.value=w.selectedCommitShas),w?.autoSelectedCommits&&Array.isArray(w.autoSelectedCommits)&&(S.value=w.autoSelectedCommits)}catch{}d=!1,D(),s.value?.status==="running"&&j()}),he(()=>{L(),f&&clearTimeout(f)}),{clusterId:g,baseCommit:o,savedBaseCommit:r,selectedCommitShas:k,autoSelectedCommits:S,baseCommitIsPinned:_,contextText:R,contextSections:P,tokenEstimate:E,imageTokenEstimate:U,coverage:O,scmChanges:l,contextLoading:p,refreshContext:D,diagnosis:s,posting:i,runDiagnosis:W}}function ct(g){const b=lt(g);return Ve(re,b),b}function zs(){const g=be(re);if(!g)throw new Error("useClusterDiagnosis() must be used under a page that called provideClusterDiagnosis()");return g}function ut(g){const b=be(re,null);if(b)return b;if(g==null)throw new Error("useOrProvideClusterDiagnosis() requires a clusterId when used outside provideClusterDiagnosis()");return ct(g)}const dt={key:0,class:"flex items-center gap-1.5 text-xs text-gray-400 py-1"},ft={key:1,class:"space-y-1.5"},mt={class:"flex items-center justify-between"},gt={class:"text-xs font-medium text-gray-500"},pt={class:"text-gray-400 font-normal"},vt={class:"flex gap-0.5"},xt={class:"grid grid-cols-4 gap-1.5"},yt=["onClick"],ht={class:"relative"},bt=["src","alt"],_t={class:"absolute top-0.5 right-0.5"},kt={class:"px-1 py-0.5 bg-elevated space-y-0.5"},Ct=["title"],wt={class:"flex items-center gap-1 flex-wrap"},St={key:0,class:"text-[8px] text-gray-400 leading-tight"},Tt={key:1,class:"text-[8px] text-gray-400 leading-tight truncate"},$t={key:2,class:"text-[8px] text-gray-400 leading-tight ml-auto"},xe=8,Dt=_e({__name:"DiagnosisScreenshots",props:{affectedTestCases:{}},emits:["update:images"],setup(g,{emit:b}){const o=g,r=b,k=qe();async function S(s){const i=(s.type||"image/webp").split(";")[0].trim();return new Promise((c,f)=>{const d=new FileReader;d.onload=()=>{const z=d.result.split(",")[1];z!=null?c({data:z,mediaType:i}):f(new Error("Failed to read blob"))},d.onerror=f,d.readAsDataURL(s)})}const _=x([]),R=x(!1);async function P(){if(!o.affectedTestCases.length)return;R.value=!0,_.value=[];const s=[];for(const i of o.affectedTestCases){if(s.length>=xe)break;try{const c=await $fetch(`/api/test-run-cases/${i.recentTestRunsCaseId}`);for(const f of c.attachments??[]){if(!Xe(f.path,f.contentType))continue;if(s.length>=xe)break;const d=f.name||f.path.split("/").pop()||"screenshot",z=st(f.path,f.contentType,k.app?.baseURL,!0);try{const D=await fetch(z);if(!D.ok)continue;const I=await D.blob(),{data:L,mediaType:j}=await S(I);s.push({src:`data:${j};base64,${L}`,data:L,mediaType:j,name:d,selected:!0,caseTitle:i.title,status:c.status,retries:c.retries,browser:c.browser,startTime:c.testRun?.startTime??null})}catch{}}}catch{}}_.value=s,R.value=!1,E()}function E(){r("update:images",_.value.filter(s=>s.selected).map(({name:s,mediaType:i,data:c})=>({name:s,mediaType:i,data:c})))}function U(s){_.value[s].selected=!_.value[s].selected,E()}function O(){_.value.forEach(s=>s.selected=!0),E()}function l(){_.value.forEach(s=>s.selected=!1),E()}const p=K(()=>_.value.filter(s=>s.selected).length);return ye(P),(s,i)=>{const c=ke,f=Ce;return e(R)?(m(),h("div",dt,[u(c,{name:"i-lucide-loader-2",class:"size-3 animate-spin"}),i[0]||(i[0]=C(" Loading screenshots from test evidence… ",-1))])):e(_).length?(m(),h("div",ft,[a("div",mt,[a("span",gt,[i[1]||(i[1]=C(" Test screenshots ",-1)),a("span",pt,"("+$(e(p))+"/"+$(e(_).length)+" will be sent to AI)",1)]),a("div",vt,[u(f,{size:"xs",color:"neutral",variant:"ghost",onClick:O},{default:B(()=>[...i[2]||(i[2]=[C("All",-1)])]),_:1}),u(f,{size:"xs",color:"neutral",variant:"ghost",onClick:l},{default:B(()=>[...i[3]||(i[3]=[C("None",-1)])]),_:1})])]),a("div",xt,[(m(!0),h(J,null,oe(e(_),(d,z)=>(m(),h("div",{key:z,class:Q(["cursor-pointer rounded overflow-hidden border-2 transition-all",d.selected?"border-primary":"border-default opacity-50"]),onClick:D=>U(z)},[a("div",ht,[a("img",{src:d.src,alt:d.name,class:"w-full h-14 object-cover object-top"},null,8,bt),a("div",_t,[u(c,{name:d.selected?"i-lucide-check-circle-2":"i-lucide-circle",class:Q(["size-3.5 drop-shadow",d.selected?"text-primary":"text-gray-300"])},null,8,["name","class"])])]),a("div",kt,[a("p",{class:"text-[9px] text-gray-700 dark:text-gray-300 truncate font-medium leading-tight",title:d.caseTitle},$(d.caseTitle),9,Ct),a("div",wt,[a("span",{class:Q(["text-[8px] px-1 rounded leading-tight font-medium",d.status==="passed"?"bg-success/15 text-success":d.status==="failed"?"bg-error/15 text-error":"bg-neutral/15 text-gray-500"])},$(d.status),3),d.retries>0?(m(),h("span",St,"retry "+$(d.retries),1)):T("",!0),d.browser?(m(),h("span",Tt,$(d.browser),1)):T("",!0),d.startTime?(m(),h("span",$t,$(e(we)(d.startTime)),1)):T("",!0)])])],10,yt))),128))])])):T("",!0)}}}),At=Object.assign(Dt,{__name:"DiagnosisScreenshots"});function zt(g){const b=x(""),o=x(null),r=x("idle"),k=x(null),S=x(null);let _=null;function R(){_&&(_.abort(),_=null),r.value==="streaming"&&(r.value="cancelled")}function P(){R(),b.value="",o.value=null,r.value="idle",k.value=null,S.value=null}async function E(l={}){b.value="",o.value=null,S.value=null,k.value=null,r.value="streaming";const p=e(g);_=new AbortController;const s=new URLSearchParams;l.force&&s.set("force","true");const i=`/api/failure-clusters/${p}/diagnose/stream${s.toString()?"?"+s.toString():""}`;try{const c=await $fetch.raw(i,{method:"POST",body:{additionalContext:l.additionalContext,images:l.images,baseCommit:l.baseCommit,selectedCommitShas:l.selectedCommitShas,scope:l.scope,testRunsCaseId:l.testRunsCaseId},responseType:"stream",signal:_.signal,ignoreResponseError:!0}),f=c._data??c.body;if(!f)throw new Error("No response body from streaming endpoint");let d;if(f instanceof ReadableStream)d=f.getReader();else if(f instanceof Uint8Array||f instanceof ArrayBuffer){const L=new TextDecoder().decode(f instanceof ArrayBuffer?new Uint8Array(f):f);O(L),r.value==="streaming"&&(r.value="error",S.value="Stream ended without a result event");return}else if(typeof f?.getReader=="function")d=f.getReader();else if(f?.pipeThrough)d=f.getReader();else throw new Error("Unsupported stream response format");const z=new TextDecoder;let D="";for(;;){const{done:I,value:L}=await d.read();if(I)break;D+=z.decode(L,{stream:!0});const j=D.split(`
2
2
 
3
3
  `);D=j.pop()||"";let q=!1;for(const W of j){const n=U(W);if(n){if(n.event==="result")k.value=n.data,r.value="complete",q=!0;else if(n.event==="thinking"){const w=n.data;b.value+=w.text}else if(n.event==="stage")o.value=n.data.stage;else if(n.event==="error"){const w=n.data;S.value=w.message,r.value="error"}}}if(q)break}if(D.trim()){const I=U(D.trim());I&&(I.event==="result"?(k.value=I.data,r.value="complete"):I.event==="error"&&(S.value=I.data.message,r.value="error"))}r.value==="streaming"&&(S.value||(r.value="complete"))}catch(c){if(c?.name==="AbortError"){r.value="cancelled";return}S.value=String(c?.message??c),r.value="error"}finally{_=null}}function U(l){if(!l.trim())return null;const p=l.split(`
4
4
  `);let s="message",i="";for(const c of p)c.startsWith("event: ")?s=c.slice(7).trim():c.startsWith("data: ")?i+=c.slice(6):c.startsWith(":");if(!i)return null;try{return{event:s,data:JSON.parse(i)}}catch{return{event:s,data:i}}}function O(l){const p=l.split(`
@@ -1 +1 @@
1
- import{d as v,b2 as I,aC as y,b3 as F,B as g,ad as h,J as C,o as K,f as S,g as i,j as w,k as r,X as B,V as R,h as u,b4 as T,b5 as q,L as k,b6 as x}from"./CNu3kken.js";var _=v({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(d){const n=d,a=I(),f=y(),l=u(()=>n.tabStopId||f),c=u(()=>a.currentTabStopId.value===l.value),{getItems:p,CollectionItem:b}=F();g(()=>{n.focusable&&a.onFocusableItemAdd()}),h(()=>{n.focusable&&a.onFocusableItemRemove()}),C(()=>n.focusable,(e,t)=>{e!==t&&(e?a.onFocusableItemAdd():a.onFocusableItemRemove())});function m(e){if(e.key==="Tab"&&e.shiftKey){a.onItemShiftTab();return}if(e.target!==e.currentTarget)return;const t=T(e,a.orientation.value,a.dir.value);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!n.allowShiftKey&&e.shiftKey)return;e.preventDefault();let o=[...p().map(s=>s.ref).filter(s=>s.dataset.disabled!=="")];if(t==="last")o.reverse();else if(t==="prev"||t==="next"){t==="prev"&&o.reverse();const s=o.indexOf(e.currentTarget);o=a.loop.value?q(o,s+1):o.slice(s+1)}k(()=>x(o))}}return(e,t)=>(K(),S(r(b),null,{default:i(()=>[w(r(B),{tabindex:c.value?0:-1,"data-orientation":r(a).orientation.value,"data-active":e.active?"":void 0,"data-disabled":e.focusable?void 0:"",as:e.as,"as-child":e.asChild,onMousedown:t[0]||(t[0]=o=>{e.focusable?r(a).onItemFocus(l.value):o.preventDefault()}),onFocus:t[1]||(t[1]=o=>r(a).onItemFocus(l.value)),onKeydown:m},{default:i(()=>[R(e.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),j=_;export{j as R};
1
+ import{d as v,b2 as I,aC as y,b3 as F,B as g,ad as h,J as C,o as K,f as S,g as i,j as w,k as r,X as B,V as R,h as u,b4 as T,b5 as q,L as k,b6 as x}from"./C5TrTuWv.js";var _=v({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(d){const n=d,a=I(),f=y(),l=u(()=>n.tabStopId||f),c=u(()=>a.currentTabStopId.value===l.value),{getItems:p,CollectionItem:b}=F();g(()=>{n.focusable&&a.onFocusableItemAdd()}),h(()=>{n.focusable&&a.onFocusableItemRemove()}),C(()=>n.focusable,(e,t)=>{e!==t&&(e?a.onFocusableItemAdd():a.onFocusableItemRemove())});function m(e){if(e.key==="Tab"&&e.shiftKey){a.onItemShiftTab();return}if(e.target!==e.currentTarget)return;const t=T(e,a.orientation.value,a.dir.value);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!n.allowShiftKey&&e.shiftKey)return;e.preventDefault();let o=[...p().map(s=>s.ref).filter(s=>s.dataset.disabled!=="")];if(t==="last")o.reverse();else if(t==="prev"||t==="next"){t==="prev"&&o.reverse();const s=o.indexOf(e.currentTarget);o=a.loop.value?q(o,s+1):o.slice(s+1)}k(()=>x(o))}}return(e,t)=>(K(),S(r(b),null,{default:i(()=>[w(r(B),{tabindex:c.value?0:-1,"data-orientation":r(a).orientation.value,"data-active":e.active?"":void 0,"data-disabled":e.focusable?void 0:"",as:e.as,"as-child":e.asChild,onMousedown:t[0]||(t[0]=o=>{e.focusable?r(a).onItemFocus(l.value):o.preventDefault()}),onFocus:t[1]||(t[1]=o=>r(a).onItemFocus(l.value)),onKeydown:m},{default:i(()=>[R(e.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),j=_;export{j as R};
@@ -1,4 +1,4 @@
1
- import{x as U,y as g,z as q,A as Q,B as Z,D as ee,E as V,X as te,C as ne,c as E,d as ae,i as re,e as se,F as $,j as ie,G as R,f as Y,g as X,k as oe,r as O,n as P,s as T,l as W,H as z,I,J as le,K as ce,p as ue,t as he,P as de,v as ye}from"./LTMoFvEY.js";import{d as fe,ao as pe,B as ve,L as ge,ad as me,J,o as ke,c as xe,h as be,r as Se}from"./CNu3kken.js";function Ae(p,n,e){var r=null,s=g(!0),l=null,o=q,c=null,m=U(a);p=typeof p=="function"?p:p===void 0?Q:g(+p),n=typeof n=="function"?n:n===void 0?g(0):g(+n),e=typeof e=="function"?e:e===void 0?Z:g(+e);function a(t){var u,x,h,d=(t=ee(t)).length,f,v=!1,b,i=new Array(d),y=new Array(d);for(l==null&&(c=o(b=m())),u=0;u<=d;++u){if(!(u<d&&s(f=t[u],u,t))===v)if(v=!v)x=u,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),h=u-1;h>=x;--h)c.point(i[h],y[h]);c.lineEnd(),c.areaEnd()}v&&(i[u]=+p(f,u,t),y[u]=+n(f,u,t),c.point(r?+r(f,u,t):i[u],e?+e(f,u,t):y[u]))}if(b)return c=null,b+""||null}function k(){return V().defined(s).curve(o).context(l)}return a.x=function(t){return arguments.length?(p=typeof t=="function"?t:g(+t),r=null,a):p},a.x0=function(t){return arguments.length?(p=typeof t=="function"?t:g(+t),a):p},a.x1=function(t){return arguments.length?(r=t==null?null:typeof t=="function"?t:g(+t),a):r},a.y=function(t){return arguments.length?(n=typeof t=="function"?t:g(+t),e=null,a):n},a.y0=function(t){return arguments.length?(n=typeof t=="function"?t:g(+t),a):n},a.y1=function(t){return arguments.length?(e=t==null?null:typeof t=="function"?t:g(+t),a):e},a.lineX0=a.lineY0=function(){return k().x(p).y(n)},a.lineY1=function(){return k().x(p).y(e)},a.lineX1=function(){return k().x(r).y(n)},a.defined=function(t){return arguments.length?(s=typeof t=="function"?t:g(!!t),a):s},a.curve=function(t){return arguments.length?(o=t,l!=null&&(c=o(l)),a):o},a.context=function(t){return arguments.length?(t==null?l=c=null:c=o(l=t),a):l},a}const De=Object.assign(Object.assign({},te),{color:void 0,curveType:ne.MonotoneX,baseline:()=>0,opacity:1,cursor:null,line:!1,lineColor:void 0,lineWidth:2,lineDashArray:void 0,minHeight1Px:!1,minHeight:void 0,stackMinHeight:!1}),K=E`
1
+ import{x as U,y as g,z as q,A as Q,B as Z,D as ee,E as V,X as te,C as ne,c as E,d as ae,i as re,e as se,F as $,j as ie,G as R,f as Y,g as X,k as oe,r as O,n as P,s as T,l as W,H as z,I,J as le,K as ce,p as ue,t as he,P as de,v as ye}from"./P5uOaRUZ.js";import{d as fe,ao as pe,B as ve,L as ge,ad as me,J,o as ke,c as xe,h as be,r as Se}from"./C5TrTuWv.js";function Ae(p,n,e){var r=null,s=g(!0),l=null,o=q,c=null,m=U(a);p=typeof p=="function"?p:p===void 0?Q:g(+p),n=typeof n=="function"?n:n===void 0?g(0):g(+n),e=typeof e=="function"?e:e===void 0?Z:g(+e);function a(t){var u,x,h,d=(t=ee(t)).length,f,v=!1,b,i=new Array(d),y=new Array(d);for(l==null&&(c=o(b=m())),u=0;u<=d;++u){if(!(u<d&&s(f=t[u],u,t))===v)if(v=!v)x=u,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),h=u-1;h>=x;--h)c.point(i[h],y[h]);c.lineEnd(),c.areaEnd()}v&&(i[u]=+p(f,u,t),y[u]=+n(f,u,t),c.point(r?+r(f,u,t):i[u],e?+e(f,u,t):y[u]))}if(b)return c=null,b+""||null}function k(){return V().defined(s).curve(o).context(l)}return a.x=function(t){return arguments.length?(p=typeof t=="function"?t:g(+t),r=null,a):p},a.x0=function(t){return arguments.length?(p=typeof t=="function"?t:g(+t),a):p},a.x1=function(t){return arguments.length?(r=t==null?null:typeof t=="function"?t:g(+t),a):r},a.y=function(t){return arguments.length?(n=typeof t=="function"?t:g(+t),e=null,a):n},a.y0=function(t){return arguments.length?(n=typeof t=="function"?t:g(+t),a):n},a.y1=function(t){return arguments.length?(e=t==null?null:typeof t=="function"?t:g(+t),a):e},a.lineX0=a.lineY0=function(){return k().x(p).y(n)},a.lineY1=function(){return k().x(p).y(e)},a.lineX1=function(){return k().x(r).y(n)},a.defined=function(t){return arguments.length?(s=typeof t=="function"?t:g(!!t),a):s},a.curve=function(t){return arguments.length?(o=t,l!=null&&(c=o(l)),a):o},a.context=function(t){return arguments.length?(t==null?l=c=null:c=o(l=t),a):l},a}const De=Object.assign(Object.assign({},te),{color:void 0,curveType:ne.MonotoneX,baseline:()=>0,opacity:1,cursor:null,line:!1,lineColor:void 0,lineWidth:2,lineDashArray:void 0,minHeight1Px:!1,minHeight:void 0,stackMinHeight:!1}),K=E`
2
2
  label: area-component;
3
3
  `,Ce=re`
4
4
  :root {
@@ -1 +1 @@
1
- import{_ as m}from"./Bag08cIY.js";import{d,o as t,c as r,R as l,i as n,j as s,t as a,s as x,g as k,m as u,v as o}from"./CNu3kken.js";const g={class:"p-2 text-sm text-gray-900 dark:text-gray-100 space-y-1"},_={class:"text-xs text-muted"},y={key:0,class:"text-xs"},h={key:1,class:"text-xs text-muted"},p=d({__name:"ChartMarkerTooltip",props:{marker:{},pos:{}},setup(e){return(v,f)=>{const c=m,i=x;return e.marker?(t(),r("div",{key:0,class:"fixed z-50 pointer-events-none bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 max-w-[260px]",style:l({left:`${e.pos.x}px`,top:`${e.pos.y}px`})},[n("div",g,[s(c,{marker:e.marker},null,8,["marker"]),n("div",_,a(new Date(e.marker.occurredAt).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})),1),e.marker.environment?(t(),r("div",y,[s(i,{color:"neutral",variant:"subtle",size:"xs"},{default:k(()=>[u(a(e.marker.environment),1)]),_:1})])):o("",!0),e.marker.description?(t(),r("p",h,a(e.marker.description),1)):o("",!0)])],4)):o("",!0)}}}),B=Object.assign(p,{__name:"ChartMarkerTooltip"});export{B as _};
1
+ import{_ as m}from"./BvAfKk6C.js";import{d,o as t,c as r,R as l,i as n,j as s,t as a,s as x,g as k,m as u,v as o}from"./C5TrTuWv.js";const g={class:"p-2 text-sm text-gray-900 dark:text-gray-100 space-y-1"},_={class:"text-xs text-muted"},y={key:0,class:"text-xs"},h={key:1,class:"text-xs text-muted"},p=d({__name:"ChartMarkerTooltip",props:{marker:{},pos:{}},setup(e){return(v,f)=>{const c=m,i=x;return e.marker?(t(),r("div",{key:0,class:"fixed z-50 pointer-events-none bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 max-w-[260px]",style:l({left:`${e.pos.x}px`,top:`${e.pos.y}px`})},[n("div",g,[s(c,{marker:e.marker},null,8,["marker"]),n("div",_,a(new Date(e.marker.occurredAt).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})),1),e.marker.environment?(t(),r("div",y,[s(i,{color:"neutral",variant:"subtle",size:"xs"},{default:k(()=>[u(a(e.marker.environment),1)]),_:1})])):o("",!0),e.marker.description?(t(),r("p",h,a(e.marker.description),1)):o("",!0)])],4)):o("",!0)}}}),B=Object.assign(p,{__name:"ChartMarkerTooltip"});export{B as _};
@@ -1 +1 @@
1
- import{a2 as $,a3 as j,a5 as z,ao as y,aZ as S,r as V,aU as w,a_ as P,J as B,o,f as C,g as b,i as q,q as s,k as t,c as u,j as N,V as n,m as c,t as f,v as m,X as F,h,a8 as D,N as g,bn as K,bo as O}from"./CNu3kken.js";import{L as W}from"./DZ-KbUZi.js";const E={slots:{root:"",wrapper:"",labelWrapper:"flex content-center items-center justify-between gap-1",label:"block font-medium text-default",container:"relative",description:"text-muted",error:"mt-2 text-error",hint:"text-muted",help:"mt-2 text-muted"},variants:{size:{xs:{root:"text-xs"},sm:{root:"text-xs"},md:{root:"text-sm"},lg:{root:"text-sm"},xl:{root:"text-base"}},required:{true:{label:"after:content-['*'] after:ms-0.5 after:text-error"}},orientation:{vertical:{container:"mt-1"},horizontal:{root:"flex justify-between place-items-baseline gap-2"}}},defaultVariants:{size:"md"}},L=["id"],U=["id"],A=["id"],J=["id"],G={__name:"UFormField",props:{as:{type:null,required:!1},name:{type:String,required:!1},errorPattern:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},help:{type:String,required:!1},error:{type:[Boolean,String],required:!1,default:void 0},hint:{type:String,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},eagerValidation:{type:Boolean,required:!1},validateOnInputDelay:{type:Number,required:!1},orientation:{type:null,required:!1,default:"vertical"},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(x){const _=x,l=$(),e=j("formField",_),I=z(),a=h(()=>D({extend:E,...I.ui?.formField||{}})({size:e.size,required:e.required,orientation:e.orientation})),k=y(S,null),i=h(()=>e.error||k?.value?.find(r=>r.name===e.name||e.errorPattern&&r.name?.match(e.errorPattern))?.message),d=V(w()),p=d.value,v=y(P,void 0);return B(d,()=>{v&&e.name&&(v.value[e.name]={id:d.value,pattern:e.errorPattern})},{immediate:!0}),g(K,d),g(O,h(()=>({error:i.value,name:e.name,size:e.size,eagerValidation:e.eagerValidation,validateOnInputDelay:e.validateOnInputDelay,errorPattern:e.errorPattern,hint:e.hint,description:e.description,help:e.help,ariaId:p}))),(r,T)=>(o(),C(t(F),{as:t(e).as,"data-orientation":t(e).orientation,"data-slot":"root",class:s(a.value.root({class:[t(e).ui?.root,t(e).class]}))},{default:b(()=>[q("div",{"data-slot":"wrapper",class:s(a.value.wrapper({class:t(e).ui?.wrapper}))},[t(e).label||l.label?(o(),u("div",{key:0,"data-slot":"labelWrapper",class:s(a.value.labelWrapper({class:t(e).ui?.labelWrapper}))},[N(t(W),{for:d.value,"data-slot":"label",class:s(a.value.label({class:t(e).ui?.label}))},{default:b(()=>[n(r.$slots,"label",{label:t(e).label},()=>[c(f(t(e).label),1)])]),_:3},8,["for","class"]),t(e).hint||l.hint?(o(),u("span",{key:0,id:`${t(p)}-hint`,"data-slot":"hint",class:s(a.value.hint({class:t(e).ui?.hint}))},[n(r.$slots,"hint",{hint:t(e).hint},()=>[c(f(t(e).hint),1)])],10,L)):m("",!0)],2)):m("",!0),t(e).description||l.description?(o(),u("p",{key:1,id:`${t(p)}-description`,"data-slot":"description",class:s(a.value.description({class:t(e).ui?.description}))},[n(r.$slots,"description",{description:t(e).description},()=>[c(f(t(e).description),1)])],10,U)):m("",!0)],2),q("div",{class:s([(t(e).label||!!l.label||t(e).description||!!l.description)&&a.value.container({class:t(e).ui?.container})])},[n(r.$slots,"default",{error:i.value}),t(e).error!==!1&&(typeof i.value=="string"&&i.value||l.error)?(o(),u("div",{key:0,id:`${t(p)}-error`,"data-slot":"error",class:s(a.value.error({class:t(e).ui?.error}))},[n(r.$slots,"error",{error:i.value},()=>[c(f(i.value),1)])],10,A)):t(e).help||l.help?(o(),u("div",{key:1,id:`${t(p)}-help`,"data-slot":"help",class:s(a.value.help({class:t(e).ui?.help}))},[n(r.$slots,"help",{help:t(e).help},()=>[c(f(t(e).help),1)])],10,J)):m("",!0)],2)]),_:3},8,["as","data-orientation","class"]))}};export{G as _};
1
+ import{a2 as $,a3 as j,a5 as z,ao as y,aZ as S,r as V,aU as w,a_ as P,J as B,o,f as C,g as b,i as q,q as s,k as t,c as u,j as N,V as n,m as c,t as f,v as m,X as F,h,a8 as D,N as g,bn as K,bo as O}from"./C5TrTuWv.js";import{L as W}from"./D_y2VS8k.js";const E={slots:{root:"",wrapper:"",labelWrapper:"flex content-center items-center justify-between gap-1",label:"block font-medium text-default",container:"relative",description:"text-muted",error:"mt-2 text-error",hint:"text-muted",help:"mt-2 text-muted"},variants:{size:{xs:{root:"text-xs"},sm:{root:"text-xs"},md:{root:"text-sm"},lg:{root:"text-sm"},xl:{root:"text-base"}},required:{true:{label:"after:content-['*'] after:ms-0.5 after:text-error"}},orientation:{vertical:{container:"mt-1"},horizontal:{root:"flex justify-between place-items-baseline gap-2"}}},defaultVariants:{size:"md"}},L=["id"],U=["id"],A=["id"],J=["id"],G={__name:"UFormField",props:{as:{type:null,required:!1},name:{type:String,required:!1},errorPattern:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},help:{type:String,required:!1},error:{type:[Boolean,String],required:!1,default:void 0},hint:{type:String,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},eagerValidation:{type:Boolean,required:!1},validateOnInputDelay:{type:Number,required:!1},orientation:{type:null,required:!1,default:"vertical"},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(x){const _=x,l=$(),e=j("formField",_),I=z(),a=h(()=>D({extend:E,...I.ui?.formField||{}})({size:e.size,required:e.required,orientation:e.orientation})),k=y(S,null),i=h(()=>e.error||k?.value?.find(r=>r.name===e.name||e.errorPattern&&r.name?.match(e.errorPattern))?.message),d=V(w()),p=d.value,v=y(P,void 0);return B(d,()=>{v&&e.name&&(v.value[e.name]={id:d.value,pattern:e.errorPattern})},{immediate:!0}),g(K,d),g(O,h(()=>({error:i.value,name:e.name,size:e.size,eagerValidation:e.eagerValidation,validateOnInputDelay:e.validateOnInputDelay,errorPattern:e.errorPattern,hint:e.hint,description:e.description,help:e.help,ariaId:p}))),(r,T)=>(o(),C(t(F),{as:t(e).as,"data-orientation":t(e).orientation,"data-slot":"root",class:s(a.value.root({class:[t(e).ui?.root,t(e).class]}))},{default:b(()=>[q("div",{"data-slot":"wrapper",class:s(a.value.wrapper({class:t(e).ui?.wrapper}))},[t(e).label||l.label?(o(),u("div",{key:0,"data-slot":"labelWrapper",class:s(a.value.labelWrapper({class:t(e).ui?.labelWrapper}))},[N(t(W),{for:d.value,"data-slot":"label",class:s(a.value.label({class:t(e).ui?.label}))},{default:b(()=>[n(r.$slots,"label",{label:t(e).label},()=>[c(f(t(e).label),1)])]),_:3},8,["for","class"]),t(e).hint||l.hint?(o(),u("span",{key:0,id:`${t(p)}-hint`,"data-slot":"hint",class:s(a.value.hint({class:t(e).ui?.hint}))},[n(r.$slots,"hint",{hint:t(e).hint},()=>[c(f(t(e).hint),1)])],10,L)):m("",!0)],2)):m("",!0),t(e).description||l.description?(o(),u("p",{key:1,id:`${t(p)}-description`,"data-slot":"description",class:s(a.value.description({class:t(e).ui?.description}))},[n(r.$slots,"description",{description:t(e).description},()=>[c(f(t(e).description),1)])],10,U)):m("",!0)],2),q("div",{class:s([(t(e).label||!!l.label||t(e).description||!!l.description)&&a.value.container({class:t(e).ui?.container})])},[n(r.$slots,"default",{error:i.value}),t(e).error!==!1&&(typeof i.value=="string"&&i.value||l.error)?(o(),u("div",{key:0,id:`${t(p)}-error`,"data-slot":"error",class:s(a.value.error({class:t(e).ui?.error}))},[n(r.$slots,"error",{error:i.value},()=>[c(f(i.value),1)])],10,A)):t(e).help||l.help?(o(),u("div",{key:1,id:`${t(p)}-help`,"data-slot":"help",class:s(a.value.help({class:t(e).ui?.help}))},[n(r.$slots,"help",{help:t(e).help},()=>[c(f(t(e).help),1)])],10,J)):m("",!0)],2)]),_:3},8,["as","data-orientation","class"]))}};export{G as _};