@piwitests/server 0.19.0 → 0.20.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 (418) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{eptP4pGv.js → -f7BAm1H.js} +1 -1
  3. package/.output/public/_nuxt/{Bti38m-M.js → 4gYNA-d4.js} +1 -1
  4. package/.output/public/_nuxt/{CHEFCN8Q.js → 5A6ITZXj.js} +1 -1
  5. package/.output/public/_nuxt/{DoUy4UHi.js → 8PUUncmO.js} +2 -2
  6. package/.output/public/_nuxt/{DS636elg.js → A1pj0VnG.js} +1 -1
  7. package/.output/public/_nuxt/{B9WhzpKO.js → AbmKWFQQ.js} +1 -1
  8. package/.output/public/_nuxt/{rWNTSFD6.js → B3obW6cw.js} +3 -3
  9. package/.output/public/_nuxt/{Bu2aaVIY.js → B7FTvFWq.js} +1 -1
  10. package/.output/public/_nuxt/{CpjgB2aY.js → B8zkOmwo.js} +1 -1
  11. package/.output/public/_nuxt/B96M2gdj.js +1 -0
  12. package/.output/public/_nuxt/{FUXhyidq.js → B99fbi73.js} +1 -1
  13. package/.output/public/_nuxt/{DslPMqfa.js → B9OLmp0f.js} +1 -1
  14. package/.output/public/_nuxt/{BccXfBfI.js → BKkF4pPD.js} +1 -1
  15. package/.output/public/_nuxt/{DP8hfJ9h.js → BT3wGCTI.js} +1 -1
  16. package/.output/public/_nuxt/{B3B9Ii2A.js → BUa0V0Ly.js} +1 -1
  17. package/.output/public/_nuxt/{B3HO8kuh.js → BUkim3TM.js} +1 -1
  18. package/.output/public/_nuxt/{BVaxh6Nl.js → BVc14Ncz.js} +3 -3
  19. package/.output/public/_nuxt/{DW0xl3I6.js → BY0HxR3t.js} +1 -1
  20. package/.output/public/_nuxt/B_xAMWQS.js +2 -0
  21. package/.output/public/_nuxt/{C2_3mdPC.js → BdQoBaOv.js} +1 -1
  22. package/.output/public/_nuxt/{DT53RWbC.js → BdfhYr-u.js} +1 -1
  23. package/.output/public/_nuxt/{CtQBsNUb.js → BgRu_3tT.js} +1 -1
  24. package/.output/public/_nuxt/{SlIRLREZ.js → BiO7RBWb.js} +1 -1
  25. package/.output/public/_nuxt/BicAJ6U8.js +1 -0
  26. package/.output/public/_nuxt/{C7P1UCO2.js → Bm62iDV5.js} +1 -1
  27. package/.output/public/_nuxt/{CZfMdzfk.js → BmUfSNMV.js} +1 -1
  28. package/.output/public/_nuxt/{tvgqrYDd.js → Bnxf8nbZ.js} +1 -1
  29. package/.output/public/_nuxt/{ndShiWE8.js → Bow4tTR0.js} +1 -1
  30. package/.output/public/_nuxt/{D0HNloZ9.js → BrQEE053.js} +1 -1
  31. package/.output/public/_nuxt/{CV9-fTmY.js → BzRRzmwm.js} +1 -1
  32. package/.output/public/_nuxt/{DprVVyUQ.js → C0_yH0N7.js} +1 -1
  33. package/.output/public/_nuxt/{DLSrtpsA.js → C1gTN4Q8.js} +1 -1
  34. package/.output/public/_nuxt/{ClOqkAcc.js → C2hkrSey.js} +1 -1
  35. package/.output/public/_nuxt/{ZFiQCMUB.js → C8e1EbJI.js} +1 -1
  36. package/.output/public/_nuxt/{nv9-6vBK.js → CA9B2HE5.js} +1 -1
  37. package/.output/public/_nuxt/{KnfsST6Y.js → CAAwCT7H.js} +1 -1
  38. package/.output/public/_nuxt/{ybDYeNxd.js → CAvY22RE.js} +1 -1
  39. package/.output/public/_nuxt/{C5iG7O4O.js → CEfS4-oS.js} +1 -1
  40. package/.output/public/_nuxt/{Bp5ELvx9.js → CIoSMkpp.js} +1 -1
  41. package/.output/public/_nuxt/{C95YAaJq.js → CIrFl3MW.js} +1 -1
  42. package/.output/public/_nuxt/{DiOLdHBC.js → CJFtzlQ4.js} +1 -1
  43. package/.output/public/_nuxt/{BX9ZXe98.js → CNyV9YpI.js} +1 -1
  44. package/.output/public/_nuxt/CSJ-eOQM.js +1 -0
  45. package/.output/public/_nuxt/{fVcG504p.js → CTU1mrhq.js} +1 -1
  46. package/.output/public/_nuxt/{279D2RYp.js → CXEH9OPk.js} +1 -1
  47. package/.output/public/_nuxt/CahpB9Z2.js +5 -0
  48. package/.output/public/_nuxt/{B7NBP1C-.js → Cbh--1MW.js} +1 -1
  49. package/.output/public/_nuxt/CeG9pBAD.js +1 -0
  50. package/.output/public/_nuxt/{D55D4EYo.js → CeW8v31b.js} +1 -1
  51. package/.output/public/_nuxt/{BuMC3WjZ.js → CjPfj7ya.js} +1 -1
  52. package/.output/public/_nuxt/{HXerICAi.js → Cnsmicv2.js} +1 -1
  53. package/.output/public/_nuxt/{DgE2YE3R.js → CsLojMwR.js} +1 -1
  54. package/.output/public/_nuxt/{C9_jrmk9.js → Cus22Ud3.js} +2 -2
  55. package/.output/public/_nuxt/{DX-MDGb3.js → CwGWJbiy.js} +1 -1
  56. package/.output/public/_nuxt/{BJ0XQElc.js → Cx6gc2VW.js} +1 -1
  57. package/.output/public/_nuxt/{cHAnlQbv.js → CxyAzHr3.js} +1 -1
  58. package/.output/public/_nuxt/{BxCKKeYs.js → CzAPFPpL.js} +1 -1
  59. package/.output/public/_nuxt/{B33iXw77.js → D--H4jLI.js} +1 -1
  60. package/.output/public/_nuxt/D1POo6S4.js +10 -0
  61. package/.output/public/_nuxt/{BDicZ1gQ.js → D5tke0B5.js} +1 -1
  62. package/.output/public/_nuxt/D8nkF-OO.js +3 -0
  63. package/.output/public/_nuxt/{CzGyac8q.js → DA25RkyK.js} +1 -1
  64. package/.output/public/_nuxt/{CUtJobDm.js → DIB-5fUJ.js} +1 -1
  65. package/.output/public/_nuxt/{BPRffDuo.js → DJmoLeVt.js} +1 -1
  66. package/.output/public/_nuxt/{DGfAxLHV.js → DJxlKFGb.js} +1 -1
  67. package/.output/public/_nuxt/{81InBX9v.js → DMec-OLo.js} +1 -1
  68. package/.output/public/_nuxt/{CK_2LZBS.js → DPCxhHri.js} +1 -1
  69. package/.output/public/_nuxt/{Bn0YQDyy.js → DSqHUrvO.js} +1 -1
  70. package/.output/public/_nuxt/{BqV0l12c.js → DabzhQB1.js} +1 -1
  71. package/.output/public/_nuxt/{BfTuX0wq.js → DdwHkKfV.js} +1 -1
  72. package/.output/public/_nuxt/{C-elpgyr.js → DeY2JkR2.js} +1 -1
  73. package/.output/public/_nuxt/{DEFEpYzn.js → DfgOx_ou.js} +1 -1
  74. package/.output/public/_nuxt/DmkUdSS4.js +1 -0
  75. package/.output/public/_nuxt/{Ar3IelOY.js → DoIREDVb.js} +1 -1
  76. package/.output/public/_nuxt/DpZ1r1HA.js +1 -0
  77. package/.output/public/_nuxt/{Jo8kRmHz.js → Dpd16JVI.js} +1 -1
  78. package/.output/public/_nuxt/{BSIxhGsh.js → DqcKngf3.js} +1 -1
  79. package/.output/public/_nuxt/{BMvCSA6h.js → DrfE8IY0.js} +1 -1
  80. package/.output/public/_nuxt/{eaVkJRSa.js → DsesNydr.js} +1 -1
  81. package/.output/public/_nuxt/{zQyPuvV1.js → DtHJgCS8.js} +1 -1
  82. package/.output/public/_nuxt/Dtd4rC58.js +9 -0
  83. package/.output/public/_nuxt/{NQikbhmK.js → Du2W7Jne.js} +37 -36
  84. package/.output/public/_nuxt/{CDk0q2hV.js → DuwtTfO8.js} +1 -1
  85. package/.output/public/_nuxt/{B44A4LSJ.js → Dy-TJ0Mt.js} +1 -1
  86. package/.output/public/_nuxt/{-09h6CA9.js → Dy86h-7P.js} +1 -1
  87. package/.output/public/_nuxt/{Cdff9XNh.js → Dyeqn3aG.js} +1 -1
  88. package/.output/public/_nuxt/{Dnpkl-1q.js → FaFoMVKo.js} +1 -1
  89. package/.output/public/_nuxt/GPNI1ffD.js +4 -0
  90. package/.output/public/_nuxt/{BCMuIgP5.js → H94BMf3L.js} +1 -1
  91. package/.output/public/_nuxt/HPNQD6v3.js +1 -0
  92. package/.output/public/_nuxt/HXadJrHu.js +2 -0
  93. package/.output/public/_nuxt/{YVN7WG7q.js → KyA_4Ks-.js} +1 -1
  94. package/.output/public/_nuxt/{CYsTqbBS.js → L3kAWB2a.js} +1 -1
  95. package/.output/public/_nuxt/{Dk9fwOCm.js → McL25vkx.js} +2 -2
  96. package/.output/public/_nuxt/Nn93e_Mz.js +1 -0
  97. package/.output/public/_nuxt/UdR3DBPS.js +1 -0
  98. package/.output/public/_nuxt/{SfMRXW25.js → Und3xXFc.js} +1 -1
  99. package/.output/public/_nuxt/_mj6CfPa.js +1 -0
  100. package/.output/public/_nuxt/{BPQoBGg5.js → b-GYfcrQ.js} +1 -1
  101. package/.output/public/_nuxt/{DHDtnj7p.js → bLcjFslv.js} +1 -1
  102. package/.output/public/_nuxt/builds/latest.json +1 -1
  103. package/.output/public/_nuxt/builds/meta/e659b3e1-0e61-4971-940e-10063f9f4763.json +1 -0
  104. package/.output/public/_nuxt/entry.DmptwB51.css +1 -0
  105. package/.output/public/_nuxt/{y17lMTFy.js → hC_z4G8p.js} +1 -1
  106. package/.output/public/_nuxt/{CTxDO9fB.js → hNh4CIL0.js} +1 -1
  107. package/.output/public/_nuxt/{CGNkHojN.js → l5WKbU4h.js} +1 -1
  108. package/.output/public/_nuxt/{DcmZRa_F.js → oAClCn_h.js} +1 -1
  109. package/.output/public/_nuxt/{IvQlbZk6.js → pQqGiNch.js} +1 -1
  110. package/.output/public/_nuxt/ryMzSDUj.js +2 -0
  111. package/.output/server/chunks/_/collect.mjs +1 -1
  112. package/.output/server/chunks/_/markers.mjs +1 -1
  113. package/.output/server/chunks/_/quarantine.mjs +1 -1
  114. package/.output/server/chunks/_/users.mjs +1 -1
  115. package/.output/server/chunks/build/{BrowserBadge-D33lqUcj.mjs → BrowserBadge-MFvBwxmD.mjs} +66 -6
  116. package/.output/server/chunks/build/BrowserBadge-MFvBwxmD.mjs.map +1 -0
  117. package/.output/server/chunks/build/{Checkbox-DvUBGagc.mjs → Checkbox-4Q5d0fa0.mjs} +4 -4
  118. package/.output/server/chunks/build/Checkbox-4Q5d0fa0.mjs.map +1 -0
  119. package/.output/server/chunks/build/CiEnvCard-DB5DvBh1.mjs +1492 -0
  120. package/.output/server/chunks/build/CiEnvCard-DB5DvBh1.mjs.map +1 -0
  121. package/.output/server/chunks/build/CodeBlock-BgE-NSmE.mjs +1 -1
  122. package/.output/server/chunks/build/DashboardSidebarToggle-DCTnHiIv.mjs +1 -1
  123. package/.output/server/chunks/build/{DiagnosisPanel-B646dK4p.mjs → DiagnosisPanel-CALyEmcJ.mjs} +3 -3
  124. package/.output/server/chunks/build/DiagnosisPanel-CALyEmcJ.mjs.map +1 -0
  125. package/.output/server/chunks/build/{EmptyState-Dtlab7S9.mjs → EmptyState-DC2q_7TD.mjs} +3 -3
  126. package/.output/server/chunks/build/EmptyState-DC2q_7TD.mjs.map +1 -0
  127. package/.output/server/chunks/build/{EntityLinks-D3fp57pR.mjs → EntityLinks-BBHWssHH.mjs} +4 -4
  128. package/.output/server/chunks/build/EntityLinks-BBHWssHH.mjs.map +1 -0
  129. package/.output/server/chunks/build/{EnvManagedBadge-Bg3FSiU1.mjs → EnvManagedBadge-UwD2b9v2.mjs} +2 -2
  130. package/.output/server/chunks/build/EnvManagedBadge-UwD2b9v2.mjs.map +1 -0
  131. package/.output/server/chunks/build/{Modal-Ck2XLt8d.mjs → Modal-pSDlXzT3.mjs} +2 -2
  132. package/.output/server/chunks/build/Modal-pSDlXzT3.mjs.map +1 -0
  133. package/.output/server/chunks/build/{OpenInIdeLink-C4MXA8ya.mjs → OpenInIdeLink-CQWKKChd.mjs} +3 -3
  134. package/.output/server/chunks/build/{OpenInIdeLink-C4MXA8ya.mjs.map → OpenInIdeLink-CQWKKChd.mjs.map} +1 -1
  135. package/.output/server/chunks/build/{ProjectTestCasesTable-CxfQ5wtN.mjs → ProjectTestCasesTable-Bo61P5K1.mjs} +8 -8
  136. package/.output/server/chunks/build/{ProjectTestCasesTable-CxfQ5wtN.mjs.map → ProjectTestCasesTable-Bo61P5K1.mjs.map} +1 -1
  137. package/.output/server/chunks/build/{RovingFocusItem-BJSzTBjy.mjs → RovingFocusItem--OEHI2P3.mjs} +2 -2
  138. package/.output/server/chunks/build/RovingFocusItem--OEHI2P3.mjs.map +1 -0
  139. package/.output/server/chunks/build/RunReports-DFLv51TX.mjs +1 -1
  140. package/.output/server/chunks/build/{Select-CUqj50wi.mjs → Select-5DK9frQ7.mjs} +3 -3
  141. package/.output/server/chunks/build/Select-5DK9frQ7.mjs.map +1 -0
  142. package/.output/server/chunks/build/{SelectMenu-Db7osY7J.mjs → SelectMenu-D-2FSqBU.mjs} +939 -7
  143. package/.output/server/chunks/build/{SelectMenu-Db7osY7J.mjs.map → SelectMenu-D-2FSqBU.mjs.map} +1 -1
  144. package/.output/server/chunks/build/{SettingsField-D6iEYbEc.mjs → SettingsField-BZfx4ma1.mjs} +2 -2
  145. package/.output/server/chunks/build/SettingsField-BZfx4ma1.mjs.map +1 -0
  146. package/.output/server/chunks/build/{Slideover-DgCa80mf.mjs → Slideover-D270EZZD.mjs} +3 -3
  147. package/.output/server/chunks/build/Slideover-D270EZZD.mjs.map +1 -0
  148. package/.output/server/chunks/build/{Switch-CgUioOYB.mjs → Switch-B5Fp8ULt.mjs} +2 -2
  149. package/.output/server/chunks/build/Switch-B5Fp8ULt.mjs.map +1 -0
  150. package/.output/server/chunks/build/Table-BRk04Hd2.mjs +1 -1
  151. package/.output/server/chunks/build/{Tabs-Bbsg9wag.mjs → Tabs-BkSOnbaB.mjs} +2 -2
  152. package/.output/server/chunks/build/Tabs-BkSOnbaB.mjs.map +1 -0
  153. package/.output/server/chunks/build/{TestCaseHistoryChart-nMLPhdvD.mjs → TestCaseHistoryChart-CSi64vVA.mjs} +5 -5
  154. package/.output/server/chunks/build/TestCaseHistoryChart-CSi64vVA.mjs.map +1 -0
  155. package/.output/server/chunks/build/{TestStatusBar-j6h2Jp6A.mjs → TestStatusBar-DX3EhlyP.mjs} +2 -2
  156. package/.output/server/chunks/build/TestStatusBar-DX3EhlyP.mjs.map +1 -0
  157. package/.output/server/chunks/build/{Tooltip-BOazooWP.mjs → Tooltip-Dv4htNP6.mjs} +3 -3
  158. package/.output/server/chunks/build/Tooltip-Dv4htNP6.mjs.map +1 -0
  159. package/.output/server/chunks/build/{VisuallyHiddenInput-D6kBJxVd.mjs → VisuallyHiddenInput-BHvzNumK.mjs} +2 -2
  160. package/.output/server/chunks/build/VisuallyHiddenInput-BHvzNumK.mjs.map +1 -0
  161. package/.output/server/chunks/build/{_id_-z5N6HPyC.mjs → _id_-BdG37K7s.mjs} +12 -12
  162. package/.output/server/chunks/build/_id_-BdG37K7s.mjs.map +1 -0
  163. package/.output/server/chunks/build/{_id_-BHh65pfg.mjs → _id_-BdJs7BJZ.mjs} +57 -33
  164. package/.output/server/chunks/build/{_id_-BHh65pfg.mjs.map → _id_-BdJs7BJZ.mjs.map} +1 -1
  165. package/.output/server/chunks/build/{_id_-B78ky13D.mjs → _id_-BxA6IgWr.mjs} +96 -73
  166. package/.output/server/chunks/build/_id_-BxA6IgWr.mjs.map +1 -0
  167. package/.output/server/chunks/build/{_id_-Rzkqx55x.mjs → _id_-C_uSBiyU.mjs} +22 -23
  168. package/.output/server/chunks/build/{_id_-Rzkqx55x.mjs.map → _id_-C_uSBiyU.mjs.map} +1 -1
  169. package/.output/server/chunks/build/{about-CvSP73Ug.mjs → about-BE0UV-8-.mjs} +365 -18
  170. package/.output/server/chunks/build/about-BE0UV-8-.mjs.map +1 -0
  171. package/.output/server/chunks/build/{ai-B4VJ9K1K.mjs → ai-Cn05ch0u.mjs} +9 -9
  172. package/.output/server/chunks/build/{ai-B4VJ9K1K.mjs.map → ai-Cn05ch0u.mjs.map} +1 -1
  173. package/.output/server/chunks/build/{analytics-CJPC6t4L.mjs → analytics-Bo_B_jko.mjs} +20 -21
  174. package/.output/server/chunks/build/analytics-Bo_B_jko.mjs.map +1 -0
  175. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  176. package/.output/server/chunks/build/{default-zvbFgDJG.mjs → default-CbNHaFsy.mjs} +603 -71
  177. package/.output/server/chunks/build/default-CbNHaFsy.mjs.map +1 -0
  178. package/.output/server/chunks/build/{docs-DyuVEgtB.mjs → docs-B_llWMxx.mjs} +6 -6
  179. package/.output/server/chunks/build/{docs-DyuVEgtB.mjs.map → docs-B_llWMxx.mjs.map} +1 -1
  180. package/.output/server/chunks/build/{edit-CFR5g2Qf.mjs → edit-J0asTFg8.mjs} +4 -5
  181. package/.output/server/chunks/build/edit-J0asTFg8.mjs.map +1 -0
  182. package/.output/server/chunks/build/fetch-B4FwBOzu.mjs +1 -1
  183. package/.output/server/chunks/build/{import-CZo3djDi.mjs → import-CS9oylTN.mjs} +4 -4
  184. package/.output/server/chunks/build/import-CS9oylTN.mjs.map +1 -0
  185. package/.output/server/chunks/build/{index-Stqw0dEI.mjs → index-DE45ycdZ.mjs} +9 -9
  186. package/.output/server/chunks/build/index-DE45ycdZ.mjs.map +1 -0
  187. package/.output/server/chunks/build/{index-gCw_y4ZJ.mjs → index-e9skCi-V.mjs} +10 -11
  188. package/.output/server/chunks/build/{index-gCw_y4ZJ.mjs.map → index-e9skCi-V.mjs.map} +1 -1
  189. package/.output/server/chunks/build/{index-D7fe97l3.mjs → index-hGHlmyxj.mjs} +299 -91
  190. package/.output/server/chunks/build/index-hGHlmyxj.mjs.map +1 -0
  191. package/.output/server/chunks/build/isValueEqualOrExist-D2qw9YEr.mjs +1 -1
  192. package/.output/server/chunks/build/login-Da4u1IlW.mjs +1 -1
  193. package/.output/server/chunks/build/{mcp-B3IUvRgD.mjs → mcp-uhVCCwQM.mjs} +339 -10
  194. package/.output/server/chunks/build/mcp-uhVCCwQM.mjs.map +1 -0
  195. package/.output/server/chunks/build/{notifications-abDv0id8.mjs → notifications-fx_qnKGA.mjs} +4 -4
  196. package/.output/server/chunks/build/notifications-fx_qnKGA.mjs.map +1 -0
  197. package/.output/server/chunks/build/{pr-feedback-DjZID6q-.mjs → pr-feedback-X6-70iF0.mjs} +3 -3
  198. package/.output/server/chunks/build/pr-feedback-X6-70iF0.mjs.map +1 -0
  199. package/.output/server/chunks/build/server.mjs +24 -24
  200. package/.output/server/chunks/build/{settings-Du7YqF8i.mjs → settings-CCYe7rsc.mjs} +3 -3
  201. package/.output/server/chunks/build/settings-CCYe7rsc.mjs.map +1 -0
  202. package/.output/server/chunks/build/{storage-B4vzxd8G.mjs → storage-CJEmviCD.mjs} +5 -5
  203. package/.output/server/chunks/build/storage-CJEmviCD.mjs.map +1 -0
  204. package/.output/server/chunks/build/{test-cases-DUvaO1He.mjs → test-cases-thBbAykw.mjs} +9 -9
  205. package/.output/server/chunks/build/test-cases-thBbAykw.mjs.map +1 -0
  206. package/.output/server/chunks/build/{useAiStatus-CWvIo32Q.mjs → useAiStatus-CxjMmDDY.mjs} +8 -8
  207. package/.output/server/chunks/build/useAiStatus-CxjMmDDY.mjs.map +1 -0
  208. package/.output/server/chunks/build/{useCopyRich-BemRsKgv.mjs → useCopyRich-RJKhWoyj.mjs} +74 -44
  209. package/.output/server/chunks/build/useCopyRich-RJKhWoyj.mjs.map +1 -0
  210. package/.output/server/chunks/build/{useDesktopDownload-D49JRQSw.mjs → useDesktopDownload-BepjqxOt.mjs} +2 -2
  211. package/.output/server/chunks/build/useDesktopDownload-BepjqxOt.mjs.map +1 -0
  212. package/.output/server/chunks/build/{useOpenInIde-4GFf-kdi.mjs → useOpenInIde-BbTnPhFA.mjs} +2 -2
  213. package/.output/server/chunks/build/useOpenInIde-BbTnPhFA.mjs.map +1 -0
  214. package/.output/server/chunks/build/{useSettingsNav-C3O866KC.mjs → useSettingsNav-DnQKacz8.mjs} +4 -4
  215. package/.output/server/chunks/build/useSettingsNav-DnQKacz8.mjs.map +1 -0
  216. package/.output/server/chunks/build/useTauri-Kf3HE_42.mjs +11 -0
  217. package/.output/server/chunks/build/useTauri-Kf3HE_42.mjs.map +1 -0
  218. package/.output/server/chunks/build/{wasted-time-lYkx5YO4.mjs → wasted-time-BNTPIyrC.mjs} +4 -4
  219. package/.output/server/chunks/build/wasted-time-BNTPIyrC.mjs.map +1 -0
  220. package/.output/server/chunks/nitro/nitro.mjs +3471 -2802
  221. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  222. package/.output/server/chunks/routes/__piwi/session.get.mjs +1 -1
  223. package/.output/server/chunks/routes/api/desktop/import-local.post.mjs +88 -0
  224. package/.output/server/chunks/routes/api/desktop/import-local.post.mjs.map +1 -0
  225. package/.output/server/chunks/routes/api/failure-clusters/_id/base-commit.patch.mjs +1 -1
  226. package/.output/server/chunks/routes/api/failure-clusters/_id/branches.get.mjs +1 -1
  227. package/.output/server/chunks/routes/api/failure-clusters/_id/commit-diff.get.mjs +1 -1
  228. package/.output/server/chunks/routes/api/failure-clusters/_id/commits.get.mjs +1 -1
  229. package/.output/server/chunks/routes/api/failure-clusters/_id/context.get.mjs +1 -1
  230. package/.output/server/chunks/routes/api/failure-clusters/_id/diagnose/stream.post.mjs +1 -1
  231. package/.output/server/chunks/routes/api/failure-clusters/_id/diagnose.post.mjs +1 -1
  232. package/.output/server/chunks/routes/api/failure-clusters/_id/diagnoses.get.mjs +1 -1
  233. package/.output/server/chunks/routes/api/failure-clusters/_id/diagnosis.get.mjs +1 -1
  234. package/.output/server/chunks/routes/api/failure-clusters/_id/export.get.mjs +1 -1
  235. package/.output/server/chunks/routes/api/failure-clusters/_id/extract-cases.post.mjs +1 -1
  236. package/.output/server/chunks/routes/api/failure-clusters/_id/fix-plan.get.mjs +1 -1
  237. package/.output/server/chunks/routes/api/failure-clusters/_id/status.patch.mjs +1 -1
  238. package/.output/server/chunks/routes/api/failure-clusters/_id_.get.mjs +1 -1
  239. package/.output/server/chunks/routes/api/failure-diagnoses/_id/feedback.patch.mjs +1 -1
  240. package/.output/server/chunks/routes/api/files/_...path_.get.mjs +1 -1
  241. package/.output/server/chunks/routes/api/health.get.mjs +1 -1
  242. package/.output/server/chunks/routes/api/index.get2.mjs +1 -1
  243. package/.output/server/chunks/routes/api/index.get3.mjs +1 -1
  244. package/.output/server/chunks/routes/api/index.get4.mjs +1 -1
  245. package/.output/server/chunks/routes/api/index.post2.mjs +1 -1
  246. package/.output/server/chunks/routes/api/index.post3.mjs +1 -1
  247. package/.output/server/chunks/routes/api/index.post4.mjs +1 -1
  248. package/.output/server/chunks/routes/api/index.post5.mjs +1 -1
  249. package/.output/server/chunks/routes/api/links/_id/refresh.post.mjs +1 -1
  250. package/.output/server/chunks/routes/api/links/_id_.delete.mjs +1 -1
  251. package/.output/server/chunks/routes/api/links/_id_.patch.mjs +1 -1
  252. package/.output/server/chunks/routes/api/markers/_id_.delete.mjs +1 -1
  253. package/.output/server/chunks/routes/api/markers/_id_.put.mjs +1 -1
  254. package/.output/server/chunks/routes/api/notifications/stream.get.mjs +1 -1
  255. package/.output/server/chunks/routes/api/projects/_id/cluster-merge-suggestions.get.mjs +1 -1
  256. package/.output/server/chunks/routes/api/projects/_id/failure-clusters.get.mjs +1 -1
  257. package/.output/server/chunks/routes/api/projects/_id/flaky-classify.post.mjs +1 -1
  258. package/.output/server/chunks/routes/api/projects/_id/flaky-tests.get.mjs +1 -1
  259. package/.output/server/chunks/routes/api/projects/_id/latest-run.get.mjs +1 -1
  260. package/.output/server/chunks/routes/api/projects/_id/markers.get.mjs +1 -1
  261. package/.output/server/chunks/routes/api/projects/_id/markers.post.mjs +1 -1
  262. package/.output/server/chunks/routes/api/projects/_id/members.get.mjs +1 -1
  263. package/.output/server/chunks/routes/api/projects/_id/members.put.mjs +1 -1
  264. package/.output/server/chunks/routes/api/projects/_id/performance.get.mjs +1 -1
  265. package/.output/server/chunks/routes/api/projects/_id/quarantine/_testCaseId_.delete.mjs +1 -1
  266. package/.output/server/chunks/routes/api/projects/_id/quarantine.get.mjs +1 -1
  267. package/.output/server/chunks/routes/api/projects/_id/quarantine.post.mjs +1 -1
  268. package/.output/server/chunks/routes/api/projects/_id/slow-tests.get.mjs +1 -1
  269. package/.output/server/chunks/routes/api/projects/_id/spec-health.get.mjs +1 -1
  270. package/.output/server/chunks/routes/api/projects/_id/test-cases.get.mjs +1 -1
  271. package/.output/server/chunks/routes/api/projects/_id/timeout-opportunities.get.mjs +1 -1
  272. package/.output/server/chunks/routes/api/projects/_id_.delete.mjs +1 -1
  273. package/.output/server/chunks/routes/api/projects/_id_.get.mjs +1 -1
  274. package/.output/server/chunks/routes/api/projects/_id_.put.mjs +1 -1
  275. package/.output/server/chunks/routes/api/projects/menu.get.mjs +1 -1
  276. package/.output/server/chunks/routes/api/projects/overview.get.mjs +1 -1
  277. package/.output/server/chunks/routes/api/projects.get.mjs +1 -1
  278. package/.output/server/chunks/routes/api/search.get.mjs +1 -1
  279. package/.output/server/chunks/routes/api/settings/ai/limits.get.mjs +1 -1
  280. package/.output/server/chunks/routes/api/settings/ai/limits.put.mjs +1 -1
  281. package/.output/server/chunks/routes/api/settings/ai/test.post.mjs +1 -1
  282. package/.output/server/chunks/routes/api/settings/ai/usage.get.mjs +1 -1
  283. package/.output/server/chunks/routes/api/settings/ai.get.mjs +1 -1
  284. package/.output/server/chunks/routes/api/settings/ai.put.mjs +1 -1
  285. package/.output/server/chunks/routes/api/settings/pr-feedback.get.mjs +1 -1
  286. package/.output/server/chunks/routes/api/settings/pr-feedback.put.mjs +1 -1
  287. package/.output/server/chunks/routes/api/settings/smtp.get.mjs +1 -1
  288. package/.output/server/chunks/routes/api/settings/timeout-hygiene.get.mjs +1 -1
  289. package/.output/server/chunks/routes/api/settings/timeout-hygiene.put.mjs +1 -1
  290. package/.output/server/chunks/routes/api/settings/wasted-waits.get.mjs +1 -1
  291. package/.output/server/chunks/routes/api/settings/wasted-waits.put.mjs +1 -1
  292. package/.output/server/chunks/routes/api/stream.get.mjs +1 -1
  293. package/.output/server/chunks/routes/api/subscriptions/_id_.delete.mjs +1 -1
  294. package/.output/server/chunks/routes/api/subscriptions/_id_.patch.mjs +1 -1
  295. package/.output/server/chunks/routes/api/tags/_id_.delete.mjs +1 -1
  296. package/.output/server/chunks/routes/api/tags/_id_.put.mjs +1 -1
  297. package/.output/server/chunks/routes/api/test-cases/_id/history.get.mjs +1 -1
  298. package/.output/server/chunks/routes/api/test-cases/_id/stability-trend.get.mjs +1 -1
  299. package/.output/server/chunks/routes/api/test-cases/_id_.get.mjs +1 -1
  300. package/.output/server/chunks/routes/api/test-run-cases/_id/diagnose.post.mjs +1 -1
  301. package/.output/server/chunks/routes/api/test-run-cases/_id/diagnosis-context.get.mjs +1 -1
  302. package/.output/server/chunks/routes/api/test-run-cases/_id/diagnosis.get.mjs +1 -1
  303. package/.output/server/chunks/routes/api/test-run-cases/_id/export.get.mjs +1 -1
  304. package/.output/server/chunks/routes/api/test-run-cases/_id/traces.get.mjs +1 -1
  305. package/.output/server/chunks/routes/api/test-run-cases/_id_.get.mjs +1 -1
  306. package/.output/server/chunks/routes/api/test-runs/_id/begin.post.mjs +1 -1
  307. package/.output/server/chunks/routes/api/test-runs/_id/case-files.post.mjs +1 -1
  308. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/dom-snapshot.get.mjs +5 -3
  309. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/dom-snapshot.get.mjs.map +1 -1
  310. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/environment-diff.get.mjs +1 -1
  311. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/locator-healing.get.mjs +1 -1
  312. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/locator-pick.post.mjs +1 -1
  313. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/trace-network-body.get.mjs +1 -1
  314. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/trace-network.get.mjs +1 -1
  315. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/trace-stacks.get.mjs +1 -1
  316. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/visual-diff.get.mjs +1 -1
  317. package/.output/server/chunks/routes/api/test-runs/_id/events.post.mjs +1 -1
  318. package/.output/server/chunks/routes/api/test-runs/_id/failure-groups.get.mjs +1 -1
  319. package/.output/server/chunks/routes/api/test-runs/_id/finish.post.mjs +1 -1
  320. package/.output/server/chunks/routes/api/test-runs/_id/gate.post.mjs +1 -1
  321. package/.output/server/chunks/routes/api/test-runs/_id/heartbeat.post.mjs +1 -1
  322. package/.output/server/chunks/routes/api/test-runs/_id/insights.get.mjs +1 -1
  323. package/.output/server/chunks/routes/api/test-runs/_id/network-requests.get.mjs +1 -1
  324. package/.output/server/chunks/routes/api/test-runs/_id/regression-context.get.mjs +1 -1
  325. package/.output/server/chunks/routes/api/test-runs/_id/stream.get.mjs +1 -1
  326. package/.output/server/chunks/routes/api/test-runs/_id/summary.get.mjs +1 -1
  327. package/.output/server/chunks/routes/api/test-runs/_id_.delete.mjs +1 -1
  328. package/.output/server/chunks/routes/api/test-runs/_id_.get.mjs +1 -1
  329. package/.output/server/chunks/routes/api/test-runs/_id_.patch.mjs +1 -1
  330. package/.output/server/chunks/routes/api/test-runs/import/check.post.mjs +1 -2
  331. package/.output/server/chunks/routes/api/test-runs/import/check.post.mjs.map +1 -1
  332. package/.output/server/chunks/routes/api/test-runs/import.post.mjs +4 -128
  333. package/.output/server/chunks/routes/api/test-runs/import.post.mjs.map +1 -1
  334. package/.output/server/chunks/routes/api/test-runs/recent.get.mjs +1 -1
  335. package/.output/server/chunks/routes/api/test-runs/setup.post.mjs +1 -1
  336. package/.output/server/chunks/routes/api/test-runs/start.post.mjs +1 -1
  337. package/.output/server/chunks/routes/api/test-runs/submit.post.mjs +1 -1
  338. package/.output/server/chunks/routes/api/test-runs/upload.post.mjs +1 -1
  339. package/.output/server/chunks/routes/api/tests/cleanup.delete.mjs +3 -1
  340. package/.output/server/chunks/routes/api/tests/cleanup.delete.mjs.map +1 -1
  341. package/.output/server/chunks/routes/api/traces/check.post.mjs +1 -1
  342. package/.output/server/chunks/routes/api/users/_id/index.post.mjs +1 -1
  343. package/.output/server/chunks/routes/api/users/_id/invite.post.mjs +1 -1
  344. package/.output/server/chunks/routes/api/users/_id/projects.get.mjs +1 -1
  345. package/.output/server/chunks/routes/api/users/_id/projects.put.mjs +1 -1
  346. package/.output/server/chunks/routes/api/version.get.mjs +1 -1
  347. package/.output/server/chunks/routes/mcp.post.mjs +1 -1
  348. package/.output/server/chunks/routes/renderer.mjs +1 -1
  349. package/.output/server/index.mjs +1 -1
  350. package/.output/server/package.json +1 -1
  351. package/package.json +1 -1
  352. package/.output/public/_nuxt/BYDaY0Z7.js +0 -1
  353. package/.output/public/_nuxt/Bc8mOoz9.js +0 -4
  354. package/.output/public/_nuxt/BeLWlVK0.js +0 -1
  355. package/.output/public/_nuxt/BpUaY9nH.js +0 -2
  356. package/.output/public/_nuxt/CHNwfU1y.js +0 -1
  357. package/.output/public/_nuxt/CNFYDQmj.js +0 -1
  358. package/.output/public/_nuxt/CU5S9GCh.js +0 -1
  359. package/.output/public/_nuxt/CrwJAwhk.js +0 -1
  360. package/.output/public/_nuxt/CuSVQEkS.js +0 -3
  361. package/.output/public/_nuxt/CylWPruw.js +0 -1
  362. package/.output/public/_nuxt/DDDpCFpF.js +0 -1
  363. package/.output/public/_nuxt/DVDXJYq2.js +0 -2
  364. package/.output/public/_nuxt/Dgf5N4Ng.js +0 -1
  365. package/.output/public/_nuxt/DiZyJYez.js +0 -1
  366. package/.output/public/_nuxt/OSduWzyz.js +0 -1
  367. package/.output/public/_nuxt/WsxFTEFq.js +0 -10
  368. package/.output/public/_nuxt/aQgs_c6e.js +0 -9
  369. package/.output/public/_nuxt/builds/meta/ab473028-4b37-4884-b243-b8f6e5046e5e.json +0 -1
  370. package/.output/public/_nuxt/dYCKgE-3.js +0 -5
  371. package/.output/public/_nuxt/entry.CPhW41mh.css +0 -1
  372. package/.output/public/_nuxt/g26aVPxc.js +0 -1
  373. package/.output/server/chunks/_/import-runs.mjs +0 -351
  374. package/.output/server/chunks/_/import-runs.mjs.map +0 -1
  375. package/.output/server/chunks/build/BrowserBadge-D33lqUcj.mjs.map +0 -1
  376. package/.output/server/chunks/build/Checkbox-DvUBGagc.mjs.map +0 -1
  377. package/.output/server/chunks/build/CiEnvCard-CrjOM17n.mjs +0 -631
  378. package/.output/server/chunks/build/CiEnvCard-CrjOM17n.mjs.map +0 -1
  379. package/.output/server/chunks/build/DiagnosisPanel-B646dK4p.mjs.map +0 -1
  380. package/.output/server/chunks/build/EmptyState-Dtlab7S9.mjs.map +0 -1
  381. package/.output/server/chunks/build/EntityLinks-D3fp57pR.mjs.map +0 -1
  382. package/.output/server/chunks/build/EnvManagedBadge-Bg3FSiU1.mjs.map +0 -1
  383. package/.output/server/chunks/build/Modal-Ck2XLt8d.mjs.map +0 -1
  384. package/.output/server/chunks/build/RovingFocusItem-BJSzTBjy.mjs.map +0 -1
  385. package/.output/server/chunks/build/Select-CUqj50wi.mjs.map +0 -1
  386. package/.output/server/chunks/build/SettingsField-D6iEYbEc.mjs.map +0 -1
  387. package/.output/server/chunks/build/Slideover-DgCa80mf.mjs.map +0 -1
  388. package/.output/server/chunks/build/Switch-CgUioOYB.mjs.map +0 -1
  389. package/.output/server/chunks/build/Tabs-Bbsg9wag.mjs.map +0 -1
  390. package/.output/server/chunks/build/TestCaseHistoryChart-nMLPhdvD.mjs.map +0 -1
  391. package/.output/server/chunks/build/TestStatusBar-j6h2Jp6A.mjs.map +0 -1
  392. package/.output/server/chunks/build/Tooltip-BOazooWP.mjs.map +0 -1
  393. package/.output/server/chunks/build/VisuallyHiddenInput-D6kBJxVd.mjs.map +0 -1
  394. package/.output/server/chunks/build/_id_-B78ky13D.mjs.map +0 -1
  395. package/.output/server/chunks/build/_id_-z5N6HPyC.mjs.map +0 -1
  396. package/.output/server/chunks/build/about-CvSP73Ug.mjs.map +0 -1
  397. package/.output/server/chunks/build/analytics-CJPC6t4L.mjs.map +0 -1
  398. package/.output/server/chunks/build/default-zvbFgDJG.mjs.map +0 -1
  399. package/.output/server/chunks/build/edit-CFR5g2Qf.mjs.map +0 -1
  400. package/.output/server/chunks/build/import-CZo3djDi.mjs.map +0 -1
  401. package/.output/server/chunks/build/index-D7fe97l3.mjs.map +0 -1
  402. package/.output/server/chunks/build/index-Stqw0dEI.mjs.map +0 -1
  403. package/.output/server/chunks/build/mcp-B3IUvRgD.mjs.map +0 -1
  404. package/.output/server/chunks/build/notifications-abDv0id8.mjs.map +0 -1
  405. package/.output/server/chunks/build/pr-feedback-DjZID6q-.mjs.map +0 -1
  406. package/.output/server/chunks/build/settings-Du7YqF8i.mjs.map +0 -1
  407. package/.output/server/chunks/build/storage-B4vzxd8G.mjs.map +0 -1
  408. package/.output/server/chunks/build/test-cases-DUvaO1He.mjs.map +0 -1
  409. package/.output/server/chunks/build/useAiStatus-CWvIo32Q.mjs.map +0 -1
  410. package/.output/server/chunks/build/useCopyRich-BemRsKgv.mjs.map +0 -1
  411. package/.output/server/chunks/build/useDesktopDownload-D49JRQSw.mjs.map +0 -1
  412. package/.output/server/chunks/build/useOpenInIde-4GFf-kdi.mjs.map +0 -1
  413. package/.output/server/chunks/build/useSettingsNav-C3O866KC.mjs.map +0 -1
  414. package/.output/server/chunks/build/useTauri-lRT8zkLv.mjs +0 -7
  415. package/.output/server/chunks/build/useTauri-lRT8zkLv.mjs.map +0 -1
  416. package/.output/server/chunks/build/virtualizer-Cd1hhlxC.mjs +0 -940
  417. package/.output/server/chunks/build/virtualizer-Cd1hhlxC.mjs.map +0 -1
  418. package/.output/server/chunks/build/wasted-time-lYkx5YO4.mjs.map +0 -1
