@piwitests/server 0.26.0 → 0.26.1

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 (382) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{BdQ7kfxJ.js → 1QWBzxLM.js} +4 -4
  3. package/.output/public/_nuxt/{CY1UsEbI.js → 4hW9LHwA.js} +1 -1
  4. package/.output/public/_nuxt/96uxfdYT.js +1 -0
  5. package/.output/public/_nuxt/{HGYIpJtg.js → AbnDY6Zr.js} +1 -1
  6. package/.output/public/_nuxt/{CZ6WR7uw.js → B-1zt4pp.js} +1 -1
  7. package/.output/public/_nuxt/{Sx5-c-bZ.js → B1iYmAt_.js} +1 -1
  8. package/.output/public/_nuxt/{CbzgEkmW.js → B2bxEmbR.js} +1 -1
  9. package/.output/public/_nuxt/B3hAvaCe.js +4 -0
  10. package/.output/public/_nuxt/{CyWOerIG.js → B4lvHjBe.js} +1 -1
  11. package/.output/public/_nuxt/B5S7BkC3.js +1 -0
  12. package/.output/public/_nuxt/{Bb_1uAHn.js → B6j5Ornu.js} +1 -1
  13. package/.output/public/_nuxt/{CrsaY0R_.js → B82vqOZe.js} +1 -1
  14. package/.output/public/_nuxt/{CTFUlsXp.js → B9oXlGro.js} +1 -1
  15. package/.output/public/_nuxt/{CsJ9Ce4U.js → BABCH5kE.js} +1 -1
  16. package/.output/public/_nuxt/{Gn1Ns00e.js → BF5qB58w.js} +1 -1
  17. package/.output/public/_nuxt/{CsGsLxHg.js → BFLa9ZEP.js} +1 -1
  18. package/.output/public/_nuxt/BIlohx1E.js +1 -0
  19. package/.output/public/_nuxt/{B6djubIK.js → BM5C-Oec.js} +1 -1
  20. package/.output/public/_nuxt/{CrZhoZuI.js → BOA-I6S9.js} +1 -1
  21. package/.output/public/_nuxt/{Bp2zrrkV.js → BQUhoGCh.js} +1 -1
  22. package/.output/public/_nuxt/{DUC3QnqW.js → BQYLGX9o.js} +1 -1
  23. package/.output/public/_nuxt/{CUjzhXN1.js → BRMeEHXd.js} +1 -1
  24. package/.output/public/_nuxt/{Cf_a8ynB.js → BRtaKOKv.js} +2 -2
  25. package/.output/public/_nuxt/{B7uPoZ7T.js → BS91Og__.js} +1 -1
  26. package/.output/public/_nuxt/{DKgbchez.js → BTGAvMoT.js} +1 -1
  27. package/.output/public/_nuxt/{BIamiwb7.js → BaLX92Wz.js} +1 -1
  28. package/.output/public/_nuxt/{LWIyaZKe.js → Bc6Zr-Xn.js} +1 -1
  29. package/.output/public/_nuxt/{R7AVOWi_.js → BceMEnJt.js} +1 -1
  30. package/.output/public/_nuxt/{Q2oJNyXL.js → BeCAVtCK.js} +1 -1
  31. package/.output/public/_nuxt/{D_SD71Qf.js → Bf119e7x.js} +1 -1
  32. package/.output/public/_nuxt/BfRcdz11.js +9 -0
  33. package/.output/public/_nuxt/{CxwnFFD0.js → Bl0xzETD.js} +1 -1
  34. package/.output/public/_nuxt/{C_eXufkv.js → BnUQ3i5l.js} +1 -1
  35. package/.output/public/_nuxt/{rPG7kzfL.js → Bp1WeQ0_.js} +1 -1
  36. package/.output/public/_nuxt/{BL8cYWsR.js → Bp31ZRcA.js} +1 -1
  37. package/.output/public/_nuxt/{Drh1_ASq.js → BrxUH8qL.js} +1 -1
  38. package/.output/public/_nuxt/{D72Ce8Ff.js → BsdfEbVC.js} +1 -1
  39. package/.output/public/_nuxt/BtGI4ZbP.js +1 -0
  40. package/.output/public/_nuxt/{BV8EzO8q.js → BuMX-4RF.js} +1 -1
  41. package/.output/public/_nuxt/{DPPhFZOr.js → BuXJR5tn.js} +1 -1
  42. package/.output/public/_nuxt/{Bh2WA4IJ.js → Bx_lfKHl.js} +1 -1
  43. package/.output/public/_nuxt/{vcSKeWsW.js → C4UKyPQn.js} +1 -1
  44. package/.output/public/_nuxt/{IoE3eJ9F.js → C9XCTbtQ.js} +1 -1
  45. package/.output/public/_nuxt/{BilJoEne.js → CEPU6VkU.js} +1 -1
  46. package/.output/public/_nuxt/CHz7LJIX.js +1 -0
  47. package/.output/public/_nuxt/{BPhGDGAR.js → CMhd8IBr.js} +1 -1
  48. package/.output/public/_nuxt/{C5X_N4R7.js → CN1M6i4K.js} +33 -33
  49. package/.output/public/_nuxt/CQLkowA3.js +1 -0
  50. package/.output/public/_nuxt/{DTtizz85.js → CU_2YLhT.js} +1 -1
  51. package/.output/public/_nuxt/{CMVTTE_g.js → CXkXHtcx.js} +1 -1
  52. package/.output/public/_nuxt/{igDJCTgt.js → CZeKW-zP.js} +1 -1
  53. package/.output/public/_nuxt/{9oKY4Zb7.js → CapSEET7.js} +1 -1
  54. package/.output/public/_nuxt/{j2eGYaRa.js → CeExxGSu.js} +1 -1
  55. package/.output/public/_nuxt/{CEgRB8H9.js → CfwpqSe7.js} +1 -1
  56. package/.output/public/_nuxt/{CFKbXp6V.js → ChOtLYkd.js} +1 -1
  57. package/.output/public/_nuxt/ChuJzPWz.js +1 -0
  58. package/.output/public/_nuxt/{Bo73sAu8.js → CiCUZGFZ.js} +1 -1
  59. package/.output/public/_nuxt/{C6R4tyud.js → CkL_oDa8.js} +1 -1
  60. package/.output/public/_nuxt/{DtGJeysS.js → CkhOMiiO.js} +1 -1
  61. package/.output/public/_nuxt/ClmHMP65.js +2 -0
  62. package/.output/public/_nuxt/{BtcDY0Du.js → Cnm0d_7S.js} +1 -1
  63. package/.output/public/_nuxt/{CK2AMqz_.js → CtQMagSz.js} +1 -1
  64. package/.output/public/_nuxt/{B1KjIR-q.js → Ctnn3S3-.js} +1 -1
  65. package/.output/public/_nuxt/{DCeZxpxe.js → CywiLuOD.js} +4 -4
  66. package/.output/public/_nuxt/{oA84LLqO.js → CzRkZLB4.js} +1 -1
  67. package/.output/public/_nuxt/CzyCEdYP.js +1 -0
  68. package/.output/public/_nuxt/{D56yp7m9.js → D-F0Rhjj.js} +1 -1
  69. package/.output/public/_nuxt/D4mPjHHR.js +2 -0
  70. package/.output/public/_nuxt/{BsGvSoPC.js → D4v7lLm3.js} +1 -1
  71. package/.output/public/_nuxt/{CxRTKV-K.js → D6B0WKO0.js} +1 -1
  72. package/.output/public/_nuxt/{jv8U_Tup.js → DAg6jtav.js} +1 -1
  73. package/.output/public/_nuxt/DBXXb0w8.js +1 -0
  74. package/.output/public/_nuxt/{ChlP20A5.js → DHN2t5Vt.js} +1 -1
  75. package/.output/public/_nuxt/{B8tezsWe.js → DJKHXfNS.js} +1 -1
  76. package/.output/public/_nuxt/{CFg5qdS0.js → DMqAUHFN.js} +1 -1
  77. package/.output/public/_nuxt/{C9A3sPDo.js → DURme_kn.js} +1 -1
  78. package/.output/public/_nuxt/{C2hIM5f9.js → DVo_e_uj.js} +1 -1
  79. package/.output/public/_nuxt/{DKhqIou2.js → DXh8q5KY.js} +1 -1
  80. package/.output/public/_nuxt/{CZXeJs2k.js → DXz1Kb4-.js} +1 -1
  81. package/.output/public/_nuxt/{CPrVhXJk.js → DYdwHaco.js} +1 -1
  82. package/.output/public/_nuxt/{WZXZeGYt.js → D_ZAGxCQ.js} +1 -1
  83. package/.output/public/_nuxt/{D5SN7rPK.js → D_dhjJvR.js} +1 -1
  84. package/.output/public/_nuxt/{DR1jFptD.js → DamZHy5M.js} +1 -1
  85. package/.output/public/_nuxt/{xKX9IHe3.js → DbtjJCra.js} +1 -1
  86. package/.output/public/_nuxt/{r6zkA1SE.js → DcOlL-oi.js} +1 -1
  87. package/.output/public/_nuxt/{CxspCKpR.js → DeQ9sIia.js} +1 -1
  88. package/.output/public/_nuxt/{BkHJoHpc.js → DjX1bLZD.js} +1 -1
  89. package/.output/public/_nuxt/{Be0bwdsi.js → Dly7wCCl.js} +1 -1
  90. package/.output/public/_nuxt/DmeogbGY.js +1 -0
  91. package/.output/public/_nuxt/{CfV2N201.js → Dn_-RkxP.js} +1 -1
  92. package/.output/public/_nuxt/{dg6uXTyR.js → DoDo3VF2.js} +1 -1
  93. package/.output/public/_nuxt/{BMlKQMjM.js → DoVHTl-K.js} +1 -1
  94. package/.output/public/_nuxt/DpM8IgHL.js +1 -0
  95. package/.output/public/_nuxt/{B4NjylBn.js → Dpwj_1H5.js} +1 -1
  96. package/.output/public/_nuxt/{DzJa19LG.js → DvSHenmZ.js} +1 -1
  97. package/.output/public/_nuxt/DvYU87_a.js +1 -0
  98. package/.output/public/_nuxt/{G2J1dVVb.js → Dx41arC8.js} +1 -1
  99. package/.output/public/_nuxt/DxBrlj7b.js +1 -0
  100. package/.output/public/_nuxt/{r-HZNbp3.js → JNpNdV-o.js} +1 -1
  101. package/.output/public/_nuxt/Lz9MmwKY.js +1 -0
  102. package/.output/public/_nuxt/OMI0cmZ0.js +1 -0
  103. package/.output/public/_nuxt/{CUWrUpTl.js → UAmyrRCI.js} +1 -1
  104. package/.output/public/_nuxt/{EJllK0wm.js → VBTxfbqU.js} +1 -1
  105. package/.output/public/_nuxt/VbedPPFH.js +1 -0
  106. package/.output/public/_nuxt/{BY9A1aOT.js → _okd7MfH.js} +1 -1
  107. package/.output/public/_nuxt/{BOn5q0rT.js → bmAf49LT.js} +1 -1
  108. package/.output/public/_nuxt/builds/latest.json +1 -1
  109. package/.output/public/_nuxt/builds/meta/0174ebd8-8fa5-4698-aa79-7a8dd2f6527f.json +1 -0
  110. package/.output/public/_nuxt/{D0XWJGhG.js → e-GZmCeP.js} +1 -1
  111. package/.output/public/_nuxt/entry.Dv52uAyn.css +1 -0
  112. package/.output/public/_nuxt/{DVIIj6Vv.js → f9TbT3AM.js} +1 -1
  113. package/.output/public/_nuxt/gdlHFfN6.js +1 -0
  114. package/.output/public/_nuxt/{BTG_PmM5.js → huBoAZeM.js} +1 -1
  115. package/.output/public/_nuxt/{DadksxQ9.js → mYw4b7uY.js} +1 -1
  116. package/.output/public/_nuxt/{B0eHOux4.js → mi7tdFxN.js} +1 -1
  117. package/.output/public/_nuxt/sFe4Zr5j.js +1 -0
  118. package/.output/public/_nuxt/{CLrLFf3s.js → uspGXbik.js} +1 -1
  119. package/.output/public/_nuxt/{DLN-CQXF.js → w7KxwWEv.js} +1 -1
  120. package/.output/public/_nuxt/{Bp55g9gr.js → wa4k1aDz.js} +1 -1
  121. package/.output/public/_nuxt/{C2yZcDch.js → xuB8n0QL.js} +1 -1
  122. package/.output/public/favicon.ico +0 -0
  123. package/.output/public/trace-viewer/assets/codeMirrorModule-LEHpjmcn.js +32 -0
  124. package/.output/public/trace-viewer/assets/defaultSettingsView-BNmKHKpQ.js +264 -0
  125. package/.output/public/trace-viewer/assets/urlMatch-BYQrIQwR.js +1 -0
  126. package/.output/public/trace-viewer/assets/xtermModule-CsJ4vdCR.js +9 -0
  127. package/.output/public/trace-viewer/codeMirrorModule.DYBRYzYX.css +1 -0
  128. package/.output/public/trace-viewer/codicon.DCmgc-ay.ttf +0 -0
  129. package/.output/public/trace-viewer/defaultSettingsView.CjdS-WJx.css +1 -0
  130. package/.output/public/trace-viewer/index.CzXZzn5A.css +1 -0
  131. package/.output/public/trace-viewer/index.DMMX1gXU.js +2 -0
  132. package/.output/public/trace-viewer/index.html +44 -0
  133. package/.output/public/trace-viewer/manifest.webmanifest +16 -0
  134. package/.output/public/trace-viewer/playwright-logo.svg +9 -0
  135. package/.output/public/trace-viewer/snapshot.html +10 -0
  136. package/.output/public/trace-viewer/snapshot.v8KI4P3m.js +2 -0
  137. package/.output/public/trace-viewer/sw.bundle.js +5 -0
  138. package/.output/public/trace-viewer/uiMode.BZQ54Kgt.css +1 -0
  139. package/.output/public/trace-viewer/uiMode.Ut8wwJNp.js +6 -0
  140. package/.output/public/trace-viewer/uiMode.html +18 -0
  141. package/.output/public/trace-viewer/xtermModule.DYP7pi_n.css +32 -0
  142. package/.output/server/chunks/_/users.mjs +1 -1
  143. package/.output/server/chunks/build/{BreadcrumbNav-DBnGj5Jq.mjs → BreadcrumbNav-Bg4QGX0k.mjs} +11 -4
  144. package/.output/server/chunks/build/BreadcrumbNav-Bg4QGX0k.mjs.map +1 -0
  145. package/.output/server/chunks/build/{BrowserBadge-vFb1ERG_.mjs → BrowserBadge-yMgLTBUu.mjs} +17 -9
  146. package/.output/server/chunks/build/BrowserBadge-yMgLTBUu.mjs.map +1 -0
  147. package/.output/server/chunks/build/{ChartMarkerLines-BXqUpUcs.mjs → ChartMarkerLines-D0cTRlxF.mjs} +3 -3
  148. package/.output/server/chunks/build/ChartMarkerLines-D0cTRlxF.mjs.map +1 -0
  149. package/.output/server/chunks/build/{ChartTooltip-DoF6Smyc.mjs → ChartTooltip-B2t6VYYH.mjs} +3 -3
  150. package/.output/server/chunks/build/ChartTooltip-B2t6VYYH.mjs.map +1 -0
  151. package/.output/server/chunks/build/Checkbox-ChSYhiUz.mjs +1 -1
  152. package/.output/server/chunks/build/ClientDate-U97Z1p6-.mjs +32 -0
  153. package/.output/server/chunks/build/ClientDate-U97Z1p6-.mjs.map +1 -0
  154. package/.output/server/chunks/build/{CodeBlock-CmvKHaq8.mjs → CodeBlock-DuWhmcI2.mjs} +3 -3
  155. package/.output/server/chunks/build/CodeBlock-DuWhmcI2.mjs.map +1 -0
  156. package/.output/server/chunks/build/DashboardSidebarToggle-a5KYecZ0.mjs +1 -1
  157. package/.output/server/chunks/build/DashboardToolbar-BZoGc0ri.mjs +72 -0
  158. package/.output/server/chunks/build/DashboardToolbar-BZoGc0ri.mjs.map +1 -0
  159. package/.output/server/chunks/build/{DataLocationCard-ChV02QJj.mjs → DataLocationCard-DCdhQBIY.mjs} +2 -2
  160. package/.output/server/chunks/build/DataLocationCard-DCdhQBIY.mjs.map +1 -0
  161. package/.output/server/chunks/build/{DesktopRunLocallyButton-BfmbZpiL.mjs → DesktopRunLocallyButton-ChHg3GqK.mjs} +5 -5
  162. package/.output/server/chunks/build/{DesktopRunLocallyButton-BfmbZpiL.mjs.map → DesktopRunLocallyButton-ChHg3GqK.mjs.map} +1 -1
  163. package/.output/server/chunks/build/{DiagnosisPanel-C_ndadzP.mjs → DiagnosisPanel-DE-r2UV8.mjs} +5 -5
  164. package/.output/server/chunks/build/DiagnosisPanel-DE-r2UV8.mjs.map +1 -0
  165. package/.output/server/chunks/build/{DiagnosisResult-GAjo6Lt3.mjs → DiagnosisResult-CrGK--xh.mjs} +16 -10
  166. package/.output/server/chunks/build/DiagnosisResult-CrGK--xh.mjs.map +1 -0
  167. package/.output/server/chunks/build/{DurationValue-CObiBDnH.mjs → DurationValue-Dn06XQk3.mjs} +2 -2
  168. package/.output/server/chunks/build/DurationValue-Dn06XQk3.mjs.map +1 -0
  169. package/.output/server/chunks/build/EntityLinks-BcpvMt_V.mjs +1 -1
  170. package/.output/server/chunks/build/EnvManagedBadge-_8GfjWjE.mjs +1 -1
  171. package/.output/server/chunks/build/{FeatureUnavailable-Buoyoqx1.mjs → FeatureUnavailable-IaBjVCqQ.mjs} +2 -2
  172. package/.output/server/chunks/build/FeatureUnavailable-IaBjVCqQ.mjs.map +1 -0
  173. package/.output/server/chunks/build/{GetStartedWizard-tL3U_qM1.mjs → GetStartedWizard-BiyxEXWP.mjs} +3 -3
  174. package/.output/server/chunks/build/GetStartedWizard-BiyxEXWP.mjs.map +1 -0
  175. package/.output/server/chunks/build/{HelpHint-C96TlqxY.mjs → HelpHint-CdBz6deq.mjs} +2 -2
  176. package/.output/server/chunks/build/HelpHint-CdBz6deq.mjs.map +1 -0
  177. package/.output/server/chunks/build/{MetaStripGroup-Cp2WCQf7.mjs → MetaStripGroup-CDyGlsNt.mjs} +94 -21
  178. package/.output/server/chunks/build/MetaStripGroup-CDyGlsNt.mjs.map +1 -0
  179. package/.output/server/chunks/build/{NavbarActions-VCHW0u67.mjs → NavbarActions-BTWxKCVI.mjs} +2 -2
  180. package/.output/server/chunks/build/NavbarActions-BTWxKCVI.mjs.map +1 -0
  181. package/.output/server/chunks/build/NavigationMenu-D4ZpdCm_.mjs +1 -1
  182. package/.output/server/chunks/build/OpenInIdeLink-Bnl-_som.mjs +1 -1
  183. package/.output/server/chunks/build/{ProjectTestCasesTable-saHYJoyQ.mjs → ProjectTestCasesTable-DJDAZ9NQ.mjs} +9 -9
  184. package/.output/server/chunks/build/ProjectTestCasesTable-DJDAZ9NQ.mjs.map +1 -0
  185. package/.output/server/chunks/build/{RunReports-CKYYRC59.mjs → RunReports-BSo2cCNx.mjs} +4 -4
  186. package/.output/server/chunks/build/RunReports-BSo2cCNx.mjs.map +1 -0
  187. package/.output/server/chunks/build/{RunStatusBadge-CWhmAmKb.mjs → RunStatusBadge-zfeSwcTx.mjs} +2 -2
  188. package/.output/server/chunks/build/RunStatusBadge-zfeSwcTx.mjs.map +1 -0
  189. package/.output/server/chunks/build/{SectionCard-BB1O3uXd.mjs → SectionCard-CKD1s0eF.mjs} +2 -2
  190. package/.output/server/chunks/build/SectionCard-CKD1s0eF.mjs.map +1 -0
  191. package/.output/server/chunks/build/Select-COU8NARj.mjs +1 -1
  192. package/.output/server/chunks/build/SelectMenu-BUwwc3Qt.mjs +1 -1
  193. package/.output/server/chunks/build/{SettingsField-CEasBHu3.mjs → SettingsField-CDnUtiCM.mjs} +3 -3
  194. package/.output/server/chunks/build/SettingsField-CDnUtiCM.mjs.map +1 -0
  195. package/.output/server/chunks/build/Table-BET-DOtX.mjs +1 -1
  196. package/.output/server/chunks/build/{TestCaseHistoryChart-BgI6P_zS.mjs → TestCaseHistoryChart-Do7WK-ZY.mjs} +16 -17
  197. package/.output/server/chunks/build/TestCaseHistoryChart-Do7WK-ZY.mjs.map +1 -0
  198. package/.output/server/chunks/build/{TestStatusBar-DR8jM5th.mjs → TestStatusBar-BipoEOzd.mjs} +15 -6
  199. package/.output/server/chunks/build/TestStatusBar-BipoEOzd.mjs.map +1 -0
  200. package/.output/server/chunks/build/Tooltip-CK0ucuXC.mjs +1 -1
  201. package/.output/server/chunks/build/{_id_-rQhFY0fN.mjs → _id_-BLPB189b.mjs} +16 -16
  202. package/.output/server/chunks/build/{_id_-rQhFY0fN.mjs.map → _id_-BLPB189b.mjs.map} +1 -1
  203. package/.output/server/chunks/build/{_id_-kkexEH_q.mjs → _id_-BeGJOSxY.mjs} +16 -16
  204. package/.output/server/chunks/build/_id_-BeGJOSxY.mjs.map +1 -0
  205. package/.output/server/chunks/build/{_id_-B7Dw490u.mjs → _id_-CfLEW45H.mjs} +472 -304
  206. package/.output/server/chunks/build/_id_-CfLEW45H.mjs.map +1 -0
  207. package/.output/server/chunks/build/{_id_-DVPb1S93.mjs → _id_-DxHe32cW.mjs} +654 -453
  208. package/.output/server/chunks/build/_id_-DxHe32cW.mjs.map +1 -0
  209. package/.output/server/chunks/build/{about-C4AbyQ4q.mjs → about-FLAssVsA.mjs} +5 -5
  210. package/.output/server/chunks/build/about-FLAssVsA.mjs.map +1 -0
  211. package/.output/server/chunks/build/{account-B45bYZd1.mjs → account-Cvz6KkYu.mjs} +4 -4
  212. package/.output/server/chunks/build/account-Cvz6KkYu.mjs.map +1 -0
  213. package/.output/server/chunks/build/{ai-CgN9xXFf.mjs → ai-DR9Zry7B.mjs} +8 -8
  214. package/.output/server/chunks/build/{ai-CgN9xXFf.mjs.map → ai-DR9Zry7B.mjs.map} +1 -1
  215. package/.output/server/chunks/build/{analytics-BRkiUpwa.mjs → analytics-CCAQayhv.mjs} +9 -9
  216. package/.output/server/chunks/build/{analytics-BRkiUpwa.mjs.map → analytics-CCAQayhv.mjs.map} +1 -1
  217. package/.output/server/chunks/build/{auto-heal-BnTdKHQq.mjs → auto-heal-ngiiiVmq.mjs} +4 -4
  218. package/.output/server/chunks/build/auto-heal-ngiiiVmq.mjs.map +1 -0
  219. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  220. package/.output/server/chunks/build/{default-BGOdM_zA.mjs → default-wYpdMMvh.mjs} +15 -13
  221. package/.output/server/chunks/build/{default-BGOdM_zA.mjs.map → default-wYpdMMvh.mjs.map} +1 -1
  222. package/.output/server/chunks/build/{docs-D7R5eJ1Z.mjs → docs-BX9DoKOI.mjs} +4 -4
  223. package/.output/server/chunks/build/{docs-D7R5eJ1Z.mjs.map → docs-BX9DoKOI.mjs.map} +1 -1
  224. package/.output/server/chunks/build/{edit-BbL3k6c3.mjs → edit-DnyBC4uC.mjs} +7 -7
  225. package/.output/server/chunks/build/{edit-BbL3k6c3.mjs.map → edit-DnyBC4uC.mjs.map} +1 -1
  226. package/.output/server/chunks/build/fetch-DOcN2mHf.mjs +1 -1
  227. package/.output/server/chunks/build/{help-content-BK3jcgLw.mjs → help-content-3QLSe6Vd.mjs} +3 -3
  228. package/.output/server/chunks/build/help-content-3QLSe6Vd.mjs.map +1 -0
  229. package/.output/server/chunks/build/{import-ibAn_HB9.mjs → import-S-w3MXez.mjs} +8 -8
  230. package/.output/server/chunks/build/import-S-w3MXez.mjs.map +1 -0
  231. package/.output/server/chunks/build/{index-D5A0DW7Y.mjs → index-BFr7JW_2.mjs} +4 -4
  232. package/.output/server/chunks/build/index-BFr7JW_2.mjs.map +1 -0
  233. package/.output/server/chunks/build/{index-CqinXTVs.mjs → index-CdzYiYiu.mjs} +9 -9
  234. package/.output/server/chunks/build/{index-CqinXTVs.mjs.map → index-CdzYiYiu.mjs.map} +1 -1
  235. package/.output/server/chunks/build/{index-DreB_S-d.mjs → index-CgYJur1z.mjs} +31 -23
  236. package/.output/server/chunks/build/index-CgYJur1z.mjs.map +1 -0
  237. package/.output/server/chunks/build/{index-2GmuPNF-.mjs → index-CjnZ521K.mjs} +22 -4
  238. package/.output/server/chunks/build/index-CjnZ521K.mjs.map +1 -0
  239. package/.output/server/chunks/build/{index-KsRegEjT.mjs → index-xgA4P1ht.mjs} +3218 -4087
  240. package/.output/server/chunks/build/index-xgA4P1ht.mjs.map +1 -0
  241. package/.output/server/chunks/build/isValueEqualOrExist-D4lZ8uRY.mjs +1 -1
  242. package/.output/server/chunks/build/login-DueFS2RU.mjs +1 -1
  243. package/.output/server/chunks/build/{mcp-Dwj29-uG.mjs → mcp-DlZzubUF.mjs} +7 -7
  244. package/.output/server/chunks/build/mcp-DlZzubUF.mjs.map +1 -0
  245. package/.output/server/chunks/build/{notifications-CjAn5FJj.mjs → notifications-ByPVhyPX.mjs} +6 -6
  246. package/.output/server/chunks/build/notifications-ByPVhyPX.mjs.map +1 -0
  247. package/.output/server/chunks/build/{performance-DRzcu_c7.mjs → performance-Dc9FhaJr.mjs} +6 -6
  248. package/.output/server/chunks/build/performance-Dc9FhaJr.mjs.map +1 -0
  249. package/.output/server/chunks/build/{pr-feedback-DR60oGBf.mjs → pr-feedback-5kC_UmKG.mjs} +4 -4
  250. package/.output/server/chunks/build/pr-feedback-5kC_UmKG.mjs.map +1 -0
  251. package/.output/server/chunks/build/{selections-BjjolRZ9.mjs → selections-C6J9mI0s.mjs} +9 -9
  252. package/.output/server/chunks/build/selections-C6J9mI0s.mjs.map +1 -0
  253. package/.output/server/chunks/build/server.mjs +33 -33
  254. package/.output/server/chunks/build/{settings-B3NWV9tu.mjs → settings-DcCAv0U4.mjs} +17 -81
  255. package/.output/server/chunks/build/settings-DcCAv0U4.mjs.map +1 -0
  256. package/.output/server/chunks/build/{settings-metadata-DwJk8uSt.mjs → settings-metadata-B684YiW4.mjs} +2 -2
  257. package/.output/server/chunks/build/settings-metadata-B684YiW4.mjs.map +1 -0
  258. package/.output/server/chunks/build/{setup-BlgFTixN.mjs → setup-Cf3Mzf-W.mjs} +8 -8
  259. package/.output/server/chunks/build/{setup-BlgFTixN.mjs.map → setup-Cf3Mzf-W.mjs.map} +1 -1
  260. package/.output/server/chunks/build/{storage-C1O-FC0U.mjs → storage-B4VySiv3.mjs} +7 -7
  261. package/.output/server/chunks/build/storage-B4VySiv3.mjs.map +1 -0
  262. package/.output/server/chunks/build/{tags-dsvYrnii.mjs → tags-BvWdsd1F.mjs} +25 -11
  263. package/.output/server/chunks/build/tags-BvWdsd1F.mjs.map +1 -0
  264. package/.output/server/chunks/build/{test-cases-CFiOuyK6.mjs → test-cases-LIIu7dMu.mjs} +11 -11
  265. package/.output/server/chunks/build/test-cases-LIIu7dMu.mjs.map +1 -0
  266. package/.output/server/chunks/build/{test-functions-CbmBi6az.mjs → test-functions-Dv8nezrM.mjs} +8 -8
  267. package/.output/server/chunks/build/test-functions-Dv8nezrM.mjs.map +1 -0
  268. package/.output/server/chunks/build/{useCopyRich-DPKZKHvZ.mjs → useCopyRich-DRRKIts2.mjs} +17 -14
  269. package/.output/server/chunks/build/{useCopyRich-DPKZKHvZ.mjs.map → useCopyRich-DRRKIts2.mjs.map} +1 -1
  270. package/.output/server/chunks/build/{useDesktopDownload-R_RWSgUV.mjs → useDesktopDownload-CK-5nATq.mjs} +2 -2
  271. package/.output/server/chunks/build/useDesktopDownload-CK-5nATq.mjs.map +1 -0
  272. package/.output/server/chunks/build/{useDesktopLocalRuns-BdELBy0Y.mjs → useDesktopLocalRuns-BHZic4MJ.mjs} +3 -3
  273. package/.output/server/chunks/build/useDesktopLocalRuns-BHZic4MJ.mjs.map +1 -0
  274. package/.output/server/chunks/build/{useDesktopProjectLink-IUN7SIP2.mjs → useDesktopProjectLink-CqBvnXwG.mjs} +2 -2
  275. package/.output/server/chunks/build/useDesktopProjectLink-CqBvnXwG.mjs.map +1 -0
  276. package/.output/server/chunks/build/useOpenInIde-DS4YXevu.mjs +1 -1
  277. package/.output/server/chunks/build/{useSettingsNav-Dg87E7kY.mjs → useSettingsNav-dyHz-2Bz.mjs} +2 -2
  278. package/.output/server/chunks/build/useSettingsNav-dyHz-2Bz.mjs.map +1 -0
  279. package/.output/server/chunks/build/{users-DgsoiXxQ.mjs → users-CluLB8DL.mjs} +31 -13
  280. package/.output/server/chunks/build/users-CluLB8DL.mjs.map +1 -0
  281. package/.output/server/chunks/nitro/nitro.mjs +839 -680
  282. package/.output/server/chunks/routes/__piwi/session.get.mjs +1 -1
  283. package/.output/server/chunks/routes/api/test-runs/_id/case-files.post.mjs +5 -2
  284. package/.output/server/chunks/routes/api/test-runs/_id/case-files.post.mjs.map +1 -1
  285. package/.output/server/chunks/routes/api/test-runs/_id/events.post.mjs +1 -1
  286. package/.output/server/chunks/routes/api/test-runs/_id/failure-groups.get.mjs +1 -1
  287. package/.output/server/chunks/routes/api/test-runs/_id/finish.post.mjs +42 -26
  288. package/.output/server/chunks/routes/api/test-runs/_id/finish.post.mjs.map +1 -1
  289. package/.output/server/chunks/routes/api/test-runs/_id/gate.post.mjs +1 -1
  290. package/.output/server/chunks/routes/api/test-runs/_id/heartbeat.post.mjs +1 -1
  291. package/.output/server/chunks/routes/api/test-runs/_id/insights.get.mjs +1 -1
  292. package/.output/server/chunks/routes/api/test-runs/_id/network-requests.get.mjs +1 -1
  293. package/.output/server/chunks/routes/api/test-runs/_id/regression-context.get.mjs +1 -1
  294. package/.output/server/chunks/routes/api/test-runs/_id/summary.get.mjs +1 -1
  295. package/.output/server/chunks/routes/api/test-runs/import/check.post.mjs +1 -1
  296. package/.output/server/chunks/routes/api/test-runs/recent.get.mjs +1 -1
  297. package/.output/server/chunks/routes/api/test-runs/submit.post.mjs +1 -1
  298. package/.output/server/chunks/routes/api/test-runs/upload.post.mjs +1 -1
  299. package/.output/server/chunks/routes/api/tests/cleanup.delete.mjs +1 -0
  300. package/.output/server/chunks/routes/api/tests/cleanup.delete.mjs.map +1 -1
  301. package/.output/server/chunks/routes/api/traces/check.post.mjs +1 -1
  302. package/.output/server/chunks/routes/api/users/_id/index.post.mjs +1 -1
  303. package/.output/server/chunks/routes/api/users/_id/invite.post.mjs +1 -1
  304. package/.output/server/chunks/routes/api/users/_id/projects.get.mjs +1 -1
  305. package/.output/server/chunks/routes/api/users/_id/projects.put.mjs +1 -1
  306. package/.output/server/chunks/routes/mcp.post.mjs +1 -1
  307. package/.output/server/chunks/routes/renderer.mjs +1 -1
  308. package/.output/server/chunks/routes/share/_token_.get.mjs +1 -1
  309. package/.output/server/index.mjs +1 -1
  310. package/.output/server/package.json +1 -1
  311. package/package.json +1 -1
  312. package/.output/public/_nuxt/3HmftUHT.js +0 -1
  313. package/.output/public/_nuxt/B7zo6PK8.js +0 -1
  314. package/.output/public/_nuxt/BO4sfkbw.js +0 -1
  315. package/.output/public/_nuxt/BdyXNI2_.js +0 -1
  316. package/.output/public/_nuxt/Bg63qh8W.js +0 -1
  317. package/.output/public/_nuxt/BnhWd06P.js +0 -1
  318. package/.output/public/_nuxt/CHWW6xiX.js +0 -1
  319. package/.output/public/_nuxt/CIPvUOic.js +0 -2
  320. package/.output/public/_nuxt/CVcFbORW.js +0 -9
  321. package/.output/public/_nuxt/CZlz5y13.js +0 -1
  322. package/.output/public/_nuxt/CkV_UG8j.js +0 -1
  323. package/.output/public/_nuxt/D0TpBpCc.js +0 -1
  324. package/.output/public/_nuxt/D3LyIeiJ.js +0 -1
  325. package/.output/public/_nuxt/DcccidY5.js +0 -4
  326. package/.output/public/_nuxt/DqkCbAzo.js +0 -1
  327. package/.output/public/_nuxt/DwH4SIZE.js +0 -1
  328. package/.output/public/_nuxt/DwZS0oRm.js +0 -2
  329. package/.output/public/_nuxt/DxPZIuWy.js +0 -1
  330. package/.output/public/_nuxt/Dyb1FouX.js +0 -1
  331. package/.output/public/_nuxt/builds/meta/a5fb24cc-65e3-4e55-aa12-038fe2de4754.json +0 -1
  332. package/.output/public/_nuxt/entry.BFe0Ua9k.css +0 -1
  333. package/.output/public/_nuxt/i7znB42v.js +0 -1
  334. package/.output/server/chunks/build/BreadcrumbNav-DBnGj5Jq.mjs.map +0 -1
  335. package/.output/server/chunks/build/BrowserBadge-vFb1ERG_.mjs.map +0 -1
  336. package/.output/server/chunks/build/ChartMarkerLines-BXqUpUcs.mjs.map +0 -1
  337. package/.output/server/chunks/build/ChartTooltip-DoF6Smyc.mjs.map +0 -1
  338. package/.output/server/chunks/build/CodeBlock-CmvKHaq8.mjs.map +0 -1
  339. package/.output/server/chunks/build/DataLocationCard-ChV02QJj.mjs.map +0 -1
  340. package/.output/server/chunks/build/DiagnosisPanel-C_ndadzP.mjs.map +0 -1
  341. package/.output/server/chunks/build/DiagnosisResult-GAjo6Lt3.mjs.map +0 -1
  342. package/.output/server/chunks/build/DurationValue-CObiBDnH.mjs.map +0 -1
  343. package/.output/server/chunks/build/FeatureUnavailable-Buoyoqx1.mjs.map +0 -1
  344. package/.output/server/chunks/build/GetStartedWizard-tL3U_qM1.mjs.map +0 -1
  345. package/.output/server/chunks/build/HelpHint-C96TlqxY.mjs.map +0 -1
  346. package/.output/server/chunks/build/MetaStripGroup-Cp2WCQf7.mjs.map +0 -1
  347. package/.output/server/chunks/build/NavbarActions-VCHW0u67.mjs.map +0 -1
  348. package/.output/server/chunks/build/ProjectTestCasesTable-saHYJoyQ.mjs.map +0 -1
  349. package/.output/server/chunks/build/RunReports-CKYYRC59.mjs.map +0 -1
  350. package/.output/server/chunks/build/RunStatusBadge-CWhmAmKb.mjs.map +0 -1
  351. package/.output/server/chunks/build/SectionCard-BB1O3uXd.mjs.map +0 -1
  352. package/.output/server/chunks/build/SettingsField-CEasBHu3.mjs.map +0 -1
  353. package/.output/server/chunks/build/TestCaseHistoryChart-BgI6P_zS.mjs.map +0 -1
  354. package/.output/server/chunks/build/TestStatusBar-DR8jM5th.mjs.map +0 -1
  355. package/.output/server/chunks/build/_id_-B7Dw490u.mjs.map +0 -1
  356. package/.output/server/chunks/build/_id_-DVPb1S93.mjs.map +0 -1
  357. package/.output/server/chunks/build/_id_-kkexEH_q.mjs.map +0 -1
  358. package/.output/server/chunks/build/about-C4AbyQ4q.mjs.map +0 -1
  359. package/.output/server/chunks/build/account-B45bYZd1.mjs.map +0 -1
  360. package/.output/server/chunks/build/auto-heal-BnTdKHQq.mjs.map +0 -1
  361. package/.output/server/chunks/build/help-content-BK3jcgLw.mjs.map +0 -1
  362. package/.output/server/chunks/build/import-ibAn_HB9.mjs.map +0 -1
  363. package/.output/server/chunks/build/index-2GmuPNF-.mjs.map +0 -1
  364. package/.output/server/chunks/build/index-D5A0DW7Y.mjs.map +0 -1
  365. package/.output/server/chunks/build/index-DreB_S-d.mjs.map +0 -1
  366. package/.output/server/chunks/build/index-KsRegEjT.mjs.map +0 -1
  367. package/.output/server/chunks/build/mcp-Dwj29-uG.mjs.map +0 -1
  368. package/.output/server/chunks/build/notifications-CjAn5FJj.mjs.map +0 -1
  369. package/.output/server/chunks/build/performance-DRzcu_c7.mjs.map +0 -1
  370. package/.output/server/chunks/build/pr-feedback-DR60oGBf.mjs.map +0 -1
  371. package/.output/server/chunks/build/selections-BjjolRZ9.mjs.map +0 -1
  372. package/.output/server/chunks/build/settings-B3NWV9tu.mjs.map +0 -1
  373. package/.output/server/chunks/build/settings-metadata-DwJk8uSt.mjs.map +0 -1
  374. package/.output/server/chunks/build/storage-C1O-FC0U.mjs.map +0 -1
  375. package/.output/server/chunks/build/tags-dsvYrnii.mjs.map +0 -1
  376. package/.output/server/chunks/build/test-cases-CFiOuyK6.mjs.map +0 -1
  377. package/.output/server/chunks/build/test-functions-CbmBi6az.mjs.map +0 -1
  378. package/.output/server/chunks/build/useDesktopDownload-R_RWSgUV.mjs.map +0 -1
  379. package/.output/server/chunks/build/useDesktopLocalRuns-BdELBy0Y.mjs.map +0 -1
  380. package/.output/server/chunks/build/useDesktopProjectLink-IUN7SIP2.mjs.map +0 -1
  381. package/.output/server/chunks/build/useSettingsNav-Dg87E7kY.mjs.map +0 -1
  382. package/.output/server/chunks/build/users-DgsoiXxQ.mjs.map +0 -1
@@ -1,34 +1,34 @@
1
- import{r as ne,d as ce,o as p,c as f,b as c,g as x,U as We,h as S,_ as ke,j as _e,a1 as rt,F as j,z as Y,t as w,l as $,v as P,q as it,e as N,f as Q,k as R,B as Tt,i as J,a as ye,M as zt,aq as It,x as Et,J as Pt,m as Lt}from"./BdQ7kfxJ.js";import{a as Be}from"./DTtizz85.js";import{e as Bt,a as Dt}from"./DwZS0oRm.js";import{_ as De}from"./CrsaY0R_.js";import{_ as qt}from"./CK2AMqz_.js";import{_ as Ft}from"./CZ6WR7uw.js";import{_ as Mt}from"./CPrVhXJk.js";import{h as Xe,_ as Nt}from"./Gn1Ns00e.js";import{_ as jt}from"./dg6uXTyR.js";function Ot(t,e=!1){const s=ne(e);try{const i=document.cookie.match(new RegExp(`(?:^|;\\s*)${t}=([^;]*)`));i&&(s.value=i[1]==="true")}catch{}function r(){document.cookie=`${t}=${s.value}; path=/; max-age=31536000; sameSite=lax`}function n(){s.value=!s.value,r()}function o(i){s.value=i,r()}return{folded:s,toggle:n,setFolded:o}}function Ht(t){return Ot(`piwi-summary-fold-${t}`,!1)}const Ut={class:"flex items-center gap-3"},Zt={class:"ml-auto shrink-0"},Vt={key:1,class:"relative"},Qt={class:"absolute top-1 right-1 z-10"},Gt=ce({__name:"FoldableSummary",props:{storageKey:{}},setup(t){const e=t,{folded:s,toggle:r}=Ht(e.storageKey);return(n,o)=>{const i=ke,l=_e;return p(),f("div",null,[c(s)?(p(),f("div",{key:0,class:"border border-gray-200 dark:border-gray-800 rounded-xl p-2.5 shadow-xs cursor-pointer select-none",onClick:o[0]||(o[0]=(...a)=>c(r)&&c(r)(...a))},[x("div",Ut,[We(n.$slots,"folded"),x("div",Zt,[S(i,{name:"i-lucide-chevron-down",class:"size-4 text-gray-400"})])])])):(p(),f("div",Vt,[x("div",Qt,[S(l,{icon:"i-lucide-chevron-up",size:"xs",color:"neutral",variant:"ghost",onClick:c(r),title:"Collapse summary"},null,8,["onClick"])]),We(n.$slots,"default")]))])}}}),zr=Object.assign(Gt,{__name:"FoldableSummary"}),Wt=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp"]),Xt=new Set(["image/png","image/jpeg","image/gif","image/svg+xml","image/webp"]),Kt=new Set([".webm",".mp4",".ogg",".mov"]),Jt=new Set(["video/webm","video/mp4","video/ogg","video/quicktime"]);function Ir(t,e){const s="."+(t.toLowerCase().split(".").pop()||"");return!!(Wt.has(s)||e&&Xt.has(e.toLowerCase()))}function Er(t,e){const s="."+(t.toLowerCase().split(".").pop()||"");return!!(Kt.has(s)||e&&Jt.has(e.toLowerCase()))}function Pr(t){return t.replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"")}const Yt={class:"rounded-lg border border-default overflow-hidden bg-muted min-h-16"},es={key:0,class:"flex items-center gap-2 p-4 text-sm text-gray-500"},ts={key:0,class:"text-sm font-bold text-gray-900 dark:text-white mt-4 mb-0.5 first:mt-0"},ss={key:1,class:"font-semibold text-gray-700 dark:text-gray-200 mt-2 mb-0.5"},ns={key:2,class:"my-1 px-2 py-0.5 rounded bg-yellow-50 dark:bg-yellow-900/20 text-yellow-800 dark:text-yellow-300 italic"},rs={key:3,class:"text-gray-600 dark:text-gray-400 flex gap-1.5"},is={key:4,class:"text-gray-600 dark:text-gray-400"},os={key:5,class:"h-2"},as={key:6,class:"mt-2 px-2 py-0.5 bg-gray-200 dark:bg-gray-700 text-gray-500 dark:text-gray-400 rounded-t text-[10px] uppercase tracking-wide"},ls={key:7,class:"overflow-x-auto bg-gray-50 dark:bg-gray-900/40"},cs=["innerHTML"],us={key:8,class:"h-1 bg-gray-100 dark:bg-gray-800/50 rounded-b mb-2"},ps={key:2,class:"p-3 text-xs text-gray-400 italic"},ds=ce({__name:"MarkdownPreview",props:{text:{},loading:{type:Boolean},maxHeight:{}},setup(t){const e=t;function s(n){const o=[];let i=!1,l="",a=[];for(const d of n.split(`
2
- `))if(!i)d.startsWith("```")?(i=!0,l=d.slice(3).trim(),a=[]):d.startsWith("## ")?o.push({kind:"h2",text:d.slice(3)}):d.startsWith("### ")?o.push({kind:"h3",text:d.slice(4)}):d.startsWith("> ")?o.push({kind:"note",text:d.slice(2)}):d.startsWith("- ")?o.push({kind:"bullet",text:d.slice(2)}):d.trim()===""?o.push({kind:"blank"}):o.push({kind:"text",text:d});else if(d==="```"){const h=a.join(`
3
- `);if(a.length){const{html:m}=Xe(h,l);o.push({kind:"code-start",lang:l||"code"}),o.push({kind:"code-block",html:m}),o.push({kind:"code-end"})}i=!1}else a.push(d);if(i&&a.length){const{html:d}=Xe(a.join(`
4
- `),l);o.push({kind:"code-start",lang:l||"code"}),o.push({kind:"code-block",html:d}),o.push({kind:"code-end"})}return o}const r=P(()=>e.text?s(e.text):[]);return(n,o)=>{const i=ke;return p(),f("div",Yt,[t.loading?(p(),f("div",es,[S(i,{name:"i-lucide-loader-2",class:"size-4 animate-spin"}),o[0]||(o[0]=x("span",null,"Fetching context… (includes SCM diff lookup)",-1))])):c(r).length?(p(),f("div",{key:1,class:"overflow-auto p-3 text-xs font-mono leading-relaxed",style:rt({maxHeight:t.maxHeight??"45vh"})},[(p(!0),f(j,null,Y(c(r),(l,a)=>(p(),f(j,{key:a},[l.kind==="h2"?(p(),f("div",ts,w(l.text),1)):l.kind==="h3"?(p(),f("div",ss,w(l.text),1)):l.kind==="note"?(p(),f("div",ns,w(l.text),1)):l.kind==="bullet"?(p(),f("div",rs,[o[1]||(o[1]=x("span",{class:"text-gray-400 shrink-0"},"·",-1)),x("span",null,w(l.text),1)])):l.kind==="text"?(p(),f("div",is,w(l.text),1)):l.kind==="blank"?(p(),f("div",os)):l.kind==="code-start"?(p(),f("div",as,w(l.lang||"code"),1)):l.kind==="code-block"?(p(),f("div",ls,[x("pre",{class:"hljs px-2 py-1 !bg-transparent whitespace-pre-wrap",innerHTML:l.html},null,8,cs)])):l.kind==="code-end"?(p(),f("div",us)):$("",!0)],64))),128))],4)):(p(),f("div",ps,"No context loaded"))])}}}),ot=Object.assign(ds,{__name:"MarkdownPreview"}),hs=ce({__name:"CopyAiPromptButton",props:{contextEndpoint:{}},setup(t){const e=t,{copy:s,copied:r}=Be(),n=it(),o=ne(!1),i=P(()=>(Tt().app?.baseURL??"/").replace(/\/$/,""));async function l(){o.value=!0;try{const a=await fetch(`${i.value}${e.contextEndpoint}?format=prompt`);if(!a.ok)throw new Error(`Request failed (${a.status})`);s(await a.text(),{toast:"AI prompt copied"})}catch(a){n.add({title:"Could not copy the prompt",description:Bt(a),color:"error"})}finally{o.value=!1}}return(a,d)=>{const h=_e;return p(),N(h,{icon:c(r)?"i-lucide-check":"i-lucide-clipboard-copy",size:"xs",color:"neutral",variant:"outline",loading:c(o),title:"Copy the exact request Piwi would send to the model — to reuse it elsewhere, or to check what it contains",onClick:l},{default:Q(()=>[R(w(c(r)?"Copied":"Copy prompt"),1)]),_:1},8,["icon","loading"])}}}),Lr=Object.assign(hs,{__name:"CopyAiPromptButton"}),Se=[{id:"clusterSummary",label:"Failure cluster summary",short:"Cluster"},{id:"sampleError",label:"Raw error message",short:"Error"},{id:"representativeExecution",label:"Representative execution overview",short:"Execution"},{id:"executionError",label:"Representative execution error",short:"Error"},{id:"runContext",label:"Run context (partial run, parallelism, flaky class)",short:"Run context"},{id:"testAnnotations",label:"Test annotations (@fixme/@flaky …)",short:"Annotations"},{id:"affectedTests",label:"Affected tests",short:"Tests"},{id:"testSource",label:"Test source code",short:"Source"},{id:"sourceFiles",label:"Full source files (suspect + imports)",short:"Files"},{id:"steps",label:"Test steps",short:"Steps"},{id:"failingSteps",label:"Failing steps",short:"Steps"},{id:"aiSteps",label:"AI-step prompts (natural-language intents)",short:"AI steps"},{id:"console",label:"Browser console logs",short:"Console"},{id:"networkRequests",label:"Network requests",short:"Network"},{id:"serverLogs",label:"Backend server logs",short:"Server logs"},{id:"serverTraces",label:"Server traces (spans)",short:"Traces"},{id:"webVitals",label:"Web vitals",short:"Web vitals"},{id:"appState",label:"App state at test end (URL/storage/cookies)",short:"App state"},{id:"ariaSnapshot",label:"ARIA snapshot",short:"ARIA"},{id:"domSnapshot",label:"DOM snapshot from trace (failure time)",short:"DOM"},{id:"screenshots",label:"Screenshots (attached as images)",short:"Screenshots"},{id:"visualDiff",label:"Visual diff vs last passing screenshot",short:"Visual diff"},{id:"browserDistribution",label:"Browser distribution",short:"Browsers"},{id:"recurrenceFlakiness",label:"Recurrence & flakiness",short:"Flakiness"},{id:"baselineComparison",label:"Compared to last pass (duration/vitals/steps)",short:"Baseline"},{id:"environmentDiff",label:"Environment diff vs last pass",short:"Env diff"},{id:"retryProgression",label:"Retry progression (per-attempt errors)",short:"Retries"},{id:"passedPeers",label:"Passing peers in same file",short:"Peers"},{id:"scmInvestigation",label:"SCM diff since last green",short:"SCM diff"},{id:"selectedCommits",label:"Manually selected commits",short:"Commits"},{id:"priorDiagnosis",label:"Prior diagnosis & triage",short:"Prior"},{id:"tracePointers",label:"Trace files",short:"Traces"},{id:"artifacts",label:"Attachments & artifacts (video, HAR)",short:"Artifacts"},{id:"nearestAriaNames",label:"Nearest matching ARIA names from snapshot",short:"Nearest ARIA"},{id:"alreadyGreen",label:"Baseline freshness / already-green check",short:"Already green"},{id:"topSuspectedCommit",label:"Top suspected commit",short:"Top commit"},{id:"failingAction",label:"Failing action from trace parsing",short:"Trace"},{id:"traceCallStack",label:"Full call stack with source (from trace)",short:"Call stack"},{id:"traceNetwork",label:"Network activity from trace (all requests)",short:"Trace net"},{id:"locatorHealing",label:"Alternative locators from prior success",short:"Alt locators"}],at=new Set(Se.map(t=>t.id)),lt=Object.fromEntries(Se.map(t=>[t.id,t.short]));function gs(t){return at.has(t)}function Br(t){const e=new Set;for(const s of t)if(s)for(const r of String(s).matchAll(/\[([a-zA-Z][a-zA-Z0-9]*)]/g))at.has(r[1])&&e.add(r[1]);return[...e]}const fs={class:"rounded-lg border border-default bg-elevated/30 px-2.5 py-2"},ks={key:0,class:"flex items-center gap-2 text-xs text-gray-400"},xs={key:1,class:"flex flex-wrap items-center gap-1.5"},ms={class:"text-xs font-medium text-gray-500 inline-flex items-center gap-1"},bs=["title","onClick"],ys={key:0,class:"text-xs text-gray-400"},ws=ce({__name:"DiagnosisCoverageStrip",props:{sections:{},notApplicable:{},tokenEstimate:{},loading:{type:Boolean}},emits:["view-section","open"],setup(t,{emit:e}){const s=t,r=e,n=P(()=>s.sections.map(l=>({id:l.id,short:lt[l.id]??l.title??l.id,truncated:l.truncated}))),o=P(()=>Math.max(0,Se.length-s.sections.length)),i=P(()=>{const l=s.tokenEstimate;return l?l>=1e3?`${(l/1e3).toFixed(1)}k`:String(l):""});return(l,a)=>{const d=ke,h=De;return p(),f("div",fs,[t.loading&&!t.sections.length?(p(),f("div",ks,[S(d,{name:"i-lucide-loader-circle",class:"size-3.5 animate-spin"}),a[1]||(a[1]=R(" Building context… ",-1))])):(p(),f("div",xs,[x("span",ms,[S(d,{name:"i-lucide-layers",class:"size-3.5"}),a[2]||(a[2]=R(" Context ",-1)),S(h,{topic:"cluster.coverage"})]),(p(!0),f(j,null,Y(c(n),m=>(p(),f("button",{key:m.id,type:"button",class:"inline-flex items-center gap-1 rounded-full border border-default bg-default px-2 py-0.5 text-xs hover:border-primary/50 transition-colors",title:m.truncated?`${m.short} (truncated)`:m.short,onClick:b=>r("view-section",m.id)},[S(d,{name:m.truncated?"i-lucide-scissors":"i-lucide-check",class:J(["size-3",m.truncated?"text-warning":"text-success"])},null,8,["name","class"]),R(" "+w(m.short),1)],8,bs))),128)),c(n).length?$("",!0):(p(),f("span",ys,"No evidence sections yet")),x("button",{type:"button",class:"ml-auto text-xs text-gray-400 hover:text-primary transition-colors whitespace-nowrap",onClick:a[0]||(a[0]=m=>r("open"))},[c(o)?(p(),f(j,{key:0},[R(w(c(o))+" not included · ",1)],64)):$("",!0),c(i)?(p(),f(j,{key:1},[R("~"+w(c(i))+" tokens",1)],64)):$("",!0),S(d,{name:"i-lucide-arrow-right",class:"size-3 inline align-text-bottom"})])]))])}}}),Dr=Object.assign(ws,{__name:"DiagnosisCoverageStrip"}),vs={class:"flex items-center justify-between w-full"},$s={class:"flex items-center gap-2"},_s={class:"font-semibold inline-flex items-center gap-1"},Ss={class:"text-xs text-gray-400"},As={class:"flex items-center gap-1"},Cs={class:"rounded-lg border border-default bg-elevated/30 p-3 mb-4"},Rs={class:"flex items-center justify-between gap-2 mb-2"},Ts={class:"text-xs font-medium text-gray-500 uppercase tracking-wide inline-flex items-center gap-1"},zs={class:"text-xs text-gray-400"},Is={class:"flex flex-wrap gap-1.5"},Es=["title"],Ps={class:"text-xs text-gray-400 mt-2"},Ls={class:"space-y-4"},Bs={class:"text-xs font-medium text-gray-500 uppercase tracking-wide mb-2"},Ds={class:"space-y-2"},qs=["data-section-id"],Fs={key:0,class:"text-center text-gray-400 py-8 text-sm"},Ms=ce({__name:"DiagnosisContextModal",props:{open:{type:Boolean},sections:{},tokenEstimate:{},imageTokenEstimate:{},loading:{type:Boolean},focusSection:{},citedSections:{},notApplicableSections:{}},emits:["update:open","refresh"],setup(t,{emit:e}){const s=t,r=P(()=>{const v=new Map;for(const y of s.sections)v.has(y.id)||v.set(y.id,y);return v}),n=P(()=>new Set(Object.keys(s.notApplicableSections??{}))),o=P(()=>new Set(s.citedSections??[])),i=P(()=>Se.map(v=>{if(n.value.has(v.id))return{id:v.id,short:v.short,label:v.label,state:"notApplicable",cited:o.value.has(v.id)};const y=r.value.get(v.id),L=y?y.truncated?"truncated":"present":"absent";return{id:v.id,short:v.short,label:v.label,state:L,cited:o.value.has(v.id)}})),l=P(()=>{const v={present:0,truncated:0,absent:0,notApplicable:0};for(const y of i.value)v[y.state]++;return v}),a={present:"bg-emerald-500",truncated:"bg-amber-500",absent:"bg-gray-300 dark:bg-gray-600",notApplicable:"bg-purple-400"};function d(v){if(v.state==="notApplicable"){const y=s.notApplicableSections?.[v.id];return`${v.label}: not applicable${y?` — ${y}`:""}`}return`${v.label}: ${v.state}${v.cited?" · cited by the diagnosis":""}`}const h=e,{copy:m,copied:b}=Be(),z=P(()=>{const v=[],y=["clusterSummary","sampleError","representativeExecution","executionError","runContext"],L=["testAnnotations","testSource","steps","failingSteps","console","networkRequests","serverLogs","serverTraces","webVitals","ariaSnapshot"],ee=["recurrenceFlakiness","baselineComparison","retryProgression","passedPeers","browserDistribution","affectedTests"],re=["scmInvestigation","selectedCommits"],te=["priorDiagnosis","tracePointers","artifacts"],q=(E,F)=>{const le=s.sections.filter(Re=>E.includes(Re.id));le.length>0&&v.push({label:F,items:le})};return q(y,"Primary"),q(L,"Test Evidence"),q(ee,"Analysis"),q(re,"SCM"),q(te,"Other"),v}),_=ne(null);ye(()=>[s.open,s.focusSection],async([v,y])=>{if(!v||!y)return;await zt();const L=document.querySelector(`[data-section-id="${y}"]`);L&&(L.scrollIntoView({behavior:"smooth",block:"start"}),_.value=y,setTimeout(()=>{_.value===y&&(_.value=null)},2500))});function H(v){let y=`## ${v.title}`;const L=[];return L.push(`${v.chars} chars`),v.truncated&&L.push("truncated"),v.items!=null&&L.push(`${v.items} items`),L.length&&(y+=` — ${L.join(", ")}`),y}return(v,y)=>{const L=De,ee=_e,re=ke,te=ot,q=qt;return p(),N(q,{open:t.open,title:"Context sent to AI",ui:{content:"max-w-5xl"},"onUpdate:open":y[2]||(y[2]=E=>h("update:open",E))},{header:Q(()=>[x("div",vs,[x("div",$s,[x("span",_s,[y[3]||(y[3]=R(" Context sent to AI ",-1)),S(L,{topic:"cluster.context-preview"})]),x("span",Ss,[R(" ~"+w(t.tokenEstimate)+" tokens",1),t.imageTokenEstimate?(p(),f(j,{key:0},[R(" ("+w(t.tokenEstimate-t.imageTokenEstimate)+" text + "+w(t.imageTokenEstimate)+" image)",1)],64)):$("",!0)])]),x("div",As,[S(ee,{icon:"i-lucide-refresh-cw",size:"xs",color:"neutral",variant:"ghost",loading:t.loading,onClick:y[0]||(y[0]=E=>h("refresh"))},null,8,["loading"]),S(ee,{icon:"i-lucide-x",size:"xs",color:"neutral",variant:"ghost",onClick:y[1]||(y[1]=E=>h("update:open",!1))})])])]),body:Q(()=>[y[7]||(y[7]=x("p",{class:"text-xs text-gray-500 dark:text-gray-400 mb-3"},"Copy individual sections or the full context below.",-1)),x("div",Cs,[x("div",Rs,[x("p",Ts,[y[4]||(y[4]=R(" Data coverage ",-1)),S(L,{topic:"cluster.coverage"})]),x("p",zs,w(c(l).present)+" present · "+w(c(l).truncated)+" truncated · "+w(c(l).absent)+" absent"+w(c(l).notApplicable?` · ${c(l).notApplicable} n/a`:""),1)]),x("div",Is,[(p(!0),f(j,null,Y(c(i),E=>(p(),f("span",{key:E.id,class:J(["inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-xs",[E.cited?"border-primary text-primary":"border-default",E.state==="absent"?"text-gray-400 opacity-70":"",E.state==="notApplicable"?"text-purple-500 border-purple-300 dark:border-purple-700":""]]),title:d(E)},[x("span",{class:J(["size-1.5 rounded-full shrink-0",a[E.state]])},null,2),R(" "+w(E.short)+" ",1),E.cited?(p(),N(re,{key:0,name:"i-lucide-quote",class:"size-2.5 shrink-0"})):$("",!0)],10,Es))),128))]),x("p",Ps,[y[5]||(y[5]=R(" Absent or truncated evidence lowers the diagnosis confidence. ",-1)),S(re,{name:"i-lucide-quote",class:"size-2.5 inline"}),y[6]||(y[6]=R(" marks sections the diagnosis cited. ",-1))])]),x("div",Ls,[(p(!0),f(j,null,Y(c(z),E=>(p(),f("div",{key:E.label},[x("p",Bs,w(E.label),1),x("div",Ds,[(p(!0),f(j,null,Y(E.items,F=>(p(),f("div",{key:F.id,"data-section-id":F.id,class:J(["relative rounded-lg transition-shadow",c(_)===F.id?"ring-2 ring-primary":c(o).has(F.id)?"ring-1 ring-primary/40":""])},[S(te,{text:H(F)+`
1
+ import{r as ne,d as ce,o as p,c as f,b as c,g as x,U as We,h as S,j as $e,_ as _e,a1 as rt,F as j,z as Y,t as w,l as $,v as P,q as it,e as N,f as Q,k as R,B as Tt,i as J,a as be,M as zt,aq as It,x as Et,J as Pt,m as Lt}from"./1QWBzxLM.js";import{a as Be}from"./CU_2YLhT.js";import{e as Bt,a as Dt}from"./D4mPjHHR.js";import{_ as De}from"./B82vqOZe.js";import{_ as qt}from"./CtQMagSz.js";import{_ as Ft}from"./B-1zt4pp.js";import{_ as Mt}from"./DYdwHaco.js";import{h as Xe,_ as Nt}from"./BF5qB58w.js";import{_ as jt}from"./DoDo3VF2.js";function Ot(t,e=!1){const s=ne(e);try{const i=document.cookie.match(new RegExp(`(?:^|;\\s*)${t}=([^;]*)`));i&&(s.value=i[1]==="true")}catch{}function r(){document.cookie=`${t}=${s.value}; path=/; max-age=31536000; sameSite=lax`}function n(){s.value=!s.value,r()}function a(i){s.value=i,r()}return{folded:s,toggle:n,setFolded:a}}function Ht(t){return Ot(`piwi-summary-fold-${t}`,!1)}const Zt={class:"flex items-center gap-3"},Ut={class:"ml-auto shrink-0"},Vt={key:1,class:"relative"},Qt={class:"absolute top-1 right-1 z-10"},Gt=ce({__name:"FoldableSummary",props:{storageKey:{}},setup(t){const e=t,{folded:s,toggle:r}=Ht(e.storageKey);function n(a){a.target?.closest('button, a, input, select, textarea, [role="button"]')||r()}return(a,i)=>{const l=$e;return p(),f("div",null,[c(s)?(p(),f("div",{key:0,class:"border border-gray-200 dark:border-gray-800 rounded-xl p-2.5 shadow-xs cursor-pointer select-none",onClick:n},[x("div",Zt,[We(a.$slots,"folded"),x("div",Ut,[S(l,{icon:"i-lucide-chevron-down",size:"xs",color:"neutral",variant:"ghost",title:"Expand summary","aria-label":"Expand summary","aria-expanded":!1,onClick:c(r)},null,8,["onClick"])])])])):(p(),f("div",Vt,[x("div",Qt,[S(l,{icon:"i-lucide-chevron-up",size:"xs",color:"neutral",variant:"ghost",onClick:c(r),title:"Collapse summary","aria-expanded":"true"},null,8,["onClick"])]),We(a.$slots,"default")]))])}}}),zr=Object.assign(Gt,{__name:"FoldableSummary"}),Wt=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp"]),Xt=new Set(["image/png","image/jpeg","image/gif","image/svg+xml","image/webp"]),Kt=new Set([".webm",".mp4",".ogg",".mov"]),Jt=new Set(["video/webm","video/mp4","video/ogg","video/quicktime"]);function Ir(t,e){const s="."+(t.toLowerCase().split(".").pop()||"");return!!(Wt.has(s)||e&&Xt.has(e.toLowerCase()))}function Er(t,e){const s="."+(t.toLowerCase().split(".").pop()||"");return!!(Kt.has(s)||e&&Jt.has(e.toLowerCase()))}function Pr(t){return t.replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"")}const Yt={class:"rounded-lg border border-default overflow-hidden bg-muted min-h-16"},es={key:0,class:"flex items-center gap-2 p-4 text-sm text-gray-500"},ts={key:0,class:"text-sm font-bold text-gray-900 dark:text-white mt-4 mb-0.5 first:mt-0"},ss={key:1,class:"font-semibold text-gray-700 dark:text-gray-200 mt-2 mb-0.5"},ns={key:2,class:"my-1 px-2 py-0.5 rounded bg-yellow-50 dark:bg-yellow-900/20 text-yellow-800 dark:text-yellow-300 italic"},rs={key:3,class:"text-gray-600 dark:text-gray-400 flex gap-1.5"},is={key:4,class:"text-gray-600 dark:text-gray-400"},as={key:5,class:"h-2"},os={key:6,class:"mt-2 px-2 py-0.5 bg-gray-200 dark:bg-gray-700 text-gray-500 dark:text-gray-400 rounded-t text-[10px] uppercase tracking-wide"},ls={key:7,class:"overflow-x-auto bg-gray-50 dark:bg-gray-900/40"},cs=["innerHTML"],us={key:8,class:"h-1 bg-gray-100 dark:bg-gray-800/50 rounded-b mb-2"},ps={key:2,class:"p-3 text-xs text-gray-400 italic"},ds=ce({__name:"MarkdownPreview",props:{text:{},loading:{type:Boolean},maxHeight:{}},setup(t){const e=t;function s(n){const a=[];let i=!1,l="",o=[];for(const d of n.split(`
2
+ `))if(!i)d.startsWith("```")?(i=!0,l=d.slice(3).trim(),o=[]):d.startsWith("## ")?a.push({kind:"h2",text:d.slice(3)}):d.startsWith("### ")?a.push({kind:"h3",text:d.slice(4)}):d.startsWith("> ")?a.push({kind:"note",text:d.slice(2)}):d.startsWith("- ")?a.push({kind:"bullet",text:d.slice(2)}):d.trim()===""?a.push({kind:"blank"}):a.push({kind:"text",text:d});else if(d==="```"){const h=o.join(`
3
+ `);if(o.length){const{html:m}=Xe(h,l);a.push({kind:"code-start",lang:l||"code"}),a.push({kind:"code-block",html:m}),a.push({kind:"code-end"})}i=!1}else o.push(d);if(i&&o.length){const{html:d}=Xe(o.join(`
4
+ `),l);a.push({kind:"code-start",lang:l||"code"}),a.push({kind:"code-block",html:d}),a.push({kind:"code-end"})}return a}const r=P(()=>e.text?s(e.text):[]);return(n,a)=>{const i=_e;return p(),f("div",Yt,[t.loading?(p(),f("div",es,[S(i,{name:"i-lucide-loader-2",class:"size-4 animate-spin"}),a[0]||(a[0]=x("span",null,"Fetching context… (includes SCM diff lookup)",-1))])):c(r).length?(p(),f("div",{key:1,class:"overflow-auto p-3 text-xs font-mono leading-relaxed",style:rt({maxHeight:t.maxHeight??"45vh"})},[(p(!0),f(j,null,Y(c(r),(l,o)=>(p(),f(j,{key:o},[l.kind==="h2"?(p(),f("div",ts,w(l.text),1)):l.kind==="h3"?(p(),f("div",ss,w(l.text),1)):l.kind==="note"?(p(),f("div",ns,w(l.text),1)):l.kind==="bullet"?(p(),f("div",rs,[a[1]||(a[1]=x("span",{class:"text-gray-400 shrink-0"},"·",-1)),x("span",null,w(l.text),1)])):l.kind==="text"?(p(),f("div",is,w(l.text),1)):l.kind==="blank"?(p(),f("div",as)):l.kind==="code-start"?(p(),f("div",os,w(l.lang||"code"),1)):l.kind==="code-block"?(p(),f("div",ls,[x("pre",{class:"hljs px-2 py-1 !bg-transparent whitespace-pre-wrap",innerHTML:l.html},null,8,cs)])):l.kind==="code-end"?(p(),f("div",us)):$("",!0)],64))),128))],4)):(p(),f("div",ps,"No context loaded"))])}}}),at=Object.assign(ds,{__name:"MarkdownPreview"}),hs=ce({__name:"CopyAiPromptButton",props:{contextEndpoint:{}},setup(t){const e=t,{copy:s,copied:r}=Be(),n=it(),a=ne(!1),i=P(()=>(Tt().app?.baseURL??"/").replace(/\/$/,""));async function l(){a.value=!0;try{const o=await fetch(`${i.value}${e.contextEndpoint}?format=prompt`);if(!o.ok)throw new Error(`Request failed (${o.status})`);s(await o.text(),{toast:"AI prompt copied"})}catch(o){n.add({title:"Could not copy the prompt",description:Bt(o),color:"error"})}finally{a.value=!1}}return(o,d)=>{const h=$e;return p(),N(h,{icon:c(r)?"i-lucide-check":"i-lucide-clipboard-copy",size:"xs",color:"neutral",variant:"outline",loading:c(a),title:"Copy the exact request Piwi would send to the model — to reuse it elsewhere, or to check what it contains",onClick:l},{default:Q(()=>[R(w(c(r)?"Copied":"Copy prompt"),1)]),_:1},8,["icon","loading"])}}}),Lr=Object.assign(hs,{__name:"CopyAiPromptButton"}),Se=[{id:"clusterSummary",label:"Failure cluster summary",short:"Cluster"},{id:"sampleError",label:"Raw error message",short:"Error"},{id:"representativeExecution",label:"Representative execution overview",short:"Execution"},{id:"executionError",label:"Representative execution error",short:"Error"},{id:"runContext",label:"Run context (partial run, parallelism, flaky class)",short:"Run context"},{id:"testAnnotations",label:"Test annotations (@fixme/@flaky …)",short:"Annotations"},{id:"affectedTests",label:"Affected tests",short:"Tests"},{id:"testSource",label:"Test source code",short:"Source"},{id:"sourceFiles",label:"Full source files (suspect + imports)",short:"Files"},{id:"steps",label:"Test steps",short:"Steps"},{id:"failingSteps",label:"Failing steps",short:"Steps"},{id:"aiSteps",label:"AI-step prompts (natural-language intents)",short:"AI steps"},{id:"console",label:"Browser console logs",short:"Console"},{id:"networkRequests",label:"Network requests",short:"Network"},{id:"serverLogs",label:"Backend server logs",short:"Server logs"},{id:"serverTraces",label:"Server traces (spans)",short:"Traces"},{id:"webVitals",label:"Web vitals",short:"Web vitals"},{id:"appState",label:"App state at test end (URL/storage/cookies)",short:"App state"},{id:"ariaSnapshot",label:"ARIA snapshot",short:"ARIA"},{id:"domSnapshot",label:"DOM snapshot from trace (failure time)",short:"DOM"},{id:"screenshots",label:"Screenshots (attached as images)",short:"Screenshots"},{id:"visualDiff",label:"Visual diff vs last passing screenshot",short:"Visual diff"},{id:"browserDistribution",label:"Browser distribution",short:"Browsers"},{id:"recurrenceFlakiness",label:"Recurrence & flakiness",short:"Flakiness"},{id:"baselineComparison",label:"Compared to last pass (duration/vitals/steps)",short:"Baseline"},{id:"environmentDiff",label:"Environment diff vs last pass",short:"Env diff"},{id:"retryProgression",label:"Retry progression (per-attempt errors)",short:"Retries"},{id:"passedPeers",label:"Passing peers in same file",short:"Peers"},{id:"scmInvestigation",label:"SCM diff since last green",short:"SCM diff"},{id:"selectedCommits",label:"Manually selected commits",short:"Commits"},{id:"priorDiagnosis",label:"Prior diagnosis & triage",short:"Prior"},{id:"tracePointers",label:"Trace files",short:"Traces"},{id:"artifacts",label:"Attachments & artifacts (video, HAR)",short:"Artifacts"},{id:"nearestAriaNames",label:"Nearest matching ARIA names from snapshot",short:"Nearest ARIA"},{id:"alreadyGreen",label:"Baseline freshness / already-green check",short:"Already green"},{id:"topSuspectedCommit",label:"Top suspected commit",short:"Top commit"},{id:"failingAction",label:"Failing action from trace parsing",short:"Trace"},{id:"traceCallStack",label:"Full call stack with source (from trace)",short:"Call stack"},{id:"traceNetwork",label:"Network activity from trace (all requests)",short:"Trace net"},{id:"locatorHealing",label:"Alternative locators from prior success",short:"Alt locators"}],ot=new Set(Se.map(t=>t.id)),lt=Object.fromEntries(Se.map(t=>[t.id,t.short]));function gs(t){return ot.has(t)}function Br(t){const e=new Set;for(const s of t)if(s)for(const r of String(s).matchAll(/\[([a-zA-Z][a-zA-Z0-9]*)]/g))ot.has(r[1])&&e.add(r[1]);return[...e]}const fs={class:"rounded-lg border border-default bg-elevated/30 px-2.5 py-2"},ks={key:0,class:"flex items-center gap-2 text-xs text-gray-400"},xs={key:1,class:"flex flex-wrap items-center gap-1.5"},ms={class:"text-xs font-medium text-gray-500 inline-flex items-center gap-1"},bs=["title","onClick"],ys={key:0,class:"text-xs text-gray-400"},ws=ce({__name:"DiagnosisCoverageStrip",props:{sections:{},notApplicable:{},tokenEstimate:{},loading:{type:Boolean}},emits:["view-section","open"],setup(t,{emit:e}){const s=t,r=e,n=P(()=>s.sections.map(l=>({id:l.id,short:lt[l.id]??l.title??l.id,truncated:l.truncated}))),a=P(()=>Math.max(0,Se.length-s.sections.length)),i=P(()=>{const l=s.tokenEstimate;return l?l>=1e3?`${(l/1e3).toFixed(1)}k`:String(l):""});return(l,o)=>{const d=_e,h=De;return p(),f("div",fs,[t.loading&&!t.sections.length?(p(),f("div",ks,[S(d,{name:"i-lucide-loader-circle",class:"size-3.5 animate-spin"}),o[1]||(o[1]=R(" Building context… ",-1))])):(p(),f("div",xs,[x("span",ms,[S(d,{name:"i-lucide-layers",class:"size-3.5"}),o[2]||(o[2]=R(" Context ",-1)),S(h,{topic:"cluster.coverage"})]),(p(!0),f(j,null,Y(c(n),m=>(p(),f("button",{key:m.id,type:"button",class:"inline-flex items-center gap-1 rounded-full border border-default bg-default px-2 py-0.5 text-xs hover:border-primary/50 transition-colors",title:m.truncated?`${m.short} (truncated)`:m.short,onClick:b=>r("view-section",m.id)},[S(d,{name:m.truncated?"i-lucide-scissors":"i-lucide-check",class:J(["size-3",m.truncated?"text-warning":"text-success"])},null,8,["name","class"]),R(" "+w(m.short),1)],8,bs))),128)),c(n).length?$("",!0):(p(),f("span",ys,"No evidence sections yet")),x("button",{type:"button",class:"ml-auto text-xs text-gray-400 hover:text-primary transition-colors whitespace-nowrap",onClick:o[0]||(o[0]=m=>r("open"))},[c(a)?(p(),f(j,{key:0},[R(w(c(a))+" not included · ",1)],64)):$("",!0),c(i)?(p(),f(j,{key:1},[R("~"+w(c(i))+" tokens",1)],64)):$("",!0),S(d,{name:"i-lucide-arrow-right",class:"size-3 inline align-text-bottom"})])]))])}}}),Dr=Object.assign(ws,{__name:"DiagnosisCoverageStrip"}),vs={class:"flex items-center justify-between w-full"},$s={class:"flex items-center gap-2"},_s={class:"font-semibold inline-flex items-center gap-1"},Ss={class:"text-xs text-gray-400"},Cs={class:"flex items-center gap-1"},As={class:"rounded-lg border border-default bg-elevated/30 p-3 mb-4"},Rs={class:"flex items-center justify-between gap-2 mb-2"},Ts={class:"text-xs font-medium text-gray-500 uppercase tracking-wide inline-flex items-center gap-1"},zs={class:"text-xs text-gray-400"},Is={class:"flex flex-wrap gap-1.5"},Es=["title"],Ps={class:"text-xs text-gray-400 mt-2"},Ls={class:"space-y-4"},Bs={class:"text-xs font-medium text-gray-500 uppercase tracking-wide mb-2"},Ds={class:"space-y-2"},qs=["data-section-id"],Fs={key:0,class:"text-center text-gray-400 py-8 text-sm"},Ms=ce({__name:"DiagnosisContextModal",props:{open:{type:Boolean},sections:{},tokenEstimate:{},imageTokenEstimate:{},loading:{type:Boolean},focusSection:{},citedSections:{},notApplicableSections:{}},emits:["update:open","refresh"],setup(t,{emit:e}){const s=t,r=P(()=>{const v=new Map;for(const y of s.sections)v.has(y.id)||v.set(y.id,y);return v}),n=P(()=>new Set(Object.keys(s.notApplicableSections??{}))),a=P(()=>new Set(s.citedSections??[])),i=P(()=>Se.map(v=>{if(n.value.has(v.id))return{id:v.id,short:v.short,label:v.label,state:"notApplicable",cited:a.value.has(v.id)};const y=r.value.get(v.id),L=y?y.truncated?"truncated":"present":"absent";return{id:v.id,short:v.short,label:v.label,state:L,cited:a.value.has(v.id)}})),l=P(()=>{const v={present:0,truncated:0,absent:0,notApplicable:0};for(const y of i.value)v[y.state]++;return v}),o={present:"bg-emerald-500",truncated:"bg-amber-500",absent:"bg-gray-300 dark:bg-gray-600",notApplicable:"bg-purple-400"};function d(v){if(v.state==="notApplicable"){const y=s.notApplicableSections?.[v.id];return`${v.label}: not applicable${y?` — ${y}`:""}`}return`${v.label}: ${v.state}${v.cited?" · cited by the diagnosis":""}`}const h=e,{copy:m,copied:b}=Be(),z=P(()=>{const v=[],y=["clusterSummary","sampleError","representativeExecution","executionError","runContext"],L=["testAnnotations","testSource","steps","failingSteps","console","networkRequests","serverLogs","serverTraces","webVitals","ariaSnapshot"],ee=["recurrenceFlakiness","baselineComparison","retryProgression","passedPeers","browserDistribution","affectedTests"],re=["scmInvestigation","selectedCommits"],te=["priorDiagnosis","tracePointers","artifacts"],q=(E,F)=>{const le=s.sections.filter(Re=>E.includes(Re.id));le.length>0&&v.push({label:F,items:le})};return q(y,"Primary"),q(L,"Test Evidence"),q(ee,"Analysis"),q(re,"SCM"),q(te,"Other"),v}),_=ne(null);be(()=>[s.open,s.focusSection],async([v,y])=>{if(!v||!y)return;await zt();const L=document.querySelector(`[data-section-id="${y}"]`);L&&(L.scrollIntoView({behavior:"smooth",block:"start"}),_.value=y,setTimeout(()=>{_.value===y&&(_.value=null)},2500))});function H(v){let y=`## ${v.title}`;const L=[];return L.push(`${v.chars} chars`),v.truncated&&L.push("truncated"),v.items!=null&&L.push(`${v.items} items`),L.length&&(y+=` — ${L.join(", ")}`),y}return(v,y)=>{const L=De,ee=$e,re=_e,te=at,q=qt;return p(),N(q,{open:t.open,title:"Context sent to AI",ui:{content:"max-w-5xl"},"onUpdate:open":y[2]||(y[2]=E=>h("update:open",E))},{header:Q(()=>[x("div",vs,[x("div",$s,[x("span",_s,[y[3]||(y[3]=R(" Context sent to AI ",-1)),S(L,{topic:"cluster.context-preview"})]),x("span",Ss,[R(" ~"+w(t.tokenEstimate)+" tokens",1),t.imageTokenEstimate?(p(),f(j,{key:0},[R(" ("+w(t.tokenEstimate-t.imageTokenEstimate)+" text + "+w(t.imageTokenEstimate)+" image)",1)],64)):$("",!0)])]),x("div",Cs,[S(ee,{icon:"i-lucide-refresh-cw",size:"xs",color:"neutral",variant:"ghost",loading:t.loading,onClick:y[0]||(y[0]=E=>h("refresh"))},null,8,["loading"]),S(ee,{icon:"i-lucide-x",size:"xs",color:"neutral",variant:"ghost",onClick:y[1]||(y[1]=E=>h("update:open",!1))})])])]),body:Q(()=>[y[7]||(y[7]=x("p",{class:"text-xs text-gray-500 dark:text-gray-400 mb-3"},"Copy individual sections or the full context below.",-1)),x("div",As,[x("div",Rs,[x("p",Ts,[y[4]||(y[4]=R(" Data coverage ",-1)),S(L,{topic:"cluster.coverage"})]),x("p",zs,w(c(l).present)+" present · "+w(c(l).truncated)+" truncated · "+w(c(l).absent)+" absent"+w(c(l).notApplicable?` · ${c(l).notApplicable} n/a`:""),1)]),x("div",Is,[(p(!0),f(j,null,Y(c(i),E=>(p(),f("span",{key:E.id,class:J(["inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-xs",[E.cited?"border-primary text-primary":"border-default",E.state==="absent"?"text-gray-400 opacity-70":"",E.state==="notApplicable"?"text-purple-500 border-purple-300 dark:border-purple-700":""]]),title:d(E)},[x("span",{class:J(["size-1.5 rounded-full shrink-0",o[E.state]])},null,2),R(" "+w(E.short)+" ",1),E.cited?(p(),N(re,{key:0,name:"i-lucide-quote",class:"size-2.5 shrink-0"})):$("",!0)],10,Es))),128))]),x("p",Ps,[y[5]||(y[5]=R(" Absent or truncated evidence lowers the diagnosis confidence. ",-1)),S(re,{name:"i-lucide-quote",class:"size-2.5 inline"}),y[6]||(y[6]=R(" marks sections the diagnosis cited. ",-1))])]),x("div",Ls,[(p(!0),f(j,null,Y(c(z),E=>(p(),f("div",{key:E.label},[x("p",Bs,w(E.label),1),x("div",Ds,[(p(!0),f(j,null,Y(E.items,F=>(p(),f("div",{key:F.id,"data-section-id":F.id,class:J(["relative rounded-lg transition-shadow",c(_)===F.id?"ring-2 ring-primary":c(a).has(F.id)?"ring-1 ring-primary/40":""])},[S(te,{text:H(F)+`
5
5
 