@@ -1 +1 @@
1
- import{_ as q}from"./D0HNloZ9.js";import{_ as S}from"./Jo8kRmHz.js";import{_ as $}from"./B9WhzpKO.js";import{d as T,b as j,w as F,au as N,c as y,j as n,g as r,o as m,k as e,f as O,v as P,i as c,q as B,F as I,y as R,I as E,_ as L,m as k,r as M,L as W}from"./NQikbhmK.js";import{_ as A}from"./DprVVyUQ.js";import{u as z}from"./CpjgB2aY.js";import"./CYsTqbBS.js";import"./g26aVPxc.js";import"./CNFYDQmj.js";import"./BYDaY0Z7.js";import"./C7P1UCO2.js";import"./BjaRappk.js";import"./Bn0YQDyy.js";import"./eptP4pGv.js";const D={class:"space-y-6"},K={class:"space-y-4"},G={class:"flex items-center justify-between gap-2"},H={class:"flex items-center gap-2 shrink-0"},ue=T({__name:"pr-feedback",async setup(J){let u,p;const d=j(),{data:o,refresh:f}=([u,p]=F(()=>z("/api/settings/pr-feedback","$My52-nCqWi")),u=await u,p(),u),l=M(!1),t=W({enabled:!1,comment:!0,status:!0,onlyOnFailure:!1,statusContext:"piwi/tests"});N(()=>{o.value&&Object.assign(t,o.value.settings)});const v=[{key:"comment",label:"Post a summary comment",description:"Creates one comment on the pull request and edits it on every later run, so a busy branch gets one comment rather than one per push."},{key:"status",label:"Set a commit status",description:"Marks the run’s commit passed or failed, so the pull request shows the result in its checks list. Still set on a green run when the comment is suppressed."},{key:"onlyOnFailure",label:"Only comment on failures",description:"Keeps green runs from adding a comment. The commit status is still set either way."}];async function g(){l.value=!0;try{const i=await $fetch("/api/settings/pr-feedback",{method:"PUT",body:{settings:{...t}}});o.value=i,Object.assign(t,i.settings),d.add({title:"Saved",color:"success"}),await f()}catch{d.add({title:"Save failed",color:"error"})}finally{l.value=!1}}async function w(){l.value=!0;try{const i=await $fetch("/api/settings/pr-feedback",{method:"PUT",body:{settings:null}});o.value=i,Object.assign(t,i.settings),d.add({title:"Reset to defaults",color:"success"}),await f()}catch{d.add({title:"Reset failed",color:"error"})}finally{l.value=!1}}return(i,s)=>{const x=q,h=S,_=$,C=E,b=L,V=A;return m(),y("div",D,[n(V,{icon:"i-lucide-git-pull-request",title:"Pull-request feedback",help:"settings.pr-feedback"},{subtitle:r(()=>[...s[2]||(s[2]=[k(" When a run finishes on a branch with an open pull request, post the result back to it — new failures separated from pre-existing ones, the failure clusters behind them, and the locator to use instead of the one that broke. ",-1)])]),footer:r(()=>[c("div",G,[s[4]||(s[4]=c("p",{class:"text-xs text-muted"}," Needs an SCM token with write access to the repository — set it globally, or per project in the project’s edit page. ",-1)),c("div",H,[n(b,{variant:"ghost",color:"neutral",disabled:e(l),label:"Reset to defaults",onClick:w},null,8,["disabled"]),n(b,{color:"primary",loading:e(l),icon:"i-lucide-save",onClick:g},{default:r(()=>[...s[3]||(s[3]=[k("Save",-1)])]),_:1},8,["loading"])])])]),default:r(()=>[e(o)&&!e(o).siteUrlConfigured?(m(),O(x,{key:0,color:"warning",variant:"soft",icon:"i-lucide-triangle-alert",title:"PIWI_SITE_URL is not set",description:"Nothing is posted until it is — every link in the comment is built from it, and a comment full of unreachable links is worse than no comment.",class:"mb-4"})):P("",!0),c("div",K,[n(h,{modelValue:e(t).enabled,"onUpdate:modelValue":s[0]||(s[0]=a=>e(t).enabled=a),label:"Post feedback to pull requests"},null,8,["modelValue"]),c("div",{class:B(["space-y-4 pl-1",!e(t).enabled&&"opacity-50 pointer-events-none"])},[(m(),y(I,null,R(v,a=>n(_,{key:a.key,label:a.label,description:a.description},{default:r(()=>[n(h,{modelValue:e(t)[a.key],"onUpdate:modelValue":U=>e(t)[a.key]=U},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label","description"])),64)),n(_,{label:"Commit status context",description:"The name shown next to the status in the pull request’s checks list.",hint:`default ${e(o)?.defaults.statusContext??""}`},{default:r(()=>[n(C,{modelValue:e(t).statusContext,"onUpdate:modelValue":s[1]||(s[1]=a=>e(t).statusContext=a),placeholder:e(o)?.defaults.statusContext,class:"w-full max-w-sm"},null,8,["modelValue","placeholder"])]),_:1},8,["hint"])],2)])]),_:1})])}}});export{ue as default};
1
+ import{_ as q}from"./BrQEE053.js";import{_ as S}from"./Dpd16JVI.js";import{_ as $}from"./AbmKWFQQ.js";import{d as T,b as j,w as F,aw as N,c as y,j as n,g as r,o as m,k as e,f as O,v as P,i as c,q as B,F as I,y as R,I as E,_ as L,m as k,r as M,L as W}from"./Du2W7Jne.js";import{_ as A}from"./C0_yH0N7.js";import{u as z}from"./B8zkOmwo.js";import"./L3kAWB2a.js";import"./UdR3DBPS.js";import"./Nn93e_Mz.js";import"./DmkUdSS4.js";import"./Bm62iDV5.js";import"./BjaRappk.js";import"./DSqHUrvO.js";import"./-f7BAm1H.js";const D={class:"space-y-6"},K={class:"space-y-4"},G={class:"flex items-center justify-between gap-2"},H={class:"flex items-center gap-2 shrink-0"},ue=T({__name:"pr-feedback",async setup(J){let u,p;const d=j(),{data:o,refresh:f}=([u,p]=F(()=>z("/api/settings/pr-feedback","$My52-nCqWi")),u=await u,p(),u),l=M(!1),t=W({enabled:!1,comment:!0,status:!0,onlyOnFailure:!1,statusContext:"piwi/tests"});N(()=>{o.value&&Object.assign(t,o.value.settings)});const v=[{key:"comment",label:"Post a summary comment",description:"Creates one comment on the pull request and edits it on every later run, so a busy branch gets one comment rather than one per push."},{key:"status",label:"Set a commit status",description:"Marks the run’s commit passed or failed, so the pull request shows the result in its checks list. Still set on a green run when the comment is suppressed."},{key:"onlyOnFailure",label:"Only comment on failures",description:"Keeps green runs from adding a comment. The commit status is still set either way."}];async function g(){l.value=!0;try{const i=await $fetch("/api/settings/pr-feedback",{method:"PUT",body:{settings:{...t}}});o.value=i,Object.assign(t,i.settings),d.add({title:"Saved",color:"success"}),await f()}catch{d.add({title:"Save failed",color:"error"})}finally{l.value=!1}}async function w(){l.value=!0;try{const i=await $fetch("/api/settings/pr-feedback",{method:"PUT",body:{settings:null}});o.value=i,Object.assign(t,i.settings),d.add({title:"Reset to defaults",color:"success"}),await f()}catch{d.add({title:"Reset failed",color:"error"})}finally{l.value=!1}}return(i,s)=>{const x=q,h=S,_=$,C=E,b=L,V=A;return m(),y("div",D,[n(V,{icon:"i-lucide-git-pull-request",title:"Pull-request feedback",help:"settings.pr-feedback"},{subtitle:r(()=>[...s[2]||(s[2]=[k(" When a run finishes on a branch with an open pull request, post the result back to it — new failures separated from pre-existing ones, the failure clusters behind them, and the locator to use instead of the one that broke. ",-1)])]),footer:r(()=>[c("div",G,[s[4]||(s[4]=c("p",{class:"text-xs text-muted"}," Needs an SCM token with write access to the repository — set it globally, or per project in the project’s edit page. ",-1)),c("div",H,[n(b,{variant:"ghost",color:"neutral",disabled:e(l),label:"Reset to defaults",onClick:w},null,8,["disabled"]),n(b,{color:"primary",loading:e(l),icon:"i-lucide-save",onClick:g},{default:r(()=>[...s[3]||(s[3]=[k("Save",-1)])]),_:1},8,["loading"])])])]),default:r(()=>[e(o)&&!e(o).siteUrlConfigured?(m(),O(x,{key:0,color:"warning",variant:"soft",icon:"i-lucide-triangle-alert",title:"PIWI_SITE_URL is not set",description:"Nothing is posted until it is — every link in the comment is built from it, and a comment full of unreachable links is worse than no comment.",class:"mb-4"})):P("",!0),c("div",K,[n(h,{modelValue:e(t).enabled,"onUpdate:modelValue":s[0]||(s[0]=a=>e(t).enabled=a),label:"Post feedback to pull requests"},null,8,["modelValue"]),c("div",{class:B(["space-y-4 pl-1",!e(t).enabled&&"opacity-50 pointer-events-none"])},[(m(),y(I,null,R(v,a=>n(_,{key:a.key,label:a.label,description:a.description},{default:r(()=>[n(h,{modelValue:e(t)[a.key],"onUpdate:modelValue":U=>e(t)[a.key]=U},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label","description"])),64)),n(_,{label:"Commit status context",description:"The name shown next to the status in the pull request’s checks list.",hint:`default ${e(o)?.defaults.statusContext??""}`},{default:r(()=>[n(C,{modelValue:e(t).statusContext,"onUpdate:modelValue":s[1]||(s[1]=a=>e(t).statusContext=a),placeholder:e(o)?.defaults.statusContext,class:"w-full max-w-sm"},null,8,["modelValue","placeholder"])]),_:1},8,["hint"])],2)])]),_:1})])}}});export{ue as default};
@@ -0,0 +1,10 @@
1
+ import{_ as tt,a as et}from"./DoIREDVb.js";import{_ as j}from"./C0_yH0N7.js";import{d as L,b as N,B as O,ao as U,k as t,f as x,g as m,v as C,r as b,o as c,i as e,c as w,j as s,m as o,t as D,_ as z,z as nt,F as G,ap as st,h as R,x as W,am as ot,p as A,w as V,A as at}from"./Du2W7Jne.js";import{g as E,f as it}from"./DuwtTfO8.js";import{_ as lt}from"./BdfhYr-u.js";import{_ as F}from"./B3obW6cw.js";import{_ as rt}from"./Dy-TJ0Mt.js";import{u as K}from"./DSqHUrvO.js";import{_ as ct}from"./Dpd16JVI.js";import{a as ut}from"./Bm62iDV5.js";import{u as dt}from"./_mj6CfPa.js";import{u as T}from"./B8zkOmwo.js";import"./-f7BAm1H.js";import"./L3kAWB2a.js";import"./UdR3DBPS.js";import"./Nn93e_Mz.js";import"./DmkUdSS4.js";import"./BjaRappk.js";const pt={class:"space-y-3"},mt={key:0,class:"flex items-center justify-between gap-3"},_t={key:1,class:"text-sm text-muted"},ft={key:2,class:"flex items-center justify-between gap-3"},vt={class:"text-sm flex items-center gap-2"},kt={class:"flex items-start justify-between gap-3"},yt={class:"space-y-1 min-w-0"},gt={class:"text-sm font-medium"},ht={key:0,class:"text-xs text-muted whitespace-pre-wrap line-clamp-6"},xt={key:1,class:"text-xs text-muted"},bt=L({__name:"DesktopUpdateCard",props:{currentVersion:{}},setup(y){const l=N(),_=b(!1),u=b(!1),d=b(!1),a=b(!1),n=b(null),f=b(null);let g=null;O(()=>{_.value=!!U()}),ot(()=>{g?.()});async function h(){const p=U();if(!(!p||u.value)){u.value=!0;try{n.value=await p.invoke("desktop_check_update")}catch(i){l.add({title:"Update check failed",description:E(i),color:"error"})}finally{u.value=!1}}}async function v(){const p=U(),i=st();if(!(!p||d.value)){d.value=!0,f.value={downloaded:0,total:null};try{i&&!g&&(g=await i.listen("piwi:update-progress",({payload:k})=>{f.value=k})),await p.invoke("desktop_install_update"),a.value=!0}catch(k){l.add({title:"Update failed",description:E(k),color:"error"}),f.value=null}finally{d.value=!1}}}async function r(){const p=U();if(p)try{await p.invoke("desktop_restart_app")}catch{}}const B=R(()=>{const p=f.value;return p?.total?Math.min(100,Math.round(p.downloaded/p.total*100)):null});return(p,i)=>{const k=z,$=W,S=A,P=nt,I=j;return t(_)?(c(),x(I,{key:0,icon:"i-lucide-arrow-up-circle",title:"Updates"},{subtitle:m(()=>[o(" Updates install from GitHub releases and apply on restart"+D(y.currentVersion?` — you are on v${y.currentVersion}`:"")+". ",1)]),default:m(()=>[e("div",pt,[t(n)?t(n).state==="unsupported"?(c(),w("p",_t,[i[3]||(i[3]=o(" This build has no update channel — dev builds and releases made without the update signing key cannot self-update. Grab new versions from the ",-1)),s($,{to:"https://github.com/piwitests/platform/releases/latest",target:"_blank",rel:"noopener noreferrer",class:"text-primary hover:underline"},{default:m(()=>[...i[2]||(i[2]=[o("latest release",-1)])]),_:1}),i[4]||(i[4]=o(". ",-1))])):t(n).state==="uptodate"?(c(),w("div",ft,[e("p",vt,[s(S,{name:"i-lucide-check-circle",class:"size-4 text-success"}),i[5]||(i[5]=o(" You're on the latest version. ",-1))]),s(k,{size:"xs",color:"neutral",variant:"soft",icon:"i-lucide-refresh-cw",loading:t(u),onClick:h},{default:m(()=>[...i[6]||(i[6]=[o(" Check again ",-1)])]),_:1},8,["loading"])])):(c(),w(G,{key:3},[e("div",kt,[e("div",yt,[e("p",gt,"Version "+D(t(n).version)+" is available",1),t(n).notes?(c(),w("p",ht,D(t(n).notes),1)):C("",!0)]),t(a)?(c(),x(k,{key:1,size:"xs",color:"success",icon:"i-lucide-rotate-cw",class:"shrink-0",onClick:r},{default:m(()=>[...i[7]||(i[7]=[o(" Restart now ",-1)])]),_:1})):(c(),x(k,{key:0,size:"xs",icon:"i-lucide-download",loading:t(d),class:"shrink-0",onClick:v},{default:m(()=>[o(D(t(d)?"Installing…":"Install update"),1)]),_:1},8,["loading"]))]),t(d)&&t(B)!==null?(c(),x(P,{key:0,"model-value":t(B),size:"sm"},null,8,["model-value"])):C("",!0),t(a)?(c(),w("p",xt," The update is installed — it applies the next time the app starts. ")):C("",!0)],64)):(c(),w("div",mt,[i[1]||(i[1]=e("p",{class:"text-sm text-muted"},"Check GitHub for a newer version of the desktop app.",-1)),s(k,{size:"xs",icon:"i-lucide-refresh-cw",loading:t(u),onClick:h},{default:m(()=>[...i[0]||(i[0]=[o("Check for updates",-1)])]),_:1},8,["loading"])]))])]),_:1})):C("",!0)}}}),wt=Object.assign(bt,{__name:"DesktopUpdateCard"}),Ct={class:"space-y-4 text-sm"},$t={class:"space-y-1"},St={class:"space-y-3"},Ut={class:"space-y-1"},Dt={class:"flex items-start gap-2"},Bt={class:"text-xs break-all flex-1"},Rt={class:"space-y-1"},jt=`reporter: [
2
+ ['@piwitests/reporter', { projectName: 'my-project' }],
3
+ ],`,Lt=L({__name:"DesktopReporterCard",props:{url:{},token:{}},setup(y){const l=y,{copy:_}=K(),u=R(()=>`reporter: [
4
+ ['@piwitests/reporter', {
5
+ serverUrl: '${l.url}',
6
+ projectName: 'my-project',
7
+ apiKey: '${l.token}',
8
+ }],
9
+ ],`);return(d,a)=>{const n=F,f=rt,g=z,h=j;return c(),x(h,{icon:"i-lucide-upload",title:"Send results to this app"},{subtitle:m(()=>[...a[1]||(a[1]=[o(" While this app is running, the Playwright reporter finds it on its own — no URL and no token in your config. ",-1)])]),default:m(()=>[e("div",Ct,[e("div",$t,[a[2]||(a[2]=e("div",{class:"text-muted"},"playwright.config.ts",-1)),s(n,{code:jt,lang:"typescript"}),a[3]||(a[3]=e("p",{class:"text-muted text-xs"},[o(" The app publishes its address and token to "),e("code",null,"~/.piwi/desktop.json"),o(" while it runs. The reporter reads that file only when your config and environment set no "),e("code",null,"serverUrl"),o(" and no "),e("code",null,"apiKey"),o(", so a project already pointed at another dashboard is never redirected here. ")],-1))]),s(f),e("div",St,[a[6]||(a[6]=e("p",{class:"text-muted"},[o(" Configure it by hand when discovery cannot apply — tests running as another user, in a container, or with a config that already sets "),e("code",null,"serverUrl"),o(". The token is a local secret: prefer the "),e("code",null,"PIWI_API_KEY"),o(" env var over committing it. ")],-1)),e("div",Ut,[a[4]||(a[4]=e("div",{class:"text-muted"},"Access token",-1)),e("div",Dt,[e("code",Bt,D(y.token),1),s(g,{icon:"i-lucide-copy",color:"neutral",variant:"ghost",size:"xs","aria-label":"Copy access token",onClick:a[0]||(a[0]=v=>t(_)(y.token,{toast:!0}))})])]),e("div",Rt,[a[5]||(a[5]=e("div",{class:"text-muted"},"playwright.config.ts",-1)),s(n,{code:t(u),lang:"typescript"},null,8,["code"])])])])]),_:1})}}}),It=Object.assign(Lt,{__name:"DesktopReporterCard"}),Pt={class:"space-y-3 text-sm"},Vt={class:"space-y-1"},Tt={class:"flex items-start gap-2"},zt={class:"text-xs break-all flex-1"},At={class:"space-y-1"},Mt={class:"flex items-start gap-2"},Et={class:"text-xs break-all flex-1"},Nt={class:"space-y-1"},Ot=L({__name:"DesktopMcpCard",props:{url:{},token:{}},setup(y){const l=y,{copy:_}=K(),u=R(()=>`${l.url}/mcp`),d=R(()=>`claude mcp add --transport http piwi ${u.value} \\
10
+ --header "Authorization: Bearer ${l.token}"`);return(a,n)=>{const f=z,g=F,h=j;return c(),x(h,{icon:"i-lucide-plug",title:"Connect an AI assistant (MCP)"},{subtitle:m(()=>[...n[2]||(n[2]=[o(" This app exposes a local MCP endpoint. Point your client at the URL below and authenticate with the access token — it is the Bearer token, even though sign-in is off. ",-1)])]),default:m(()=>[e("div",Pt,[e("div",Vt,[n[3]||(n[3]=e("div",{class:"text-muted"},"MCP URL",-1)),e("div",Tt,[e("code",zt,D(t(u)),1),s(f,{icon:"i-lucide-copy",color:"neutral",variant:"ghost",size:"xs","aria-label":"Copy MCP URL",onClick:n[0]||(n[0]=v=>t(_)(t(u),{toast:!0}))})])]),e("div",At,[n[4]||(n[4]=e("div",{class:"text-muted"},"Access token",-1)),e("div",Mt,[e("code",Et,D(y.token),1),s(f,{icon:"i-lucide-copy",color:"neutral",variant:"ghost",size:"xs","aria-label":"Copy access token",onClick:n[1]||(n[1]=v=>t(_)(y.token,{toast:!0}))})])]),e("div",Nt,[n[5]||(n[5]=e("div",{class:"text-muted"},"Claude Code",-1)),s(g,{code:t(d),lang:"sh"},null,8,["code"])])])]),_:1})}}}),Gt=Object.assign(Ot,{__name:"DesktopMcpCard"}),Wt={key:0,class:"flex items-center gap-2 text-sm text-muted"},Ft={key:1,class:"space-y-4"},Kt={class:"flex items-start justify-between gap-4"},qt={class:"flex items-start justify-between gap-4"},Ht={key:2,class:"space-y-1 text-sm text-muted"},Yt=L({__name:"DesktopServiceCard",setup(y){const l=N(),_=b(!0),u=b(!1),d=b(!1),a=b(!1),n=b(!1);async function f(){const v=U();if(!v){u.value=!1,_.value=!1;return}try{const r=await v.invoke("desktop_get_service_settings");a.value=!!r.run_in_background,n.value=!!r.start_on_login,u.value=!0}catch{u.value=!1}finally{_.value=!1}}O(f);async function g(v){const r=U();if(r){d.value=!0;try{await r.invoke("desktop_set_run_in_background",{enabled:v}),a.value=v}catch{l.add({title:'Could not update "Run in background"',color:"error"})}finally{d.value=!1}}}async function h(v){const r=U();if(r){d.value=!0;try{await r.invoke("desktop_set_start_on_login",{enabled:v}),n.value=v}catch{l.add({title:'Could not update "Start on login"',color:"error"})}finally{d.value=!1}}}return(v,r)=>{const B=A,p=ct,i=j;return c(),x(i,{icon:"i-lucide-monitor-cog",title:"Desktop app"},{subtitle:m(()=>[...r[0]||(r[0]=[o(" Keep Piwi running in the background and start it automatically when you log in. ",-1)])]),default:m(()=>[t(_)?(c(),w("div",Wt,[s(B,{name:"i-lucide-loader-2",class:"size-4 animate-spin"}),r[1]||(r[1]=o(" Checking… ",-1))])):t(u)?(c(),w("div",Ft,[e("div",Kt,[r[2]||(r[2]=e("div",{class:"space-y-0.5"},[e("p",{class:"text-sm font-medium"},"Run in background"),e("p",{class:"text-xs text-muted"},"Closing the window keeps the server running in the tray instead of quitting.")],-1)),s(p,{"model-value":t(a),disabled:t(d),"onUpdate:modelValue":g},null,8,["model-value","disabled"])]),e("div",qt,[r[3]||(r[3]=e("div",{class:"space-y-0.5"},[e("p",{class:"text-sm font-medium"},"Start on login"),e("p",{class:"text-xs text-muted"}," Launch Piwi automatically (hidden in the tray) when you sign in to your computer. ")],-1)),s(p,{"model-value":t(n),disabled:t(d),"onUpdate:modelValue":h},null,8,["model-value","disabled"])])])):(c(),w("div",Ht,[...r[4]||(r[4]=[e("p",null,"Manage these from the Piwi tray icon:",-1),e("p",{class:"text-xs"},[o(" Right-click the Piwi icon in your system tray for "),e("strong",null,"Run in background"),o(" and "),e("strong",null,"Start on login"),o(". On Windows the icon may be hidden under the “show hidden icons” arrow (▲) next to the clock — drag it onto the taskbar to keep it in view. ")],-1)])]))]),_:1})}}}),Qt=Object.assign(Yt,{__name:"DesktopServiceCard"}),Jt={class:"space-y-6"},Xt={class:"flex flex-wrap items-center gap-x-6 gap-y-3 text-sm"},ke=L({__name:"about",async setup(y){let l,_;const u=at(),d=dt(),{data:a}=([l,_]=V(()=>T("/api/version","$mIoGdvWYhF")),l=await l,_(),l),{data:n}=([l,_]=V(()=>T("/api/admin/stats",{immediate:d,default:()=>null},"$IuuLVEbWlE")),l=await l,_(),l),{data:f}=([l,_]=V(()=>T("/api/desktop/reporter-config",{immediate:d,default:()=>null},"$A4rSe7BAN_")),l=await l,_(),l),g=u.public.appVersion,h=u.public.buildSha,v=u.public.buildTime,r=u.public.nodeVersion,B=u.public.authEnabled,p=R(()=>h?h.slice(0,7):null),i=R(()=>{const k=a.value?.dbBackend;return k==="postgresql"?"PostgreSQL":k==="sqlite"?"SQLite":k??null});return(k,$)=>{const S=et,P=tt,I=j,q=wt,H=lt,Y=It,Q=Gt,J=Qt,X=ut,M=W,Z=A;return c(),w("div",Jt,[s(I,{icon:"i-lucide-info",title:"Application"},{default:m(()=>[s(P,null,{default:m(()=>[s(S,{label:"Version",value:`v${t(g)}`},null,8,["value"]),t(p)?(c(),x(S,{key:0,label:"Build",value:t(p),hint:t(h)},null,8,["value","hint"])):C("",!0),t(v)?(c(),x(S,{key:1,label:"Built",value:("formatRelativeTime"in k?k.formatRelativeTime:t(it))(t(v)),hint:t(v)},null,8,["value","hint"])):C("",!0),s(S,{label:"Node.js",value:t(r)},null,8,["value"]),s(S,{label:"Database",value:t(i)},null,8,["value"]),s(S,{label:"Authentication",value:t(B)?"Enabled":"Disabled"},null,8,["value"])]),_:1})]),_:1}),s(q,{"current-version":t(g)},null,8,["current-version"]),t(d)?(c(),w(G,{key:0},[t(n)?(c(),x(H,{key:0,database:t(n).databaseLocation,storage:t(n).storageLocation},null,8,["database","storage"])):C("",!0),t(f)?(c(),x(Y,{key:1,url:t(f).url,token:t(f).token},null,8,["url","token"])):C("",!0),t(f)?(c(),x(Q,{key:2,url:t(f).url,token:t(f).token},null,8,["url","token"])):C("",!0),s(J)],64)):C("",!0),s(I,{icon:"i-lucide-book-open",title:"Resources"},{default:m(()=>[e("div",Xt,[s(X,{to:""},{default:m(()=>[...$[0]||($[0]=[o("Documentation",-1)])]),_:1}),s(M,{to:"/docs",class:"inline-flex items-center gap-1 text-primary hover:underline"},{default:m(()=>[...$[1]||($[1]=[o(" API reference ",-1)])]),_:1}),s(M,{to:"https://github.com/piwitests/platform",target:"_blank",rel:"noopener noreferrer",class:"inline-flex items-center gap-1 text-primary hover:underline"},{default:m(()=>[$[2]||($[2]=o(" GitHub ",-1)),s(Z,{name:"i-lucide-external-link",class:"w-3.5 h-3.5 shrink-0"})]),_:1})])]),_:1})])}}});export{ke as default};
@@ -1 +1 @@
1
- import{_ as F}from"./BxCKKeYs.js";import{_ as O}from"./eptP4pGv.js";import{_ as T}from"./D0HNloZ9.js";import{ay as D,d as G,N as Y,a as H,u as J,b as K,B as q,c as N,i as r,k as t,f as m,g as s,j as a,m as f,A as Q,r as _,D as W,o as i,v,C as B,I as X,_ as Z,p as ee,L as I,h as te}from"./NQikbhmK.js";import{_ as ae}from"./B9WhzpKO.js";import{_ as se}from"./B44A4LSJ.js";import"./CYsTqbBS.js";const oe=D("/logo-wide.svg"),ne={class:"min-h-screen flex flex-col items-center justify-center bg-elevated/50 gap-6 px-4"},le={key:1,class:"space-y-2 mb-4"},re={class:"mt-4 text-center"},ie={class:"flex items-center gap-4 text-sm text-muted"},de={href:"https://github.com/piwitests/platform",target:"_blank",rel:"noopener",class:"flex items-center gap-1.5 hover:text-default transition-colors"},ve=G({__name:"login",setup(ue){const{login:U}=Y(),C=H(),M=J(),y=K(),A=Q(),d=I({username:"",password:""}),w=_(!1),c=_(""),h=_(null),o=I({username:"",password:"",confirmPassword:"",name:""}),u=_(!1),p=_("");q(async()=>{if(A.public.demoMode){h.value=!1;return}try{const n=await $fetch("/api/auth/setup");h.value=n.needsSetup}catch{h.value=!1}});async function z(){if(!o.username||!o.password){p.value="Please choose a username and password";return}if(o.password!==o.confirmPassword){p.value="Passwords do not match";return}u.value=!0,p.value="";try{await $fetch("/api/auth/setup",{method:"POST",body:{username:o.username,password:o.password,name:o.name||void 0}}),await U(o.username,o.password),y.add({title:"Admin account created",description:"You're signed in.",color:"success"}),C.push("/")}catch(n){const e=n&&typeof n=="object"&&"data"in n?n.data?.message:void 0;p.value=e||"Failed to create the admin account",y.add({title:"Setup failed",description:p.value,color:"error"})}finally{u.value=!1}}const x=te(()=>A.public.demoMode?[]:A.public.oauthProviders||[]);q(()=>{const n=M.query.error;if(n){const e={"access-denied":"Access was denied","invalid-state":"Authentication failed (invalid state)","missing-code":"Authentication failed (missing code)","oauth-failed":"OAuth authentication failed","account-exists":"This email is already linked to a different sign-in method. Sign in with that method instead.","domain-not-allowed":"Your email domain is not allowed to sign in here.","org-not-allowed":"You are not a member of an allowed organization.","link-requires-login":"Please sign in before connecting a provider.","auth-disabled":"Authentication is not enabled","invalid-provider":"Invalid OAuth provider"};c.value=e[n]||"Authentication failed"}});async function E(){if(!d.username||!d.password){c.value="Please enter username and password";return}w.value=!0,c.value="";try{await U(d.username,d.password),y.add({title:"Login successful",color:"success"}),C.push("/")}catch(n){const e=n&&typeof n=="object"&&"data"in n?n.data?.message:void 0;c.value=e||"Invalid username or password",y.add({title:"Login failed",description:c.value,color:"error"})}finally{w.value=!1}}function S(n){window.location.href=`/api/auth/oauth/${n}/login`}return(n,e)=>{const R=F,P=O,$=T,g=X,b=ae,k=Z,V=ee,j=se,L=W;return i(),N("div",ne,[e[18]||(e[18]=r("img",{src:oe,alt:"Piwi Dashboard",class:"h-16 rounded-xl"},null,-1)),t(h)===null?(i(),m(P,{key:0,class:"w-full max-w-md"},{default:s(()=>[a(R,{text:"Loading…"})]),_:1})):t(h)?(i(),m(P,{key:1,class:"w-full max-w-md"},{header:s(()=>[...e[8]||(e[8]=[r("h1",{class:"text-xl font-semibold"},"Create the first admin account",-1),r("p",{class:"text-sm text-muted mt-1"}," Authentication is enabled and no accounts exist yet. Create the administrator account to sign in. ",-1)])]),default:s(()=>[t(p)?(i(),m($,{key:0,color:"error",title:t(p),variant:"subtle",class:"mb-4"},null,8,["title"])):v("",!0),r("form",{class:"space-y-4",onSubmit:B(z,["prevent"])},[a(b,{label:"Username",name:"username",required:""},{default:s(()=>[a(g,{modelValue:t(o).username,"onUpdate:modelValue":e[0]||(e[0]=l=>t(o).username=l),type:"text",placeholder:"Choose a username",autocomplete:"username",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Name",name:"name"},{default:s(()=>[a(g,{modelValue:t(o).name,"onUpdate:modelValue":e[1]||(e[1]=l=>t(o).name=l),type:"text",placeholder:"Administrator (optional)",autocomplete:"name",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Password",name:"password",required:""},{default:s(()=>[a(g,{modelValue:t(o).password,"onUpdate:modelValue":e[2]||(e[2]=l=>t(o).password=l),type:"password",placeholder:"Choose a password",autocomplete:"new-password",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Confirm password",name:"confirmPassword",required:""},{default:s(()=>[a(g,{modelValue:t(o).confirmPassword,"onUpdate:modelValue":e[3]||(e[3]=l=>t(o).confirmPassword=l),type:"password",placeholder:"Re-enter the password",autocomplete:"new-password",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(k,{type:"submit",block:"",loading:t(u),disabled:t(u)},{default:s(()=>[...e[9]||(e[9]=[f(" Create admin account ",-1)])]),_:1},8,["loading","disabled"])],32)]),_:1})):(i(),m(P,{key:2,class:"w-full max-w-md"},{header:s(()=>[...e[10]||(e[10]=[r("h1",{class:"text-xl font-semibold"},"Sign in to your account",-1)])]),default:s(()=>[t(c)?(i(),m($,{key:0,color:"error",title:t(c),variant:"subtle",class:"mb-4"},null,8,["title"])):v("",!0),t(x).length>0?(i(),N("div",le,[t(x).includes("google")?(i(),m(k,{key:0,block:"",color:"neutral",variant:"outline",onClick:e[4]||(e[4]=l=>S("google"))},{leading:s(()=>[a(V,{name:"i-lucide-chrome",class:"size-5"})]),default:s(()=>[e[11]||(e[11]=f(" Sign in with Google ",-1))]),_:1})):v("",!0),t(x).includes("github")?(i(),m(k,{key:1,block:"",color:"neutral",variant:"outline",onClick:e[5]||(e[5]=l=>S("github"))},{leading:s(()=>[a(V,{name:"i-lucide-github",class:"size-5"})]),default:s(()=>[e[12]||(e[12]=f(" Sign in with GitHub ",-1))]),_:1})):v("",!0),t(x).length>0?(i(),m(j,{key:2,label:"or continue with password",class:"my-4"})):v("",!0)])):v("",!0),r("form",{class:"space-y-4",onSubmit:B(E,["prevent"])},[a(b,{label:"Username",name:"username",required:""},{default:s(()=>[a(g,{modelValue:t(d).username,"onUpdate:modelValue":e[6]||(e[6]=l=>t(d).username=l),type:"text",placeholder:"Enter your username",autocomplete:"username",disabled:t(w),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Password",name:"password",required:""},{default:s(()=>[a(g,{modelValue:t(d).password,"onUpdate:modelValue":e[7]||(e[7]=l=>t(d).password=l),type:"password",placeholder:"Enter your password",autocomplete:"current-password",disabled:t(w),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(k,{type:"submit",block:"",loading:t(w),disabled:t(w)},{default:s(()=>[...e[13]||(e[13]=[f(" Login ",-1)])]),_:1},8,["loading","disabled"])],32),r("div",re,[a(L,{to:"/forgot-password",class:"text-sm text-muted hover:text-default"},{default:s(()=>[...e[14]||(e[14]=[f(" Forgot password? ",-1)])]),_:1})])]),_:1})),r("div",ie,[r("a",de,[a(V,{name:"i-lucide-github",class:"size-4"}),e[15]||(e[15]=f(" GitHub ",-1))]),e[17]||(e[17]=r("span",null,"·",-1)),a(L,{to:"/docs",class:"flex items-center gap-1.5 hover:text-default transition-colors"},{default:s(()=>[a(V,{name:"i-lucide-book-open",class:"size-4"}),e[16]||(e[16]=f(" API Docs ",-1))]),_:1})])])}}});export{ve as default};
1
+ import{_ as F}from"./CzAPFPpL.js";import{_ as O}from"./-f7BAm1H.js";import{_ as T}from"./BrQEE053.js";import{az as D,d as G,N as Y,a as H,u as J,b as K,B as q,c as N,i as r,k as t,f as m,g as s,j as a,m as f,A as Q,r as _,D as W,o as i,v,C as z,I as X,_ as Z,p as ee,L as B,h as te}from"./Du2W7Jne.js";import{_ as ae}from"./AbmKWFQQ.js";import{_ as se}from"./Dy-TJ0Mt.js";import"./L3kAWB2a.js";const oe=D("/logo-wide.svg"),ne={class:"min-h-screen flex flex-col items-center justify-center bg-elevated/50 gap-6 px-4"},le={key:1,class:"space-y-2 mb-4"},re={class:"mt-4 text-center"},ie={class:"flex items-center gap-4 text-sm text-muted"},de={href:"https://github.com/piwitests/platform",target:"_blank",rel:"noopener",class:"flex items-center gap-1.5 hover:text-default transition-colors"},ve=G({__name:"login",setup(ue){const{login:U}=Y(),C=H(),I=J(),y=K(),A=Q(),d=B({username:"",password:""}),w=_(!1),c=_(""),h=_(null),o=B({username:"",password:"",confirmPassword:"",name:""}),u=_(!1),p=_("");q(async()=>{if(A.public.demoMode){h.value=!1;return}try{const n=await $fetch("/api/auth/setup");h.value=n.needsSetup}catch{h.value=!1}});async function M(){if(!o.username||!o.password){p.value="Please choose a username and password";return}if(o.password!==o.confirmPassword){p.value="Passwords do not match";return}u.value=!0,p.value="";try{await $fetch("/api/auth/setup",{method:"POST",body:{username:o.username,password:o.password,name:o.name||void 0}}),await U(o.username,o.password),y.add({title:"Admin account created",description:"You're signed in.",color:"success"}),C.push("/")}catch(n){const e=n&&typeof n=="object"&&"data"in n?n.data?.message:void 0;p.value=e||"Failed to create the admin account",y.add({title:"Setup failed",description:p.value,color:"error"})}finally{u.value=!1}}const x=te(()=>A.public.demoMode?[]:A.public.oauthProviders||[]);q(()=>{const n=I.query.error;if(n){const e={"access-denied":"Access was denied","invalid-state":"Authentication failed (invalid state)","missing-code":"Authentication failed (missing code)","oauth-failed":"OAuth authentication failed","account-exists":"This email is already linked to a different sign-in method. Sign in with that method instead.","domain-not-allowed":"Your email domain is not allowed to sign in here.","org-not-allowed":"You are not a member of an allowed organization.","link-requires-login":"Please sign in before connecting a provider.","auth-disabled":"Authentication is not enabled","invalid-provider":"Invalid OAuth provider"};c.value=e[n]||"Authentication failed"}});async function E(){if(!d.username||!d.password){c.value="Please enter username and password";return}w.value=!0,c.value="";try{await U(d.username,d.password),y.add({title:"Login successful",color:"success"}),C.push("/")}catch(n){const e=n&&typeof n=="object"&&"data"in n?n.data?.message:void 0;c.value=e||"Invalid username or password",y.add({title:"Login failed",description:c.value,color:"error"})}finally{w.value=!1}}function S(n){window.location.href=`/api/auth/oauth/${n}/login`}return(n,e)=>{const R=F,P=O,$=T,g=X,b=ae,k=Z,V=ee,j=se,L=W;return i(),N("div",ne,[e[18]||(e[18]=r("img",{src:oe,alt:"Piwi Dashboard",class:"h-16 rounded-xl"},null,-1)),t(h)===null?(i(),m(P,{key:0,class:"w-full max-w-md"},{default:s(()=>[a(R,{text:"Loading…"})]),_:1})):t(h)?(i(),m(P,{key:1,class:"w-full max-w-md"},{header:s(()=>[...e[8]||(e[8]=[r("h1",{class:"text-xl font-semibold"},"Create the first admin account",-1),r("p",{class:"text-sm text-muted mt-1"}," Authentication is enabled and no accounts exist yet. Create the administrator account to sign in. ",-1)])]),default:s(()=>[t(p)?(i(),m($,{key:0,color:"error",title:t(p),variant:"subtle",class:"mb-4"},null,8,["title"])):v("",!0),r("form",{class:"space-y-4",onSubmit:z(M,["prevent"])},[a(b,{label:"Username",name:"username",required:""},{default:s(()=>[a(g,{modelValue:t(o).username,"onUpdate:modelValue":e[0]||(e[0]=l=>t(o).username=l),type:"text",placeholder:"Choose a username",autocomplete:"username",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Name",name:"name"},{default:s(()=>[a(g,{modelValue:t(o).name,"onUpdate:modelValue":e[1]||(e[1]=l=>t(o).name=l),type:"text",placeholder:"Administrator (optional)",autocomplete:"name",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Password",name:"password",required:""},{default:s(()=>[a(g,{modelValue:t(o).password,"onUpdate:modelValue":e[2]||(e[2]=l=>t(o).password=l),type:"password",placeholder:"Choose a password",autocomplete:"new-password",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Confirm password",name:"confirmPassword",required:""},{default:s(()=>[a(g,{modelValue:t(o).confirmPassword,"onUpdate:modelValue":e[3]||(e[3]=l=>t(o).confirmPassword=l),type:"password",placeholder:"Re-enter the password",autocomplete:"new-password",disabled:t(u),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(k,{type:"submit",block:"",loading:t(u),disabled:t(u)},{default:s(()=>[...e[9]||(e[9]=[f(" Create admin account ",-1)])]),_:1},8,["loading","disabled"])],32)]),_:1})):(i(),m(P,{key:2,class:"w-full max-w-md"},{header:s(()=>[...e[10]||(e[10]=[r("h1",{class:"text-xl font-semibold"},"Sign in to your account",-1)])]),default:s(()=>[t(c)?(i(),m($,{key:0,color:"error",title:t(c),variant:"subtle",class:"mb-4"},null,8,["title"])):v("",!0),t(x).length>0?(i(),N("div",le,[t(x).includes("google")?(i(),m(k,{key:0,block:"",color:"neutral",variant:"outline",onClick:e[4]||(e[4]=l=>S("google"))},{leading:s(()=>[a(V,{name:"i-lucide-chrome",class:"size-5"})]),default:s(()=>[e[11]||(e[11]=f(" Sign in with Google ",-1))]),_:1})):v("",!0),t(x).includes("github")?(i(),m(k,{key:1,block:"",color:"neutral",variant:"outline",onClick:e[5]||(e[5]=l=>S("github"))},{leading:s(()=>[a(V,{name:"i-lucide-github",class:"size-5"})]),default:s(()=>[e[12]||(e[12]=f(" Sign in with GitHub ",-1))]),_:1})):v("",!0),t(x).length>0?(i(),m(j,{key:2,label:"or continue with password",class:"my-4"})):v("",!0)])):v("",!0),r("form",{class:"space-y-4",onSubmit:z(E,["prevent"])},[a(b,{label:"Username",name:"username",required:""},{default:s(()=>[a(g,{modelValue:t(d).username,"onUpdate:modelValue":e[6]||(e[6]=l=>t(d).username=l),type:"text",placeholder:"Enter your username",autocomplete:"username",disabled:t(w),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(b,{label:"Password",name:"password",required:""},{default:s(()=>[a(g,{modelValue:t(d).password,"onUpdate:modelValue":e[7]||(e[7]=l=>t(d).password=l),type:"password",placeholder:"Enter your password",autocomplete:"current-password",disabled:t(w),class:"w-full"},null,8,["modelValue","disabled"])]),_:1}),a(k,{type:"submit",block:"",loading:t(w),disabled:t(w)},{default:s(()=>[...e[13]||(e[13]=[f(" Login ",-1)])]),_:1},8,["loading","disabled"])],32),r("div",re,[a(L,{to:"/forgot-password",class:"text-sm text-muted hover:text-default"},{default:s(()=>[...e[14]||(e[14]=[f(" Forgot password? ",-1)])]),_:1})])]),_:1})),r("div",ie,[r("a",de,[a(V,{name:"i-lucide-github",class:"size-4"}),e[15]||(e[15]=f(" GitHub ",-1))]),e[17]||(e[17]=r("span",null,"·",-1)),a(L,{to:"/docs",class:"flex items-center gap-1.5 hover:text-default transition-colors"},{default:s(()=>[a(V,{name:"i-lucide-book-open",class:"size-4"}),e[16]||(e[16]=f(" API Docs ",-1))]),_:1})])])}}});export{ve as default};
@@ -0,0 +1,3 @@
1
+ import{_ as Q,a as X}from"./5A6ITZXj.js";import{_ as Z}from"./BrQEE053.js";import{d as M,b as ee,B as te,ao as P,k as r,o,f as v,g as p,c as d,j as c,p as L,m as s,F as j,y as B,q as se,i as e,t as y,s as re,v as f,_ as N,r as T,w as ie,e as oe,A as ne,h as x}from"./Du2W7Jne.js";import{_ as E}from"./C0_yH0N7.js";import{g as O}from"./DuwtTfO8.js";import{_ as ae}from"./B3obW6cw.js";import{_ as ce}from"./CxyAzHr3.js";import{u as pe}from"./_mj6CfPa.js";import{u as de}from"./DSqHUrvO.js";import{u as le}from"./B8zkOmwo.js";import"./KyA_4Ks-.js";import"./Bm62iDV5.js";import"./BjaRappk.js";import"./-f7BAm1H.js";import"./pQqGiNch.js";const ue={key:0,class:"flex items-center gap-2 text-sm text-muted"},me={key:1,class:"space-y-2"},ge=["data-testid"],fe={class:"min-w-0 flex-1"},ye={class:"flex items-center gap-2"},he={class:"text-sm font-medium"},be={key:0,class:"text-xs text-muted truncate"},_e={key:1,class:"text-xs text-warning"},xe={class:"flex items-center gap-1.5 shrink-0"},ve=M({__name:"DesktopMcpClientsCard",setup($){const h=ee(),w=T(!1),I=T(!0),k=T([]),l=T(null);async function A(){const n=P();if(n)try{k.value=await n.invoke("desktop_mcp_clients"),w.value=!0}catch{w.value=!1}finally{I.value=!1}}te(()=>{P()?A():I.value=!1});async function b(n,a){const m=P();if(m){l.value=n.id;try{const _=await m.invoke(a?"desktop_mcp_connect":"desktop_mcp_disconnect",{clientId:n.id});k.value=k.value.map(g=>g.id===_.id?_:g),h.add({title:a?`${n.label} connected`:`${n.label} disconnected`,description:a?`Restart ${n.label} to pick up the new server.`:void 0,color:"success",icon:"i-lucide-plug"})}catch(_){h.add({title:`Could not update ${n.label}`,description:O(_),color:"error"})}finally{l.value=null}}}async function u(n){const a=P();if(a)try{await a.invoke("desktop_mcp_reveal",{clientId:n.id})}catch(m){h.add({title:"Could not open the file",description:O(m),color:"error"})}}function S(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,a)=>{const m=L,_=re,g=N,U=E;return r(w)?(o(),v(U,{key:0,icon:"i-lucide-plug-zap",title:"Connect a client on this machine"},{subtitle:p(()=>[...a[0]||(a[0]=[s(" One click writes the ",-1),e("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:p(()=>[r(I)?(o(),d("div",ue,[c(m,{name:"i-lucide-loader-2",class:"size-4 animate-spin"}),a[1]||(a[1]=s(" Detecting clients… ",-1))])):(o(),d("div",me,[(o(!0),d(j,null,B(r(k),i=>(o(),d("div",{key:i.id,"data-testid":`mcp-client-${i.id}`,class:se(["flex items-center gap-3 rounded-md border border-default p-2.5",i.status==="not_installed"?"opacity-60":""])},[c(m,{name:"i-lucide-bot",class:"size-4 text-gray-400 shrink-0"}),e("div",fe,[e("div",ye,[e("p",he,y(i.label),1),S(i)?(o(),v(_,{key:0,color:S(i).color,variant:"subtle",size:"sm"},{default:p(()=>[s(y(S(i).label),1)]),_:2},1032,["color"])):f("",!0)]),i.config_path?(o(),d("p",be,y(i.config_path),1)):f("",!0),i.detail?(o(),d("p",_e,y(i.detail),1)):f("",!0)]),e("div",xe,[i.status==="not_connected"?(o(),v(g,{key:0,size:"xs",icon:"i-lucide-plug",loading:r(l)===i.id,onClick:q=>b(i,!0)},{default:p(()=>[...a[2]||(a[2]=[s(" Connect ",-1)])]),_:1},8,["loading","onClick"])):i.status==="stale"?(o(),v(g,{key:1,size:"xs",color:"warning",icon:"i-lucide-refresh-cw",loading:r(l)===i.id,onClick:q=>b(i,!0)},{default:p(()=>[...a[3]||(a[3]=[s(" Update ",-1)])]),_:1},8,["loading","onClick"])):f("",!0),i.status==="connected"||i.status==="stale"?(o(),v(g,{key:2,size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-unplug",loading:r(l)===i.id,onClick:q=>b(i,!1)},{default:p(()=>[...a[4]||(a[4]=[s(" Disconnect ",-1)])]),_:1},8,["loading","onClick"])):f("",!0),i.status!=="not_installed"&&i.config_path?(o(),v(g,{key:3,size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-folder-open","aria-label":"Reveal config file",title:"Reveal config file",onClick:q=>u(i)},null,8,["onClick"])):f("",!0)])],10,ge))),128)),a[5]||(a[5]=e("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})):f("",!0)}}}),ke=Object.assign(ve,{__name:"DesktopMcpClientsCard"}),we=[{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"]}}];function Ie($){return new URL(globalThis.location.href)}const Ce={class:"max-w-3xl mx-auto p-6 space-y-6"},je={key:0,class:"mb-4 space-y-3 rounded-md border border-default bg-elevated/50 p-3"},Se={class:"space-y-1"},qe={class:"flex items-start gap-2"},Re={class:"text-xs break-all flex-1"},Ae={class:"space-y-1"},De={class:"flex items-start gap-2"},Pe={class:"text-xs break-all flex-1"},Te={class:"text-sm text-gray-500 dark:text-gray-400 mb-4"},Ue={class:"space-y-3"},ze={class:"space-y-3"},$e={class:"space-y-3"},Oe={class:"space-y-3"},Me={class:"space-y-3"},Le={class:"space-y-3"},Be={class:"flex flex-col gap-1.5"},Ne={class:"min-w-0"},Ee={class:"text-sm font-mono font-semibold text-foreground"},Ge={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},Fe={class:"space-y-3 text-sm text-gray-600 dark:text-gray-400"},He={key:0},We={key:1},Ve={key:2,class:"text-xs text-gray-400"},Ye={key:3,class:"text-xs text-gray-400"},Je={class:"space-y-2"},Ke={class:"flex items-center gap-2"},Qe={class:"flex-1 px-3 py-2 bg-muted rounded-md text-sm font-mono break-all"},Xe={class:"text-xs text-gray-400"},Ze="pd_YOUR_API_KEY",ft=M({__name:"mcp",async setup($){let h,w;const I=ne(),k=I.public.demoMode,l=pe(),{copy:A}=de(),{data:b}=([h,w]=ie(()=>le("/api/desktop/reporter-config",{immediate:l,default:()=>null},"$fdl6kilREP")),h=await h,w(),h),u=x(()=>b.value?.token??Ze),S=Ie(),n=x(()=>`${b.value?.url??I.public.siteUrl??S.origin}/mcp`);oe({title:"MCP server — Piwi Dashboard"});const a=we,m=[{label:"Claude Code",slot:"claude-code"},{label:"Cursor",slot:"cursor"},{label:"VS Code",slot:"vscode"},{label:"Claude Desktop",slot:"claude-desktop"},{label:"Gemini CLI",slot:"gemini"},{label:"Windsurf / Continue",slot:"windsurf"}],_=x(()=>`claude mcp add --transport http piwi ${n.value} \\
2
+ --header "Authorization: Bearer ${u.value}"`),g=x(()=>JSON.stringify({mcpServers:{piwi:{url:n.value,headers:{Authorization:`Bearer ${u.value}`}}}},null,2)),U=x(()=>JSON.stringify({servers:{piwi:{type:"http",url:n.value,headers:{Authorization:`Bearer ${u.value}`}}}},null,2)),i=x(()=>JSON.stringify({mcpServers:{piwi:{type:"http",url:n.value,headers:{Authorization:`Bearer ${u.value}`}}}},null,2)),q=x(()=>`gemini mcp add --transport http piwi ${n.value} \\
3
+ --header "Authorization: Bearer ${u.value}"`),G=x(()=>JSON.stringify({mcpServers:{piwi:{serverUrl:n.value,headers:{Authorization:`Bearer ${u.value}`}}}},null,2));return(F,t)=>{const H=X,W=Z,V=ke,z=N,C=ae,Y=ce,D=E,J=L,K=Q;return o(),v(K,null,{header:p(()=>[c(H,{title:"MCP server"})]),body:p(()=>[e("div",Ce,[r(k)?(o(),v(W,{key:0,color:"info",icon:"i-lucide-bot",title:"Feature preview",description:"The MCP endpoint is not active in this demo — it requires a real Piwi backend. The tools and client setup shown below reflect what your own deployment exposes."})):f("",!0),c(V),c(D,{icon:"i-lucide-settings-2",title:"Client setup",help:"mcp.client-setup"},{default:p(()=>[r(b)?(o(),d("div",je,[e("div",Se,[t[2]||(t[2]=e("div",{class:"text-xs text-muted"},"MCP URL",-1)),e("div",qe,[e("code",Re,y(r(n)),1),c(z,{icon:"i-lucide-copy",color:"neutral",variant:"ghost",size:"xs","aria-label":"Copy MCP URL",onClick:t[0]||(t[0]=R=>r(A)(r(n),{toast:!0}))})])]),e("div",Ae,[t[3]||(t[3]=e("div",{class:"text-xs text-muted"},"Access token",-1)),e("div",De,[e("code",Pe,y(r(u)),1),c(z,{icon:"i-lucide-copy",color:"neutral",variant:"ghost",size:"xs","aria-label":"Copy access token",onClick:t[1]||(t[1]=R=>r(A)(r(u),{toast:!0}))})])]),t[4]||(t[4]=e("p",{class:"text-xs text-muted"},[s(" This app authenticates with a local access token even though sign-in is off — it is the "),e("code",{class:"font-mono"},"Bearer"),s(" value, already filled into the snippets below. ")],-1))])):f("",!0),e("p",Te,[r(b)?(o(),d(j,{key:0},[s("Pick your client below — the URL and access token above are already baked into each snippet.")],64)):(o(),d(j,{key:1},[t[5]||(t[5]=s("Replace ",-1)),t[6]||(t[6]=e("code",{class:"px-1 py-0.5 bg-muted rounded text-xs font-mono"},"pd_YOUR_API_KEY",-1)),t[7]||(t[7]=s(" with your actual API key. The MCP URL shown in the snippets is auto-detected from your current browser origin.",-1))],64))]),c(Y,{items:m,ui:{list:"mb-4"}},{"claude-code":p(()=>[e("div",Ue,[t[8]||(t[8]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"}," Run once in any terminal. Claude Code stores the server in your global MCP config. ",-1)),c(C,{code:r(_),lang:"sh"},null,8,["code"]),t[9]||(t[9]=e("p",{class:"text-xs text-gray-400"},[s(" After adding, restart Claude Code and use "),e("code",{class:"font-mono"},"/mcp"),s(" to verify "),e("strong",null,"piwi"),s(" is connected. Claude will call the tools automatically when you ask about test results or failures. ")],-1))])]),cursor:p(()=>[e("div",ze,[t[10]||(t[10]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[s(" Add to "),e("code",{class:"font-mono text-xs"},"~/.cursor/mcp.json"),s(" (global) or "),e("code",{class:"font-mono text-xs"},".cursor/mcp.json"),s(" in your project root: ")],-1)),c(C,{code:r(g),lang:"json"},null,8,["code"]),t[11]||(t[11]=e("p",{class:"text-xs text-gray-400"}," Restart Cursor, then enable the MCP server in Cursor Settings → MCP. ",-1))])]),vscode:p(()=>[e("div",$e,[t[12]||(t[12]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[s(" Add to "),e("code",{class:"font-mono text-xs"},".vscode/mcp.json"),s(" in your workspace (VS Code Copilot agent mode, version 1.99+): ")],-1)),c(C,{code:r(U),lang:"json"},null,8,["code"]),t[13]||(t[13]=e("p",{class:"text-xs text-gray-400"}," The server appears in the Copilot chat agent drop-down once the file is saved. ",-1))])]),"claude-desktop":p(()=>[e("div",Oe,[t[14]||(t[14]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"},"Add to your Claude Desktop config file:",-1)),t[15]||(t[15]=e("ul",{class:"text-xs text-gray-400 space-y-0.5 mb-2"},[e("li",null,[e("strong",null,"macOS:"),e("code",{class:"font-mono"},"~/Library/Application Support/Claude/claude_desktop_config.json")]),e("li",null,[e("strong",null,"Windows:"),e("code",{class:"font-mono"},"%APPDATA%\\Claude\\claude_desktop_config.json")])],-1)),c(C,{code:r(i),lang:"json"},null,8,["code"]),t[16]||(t[16]=e("p",{class:"text-xs text-gray-400"}," Requires Claude Desktop with remote MCP support (released early 2025). Restart the app after saving. ",-1))])]),gemini:p(()=>[e("div",Me,[t[17]||(t[17]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"},"Run once to register the server with Gemini CLI:",-1)),c(C,{code:r(q),lang:"sh"},null,8,["code"]),t[18]||(t[18]=e("p",{class:"text-xs text-gray-400"}," Gemini CLI fetches the tool list on startup and makes them available in agent mode. ",-1))])]),windsurf:p(()=>[e("div",Le,[t[19]||(t[19]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[s(" Add to your Windsurf or Continue MCP config. For Windsurf: "),e("code",{class:"font-mono text-xs"},"~/.codeium/windsurf/mcp_config.json"),s(". For Continue: "),e("code",{class:"font-mono text-xs"},"~/.continue/config.json"),s(" under "),e("code",{class:"font-mono text-xs"},"mcpServers"),s(". ")],-1)),c(C,{code:r(G),lang:"json"},null,8,["code"])])]),_:1})]),_:1}),c(D,{icon:"i-lucide-bot",title:"What it provides",help:"mcp.tools"},{default:p(()=>[e("div",Be,[(o(!0),d(j,null,B(r(a),R=>(o(),d("div",{key:R.name,class:"flex items-start gap-3 px-3 py-2.5 rounded-md bg-elevated/50 border border-default hover:bg-elevated transition-colors"},[c(J,{name:"i-lucide-wrench",class:"size-4 mt-0.5 shrink-0 text-primary"}),e("div",Ne,[e("p",Ee,y(R.name),1),e("p",Ge,y(R.description),1)])]))),128))])]),_:1}),c(D,{icon:"i-lucide-key",title:"Authentication",help:"mcp.auth"},{default:p(()=>[e("div",Fe,[t[24]||(t[24]=e("p",null,[s(" MCP requests are authenticated with the same API keys used by the REST API. API keys start with "),e("code",{class:"px-1 py-0.5 bg-muted rounded text-xs font-mono"},"pd_"),s(". ")],-1)),r(l)?(o(),d("p",We,[...t[21]||(t[21]=[s(" This app provides a local access token automatically — shown in ",-1),e("strong",null,"Client setup",-1),s(" above and already filled into every snippet, so there is nothing to replace. ",-1)])])):(o(),d("p",He,[...t[20]||(t[20]=[s(" Generate a key in ",-1),e("strong",null,"Settings → Users → [your account] → API keys",-1),s(", then replace ",-1),e("code",{class:"px-1 py-0.5 bg-muted rounded text-xs font-mono"},"pd_YOUR_API_KEY",-1),s(" in the snippets above. ",-1)])])),r(l)?(o(),d("p",Ye,[...t[23]||(t[23]=[s(" This desktop app keeps sign-in off but still requires its own local access token on every request — it is the ",-1),e("code",{class:"font-mono"},"Bearer",-1),s(" value. The endpoint is not open. ",-1)])])):(o(),d("p",Ve,[...t[22]||(t[22]=[s(" When authentication is disabled (",-1),e("code",{class:"font-mono"},"PIWI_AUTH_ENABLED",-1),s(" not set), any request is accepted without a key. ",-1)])]))])]),_:1}),c(D,{icon:"i-lucide-link",title:"Server URL"},{default:p(()=>[e("div",Je,[e("div",Ke,[e("code",Qe,y(r(n)),1),c(z,{icon:"i-lucide-external-link",size:"sm",color:"neutral",variant:"outline",title:"Open API docs",to:"/docs",external:!r(k)},{default:p(()=>[...t[25]||(t[25]=[s(" REST API docs ",-1)])]),_:1},8,["external"])]),e("p",Xe,[t[32]||(t[32]=s(" This is your Piwi instance's MCP endpoint. It is also the server URL to paste into client configs above. ",-1)),r(l)?(o(),d(j,{key:0},[t[26]||(t[26]=s("This desktop app requires its local access token as the ",-1)),t[27]||(t[27]=e("code",{class:"font-mono"},"Bearer",-1)),t[28]||(t[28]=s(" value on every request.",-1))],64)):(o(),d(j,{key:1},[t[29]||(t[29]=s("The server requires a valid Bearer token (or no auth if ",-1)),t[30]||(t[30]=e("code",{class:"font-mono"},"PIWI_AUTH_ENABLED",-1)),t[31]||(t[31]=s(" is not set).",-1))],64))])])]),_:1})])]),_:1})}}});export{ft as default};
@@ -1 +1 @@
1
- import{_ as $,a as k}from"./279D2RYp.js";import{_ as y,a as B}from"./CHEFCN8Q.js";import{u as C,_ as D}from"./Bp5ELvx9.js";import{a3 as M,a5 as S,o as m,f as d,g as i,V as c,i as p,q as u,k as s,X as U,h as _,a8 as N,B as P,r as q,d as T,e as j,j as o,aJ as V}from"./NQikbhmK.js";import"./YVN7WG7q.js";import"./DEFEpYzn.js";import"./DP8hfJ9h.js";import"./B7NBP1C-.js";import"./BjaRappk.js";import"./CHNwfU1y.js";const H={slots:{root:"shrink-0 flex items-center justify-between border-b border-default px-4 sm:px-6 gap-1.5 overflow-x-auto min-h-[49px]",left:"flex items-center gap-1.5",right:"flex items-center gap-1.5"}},z={__name:"UDashboardToolbar",props:{as:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(t){const e=M("dashboardToolbar",t),a=S(),l=_(()=>N({extend:H,...a.ui?.dashboardToolbar||{}})());return(r,f)=>(m(),d(s(U),{as:s(e).as,"data-slot":"root",class:u(l.value.root({class:[s(e).ui?.root,s(e).class]}))},{default:i(()=>[c(r.$slots,"default",{},()=>[p("div",{"data-slot":"left",class:u(l.value.left({class:[s(e).ui?.left]}))},[c(r.$slots,"left")],2),p("div",{"data-slot":"right",class:u(l.value.right({class:[s(e).ui?.right]}))},[c(r.$slots,"right")],2)])]),_:3},8,["as","class"]))}};function A(){const t=q({account:!1,users:!1,notifications:!1,tags:!1,storage:!1,"wasted-time":!1,"timeout-hygiene":!1,"pr-feedback":!1,ai:!1,about:!1});async function n(){const e=[];e.push($fetch("/api/settings/ai").then(a=>{t.value.ai=!!a.envManaged}).catch(()=>{})),e.push($fetch("/api/settings/wasted-waits").then(a=>{t.value["wasted-time"]=!!a.envManaged}).catch(()=>{})),e.push($fetch("/api/settings/smtp").then(a=>{t.value.notifications=!!(a.envManaged&&a.configured)}).catch(()=>{})),await Promise.all(e)}return P(()=>{n()}),{envManaged:t,refresh:n}}const E={class:"flex flex-col gap-4 sm:gap-6 lg:gap-12 w-full lg:max-w-4xl mx-auto"},W=T({__name:"settings",setup(t){j({title:"Settings — Piwi Dashboard"});const{envManaged:n}=A(),e=C(n),a=_(()=>[e.value,[{label:"Documentation",icon:"i-lucide-book-open",to:"https://github.com/piwitests/platform",target:"_blank"}]]);return(l,r)=>{const f=$,g=k,h=B,b=D,v=z,x=V,w=y;return m(),d(w,{id:"settings",ui:{body:"lg:py-12"}},{header:i(()=>[o(h,null,{leading:i(()=>[o(f),o(g,{items:[{label:"Home",icon:"i-lucide-house",to:"/"},{label:"Settings"}]})]),_:1}),o(v,null,{default:i(()=>[o(b,{items:s(a),highlight:"",class:"-mx-1 flex-1",ui:{list:"overflow-x-auto",root:"min-w-0"}},null,8,["items"])]),_:1})]),body:i(()=>[p("div",E,[o(x)])]),_:1})}}});export{W as default};
1
+ import{_ as $,a as k}from"./CXEH9OPk.js";import{_ as y,a as B}from"./5A6ITZXj.js";import{u as C,_ as D}from"./CIoSMkpp.js";import{a3 as M,a5 as S,o as m,f as d,g as i,V as c,i as p,q as u,k as s,X as U,h as _,a8 as N,B as P,r as q,d as T,e as j,j as o,aK as V}from"./Du2W7Jne.js";import"./KyA_4Ks-.js";import"./DfgOx_ou.js";import"./BT3wGCTI.js";import"./Cbh--1MW.js";import"./BjaRappk.js";import"./_mj6CfPa.js";const H={slots:{root:"shrink-0 flex items-center justify-between border-b border-default px-4 sm:px-6 gap-1.5 overflow-x-auto min-h-[49px]",left:"flex items-center gap-1.5",right:"flex items-center gap-1.5"}},z={__name:"UDashboardToolbar",props:{as:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(t){const e=M("dashboardToolbar",t),a=S(),l=_(()=>N({extend:H,...a.ui?.dashboardToolbar||{}})());return(r,f)=>(m(),d(s(U),{as:s(e).as,"data-slot":"root",class:u(l.value.root({class:[s(e).ui?.root,s(e).class]}))},{default:i(()=>[c(r.$slots,"default",{},()=>[p("div",{"data-slot":"left",class:u(l.value.left({class:[s(e).ui?.left]}))},[c(r.$slots,"left")],2),p("div",{"data-slot":"right",class:u(l.value.right({class:[s(e).ui?.right]}))},[c(r.$slots,"right")],2)])]),_:3},8,["as","class"]))}};function A(){const t=q({account:!1,users:!1,notifications:!1,tags:!1,storage:!1,"wasted-time":!1,"timeout-hygiene":!1,"pr-feedback":!1,ai:!1,about:!1});async function n(){const e=[];e.push($fetch("/api/settings/ai").then(a=>{t.value.ai=!!a.envManaged}).catch(()=>{})),e.push($fetch("/api/settings/wasted-waits").then(a=>{t.value["wasted-time"]=!!a.envManaged}).catch(()=>{})),e.push($fetch("/api/settings/smtp").then(a=>{t.value.notifications=!!(a.envManaged&&a.configured)}).catch(()=>{})),await Promise.all(e)}return P(()=>{n()}),{envManaged:t,refresh:n}}const E={class:"flex flex-col gap-4 sm:gap-6 lg:gap-12 w-full lg:max-w-4xl mx-auto"},W=T({__name:"settings",setup(t){j({title:"Settings — Piwi Dashboard"});const{envManaged:n}=A(),e=C(n),a=_(()=>[e.value,[{label:"Documentation",icon:"i-lucide-book-open",to:"https://github.com/piwitests/platform",target:"_blank"}]]);return(l,r)=>{const f=$,g=k,h=B,b=D,v=z,x=V,w=y;return m(),d(w,{id:"settings",ui:{body:"lg:py-12"}},{header:i(()=>[o(h,null,{leading:i(()=>[o(f),o(g,{items:[{label:"Home",icon:"i-lucide-house",to:"/"},{label:"Settings"}]})]),_:1}),o(v,null,{default:i(()=>[o(b,{items:s(a),highlight:"",class:"-mx-1 flex-1",ui:{list:"overflow-x-auto",root:"min-w-0"}},null,8,["items"])]),_:1})]),body:i(()=>[p("div",E,[o(x)])]),_:1})}}});export{W as default};
@@ -1 +1 @@
1
- import{d as j,b as F,w as R,au as T,c as y,j as l,g as r,o as _,i as m,F as $,y as S,k as i,I as U,_ as V,m as u,r as C,L as O}from"./NQikbhmK.js";import{_ as P}from"./B9WhzpKO.js";import{_ as A}from"./DprVVyUQ.js";import{u as B}from"./CpjgB2aY.js";import"./CYsTqbBS.js";import"./C7P1UCO2.js";import"./BjaRappk.js";import"./Bn0YQDyy.js";import"./eptP4pGv.js";const N={class:"space-y-6"},E={class:"grid grid-cols-1 gap-x-4 gap-y-3 sm:grid-cols-2"},L={class:"flex items-center justify-end gap-2"},X=j({__name:"timeout-hygiene",async setup(z){let d,p;const c=F(),{data:s,refresh:f}=([d,p]=R(()=>B("/api/settings/timeout-hygiene","$8Luq-s6QSj")),d=await d,p(),d),o=C(!1),n=O({minRuns:0,factor:0,floorMs:0,safety:0,recommendedFloorMs:0,slowStaleP95Ms:0});T(()=>{s.value&&Object.assign(n,s.value.thresholds)});const g=[{key:"minRuns",label:"Minimum runs",description:"Executions with a duration needed before a test is judged.",min:1,step:1},{key:"factor",label:"Oversize factor (×)",description:"Flag a timeout when it is at least this many times the test’s p95 duration.",min:1,step:.5},{key:"floorMs",label:"Minimum headroom (ms)",description:"Only flag when the timeout − p95 gap is at least this many ms.",min:0,step:1e3},{key:"safety",label:"Recommendation safety (×)",description:"Recommended timeout = p95 × this.",min:1,step:.5},{key:"recommendedFloorMs",label:"Recommendation floor (ms)",description:"Never recommend a timeout below this many ms.",min:0,step:1e3},{key:"slowStaleP95Ms",label:"Stale slow() p95 (ms)",description:"A test.slow() test is stale when its p95 duration stays under this.",min:0,step:1e3}];async function v(){o.value=!0;try{const e=await $fetch("/api/settings/timeout-hygiene",{method:"PUT",body:{thresholds:{...n}}});s.value=e,c.add({title:"Timeout-hygiene thresholds saved",color:"success"}),await f()}catch(e){const a=e&&typeof e=="object"&&"data"in e?e.data?.message:void 0;c.add({title:"Save failed",description:a||"An error occurred",color:"error"})}finally{o.value=!1}}async function b(){o.value=!0;try{const e=await $fetch("/api/settings/timeout-hygiene",{method:"PUT",body:{thresholds:null}});s.value=e,Object.assign(n,e.thresholds),c.add({title:"Reset to defaults",color:"success"}),await f()}catch{c.add({title:"Reset failed",color:"error"})}finally{o.value=!1}}return(e,a)=>{const w=U,k=P,h=V,x=A;return _(),y("div",N,[l(x,{icon:"i-lucide-scissors",title:"Timeout hygiene",help:"settings.timeout-hygiene"},{subtitle:r(()=>[...a[0]||(a[0]=[u(" Tune how timeout opportunities are detected — oversized per-test timeouts and stale ",-1),m("code",null,"test.slow()",-1),u(" marks — surfaced per project (Performance tab) and in Analytics. Opportunities are recomputed when viewed, so changes apply to existing runs immediately. ",-1)])]),footer:r(()=>[m("div",L,[l(h,{variant:"ghost",color:"neutral",disabled:i(o),label:"Reset to defaults",onClick:b},null,8,["disabled"]),l(h,{color:"primary",loading:i(o),icon:"i-lucide-save",onClick:v},{default:r(()=>[...a[1]||(a[1]=[u("Save",-1)])]),_:1},8,["loading"])])]),default:r(()=>[m("div",E,[(_(),y($,null,S(g,t=>l(k,{key:t.key,label:t.label,description:t.description,hint:`default ${i(s)?.defaults[t.key]??""}`},{default:r(()=>[l(w,{modelValue:i(n)[t.key],"onUpdate:modelValue":M=>i(n)[t.key]=M,modelModifiers:{number:!0},type:"number",min:t.min,step:t.step,placeholder:`default ${i(s)?.defaults[t.key]??""}`,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","min","step","placeholder"])]),_:2},1032,["label","description","hint"])),64))])]),_:1})])}}});export{X as default};
1
+ import{d as j,b as F,w as R,aw as T,c as y,j as l,g as r,o as _,i as m,F as $,y as S,k as i,I as U,_ as V,m as u,r as C,L as O}from"./Du2W7Jne.js";import{_ as P}from"./AbmKWFQQ.js";import{_ as A}from"./C0_yH0N7.js";import{u as B}from"./B8zkOmwo.js";import"./L3kAWB2a.js";import"./Bm62iDV5.js";import"./BjaRappk.js";import"./DSqHUrvO.js";import"./-f7BAm1H.js";const N={class:"space-y-6"},E={class:"grid grid-cols-1 gap-x-4 gap-y-3 sm:grid-cols-2"},L={class:"flex items-center justify-end gap-2"},X=j({__name:"timeout-hygiene",async setup(z){let d,p;const c=F(),{data:s,refresh:f}=([d,p]=R(()=>B("/api/settings/timeout-hygiene","$8Luq-s6QSj")),d=await d,p(),d),o=C(!1),n=O({minRuns:0,factor:0,floorMs:0,safety:0,recommendedFloorMs:0,slowStaleP95Ms:0});T(()=>{s.value&&Object.assign(n,s.value.thresholds)});const g=[{key:"minRuns",label:"Minimum runs",description:"Executions with a duration needed before a test is judged.",min:1,step:1},{key:"factor",label:"Oversize factor (×)",description:"Flag a timeout when it is at least this many times the test’s p95 duration.",min:1,step:.5},{key:"floorMs",label:"Minimum headroom (ms)",description:"Only flag when the timeout − p95 gap is at least this many ms.",min:0,step:1e3},{key:"safety",label:"Recommendation safety (×)",description:"Recommended timeout = p95 × this.",min:1,step:.5},{key:"recommendedFloorMs",label:"Recommendation floor (ms)",description:"Never recommend a timeout below this many ms.",min:0,step:1e3},{key:"slowStaleP95Ms",label:"Stale slow() p95 (ms)",description:"A test.slow() test is stale when its p95 duration stays under this.",min:0,step:1e3}];async function v(){o.value=!0;try{const e=await $fetch("/api/settings/timeout-hygiene",{method:"PUT",body:{thresholds:{...n}}});s.value=e,c.add({title:"Timeout-hygiene thresholds saved",color:"success"}),await f()}catch(e){const a=e&&typeof e=="object"&&"data"in e?e.data?.message:void 0;c.add({title:"Save failed",description:a||"An error occurred",color:"error"})}finally{o.value=!1}}async function b(){o.value=!0;try{const e=await $fetch("/api/settings/timeout-hygiene",{method:"PUT",body:{thresholds:null}});s.value=e,Object.assign(n,e.thresholds),c.add({title:"Reset to defaults",color:"success"}),await f()}catch{c.add({title:"Reset failed",color:"error"})}finally{o.value=!1}}return(e,a)=>{const w=U,k=P,h=V,x=A;return _(),y("div",N,[l(x,{icon:"i-lucide-scissors",title:"Timeout hygiene",help:"settings.timeout-hygiene"},{subtitle:r(()=>[...a[0]||(a[0]=[u(" Tune how timeout opportunities are detected — oversized per-test timeouts and stale ",-1),m("code",null,"test.slow()",-1),u(" marks — surfaced per project (Performance tab) and in Analytics. Opportunities are recomputed when viewed, so changes apply to existing runs immediately. ",-1)])]),footer:r(()=>[m("div",L,[l(h,{variant:"ghost",color:"neutral",disabled:i(o),label:"Reset to defaults",onClick:b},null,8,["disabled"]),l(h,{color:"primary",loading:i(o),icon:"i-lucide-save",onClick:v},{default:r(()=>[...a[1]||(a[1]=[u("Save",-1)])]),_:1},8,["loading"])])]),default:r(()=>[m("div",E,[(_(),y($,null,S(g,t=>l(k,{key:t.key,label:t.label,description:t.description,hint:`default ${i(s)?.defaults[t.key]??""}`},{default:r(()=>[l(w,{modelValue:i(n)[t.key],"onUpdate:modelValue":M=>i(n)[t.key]=M,modelModifiers:{number:!0},type:"number",min:t.min,step:t.step,placeholder:`default ${i(s)?.defaults[t.key]??""}`,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","min","step","placeholder"])]),_:2},1032,["label","description","hint"])),64))])]),_:1})])}}});export{X as default};
@@ -1 +1 @@
1
- import{d as S,o as v,c as h,k as t,F as J,i as x,q as B,V as K,m as l,t as L,j as n,p as A,f as U,g as a,_ as q,v as F,l as M,h as y,r as _,K as R,J as T}from"./NQikbhmK.js";import{_ as H}from"./B44A4LSJ.js";import{u as G}from"./CylWPruw.js";import{u as Q}from"./Bn0YQDyy.js";function W(i){let o=i,u=null,j=null;const k=i.lastIndexOf(":");if(k>0){const m=i.slice(k+1);if(/^\d+$/.test(m)){const c=i.slice(0,k),b=c.lastIndexOf(":");if(b>0){const g=c.slice(b+1);/^\d+$/.test(g)?(j=parseInt(m,10),u=parseInt(g,10),o=c.slice(0,b)):(u=parseInt(m,10),o=c)}else u=parseInt(m,10),o=c}}return{filePath:o,line:u,column:j}}const X={class:"group/ide inline-flex items-center gap-1 min-w-0 max-w-full align-middle"},Y=["title","aria-label"],Z={type:"button",class:"shrink-0 inline-flex items-center rounded p-0.5 text-muted cursor-pointer transition-colors hover:bg-elevated/60 hover:text-default","aria-label":"Choose how to open in IDE",title:"Choose how to open"},ee={class:"w-56 p-1 space-y-0.5"},te=S({__name:"OpenInIdeLink",props:{filePath:{},line:{default:null},column:{default:null},location:{},projectKey:{},projectName:{},mono:{type:Boolean,default:!0}},setup(i){const o=i,{openInIde:u,openInVscode:j,openViaJetbrainsUrl:k,openViaJetbrainsHttp:m,resolveAbsPath:c,openSettings:b}=G(),{copy:g}=Q(),P=y(()=>o.filePath?{filePath:o.filePath,line:o.line??null,column:o.column??null}:o.location?W(o.location):{filePath:"",line:null,column:null}),f=y(()=>P.value.filePath),w=y(()=>P.value.line),I=y(()=>w.value?`${f.value}:${w.value}`:f.value),O=y(()=>c(f.value,o.projectKey)),r=y(()=>({filePath:f.value,line:w.value,column:P.value.column,projectKey:o.projectKey??null,projectName:o.projectName??null})),C=_(!1),N=_(!1);function D(){N.value=!0,R(()=>{C.value=!0})}function p($){C.value=!1,$()}return($,e)=>{const z=A,d=q,V=H,E=T;return v(),h("span",X,[t(f)?(v(),h(J,{key:0},[x("button",{type:"button",class:"inline-flex items-center gap-1 min-w-0 max-w-full cursor-pointer text-left",title:`Open ${t(I)} in IDE`,"aria-label":`Open ${t(I)} in IDE`,onClick:e[0]||(e[0]=s=>t(u)(t(r)))},[x("span",{class:B([i.mono?"font-mono":"","truncate underline decoration-dashed decoration-1 underline-offset-2 decoration-gray-400/70 dark:decoration-gray-500/70 transition-colors group-hover/ide:decoration-current"])},[K($.$slots,"default",{},()=>[l(L(t(I)),1)])],2),n(z,{name:"i-lucide-external-link",class:"size-3 shrink-0 opacity-0 transition-opacity group-hover/ide:opacity-100"})],8,Y),t(N)?(v(),U(E,{key:1,open:t(C),"onUpdate:open":e[8]||(e[8]=s=>M(C)?C.value=s:null)},{content:a(()=>[x("div",ee,[e[16]||(e[16]=x("p",{class:"text-xs font-medium text-muted px-2 pt-1 pb-1"},"Open in IDE",-1)),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-wand-sparkles",onClick:e[1]||(e[1]=s=>p(()=>t(u)({...t(r),method:"auto"})))},{default:a(()=>[...e[9]||(e[9]=[l(" Auto (try all) ",-1)])]),_:1}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-code",onClick:e[2]||(e[2]=s=>p(()=>t(j)(t(r))))},{default:a(()=>[...e[10]||(e[10]=[l(" Open in VS Code ",-1)])]),_:1}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-square-code",onClick:e[3]||(e[3]=s=>p(()=>t(k)(t(r))))},{default:a(()=>[...e[11]||(e[11]=[l(" JetBrains (URL) ",-1)])]),_:1}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-server",onClick:e[4]||(e[4]=s=>p(()=>t(m)(t(r))))},{default:a(()=>[...e[12]||(e[12]=[l(" JetBrains (local server) ",-1)])]),_:1}),n(V,{class:"my-1"}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-clipboard",onClick:e[5]||(e[5]=s=>p(()=>t(g)(t(f),{toast:"Path copied"})))},{default:a(()=>[...e[13]||(e[13]=[l(" Copy path ",-1)])]),_:1}),t(O)?(v(),U(d,{key:0,block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-clipboard-check",onClick:e[6]||(e[6]=s=>p(()=>t(g)(t(O),{toast:"Absolute path copied"})))},{default:a(()=>[...e[14]||(e[14]=[l(" Copy absolute path ",-1)])]),_:1})):F("",!0),n(V,{class:"my-1"}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-settings",onClick:e[7]||(e[7]=s=>p(()=>t(b)({projectKey:t(r).projectKey?String(t(r).projectKey):null,projectName:t(r).projectName})))},{default:a(()=>[...e[15]||(e[15]=[l(" Configure… ",-1)])]),_:1})])]),default:a(()=>[x("button",Z,[n(z,{name:"i-lucide-chevron-down",class:"size-3.5"})])]),_:1},8,["open"])):(v(),h("button",{key:0,type:"button",class:"shrink-0 inline-flex items-center rounded p-0.5 text-muted cursor-pointer transition-opacity hover:bg-elevated/60 hover:text-default opacity-100 sm:opacity-0 sm:group-hover/ide:opacity-100 focus-visible:opacity-100","aria-label":"Choose how to open in IDE",title:"Choose how to open",onClick:D},[n(z,{name:"i-lucide-chevron-down",class:"size-3.5"})]))],64)):(v(),h("span",{key:1,class:B([i.mono?"font-mono":"","truncate"])},[K($.$slots,"default",{},()=>[l(L(t(I)),1)])],2))])}}}),ae=Object.assign(te,{__name:"OpenInIdeLink"});export{ae as _};
1
+ import{d as S,o as v,c as h,k as t,F as J,i as x,q as B,V as K,m as l,t as L,j as n,p as A,f as U,g as a,_ as q,v as F,l as M,h as y,r as _,K as R,J as T}from"./Du2W7Jne.js";import{_ as H}from"./Dy-TJ0Mt.js";import{a as G}from"./BicAJ6U8.js";import{u as Q}from"./DSqHUrvO.js";function W(i){let o=i,u=null,j=null;const k=i.lastIndexOf(":");if(k>0){const m=i.slice(k+1);if(/^\d+$/.test(m)){const c=i.slice(0,k),b=c.lastIndexOf(":");if(b>0){const g=c.slice(b+1);/^\d+$/.test(g)?(j=parseInt(m,10),u=parseInt(g,10),o=c.slice(0,b)):(u=parseInt(m,10),o=c)}else u=parseInt(m,10),o=c}}return{filePath:o,line:u,column:j}}const X={class:"group/ide inline-flex items-center gap-1 min-w-0 max-w-full align-middle"},Y=["title","aria-label"],Z={type:"button",class:"shrink-0 inline-flex items-center rounded p-0.5 text-muted cursor-pointer transition-colors hover:bg-elevated/60 hover:text-default","aria-label":"Choose how to open in IDE",title:"Choose how to open"},ee={class:"w-56 p-1 space-y-0.5"},te=S({__name:"OpenInIdeLink",props:{filePath:{},line:{default:null},column:{default:null},location:{},projectKey:{},projectName:{},mono:{type:Boolean,default:!0}},setup(i){const o=i,{openInIde:u,openInVscode:j,openViaJetbrainsUrl:k,openViaJetbrainsHttp:m,resolveAbsPath:c,openSettings:b}=G(),{copy:g}=Q(),P=y(()=>o.filePath?{filePath:o.filePath,line:o.line??null,column:o.column??null}:o.location?W(o.location):{filePath:"",line:null,column:null}),f=y(()=>P.value.filePath),w=y(()=>P.value.line),I=y(()=>w.value?`${f.value}:${w.value}`:f.value),O=y(()=>c(f.value,o.projectKey)),r=y(()=>({filePath:f.value,line:w.value,column:P.value.column,projectKey:o.projectKey??null,projectName:o.projectName??null})),C=_(!1),N=_(!1);function D(){N.value=!0,R(()=>{C.value=!0})}function p($){C.value=!1,$()}return($,e)=>{const z=A,d=q,V=H,E=T;return v(),h("span",X,[t(f)?(v(),h(J,{key:0},[x("button",{type:"button",class:"inline-flex items-center gap-1 min-w-0 max-w-full cursor-pointer text-left",title:`Open ${t(I)} in IDE`,"aria-label":`Open ${t(I)} in IDE`,onClick:e[0]||(e[0]=s=>t(u)(t(r)))},[x("span",{class:B([i.mono?"font-mono":"","truncate underline decoration-dashed decoration-1 underline-offset-2 decoration-gray-400/70 dark:decoration-gray-500/70 transition-colors group-hover/ide:decoration-current"])},[K($.$slots,"default",{},()=>[l(L(t(I)),1)])],2),n(z,{name:"i-lucide-external-link",class:"size-3 shrink-0 opacity-0 transition-opacity group-hover/ide:opacity-100"})],8,Y),t(N)?(v(),U(E,{key:1,open:t(C),"onUpdate:open":e[8]||(e[8]=s=>M(C)?C.value=s:null)},{content:a(()=>[x("div",ee,[e[16]||(e[16]=x("p",{class:"text-xs font-medium text-muted px-2 pt-1 pb-1"},"Open in IDE",-1)),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-wand-sparkles",onClick:e[1]||(e[1]=s=>p(()=>t(u)({...t(r),method:"auto"})))},{default:a(()=>[...e[9]||(e[9]=[l(" Auto (try all) ",-1)])]),_:1}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-code",onClick:e[2]||(e[2]=s=>p(()=>t(j)(t(r))))},{default:a(()=>[...e[10]||(e[10]=[l(" Open in VS Code ",-1)])]),_:1}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-square-code",onClick:e[3]||(e[3]=s=>p(()=>t(k)(t(r))))},{default:a(()=>[...e[11]||(e[11]=[l(" JetBrains (URL) ",-1)])]),_:1}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-server",onClick:e[4]||(e[4]=s=>p(()=>t(m)(t(r))))},{default:a(()=>[...e[12]||(e[12]=[l(" JetBrains (local server) ",-1)])]),_:1}),n(V,{class:"my-1"}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-clipboard",onClick:e[5]||(e[5]=s=>p(()=>t(g)(t(f),{toast:"Path copied"})))},{default:a(()=>[...e[13]||(e[13]=[l(" Copy path ",-1)])]),_:1}),t(O)?(v(),U(d,{key:0,block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-clipboard-check",onClick:e[6]||(e[6]=s=>p(()=>t(g)(t(O),{toast:"Absolute path copied"})))},{default:a(()=>[...e[14]||(e[14]=[l(" Copy absolute path ",-1)])]),_:1})):F("",!0),n(V,{class:"my-1"}),n(d,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-settings",onClick:e[7]||(e[7]=s=>p(()=>t(b)({projectKey:t(r).projectKey?String(t(r).projectKey):null,projectName:t(r).projectName})))},{default:a(()=>[...e[15]||(e[15]=[l(" Configure… ",-1)])]),_:1})])]),default:a(()=>[x("button",Z,[n(z,{name:"i-lucide-chevron-down",class:"size-3.5"})])]),_:1},8,["open"])):(v(),h("button",{key:0,type:"button",class:"shrink-0 inline-flex items-center rounded p-0.5 text-muted cursor-pointer transition-opacity hover:bg-elevated/60 hover:text-default opacity-100 sm:opacity-0 sm:group-hover/ide:opacity-100 focus-visible:opacity-100","aria-label":"Choose how to open in IDE",title:"Choose how to open",onClick:D},[n(z,{name:"i-lucide-chevron-down",class:"size-3.5"})]))],64)):(v(),h("span",{key:1,class:B([i.mono?"font-mono":"","truncate"])},[K($.$slots,"default",{},()=>[l(L(t(I)),1)])],2))])}}}),ae=Object.assign(te,{__name:"OpenInIdeLink"});export{ae as _};
@@ -1 +1 @@
1
- import{c as j,d as E,D as N,a as R,e as b,f as _,g as A,b as I}from"./B3HO8kuh.js";import{a2 as L,a3 as T,a4 as z,a5 as F,a6 as G,a7 as K,bs as U,o as a,f as l,g as r,k as e,q as c,V as d,v as i,j as h,W as k,bv as W,bG as J,bH as M,m,t as v,c as q,_ as Q,i as X,a0 as Y,a1 as Z,h as $,b4 as B,bI as ee,a8 as te}from"./NQikbhmK.js";const se={slots:{overlay:"fixed inset-0 bg-elevated/75",content:"fixed bg-default divide-y divide-default sm:ring ring-default sm:shadow-lg flex flex-col focus:outline-none",header:"flex items-center gap-1.5 p-4 sm:px-6 min-h-(--ui-header-height)",wrapper:"",body:"flex-1 overflow-y-auto p-4 sm:p-6",footer:"flex items-center gap-1.5 p-4 sm:px-6",title:"text-highlighted font-semibold",description:"mt-1 text-muted text-sm",close:"absolute top-4 end-4"},variants:{side:{top:{content:""},right:{content:"max-w-md"},bottom:{content:""},left:{content:"max-w-md"}},inset:{true:{content:"rounded-lg"}},transition:{true:{overlay:"data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]"}}},compoundVariants:[{side:"top",inset:!0,class:{content:"max-h-[calc(100%-2rem)] inset-x-4 top-4"}},{side:"top",inset:!1,class:{content:"max-h-full inset-x-0 top-0"}},{side:"right",inset:!0,class:{content:"w-[calc(100%-2rem)] inset-y-4 right-4"}},{side:"right",inset:!1,class:{content:"w-full inset-y-0 right-0"}},{side:"bottom",inset:!0,class:{content:"max-h-[calc(100%-2rem)] inset-x-4 bottom-4"}},{side:"bottom",inset:!1,class:{content:"max-h-full inset-x-0 bottom-0"}},{side:"left",inset:!0,class:{content:"w-[calc(100%-2rem)] inset-y-4 left-4"}},{side:"left",inset:!1,class:{content:"w-full inset-y-0 left-0"}},{transition:!0,side:"top",class:{content:"data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-top_200ms_ease-in-out]"}},{transition:!0,side:"right",class:{content:"data-[state=open]:animate-[slide-in-from-right_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-right_200ms_ease-in-out]"}},{transition:!0,side:"bottom",class:{content:"data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-bottom_200ms_ease-in-out]"}},{transition:!0,side:"left",class:{content:"data-[state=open]:animate-[slide-in-from-left_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-left_200ms_ease-in-out]"}}]},le={__name:"USlideover",props:{title:{type:String,required:!1},description:{type:String,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},transition:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1,default:"right"},inset:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1}},emits:["leave","after:leave","enter","after:enter","close:prevent","update:open"],setup(D,{emit:O}){const P=D,f=O,s=L(),t=T("slideover",P),{t:C}=z(),w=F(),S=G(K(t,"open","defaultOpen","modal","unmountOnHide"),f),x=U(B(()=>t.portal)),V=B(()=>t.content),H=$(()=>t.dismissible?{pointerDownOutside:ee}:["interactOutside","escapeKeyDown"].reduce((n,y)=>(n[y]=p=>{p.preventDefault(),f("close:prevent")},n),{})),u=$(()=>te({extend:se,...w.ui?.slideover||{}})({transition:t.transition,side:t.side,inset:t.inset}));return(o,n)=>(a(),l(e(I),Y(Z(e(S))),{default:r(({open:y,close:p})=>[s.default?(a(),l(e(j),{key:0,"as-child":"",class:c(e(t).class)},{default:r(()=>[d(o.$slots,"default",{open:y})]),_:2},1032,["class"])):i("",!0),h(e(E),k(e(x),{"force-mount":e(x).disabled&&e(t).unmountOnHide===!1||void 0}),{default:r(()=>[h(e(W),null,{default:r(()=>[e(t).overlay?(a(),l(e(N),{key:0,"data-slot":"overlay",class:c(u.value.overlay({class:e(t).ui?.overlay}))},null,8,["class"])):i("",!0),h(e(R),k({"data-side":e(t).side,"data-slot":"content",class:u.value.content({class:[!s.default&&e(t).class,e(t).ui?.content]})},V.value,{onEnter:n[0]||(n[0]=g=>f("enter")),onAfterEnter:n[1]||(n[1]=g=>f("after:enter")),onLeave:n[2]||(n[2]=g=>f("leave")),onAfterLeave:n[3]||(n[3]=g=>f("after:leave"))},J(H.value)),{default:r(()=>[!e(t).title&&!s.title||!e(t).description&&!s.description||s.content?(a(),l(e(M),{key:0},{default:r(()=>[!e(t).title&&!s.title?(a(),l(e(b),{key:0})):s.content?(a(),l(e(b),{key:1},{default:r(()=>[d(o.$slots,"title",{},()=>[m(v(e(t).title),1)])]),_:3})):i("",!0),!e(t).description&&!s.description?(a(),l(e(_),{key:2})):s.content?(a(),l(e(_),{key:3},{default:r(()=>[d(o.$slots,"description",{},()=>[m(v(e(t).description),1)])]),_:3})):i("",!0)]),_:3})):i("",!0),d(o.$slots,"content",{close:p},()=>[s.header||e(t).title||s.title||e(t).description||s.description||e(t).close||s.close?(a(),q("div",{key:0,"data-slot":"header",class:c(u.value.header({class:e(t).ui?.header}))},[d(o.$slots,"header",{close:p},()=>[e(t).title||s.title||e(t).description||s.description?(a(),q("div",{key:0,"data-slot":"wrapper",class:c(u.value.wrapper({class:e(t).ui?.wrapper}))},[e(t).title||s.title?(a(),l(e(b),{key:0,"data-slot":"title",class:c(u.value.title({class:e(t).ui?.title}))},{default:r(()=>[d(o.$slots,"title",{},()=>[m(v(e(t).title),1)])]),_:3},8,["class"])):i("",!0),e(t).description||s.description?(a(),l(e(_),{key:1,"data-slot":"description",class:c(u.value.description({class:e(t).ui?.description}))},{default:r(()=>[d(o.$slots,"description",{},()=>[m(v(e(t).description),1)])]),_:3},8,["class"])):i("",!0)],2)):i("",!0),d(o.$slots,"actions"),e(t).close||s.close?(a(),l(e(A),{key:1,"as-child":""},{default:r(()=>[d(o.$slots,"close",{ui:u.value},()=>[e(t).close?(a(),l(Q,k({key:0,icon:e(t).closeIcon||e(w).ui.icons.close,color:"neutral",variant:"ghost","aria-label":e(C)("slideover.close")},typeof e(t).close=="object"?e(t).close:{},{"data-slot":"close",class:u.value.close({class:e(t).ui?.close})}),null,16,["icon","aria-label","class"])):i("",!0)])]),_:2},1024)):i("",!0)])],2)):i("",!0),X("div",{"data-slot":"body",class:c(u.value.body({class:e(t).ui?.body}))},[d(o.$slots,"body",{close:p})],2),s.footer?(a(),q("div",{key:1,"data-slot":"footer",class:c(u.value.footer({class:e(t).ui?.footer}))},[d(o.$slots,"footer",{close:p})],2)):i("",!0)])]),_:2},1040,["data-side","class"])]),_:2},1024)]),_:2},1040,["force-mount"])]),_:3},16))}};export{le as _};
1
+ import{c as H,d as E,D as N,a as R,e as b,f as _,g as A,b as L}from"./BUkim3TM.js";import{a2 as T,a3 as z,a4 as F,a5 as I,a6 as G,a7 as K,bi as U,o as a,f as l,g as r,k as e,q as c,V as d,v as i,j as h,W as k,bj as W,bk as J,bl as M,m,t as v,c as q,_ as Q,i as X,a0 as Y,a1 as Z,h as $,b5 as B,bm as ee,a8 as te}from"./Du2W7Jne.js";const se={slots:{overlay:"fixed inset-0 bg-elevated/75",content:"fixed bg-default divide-y divide-default sm:ring ring-default sm:shadow-lg flex flex-col focus:outline-none",header:"flex items-center gap-1.5 p-4 sm:px-6 min-h-(--ui-header-height)",wrapper:"",body:"flex-1 overflow-y-auto p-4 sm:p-6",footer:"flex items-center gap-1.5 p-4 sm:px-6",title:"text-highlighted font-semibold",description:"mt-1 text-muted text-sm",close:"absolute top-4 end-4"},variants:{side:{top:{content:""},right:{content:"max-w-md"},bottom:{content:""},left:{content:"max-w-md"}},inset:{true:{content:"rounded-lg"}},transition:{true:{overlay:"data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]"}}},compoundVariants:[{side:"top",inset:!0,class:{content:"max-h-[calc(100%-2rem)] inset-x-4 top-4"}},{side:"top",inset:!1,class:{content:"max-h-full inset-x-0 top-0"}},{side:"right",inset:!0,class:{content:"w-[calc(100%-2rem)] inset-y-4 right-4"}},{side:"right",inset:!1,class:{content:"w-full inset-y-0 right-0"}},{side:"bottom",inset:!0,class:{content:"max-h-[calc(100%-2rem)] inset-x-4 bottom-4"}},{side:"bottom",inset:!1,class:{content:"max-h-full inset-x-0 bottom-0"}},{side:"left",inset:!0,class:{content:"w-[calc(100%-2rem)] inset-y-4 left-4"}},{side:"left",inset:!1,class:{content:"w-full inset-y-0 left-0"}},{transition:!0,side:"top",class:{content:"data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-top_200ms_ease-in-out]"}},{transition:!0,side:"right",class:{content:"data-[state=open]:animate-[slide-in-from-right_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-right_200ms_ease-in-out]"}},{transition:!0,side:"bottom",class:{content:"data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-bottom_200ms_ease-in-out]"}},{transition:!0,side:"left",class:{content:"data-[state=open]:animate-[slide-in-from-left_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-left_200ms_ease-in-out]"}}]},le={__name:"USlideover",props:{title:{type:String,required:!1},description:{type:String,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},transition:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1,default:"right"},inset:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1}},emits:["leave","after:leave","enter","after:enter","close:prevent","update:open"],setup(D,{emit:O}){const P=D,f=O,s=T(),t=z("slideover",P),{t:C}=F(),w=I(),S=G(K(t,"open","defaultOpen","modal","unmountOnHide"),f),x=U(B(()=>t.portal)),V=B(()=>t.content),j=$(()=>t.dismissible?{pointerDownOutside:ee}:["interactOutside","escapeKeyDown"].reduce((n,y)=>(n[y]=p=>{p.preventDefault(),f("close:prevent")},n),{})),u=$(()=>te({extend:se,...w.ui?.slideover||{}})({transition:t.transition,side:t.side,inset:t.inset}));return(o,n)=>(a(),l(e(L),Y(Z(e(S))),{default:r(({open:y,close:p})=>[s.default?(a(),l(e(H),{key:0,"as-child":"",class:c(e(t).class)},{default:r(()=>[d(o.$slots,"default",{open:y})]),_:2},1032,["class"])):i("",!0),h(e(E),k(e(x),{"force-mount":e(x).disabled&&e(t).unmountOnHide===!1||void 0}),{default:r(()=>[h(e(W),null,{default:r(()=>[e(t).overlay?(a(),l(e(N),{key:0,"data-slot":"overlay",class:c(u.value.overlay({class:e(t).ui?.overlay}))},null,8,["class"])):i("",!0),h(e(R),k({"data-side":e(t).side,"data-slot":"content",class:u.value.content({class:[!s.default&&e(t).class,e(t).ui?.content]})},V.value,{onEnter:n[0]||(n[0]=g=>f("enter")),onAfterEnter:n[1]||(n[1]=g=>f("after:enter")),onLeave:n[2]||(n[2]=g=>f("leave")),onAfterLeave:n[3]||(n[3]=g=>f("after:leave"))},J(j.value)),{default:r(()=>[!e(t).title&&!s.title||!e(t).description&&!s.description||s.content?(a(),l(e(M),{key:0},{default:r(()=>[!e(t).title&&!s.title?(a(),l(e(b),{key:0})):s.content?(a(),l(e(b),{key:1},{default:r(()=>[d(o.$slots,"title",{},()=>[m(v(e(t).title),1)])]),_:3})):i("",!0),!e(t).description&&!s.description?(a(),l(e(_),{key:2})):s.content?(a(),l(e(_),{key:3},{default:r(()=>[d(o.$slots,"description",{},()=>[m(v(e(t).description),1)])]),_:3})):i("",!0)]),_:3})):i("",!0),d(o.$slots,"content",{close:p},()=>[s.header||e(t).title||s.title||e(t).description||s.description||e(t).close||s.close?(a(),q("div",{key:0,"data-slot":"header",class:c(u.value.header({class:e(t).ui?.header}))},[d(o.$slots,"header",{close:p},()=>[e(t).title||s.title||e(t).description||s.description?(a(),q("div",{key:0,"data-slot":"wrapper",class:c(u.value.wrapper({class:e(t).ui?.wrapper}))},[e(t).title||s.title?(a(),l(e(b),{key:0,"data-slot":"title",class:c(u.value.title({class:e(t).ui?.title}))},{default:r(()=>[d(o.$slots,"title",{},()=>[m(v(e(t).title),1)])]),_:3},8,["class"])):i("",!0),e(t).description||s.description?(a(),l(e(_),{key:1,"data-slot":"description",class:c(u.value.description({class:e(t).ui?.description}))},{default:r(()=>[d(o.$slots,"description",{},()=>[m(v(e(t).description),1)])]),_:3},8,["class"])):i("",!0)],2)):i("",!0),d(o.$slots,"actions"),e(t).close||s.close?(a(),l(e(A),{key:1,"as-child":""},{default:r(()=>[d(o.$slots,"close",{ui:u.value},()=>[e(t).close?(a(),l(Q,k({key:0,icon:e(t).closeIcon||e(w).ui.icons.close,color:"neutral",variant:"ghost","aria-label":e(C)("slideover.close")},typeof e(t).close=="object"?e(t).close:{},{"data-slot":"close",class:u.value.close({class:e(t).ui?.close})}),null,16,["icon","aria-label","class"])):i("",!0)])]),_:2},1024)):i("",!0)])],2)):i("",!0),X("div",{"data-slot":"body",class:c(u.value.body({class:e(t).ui?.body}))},[d(o.$slots,"body",{close:p})],2),s.footer?(a(),q("div",{key:1,"data-slot":"footer",class:c(u.value.footer({class:e(t).ui?.footer}))},[d(o.$slots,"footer",{close:p})],2)):i("",!0)])]),_:2},1040,["data-side","class"])]),_:2},1024)]),_:2},1040,["force-mount"])]),_:3},16))}};export{le as _};
@@ -1 +1 @@
1
- import{_ as pe}from"./279D2RYp.js";import{_ as me}from"./BqV0l12c.js";import{_ as he,a as fe}from"./CHEFCN8Q.js";import{_ as ye}from"./rWNTSFD6.js";import{_ as Y}from"./D0HNloZ9.js";import{_ as ge}from"./DprVVyUQ.js";import{d as G,o as v,c as C,i as b,t as I,k as e,j as E,g as S,p as J,q,m as R,s as ve,f as A,v as z,x as _e,F as W,y as Q,h as U,_ as Z,z as be,A as ee,r as F,u as xe,w as we,e as ke,B as $e,C as H}from"./NQikbhmK.js";import{_ as Te}from"./DLSrtpsA.js";import{f as V}from"./D-c8ZSws.js";import{u as Ce}from"./CpjgB2aY.js";import"./YVN7WG7q.js";import"./CDk0q2hV.js";import"./Bn0YQDyy.js";import"./C7P1UCO2.js";import"./BjaRappk.js";import"./eptP4pGv.js";const Ie={class:"p-3 sm:p-4 space-y-2"},ze={class:"flex items-start justify-between gap-3"},Be={class:"min-w-0 space-y-1"},Ee={class:"font-medium text-sm break-all"},Ue={class:"text-xs text-gray-500"},Re={class:"flex items-center gap-2 shrink-0"},Ae={key:2,class:"text-xs"},je={key:0,class:"text-xs text-gray-500"},Pe={class:"text-default"},Le={key:1,class:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-500"},Se={key:0},De={key:1},Fe={key:2},Ne={key:3},Me={key:3,class:"text-xs text-gray-500"},Ve={class:"space-y-0.5"},Oe={class:"text-[11px]"},He=G({__name:"ImportFileRow",props:{entry:{},removable:{type:Boolean}},emits:["remove"],setup(p){const c=p,a={hashing:{label:"Reading",color:"neutral",icon:"i-lucide-loader-circle"},checking:{label:"Checking",color:"neutral",icon:"i-lucide-loader-circle"},ready:{label:"Ready",color:"primary",icon:"i-lucide-circle-check"},uploading:{label:"Importing",color:"primary",icon:"i-lucide-loader-circle"},imported:{label:"Imported",color:"success",icon:"i-lucide-check"},duplicate:{label:"Already imported",color:"neutral",icon:"i-lucide-copy-check"},"too-large":{label:"Too large",color:"warning",icon:"i-lucide-weight"},invalid:{label:"Not importable",color:"warning",icon:"i-lucide-file-x"},failed:{label:"Failed",color:"error",icon:"i-lucide-circle-alert"}},d=U(()=>a[c.entry.state]),m=U(()=>["hashing","checking","uploading"].includes(c.entry.state)),o=U(()=>c.entry.result),t=U(()=>c.entry.state==="imported"?o.value:null),h=U(()=>t.value?.kind==="trace");function n(l,i){return`${l} ${i}${l===1?"":"s"}`}return(l,i)=>{const f=J,y=ve,k=Z,$=be,x=_e,T=Y;return v(),C("div",Ie,[b("div",ze,[b("div",Be,[b("p",Ee,I(p.entry.name),1),b("p",Ue,I(("formatBytes"in l?l.formatBytes:e(V))(p.entry.size)),1)]),b("div",Re,[E(y,{color:e(d).color,variant:"subtle",size:"sm"},{default:S(()=>[E(f,{name:e(d).icon,class:q(["size-3.5 mr-1",e(m)&&"animate-spin"])},null,8,["name","class"]),R(" "+I(e(d).label),1)]),_:1},8,["color"]),p.removable?(v(),A(k,{key:0,icon:"i-lucide-x",color:"neutral",variant:"ghost",size:"xs",title:"Remove from the list",onClick:i[0]||(i[0]=s=>l.$emit("remove",p.entry.id))})):z("",!0)])]),p.entry.state==="uploading"||p.entry.state==="hashing"?(v(),A($,{key:0,"model-value":Math.round(p.entry.progress*100),size:"sm"},null,8,["model-value"])):z("",!0),p.entry.message?(v(),C("p",{key:1,class:q(["text-xs",p.entry.state==="failed"?"text-error":"text-gray-500"])},I(p.entry.message),3)):z("",!0),e(o)?.testRunId?(v(),C("div",Ae,[E(x,{to:`/test-runs/${e(o).testRunId}`,class:"text-primary hover:underline"},{default:S(()=>[R(" View run #"+I(e(o).testRunId),1)]),_:1},8,["to"])])):z("",!0),e(t)?(v(),C(W,{key:3},[e(h)?(v(),C("p",je,[i[1]||(i[1]=R(" Added ",-1)),b("span",Pe,I(e(t).caseTitle),1),i[2]||(i[2]=R(" to this run. ",-1))])):(v(),C("div",Le,[b("span",null,I(n(e(t).totalTests,"execution")),1),b("span",null,I(e(t).passedTests)+" passed",1),b("span",null,I(e(t).failedTests)+" failed",1),e(t).skippedTests?(v(),C("span",Se,I(e(t).skippedTests)+" skipped",1)):z("",!0),e(t).flakyTests?(v(),C("span",De,I(e(t).flakyTests)+" flaky",1)):z("",!0),e(t).traceCount?(v(),C("span",Fe,I(n(e(t).traceCount,"trace")),1)):z("",!0),e(t).attachmentCount?(v(),C("span",Ne,I(n(e(t).attachmentCount,"attachment")),1)):z("",!0)])),e(t).shard?(v(),A(T,{key:2,color:"warning",variant:"subtle",icon:"i-lucide-split",description:`This archive is shard ${e(t).shard.current} of ${e(t).shard.total}. Each shard imports as its own run — they are not merged.`,ui:{description:"text-xs"}},null,8,["description"])):z("",!0),e(t).filePaths.length&&!e(h)?(v(),C("div",Me,[i[3]||(i[3]=b("p",{class:"mb-1"},[R(" Spec files recorded as "),b("span",{class:"text-gray-400"},"(these must match the paths your live runs report for history to line up)"),R(": ")],-1)),b("ul",Ve,[(v(!0),C(W,null,Q(e(t).filePaths,s=>(v(),C("li",{key:s},[b("code",Oe,I(s),1)]))),128))])])):z("",!0)],64)):z("",!0)])}}}),qe=Object.assign(He,{__name:"ImportFileRow"}),L=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),We=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ke=Array.from({length:256},(p,c)=>c.toString(16).padStart(2,"0"));class te{#r=new Uint32Array(We);#t=new Uint8Array(64);#e=0;#n=0;#i=new Uint32Array(64);#o=!1;update(c){if(this.#o)throw new Error("Sha256: update() after digest()");this.#n+=c.length;let a=0;if(this.#e>0){const d=Math.min(64-this.#e,c.length);if(this.#t.set(c.subarray(0,d),this.#e),this.#e+=d,a=d,this.#e<64)return this;this.#s(this.#t,0),this.#e=0}for(;a+64<=c.length;a+=64)this.#s(c,a);return a<c.length&&(this.#t.set(c.subarray(a),0),this.#e=c.length-a),this}digest(){if(this.#o)throw new Error("Sha256: digest() called twice");this.#o=!0;const c=this.#n*8;this.#t[this.#e++]=128,this.#e>56&&(this.#t.fill(0,this.#e),this.#s(this.#t,0),this.#e=0),this.#t.fill(0,this.#e,56);const a=new DataView(this.#t.buffer,this.#t.byteOffset,64);a.setUint32(56,Math.floor(c/4294967296),!1),a.setUint32(60,c>>>0,!1),this.#s(this.#t,0);const d=new Uint8Array(32),m=new DataView(d.buffer);for(let o=0;o<8;o++)m.setUint32(o*4,this.#r[o],!1);return d}hex(){const c=this.digest();let a="";for(let d=0;d<32;d++)a+=Ke[c[d]];return a}#s(c,a){const d=this.#i,m=this.#r;for(let r=0;r<16;r++){const _=a+r*4;d[r]=c[_]<<24|c[_+1]<<16|c[_+2]<<8|c[_+3]}for(let r=16;r<64;r++){const _=d[r-15],B=d[r-2],g=(_>>>7|_<<25)^(_>>>18|_<<14)^_>>>3,D=(B>>>17|B<<15)^(B>>>19|B<<13)^B>>>10;d[r]=d[r-16]+g+d[r-7]+D|0}let o=m[0],t=m[1],h=m[2],n=m[3],l=m[4],i=m[5],f=m[6],y=m[7],k=0,$=0,x=0,T=0,s=0,u=0;for(let r=0;r<64;r+=8)$=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),x=l&i^~l&f,s=y+$+x+L[r]+d[r]|0,k=(o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10),T=o&t^o&h^t&h,u=k+T|0,n=n+s|0,y=s+u|0,$=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),x=n&l^~n&i,s=f+$+x+L[r+1]+d[r+1]|0,k=(y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10),T=y&o^y&t^o&t,u=k+T|0,h=h+s|0,f=s+u|0,$=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),x=h&n^~h&l,s=i+$+x+L[r+2]+d[r+2]|0,k=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),T=f&y^f&o^y&o,u=k+T|0,t=t+s|0,i=s+u|0,$=(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7),x=t&h^~t&n,s=l+$+x+L[r+3]+d[r+3]|0,k=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),T=i&f^i&y^f&y,u=k+T|0,o=o+s|0,l=s+u|0,$=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),x=o&t^~o&h,s=n+$+x+L[r+4]+d[r+4]|0,k=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),T=l&i^l&f^i&f,u=k+T|0,y=y+s|0,n=s+u|0,$=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),x=y&o^~y&t,s=h+$+x+L[r+5]+d[r+5]|0,k=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),T=n&l^n&i^l&i,u=k+T|0,f=f+s|0,h=s+u|0,$=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7),x=f&y^~f&o,s=t+$+x+L[r+6]+d[r+6]|0,k=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),T=h&n^h&l^n&l,u=k+T|0,i=i+s|0,t=s+u|0,$=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),x=i&f^~i&y,s=o+$+x+L[r+7]+d[r+7]|0,k=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),T=t&h^t&n^h&n,u=k+T|0,l=l+s|0,o=s+u|0;m[0]=m[0]+o|0,m[1]=m[1]+t|0,m[2]=m[2]+h|0,m[3]=m[3]+n|0,m[4]=m[4]+l|0,m[5]=m[5]+i|0,m[6]=m[6]+f|0,m[7]=m[7]+y|0}}async function Xe(p,c){const a=new te,d=p.stream().getReader();let m=0;for(;;){const{done:o,value:t}=await d.read();if(o)break;a.update(t),m+=t.length,c&&c(p.size?m/p.size:1)}return c&&c(1),a.hex()}const X=["ready","failed"],Ye={ok:"ready",duplicate:"duplicate","too-large":"too-large",invalid:"invalid"};function Ge(p){const c=Je("/api/test-runs/import"),a=F([]),d=F(null),m=F(null),o=F(!1);let t=1;const h=U(()=>a.value.filter(s=>X.includes(s.state)).length),n=U(()=>a.value.filter(s=>s.state==="imported").length),l=U(()=>a.value.some(s=>s.state==="hashing"||s.state==="checking")),i=F({done:0,total:0});async function f(){if(p.value)try{const s=await $fetch("/api/test-runs/import/check",{method:"POST",body:{projectName:p.value,files:[]}});d.value=s.maxBytes,m.value=null}catch(s){m.value=M(s,"Could not reach the server to read its upload limit.")}}async function y(s){const u=s.map(g=>({id:t++,file:g,name:g.name,size:g.size,state:"hashing",progress:0}));a.value=[...a.value,...u];const r=a.value.slice(-u.length),_=[];for(const g of r)d.value!=null&&g.size>d.value?(g.state="too-large",g.message=`${V(g.size)} exceeds the ${V(d.value)} limit.`):g.size===0?(g.state="invalid",g.message="The file is empty."):g.name.toLowerCase().endsWith(".zip")?_.push(g):(g.state="invalid",g.message="Expected a .zip blob report (blob-report/report-*.zip).");if(_.length===0)return;for(const g of _)try{g.progress=0,g.hash=await Xe(g.file,D=>{g.progress=D}),g.state="checking"}catch(D){g.state="failed",g.message=M(D,"Could not read the file.")}finally{g.progress=0}const B=await Qe(_);for(const g of _)g.group=B??void 0;await k(_.filter(g=>g.state==="checking"))}async function k(s){if(!(s.length===0||!p.value))try{const u=await $fetch("/api/test-runs/import/check",{method:"POST",body:{projectName:p.value,files:s.map(r=>({name:r.name,size:r.size,hash:r.hash}))}});d.value=u.maxBytes,u.results.forEach((r,_)=>{const B=s[_];B&&(B.state=Ye[r.status]??"ready",B.message=r.message,r.testRunId&&(B.result={testRunId:r.testRunId}))})}catch(u){const r=M(u,"Pre-flight check failed.");for(const _ of s)_.state="ready",_.message=`${r} Importing will still verify it.`}}async function $(){if(o.value||!p.value)return;o.value=!0;const s=a.value.filter(u=>X.includes(u.state));i.value={done:0,total:s.length};try{for(const u of s){u.state="uploading",u.message=void 0,u.progress=0;try{const r=await Ze(c,p.value,u,u.group??null,_=>{u.progress=_});u.result=r,u.state=r.status==="duplicate"?"duplicate":"imported",u.message=r.status==="duplicate"?"Already imported into this project.":void 0}catch(r){u.state="failed",u.message=M(r,"The import failed.")}finally{u.progress=0,i.value={...i.value,done:i.value.done+1}}}}finally{o.value=!1}}function x(s){a.value=a.value.filter(u=>u.id!==s)}function T(){a.value=a.value.filter(s=>!["imported","duplicate"].includes(s.state))}return{entries:a,maxBytes:d,limitError:m,importing:o,readyCount:h,importedCount:n,busy:l,batch:i,loadLimit:f,addFiles:y,startImport:$,remove:x,clearFinished:T}}function Je(p){return`${(ee().app.baseURL||"/").replace(/\/$/,"")}${p}`}async function Qe(p){const c=p.map(a=>a.hash).filter(a=>!!a);return c.length===0?null:new te().update(new TextEncoder().encode([...c].sort().join(""))).hex()}function Ze(p,c,a,d,m){return new Promise((o,t)=>{const h=new FormData;h.append("projectName",c),d&&h.append("importGroup",d),h.append("archive",a.file,a.name);const n=new XMLHttpRequest;n.open("POST",p),n.responseType="json",n.upload.addEventListener("progress",l=>{l.lengthComputable&&m(l.loaded/l.total)}),n.addEventListener("load",()=>{const l=n.response;if(n.status>=200&&n.status<300){o(l);return}const i=typeof l?.message=="string"?l.message:null;t(new Error(i??et(n.status)))}),n.addEventListener("error",()=>t(new Error("The connection dropped during the upload."))),n.addEventListener("abort",()=>t(new Error("The upload was cancelled."))),n.addEventListener("timeout",()=>t(new Error("The upload timed out."))),n.send(h)})}function et(p){return p===413?"The server (or a proxy in front of it) rejected the archive as too large.":p===401||p===403?"You do not have permission to import into this project.":p===0?"The connection dropped during the upload.":p>=500?`The server failed while importing (HTTP ${p}).`:`The import was rejected (HTTP ${p}).`}function M(p,c){const a=p?.data;return typeof a?.message=="string"&&a.message?a.message:p?.message||c}const tt={class:"p-4 space-y-4"},st={class:"space-y-4"},ot={class:"text-sm text-gray-600 dark:text-gray-400 space-y-2"},rt={class:"flex items-center gap-2"},nt={key:0,class:"text-xs text-gray-500 tabular-nums"},it={class:"space-y-4"},at={key:0,class:"text-xs text-gray-500 mt-3"},lt={key:1,class:"divide-y divide-gray-100 dark:divide-gray-800 border rounded-lg border-gray-200 dark:border-gray-800"},ct={key:2,class:"flex justify-end"},Ct=G({__name:"import",async setup(p){let c,a;const m=xe().params.id,{data:o}=([c,a]=we(()=>Ce(`/api/projects/${m}`,"$w9ISz8uFNz")),c=await c,a(),c);ke(U(()=>({title:`Import runs — ${o.value?.label||o.value?.name||"Project"} — Piwi Dashboard`})));const t=ee().public.demoMode,h=U(()=>o.value?.name),{entries:n,maxBytes:l,limitError:i,importing:f,readyCount:y,importedCount:k,busy:$,batch:x,loadLimit:T,addFiles:s,startImport:u,remove:r,clearFinished:_}=Ge(h);$e(T);const B=F(null),g=F(!1);function D(j){const w=j.target;w.files?.length&&s([...w.files]),w.value=""}function se(j){g.value=!1;const w=[...j.dataTransfer?.files??[]];w.length&&s(w)}const oe=U(()=>n.value.filter(j=>["imported","duplicate"].includes(j.state)).length);return(j,w)=>{const re=pe,ne=me,ie=fe,ae=ye,O=Y,K=ge,N=Z,le=J,ce=Te,de=qe,ue=he;return v(),A(ue,{id:"project-import"},{header:S(()=>[E(ie,null,{leading:S(()=>[E(re),E(ne,{items:[{label:"Home",icon:"i-lucide-house",to:"/"},{label:"Projects",to:"/projects"},{label:e(o)?.label||e(o)?.name||"Project",to:`/projects/${e(m)}`},{label:"Import runs"}]},null,8,["items"])]),_:1})]),body:S(()=>[b("div",tt,[E(K,{title:"Import past runs",icon:"i-lucide-import",help:"project.import",subtitle:"Backfill runs recorded before you started using Piwi, from Playwright's own blob reports."},{default:S(()=>[b("div",st,[b("div",ot,[w[5]||(w[5]=b("p",null,[R(" Run your suite with the blob reporter and upload the archives it writes to "),b("code",null,"blob-report/"),R(": ")],-1)),E(ae,{code:"npx playwright test --reporter=blob",language:"bash"}),w[6]||(w[6]=b("p",null," Each archive imports as one completed run, with its traces, screenshots and videos. Importing the same archive twice does nothing, so an interrupted batch is safe to repeat. ",-1))]),e(t)?(v(),A(O,{key:0,color:"primary",variant:"subtle",icon:"i-lucide-monitor-smartphone",title:"Nothing leaves your browser",description:"This is the demo: the archive is read by a service worker and stored in your browser, not uploaded. It is cleared when the demo's sample data is refreshed, or when you reset the demo.",ui:{description:"text-xs"}})):z("",!0),E(O,{color:"neutral",variant:"subtle",icon:"i-lucide-info",title:"What imported runs carry",description:"Failures still cluster, and traces, screenshots and videos open exactly as they do for reported runs. Web vitals, page state and locator healing come from Piwi's own capture fixtures, so historical runs have none — they start once the reporter is in place.",ui:{description:"text-xs"}}),e(i)?(v(),A(O,{key:1,color:"error",variant:"subtle",icon:"i-lucide-circle-alert",description:e(i)},null,8,["description"])):z("",!0)])]),_:1}),E(K,{title:"Archives",icon:"i-lucide-files",count:e(n).length||null},{actions:S(()=>[b("div",rt,[e(f)?(v(),C("span",nt,I(e(x).done)+" of "+I(e(x).total)+" done ",1)):z("",!0),e(oe)>0&&!e(f)?(v(),A(N,{key:1,label:"Clear finished",icon:"i-lucide-eraser",color:"neutral",variant:"ghost",size:"sm",disabled:e(f),onClick:w[0]||(w[0]=P=>e(_)())},null,8,["disabled"])):z("",!0),E(N,{label:e(y)>0?`Import ${e(y)} archive${e(y)===1?"":"s"}`:"Import",icon:"i-lucide-upload",size:"sm",loading:e(f),disabled:e(y)===0||e($),onClick:w[1]||(w[1]=P=>e(u)())},null,8,["label","loading","disabled"])])]),default:S(()=>[b("div",it,[b("div",{class:q(["rounded-lg border-2 border-dashed p-6 text-center transition-colors",e(g)?"border-primary bg-primary/5":"border-gray-200 dark:border-gray-700"]),onDragover:w[3]||(w[3]=H(P=>g.value=!0,["prevent"])),onDragleave:w[4]||(w[4]=H(P=>g.value=!1,["prevent"])),onDrop:H(se,["prevent"])},[E(le,{name:"i-lucide-file-archive",class:"size-7 text-gray-400 mb-2"}),w[7]||(w[7]=b("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[R("Drop "),b("code",null,"report-*.zip"),R(" files here, or")],-1)),E(N,{label:"Choose files",icon:"i-lucide-folder-open",variant:"outline",size:"sm",class:"mt-2",disabled:e(f),onClick:w[2]||(w[2]=P=>e(B)?.click())},null,8,["disabled"]),e(l)?(v(),C("p",at," Up to "+I(("formatBytes"in j?j.formatBytes:e(V))(e(l)))+" per archive. Larger ones are rejected here, before uploading. ",1)):z("",!0),b("input",{ref_key:"fileInput",ref:B,type:"file",accept:".zip",multiple:"",class:"hidden",onChange:D},null,544)],34),e(n).length===0?(v(),A(ce,{key:0,icon:"i-lucide-inbox",text:"No archives selected yet."})):(v(),C("div",lt,[(v(!0),C(W,null,Q(e(n),P=>(v(),A(de,{key:P.id,entry:P,removable:!e(f)&&P.state!=="uploading",onRemove:e(r)},null,8,["entry","removable","onRemove"]))),128))])),e(k)>0?(v(),C("div",ct,[E(N,{label:`Open ${e(o)?.label||e(o)?.name||"project"}`,icon:"i-lucide-arrow-right",trailing:"",variant:"ghost",size:"sm",to:`/projects/${e(m)}`},null,8,["label","to"])])):z("",!0)])]),_:1},8,["count"])])]),_:1})}}});export{Ct as default};
1
+ import{_ as pe}from"./CXEH9OPk.js";import{_ as me}from"./DabzhQB1.js";import{_ as he,a as fe}from"./5A6ITZXj.js";import{_ as ye}from"./B3obW6cw.js";import{_ as Y}from"./BrQEE053.js";import{_ as ge}from"./C0_yH0N7.js";import{d as G,o as v,c as C,i as b,t as I,k as e,j as E,g as S,p as J,q,m as R,s as ve,f as A,v as z,x as _e,F as W,y as Q,h as U,_ as Z,z as be,A as ee,r as F,u as xe,w as we,e as ke,B as $e,C as H}from"./Du2W7Jne.js";import{_ as Te}from"./C1gTN4Q8.js";import{f as V}from"./D-c8ZSws.js";import{u as Ce}from"./B8zkOmwo.js";import"./KyA_4Ks-.js";import"./DuwtTfO8.js";import"./DSqHUrvO.js";import"./Bm62iDV5.js";import"./BjaRappk.js";import"./-f7BAm1H.js";const Ie={class:"p-3 sm:p-4 space-y-2"},ze={class:"flex items-start justify-between gap-3"},Be={class:"min-w-0 space-y-1"},Ee={class:"font-medium text-sm break-all"},Ue={class:"text-xs text-gray-500"},Re={class:"flex items-center gap-2 shrink-0"},Ae={key:2,class:"text-xs"},je={key:0,class:"text-xs text-gray-500"},Pe={class:"text-default"},Le={key:1,class:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-500"},Se={key:0},De={key:1},Fe={key:2},Ne={key:3},Me={key:3,class:"text-xs text-gray-500"},Ve={class:"space-y-0.5"},Oe={class:"text-[11px]"},He=G({__name:"ImportFileRow",props:{entry:{},removable:{type:Boolean}},emits:["remove"],setup(p){const c=p,a={hashing:{label:"Reading",color:"neutral",icon:"i-lucide-loader-circle"},checking:{label:"Checking",color:"neutral",icon:"i-lucide-loader-circle"},ready:{label:"Ready",color:"primary",icon:"i-lucide-circle-check"},uploading:{label:"Importing",color:"primary",icon:"i-lucide-loader-circle"},imported:{label:"Imported",color:"success",icon:"i-lucide-check"},duplicate:{label:"Already imported",color:"neutral",icon:"i-lucide-copy-check"},"too-large":{label:"Too large",color:"warning",icon:"i-lucide-weight"},invalid:{label:"Not importable",color:"warning",icon:"i-lucide-file-x"},failed:{label:"Failed",color:"error",icon:"i-lucide-circle-alert"}},d=U(()=>a[c.entry.state]),m=U(()=>["hashing","checking","uploading"].includes(c.entry.state)),o=U(()=>c.entry.result),t=U(()=>c.entry.state==="imported"?o.value:null),h=U(()=>t.value?.kind==="trace");function n(l,i){return`${l} ${i}${l===1?"":"s"}`}return(l,i)=>{const f=J,y=ve,k=Z,$=be,x=_e,T=Y;return v(),C("div",Ie,[b("div",ze,[b("div",Be,[b("p",Ee,I(p.entry.name),1),b("p",Ue,I(("formatBytes"in l?l.formatBytes:e(V))(p.entry.size)),1)]),b("div",Re,[E(y,{color:e(d).color,variant:"subtle",size:"sm"},{default:S(()=>[E(f,{name:e(d).icon,class:q(["size-3.5 mr-1",e(m)&&"animate-spin"])},null,8,["name","class"]),R(" "+I(e(d).label),1)]),_:1},8,["color"]),p.removable?(v(),A(k,{key:0,icon:"i-lucide-x",color:"neutral",variant:"ghost",size:"xs",title:"Remove from the list",onClick:i[0]||(i[0]=s=>l.$emit("remove",p.entry.id))})):z("",!0)])]),p.entry.state==="uploading"||p.entry.state==="hashing"?(v(),A($,{key:0,"model-value":Math.round(p.entry.progress*100),size:"sm"},null,8,["model-value"])):z("",!0),p.entry.message?(v(),C("p",{key:1,class:q(["text-xs",p.entry.state==="failed"?"text-error":"text-gray-500"])},I(p.entry.message),3)):z("",!0),e(o)?.testRunId?(v(),C("div",Ae,[E(x,{to:`/test-runs/${e(o).testRunId}`,class:"text-primary hover:underline"},{default:S(()=>[R(" View run #"+I(e(o).testRunId),1)]),_:1},8,["to"])])):z("",!0),e(t)?(v(),C(W,{key:3},[e(h)?(v(),C("p",je,[i[1]||(i[1]=R(" Added ",-1)),b("span",Pe,I(e(t).caseTitle),1),i[2]||(i[2]=R(" to this run. ",-1))])):(v(),C("div",Le,[b("span",null,I(n(e(t).totalTests,"execution")),1),b("span",null,I(e(t).passedTests)+" passed",1),b("span",null,I(e(t).failedTests)+" failed",1),e(t).skippedTests?(v(),C("span",Se,I(e(t).skippedTests)+" skipped",1)):z("",!0),e(t).flakyTests?(v(),C("span",De,I(e(t).flakyTests)+" flaky",1)):z("",!0),e(t).traceCount?(v(),C("span",Fe,I(n(e(t).traceCount,"trace")),1)):z("",!0),e(t).attachmentCount?(v(),C("span",Ne,I(n(e(t).attachmentCount,"attachment")),1)):z("",!0)])),e(t).shard?(v(),A(T,{key:2,color:"warning",variant:"subtle",icon:"i-lucide-split",description:`This archive is shard ${e(t).shard.current} of ${e(t).shard.total}. Each shard imports as its own run — they are not merged.`,ui:{description:"text-xs"}},null,8,["description"])):z("",!0),e(t).filePaths.length&&!e(h)?(v(),C("div",Me,[i[3]||(i[3]=b("p",{class:"mb-1"},[R(" Spec files recorded as "),b("span",{class:"text-gray-400"},"(these must match the paths your live runs report for history to line up)"),R(": ")],-1)),b("ul",Ve,[(v(!0),C(W,null,Q(e(t).filePaths,s=>(v(),C("li",{key:s},[b("code",Oe,I(s),1)]))),128))])])):z("",!0)],64)):z("",!0)])}}}),qe=Object.assign(He,{__name:"ImportFileRow"}),L=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),We=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ke=Array.from({length:256},(p,c)=>c.toString(16).padStart(2,"0"));class te{#r=new Uint32Array(We);#t=new Uint8Array(64);#e=0;#n=0;#i=new Uint32Array(64);#o=!1;update(c){if(this.#o)throw new Error("Sha256: update() after digest()");this.#n+=c.length;let a=0;if(this.#e>0){const d=Math.min(64-this.#e,c.length);if(this.#t.set(c.subarray(0,d),this.#e),this.#e+=d,a=d,this.#e<64)return this;this.#s(this.#t,0),this.#e=0}for(;a+64<=c.length;a+=64)this.#s(c,a);return a<c.length&&(this.#t.set(c.subarray(a),0),this.#e=c.length-a),this}digest(){if(this.#o)throw new Error("Sha256: digest() called twice");this.#o=!0;const c=this.#n*8;this.#t[this.#e++]=128,this.#e>56&&(this.#t.fill(0,this.#e),this.#s(this.#t,0),this.#e=0),this.#t.fill(0,this.#e,56);const a=new DataView(this.#t.buffer,this.#t.byteOffset,64);a.setUint32(56,Math.floor(c/4294967296),!1),a.setUint32(60,c>>>0,!1),this.#s(this.#t,0);const d=new Uint8Array(32),m=new DataView(d.buffer);for(let o=0;o<8;o++)m.setUint32(o*4,this.#r[o],!1);return d}hex(){const c=this.digest();let a="";for(let d=0;d<32;d++)a+=Ke[c[d]];return a}#s(c,a){const d=this.#i,m=this.#r;for(let r=0;r<16;r++){const _=a+r*4;d[r]=c[_]<<24|c[_+1]<<16|c[_+2]<<8|c[_+3]}for(let r=16;r<64;r++){const _=d[r-15],B=d[r-2],g=(_>>>7|_<<25)^(_>>>18|_<<14)^_>>>3,D=(B>>>17|B<<15)^(B>>>19|B<<13)^B>>>10;d[r]=d[r-16]+g+d[r-7]+D|0}let o=m[0],t=m[1],h=m[2],n=m[3],l=m[4],i=m[5],f=m[6],y=m[7],k=0,$=0,x=0,T=0,s=0,u=0;for(let r=0;r<64;r+=8)$=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),x=l&i^~l&f,s=y+$+x+L[r]+d[r]|0,k=(o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10),T=o&t^o&h^t&h,u=k+T|0,n=n+s|0,y=s+u|0,$=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),x=n&l^~n&i,s=f+$+x+L[r+1]+d[r+1]|0,k=(y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10),T=y&o^y&t^o&t,u=k+T|0,h=h+s|0,f=s+u|0,$=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),x=h&n^~h&l,s=i+$+x+L[r+2]+d[r+2]|0,k=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),T=f&y^f&o^y&o,u=k+T|0,t=t+s|0,i=s+u|0,$=(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7),x=t&h^~t&n,s=l+$+x+L[r+3]+d[r+3]|0,k=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),T=i&f^i&y^f&y,u=k+T|0,o=o+s|0,l=s+u|0,$=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),x=o&t^~o&h,s=n+$+x+L[r+4]+d[r+4]|0,k=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),T=l&i^l&f^i&f,u=k+T|0,y=y+s|0,n=s+u|0,$=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),x=y&o^~y&t,s=h+$+x+L[r+5]+d[r+5]|0,k=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),T=n&l^n&i^l&i,u=k+T|0,f=f+s|0,h=s+u|0,$=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7),x=f&y^~f&o,s=t+$+x+L[r+6]+d[r+6]|0,k=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),T=h&n^h&l^n&l,u=k+T|0,i=i+s|0,t=s+u|0,$=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),x=i&f^~i&y,s=o+$+x+L[r+7]+d[r+7]|0,k=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),T=t&h^t&n^h&n,u=k+T|0,l=l+s|0,o=s+u|0;m[0]=m[0]+o|0,m[1]=m[1]+t|0,m[2]=m[2]+h|0,m[3]=m[3]+n|0,m[4]=m[4]+l|0,m[5]=m[5]+i|0,m[6]=m[6]+f|0,m[7]=m[7]+y|0}}async function Xe(p,c){const a=new te,d=p.stream().getReader();let m=0;for(;;){const{done:o,value:t}=await d.read();if(o)break;a.update(t),m+=t.length,c&&c(p.size?m/p.size:1)}return c&&c(1),a.hex()}const X=["ready","failed"],Ye={ok:"ready",duplicate:"duplicate","too-large":"too-large",invalid:"invalid"};function Ge(p){const c=Je("/api/test-runs/import"),a=F([]),d=F(null),m=F(null),o=F(!1);let t=1;const h=U(()=>a.value.filter(s=>X.includes(s.state)).length),n=U(()=>a.value.filter(s=>s.state==="imported").length),l=U(()=>a.value.some(s=>s.state==="hashing"||s.state==="checking")),i=F({done:0,total:0});async function f(){if(p.value)try{const s=await $fetch("/api/test-runs/import/check",{method:"POST",body:{projectName:p.value,files:[]}});d.value=s.maxBytes,m.value=null}catch(s){m.value=M(s,"Could not reach the server to read its upload limit.")}}async function y(s){const u=s.map(g=>({id:t++,file:g,name:g.name,size:g.size,state:"hashing",progress:0}));a.value=[...a.value,...u];const r=a.value.slice(-u.length),_=[];for(const g of r)d.value!=null&&g.size>d.value?(g.state="too-large",g.message=`${V(g.size)} exceeds the ${V(d.value)} limit.`):g.size===0?(g.state="invalid",g.message="The file is empty."):g.name.toLowerCase().endsWith(".zip")?_.push(g):(g.state="invalid",g.message="Expected a .zip blob report (blob-report/report-*.zip).");if(_.length===0)return;for(const g of _)try{g.progress=0,g.hash=await Xe(g.file,D=>{g.progress=D}),g.state="checking"}catch(D){g.state="failed",g.message=M(D,"Could not read the file.")}finally{g.progress=0}const B=await Qe(_);for(const g of _)g.group=B??void 0;await k(_.filter(g=>g.state==="checking"))}async function k(s){if(!(s.length===0||!p.value))try{const u=await $fetch("/api/test-runs/import/check",{method:"POST",body:{projectName:p.value,files:s.map(r=>({name:r.name,size:r.size,hash:r.hash}))}});d.value=u.maxBytes,u.results.forEach((r,_)=>{const B=s[_];B&&(B.state=Ye[r.status]??"ready",B.message=r.message,r.testRunId&&(B.result={testRunId:r.testRunId}))})}catch(u){const r=M(u,"Pre-flight check failed.");for(const _ of s)_.state="ready",_.message=`${r} Importing will still verify it.`}}async function $(){if(o.value||!p.value)return;o.value=!0;const s=a.value.filter(u=>X.includes(u.state));i.value={done:0,total:s.length};try{for(const u of s){u.state="uploading",u.message=void 0,u.progress=0;try{const r=await Ze(c,p.value,u,u.group??null,_=>{u.progress=_});u.result=r,u.state=r.status==="duplicate"?"duplicate":"imported",u.message=r.status==="duplicate"?"Already imported into this project.":void 0}catch(r){u.state="failed",u.message=M(r,"The import failed.")}finally{u.progress=0,i.value={...i.value,done:i.value.done+1}}}}finally{o.value=!1}}function x(s){a.value=a.value.filter(u=>u.id!==s)}function T(){a.value=a.value.filter(s=>!["imported","duplicate"].includes(s.state))}return{entries:a,maxBytes:d,limitError:m,importing:o,readyCount:h,importedCount:n,busy:l,batch:i,loadLimit:f,addFiles:y,startImport:$,remove:x,clearFinished:T}}function Je(p){return`${(ee().app.baseURL||"/").replace(/\/$/,"")}${p}`}async function Qe(p){const c=p.map(a=>a.hash).filter(a=>!!a);return c.length===0?null:new te().update(new TextEncoder().encode([...c].sort().join(""))).hex()}function Ze(p,c,a,d,m){return new Promise((o,t)=>{const h=new FormData;h.append("projectName",c),d&&h.append("importGroup",d),h.append("archive",a.file,a.name);const n=new XMLHttpRequest;n.open("POST",p),n.responseType="json",n.upload.addEventListener("progress",l=>{l.lengthComputable&&m(l.loaded/l.total)}),n.addEventListener("load",()=>{const l=n.response;if(n.status>=200&&n.status<300){o(l);return}const i=typeof l?.message=="string"?l.message:null;t(new Error(i??et(n.status)))}),n.addEventListener("error",()=>t(new Error("The connection dropped during the upload."))),n.addEventListener("abort",()=>t(new Error("The upload was cancelled."))),n.addEventListener("timeout",()=>t(new Error("The upload timed out."))),n.send(h)})}function et(p){return p===413?"The server (or a proxy in front of it) rejected the archive as too large.":p===401||p===403?"You do not have permission to import into this project.":p===0?"The connection dropped during the upload.":p>=500?`The server failed while importing (HTTP ${p}).`:`The import was rejected (HTTP ${p}).`}function M(p,c){const a=p?.data;return typeof a?.message=="string"&&a.message?a.message:p?.message||c}const tt={class:"p-4 space-y-4"},st={class:"space-y-4"},ot={class:"text-sm text-gray-600 dark:text-gray-400 space-y-2"},rt={class:"flex items-center gap-2"},nt={key:0,class:"text-xs text-gray-500 tabular-nums"},it={class:"space-y-4"},at={key:0,class:"text-xs text-gray-500 mt-3"},lt={key:1,class:"divide-y divide-gray-100 dark:divide-gray-800 border rounded-lg border-gray-200 dark:border-gray-800"},ct={key:2,class:"flex justify-end"},Ct=G({__name:"import",async setup(p){let c,a;const m=xe().params.id,{data:o}=([c,a]=we(()=>Ce(`/api/projects/${m}`,"$w9ISz8uFNz")),c=await c,a(),c);ke(U(()=>({title:`Import runs — ${o.value?.label||o.value?.name||"Project"} — Piwi Dashboard`})));const t=ee().public.demoMode,h=U(()=>o.value?.name),{entries:n,maxBytes:l,limitError:i,importing:f,readyCount:y,importedCount:k,busy:$,batch:x,loadLimit:T,addFiles:s,startImport:u,remove:r,clearFinished:_}=Ge(h);$e(T);const B=F(null),g=F(!1);function D(j){const w=j.target;w.files?.length&&s([...w.files]),w.value=""}function se(j){g.value=!1;const w=[...j.dataTransfer?.files??[]];w.length&&s(w)}const oe=U(()=>n.value.filter(j=>["imported","duplicate"].includes(j.state)).length);return(j,w)=>{const re=pe,ne=me,ie=fe,ae=ye,O=Y,K=ge,N=Z,le=J,ce=Te,de=qe,ue=he;return v(),A(ue,{id:"project-import"},{header:S(()=>[E(ie,null,{leading:S(()=>[E(re),E(ne,{items:[{label:"Home",icon:"i-lucide-house",to:"/"},{label:"Projects",to:"/projects"},{label:e(o)?.label||e(o)?.name||"Project",to:`/projects/${e(m)}`},{label:"Import runs"}]},null,8,["items"])]),_:1})]),body:S(()=>[b("div",tt,[E(K,{title:"Import past runs",icon:"i-lucide-import",help:"project.import",subtitle:"Backfill runs recorded before you started using Piwi, from Playwright's own blob reports."},{default:S(()=>[b("div",st,[b("div",ot,[w[5]||(w[5]=b("p",null,[R(" Run your suite with the blob reporter and upload the archives it writes to "),b("code",null,"blob-report/"),R(": ")],-1)),E(ae,{code:"npx playwright test --reporter=blob",language:"bash"}),w[6]||(w[6]=b("p",null," Each archive imports as one completed run, with its traces, screenshots and videos. Importing the same archive twice does nothing, so an interrupted batch is safe to repeat. ",-1))]),e(t)?(v(),A(O,{key:0,color:"primary",variant:"subtle",icon:"i-lucide-monitor-smartphone",title:"Nothing leaves your browser",description:"This is the demo: the archive is read by a service worker and stored in your browser, not uploaded. It is cleared when the demo's sample data is refreshed, or when you reset the demo.",ui:{description:"text-xs"}})):z("",!0),E(O,{color:"neutral",variant:"subtle",icon:"i-lucide-info",title:"What imported runs carry",description:"Failures still cluster, and traces, screenshots and videos open exactly as they do for reported runs. Web vitals, page state and locator healing come from Piwi's own capture fixtures, so historical runs have none — they start once the reporter is in place.",ui:{description:"text-xs"}}),e(i)?(v(),A(O,{key:1,color:"error",variant:"subtle",icon:"i-lucide-circle-alert",description:e(i)},null,8,["description"])):z("",!0)])]),_:1}),E(K,{title:"Archives",icon:"i-lucide-files",count:e(n).length||null},{actions:S(()=>[b("div",rt,[e(f)?(v(),C("span",nt,I(e(x).done)+" of "+I(e(x).total)+" done ",1)):z("",!0),e(oe)>0&&!e(f)?(v(),A(N,{key:1,label:"Clear finished",icon:"i-lucide-eraser",color:"neutral",variant:"ghost",size:"sm",disabled:e(f),onClick:w[0]||(w[0]=P=>e(_)())},null,8,["disabled"])):z("",!0),E(N,{label:e(y)>0?`Import ${e(y)} archive${e(y)===1?"":"s"}`:"Import",icon:"i-lucide-upload",size:"sm",loading:e(f),disabled:e(y)===0||e($),onClick:w[1]||(w[1]=P=>e(u)())},null,8,["label","loading","disabled"])])]),default:S(()=>[b("div",it,[b("div",{class:q(["rounded-lg border-2 border-dashed p-6 text-center transition-colors",e(g)?"border-primary bg-primary/5":"border-gray-200 dark:border-gray-700"]),onDragover:w[3]||(w[3]=H(P=>g.value=!0,["prevent"])),onDragleave:w[4]||(w[4]=H(P=>g.value=!1,["prevent"])),onDrop:H(se,["prevent"])},[E(le,{name:"i-lucide-file-archive",class:"size-7 text-gray-400 mb-2"}),w[7]||(w[7]=b("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[R("Drop "),b("code",null,"report-*.zip"),R(" files here, or")],-1)),E(N,{label:"Choose files",icon:"i-lucide-folder-open",variant:"outline",size:"sm",class:"mt-2",disabled:e(f),onClick:w[2]||(w[2]=P=>e(B)?.click())},null,8,["disabled"]),e(l)?(v(),C("p",at," Up to "+I(("formatBytes"in j?j.formatBytes:e(V))(e(l)))+" per archive. Larger ones are rejected here, before uploading. ",1)):z("",!0),b("input",{ref_key:"fileInput",ref:B,type:"file",accept:".zip",multiple:"",class:"hidden",onChange:D},null,544)],34),e(n).length===0?(v(),A(ce,{key:0,icon:"i-lucide-inbox",text:"No archives selected yet."})):(v(),C("div",lt,[(v(!0),C(W,null,Q(e(n),P=>(v(),A(de,{key:P.id,entry:P,removable:!e(f)&&P.state!=="uploading",onRemove:e(r)},null,8,["entry","removable","onRemove"]))),128))])),e(k)>0?(v(),C("div",ct,[E(N,{label:`Open ${e(o)?.label||e(o)?.name||"project"}`,icon:"i-lucide-arrow-right",trailing:"",variant:"ghost",size:"sm",to:`/projects/${e(m)}`},null,8,["label","to"])])):z("",!0)])]),_:1},8,["count"])])]),_:1})}}});export{Ct as default};
@@ -1 +1 @@
1
- import{d as C,b as S,o as r,f as k,g as s,i as y,Q as I,c as g,F as j,y as U,E as p,j as o,I as F,v,m as h,G as w}from"./NQikbhmK.js";import{_ as $}from"./B9WhzpKO.js";import{_ as A}from"./eaVkJRSa.js";import{_ as B}from"./C7P1UCO2.js";import{_ as E}from"./DcmZRa_F.js";import{_ as L}from"./DiZyJYez.js";import{E as P}from"./CDk0q2hV.js";const H={key:0,class:"flex flex-wrap gap-1 py-0.5"},N={key:1,class:"text-[var(--ui-text-muted)]"},O=C({__name:"TagsSelect",props:{modelValue:{},allTags:{}},emits:["update:modelValue","tagCreated"],setup(t,{emit:V}){const u=t,d=V,b=S();async function _(f){const n=f.trim();if(!n)return;const i=u.allTags.find(a=>a.text.toLowerCase()===n.toLowerCase());if(i){u.modelValue.some(a=>a.id===i.id)||d("update:modelValue",[...u.modelValue,i]);return}try{const a=await $fetch("/api/tags",{method:"POST",body:{text:n,color:P()}});d("tagCreated",a.tag),d("update:modelValue",[...u.modelValue,a.tag])}catch(a){const e=a&&typeof a=="object"&&"data"in a?a.data?.message:void 0;b.add({title:"Failed to create tag",description:e||"An error occurred",color:"error"})}}return(f,n)=>{const i=E,a=L;return r(),k(a,{"model-value":t.modelValue,items:t.allTags,multiple:"","create-item":"always","label-key":"text",by:"id",placeholder:"Select or create tags…",class:"w-full","onUpdate:modelValue":n[0]||(n[0]=e=>d("update:modelValue",e)),onCreate:_},{default:s(({modelValue:e})=>[e.length?(r(),g("div",H,[(r(!0),g(j,null,U(e,m=>(r(),k(i,{key:m.id,text:m.text,color:m.color},null,8,["text","color"]))),128))])):(r(),g("span",N,"Select or create tags…"))]),"item-leading":s(({item:e})=>[y("span",{class:"inline-block size-2 rounded-full shrink-0",style:I({backgroundColor:e.color})},null,4)]),_:1},8,["model-value","items"])}}}),D=Object.assign(O,{__name:"TagsSelect"}),G={class:"space-y-5"},q={class:"inline-flex items-center gap-1"},z={class:"inline-flex items-center gap-1"},Q=C({__name:"ProjectFormFields",props:w({mode:{},allTags:{},hasToken:{type:Boolean,default:!1}},{name:{default:""},nameModifiers:{},label:{default:""},labelModifiers:{},description:{default:""},descriptionModifiers:{},diagnosisInstructions:{default:""},diagnosisInstructionsModifiers:{},scmToken:{default:""},scmTokenModifiers:{},tags:{default:()=>[]},tagsModifiers:{}}),emits:w(["tag-created"],["update:name","update:label","update:description","update:diagnosisInstructions","update:scmToken","update:tags"]),setup(t,{emit:V}){const u=V,d=p(t,"name"),b=p(t,"label"),_=p(t,"description"),f=p(t,"diagnosisInstructions"),n=p(t,"scmToken"),i=p(t,"tags");return(a,e)=>{const m=F,c=$,x=A,T=B,M=D;return r(),g("div",G,[t.mode==="create"?(r(),k(c,{key:0,label:"Project name",name:"name",required:"",description:"A unique identifier used to match test results from the reporter."},{default:s(()=>[o(m,{modelValue:d.value,"onUpdate:modelValue":e[0]||(e[0]=l=>d.value=l),placeholder:"e.g. my-app",class:"w-full"},null,8,["modelValue"])]),_:1})):v("",!0),o(c,{label:"Display label",name:"label",description:"A friendly name shown in the UI (defaults to project name if not set)."},{default:s(()=>[o(m,{modelValue:b.value,"onUpdate:modelValue":e[1]||(e[1]=l=>b.value=l),placeholder:"e.g. My Application",class:"w-full"},null,8,["modelValue"])]),_:1}),o(c,{label:"Description",name:"description",description:"Optional description of this project."},{default:s(()=>[o(x,{modelValue:_.value,"onUpdate:modelValue":e[2]||(e[2]=l=>_.value=l),placeholder:"Enter project description",rows:3,class:"w-full"},null,8,["modelValue"])]),_:1}),t.mode==="edit"?(r(),g(j,{key:1},[o(c,{name:"diagnosisInstructions",description:"Combined with the global instructions from Settings → AI."},{label:s(()=>[y("span",q,[e[7]||(e[7]=h(" AI diagnosis instructions ",-1)),o(T,{topic:"project.ai-instructions"})])]),default:s(()=>[o(x,{modelValue:f.value,"onUpdate:modelValue":e[3]||(e[3]=l=>f.value=l),placeholder:"e.g. This project tests the payment checkout flow. The backend uses Stripe for payments and the payment API is at /api/v2/payments. Database errors are usually caused by connection pool exhaustion under load.",rows:5,class:"w-full font-mono text-sm"},null,8,["modelValue"])]),_:1}),o(c,{name:"scmToken",description:t.hasToken?"Leave empty to keep the stored token, enter a new value to replace it, or save empty to remove it":"For GitHub, GitLab, or Bitbucket. Falls back to the global SCM token if not set."},{label:s(()=>[y("span",z,[e[8]||(e[8]=h("SCM token ",-1)),o(T,{topic:"project.scm-token"})])]),default:s(()=>[o(m,{modelValue:n.value,"onUpdate:modelValue":e[4]||(e[4]=l=>n.value=l),type:"password",placeholder:t.hasToken?"•••••••• (unchanged)":"ghp_..., glpat-..., or bitbucket token",class:"w-full font-mono"},null,8,["modelValue","placeholder"])]),_:1},8,["description"])],64)):v("",!0),o(c,{label:"Tags",name:"tags",description:"Select existing tags or type a new name and press Enter to create one."},{default:s(()=>[o(M,{modelValue:i.value,"onUpdate:modelValue":e[5]||(e[5]=l=>i.value=l),"all-tags":t.allTags,class:"w-full",onTagCreated:e[6]||(e[6]=l=>u("tag-created"))},null,8,["modelValue","all-tags"])]),_:1})])}}}),ee=Object.assign(Q,{__name:"ProjectFormFields"});export{ee as _};
1
+ import{d as C,b as S,o as r,f as k,g as s,i as y,Q as I,c as g,F as j,y as U,E as p,j as o,I as F,v,m as h,G as w}from"./Du2W7Jne.js";import{_ as $}from"./AbmKWFQQ.js";import{_ as A}from"./DsesNydr.js";import{_ as B}from"./Bm62iDV5.js";import{_ as E}from"./oAClCn_h.js";import{_ as L}from"./CeG9pBAD.js";import{E as P}from"./DuwtTfO8.js";const H={key:0,class:"flex flex-wrap gap-1 py-0.5"},N={key:1,class:"text-[var(--ui-text-muted)]"},O=C({__name:"TagsSelect",props:{modelValue:{},allTags:{}},emits:["update:modelValue","tagCreated"],setup(t,{emit:V}){const u=t,d=V,b=S();async function _(f){const n=f.trim();if(!n)return;const i=u.allTags.find(a=>a.text.toLowerCase()===n.toLowerCase());if(i){u.modelValue.some(a=>a.id===i.id)||d("update:modelValue",[...u.modelValue,i]);return}try{const a=await $fetch("/api/tags",{method:"POST",body:{text:n,color:P()}});d("tagCreated",a.tag),d("update:modelValue",[...u.modelValue,a.tag])}catch(a){const e=a&&typeof a=="object"&&"data"in a?a.data?.message:void 0;b.add({title:"Failed to create tag",description:e||"An error occurred",color:"error"})}}return(f,n)=>{const i=E,a=L;return r(),k(a,{"model-value":t.modelValue,items:t.allTags,multiple:"","create-item":"always","label-key":"text",by:"id",placeholder:"Select or create tags…",class:"w-full","onUpdate:modelValue":n[0]||(n[0]=e=>d("update:modelValue",e)),onCreate:_},{default:s(({modelValue:e})=>[e.length?(r(),g("div",H,[(r(!0),g(j,null,U(e,m=>(r(),k(i,{key:m.id,text:m.text,color:m.color},null,8,["text","color"]))),128))])):(r(),g("span",N,"Select or create tags…"))]),"item-leading":s(({item:e})=>[y("span",{class:"inline-block size-2 rounded-full shrink-0",style:I({backgroundColor:e.color})},null,4)]),_:1},8,["model-value","items"])}}}),D=Object.assign(O,{__name:"TagsSelect"}),G={class:"space-y-5"},q={class:"inline-flex items-center gap-1"},z={class:"inline-flex items-center gap-1"},Q=C({__name:"ProjectFormFields",props:w({mode:{},allTags:{},hasToken:{type:Boolean,default:!1}},{name:{default:""},nameModifiers:{},label:{default:""},labelModifiers:{},description:{default:""},descriptionModifiers:{},diagnosisInstructions:{default:""},diagnosisInstructionsModifiers:{},scmToken:{default:""},scmTokenModifiers:{},tags:{default:()=>[]},tagsModifiers:{}}),emits:w(["tag-created"],["update:name","update:label","update:description","update:diagnosisInstructions","update:scmToken","update:tags"]),setup(t,{emit:V}){const u=V,d=p(t,"name"),b=p(t,"label"),_=p(t,"description"),f=p(t,"diagnosisInstructions"),n=p(t,"scmToken"),i=p(t,"tags");return(a,e)=>{const m=F,c=$,x=A,T=B,M=D;return r(),g("div",G,[t.mode==="create"?(r(),k(c,{key:0,label:"Project name",name:"name",required:"",description:"A unique identifier used to match test results from the reporter."},{default:s(()=>[o(m,{modelValue:d.value,"onUpdate:modelValue":e[0]||(e[0]=l=>d.value=l),placeholder:"e.g. my-app",class:"w-full"},null,8,["modelValue"])]),_:1})):v("",!0),o(c,{label:"Display label",name:"label",description:"A friendly name shown in the UI (defaults to project name if not set)."},{default:s(()=>[o(m,{modelValue:b.value,"onUpdate:modelValue":e[1]||(e[1]=l=>b.value=l),placeholder:"e.g. My Application",class:"w-full"},null,8,["modelValue"])]),_:1}),o(c,{label:"Description",name:"description",description:"Optional description of this project."},{default:s(()=>[o(x,{modelValue:_.value,"onUpdate:modelValue":e[2]||(e[2]=l=>_.value=l),placeholder:"Enter project description",rows:3,class:"w-full"},null,8,["modelValue"])]),_:1}),t.mode==="edit"?(r(),g(j,{key:1},[o(c,{name:"diagnosisInstructions",description:"Combined with the global instructions from Settings → AI."},{label:s(()=>[y("span",q,[e[7]||(e[7]=h(" AI diagnosis instructions ",-1)),o(T,{topic:"project.ai-instructions"})])]),default:s(()=>[o(x,{modelValue:f.value,"onUpdate:modelValue":e[3]||(e[3]=l=>f.value=l),placeholder:"e.g. This project tests the payment checkout flow. The backend uses Stripe for payments and the payment API is at /api/v2/payments. Database errors are usually caused by connection pool exhaustion under load.",rows:5,class:"w-full font-mono text-sm"},null,8,["modelValue"])]),_:1}),o(c,{name:"scmToken",description:t.hasToken?"Leave empty to keep the stored token, enter a new value to replace it, or save empty to remove it":"For GitHub, GitLab, or Bitbucket. Falls back to the global SCM token if not set."},{label:s(()=>[y("span",z,[e[8]||(e[8]=h("SCM token ",-1)),o(T,{topic:"project.scm-token"})])]),default:s(()=>[o(m,{modelValue:n.value,"onUpdate:modelValue":e[4]||(e[4]=l=>n.value=l),type:"password",placeholder:t.hasToken?"•••••••• (unchanged)":"ghp_..., glpat-..., or bitbucket token",class:"w-full font-mono"},null,8,["modelValue","placeholder"])]),_:1},8,["description"])],64)):v("",!0),o(c,{label:"Tags",name:"tags",description:"Select existing tags or type a new name and press Enter to create one."},{default:s(()=>[o(M,{modelValue:i.value,"onUpdate:modelValue":e[5]||(e[5]=l=>i.value=l),"all-tags":t.allTags,class:"w-full",onTagCreated:e[6]||(e[6]=l=>u("tag-created"))},null,8,["modelValue","all-tags"])]),_:1})])}}}),ee=Object.assign(Q,{__name:"ProjectFormFields"});export{ee as _};
@@ -1 +1 @@
1
- import{ci as u,b as n}from"./NQikbhmK.js";function d(c={}){const{copy:i,copied:r,isSupported:a}=u({copiedDuring:c.duration??2e3,legacy:!0}),e=n();async function s(t,o={}){if(t){try{await i(t)}catch{return}o.toast&&e.add({title:typeof o.toast=="string"?o.toast:"Copied to clipboard",icon:"i-lucide-check",color:"success",duration:2e3})}}return{copy:s,copied:r,isSupported:a}}export{d as u};
1
+ import{ck as u,b as n}from"./Du2W7Jne.js";function d(c={}){const{copy:i,copied:r,isSupported:a}=u({copiedDuring:c.duration??2e3,legacy:!0}),e=n();async function s(t,o={}){if(t){try{await i(t)}catch{return}o.toast&&e.add({title:typeof o.toast=="string"?o.toast:"Copied to clipboard",icon:"i-lucide-check",color:"success",duration:2e3})}}return{copy:s,copied:r,isSupported:a}}export{d as u};
@@ -1 +1 @@
1
- import{a as B}from"./279D2RYp.js";import{d as $,o,c as w,j as m,ac as x,y as N,g as d,V as _,a0 as y,a1 as S,i as u,k as s,f as p,_ as V,v as h,m as U,t as z,F as C,h as c,ap as P,p as j}from"./NQikbhmK.js";const D={class:"flex min-w-0 items-center gap-1 sm:hidden"},F={class:"truncate text-sm font-medium"},I=$({__name:"BreadcrumbNav",props:{items:{}},setup(t){const n=t,a=c(()=>n.items[n.items.length-1]),i=c(()=>n.items.slice(0,-1).map(e=>({label:typeof e.label=="string"?e.label:String(e.label??""),icon:e.icon,to:e.to}))),r=c(()=>i.value.length>0);return(e,q)=>{const f=B,g=V,b=P,v=j;return o(),w(C,null,[m(f,{items:t.items,class:"hidden min-w-0 sm:flex"},x({_:2},[N(e.$slots,(A,l)=>({name:l,fn:d(k=>[_(e.$slots,l,y(S(k??{})))])}))]),1032,["items"]),u("div",D,[s(r)?(o(),p(b,{key:0,items:s(i),content:{align:"start",collisionPadding:12}},{default:d(()=>[m(g,{icon:t.items[0]?.icon||"i-lucide-ellipsis","trailing-icon":"i-lucide-chevron-down",color:"neutral",variant:"ghost",size:"sm",square:"","aria-label":"Show navigation path",class:"shrink-0"},null,8,["icon"])]),_:1},8,["items"])):h("",!0),s(r)?(o(),p(v,{key:1,name:"i-lucide-chevron-right",class:"size-4 shrink-0 text-muted"})):h("",!0),u("span",F,[_(e.$slots,s(a)?.slot||"current",{item:s(a)},()=>[U(z(s(a)?.label),1)])])])],64)}}}),M=Object.assign(I,{__name:"BreadcrumbNav"});export{M as _};
1
+ import{a as B}from"./CXEH9OPk.js";import{d as $,o,c as w,j as m,ac as x,y as N,g as d,V as _,a0 as y,a1 as S,i as u,k as s,f as p,_ as V,v as h,m as U,t as z,F as C,h as c,ar as P,p as j}from"./Du2W7Jne.js";const D={class:"flex min-w-0 items-center gap-1 sm:hidden"},F={class:"truncate text-sm font-medium"},I=$({__name:"BreadcrumbNav",props:{items:{}},setup(t){const n=t,a=c(()=>n.items[n.items.length-1]),i=c(()=>n.items.slice(0,-1).map(e=>({label:typeof e.label=="string"?e.label:String(e.label??""),icon:e.icon,to:e.to}))),r=c(()=>i.value.length>0);return(e,q)=>{const f=B,g=V,b=P,v=j;return o(),w(C,null,[m(f,{items:t.items,class:"hidden min-w-0 sm:flex"},x({_:2},[N(e.$slots,(A,l)=>({name:l,fn:d(k=>[_(e.$slots,l,y(S(k??{})))])}))]),1032,["items"]),u("div",D,[s(r)?(o(),p(b,{key:0,items:s(i),content:{align:"start",collisionPadding:12}},{default:d(()=>[m(g,{icon:t.items[0]?.icon||"i-lucide-ellipsis","trailing-icon":"i-lucide-chevron-down",color:"neutral",variant:"ghost",size:"sm",square:"","aria-label":"Show navigation path",class:"shrink-0"},null,8,["icon"])]),_:1},8,["items"])):h("",!0),s(r)?(o(),p(v,{key:1,name:"i-lucide-chevron-right",class:"size-4 shrink-0 text-muted"})):h("",!0),u("span",F,[_(e.$slots,s(a)?.slot||"current",{item:s(a)},()=>[U(z(s(a)?.label),1)])])])],64)}}}),M=Object.assign(I,{__name:"BreadcrumbNav"});export{M as _};
@@ -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,D as $,m,C as B,I as V,l as C,_ as F,p as I,r as c}from"./NQikbhmK.js";import{_ as N}from"./D0HNloZ9.js";import{_ as S}from"./B9WhzpKO.js";import{_ as E}from"./eptP4pGv.js";import"./CYsTqbBS.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"},G=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=I,g=N,u=$,y=V,k=S,v=F,w=E;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{G 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,D as $,m,C as B,I as V,l as C,_ as F,p as I,r as c}from"./Du2W7Jne.js";import{_ as N}from"./BrQEE053.js";import{_ as S}from"./AbmKWFQQ.js";import{_ as E}from"./-f7BAm1H.js";import"./L3kAWB2a.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"},G=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=I,g=N,u=$,y=V,k=S,v=F,w=E;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{G as default};
@@ -1 +1 @@
1
- import{r}from"./NQikbhmK.js";function n(i){const o=`piwi-tree-view-${i}`,t=r(!1);try{const e=document.cookie.match(new RegExp(`(?:^|;\\s*)${o}=([^;]*)`));e&&(t.value=e[1]==="true")}catch{}function c(e){t.value=e,document.cookie=`${o}=${e}; path=/; max-age=31536000; sameSite=lax`}return{treeView:t,setTreeView:c}}export{n as u};
1
+ import{r}from"./Du2W7Jne.js";function n(i){const o=`piwi-tree-view-${i}`,t=r(!1);try{const e=document.cookie.match(new RegExp(`(?:^|;\\s*)${o}=([^;]*)`));e&&(t.value=e[1]==="true")}catch{}function c(e){t.value=e,document.cookie=`${o}=${e}; path=/; max-age=31536000; sameSite=lax`}return{treeView:t,setTreeView:c}}export{n as u};
@@ -1 +1 @@
1
- import{a$ as l,aM as s}from"./NQikbhmK.js";function t(r,i){return l(r)?!1:Array.isArray(r)?r.some(a=>s(a,i)):s(r,i)}export{t as i};
1
+ import{b0 as l,aN as s}from"./Du2W7Jne.js";function t(r,i){return l(r)?!1:Array.isArray(r)?r.some(a=>s(a,i)):s(r,i)}export{t as i};
@@ -0,0 +1 @@
1
+ import{d as m,H as h,o as l,f as o,W as p,bl as g,c2 as E,h as d,c,v as B,F as f,y as V}from"./Du2W7Jne.js";var k=m({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(i){const e=i,{primitiveElement:s,currentElement:n}=E(),t=d(()=>e.checked??e.value);return h(t,(r,a)=>{if(!n.value)return;const u=n.value,_=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(_,"value").set;if(v&&r!==a){const b=new Event("input",{bubbles:!0}),q=new Event("change",{bubbles:!0});v.call(u,r),u.dispatchEvent(b),u.dispatchEvent(q)}}),(r,a)=>(l(),o(g,p({ref_key:"primitiveElement",ref:s},{...e,...r.$attrs},{as:"input"}),null,16))}}),y=k,A=m({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(i){const e=i,s=d(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),n=d(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"||e.value===null||e.value===void 0?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((t,r)=>typeof t=="object"?Object.entries(t).map(([a,u])=>({name:`${e.name}[${r}][${a}]`,value:u})):{name:`${e.name}[${r}]`,value:t}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([t,r])=>({name:`${e.name}[${t}]`,value:r})):[]);return(t,r)=>(l(),c(f,null,[B(" We render single input if it's required "),s.value?(l(),o(y,p({key:t.name},{...e,...t.$attrs},{name:t.name,value:t.value}),null,16,["name","value"])):(l(!0),c(f,{key:1},V(n.value,a=>(l(),o(y,p({key:a.name},{ref_for:!0},{...e,...t.$attrs},{name:a.name,value:a.value}),null,16,["name","value"]))),128))],2112))}}),I=A;export{I as V};
@@ -1 +1 @@
1
- import{d as r,o as s,c as l,i,V as n,m as o,t as a,q as c,v as d,Q as u}from"./NQikbhmK.js";const _={class:"rounded-lg bg-gray-50 dark:bg-gray-900 p-3 min-w-0"},g={class:"text-xs font-medium text-gray-500 uppercase tracking-wider inline-flex items-center gap-1 max-w-full"},f={key:0,class:"text-xs text-gray-400 mt-1"},x=r({__name:"StatTile",props:{label:{},value:{},hint:{},size:{default:"lg"},valueClass:{default:""}},setup(e){return(t,m)=>(s(),l("div",_,[i("p",g,[n(t.$slots,"label",{},()=>[o(a(e.label),1)])]),i("p",{class:c(["mt-0.5 break-words",[e.size==="lg"?"text-xl font-bold":"text-sm font-semibold",e.valueClass]])},[n(t.$slots,"default",{},()=>[o(a(e.value??"—"),1)])],2),e.hint?(s(),l("p",f,a(e.hint),1)):d("",!0)]))}}),h=Object.assign(x,{__name:"StatTile"}),p=r({__name:"StatTileGrid",props:{minTileWidth:{default:"8.5rem"}},setup(e){return(t,m)=>(s(),l("div",{class:"grid gap-3",style:u({gridTemplateColumns:`repeat(auto-fit, minmax(min(${e.minTileWidth}, 100%), 1fr))`})},[n(t.$slots,"default")],4))}}),y=Object.assign(p,{__name:"StatTileGrid"});export{y as _,h as a};
1
+ import{d as r,o as s,c as l,i,V as n,m as o,t as a,q as c,v as d,Q as u}from"./Du2W7Jne.js";const _={class:"rounded-lg bg-gray-50 dark:bg-gray-900 p-3 min-w-0"},g={class:"text-xs font-medium text-gray-500 uppercase tracking-wider inline-flex items-center gap-1 max-w-full"},f={key:0,class:"text-xs text-gray-400 mt-1"},x=r({__name:"StatTile",props:{label:{},value:{},hint:{},size:{default:"lg"},valueClass:{default:""}},setup(e){return(t,m)=>(s(),l("div",_,[i("p",g,[n(t.$slots,"label",{},()=>[o(a(e.label),1)])]),i("p",{class:c(["mt-0.5 break-words",[e.size==="lg"?"text-xl font-bold":"text-sm font-semibold",e.valueClass]])},[n(t.$slots,"default",{},()=>[o(a(e.value??"—"),1)])],2),e.hint?(s(),l("p",f,a(e.hint),1)):d("",!0)]))}}),h=Object.assign(x,{__name:"StatTile"}),p=r({__name:"StatTileGrid",props:{minTileWidth:{default:"8.5rem"}},setup(e){return(t,m)=>(s(),l("div",{class:"grid gap-3",style:u({gridTemplateColumns:`repeat(auto-fit, minmax(min(${e.minTileWidth}, 100%), 1fr))`})},[n(t.$slots,"default")],4))}}),y=Object.assign(p,{__name:"StatTileGrid"});export{y as _,h as a};
@@ -0,0 +1 @@
1
+ import{_ as R}from"./CXEH9OPk.js";import{_ as V}from"./DabzhQB1.js";import{_ as O,a as q}from"./5A6ITZXj.js";import{_ as z}from"./DPCxhHri.js";import{d as A,u as L,a as G,b as J,w as T,e as K,r as g,f as M,g as i,h as f,o as Q,i as l,j as r,k as s,l as W,_ as X,m as b,t as Y}from"./Du2W7Jne.js";import{o as Z,s as u,_ as tt}from"./CEfS4-oS.js";import{_ as st}from"./-f7BAm1H.js";import{u as h}from"./B8zkOmwo.js";import"./KyA_4Ks-.js";import"./AbmKWFQQ.js";import"./L3kAWB2a.js";import"./DsesNydr.js";import"./Bm62iDV5.js";import"./BjaRappk.js";import"./DSqHUrvO.js";import"./oAClCn_h.js";import"./CeG9pBAD.js";import"./UdR3DBPS.js";import"./DmkUdSS4.js";import"./B99fbi73.js";import"./DuwtTfO8.js";const ot={class:"p-4 space-y-4"},et={class:"text-sm text-gray-600 mt-1"},at={class:"font-medium"},nt={class:"flex justify-end gap-2 pt-2"},Pt=A({__name:"edit",async setup(it){let n,d;const $=L(),v=G(),j=J(),c=$.params.id,{data:e}=([n,d]=T(()=>h(`/api/projects/${c}`,"$HHkdnHL3hB")),n=await n,d(),n),{data:y,refresh:x}=([n,d]=T(()=>h("/api/tags","$DPtjOd0zOq")),n=await n,d(),n);K(f(()=>({title:`Edit ${e.value?.label||e.value?.name||"Project"} — Piwi Dashboard`})));const I=f(()=>y.value?.tags||[]),U=f(()=>!!e.value?.hasScmToken),o=g({label:e.value?.label||"",description:e.value?.description||"",diagnosisInstructions:e.value?.diagnosisInstructions||"",scmToken:""}),p=g(e.value?.tags||[]),P=Z({label:u().optional(),description:u().optional(),diagnosisInstructions:u().optional(),scmToken:u().optional()}),_=g(!1);async function C(){try{_.value=!0,await $fetch(`/api/projects/${c}`,{method:"PUT",body:{label:o.value.label||null,description:o.value.description||null,diagnosisInstructions:o.value.diagnosisInstructions||null,scmToken:o.value.scmToken||null,tagIds:p.value.map(m=>m.id)}}),j.add({title:"Project updated",description:"Project settings have been saved successfully",color:"success"}),await v.push(`/projects/${c}`)}catch(m){console.error("Error updating project:",m),j.add({title:"Error",description:"Failed to update project",color:"error"})}finally{_.value=!1}}function w(){v.push(`/projects/${c}`)}return(m,t)=>{const B=R,D=V,N=q,E=z,k=X,F=tt,H=st,S=O;return Q(),M(S,{id:"project-edit"},{header:i(()=>[r(N,null,{leading:i(()=>[r(B),r(D,{items:[{label:"Home",icon:"i-lucide-house",to:"/"},{label:"Projects",to:"/projects"},{label:s(e)?.label||s(e)?.name||"Project",to:`/projects/${s(c)}`},{label:"Edit"}]},null,8,["items"])]),_:1})]),body:i(()=>[l("div",ot,[r(H,null,{header:i(()=>[t[7]||(t[7]=l("h2",null,"Edit project settings",-1)),l("p",et,[t[6]||(t[6]=b(" Project Name: ",-1)),l("span",at,Y(s(e)?.name),1)]),t[8]||(t[8]=l("p",{class:"text-xs text-gray-500 mt-1"}," Note: The project name is used to match test results from the reporter and cannot be changed. ",-1))]),default:i(()=>[r(F,{schema:s(P),state:s(o),class:"space-y-5",onSubmit:C},{default:i(()=>[r(E,{mode:"edit","has-token":s(U),label:s(o).label,"onUpdate:label":t[0]||(t[0]=a=>s(o).label=a),description:s(o).description,"onUpdate:description":t[1]||(t[1]=a=>s(o).description=a),diagnosisInstructions:s(o).diagnosisInstructions,"onUpdate:diagnosisInstructions":t[2]||(t[2]=a=>s(o).diagnosisInstructions=a),scmToken:s(o).scmToken,"onUpdate:scmToken":t[3]||(t[3]=a=>s(o).scmToken=a),tags:s(p),"onUpdate:tags":t[4]||(t[4]=a=>W(p)?p.value=a:null),"all-tags":s(I),onTagCreated:t[5]||(t[5]=a=>s(x)())},null,8,["has-token","label","description","diagnosisInstructions","scmToken","tags","all-tags"]),l("div",nt,[r(k,{variant:"ghost",color:"neutral",onClick:w},{default:i(()=>[...t[9]||(t[9]=[b(" Cancel ",-1)])]),_:1}),r(k,{type:"submit",icon:"i-lucide-check",loading:s(_)},{default:i(()=>[...t[10]||(t[10]=[b(" Save changes ",-1)])]),_:1},8,["loading"])])]),_:1},8,["schema","state"])]),_:1})])]),_:1})}}});export{Pt as default};