6
- `+F.markdown},null,8,["text"]),S(ee,{icon:c(b)?"i-lucide-check":"i-lucide-clipboard",size:"xs",color:"neutral",variant:"ghost",class:"absolute top-1 right-1",onClick:le=>c(m)(F.markdown)},null,8,["icon","onClick"])],10,qs))),128))])]))),128)),t.sections.length===0&&!t.loading?(p(),f("div",Fs," No context sections available. ")):$("",!0)])]),_:1},8,["open"])}}}),qr=Object.assign(Ms,{__name:"DiagnosisContextModal"});function qe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ae=qe();function ct(t){ae=t}var ie={exec:()=>null};function A(t,e=""){let s=typeof t=="string"?t:t.source,r={replace:(n,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace(O.caret,"$1"),s=s.replace(n,i),r},getRegex:()=>new RegExp(s,e)};return r}var Ns=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),O={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},js=/^(?:[ \t]*(?:\n|$))+/,Os=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Hs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,xe=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Us=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Fe=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ut=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,pt=A(ut).replace(/bull/g,Fe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Zs=A(ut).replace(/bull/g,Fe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Me=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Vs=/^[^\n]+/,Ne=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Qs=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ne).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gs=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Fe).getRegex(),Ae="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",je=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ws=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",je).replace("tag",Ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),dt=A(Me).replace("hr",xe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ae).getRegex(),Xs=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",dt).getRegex(),Oe={blockquote:Xs,code:Os,def:Qs,fences:Hs,heading:Us,hr:xe,html:Ws,lheading:pt,list:Gs,newline:js,paragraph:dt,table:ie,text:Vs},Ke=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",xe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ae).getRegex(),Ks={...Oe,lheading:Zs,table:Ke,paragraph:A(Me).replace("hr",xe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ke).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ae).getRegex()},Js={...Oe,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",je).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ie,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(Me).replace("hr",xe).replace("heading",` *#{1,6} *[^
7
- ]`).replace("lheading",pt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ys=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,en=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ht=/^( {2,}|\\)\n(?!\s*$)/,tn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ue=/[\p{P}\p{S}]/u,Ce=/[\s\p{P}\p{S}]/u,He=/[^\s\p{P}\p{S}]/u,sn=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ce).getRegex(),gt=/(?!~)[\p{P}\p{S}]/u,nn=/(?!~)[\s\p{P}\p{S}]/u,rn=/(?:[^\s\p{P}\p{S}]|~)/u,on=A(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ns?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ft=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,an=A(ft,"u").replace(/punct/g,ue).getRegex(),ln=A(ft,"u").replace(/punct/g,gt).getRegex(),kt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",cn=A(kt,"gu").replace(/notPunctSpace/g,He).replace(/punctSpace/g,Ce).replace(/punct/g,ue).getRegex(),un=A(kt,"gu").replace(/notPunctSpace/g,rn).replace(/punctSpace/g,nn).replace(/punct/g,gt).getRegex(),pn=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,He).replace(/punctSpace/g,Ce).replace(/punct/g,ue).getRegex(),dn=A(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ue).getRegex(),hn="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",gn=A(hn,"gu").replace(/notPunctSpace/g,He).replace(/punctSpace/g,Ce).replace(/punct/g,ue).getRegex(),fn=A(/\\(punct)/,"gu").replace(/punct/g,ue).getRegex(),kn=A(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),xn=A(je).replace("(?:-->|$)","-->").getRegex(),mn=A("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",xn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),we=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,bn=A(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",we).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xt=A(/^!?\[(label)\]\[(ref)\]/).replace("label",we).replace("ref",Ne).getRegex(),mt=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ne).getRegex(),yn=A("reflink|nolink(?!\\()","g").replace("reflink",xt).replace("nolink",mt).getRegex(),Je=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ue={_backpedal:ie,anyPunctuation:fn,autolink:kn,blockSkip:on,br:ht,code:en,del:ie,delLDelim:ie,delRDelim:ie,emStrongLDelim:an,emStrongRDelimAst:cn,emStrongRDelimUnd:pn,escape:Ys,link:bn,nolink:mt,punctuation:sn,reflink:xt,reflinkSearch:yn,tag:mn,text:tn,url:ie},wn={...Ue,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",we).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",we).getRegex()},Ee={...Ue,emStrongRDelimAst:un,emStrongLDelim:ln,delLDelim:dn,delRDelim:gn,url:A(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Je).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:A(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Je).getRegex()},vn={...Ee,br:A(ht).replace("{2,}","*").getRegex(),text:A(Ee.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},be={normal:Oe,gfm:Ks,pedantic:Js},he={normal:Ue,gfm:Ee,breaks:vn,pedantic:wn},$n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ye=t=>$n[t];function K(t,e){if(e){if(O.escapeTest.test(t))return t.replace(O.escapeReplace,Ye)}else if(O.escapeTestNoEncode.test(t))return t.replace(O.escapeReplaceNoEncode,Ye);return t}function et(t){try{t=encodeURI(t).replace(O.percentDecode,"%")}catch{return null}return t}function tt(t,e){let s=t.replace(O.findPipe,(o,i,l)=>{let a=!1,d=i;for(;--d>=0&&l[d]==="\\";)a=!a;return a?"|":" |"}),r=s.split(O.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(O.slashPipe,"|");return r}function ge(t,e,s){let r=t.length;if(r===0)return"";let n=0;for(;n<r&&t.charAt(r-n-1)===e;)n++;return t.slice(0,r-n)}function _n(t,e){if(t.indexOf(e[1])===-1)return-1;let s=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])s++;else if(t[r]===e[1]&&(s--,s<0))return r;return s>0?-2:-1}function Sn(t,e=0){let s=e,r="";for(let n of t)if(n===" "){let o=4-s%4;r+=" ".repeat(o),s+=o}else r+=n,s++;return r}function st(t,e,s,r,n){let o=e.href,i=e.title||null,l=t[1].replace(n.other.outputLinkReplace,"$1");r.state.inLink=!0;let a={type:t[0].charAt(0)==="!"?"image":"link",raw:s,href:o,title:i,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}function An(t,e,s){let r=t.match(s.other.indentCodeCompensation);if(r===null)return e;let n=r[1];return e.split(`
8
- `).map(o=>{let i=o.match(s.other.beginningSpace);if(i===null)return o;let[l]=i;return l.length>=n.length?o.slice(n.length):o}).join(`
9
- `)}var ve=class{options;rules;lexer;constructor(t){this.options=t||ae}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let s=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?s:ge(s,`
10
- `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let s=e[0],r=An(s,e[3]||"",this.rules);return{type:"code",raw:s,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let s=e[2].trim();if(this.rules.other.endingHash.test(s)){let r=ge(s,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(s=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:ge(e[0],`
6
+ `+F.markdown},null,8,["text"]),S(ee,{icon:c(b)?"i-lucide-check":"i-lucide-clipboard",size:"xs",color:"neutral",variant:"ghost",class:"absolute top-1 right-1",onClick:le=>c(m)(F.markdown)},null,8,["icon","onClick"])],10,qs))),128))])]))),128)),t.sections.length===0&&!t.loading?(p(),f("div",Fs," No context sections available. ")):$("",!0)])]),_:1},8,["open"])}}}),qr=Object.assign(Ms,{__name:"DiagnosisContextModal"});function qe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var oe=qe();function ct(t){oe=t}var ie={exec:()=>null};function C(t,e=""){let s=typeof t=="string"?t:t.source,r={replace:(n,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(O.caret,"$1"),s=s.replace(n,i),r},getRegex:()=>new RegExp(s,e)};return r}var Ns=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),O={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},js=/^(?:[ \t]*(?:\n|$))+/,Os=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Hs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ke=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Zs=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Fe=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ut=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,pt=C(ut).replace(/bull/g,Fe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Us=C(ut).replace(/bull/g,Fe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Me=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Vs=/^[^\n]+/,Ne=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Qs=C(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ne).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gs=C(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Fe).getRegex(),Ce="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",je=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ws=C("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",je).replace("tag",Ce).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),dt=C(Me).replace("hr",ke).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ce).getRegex(),Xs=C(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",dt).getRegex(),Oe={blockquote:Xs,code:Os,def:Qs,fences:Hs,heading:Zs,hr:ke,html:Ws,lheading:pt,list:Gs,newline:js,paragraph:dt,table:ie,text:Vs},Ke=C("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ke).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ce).getRegex(),Ks={...Oe,lheading:Us,table:Ke,paragraph:C(Me).replace("hr",ke).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ke).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ce).getRegex()},Js={...Oe,html:C(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",je).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ie,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:C(Me).replace("hr",ke).replace("heading",` *#{1,6} *[^
7
+ ]`).replace("lheading",pt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ys=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,en=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ht=/^( {2,}|\\)\n(?!\s*$)/,tn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ue=/[\p{P}\p{S}]/u,Ae=/[\s\p{P}\p{S}]/u,He=/[^\s\p{P}\p{S}]/u,sn=C(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ae).getRegex(),gt=/(?!~)[\p{P}\p{S}]/u,nn=/(?!~)[\s\p{P}\p{S}]/u,rn=/(?:[^\s\p{P}\p{S}]|~)/u,an=C(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ns?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ft=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,on=C(ft,"u").replace(/punct/g,ue).getRegex(),ln=C(ft,"u").replace(/punct/g,gt).getRegex(),kt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",cn=C(kt,"gu").replace(/notPunctSpace/g,He).replace(/punctSpace/g,Ae).replace(/punct/g,ue).getRegex(),un=C(kt,"gu").replace(/notPunctSpace/g,rn).replace(/punctSpace/g,nn).replace(/punct/g,gt).getRegex(),pn=C("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,He).replace(/punctSpace/g,Ae).replace(/punct/g,ue).getRegex(),dn=C(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ue).getRegex(),hn="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",gn=C(hn,"gu").replace(/notPunctSpace/g,He).replace(/punctSpace/g,Ae).replace(/punct/g,ue).getRegex(),fn=C(/\\(punct)/,"gu").replace(/punct/g,ue).getRegex(),kn=C(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),xn=C(je).replace("(?:-->|$)","-->").getRegex(),mn=C("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",xn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ye=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,bn=C(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ye).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xt=C(/^!?\[(label)\]\[(ref)\]/).replace("label",ye).replace("ref",Ne).getRegex(),mt=C(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ne).getRegex(),yn=C("reflink|nolink(?!\\()","g").replace("reflink",xt).replace("nolink",mt).getRegex(),Je=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ze={_backpedal:ie,anyPunctuation:fn,autolink:kn,blockSkip:an,br:ht,code:en,del:ie,delLDelim:ie,delRDelim:ie,emStrongLDelim:on,emStrongRDelimAst:cn,emStrongRDelimUnd:pn,escape:Ys,link:bn,nolink:mt,punctuation:sn,reflink:xt,reflinkSearch:yn,tag:mn,text:tn,url:ie},wn={...Ze,link:C(/^!?\[(label)\]\((.*?)\)/).replace("label",ye).getRegex(),reflink:C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ye).getRegex()},Ee={...Ze,emStrongRDelimAst:un,emStrongLDelim:ln,delLDelim:dn,delRDelim:gn,url:C(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Je).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:C(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Je).getRegex()},vn={...Ee,br:C(ht).replace("{2,}","*").getRegex(),text:C(Ee.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},me={normal:Oe,gfm:Ks,pedantic:Js},he={normal:Ze,gfm:Ee,breaks:vn,pedantic:wn},$n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ye=t=>$n[t];function K(t,e){if(e){if(O.escapeTest.test(t))return t.replace(O.escapeReplace,Ye)}else if(O.escapeTestNoEncode.test(t))return t.replace(O.escapeReplaceNoEncode,Ye);return t}function et(t){try{t=encodeURI(t).replace(O.percentDecode,"%")}catch{return null}return t}function tt(t,e){let s=t.replace(O.findPipe,(a,i,l)=>{let o=!1,d=i;for(;--d>=0&&l[d]==="\\";)o=!o;return o?"|":" |"}),r=s.split(O.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(O.slashPipe,"|");return r}function ge(t,e,s){let r=t.length;if(r===0)return"";let n=0;for(;n<r&&t.charAt(r-n-1)===e;)n++;return t.slice(0,r-n)}function _n(t,e){if(t.indexOf(e[1])===-1)return-1;let s=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])s++;else if(t[r]===e[1]&&(s--,s<0))return r;return s>0?-2:-1}function Sn(t,e=0){let s=e,r="";for(let n of t)if(n===" "){let a=4-s%4;r+=" ".repeat(a),s+=a}else r+=n,s++;return r}function st(t,e,s,r,n){let a=e.href,i=e.title||null,l=t[1].replace(n.other.outputLinkReplace,"$1");r.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:s,href:a,title:i,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,o}function Cn(t,e,s){let r=t.match(s.other.indentCodeCompensation);if(r===null)return e;let n=r[1];return e.split(`
8
+ `).map(a=>{let i=a.match(s.other.beginningSpace);if(i===null)return a;let[l]=i;return l.length>=n.length?a.slice(n.length):a}).join(`
9
+ `)}var we=class{options;rules;lexer;constructor(t){this.options=t||oe}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let s=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?s:ge(s,`
10
+ `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let s=e[0],r=Cn(s,e[3]||"",this.rules);return{type:"code",raw:s,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let s=e[2].trim();if(this.rules.other.endingHash.test(s)){let r=ge(s,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(s=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:ge(e[0],`
11
11
  `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let s=ge(e[0],`
12
12
  `).split(`
13
- `),r="",n="",o=[];for(;s.length>0;){let i=!1,l=[],a;for(a=0;a<s.length;a++)if(this.rules.other.blockquoteStart.test(s[a]))l.push(s[a]),i=!0;else if(!i)l.push(s[a]);else break;s=s.slice(a);let d=l.join(`
13
+ `),r="",n="",a=[];for(;s.length>0;){let i=!1,l=[],o;for(o=0;o<s.length;o++)if(this.rules.other.blockquoteStart.test(s[o]))l.push(s[o]),i=!0;else if(!i)l.push(s[o]);else break;s=s.slice(o);let d=l.join(`
14
14
  `),h=d.replace(this.rules.other.blockquoteSetextReplace,`
15
15
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
16
16
  ${d}`:d,n=n?`${n}
17
- ${h}`:h;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,o,!0),this.lexer.state.top=m,s.length===0)break;let b=o.at(-1);if(b?.type==="code")break;if(b?.type==="blockquote"){let z=b,_=z.raw+`
17
+ ${h}`:h;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,a,!0),this.lexer.state.top=m,s.length===0)break;let b=a.at(-1);if(b?.type==="code")break;if(b?.type==="blockquote"){let z=b,_=z.raw+`
18
18
  `+s.join(`
19
- `),H=this.blockquote(_);o[o.length-1]=H,r=r.substring(0,r.length-z.raw.length)+H.raw,n=n.substring(0,n.length-z.text.length)+H.text;break}else if(b?.type==="list"){let z=b,_=z.raw+`
19
+ `),H=this.blockquote(_);a[a.length-1]=H,r=r.substring(0,r.length-z.raw.length)+H.raw,n=n.substring(0,n.length-z.text.length)+H.text;break}else if(b?.type==="list"){let z=b,_=z.raw+`
20
20
  `+s.join(`
21
- `),H=this.list(_);o[o.length-1]=H,r=r.substring(0,r.length-b.raw.length)+H.raw,n=n.substring(0,n.length-z.raw.length)+H.raw,s=_.substring(o.at(-1).raw.length).split(`
22
- `);continue}}return{type:"blockquote",raw:r,tokens:o,text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){let s=e[1].trim(),r=s.length>1,n={type:"list",raw:"",ordered:r,start:r?+s.slice(0,-1):"",loose:!1,items:[]};s=r?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=r?s:"[*+-]");let o=this.rules.other.listItemRegex(s),i=!1;for(;t;){let a=!1,d="",h="";if(!(e=o.exec(t))||this.rules.block.hr.test(t))break;d=e[0],t=t.substring(d.length);let m=Sn(e[2].split(`
21
+ `),H=this.list(_);a[a.length-1]=H,r=r.substring(0,r.length-b.raw.length)+H.raw,n=n.substring(0,n.length-z.raw.length)+H.raw,s=_.substring(a.at(-1).raw.length).split(`
22
+ `);continue}}return{type:"blockquote",raw:r,tokens:a,text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){let s=e[1].trim(),r=s.length>1,n={type:"list",raw:"",ordered:r,start:r?+s.slice(0,-1):"",loose:!1,items:[]};s=r?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=r?s:"[*+-]");let a=this.rules.other.listItemRegex(s),i=!1;for(;t;){let o=!1,d="",h="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;d=e[0],t=t.substring(d.length);let m=Sn(e[2].split(`
23
23
  `,1)[0],e[1].length),b=t.split(`
24
24
  `,1)[0],z=!m.trim(),_=0;if(this.options.pedantic?(_=2,h=m.trimStart()):z?_=e[1].length+1:(_=m.search(this.rules.other.nonSpaceChar),_=_>4?1:_,h=m.slice(_),_+=e[1].length),z&&this.rules.other.blankLine.test(b)&&(d+=b+`
25
- `,t=t.substring(b.length+1),a=!0),!a){let H=this.rules.other.nextBulletRegex(_),v=this.rules.other.hrRegex(_),y=this.rules.other.fencesBeginRegex(_),L=this.rules.other.headingBeginRegex(_),ee=this.rules.other.htmlBeginRegex(_),re=this.rules.other.blockquoteBeginRegex(_);for(;t;){let te=t.split(`
25
+ `,t=t.substring(b.length+1),o=!0),!o){let H=this.rules.other.nextBulletRegex(_),v=this.rules.other.hrRegex(_),y=this.rules.other.fencesBeginRegex(_),L=this.rules.other.headingBeginRegex(_),ee=this.rules.other.htmlBeginRegex(_),re=this.rules.other.blockquoteBeginRegex(_);for(;t;){let te=t.split(`
26
26
  `,1)[0],q;if(b=te,this.options.pedantic?(b=b.replace(this.rules.other.listReplaceNesting," "),q=b):q=b.replace(this.rules.other.tabCharGlobal," "),y.test(b)||L.test(b)||ee.test(b)||re.test(b)||H.test(b)||v.test(b))break;if(q.search(this.rules.other.nonSpaceChar)>=_||!b.trim())h+=`
27
27
  `+q.slice(_);else{if(z||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(m)||L.test(m)||v.test(m))break;h+=`
28
28
  `+b}z=!b.trim(),d+=te+`
29
- `,t=t.substring(te.length+1),m=q.slice(_)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(i=!0)),n.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),n.raw+=d}let l=n.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let a of n.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}}let d=this.rules.other.listTaskCheckbox.exec(a.raw);if(d){let h={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};a.checked=h.checked,n.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=h.raw+a.tokens[0].raw,a.tokens[0].text=h.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(h)):a.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):a.tokens.unshift(h)}}if(!n.loose){let d=a.tokens.filter(m=>m.type==="space"),h=d.length>0&&d.some(m=>this.rules.other.anyLine.test(m.raw));n.loose=h}}if(n.loose)for(let a of n.items){a.loose=!0;for(let d of a.tokens)d.type==="text"&&(d.type="paragraph")}return n}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let s=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:s,raw:e[0],href:r,title:n}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let s=tt(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
30
- `):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(s.length===r.length){for(let i of r)this.rules.other.tableAlignRight.test(i)?o.align.push("right"):this.rules.other.tableAlignCenter.test(i)?o.align.push("center"):this.rules.other.tableAlignLeft.test(i)?o.align.push("left"):o.align.push(null);for(let i=0;i<s.length;i++)o.header.push({text:s[i],tokens:this.lexer.inline(s[i]),header:!0,align:o.align[i]});for(let i of n)o.rows.push(tt(i,o.header.length).map((l,a)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[a]})));return o}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let s=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:s,tokens:this.lexer.inline(s)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let s=e[1].charAt(e[1].length-1)===`
31
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:s,tokens:this.lexer.inline(s)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let o=ge(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{let o=_n(e[2],"()");if(o===-2)return;if(o>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let r=e[2],n="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],n=o[3])}else n=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?r=r.slice(1):r=r.slice(1,-1)),st(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let s;if((s=this.rules.inline.reflink.exec(t))||(s=this.rules.inline.nolink.exec(t))){let r=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[r.toLowerCase()];if(!n){let o=s[0].charAt(0);return{type:"text",raw:o,text:o}}return st(s,n,s[0],this.lexer,this.rules)}}emStrong(t,e,s=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&s.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!s||this.rules.inline.punctuation.exec(s))){let n=[...r[0]].length-1,o,i,l=n,a=0,d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+n);(r=d.exec(e))!==null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=[...o].length,r[3]||r[4]){l+=i;continue}else if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l+a);let h=[...r[0]][0].length,m=t.slice(0,n+r.index+h+i);if(Math.min(n,i)%2){let z=m.slice(1,-1);return{type:"em",raw:m,text:z,tokens:this.lexer.inlineTokens(z)}}let b=m.slice(2,-2);return{type:"strong",raw:m,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let s=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(s),n=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return r&&n&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:e[0],text:s}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,s=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!s||this.rules.inline.punctuation.exec(s))){let n=[...r[0]].length-1,o,i,l=n,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*t.length+n);(r=a.exec(e))!==null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o||(i=[...o].length,i!==n))continue;if(r[3]||r[4]){l+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l);let d=[...r[0]][0].length,h=t.slice(0,n+r.index+d+i),m=h.slice(n,-n);return{type:"del",raw:h,text:m,tokens:this.lexer.inlineTokens(m)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let s,r;return e[2]==="@"?(s=e[1],r="mailto:"+s):(s=e[1],r=s),{type:"link",raw:e[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let s,r;if(e[2]==="@")s=e[0],r="mailto:"+s;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);s=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let s=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:s}}}},G=class Pe{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ae,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let s={other:O,block:be.normal,inline:he.normal};this.options.pedantic?(s.block=be.pedantic,s.inline=he.pedantic):this.options.gfm&&(s.block=be.gfm,this.options.breaks?s.inline=he.breaks:s.inline=he.gfm),this.tokenizer.rules=s}static get rules(){return{block:be,inline:he}}static lex(e,s){return new Pe(s).lex(e)}static lexInline(e,s){return new Pe(s).inlineTokens(e)}lex(e){e=e.replace(O.carriageReturn,`
29
+ `,t=t.substring(te.length+1),m=q.slice(_)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(i=!0)),n.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),n.raw+=d}let l=n.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let o of n.items){if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),o.task){if(o.text=o.text.replace(this.rules.other.listReplaceTask,""),o.tokens[0]?.type==="text"||o.tokens[0]?.type==="paragraph"){o.tokens[0].raw=o.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),o.tokens[0].text=o.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}}let d=this.rules.other.listTaskCheckbox.exec(o.raw);if(d){let h={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};o.checked=h.checked,n.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=h.raw+o.tokens[0].raw,o.tokens[0].text=h.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(h)):o.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):o.tokens.unshift(h)}}if(!n.loose){let d=o.tokens.filter(m=>m.type==="space"),h=d.length>0&&d.some(m=>this.rules.other.anyLine.test(m.raw));n.loose=h}}if(n.loose)for(let o of n.items){o.loose=!0;for(let d of o.tokens)d.type==="text"&&(d.type="paragraph")}return n}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let s=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:s,raw:e[0],href:r,title:n}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let s=tt(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
30
+ `):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(s.length===r.length){for(let i of r)this.rules.other.tableAlignRight.test(i)?a.align.push("right"):this.rules.other.tableAlignCenter.test(i)?a.align.push("center"):this.rules.other.tableAlignLeft.test(i)?a.align.push("left"):a.align.push(null);for(let i=0;i<s.length;i++)a.header.push({text:s[i],tokens:this.lexer.inline(s[i]),header:!0,align:a.align[i]});for(let i of n)a.rows.push(tt(i,a.header.length).map((l,o)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[o]})));return a}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let s=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:s,tokens:this.lexer.inline(s)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let s=e[1].charAt(e[1].length-1)===`
31
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:s,tokens:this.lexer.inline(s)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let a=ge(s.slice(0,-1),"\\");if((s.length-a.length)%2===0)return}else{let a=_n(e[2],"()");if(a===-2)return;if(a>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let r=e[2],n="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],n=a[3])}else n=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?r=r.slice(1):r=r.slice(1,-1)),st(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let s;if((s=this.rules.inline.reflink.exec(t))||(s=this.rules.inline.nolink.exec(t))){let r=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[r.toLowerCase()];if(!n){let a=s[0].charAt(0);return{type:"text",raw:a,text:a}}return st(s,n,s[0],this.lexer,this.rules)}}emStrong(t,e,s=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&s.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!s||this.rules.inline.punctuation.exec(s))){let n=[...r[0]].length-1,a,i,l=n,o=0,d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+n);(r=d.exec(e))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(i=[...a].length,r[3]||r[4]){l+=i;continue}else if((r[5]||r[6])&&n%3&&!((n+i)%3)){o+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l+o);let h=[...r[0]][0].length,m=t.slice(0,n+r.index+h+i);if(Math.min(n,i)%2){let z=m.slice(1,-1);return{type:"em",raw:m,text:z,tokens:this.lexer.inlineTokens(z)}}let b=m.slice(2,-2);return{type:"strong",raw:m,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let s=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(s),n=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return r&&n&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:e[0],text:s}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,s=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!s||this.rules.inline.punctuation.exec(s))){let n=[...r[0]].length-1,a,i,l=n,o=this.rules.inline.delRDelim;for(o.lastIndex=0,e=e.slice(-1*t.length+n);(r=o.exec(e))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a||(i=[...a].length,i!==n))continue;if(r[3]||r[4]){l+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l);let d=[...r[0]][0].length,h=t.slice(0,n+r.index+d+i),m=h.slice(n,-n);return{type:"del",raw:h,text:m,tokens:this.lexer.inlineTokens(m)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let s,r;return e[2]==="@"?(s=e[1],r="mailto:"+s):(s=e[1],r=s),{type:"link",raw:e[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let s,r;if(e[2]==="@")s=e[0],r="mailto:"+s;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);s=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let s=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:s}}}},G=class Pe{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||oe,this.options.tokenizer=this.options.tokenizer||new we,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let s={other:O,block:me.normal,inline:he.normal};this.options.pedantic?(s.block=me.pedantic,s.inline=he.pedantic):this.options.gfm&&(s.block=me.gfm,this.options.breaks?s.inline=he.breaks:s.inline=he.gfm),this.tokenizer.rules=s}static get rules(){return{block:me,inline:he}}static lex(e,s){return new Pe(s).lex(e)}static lexInline(e,s){return new Pe(s).inlineTokens(e)}lex(e){e=e.replace(O.carriageReturn,`
32
32
  `),this.blockTokens(e,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let r=this.inlineQueue[s];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,s=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(O.tabCharGlobal," ").replace(O.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(i=>(n=i.call({lexer:this},e,s))?(e=e.substring(n.raw.length),s.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let i=s.at(-1);n.raw.length===1&&i!==void 0?i.raw+=`
33
33
  `:s.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let i=s.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
34
34
  `)?"":`
@@ -36,44 +36,44 @@ ${h}`:h;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
36
36
  `+n.text,this.inlineQueue.at(-1).src=i.text):s.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),s.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),s.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),s.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),s.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),s.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),s.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let i=s.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
37
37
  `)?"":`
38
38
  `)+n.raw,i.text+=`
39
- `+n.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},s.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),s.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),s.push(n);continue}let o=e;if(this.options.extensions?.startBlock){let i=1/0,l=e.slice(1),a;this.options.extensions.startBlock.forEach(d=>{a=d.call({lexer:this},l),typeof a=="number"&&a>=0&&(i=Math.min(i,a))}),i<1/0&&i>=0&&(o=e.substring(0,i+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o))){let i=s.at(-1);r&&i?.type==="paragraph"?(i.raw+=(i.raw.endsWith(`
39
+ `+n.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},s.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),s.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),s.push(n);continue}let a=e;if(this.options.extensions?.startBlock){let i=1/0,l=e.slice(1),o;this.options.extensions.startBlock.forEach(d=>{o=d.call({lexer:this},l),typeof o=="number"&&o>=0&&(i=Math.min(i,o))}),i<1/0&&i>=0&&(a=e.substring(0,i+1))}if(this.state.top&&(n=this.tokenizer.paragraph(a))){let i=s.at(-1);r&&i?.type==="paragraph"?(i.raw+=(i.raw.endsWith(`
40
40
  `)?"":`
41
41
  `)+n.raw,i.text+=`
42
- `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):s.push(n),r=o.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let i=s.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
42
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):s.push(n),r=a.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let i=s.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
43
43
  `)?"":`
44
44
  `)+n.raw,i.text+=`
45
- `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):s.push(n);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,s}inline(e,s=[]){return this.inlineQueue.push({src:e,tokens:s}),s}inlineTokens(e,s=[]){this.tokenizer.lexer=this;let r=e,n=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)a.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,n.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)o=n[2]?n[2].length:0,r=r.slice(0,n.index+o)+"["+"a".repeat(n[0].length-o-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let i=!1,l="";for(;e;){i||(l=""),i=!1;let a;if(this.options.extensions?.inline?.some(h=>(a=h.call({lexer:this},e,s))?(e=e.substring(a.raw.length),s.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let h=s.at(-1);a.type==="text"&&h?.type==="text"?(h.raw+=a.raw,h.text+=a.text):s.push(a);continue}if(a=this.tokenizer.emStrong(e,r,l)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.del(e,r,l)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),s.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),s.push(a);continue}let d=e;if(this.options.extensions?.startInline){let h=1/0,m=e.slice(1),b;this.options.extensions.startInline.forEach(z=>{b=z.call({lexer:this},m),typeof b=="number"&&b>=0&&(h=Math.min(h,b))}),h<1/0&&h>=0&&(d=e.substring(0,h+1))}if(a=this.tokenizer.inlineText(d)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(l=a.raw.slice(-1)),i=!0;let h=s.at(-1);h?.type==="text"?(h.raw+=a.raw,h.text+=a.text):s.push(a);continue}if(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return s}},$e=class{options;parser;constructor(t){this.options=t||ae}space(t){return""}code({text:t,lang:e,escaped:s}){let r=(e||"").match(O.notSpaceStart)?.[0],n=t.replace(O.endingNewline,"")+`
45
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):s.push(n);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,s}inline(e,s=[]){return this.inlineQueue.push({src:e,tokens:s}),s}inlineTokens(e,s=[]){this.tokenizer.lexer=this;let r=e,n=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)o.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,n.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)a=n[2]?n[2].length:0,r=r.slice(0,n.index+a)+"["+"a".repeat(n[0].length-a-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let i=!1,l="";for(;e;){i||(l=""),i=!1;let o;if(this.options.extensions?.inline?.some(h=>(o=h.call({lexer:this},e,s))?(e=e.substring(o.raw.length),s.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let h=s.at(-1);o.type==="text"&&h?.type==="text"?(h.raw+=o.raw,h.text+=o.text):s.push(o);continue}if(o=this.tokenizer.emStrong(e,r,l)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.del(e,r,l)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),s.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),s.push(o);continue}let d=e;if(this.options.extensions?.startInline){let h=1/0,m=e.slice(1),b;this.options.extensions.startInline.forEach(z=>{b=z.call({lexer:this},m),typeof b=="number"&&b>=0&&(h=Math.min(h,b))}),h<1/0&&h>=0&&(d=e.substring(0,h+1))}if(o=this.tokenizer.inlineText(d)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(l=o.raw.slice(-1)),i=!0;let h=s.at(-1);h?.type==="text"?(h.raw+=o.raw,h.text+=o.text):s.push(o);continue}if(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return s}},ve=class{options;parser;constructor(t){this.options=t||oe}space(t){return""}code({text:t,lang:e,escaped:s}){let r=(e||"").match(O.notSpaceStart)?.[0],n=t.replace(O.endingNewline,"")+`
46
46
  `;return r?'<pre><code class="language-'+K(r)+'">'+(s?n:K(n,!0))+`</code></pre>
47
47
  `:"<pre><code>"+(s?n:K(n,!0))+`</code></pre>
48
48
  `}blockquote({tokens:t}){return`<blockquote>
49
49
  ${this.parser.parse(t)}</blockquote>
50
50
  `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
51
51
  `}hr(t){return`<hr>
52
- `}list(t){let e=t.ordered,s=t.start,r="";for(let i=0;i<t.items.length;i++){let l=t.items[i];r+=this.listitem(l)}let n=e?"ol":"ul",o=e&&s!==1?' start="'+s+'"':"";return"<"+n+o+`>
52
+ `}list(t){let e=t.ordered,s=t.start,r="";for(let i=0;i<t.items.length;i++){let l=t.items[i];r+=this.listitem(l)}let n=e?"ol":"ul",a=e&&s!==1?' start="'+s+'"':"";return"<"+n+a+`>
53
53
  `+r+"</"+n+`>
54
54
  `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
55
55
  `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
56
- `}table(t){let e="",s="";for(let n=0;n<t.header.length;n++)s+=this.tablecell(t.header[n]);e+=this.tablerow({text:s});let r="";for(let n=0;n<t.rows.length;n++){let o=t.rows[n];s="";for(let i=0;i<o.length;i++)s+=this.tablecell(o[i]);r+=this.tablerow({text:s})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
56
+ `}table(t){let e="",s="";for(let n=0;n<t.header.length;n++)s+=this.tablecell(t.header[n]);e+=this.tablerow({text:s});let r="";for(let n=0;n<t.rows.length;n++){let a=t.rows[n];s="";for(let i=0;i<a.length;i++)s+=this.tablecell(a[i]);r+=this.tablerow({text:s})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
57
57
  <thead>
58
58
  `+e+`</thead>
59
59
  `+r+`</table>
60
60
  `}tablerow({text:t}){return`<tr>
61
61
  ${t}</tr>
62
62
  `}tablecell(t){let e=this.parser.parseInline(t.tokens),s=t.header?"th":"td";return(t.align?`<${s} align="${t.align}">`:`<${s}>`)+e+`</${s}>
63
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${K(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:s}){let r=this.parser.parseInline(s),n=et(t);if(n===null)return r;t=n;let o='<a href="'+t+'"';return e&&(o+=' title="'+K(e)+'"'),o+=">"+r+"</a>",o}image({href:t,title:e,text:s,tokens:r}){r&&(s=this.parser.parseInline(r,this.parser.textRenderer));let n=et(t);if(n===null)return K(s);t=n;let o=`<img src="${t}" alt="${K(s)}"`;return e&&(o+=` title="${K(e)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:K(t.text)}},Ze=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},W=class Le{options;renderer;textRenderer;constructor(e){this.options=e||ae,this.options.renderer=this.options.renderer||new $e,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ze}static parse(e,s){return new Le(s).parse(e)}static parseInline(e,s){return new Le(s).parseInline(e)}parse(e){this.renderer.parser=this;let s="";for(let r=0;r<e.length;r++){let n=e[r];if(this.options.extensions?.renderers?.[n.type]){let i=n,l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){s+=l||"";continue}}let o=n;switch(o.type){case"space":{s+=this.renderer.space(o);break}case"hr":{s+=this.renderer.hr(o);break}case"heading":{s+=this.renderer.heading(o);break}case"code":{s+=this.renderer.code(o);break}case"table":{s+=this.renderer.table(o);break}case"blockquote":{s+=this.renderer.blockquote(o);break}case"list":{s+=this.renderer.list(o);break}case"checkbox":{s+=this.renderer.checkbox(o);break}case"html":{s+=this.renderer.html(o);break}case"def":{s+=this.renderer.def(o);break}case"paragraph":{s+=this.renderer.paragraph(o);break}case"text":{s+=this.renderer.text(o);break}default:{let i='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return s}parseInline(e,s=this.renderer){this.renderer.parser=this;let r="";for(let n=0;n<e.length;n++){let o=e[n];if(this.options.extensions?.renderers?.[o.type]){let l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){r+=l||"";continue}}let i=o;switch(i.type){case"escape":{r+=s.text(i);break}case"html":{r+=s.html(i);break}case"link":{r+=s.link(i);break}case"image":{r+=s.image(i);break}case"checkbox":{r+=s.checkbox(i);break}case"strong":{r+=s.strong(i);break}case"em":{r+=s.em(i);break}case"codespan":{r+=s.codespan(i);break}case"br":{r+=s.br(i);break}case"del":{r+=s.del(i);break}case"text":{r+=s.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},fe=class{options;block;constructor(t){this.options=t||ae}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?G.lex:G.lexInline}provideParser(t=this.block){return t?W.parse:W.parseInline}},bt=class{defaults=qe();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=W;Renderer=$e;TextRenderer=Ze;Lexer=G;Tokenizer=ve;Hooks=fe;constructor(...t){this.use(...t)}walkTokens(t,e){let s=[];for(let r of t)switch(s=s.concat(e.call(this,r)),r.type){case"table":{let n=r;for(let o of n.header)s=s.concat(this.walkTokens(o.tokens,e));for(let o of n.rows)for(let i of o)s=s.concat(this.walkTokens(i.tokens,e));break}case"list":{let n=r;s=s.concat(this.walkTokens(n.items,e));break}default:{let n=r;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(o=>{let i=n[o].flat(1/0);s=s.concat(this.walkTokens(i,e))}):n.tokens&&(s=s.concat(this.walkTokens(n.tokens,e)))}}return s}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(s=>{let r={...s};if(r.async=this.defaults.async||r.async||!1,s.extensions&&(s.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let o=e.renderers[n.name];o?e.renderers[n.name]=function(...i){let l=n.renderer.apply(this,i);return l===!1&&(l=o.apply(this,i)),l}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=e[n.level];o?o.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),r.extensions=e),s.renderer){let n=this.defaults.renderer||new $e(this.defaults);for(let o in s.renderer){if(!(o in n))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let i=o,l=s.renderer[i],a=n[i];n[i]=(...d)=>{let h=l.apply(n,d);return h===!1&&(h=a.apply(n,d)),h||""}}r.renderer=n}if(s.tokenizer){let n=this.defaults.tokenizer||new ve(this.defaults);for(let o in s.tokenizer){if(!(o in n))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let i=o,l=s.tokenizer[i],a=n[i];n[i]=(...d)=>{let h=l.apply(n,d);return h===!1&&(h=a.apply(n,d)),h}}r.tokenizer=n}if(s.hooks){let n=this.defaults.hooks||new fe;for(let o in s.hooks){if(!(o in n))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let i=o,l=s.hooks[i],a=n[i];fe.passThroughHooks.has(o)?n[i]=d=>{if(this.defaults.async&&fe.passThroughHooksRespectAsync.has(o))return(async()=>{let m=await l.call(n,d);return a.call(n,m)})();let h=l.call(n,d);return a.call(n,h)}:n[i]=(...d)=>{if(this.defaults.async)return(async()=>{let m=await l.apply(n,d);return m===!1&&(m=await a.apply(n,d)),m})();let h=l.apply(n,d);return h===!1&&(h=a.apply(n,d)),h}}r.hooks=n}if(s.walkTokens){let n=this.defaults.walkTokens,o=s.walkTokens;r.walkTokens=function(i){let l=[];return l.push(o.call(this,i)),n&&(l=l.concat(n.call(this,i))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return G.lex(t,e??this.defaults)}parser(t,e){return W.parse(t,e??this.defaults)}parseMarkdown(t){return(e,s)=>{let r={...s},n={...this.defaults,...r},o=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&r.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return(async()=>{let i=n.hooks?await n.hooks.preprocess(e):e,l=await(n.hooks?await n.hooks.provideLexer(t):t?G.lex:G.lexInline)(i,n),a=n.hooks?await n.hooks.processAllTokens(l):l;n.walkTokens&&await Promise.all(this.walkTokens(a,n.walkTokens));let d=await(n.hooks?await n.hooks.provideParser(t):t?W.parse:W.parseInline)(a,n);return n.hooks?await n.hooks.postprocess(d):d})().catch(o);try{n.hooks&&(e=n.hooks.preprocess(e));let i=(n.hooks?n.hooks.provideLexer(t):t?G.lex:G.lexInline)(e,n);n.hooks&&(i=n.hooks.processAllTokens(i)),n.walkTokens&&this.walkTokens(i,n.walkTokens);let l=(n.hooks?n.hooks.provideParser(t):t?W.parse:W.parseInline)(i,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(i){return o(i)}}}onError(t,e){return s=>{if(s.message+=`
64
- Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+K(s.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(s);throw s}}},oe=new bt;function T(t,e){return oe.parse(t,e)}T.options=T.setOptions=function(t){return oe.setOptions(t),T.defaults=oe.defaults,ct(T.defaults),T};T.getDefaults=qe;T.defaults=ae;T.use=function(...t){return oe.use(...t),T.defaults=oe.defaults,ct(T.defaults),T};T.walkTokens=function(t,e){return oe.walkTokens(t,e)};T.parseInline=oe.parseInline;T.Parser=W;T.parser=W.parse;T.Renderer=$e;T.TextRenderer=Ze;T.Lexer=G;T.lexer=G.lex;T.Tokenizer=ve;T.Hooks=fe;T.parse=T;T.options;T.setOptions;T.use;T.walkTokens;T.parseInline;W.parse;G.lex;function B(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}const Cn=/^(?:https?:|mailto:|tel:|[/#?]|[^a-z0-9+.-]|$)/i;function nt(t){return Cn.test(t.trim().replace(/[-]/g,""))}function yt(t){return new bt({renderer:{html:e=>B(typeof e=="string"?e:e.text),link:e=>{const s=B(e.text||e.href);return t==="text"||!nt(e.href)?e.text&&e.text!==e.href?`${s} (${B(e.href)})`:s:`<a href="${B(e.href)}">${s}</a>`},image:e=>t==="text"||!nt(e.href)?B(e.text||e.href):`<img src="${B(e.href)}" alt="${B(e.text??"")}">`}})}yt("anchor");yt("text");const Rn=Symbol("clusterSectionLocator");function Tn(){return It(Rn,{canLocate:()=>!1,open:()=>{}})}const zn={class:"space-y-3"},In={key:2,class:"space-y-3 rounded-lg border border-default p-4 bg-elevated/30"},En={class:"flex items-start gap-3"},Pn=["title"],Ln={class:"relative size-12"},Bn={viewBox:"0 0 36 36",class:"size-12 -rotate-90"},Dn=["stroke-dasharray"],qn={class:"absolute inset-0 flex items-center justify-center text-xs font-semibold"},Fn={class:"flex-1 min-w-0"},Mn={class:"flex items-start justify-between gap-2"},Nn={class:"flex flex-wrap items-center gap-1.5"},jn={key:4,class:"text-xs text-gray-500 inline-flex items-center gap-1"},On={class:"flex items-center gap-1 shrink-0"},Hn={key:0,class:"text-sm font-medium mt-1.5"},Un={key:0,class:"text-sm text-gray-600 dark:text-gray-400"},Zn={key:1,class:"space-y-1"},Vn={class:"flex flex-wrap items-baseline gap-x-1.5 gap-y-1"},Qn=["title","onClick"],Gn=["title","onClick"],Wn={key:2},Xn={class:"text-sm text-gray-600 dark:text-gray-400"},Kn={key:1,class:"mt-2"},Jn={class:"flex items-center justify-between mb-1"},Yn={class:"flex items-center gap-1.5"},er={class:"flex items-center gap-1"},tr={key:0,class:"text-xs text-rose-600 dark:text-rose-400 mt-1"},sr={key:2,class:"mt-2"},nr={key:3,class:"space-y-1.5"},rr={class:"flex items-center gap-1"},ir={key:0,class:"space-y-1.5"},or={class:"flex items-center gap-1.5"},ar={key:1,class:"flex items-center gap-1.5 flex-1 min-w-0"},lr={class:"h-1.5 flex-1 max-w-24 rounded-full bg-gray-200 dark:bg-gray-700 overflow-hidden"},cr={class:"text-xs text-gray-400 shrink-0"},ur={key:0,class:"text-sm text-gray-600 dark:text-gray-400 mt-1"},pr={class:"space-y-1"},dr=["onClick"],hr={key:5,class:"space-y-1"},gr={class:"flex items-start justify-between gap-3 pt-1 border-t border-default"},fr={class:"flex items-start gap-2"},kr={class:"flex items-center gap-1 shrink-0 pt-0.5"},xr={key:0,class:"flex items-start gap-1.5"},mr={class:"flex items-center gap-1.5 text-xs text-gray-400 shrink-0 pt-0.5"},br={key:3,class:"flex flex-col items-center justify-center p-8 text-center text-gray-400 border border-dashed border-default rounded-lg"},yr=ce({__name:"DiagnosisResult",props:{diagnosis:{},lastSeenRunId:{}},emits:["view-section","prefill-context"],setup(t,{emit:e}){const s=t,{copy:r,copied:n}=Be(),o=Tn(),i=P(()=>s.diagnosis?.details);function l(u,g){return u==null&&g==null?"":`${u??0} in / ${g??0} out tokens`}function a(u){return u.status==="running"&&Date.now()-new Date(u.updatedAt).getTime()>300*1e3}const d=ne(!1),h=ne(!1),m=ne(!1),b=ne(null),z=ne(void 0),_=Pt(new Set);ye(()=>s.diagnosis?.id,()=>_.clear()),ye(()=>s.diagnosis?.feedback,u=>{b.value=u??null},{immediate:!0}),ye(()=>s.diagnosis?.feedbackNote,u=>{z.value=u??void 0},{immediate:!0});async function H(u){if(!s.diagnosis)return;const g=b.value===u?null:u;b.value=g,g||(m.value=!1),d.value=!0;try{await $fetch(`/api/failure-diagnoses/${s.diagnosis.id}/feedback`,{method:"PATCH",body:{feedback:g,feedbackNote:z.value||null}})}catch{b.value=s.diagnosis.feedback??null}finally{d.value=!1}}async function v(){if(s.diagnosis){h.value=!0;try{await $fetch(`/api/failure-diagnoses/${s.diagnosis.id}/feedback`,{method:"PATCH",body:{feedback:b.value,feedbackNote:z.value||null}}),m.value=!1}catch{}finally{h.value=!1}}}const y=P(()=>{const u=s.diagnosis;return!u||u.status!=="completed"||s.lastSeenRunId==null?!1:new Date(u.updatedAt).getTime()<Date.now()-300*1e3});function L(){if(!s.diagnosis||s.diagnosis.status!=="completed")return"";const u=s.diagnosis,g=i.value,k=[];u.category&&k.push(`**Category:** ${u.category}`),u.confidence&&k.push(`**Confidence:** ${u.confidence}${g?.confidenceScore!=null?` (${g.confidenceScore}/100)`:""}`),g?.severity&&k.push(`**Severity:** ${g.severity}`),g?.affectedArea&&k.push(`**Affected area:** ${g.affectedArea}`),k.push(""),u.summary&&k.push(`${u.summary}
63
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${K(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:s}){let r=this.parser.parseInline(s),n=et(t);if(n===null)return r;t=n;let a='<a href="'+t+'"';return e&&(a+=' title="'+K(e)+'"'),a+=">"+r+"</a>",a}image({href:t,title:e,text:s,tokens:r}){r&&(s=this.parser.parseInline(r,this.parser.textRenderer));let n=et(t);if(n===null)return K(s);t=n;let a=`<img src="${t}" alt="${K(s)}"`;return e&&(a+=` title="${K(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:K(t.text)}},Ue=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},W=class Le{options;renderer;textRenderer;constructor(e){this.options=e||oe,this.options.renderer=this.options.renderer||new ve,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ue}static parse(e,s){return new Le(s).parse(e)}static parseInline(e,s){return new Le(s).parseInline(e)}parse(e){this.renderer.parser=this;let s="";for(let r=0;r<e.length;r++){let n=e[r];if(this.options.extensions?.renderers?.[n.type]){let i=n,l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){s+=l||"";continue}}let a=n;switch(a.type){case"space":{s+=this.renderer.space(a);break}case"hr":{s+=this.renderer.hr(a);break}case"heading":{s+=this.renderer.heading(a);break}case"code":{s+=this.renderer.code(a);break}case"table":{s+=this.renderer.table(a);break}case"blockquote":{s+=this.renderer.blockquote(a);break}case"list":{s+=this.renderer.list(a);break}case"checkbox":{s+=this.renderer.checkbox(a);break}case"html":{s+=this.renderer.html(a);break}case"def":{s+=this.renderer.def(a);break}case"paragraph":{s+=this.renderer.paragraph(a);break}case"text":{s+=this.renderer.text(a);break}default:{let i='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return s}parseInline(e,s=this.renderer){this.renderer.parser=this;let r="";for(let n=0;n<e.length;n++){let a=e[n];if(this.options.extensions?.renderers?.[a.type]){let l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=l||"";continue}}let i=a;switch(i.type){case"escape":{r+=s.text(i);break}case"html":{r+=s.html(i);break}case"link":{r+=s.link(i);break}case"image":{r+=s.image(i);break}case"checkbox":{r+=s.checkbox(i);break}case"strong":{r+=s.strong(i);break}case"em":{r+=s.em(i);break}case"codespan":{r+=s.codespan(i);break}case"br":{r+=s.br(i);break}case"del":{r+=s.del(i);break}case"text":{r+=s.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},fe=class{options;block;constructor(t){this.options=t||oe}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?G.lex:G.lexInline}provideParser(t=this.block){return t?W.parse:W.parseInline}},bt=class{defaults=qe();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=W;Renderer=ve;TextRenderer=Ue;Lexer=G;Tokenizer=we;Hooks=fe;constructor(...t){this.use(...t)}walkTokens(t,e){let s=[];for(let r of t)switch(s=s.concat(e.call(this,r)),r.type){case"table":{let n=r;for(let a of n.header)s=s.concat(this.walkTokens(a.tokens,e));for(let a of n.rows)for(let i of a)s=s.concat(this.walkTokens(i.tokens,e));break}case"list":{let n=r;s=s.concat(this.walkTokens(n.items,e));break}default:{let n=r;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(a=>{let i=n[a].flat(1/0);s=s.concat(this.walkTokens(i,e))}):n.tokens&&(s=s.concat(this.walkTokens(n.tokens,e)))}}return s}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(s=>{let r={...s};if(r.async=this.defaults.async||r.async||!1,s.extensions&&(s.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let a=e.renderers[n.name];a?e.renderers[n.name]=function(...i){let l=n.renderer.apply(this,i);return l===!1&&(l=a.apply(this,i)),l}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[n.level];a?a.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),r.extensions=e),s.renderer){let n=this.defaults.renderer||new ve(this.defaults);for(let a in s.renderer){if(!(a in n))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let i=a,l=s.renderer[i],o=n[i];n[i]=(...d)=>{let h=l.apply(n,d);return h===!1&&(h=o.apply(n,d)),h||""}}r.renderer=n}if(s.tokenizer){let n=this.defaults.tokenizer||new we(this.defaults);for(let a in s.tokenizer){if(!(a in n))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let i=a,l=s.tokenizer[i],o=n[i];n[i]=(...d)=>{let h=l.apply(n,d);return h===!1&&(h=o.apply(n,d)),h}}r.tokenizer=n}if(s.hooks){let n=this.defaults.hooks||new fe;for(let a in s.hooks){if(!(a in n))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let i=a,l=s.hooks[i],o=n[i];fe.passThroughHooks.has(a)?n[i]=d=>{if(this.defaults.async&&fe.passThroughHooksRespectAsync.has(a))return(async()=>{let m=await l.call(n,d);return o.call(n,m)})();let h=l.call(n,d);return o.call(n,h)}:n[i]=(...d)=>{if(this.defaults.async)return(async()=>{let m=await l.apply(n,d);return m===!1&&(m=await o.apply(n,d)),m})();let h=l.apply(n,d);return h===!1&&(h=o.apply(n,d)),h}}r.hooks=n}if(s.walkTokens){let n=this.defaults.walkTokens,a=s.walkTokens;r.walkTokens=function(i){let l=[];return l.push(a.call(this,i)),n&&(l=l.concat(n.call(this,i))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return G.lex(t,e??this.defaults)}parser(t,e){return W.parse(t,e??this.defaults)}parseMarkdown(t){return(e,s)=>{let r={...s},n={...this.defaults,...r},a=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&r.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return(async()=>{let i=n.hooks?await n.hooks.preprocess(e):e,l=await(n.hooks?await n.hooks.provideLexer(t):t?G.lex:G.lexInline)(i,n),o=n.hooks?await n.hooks.processAllTokens(l):l;n.walkTokens&&await Promise.all(this.walkTokens(o,n.walkTokens));let d=await(n.hooks?await n.hooks.provideParser(t):t?W.parse:W.parseInline)(o,n);return n.hooks?await n.hooks.postprocess(d):d})().catch(a);try{n.hooks&&(e=n.hooks.preprocess(e));let i=(n.hooks?n.hooks.provideLexer(t):t?G.lex:G.lexInline)(e,n);n.hooks&&(i=n.hooks.processAllTokens(i)),n.walkTokens&&this.walkTokens(i,n.walkTokens);let l=(n.hooks?n.hooks.provideParser(t):t?W.parse:W.parseInline)(i,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(i){return a(i)}}}onError(t,e){return s=>{if(s.message+=`
64
+ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+K(s.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(s);throw s}}},ae=new bt;function T(t,e){return ae.parse(t,e)}T.options=T.setOptions=function(t){return ae.setOptions(t),T.defaults=ae.defaults,ct(T.defaults),T};T.getDefaults=qe;T.defaults=oe;T.use=function(...t){return ae.use(...t),T.defaults=ae.defaults,ct(T.defaults),T};T.walkTokens=function(t,e){return ae.walkTokens(t,e)};T.parseInline=ae.parseInline;T.Parser=W;T.parser=W.parse;T.Renderer=ve;T.TextRenderer=Ue;T.Lexer=G;T.lexer=G.lex;T.Tokenizer=we;T.Hooks=fe;T.parse=T;T.options;T.setOptions;T.use;T.walkTokens;T.parseInline;W.parse;G.lex;function B(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}const An=/^(?:https?:|mailto:|tel:|[/#?]|[^a-z0-9+.-]|$)/i;function nt(t){return An.test(t.trim().replace(/[-]/g,""))}function yt(t){return new bt({renderer:{html:e=>B(typeof e=="string"?e:e.text),link:e=>{const s=B(e.text||e.href);return t==="text"||!nt(e.href)?e.text&&e.text!==e.href?`${s} (${B(e.href)})`:s:`<a href="${B(e.href)}">${s}</a>`},image:e=>t==="text"||!nt(e.href)?B(e.text||e.href):`<img src="${B(e.href)}" alt="${B(e.text??"")}">`}})}yt("anchor");yt("text");const Rn=Symbol("clusterSectionLocator");function Tn(){return It(Rn,{canLocate:()=>!1,open:()=>{}})}const zn={class:"space-y-3"},In={key:2,class:"space-y-3 rounded-lg border border-default p-4 bg-elevated/30"},En={class:"flex items-start gap-3"},Pn=["title"],Ln={class:"relative size-12"},Bn={viewBox:"0 0 36 36",class:"size-12 -rotate-90"},Dn=["stroke-dasharray"],qn={class:"absolute inset-0 flex items-center justify-center text-xs font-semibold"},Fn={class:"flex-1 min-w-0"},Mn={class:"flex items-start justify-between gap-2"},Nn={class:"flex flex-wrap items-center gap-1.5"},jn={key:4,class:"text-xs text-gray-500 inline-flex items-center gap-1"},On={class:"flex items-center gap-1 shrink-0"},Hn={key:0,class:"text-sm font-medium mt-1.5"},Zn={key:0,class:"text-sm text-gray-600 dark:text-gray-400"},Un={key:1,class:"space-y-1"},Vn={class:"flex flex-wrap items-baseline gap-x-1.5 gap-y-1"},Qn=["title","onClick"],Gn=["title","onClick"],Wn={key:2},Xn={class:"text-sm text-gray-600 dark:text-gray-400"},Kn={key:1,class:"mt-2"},Jn={class:"flex items-center justify-between mb-1"},Yn={class:"flex items-center gap-1.5"},er={class:"flex items-center gap-1"},tr={key:0,class:"text-xs text-rose-600 dark:text-rose-400 mt-1"},sr={key:2,class:"mt-2"},nr={key:3,class:"space-y-1.5"},rr={class:"flex items-center gap-1"},ir={key:0,class:"space-y-1.5"},ar={class:"flex items-center gap-1.5"},or={key:1,class:"flex items-center gap-1.5 flex-1 min-w-0"},lr={class:"h-1.5 flex-1 max-w-24 rounded-full bg-gray-200 dark:bg-gray-700 overflow-hidden"},cr={class:"text-xs text-gray-400 shrink-0"},ur={key:0,class:"text-sm text-gray-600 dark:text-gray-400 mt-1"},pr={class:"space-y-1"},dr=["onClick"],hr={key:5,class:"space-y-1"},gr={class:"flex items-start justify-between gap-3 pt-1 border-t border-default"},fr={class:"flex items-start gap-2"},kr={class:"flex items-center gap-1 shrink-0 pt-0.5"},xr={key:0,class:"flex items-start gap-1.5"},mr={class:"flex items-center gap-1.5 text-xs text-gray-400 shrink-0 pt-0.5"},br={key:3,class:"flex flex-col items-center justify-center p-8 text-center text-gray-400 border border-dashed border-default rounded-lg"},yr=ce({__name:"DiagnosisResult",props:{diagnosis:{},lastSeenRunId:{}},emits:["view-section","prefill-context"],setup(t,{emit:e}){const s=t,{copy:r,copied:n}=Be(),a=Tn(),i=P(()=>s.diagnosis?.details);function l(u,g){return u==null&&g==null?"":`${u??0} in / ${g??0} out tokens`}function o(u){return u.status==="running"&&Date.now()-new Date(u.updatedAt).getTime()>300*1e3}const d=ne(!1),h=ne(!1),m=ne(!1),b=ne(null),z=ne(void 0),_=Pt(new Set);be(()=>s.diagnosis?.id,()=>_.clear()),be(()=>s.diagnosis?.feedback,u=>{b.value=u??null},{immediate:!0}),be(()=>s.diagnosis?.feedbackNote,u=>{z.value=u??void 0},{immediate:!0});async function H(u){if(!s.diagnosis)return;const g=b.value===u?null:u;b.value=g,g||(m.value=!1),d.value=!0;try{await $fetch(`/api/failure-diagnoses/${s.diagnosis.id}/feedback`,{method:"PATCH",body:{feedback:g,feedbackNote:z.value||null}})}catch{b.value=s.diagnosis.feedback??null}finally{d.value=!1}}async function v(){if(s.diagnosis){h.value=!0;try{await $fetch(`/api/failure-diagnoses/${s.diagnosis.id}/feedback`,{method:"PATCH",body:{feedback:b.value,feedbackNote:z.value||null}}),m.value=!1}catch{}finally{h.value=!1}}}const y=P(()=>{const u=s.diagnosis;return!u||u.status!=="completed"||s.lastSeenRunId==null?!1:new Date(u.updatedAt).getTime()<Date.now()-300*1e3});function L(){if(!s.diagnosis||s.diagnosis.status!=="completed")return"";const u=s.diagnosis,g=i.value,k=[];u.category&&k.push(`**Category:** ${u.category}`),u.confidence&&k.push(`**Confidence:** ${u.confidence}${g?.confidenceScore!=null?` (${g.confidenceScore}/100)`:""}`),g?.severity&&k.push(`**Severity:** ${g.severity}`),g?.affectedArea&&k.push(`**Affected area:** ${g.affectedArea}`),k.push(""),u.summary&&k.push(`${u.summary}
65
65
  `),u.rootCause&&k.push(`**Root cause:** ${u.rootCause}
66
- `);const D=g?.evidence??[];D.length&&(k.push("**Evidence:**"),D.forEach(V=>k.push(`- ${V}`)),k.push(""));const C=g?.suggestedFix;C&&(k.push("**Suggested fix:**"),C.description&&k.push(`${C.description}`),C.file&&k.push(`\`${C.file}\``),C.patch?k.push(`\`\`\`diff
67
- ${C.patch}
68
- \`\`\``):C.code&&k.push(`\`\`\`
69
- ${C.code}
70
- \`\`\``),k.push(""));const M=g?.hypotheses?.slice(1)??[];M.length&&(k.push("**Other hypotheses considered:**"),M.forEach(V=>k.push(`- (${V.category??"unknown"}, ${V.likelihood??"?"}/100) ${V.rootCause??""}`)),k.push(""));const U=g?.investigationSteps??[];U.length&&(k.push("**To confirm this diagnosis:**"),U.forEach(V=>k.push(`- ${V}`)),k.push(""));const X=g?.preventionTips??[];return X.length&&(k.push("**Prevention tips:**"),X.forEach(V=>k.push(`- ${V}`)),k.push("")),u.model&&k.push(`_${u.model}_`),k.join(`
71
- `)}function ee(){if(!s.diagnosis||s.diagnosis.status!=="completed")return"";const u=s.diagnosis,g=i.value,k=["<dl>"];u.category&&k.push(`<dt>Category</dt><dd>${B(u.category)}</dd>`),u.confidence&&k.push(`<dt>Confidence</dt><dd>${B(u.confidence)}${g?.confidenceScore!=null?` (${g.confidenceScore}/100)`:""}</dd>`),g?.severity&&k.push(`<dt>Severity</dt><dd>${B(String(g.severity))}</dd>`),g?.affectedArea&&k.push(`<dt>Affected area</dt><dd>${B(String(g.affectedArea))}</dd>`),k.push("</dl>"),u.summary&&k.push(`<p><strong>${B(u.summary)}</strong></p>`),u.rootCause&&k.push(`<p><strong>Root cause:</strong> ${B(u.rootCause)}</p>`);const D=g?.evidence??[];D.length&&(k.push("<p><strong>Evidence:</strong></p><ul>"),D.forEach(X=>k.push(`<li>${B(X)}</li>`)),k.push("</ul>"));const C=g?.suggestedFix;C&&(k.push("<p><strong>Suggested fix:</strong></p>"),C.description&&k.push(`<p>${B(String(C.description))}</p>`),C.file&&k.push(`<code>${B(String(C.file))}</code>`),C.patch?k.push(`<pre>${B(String(C.patch))}</pre>`):C.code&&k.push(`<pre>${B(String(C.code))}</pre>`));const M=g?.investigationSteps??[];M.length&&(k.push("<p><strong>To confirm this diagnosis:</strong></p><ul>"),M.forEach(X=>k.push(`<li>${B(X)}</li>`)),k.push("</ul>"));const U=g?.preventionTips??[];return U.length&&(k.push("<p><strong>Prevention tips:</strong></p><ul>"),U.forEach(X=>k.push(`<li>${B(X)}</li>`)),k.push("</ul>")),k.join(`
66
+ `);const D=g?.evidence??[];D.length&&(k.push("**Evidence:**"),D.forEach(V=>k.push(`- ${V}`)),k.push(""));const A=g?.suggestedFix;A&&(k.push("**Suggested fix:**"),A.description&&k.push(`${A.description}`),A.file&&k.push(`\`${A.file}\``),A.patch?k.push(`\`\`\`diff
67
+ ${A.patch}
68
+ \`\`\``):A.code&&k.push(`\`\`\`
69
+ ${A.code}
70
+ \`\`\``),k.push(""));const M=g?.hypotheses?.slice(1)??[];M.length&&(k.push("**Other hypotheses considered:**"),M.forEach(V=>k.push(`- (${V.category??"unknown"}, ${V.likelihood??"?"}/100) ${V.rootCause??""}`)),k.push(""));const Z=g?.investigationSteps??[];Z.length&&(k.push("**To confirm this diagnosis:**"),Z.forEach(V=>k.push(`- ${V}`)),k.push(""));const X=g?.preventionTips??[];return X.length&&(k.push("**Prevention tips:**"),X.forEach(V=>k.push(`- ${V}`)),k.push("")),u.model&&k.push(`_${u.model}_`),k.join(`
71
+ `)}function ee(){if(!s.diagnosis||s.diagnosis.status!=="completed")return"";const u=s.diagnosis,g=i.value,k=["<dl>"];u.category&&k.push(`<dt>Category</dt><dd>${B(u.category)}</dd>`),u.confidence&&k.push(`<dt>Confidence</dt><dd>${B(u.confidence)}${g?.confidenceScore!=null?` (${g.confidenceScore}/100)`:""}</dd>`),g?.severity&&k.push(`<dt>Severity</dt><dd>${B(String(g.severity))}</dd>`),g?.affectedArea&&k.push(`<dt>Affected area</dt><dd>${B(String(g.affectedArea))}</dd>`),k.push("</dl>"),u.summary&&k.push(`<p><strong>${B(u.summary)}</strong></p>`),u.rootCause&&k.push(`<p><strong>Root cause:</strong> ${B(u.rootCause)}</p>`);const D=g?.evidence??[];D.length&&(k.push("<p><strong>Evidence:</strong></p><ul>"),D.forEach(X=>k.push(`<li>${B(X)}</li>`)),k.push("</ul>"));const A=g?.suggestedFix;A&&(k.push("<p><strong>Suggested fix:</strong></p>"),A.description&&k.push(`<p>${B(String(A.description))}</p>`),A.file&&k.push(`<code>${B(String(A.file))}</code>`),A.patch?k.push(`<pre>${B(String(A.patch))}</pre>`):A.code&&k.push(`<pre>${B(String(A.code))}</pre>`));const M=g?.investigationSteps??[];M.length&&(k.push("<p><strong>To confirm this diagnosis:</strong></p><ul>"),M.forEach(X=>k.push(`<li>${B(X)}</li>`)),k.push("</ul>"));const Z=g?.preventionTips??[];return Z.length&&(k.push("<p><strong>Prevention tips:</strong></p><ul>"),Z.forEach(X=>k.push(`<li>${B(X)}</li>`)),k.push("</ul>")),k.join(`
72
72
  `)}async function re(){const u=L(),g=ee();if(!(!u&&!g))try{await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([u],{type:"text/plain"}),"text/html":new Blob([g],{type:"text/html"})})]),it().add({title:"Diagnosis copied",icon:"i-lucide-check",color:"success",duration:2e3})}catch{r(u,{toast:"Diagnosis copied"})}}function te(){const u=s.diagnosis;if(!u)return;const g=u.details?.suggestedFix?.patch;if(!g)return;const k=`git apply <<'EOF'
73
73
  ${g}
74
74
  EOF`;r(k,{toast:"git apply command copied"})}function q(){const u=i.value?.suggestedFix?.patch;if(!u)return;const g=u.endsWith(`
75
75
  `)?u:u+`
76
- `,k=new Blob([g],{type:"text/x-patch"}),D=URL.createObjectURL(k),C=document.createElement("a");C.href=D,C.download=`piwi-diagnosis-${s.diagnosis?.id??"fix"}.patch`,document.body.appendChild(C),C.click(),setTimeout(()=>{C.remove(),URL.revokeObjectURL(D)},1e3)}const E=P(()=>{const u=i.value?.patchValidation;return u&&typeof u=="object"?u:null}),F=P(()=>{const u=E.value;if(!u)return null;switch(u.status){case"applies":return{color:"success",icon:"i-lucide-badge-check",label:"Applies cleanly",title:"Verified against the real file at the failing commit"};case"applies-with-offset":return{color:"warning",icon:"i-lucide-badge-check",label:"Applies with offset",title:"Context matched at a shifted line — apply should still succeed"};case"stale-file":return{color:"error",icon:"i-lucide-badge-alert",label:"Does not apply",title:u.errors.join(`
76
+ `,k=new Blob([g],{type:"text/x-patch"}),D=URL.createObjectURL(k),A=document.createElement("a");A.href=D,A.download=`piwi-diagnosis-${s.diagnosis?.id??"fix"}.patch`,document.body.appendChild(A),A.click(),setTimeout(()=>{A.remove(),URL.revokeObjectURL(D)},1e3)}const E=P(()=>{const u=i.value?.patchValidation;return u&&typeof u=="object"?u:null}),F=P(()=>{const u=E.value;if(!u)return null;switch(u.status){case"applies":return{color:"success",icon:"i-lucide-badge-check",label:"Applies cleanly",title:"Verified against the real file at the failing commit"};case"applies-with-offset":return{color:"warning",icon:"i-lucide-badge-check",label:"Applies with offset",title:"Context matched at a shifted line — apply should still succeed"};case"stale-file":return{color:"error",icon:"i-lucide-badge-alert",label:"Does not apply",title:u.errors.join(`
77
77
  `)||"The file changed since — patch context did not match"};case"invalid":return{color:"error",icon:"i-lucide-badge-alert",label:"Invalid diff",title:u.errors.join(`
78
78
  `)||"Could not parse the patch as a unified diff"};default:return{color:"neutral",icon:"i-lucide-badge-help",label:"Unverified",title:"The source file was not in context, so the patch could not be validated"}}}),le={"app-bug":"error","test-bug":"warning","flaky-test":"warning",infrastructure:"info",environment:"secondary",unknown:"neutral"},Re={high:"success",medium:"warning",low:"neutral"},wt={blocker:"error",high:"warning",medium:"info",low:"neutral"},Ve=e;function vt(){const u=i.value?.investigationSteps??[];if(!u.length)return;const g=["Investigation findings (fill in the results, then re-diagnose):",...u.map(k=>`- ${k}: `)].join(`
79
- `);Ve("prefill-context",g)}const pe=P(()=>{const u=i.value?.confidenceScore;return typeof u=="number"?u:null}),de=P(()=>{const u=pe.value;return u!==null?u<50:s.diagnosis?.confidence==="low"||s.diagnosis?.category==="unknown"}),$t={"app-bug":"i-lucide-bug","test-bug":"i-lucide-flask-conical","flaky-test":"i-lucide-dice-5",infrastructure:"i-lucide-server",environment:"i-lucide-settings-2",unknown:"i-lucide-circle-help"},_t=P(()=>{const u=s.diagnosis?.confidence;return u==="high"?"text-emerald-500":u==="medium"?"text-amber-500":"text-rose-500"});function Te(u){return lt[u]??u}function St(u){const g=[];return{text:u.replace(/\[([a-zA-Z][a-zA-Z0-9]*)\]/g,(D,C)=>gs(C)?(g.push(C),""):D).replace(/\s{2,}/g," ").trim(),citations:g}}const Qe=P(()=>{const u=i.value?.evidence;return Array.isArray(u)?u.map(St):[]}),ze=P(()=>{const u=i.value?.hypotheses;return Array.isArray(u)?u.slice(1):[]}),me=ne(!1),Ie=P(()=>{const u=i.value?.pipeline;return Array.isArray(u)?u:[]}),Ge=P(()=>Ie.value.reduce((u,g)=>u+(g.cacheReadInputTokens??0),0));return(u,g)=>{const k=Ft,D=Lt,C=De,M=ke,U=_e,X=Mt,V=ot,At=Nt,Ct=jt;return p(),f("div",zn,[t.diagnosis&&(t.diagnosis.status==="failed"||a(t.diagnosis))?(p(),N(k,{key:0,color:"error",title:"Diagnosis failed",description:t.diagnosis.error||"Unknown error"},null,8,["description"])):$("",!0),c(y)?(p(),N(k,{key:1,color:"warning",icon:"i-lucide-clock",title:"Diagnosis may be stale",description:"New evidence may have appeared since this diagnosis was made. Consider re-running."})):$("",!0),t.diagnosis&&t.diagnosis.status==="completed"?(p(),f("div",In,[x("div",En,[c(pe)!==null?(p(),f("div",{key:0,class:"shrink-0",title:`Confidence ${c(pe)}/100`},[x("div",Ln,[(p(),f("svg",Bn,[g[6]||(g[6]=x("circle",{cx:"18",cy:"18",r:"15.9155",fill:"none",class:"text-gray-200 dark:text-gray-700",stroke:"currentColor","stroke-width":"3"},null,-1)),x("circle",{cx:"18",cy:"18",r:"15.9155",fill:"none",class:J(c(_t)),stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-dasharray":`${c(pe)} 100`},null,10,Dn)])),x("span",qn,w(c(pe)),1)])],8,Pn)):$("",!0),x("div",Fn,[x("div",Mn,[x("div",Nn,[t.diagnosis.category?(p(),N(D,{key:0,color:le[t.diagnosis.category]||"neutral",variant:"subtle",size:"sm",icon:$t[t.diagnosis.category]},{default:Q(()=>[R(w(t.diagnosis.category),1)]),_:1},8,["color","icon"])):$("",!0),t.diagnosis.confidence?(p(),N(D,{key:1,color:Re[t.diagnosis.confidence]||"neutral",variant:"outline",size:"sm"},{default:Q(()=>[R(w(t.diagnosis.confidence)+" confidence ",1)]),_:1},8,["color"])):$("",!0),t.diagnosis.confidence?(p(),N(C,{key:2,topic:"cluster.confidence"})):$("",!0),c(i)?.severity?(p(),N(D,{key:3,color:wt[c(i).severity]||"neutral",variant:"soft",size:"sm"},{default:Q(()=>[R(w(c(i).severity)+" severity ",1)]),_:1},8,["color"])):$("",!0),c(i)?.affectedArea?(p(),f("span",jn,[S(M,{name:"i-lucide-crosshair",class:"size-3 shrink-0"}),R(" "+w(c(i).affectedArea),1)])):$("",!0)]),x("div",On,[S(C,{topic:"cluster.result"}),S(U,{icon:c(n)?"i-lucide-check":"i-lucide-clipboard",size:"xs",color:"neutral",variant:"ghost",title:"Copy full diagnosis (Markdown + HTML)",onClick:re},null,8,["icon"])])]),t.diagnosis.summary?(p(),f("p",Hn,w(t.diagnosis.summary),1)):$("",!0)])]),t.diagnosis.rootCause?(p(),f("p",Un,w(t.diagnosis.rootCause),1)):$("",!0),c(Qe).length?(p(),f("ul",Zn,[(p(!0),f(j,null,Y(c(Qe),(I,Z)=>(p(),f("li",{key:Z,class:"text-sm text-gray-600 dark:text-gray-400 flex gap-1.5"},[g[7]||(g[7]=x("span",{class:"text-gray-400 shrink-0 leading-5"},"•",-1)),x("span",Vn,[x("span",null,w(I.text),1),(p(!0),f(j,null,Y(I.citations,se=>(p(),f("span",{key:se,class:"inline-flex items-center"},[x("button",{class:J(["inline-flex items-center gap-0.5 border border-default px-1.5 text-xs text-gray-500 hover:text-primary hover:border-primary transition-colors",c(o).canLocate(se)?"rounded-l bg-elevated":"rounded bg-elevated"]),title:`View ${Te(se)} in the AI context`,onClick:Rt=>Ve("view-section",se)},[S(M,{name:"i-lucide-link",class:"size-2.5"}),R(" "+w(Te(se)),1)],10,Qn),c(o).canLocate(se)?(p(),f("button",{key:0,class:"inline-flex items-center rounded-r border border-l-0 border-default bg-elevated px-1 text-xs text-gray-500 hover:text-primary hover:border-primary transition-colors",title:`Show ${Te(se)} on the page`,onClick:Rt=>c(o).open(se)},[S(M,{name:"i-lucide-map-pin",class:"size-2.5"})],8,Gn)):$("",!0)]))),128))])]))),128))])):$("",!0),c(i)?.suggestedFix?(p(),f("div",Wn,[g[9]||(g[9]=x("p",{class:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"},"Suggested fix",-1)),x("p",Xn,w(c(i).suggestedFix.description),1),c(i).suggestedFix.file&&!c(i).suggestedFix.patch?(p(),N(X,{key:0,"file-path":c(i).suggestedFix.file,class:"text-xs mt-1"},null,8,["file-path"])):$("",!0),c(i).suggestedFix.patch?(p(),f("div",Kn,[x("div",Jn,[x("div",Yn,[g[8]||(g[8]=x("span",{class:"text-xs text-gray-500 font-mono"},"patch",-1)),c(F)?(p(),N(D,{key:0,color:c(F).color,variant:"subtle",size:"sm",icon:c(F).icon,title:c(F).title},{default:Q(()=>[R(w(c(F).label),1)]),_:1},8,["color","icon","title"])):$("",!0)]),x("div",er,[S(U,{size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-download",title:"Download .patch file",onClick:q}),S(U,{size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-terminal",title:"Copy git apply command",onClick:te}),S(U,{icon:c(n)?"i-lucide-check":"i-lucide-clipboard",size:"xs",color:"neutral",variant:"ghost",title:"Copy patch",onClick:g[0]||(g[0]=I=>c(r)(c(i).suggestedFix.patch))},null,8,["icon"])])]),S(V,{text:"```diff\n"+c(i).suggestedFix.patch+"\n```"},null,8,["text"]),c(E)&&(c(E).status==="stale-file"||c(E).status==="invalid")?(p(),f("p",tr,w(c(E).errors[0]||"This patch could not be verified against the source."),1)):$("",!0)])):c(i).suggestedFix.code?(p(),f("div",sr,[S(At,{code:c(i).suggestedFix.code},null,8,["code"])])):$("",!0)])):$("",!0),c(ze).length?(p(),f("div",nr,[x("div",rr,[x("button",{class:"flex items-center gap-1.5 text-xs font-medium text-gray-500 uppercase tracking-wide hover:text-gray-700 dark:hover:text-gray-300",onClick:g[1]||(g[1]=I=>me.value=!c(me))},[S(M,{name:c(me)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3.5"},null,8,["name"]),R(" Other hypotheses considered ("+w(c(ze).length)+") ",1)]),S(C,{topic:"cluster.hypotheses"})]),c(me)?(p(),f("div",ir,[(p(!0),f(j,null,Y(c(ze),(I,Z)=>(p(),f("div",{key:Z,class:"rounded-md border border-default bg-elevated/40 px-2.5 py-1.5"},[x("div",or,[I.category?(p(),N(D,{key:0,color:le[I.category]||"neutral",variant:"subtle",size:"sm"},{default:Q(()=>[R(w(I.category),1)]),_:2},1032,["color"])):$("",!0),typeof I.likelihood=="number"?(p(),f("div",ar,[x("div",lr,[x("div",{class:"h-full rounded-full bg-gray-400 dark:bg-gray-500",style:rt({width:`${I.likelihood}%`})},null,4)]),x("span",cr,w(I.likelihood)+"/100",1)])):$("",!0)]),I.rootCause?(p(),f("p",ur,w(I.rootCause),1)):$("",!0)]))),128))])):$("",!0)])):$("",!0),c(i)?.investigationSteps?.length?(p(),f("div",{key:4,class:J(["space-y-1.5",c(de)?"rounded-lg border border-amber-300/60 dark:border-amber-500/30 bg-amber-50/60 dark:bg-amber-500/10 p-3":""])},[x("p",{class:J(["text-xs font-medium uppercase tracking-wide flex items-center gap-1.5",c(de)?"text-amber-700 dark:text-amber-400":"text-gray-500"])},[c(de)?(p(),N(M,{key:0,name:"i-lucide-flask-conical",class:"size-3.5 shrink-0"})):$("",!0),R(" "+w(c(de)?"Low confidence — gather more evidence":"To confirm this diagnosis"),1)],2),x("ul",pr,[(p(!0),f(j,null,Y(c(i).investigationSteps,(I,Z)=>(p(),f("li",{key:Z,class:J(["text-sm flex gap-2 items-start cursor-pointer select-none",c(_).has(Number(Z))?"text-gray-400 dark:text-gray-500 line-through":"text-gray-600 dark:text-gray-400"]),onClick:se=>c(_).has(Number(Z))?c(_).delete(Number(Z)):c(_).add(Number(Z))},[S(M,{name:c(_).has(Number(Z))?"i-lucide-check-square":"i-lucide-square",class:J(["size-4 shrink-0 mt-0.5",c(_).has(Number(Z))?"text-primary":"text-gray-400"])},null,8,["name","class"]),R(" "+w(I),1)],10,dr))),128))]),c(de)?(p(),N(U,{key:0,size:"xs",color:"warning",variant:"soft",icon:"i-lucide-clipboard-pen",class:"mt-1",title:"Pre-fill the additional-context box with these checks, then re-diagnose",onClick:vt},{default:Q(()=>[...g[10]||(g[10]=[R(" Add to context & refine ",-1)])]),_:1})):$("",!0)],2)):$("",!0),c(i)?.preventionTips?.length?(p(),f("ul",hr,[g[11]||(g[11]=x("li",{class:"text-xs font-medium text-gray-500 uppercase tracking-wide"},"Prevention tips",-1)),(p(!0),f(j,null,Y(c(i).preventionTips,(I,Z)=>(p(),f("li",{key:Z,class:"text-sm text-gray-600 dark:text-gray-400 flex gap-1.5"},[S(M,{name:"i-lucide-lightbulb",class:"size-3.5 shrink-0 mt-0.5 text-yellow-500"}),R(" "+w(I),1)]))),128))])):$("",!0),x("div",gr,[x("div",fr,[x("div",kr,[S(U,{icon:(c(b)==="up","i-lucide-thumbs-up"),color:c(b)==="up"?"success":"neutral",variant:"ghost",size:"xs",loading:c(d),onClick:g[2]||(g[2]=I=>H("up"))},null,8,["icon","color","loading"]),S(U,{icon:(c(b)==="down","i-lucide-thumbs-down"),color:c(b)==="down"?"error":"neutral",variant:"ghost",size:"xs",loading:c(d),onClick:g[3]||(g[3]=I=>H("down"))},null,8,["icon","color","loading"]),c(b)?(p(),f("button",{key:0,class:"text-xs text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 ml-1 transition-colors",onClick:g[4]||(g[4]=I=>m.value=!c(m))},[S(M,{name:c(m)?"i-lucide-chevron-up":"i-lucide-chevron-down",class:"size-3"},null,8,["name"]),R(" "+w(c(z)?"Edit note":"Note"),1)])):$("",!0)]),c(m)?(p(),f("div",xr,[S(Ct,{modelValue:c(z),"onUpdate:modelValue":g[5]||(g[5]=I=>Et(z)?z.value=I:null),size:"xs",placeholder:"Add a note about this feedback…",class:"max-w-64",ui:{base:"text-xs"},rows:2},null,8,["modelValue"]),S(U,{size:"xs",color:"primary",variant:"solid",loading:c(h),onClick:v},{default:Q(()=>[...g[12]||(g[12]=[R(" Save ",-1)])]),_:1},8,["loading"])])):$("",!0)]),x("div",mr,[c(Ie).length>1?(p(),N(D,{key:0,color:"neutral",variant:"subtle",size:"sm",icon:"i-lucide-workflow",title:c(Ie).map(I=>`${I.role}: ${I.model}`).join(" → ")},{default:Q(()=>[...g[13]||(g[13]=[R(" 2-stage ",-1)])]),_:1},8,["title"])):$("",!0),x("span",null,[R(w(t.diagnosis.model)+" · "+w(l(t.diagnosis.inputTokens,t.diagnosis.outputTokens)),1),c(Ge)>0?(p(),f(j,{key:0},[R(" ("+w(c(Ge))+" cached)",1)],64)):$("",!0),R(" · "+w(c(Dt)(t.diagnosis.updatedAt)),1)])])])])):$("",!0),t.diagnosis?$("",!0):(p(),f("div",br,[S(M,{name:"i-lucide-sparkles",class:"size-8 mb-2 opacity-30"}),g[14]||(g[14]=x("p",{class:"text-sm"},"Diagnosis will appear here",-1))]))])}}}),Fr=Object.assign(yr,{__name:"DiagnosisResult"});export{zr as _,ot as a,Er as b,Rn as c,Dr as d,Fr as e,qr as f,Lr as g,Br as h,Ir as i,Pr as s,Ot as u};
79
+ `);Ve("prefill-context",g)}const pe=P(()=>{const u=i.value?.confidenceScore;return typeof u=="number"?u:null}),de=P(()=>{const u=pe.value;return u!==null?u<50:s.diagnosis?.confidence==="low"||s.diagnosis?.category==="unknown"}),$t={"app-bug":"i-lucide-bug","test-bug":"i-lucide-flask-conical","flaky-test":"i-lucide-dice-5",infrastructure:"i-lucide-server",environment:"i-lucide-settings-2",unknown:"i-lucide-circle-help"},_t=P(()=>{const u=s.diagnosis?.confidence;return u==="high"?"text-emerald-500":u==="medium"?"text-amber-500":"text-rose-500"});function Te(u){return lt[u]??u}function St(u){const g=[];return{text:u.replace(/\[([a-zA-Z][a-zA-Z0-9]*)\]/g,(D,A)=>gs(A)?(g.push(A),""):D).replace(/\s{2,}/g," ").trim(),citations:g}}const Qe=P(()=>{const u=i.value?.evidence;return Array.isArray(u)?u.map(St):[]}),ze=P(()=>{const u=i.value?.hypotheses;return Array.isArray(u)?u.slice(1):[]}),xe=ne(!1),Ie=P(()=>{const u=i.value?.pipeline;return Array.isArray(u)?u:[]}),Ge=P(()=>Ie.value.reduce((u,g)=>u+(g.cacheReadInputTokens??0),0));return(u,g)=>{const k=Ft,D=Lt,A=De,M=_e,Z=$e,X=Mt,V=at,Ct=Nt,At=jt;return p(),f("div",zn,[t.diagnosis&&(t.diagnosis.status==="failed"||o(t.diagnosis))?(p(),N(k,{key:0,color:"error",title:"Diagnosis failed",description:t.diagnosis.error||"Unknown error"},null,8,["description"])):$("",!0),c(y)?(p(),N(k,{key:1,color:"warning",icon:"i-lucide-clock",title:"Diagnosis may be stale",description:"New evidence may have appeared since this diagnosis was made. Consider re-running."})):$("",!0),t.diagnosis&&t.diagnosis.status==="completed"?(p(),f("div",In,[x("div",En,[c(pe)!==null?(p(),f("div",{key:0,class:"shrink-0",title:`Confidence ${c(pe)}/100`},[x("div",Ln,[(p(),f("svg",Bn,[g[6]||(g[6]=x("circle",{cx:"18",cy:"18",r:"15.9155",fill:"none",class:"text-gray-200 dark:text-gray-700",stroke:"currentColor","stroke-width":"3"},null,-1)),x("circle",{cx:"18",cy:"18",r:"15.9155",fill:"none",class:J(c(_t)),stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-dasharray":`${c(pe)} 100`},null,10,Dn)])),x("span",qn,w(c(pe)),1)])],8,Pn)):$("",!0),x("div",Fn,[x("div",Mn,[x("div",Nn,[t.diagnosis.category?(p(),N(D,{key:0,color:le[t.diagnosis.category]||"neutral",variant:"subtle",size:"sm",icon:$t[t.diagnosis.category]},{default:Q(()=>[R(w(t.diagnosis.category),1)]),_:1},8,["color","icon"])):$("",!0),t.diagnosis.confidence?(p(),N(D,{key:1,color:Re[t.diagnosis.confidence]||"neutral",variant:"outline",size:"sm"},{default:Q(()=>[R(w(t.diagnosis.confidence)+" confidence ",1)]),_:1},8,["color"])):$("",!0),t.diagnosis.confidence?(p(),N(A,{key:2,topic:"cluster.confidence"})):$("",!0),c(i)?.severity?(p(),N(D,{key:3,color:wt[c(i).severity]||"neutral",variant:"soft",size:"sm"},{default:Q(()=>[R(w(c(i).severity)+" severity ",1)]),_:1},8,["color"])):$("",!0),c(i)?.affectedArea?(p(),f("span",jn,[S(M,{name:"i-lucide-crosshair",class:"size-3 shrink-0"}),R(" "+w(c(i).affectedArea),1)])):$("",!0)]),x("div",On,[S(A,{topic:"cluster.result"}),S(Z,{icon:c(n)?"i-lucide-check":"i-lucide-clipboard",size:"xs",color:"neutral",variant:"ghost",title:"Copy full diagnosis (Markdown + HTML)",onClick:re},null,8,["icon"])])]),t.diagnosis.summary?(p(),f("p",Hn,w(t.diagnosis.summary),1)):$("",!0)])]),t.diagnosis.rootCause?(p(),f("p",Zn,w(t.diagnosis.rootCause),1)):$("",!0),c(Qe).length?(p(),f("ul",Un,[(p(!0),f(j,null,Y(c(Qe),(I,U)=>(p(),f("li",{key:U,class:"text-sm text-gray-600 dark:text-gray-400 flex gap-1.5"},[g[7]||(g[7]=x("span",{class:"text-gray-400 shrink-0 leading-5"},"•",-1)),x("span",Vn,[x("span",null,w(I.text),1),(p(!0),f(j,null,Y(I.citations,se=>(p(),f("span",{key:se,class:"inline-flex items-center"},[x("button",{class:J(["inline-flex items-center gap-0.5 border border-default px-1.5 text-xs text-gray-500 hover:text-primary hover:border-primary transition-colors",c(a).canLocate(se)?"rounded-l bg-elevated":"rounded bg-elevated"]),title:`View ${Te(se)} in the AI context`,onClick:Rt=>Ve("view-section",se)},[S(M,{name:"i-lucide-link",class:"size-2.5"}),R(" "+w(Te(se)),1)],10,Qn),c(a).canLocate(se)?(p(),f("button",{key:0,class:"inline-flex items-center rounded-r border border-l-0 border-default bg-elevated px-1 text-xs text-gray-500 hover:text-primary hover:border-primary transition-colors",title:`Show ${Te(se)} on the page`,onClick:Rt=>c(a).open(se)},[S(M,{name:"i-lucide-map-pin",class:"size-2.5"})],8,Gn)):$("",!0)]))),128))])]))),128))])):$("",!0),c(i)?.suggestedFix?(p(),f("div",Wn,[g[9]||(g[9]=x("p",{class:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"},"Suggested fix",-1)),x("p",Xn,w(c(i).suggestedFix.description),1),c(i).suggestedFix.file&&!c(i).suggestedFix.patch?(p(),N(X,{key:0,"file-path":c(i).suggestedFix.file,class:"text-xs mt-1"},null,8,["file-path"])):$("",!0),c(i).suggestedFix.patch?(p(),f("div",Kn,[x("div",Jn,[x("div",Yn,[g[8]||(g[8]=x("span",{class:"text-xs text-gray-500 font-mono"},"patch",-1)),c(F)?(p(),N(D,{key:0,color:c(F).color,variant:"subtle",size:"sm",icon:c(F).icon,title:c(F).title},{default:Q(()=>[R(w(c(F).label),1)]),_:1},8,["color","icon","title"])):$("",!0)]),x("div",er,[S(Z,{size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-download",title:"Download .patch file",onClick:q}),S(Z,{size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-terminal",title:"Copy git apply command",onClick:te}),S(Z,{icon:c(n)?"i-lucide-check":"i-lucide-clipboard",size:"xs",color:"neutral",variant:"ghost",title:"Copy patch",onClick:g[0]||(g[0]=I=>c(r)(c(i).suggestedFix.patch))},null,8,["icon"])])]),S(V,{text:"```diff\n"+c(i).suggestedFix.patch+"\n```"},null,8,["text"]),c(E)&&(c(E).status==="stale-file"||c(E).status==="invalid")?(p(),f("p",tr,w(c(E).errors[0]||"This patch could not be verified against the source."),1)):$("",!0)])):c(i).suggestedFix.code?(p(),f("div",sr,[S(Ct,{code:c(i).suggestedFix.code},null,8,["code"])])):$("",!0)])):$("",!0),c(ze).length?(p(),f("div",nr,[x("div",rr,[x("button",{class:"flex items-center gap-1.5 text-xs font-medium text-gray-500 uppercase tracking-wide hover:text-gray-700 dark:hover:text-gray-300",onClick:g[1]||(g[1]=I=>xe.value=!c(xe))},[S(M,{name:c(xe)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3.5"},null,8,["name"]),R(" Other hypotheses considered ("+w(c(ze).length)+") ",1)]),S(A,{topic:"cluster.hypotheses"})]),c(xe)?(p(),f("div",ir,[(p(!0),f(j,null,Y(c(ze),(I,U)=>(p(),f("div",{key:U,class:"rounded-md border border-default bg-elevated/40 px-2.5 py-1.5"},[x("div",ar,[I.category?(p(),N(D,{key:0,color:le[I.category]||"neutral",variant:"subtle",size:"sm"},{default:Q(()=>[R(w(I.category),1)]),_:2},1032,["color"])):$("",!0),typeof I.likelihood=="number"?(p(),f("div",or,[x("div",lr,[x("div",{class:"h-full rounded-full bg-gray-400 dark:bg-gray-500",style:rt({width:`${I.likelihood}%`})},null,4)]),x("span",cr,w(I.likelihood)+"/100",1)])):$("",!0)]),I.rootCause?(p(),f("p",ur,w(I.rootCause),1)):$("",!0)]))),128))])):$("",!0)])):$("",!0),c(i)?.investigationSteps?.length?(p(),f("div",{key:4,class:J(["space-y-1.5",c(de)?"rounded-lg border border-amber-300/60 dark:border-amber-500/30 bg-amber-50/60 dark:bg-amber-500/10 p-3":""])},[x("p",{class:J(["text-xs font-medium uppercase tracking-wide flex items-center gap-1.5",c(de)?"text-amber-700 dark:text-amber-400":"text-gray-500"])},[c(de)?(p(),N(M,{key:0,name:"i-lucide-flask-conical",class:"size-3.5 shrink-0"})):$("",!0),R(" "+w(c(de)?"Low confidence — gather more evidence":"To confirm this diagnosis"),1)],2),x("ul",pr,[(p(!0),f(j,null,Y(c(i).investigationSteps,(I,U)=>(p(),f("li",{key:U,class:J(["text-sm flex gap-2 items-start cursor-pointer select-none",c(_).has(Number(U))?"text-gray-400 dark:text-gray-500 line-through":"text-gray-600 dark:text-gray-400"]),onClick:se=>c(_).has(Number(U))?c(_).delete(Number(U)):c(_).add(Number(U))},[S(M,{name:c(_).has(Number(U))?"i-lucide-check-square":"i-lucide-square",class:J(["size-4 shrink-0 mt-0.5",c(_).has(Number(U))?"text-primary":"text-gray-400"])},null,8,["name","class"]),R(" "+w(I),1)],10,dr))),128))]),c(de)?(p(),N(Z,{key:0,size:"xs",color:"warning",variant:"soft",icon:"i-lucide-clipboard-pen",class:"mt-1",title:"Pre-fill the additional-context box with these checks, then re-diagnose",onClick:vt},{default:Q(()=>[...g[10]||(g[10]=[R(" Add to context & refine ",-1)])]),_:1})):$("",!0)],2)):$("",!0),c(i)?.preventionTips?.length?(p(),f("ul",hr,[g[11]||(g[11]=x("li",{class:"text-xs font-medium text-gray-500 uppercase tracking-wide"},"Prevention tips",-1)),(p(!0),f(j,null,Y(c(i).preventionTips,(I,U)=>(p(),f("li",{key:U,class:"text-sm text-gray-600 dark:text-gray-400 flex gap-1.5"},[S(M,{name:"i-lucide-lightbulb",class:"size-3.5 shrink-0 mt-0.5 text-yellow-500"}),R(" "+w(I),1)]))),128))])):$("",!0),x("div",gr,[x("div",fr,[x("div",kr,[S(Z,{icon:(c(b)==="up","i-lucide-thumbs-up"),color:c(b)==="up"?"success":"neutral",variant:"ghost",size:"xs",loading:c(d),onClick:g[2]||(g[2]=I=>H("up"))},null,8,["icon","color","loading"]),S(Z,{icon:(c(b)==="down","i-lucide-thumbs-down"),color:c(b)==="down"?"error":"neutral",variant:"ghost",size:"xs",loading:c(d),onClick:g[3]||(g[3]=I=>H("down"))},null,8,["icon","color","loading"]),c(b)?(p(),f("button",{key:0,class:"text-xs text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 ml-1 transition-colors",onClick:g[4]||(g[4]=I=>m.value=!c(m))},[S(M,{name:c(m)?"i-lucide-chevron-up":"i-lucide-chevron-down",class:"size-3"},null,8,["name"]),R(" "+w(c(z)?"Edit note":"Note"),1)])):$("",!0)]),c(m)?(p(),f("div",xr,[S(At,{modelValue:c(z),"onUpdate:modelValue":g[5]||(g[5]=I=>Et(z)?z.value=I:null),size:"xs",placeholder:"Add a note about this feedback…",class:"max-w-64",ui:{base:"text-xs"},rows:2},null,8,["modelValue"]),S(Z,{size:"xs",color:"primary",variant:"solid",loading:c(h),onClick:v},{default:Q(()=>[...g[12]||(g[12]=[R(" Save ",-1)])]),_:1},8,["loading"])])):$("",!0)]),x("div",mr,[c(Ie).length>1?(p(),N(D,{key:0,color:"neutral",variant:"subtle",size:"sm",icon:"i-lucide-workflow",title:c(Ie).map(I=>`${I.role}: ${I.model}`).join(" → ")},{default:Q(()=>[...g[13]||(g[13]=[R(" 2-stage ",-1)])]),_:1},8,["title"])):$("",!0),x("span",null,[R(w(t.diagnosis.model)+" · "+w(l(t.diagnosis.inputTokens,t.diagnosis.outputTokens)),1),c(Ge)>0?(p(),f(j,{key:0},[R(" ("+w(c(Ge))+" cached)",1)],64)):$("",!0),R(" · "+w(c(Dt)(t.diagnosis.updatedAt)),1)])])])])):$("",!0),t.diagnosis?$("",!0):(p(),f("div",br,[S(M,{name:"i-lucide-sparkles",class:"size-8 mb-2 opacity-30"}),g[14]||(g[14]=x("p",{class:"text-sm"},"Diagnosis will appear here",-1))]))])}}}),Fr=Object.assign(yr,{__name:"DiagnosisResult"});export{zr as _,at as a,Er as b,Rn as c,Dr as d,Fr as e,qr as f,Lr as g,Br as h,Ir as i,Pr as s,Ot as u};
@@ -0,0 +1 @@
1
+ import{d as v,o as n,e as b,m as F,b as s,f as p,h as u,i as x,_ as y,k as I,t as f,c as r,l as m,U as g,K as H,g as _,E as B,F as k,z as N,L as O,r as T,v as h}from"./1QWBzxLM.js";import{k as D,F as P,E,l as R}from"./D4mPjHHR.js";import{_ as $}from"./B82vqOZe.js";import{_ as G}from"./e-GZmCeP.js";import{_ as q}from"./DMqAUHFN.js";import{_ as K}from"./BIlohx1E.js";const A=v({__name:"StatusChip",props:{status:{},size:{}},setup(e){return(t,l)=>{const c=y,d=F;return n(),b(d,{color:("getStatusColor"in t?t.getStatusColor:s(D))(e.status),size:e.size,variant:"subtle",class:"capitalize gap-1 items-center font-semibold shrink-0"},{default:p(()=>[u(c,{name:("getStatusIcon"in t?t.getStatusIcon:s(E))(e.status),class:x(["size-3.5 shrink-0",{"animate-spin":("isStatusInFlight"in t?t.isStatusInFlight:s(P))(e.status)}])},null,8,["name","class"]),I(" "+f(("formatStatusLabel"in t?t.formatStatusLabel:s(R))(e.status)),1)]),_:1},8,["color","size"])}}}),re=Object.assign(A,{__name:"StatusChip"}),J=["aria-label"],Q=v({__name:"MetaStripGroup",props:{label:{},icon:{},help:{}},setup(e){return(t,l)=>{const c=y,d=$;return n(),r("div",{role:"group","aria-label":e.label,class:"inline-flex items-center flex-wrap gap-x-1.5 gap-y-1 min-w-0 py-0.5 mr-3 [&:not(:first-child)]:border-l [&:not(:first-child)]:border-default [&:not(:first-child)]:pl-3"},[e.icon?(n(),b(c,{key:0,name:e.icon,class:"w-3.5 h-3.5 text-dimmed shrink-0"},null,8,["name"])):m("",!0),g(t.$slots,"default"),e.help?(n(),b(d,{key:1,topic:e.help},null,8,["topic"])):m("",!0)],8,J)}}}),ue=Object.assign(Q,{__name:"MetaStripGroup"}),W={class:"flex flex-wrap items-center gap-y-1 text-sm min-w-0"},X=v({__name:"SummaryMetaStrip",setup(e){return(t,l)=>(n(),r("div",W,[g(t.$slots,"default")]))}}),me=Object.assign(X,{__name:"SummaryMetaStrip"}),Y={class:"flex flex-col h-full gap-4 p-1 max-lg:overflow-y-auto lg:overflow-hidden"},Z={key:0,class:"lg:shrink-0"},ee={class:"lg:shrink-0 max-lg:sticky max-lg:top-0 max-lg:z-10 max-lg:-mx-1 max-lg:bg-(--ui-bg-canvas) max-lg:px-1 max-lg:py-1.5"},te=["title"],ae=v({__name:"DetailPageLayout",props:O({tabItems:{},tabPanelClass:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,l=H(e,"modelValue"),c=T(!1),d=h(()=>t.tabItems.find(i=>i.value===l.value)?.icon);function w(i){return["min-h-0","lg:flex-1",t.tabPanelClass?.[i]??"overflow-y-auto","max-lg:!block","max-lg:!overflow-visible"].join(" ")}const C=h(()=>t.tabItems.map(({slot:i,...o})=>({...o,active:l.value===o.value,"aria-current":l.value===o.value?"true":void 0,onSelect:()=>{o.disabled||(l.value=o.value)}}))),S=h(()=>t.tabItems.find(i=>i.value===l.value)?.help);return(i,o)=>{const z=y,V=G,U=q,M=$,L=B,j=K;return n(),r("div",Y,[i.$slots.summary?(n(),r("div",Z,[_("div",{class:x(s(c)?"max-lg:hidden":"")},[g(i.$slots,"summary")],2),_("button",{type:"button",class:"lg:hidden mt-2 w-full flex items-center justify-center gap-1 rounded-md border border-default py-1.5 text-xs font-medium text-muted hover:bg-elevated/60 transition-colors",onClick:o[0]||(o[0]=a=>c.value=!s(c))},[u(z,{name:s(c)?"i-lucide-chevron-down":"i-lucide-chevron-up",class:"size-3.5"},null,8,["name"]),I(" "+f(s(c)?"Show summary":"Hide summary"),1)])])):m("",!0),_("div",ee,[u(V,{modelValue:l.value,"onUpdate:modelValue":o[1]||(o[1]=a=>l.value=a),items:e.tabItems,icon:s(d),size:"md","aria-label":"Select tab",class:"w-full sm:hidden"},null,8,["modelValue","items","icon"]),u(j,{class:"hidden sm:block p-1"},{default:p(()=>[u(U,{items:s(C),highlight:"",class:"-mx-1 flex-1",ui:{list:"overflow-x-auto",root:"min-w-0"}},{"item-label":p(({item:a})=>[_("span",null,f(a.label),1),a.disabled&&a.disabledReason?(n(),r("span",{key:0,title:a.disabledReason,class:"ml-1.5 font-normal opacity-70"},f(a.disabledReason),9,te)):m("",!0)]),_:1},8,["items"]),u(L,null,{default:p(()=>[s(S)?(n(),b(M,{key:0,topic:s(S),class:"ml-2 shrink-0"},null,8,["topic"])):m("",!0)]),_:1})]),_:1})]),(n(!0),r(k,null,N(e.tabItems,a=>(n(),r(k,{key:a.value},[l.value===a.value?(n(),r("div",{key:0,class:x(w(a.value))},[g(i.$slots,`tab-${a.slot??a.value}`)],2)):m("",!0)],64))),128))])}}}),de=Object.assign(ae,{__name:"DetailPageLayout"});export{re as _,me as a,ue as b,de as c};
@@ -1 +1 @@
1
- import{b3 as q,q as x,b4 as z,J as b,b5 as E,ae as L,v as d,ab as r,b6 as y,b7 as S}from"./BdQ7kfxJ.js";function G(t={}){const{copy:c,copied:e,isSupported:a}=q({copiedDuring:t.duration??2e3,legacy:!0}),n=x();async function o(s,i={}){if(s){try{await c(s)}catch{return}i.toast&&n.add({title:typeof i.toast=="string"?i.toast:"Copied to clipboard",icon:"i-lucide-check",color:"success",duration:2e3})}}return{copy:o,copied:e,isSupported:a}}function T(t){const c=[r(t.method)?.toUpperCase()||"GET",r(t.baseURL)];for(const e of[t.query||t.params]){const a=r(e);if(!a)continue;const n={};for(const[o,s]of Object.entries(a))n[r(o)]=r(s);c.push(n)}if(t.body){const e=r(t.body);if(!e)c.push(y(e));else if(e instanceof ArrayBuffer)c.push(y(Object.fromEntries([...new Uint8Array(e).entries()].map(([a,n])=>[a,n.toString()]))));else if(e instanceof FormData){const a=[];for(const n of e.entries()){const[o,s]=n;a.push([o,s instanceof File?`${s.name}:${s.size}:${s.lastModified}`:s])}c.push(y(a))}else if(S(e))c.push(y(b(e)));else try{c.push(y(e))}catch{console.warn("[useFetch] Failed to hash body",e)}}return c}const m=z({name:"createUseFetch",factory(t={}){function c(e,a,n){const[o={},s]=typeof a=="string"?[{},a]:[a,n],i=typeof t=="function"?t(o):t,{server:_,lazy:v,default:F,transform:g,pick:w,watch:h,immediate:D,getCachedData:O,deep:$,dedupe:k,timeout:U,...u}={...typeof t=="function"?{}:i,...o,...typeof t=="function"?i:{}},f=d(()=>r(e)),C=d(()=>r(u.key)||"$f"+y([s,typeof f.value=="string"?f.value:"",...T(u)]));if(!u.baseURL&&typeof f.value=="string"&&f.value[0]==="/"&&f.value[1]==="/")throw new Error('[nuxt] [useFetch] the request URL must not start with "//".');const l=b({...E,...u,cache:typeof u.cache=="boolean"?void 0:u.cache}),p={server:_,lazy:v,default:F,transform:g,pick:w,immediate:D,getCachedData:O,deep:$,dedupe:k,timeout:U,watch:h===!1?[]:[...h||[],l]};return h===!1&&(p._keyTriggersExecute=!1),L(C,(R,{signal:j})=>(u.$fetch||globalThis.$fetch)(f.value,{signal:j,...l}),p)}return c}}),J=m.__nuxt_factory();m.__nuxt_factory({lazy:!0,_functionName:"useLazyFetch"});export{G as a,J as u};
1
+ import{b3 as q,q as x,b4 as z,J as b,b5 as E,ae as L,v as d,ab as r,b6 as y,b7 as S}from"./1QWBzxLM.js";function G(t={}){const{copy:c,copied:e,isSupported:a}=q({copiedDuring:t.duration??2e3,legacy:!0}),n=x();async function o(s,i={}){if(s){try{await c(s)}catch{return}i.toast&&n.add({title:typeof i.toast=="string"?i.toast:"Copied to clipboard",icon:"i-lucide-check",color:"success",duration:2e3})}}return{copy:o,copied:e,isSupported:a}}function T(t){const c=[r(t.method)?.toUpperCase()||"GET",r(t.baseURL)];for(const e of[t.query||t.params]){const a=r(e);if(!a)continue;const n={};for(const[o,s]of Object.entries(a))n[r(o)]=r(s);c.push(n)}if(t.body){const e=r(t.body);if(!e)c.push(y(e));else if(e instanceof ArrayBuffer)c.push(y(Object.fromEntries([...new Uint8Array(e).entries()].map(([a,n])=>[a,n.toString()]))));else if(e instanceof FormData){const a=[];for(const n of e.entries()){const[o,s]=n;a.push([o,s instanceof File?`${s.name}:${s.size}:${s.lastModified}`:s])}c.push(y(a))}else if(S(e))c.push(y(b(e)));else try{c.push(y(e))}catch{console.warn("[useFetch] Failed to hash body",e)}}return c}const m=z({name:"createUseFetch",factory(t={}){function c(e,a,n){const[o={},s]=typeof a=="string"?[{},a]:[a,n],i=typeof t=="function"?t(o):t,{server:_,lazy:v,default:F,transform:g,pick:w,watch:h,immediate:D,getCachedData:O,deep:$,dedupe:k,timeout:U,...u}={...typeof t=="function"?{}:i,...o,...typeof t=="function"?i:{}},f=d(()=>r(e)),C=d(()=>r(u.key)||"$f"+y([s,typeof f.value=="string"?f.value:"",...T(u)]));if(!u.baseURL&&typeof f.value=="string"&&f.value[0]==="/"&&f.value[1]==="/")throw new Error('[nuxt] [useFetch] the request URL must not start with "//".');const l=b({...E,...u,cache:typeof u.cache=="boolean"?void 0:u.cache}),p={server:_,lazy:v,default:F,transform:g,pick:w,immediate:D,getCachedData:O,deep:$,dedupe:k,timeout:U,watch:h===!1?[]:[...h||[],l]};return h===!1&&(p._keyTriggersExecute=!1),L(C,(R,{signal:j})=>(u.$fetch||globalThis.$fetch)(f.value,{signal:j,...l}),p)}return c}}),J=m.__nuxt_factory();m.__nuxt_factory({lazy:!0,_functionName:"useLazyFetch"});export{G as a,J as u};