specrails-desktop 2.12.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (401) hide show
  1. package/README.md +3 -2
  2. package/client/dist/assets/ActivityFeedPage-D0-P3PsD.js +1 -0
  3. package/client/dist/assets/AgentsPage-BZa3lhQM.js +86 -0
  4. package/client/dist/assets/AnalyticsPage-CgaEg-lx.js +1 -0
  5. package/client/dist/assets/BarChart-D9vfeilz.js +33 -0
  6. package/client/dist/assets/CodePage-2GUsF_JS.js +2 -0
  7. package/client/dist/assets/DesktopAnalyticsPage-C6Qccm5E.js +1 -0
  8. package/client/dist/assets/DocsDialog-BAmtk9Jc.js +11 -0
  9. package/client/dist/assets/DocsPage-CJwnpB57.js +11 -0
  10. package/client/dist/assets/{ExportDropdown-I_8R48Yq.js → ExportDropdown-DMJ__Yui.js} +1 -1
  11. package/client/dist/assets/IntegrationsPage-CP2VcOpr.js +3 -0
  12. package/client/dist/assets/JobDetailPage-Bk6tQTew.js +16 -0
  13. package/client/dist/assets/JobsPage-BvbeqWjS.js +1 -0
  14. package/client/dist/assets/LoopBuilderPage-BS3enu9N.js +7 -0
  15. package/client/dist/assets/LoopBuilderPage-DtxX27Jz.css +1 -0
  16. package/client/dist/assets/LoopsPage-B0pgvoky.js +2 -0
  17. package/client/dist/assets/analytics-BHApBnUn.js +1 -0
  18. package/client/dist/assets/analytics-BUxrug9J.js +1 -0
  19. package/client/dist/assets/analytics-Cy6DTfO-.js +1 -0
  20. package/client/dist/assets/analytics-DMJxD9FD.js +1 -0
  21. package/client/dist/assets/analytics-DgrBuxla.js +1 -0
  22. package/client/dist/assets/analytics-DwxT1CS8.js +1 -0
  23. package/client/dist/assets/analytics-GrLc-SMr.js +1 -0
  24. package/client/dist/assets/analytics-qvPq4T4h.js +1 -0
  25. package/client/dist/assets/atom-one-dark-DrWoEEbZ.js +1 -0
  26. package/client/dist/assets/auth-Cvsb7-Ek.js +1 -0
  27. package/client/dist/assets/{cssMode-DzNPAYFh.js → cssMode-DSHXamUH.js} +1 -1
  28. package/client/dist/assets/dashboard-8FSyxKGV.js +1 -0
  29. package/client/dist/assets/dashboard-A9XQUfdS.js +1 -0
  30. package/client/dist/assets/dashboard-BFktSDsV.js +1 -0
  31. package/client/dist/assets/dashboard-C1PKCXLs.js +1 -0
  32. package/client/dist/assets/dashboard-DNf0czU-.js +1 -0
  33. package/client/dist/assets/dashboard-DQQCOVfu.js +1 -0
  34. package/client/dist/assets/dashboard-DxFqeHZk.js +1 -0
  35. package/client/dist/assets/dashboard-WvPGhbbi.js +1 -0
  36. package/client/dist/assets/{dist-js-DXfIbU9U.js → dist-js-_oLAsZQ4.js} +1 -1
  37. package/client/dist/assets/{dist-js-CtdZvl0R.js → dist-js-o4iwbCuN.js} +1 -1
  38. package/client/dist/assets/{editor.main-C7Rmw-hR.js → editor.main-Cd8qBRAT.js} +2 -2
  39. package/client/dist/assets/{freemarker2-Cszs4SVo.js → freemarker2-CkEKTBm2.js} +1 -1
  40. package/client/dist/assets/{handlebars-Dp7Lsuym.js → handlebars-BRGx0JpL.js} +1 -1
  41. package/client/dist/assets/{html-BURidrEm.js → html-BfRIaGgN.js} +1 -1
  42. package/client/dist/assets/{htmlMode--k5M7GjZ.js → htmlMode-BTpSnsDE.js} +1 -1
  43. package/client/dist/assets/index-DrFJinsI.css +2 -0
  44. package/client/dist/assets/index-QEeqwz4v.js +143 -0
  45. package/client/dist/assets/{javascript-kJQz__44.js → javascript-DMmE2kKN.js} +1 -1
  46. package/client/dist/assets/{jsonMode-v5JYPpnz.js → jsonMode-hYuaUleY.js} +1 -1
  47. package/client/dist/assets/{lib-BBoUS-5a.js → lib-CVrpo1ac.js} +2 -2
  48. package/client/dist/assets/{liquid-Dl9I6gWt.js → liquid-C-VbuTr7.js} +1 -1
  49. package/client/dist/assets/loops-B1ZQCKEk.js +1 -0
  50. package/client/dist/assets/loops-Bp5yTSic.js +1 -0
  51. package/client/dist/assets/loops-BvoL_LAc.js +1 -0
  52. package/client/dist/assets/loops-BwgehdXY.js +1 -0
  53. package/client/dist/assets/loops-CMLUqUpc.js +1 -0
  54. package/client/dist/assets/loops-CW69VvTI.js +1 -0
  55. package/client/dist/assets/loops-DkV2RhEb.js +1 -0
  56. package/client/dist/assets/loops-arQ602Zm.js +1 -0
  57. package/client/dist/assets/{lspLanguageFeatures-CPlEe0NK.js → lspLanguageFeatures-BALx-vjn.js} +1 -1
  58. package/client/dist/assets/{mdx-Byl7TtzQ.js → mdx-Cs8MNCzn.js} +1 -1
  59. package/client/dist/assets/{monaco.contribution-YMAkHQcQ.js → monaco.contribution-CIvCAJs4.js} +2 -2
  60. package/client/dist/assets/nav-B5W9IMnf.js +1 -0
  61. package/client/dist/assets/nav-CCz4krPP.js +1 -0
  62. package/client/dist/assets/nav-CrG_mYRr.js +1 -0
  63. package/client/dist/assets/nav-Cw3_40fA.js +1 -0
  64. package/client/dist/assets/nav-DNDJ3H-_.js +1 -0
  65. package/client/dist/assets/nav-DVp1nEsi.js +1 -0
  66. package/client/dist/assets/nav-DbAbG5_k.js +1 -0
  67. package/client/dist/assets/nav-_0vAgZ_k.js +1 -0
  68. package/client/dist/assets/{python-jWQwT6j2.js → python-CGShLxuI.js} +1 -1
  69. package/client/dist/assets/{razor-BWS3sP-E.js → razor-CvOBQGd5.js} +1 -1
  70. package/client/dist/assets/{setup-Cpu17hJv.js → setup-BOmQ4vh2.js} +1 -1
  71. package/client/dist/assets/setup-BwO2-kuK.js +1 -0
  72. package/client/dist/assets/{setup-D-1r0uSx.js → setup-CUTNWz-0.js} +1 -1
  73. package/client/dist/assets/{setup-BHroXlke.js → setup-Cf3hjChU.js} +1 -1
  74. package/client/dist/assets/{setup-BIXsWUp1.js → setup-CsuXrbJ2.js} +1 -1
  75. package/client/dist/assets/{setup-B6egeeTM.js → setup-Df4cJOqu.js} +1 -1
  76. package/client/dist/assets/{setup-C0rVGnCy.js → setup-Do0fWx6W.js} +1 -1
  77. package/client/dist/assets/{setup-BJRdg1iE.js → setup-GlkDhBlJ.js} +1 -1
  78. package/client/dist/assets/{tsMode-BbOGOuSV.js → tsMode-04uOpiiP.js} +1 -1
  79. package/client/dist/assets/{typescript-eBtFQJLs.js → typescript-CX0CwyIZ.js} +1 -1
  80. package/client/dist/assets/upload-Dn9N1ESQ.js +1 -0
  81. package/client/dist/assets/value-Bd3Cf9Sr.js +1 -0
  82. package/client/dist/assets/{workers-BvicOoDf.js → workers-yr2u4c3C.js} +1 -1
  83. package/client/dist/assets/{xml-BJepAPyM.js → xml-C0OFlt5X.js} +1 -1
  84. package/client/dist/assets/{yaml-DabgV-eA.js → yaml-DgabaPs5.js} +1 -1
  85. package/client/dist/index.html +28 -26
  86. package/docs/getting-started.md +3 -2
  87. package/docs/guide/de/pipeline/1-rails-and-jobs.md +27 -22
  88. package/docs/guide/de/pipeline/5-the-loop-builder.md +91 -0
  89. package/docs/guide/en/pipeline/1-rails-and-jobs.md +11 -6
  90. package/docs/guide/en/pipeline/5-the-loop-builder.md +91 -0
  91. package/docs/guide/es/pipeline/1-rails-and-jobs.md +11 -6
  92. package/docs/guide/es/pipeline/5-the-loop-builder.md +91 -0
  93. package/docs/guide/fr/pipeline/1-rails-and-jobs.md +40 -35
  94. package/docs/guide/fr/pipeline/5-the-loop-builder.md +91 -0
  95. package/docs/guide/it/pipeline/1-rails-and-jobs.md +11 -6
  96. package/docs/guide/it/pipeline/5-the-loop-builder.md +91 -0
  97. package/docs/guide/ja/pipeline/1-rails-and-jobs.md +11 -6
  98. package/docs/guide/ja/pipeline/5-the-loop-builder.md +91 -0
  99. package/docs/guide/pt/pipeline/1-rails-and-jobs.md +50 -45
  100. package/docs/guide/pt/pipeline/5-the-loop-builder.md +91 -0
  101. package/docs/guide/zh/pipeline/1-rails-and-jobs.md +13 -8
  102. package/docs/guide/zh/pipeline/5-the-loop-builder.md +91 -0
  103. package/docs/internals/companion-rails-as-loops-contract.md +199 -0
  104. package/docs/internals/global-artifacts-alignment-contract.md +2 -0
  105. package/docs/running-pipelines.md +25 -14
  106. package/package.json +1 -1
  107. package/server/dist/ai-invocations.js +5 -3
  108. package/server/dist/db.js +45 -0
  109. package/server/dist/desktop-db.js +48 -0
  110. package/server/dist/desktop-router.js +10 -0
  111. package/server/dist/feature-flags.js +13 -0
  112. package/server/dist/loop-command-catalog.js +145 -0
  113. package/server/dist/loop-constants.js +82 -0
  114. package/server/dist/loop-decider.js +66 -0
  115. package/server/dist/loop-executors.js +193 -0
  116. package/server/dist/loop-factory.js +56 -0
  117. package/server/dist/loop-graph.js +144 -0
  118. package/server/dist/loop-preview.js +69 -0
  119. package/server/dist/loop-run-manager.js +407 -0
  120. package/server/dist/loop-runs-store.js +69 -0
  121. package/server/dist/loop-templates.js +137 -0
  122. package/server/dist/loops-router.js +302 -0
  123. package/server/dist/loops-store.js +137 -0
  124. package/server/dist/mobile/mobile-router.js +22 -0
  125. package/server/dist/mobile/mobile-ws.js +17 -1
  126. package/server/dist/project-registry.js +103 -1
  127. package/server/dist/project-router-jobs.js +11 -1
  128. package/server/dist/project-router-loop-runs.js +102 -0
  129. package/server/dist/project-router.js +2 -0
  130. package/server/dist/providers/claude-adapter.js +4 -0
  131. package/server/dist/providers/codex-adapter.js +21 -0
  132. package/server/dist/providers/gemini-adapter.js +4 -0
  133. package/server/dist/rails-router.js +175 -6
  134. package/server/dist/spending.js +5 -2
  135. package/server/dist/util/cli-prompt.js +6 -3
  136. package/client/dist/assets/ActivityFeedPage-B9-UAGS7.js +0 -1
  137. package/client/dist/assets/AgentsPage-Bz9rophT.js +0 -86
  138. package/client/dist/assets/AnalyticsPage-D3ynQwGd.js +0 -1
  139. package/client/dist/assets/BarChart-Cwp6VuED.js +0 -33
  140. package/client/dist/assets/CodePage-CO_TLOvi.js +0 -2
  141. package/client/dist/assets/DesktopAnalyticsPage-BMDqiAbw.js +0 -1
  142. package/client/dist/assets/DocsDialog-B-chJn-f.js +0 -11
  143. package/client/dist/assets/DocsPage-BcJwYo20.js +0 -11
  144. package/client/dist/assets/IntegrationsPage-Bd4l3L6u.js +0 -3
  145. package/client/dist/assets/JobDetailPage-Dt3jLjS4.js +0 -16
  146. package/client/dist/assets/JobsPage-DcWpJbBc.js +0 -1
  147. package/client/dist/assets/analytics-BeTyviO8.js +0 -1
  148. package/client/dist/assets/analytics-C4eEO260.js +0 -1
  149. package/client/dist/assets/analytics-C67cIA1b.js +0 -1
  150. package/client/dist/assets/analytics-CAguvW28.js +0 -1
  151. package/client/dist/assets/analytics-DBtt8Mgk.js +0 -1
  152. package/client/dist/assets/analytics-DMCto-TF.js +0 -1
  153. package/client/dist/assets/analytics-DUPtODxX.js +0 -1
  154. package/client/dist/assets/analytics-YIpQvPAc.js +0 -1
  155. package/client/dist/assets/dashboard--Ahnvfr3.js +0 -1
  156. package/client/dist/assets/dashboard-BN1C2pEh.js +0 -1
  157. package/client/dist/assets/dashboard-BZs_EzAn.js +0 -1
  158. package/client/dist/assets/dashboard-Bsw44L8_.js +0 -1
  159. package/client/dist/assets/dashboard-Bw3VECgY.js +0 -1
  160. package/client/dist/assets/dashboard-CuOshSHn.js +0 -1
  161. package/client/dist/assets/dashboard-DfouCM3_.js +0 -1
  162. package/client/dist/assets/dashboard-Pp5hwnZB.js +0 -1
  163. package/client/dist/assets/index-BEGU2TCx.js +0 -143
  164. package/client/dist/assets/index-B_Zqeoa5.css +0 -2
  165. package/client/dist/assets/nav-B05EYB0b.js +0 -1
  166. package/client/dist/assets/nav-BNGCq-0y.js +0 -1
  167. package/client/dist/assets/nav-BRInPX8a.js +0 -1
  168. package/client/dist/assets/nav-Bf87DRHD.js +0 -1
  169. package/client/dist/assets/nav-BkVzzFpc.js +0 -1
  170. package/client/dist/assets/nav-BzFLtS1W.js +0 -1
  171. package/client/dist/assets/nav-DBDbQOYn.js +0 -1
  172. package/client/dist/assets/nav-X9sVtUWC.js +0 -1
  173. package/client/dist/assets/setup-Dn2-veYO.js +0 -1
  174. /package/client/dist/assets/{abap-s65oMlhi.js → abap-CK68cr9-.js} +0 -0
  175. /package/client/dist/assets/{activity-Cyy07Tgo.js → activity-B2MvEH54.js} +0 -0
  176. /package/client/dist/assets/{activity-qFTcMyW9.js → activity-BbNkUmW4.js} +0 -0
  177. /package/client/dist/assets/{activity-DlbWCa4y.js → activity-C7VdmeGb.js} +0 -0
  178. /package/client/dist/assets/{activity-Dv6H7wEr.js → activity-Ca2XoBi-.js} +0 -0
  179. /package/client/dist/assets/{activity-C8qqEIoP.js → activity-D4dhNEwO.js} +0 -0
  180. /package/client/dist/assets/{activity-Dwq0heud.js → activity-DHjfmAyT.js} +0 -0
  181. /package/client/dist/assets/{activity-CZVM4nlJ.js → activity-Di2f50_Z.js} +0 -0
  182. /package/client/dist/assets/{activity-BqqwnH_h.js → activity-usnNa7FX.js} +0 -0
  183. /package/client/dist/assets/{addon-image-CpF0L0jM.js → addon-image-biWX2UUm.js} +0 -0
  184. /package/client/dist/assets/{addon-ligatures-hXysGZrA.js → addon-ligatures-D4EiDb5r.js} +0 -0
  185. /package/client/dist/assets/{addon-webgl-Cn1slavz.js → addon-webgl-CDCIZQ03.js} +0 -0
  186. /package/client/dist/assets/{addspec-RuL8Zd7w.js → addspec-1HEtmLv1.js} +0 -0
  187. /package/client/dist/assets/{addspec-DDvvnE6N.js → addspec-BxMn39wn.js} +0 -0
  188. /package/client/dist/assets/{addspec-xjDbYZWL.js → addspec-CNyAUGz_.js} +0 -0
  189. /package/client/dist/assets/{addspec-CIGb34PS.js → addspec-CO1xv6BL.js} +0 -0
  190. /package/client/dist/assets/{addspec-BErjOdNK.js → addspec-DAveBiCE.js} +0 -0
  191. /package/client/dist/assets/{addspec-C_3NBarY.js → addspec-DE_VfIyP.js} +0 -0
  192. /package/client/dist/assets/{addspec-B-BKlvDj.js → addspec-DfuR6EAl.js} +0 -0
  193. /package/client/dist/assets/{addspec-rmhOaH7N.js → addspec-IozoiiGs.js} +0 -0
  194. /package/client/dist/assets/{agents-BDx1RXcl.js → agents-1lhqEcXH.js} +0 -0
  195. /package/client/dist/assets/{agents-BFr3kUhK.js → agents-BYjUOrLD.js} +0 -0
  196. /package/client/dist/assets/{agents-CMxtJMLD.js → agents-CIhRSOna.js} +0 -0
  197. /package/client/dist/assets/{agents-DcxZHzNr.js → agents-CQlu1nOm.js} +0 -0
  198. /package/client/dist/assets/{agents-BlPnx-mz.js → agents-DCX9D3-Q.js} +0 -0
  199. /package/client/dist/assets/{agents-23iPejcA.js → agents-DVYpVGur.js} +0 -0
  200. /package/client/dist/assets/{agents-B_1L9xRg.js → agents-DcoUUFZl.js} +0 -0
  201. /package/client/dist/assets/{agents-G3shOewU.js → agents-Jc-CjBDB.js} +0 -0
  202. /package/client/dist/assets/{agentstudio-kk9RB7Se.js → agentstudio-1E-bag77.js} +0 -0
  203. /package/client/dist/assets/{agentstudio-Bk1eZcv4.js → agentstudio-9NbsoGXk.js} +0 -0
  204. /package/client/dist/assets/{agentstudio-Y3G0ddJ2.js → agentstudio-B-jQgYV-.js} +0 -0
  205. /package/client/dist/assets/{agentstudio-B-CMAQqy.js → agentstudio-B1y0JWY-.js} +0 -0
  206. /package/client/dist/assets/{agentstudio-DpP9caEE.js → agentstudio-Bwa72b1S.js} +0 -0
  207. /package/client/dist/assets/{agentstudio-CxlUllqI.js → agentstudio-DCTpIqOx.js} +0 -0
  208. /package/client/dist/assets/{agentstudio-DNlme601.js → agentstudio-DCyDW8sy.js} +0 -0
  209. /package/client/dist/assets/{agentstudio-ChxNuGAu.js → agentstudio-Q0Sq_jTg.js} +0 -0
  210. /package/client/dist/assets/{aiedit-DrfzQroF.js → aiedit-CGxeml8D.js} +0 -0
  211. /package/client/dist/assets/{aiedit-De0SOH6S.js → aiedit-CfBNanHE.js} +0 -0
  212. /package/client/dist/assets/{aiedit-BBCrOpHq.js → aiedit-CvSspQmE.js} +0 -0
  213. /package/client/dist/assets/{aiedit-fMltW101.js → aiedit-DSLtsYIu.js} +0 -0
  214. /package/client/dist/assets/{aiedit-BMtcGYNE.js → aiedit-DUpe7NxI.js} +0 -0
  215. /package/client/dist/assets/{aiedit-TTwzL1TS.js → aiedit-Dirqf3Bm.js} +0 -0
  216. /package/client/dist/assets/{aiedit-5ETerMK1.js → aiedit-kAU7KADg.js} +0 -0
  217. /package/client/dist/assets/{aiedit-D9ddlgkM.js → aiedit-qTGI_PGs.js} +0 -0
  218. /package/client/dist/assets/{apex-BLUBIldB.js → apex-BHHyAVNb.js} +0 -0
  219. /package/client/dist/assets/{attachments-CHaDUfjB.js → attachments-3CuBBRFu.js} +0 -0
  220. /package/client/dist/assets/{attachments-DazTVJbH.js → attachments-BLqqPGyy.js} +0 -0
  221. /package/client/dist/assets/{attachments-CCWasu-P.js → attachments-BNgH6Tcu.js} +0 -0
  222. /package/client/dist/assets/{attachments-BIsSSnHJ.js → attachments-C2JPppoP.js} +0 -0
  223. /package/client/dist/assets/{attachments-CVSAbGNl.js → attachments-CppM7de8.js} +0 -0
  224. /package/client/dist/assets/{attachments-Chg5poG1.js → attachments-D5fVsMgb.js} +0 -0
  225. /package/client/dist/assets/{attachments-Dn-JImAK.js → attachments-UJtEq892.js} +0 -0
  226. /package/client/dist/assets/{attachments-LDA9kp2X.js → attachments-pW3zm9nu.js} +0 -0
  227. /package/client/dist/assets/{azcli-DuWxh9mO.js → azcli-C56lfIEP.js} +0 -0
  228. /package/client/dist/assets/{bat-UKoTejQm.js → bat-BLamSaf-.js} +0 -0
  229. /package/client/dist/assets/{bicep-4sTT4B3D.js → bicep-lrOcEItS.js} +0 -0
  230. /package/client/dist/assets/{browser-D2Y_UAKA.js → browser-B7i7Ysc8.js} +0 -0
  231. /package/client/dist/assets/{browser-BDd1dbFa.js → browser-BVQgd1_1.js} +0 -0
  232. /package/client/dist/assets/{browser-Dxc_VIRK.js → browser-C91MQBxx.js} +0 -0
  233. /package/client/dist/assets/{browser-DH9SGVfM.js → browser-C__Vz7KR.js} +0 -0
  234. /package/client/dist/assets/{browser-lTQwcDCI.js → browser-DhwTc0ry.js} +0 -0
  235. /package/client/dist/assets/{browser-Qya9cARy.js → browser-Dpo_ug4c.js} +0 -0
  236. /package/client/dist/assets/{browser-BWSgbfdX.js → browser-DwE289IS.js} +0 -0
  237. /package/client/dist/assets/{browser-DWOVYMlg.js → browser-EFmPpkvO.js} +0 -0
  238. /package/client/dist/assets/{cameligo-CAAryRYO.js → cameligo-BK_p0bgU.js} +0 -0
  239. /package/client/dist/assets/{chat-UVVZqA57.js → chat-9RcD5Lcn.js} +0 -0
  240. /package/client/dist/assets/{chat-CUrG1eVg.js → chat-BXVx6rb5.js} +0 -0
  241. /package/client/dist/assets/{chat-CPgmgZOj.js → chat-BnJPyeUK.js} +0 -0
  242. /package/client/dist/assets/{chat-CvOOKB2s.js → chat-C5nJF6L0.js} +0 -0
  243. /package/client/dist/assets/{chat-BO9MvVID.js → chat-CE8bx6Rz.js} +0 -0
  244. /package/client/dist/assets/{chat-DIh3hr6y.js → chat-PVakYp92.js} +0 -0
  245. /package/client/dist/assets/{chat-mPn3UlMl.js → chat-UMl6H55K.js} +0 -0
  246. /package/client/dist/assets/{chat-BsbNGPW9.js → chat-mq1x9cxZ.js} +0 -0
  247. /package/client/dist/assets/{clojure-BlMERO1w.js → clojure-BQ7JOykv.js} +0 -0
  248. /package/client/dist/assets/{clsx-CnH-HMk3.js → clsx-CjLeUJfG.js} +0 -0
  249. /package/client/dist/assets/{code-BwIz8agY.js → code-BPMR8_Vp.js} +0 -0
  250. /package/client/dist/assets/{code-CDFlxUFC.js → code-BsOBm1Fb.js} +0 -0
  251. /package/client/dist/assets/{code-CY85RXZU.js → code-DtIatVES.js} +0 -0
  252. /package/client/dist/assets/{code-DtZBQTi9.js → code-Lg4awa35.js} +0 -0
  253. /package/client/dist/assets/{code-CD7yNSK0.js → code-OoLqhjoI.js} +0 -0
  254. /package/client/dist/assets/{code-D24e1Crx.js → code-aCUqkVN_.js} +0 -0
  255. /package/client/dist/assets/{code-Cp3Fdng-.js → code-eh4vO2-_.js} +0 -0
  256. /package/client/dist/assets/{code-nKa0fkm_.js → code-u9Sg9ohM.js} +0 -0
  257. /package/client/dist/assets/{coffee-Cj8D-Wl1.js → coffee-BD3DiL5s.js} +0 -0
  258. /package/client/dist/assets/{commands-t4frzhB0.js → commands-B9XEyMj-.js} +0 -0
  259. /package/client/dist/assets/{commands-BR1kDkHQ.js → commands-BI1Ta-E7.js} +0 -0
  260. /package/client/dist/assets/{commands-DWgp-8W1.js → commands-BdI0CtOL.js} +0 -0
  261. /package/client/dist/assets/{commands-ddsl1V91.js → commands-C2ewlyXo.js} +0 -0
  262. /package/client/dist/assets/{commands-IXMOKBYt.js → commands-CwypztRT.js} +0 -0
  263. /package/client/dist/assets/{commands-Cb21pDlG.js → commands-DSX3yJyr.js} +0 -0
  264. /package/client/dist/assets/{commands-B-MVT-2F.js → commands-Ic1DJDxm.js} +0 -0
  265. /package/client/dist/assets/{commands-B0yFTp7e.js → commands-yNn4IA4C.js} +0 -0
  266. /package/client/dist/assets/{common-CTEbWVZS.js → common-BhFasU8N.js} +0 -0
  267. /package/client/dist/assets/{common-CALKUpYm.js → common-CnrZ9gCZ.js} +0 -0
  268. /package/client/dist/assets/{common-B4sqsKp7.js → common-CwhHWbTD.js} +0 -0
  269. /package/client/dist/assets/{common-wA36jmj1.js → common-D9GAPxeN.js} +0 -0
  270. /package/client/dist/assets/{common-5ilvMOcH.js → common-DI4jE5y-.js} +0 -0
  271. /package/client/dist/assets/{common-DQiza2Xp.js → common-DS8zKLQT.js} +0 -0
  272. /package/client/dist/assets/{common-BKpVwUIf.js → common-DTHzyfYC.js} +0 -0
  273. /package/client/dist/assets/{common-BzEC3kJU.js → common-DY4nzbWC.js} +0 -0
  274. /package/client/dist/assets/{cpp-BPfKnaj_.js → cpp-splnCwCh.js} +0 -0
  275. /package/client/dist/assets/{csharp-gX-x5uD6.js → csharp-BCpsl-o3.js} +0 -0
  276. /package/client/dist/assets/{csp-DKGVt8SM.js → csp-tkCWrZmb.js} +0 -0
  277. /package/client/dist/assets/{css-CPMdnAVq.js → css-B_xdnReq.js} +0 -0
  278. /package/client/dist/assets/{cypher-ClMDrj9S.js → cypher-OL1zq-y3.js} +0 -0
  279. /package/client/dist/assets/{dart-C4zbzpVv.js → dart-CtTlOkrm.js} +0 -0
  280. /package/client/dist/assets/{dockerfile-D9xw73D1.js → dockerfile-DcQ5CNiW.js} +0 -0
  281. /package/client/dist/assets/{ecl-gqO8tIR9.js → ecl-DZpiDRt6.js} +0 -0
  282. /package/client/dist/assets/{editor.api2-BPnIxMjz.js → editor.api2-Cwla1nvV.js} +0 -0
  283. /package/client/dist/assets/{elixir-DSAhVF3_.js → elixir-Dzj2lqtK.js} +0 -0
  284. /package/client/dist/assets/{explore-8gMBVmkp.js → explore-4SD1DxR0.js} +0 -0
  285. /package/client/dist/assets/{explore-vdBm_Re8.js → explore-B2n8r9Ye.js} +0 -0
  286. /package/client/dist/assets/{explore-BkWTnLi3.js → explore-BxR9q8Hq.js} +0 -0
  287. /package/client/dist/assets/{explore-CQUCw9ci.js → explore-CBYU76JD.js} +0 -0
  288. /package/client/dist/assets/{explore-Dbac0ErD.js → explore-CCcPXrHg.js} +0 -0
  289. /package/client/dist/assets/{explore-DUU36tcH.js → explore-CZt4Ncpa.js} +0 -0
  290. /package/client/dist/assets/{explore-DlKgN7D-.js → explore-DQ0XEjed.js} +0 -0
  291. /package/client/dist/assets/{explore-COaUKI0t.js → explore-xQoaak6e.js} +0 -0
  292. /package/client/dist/assets/{flow9-DeQCSPOd.js → flow9-CFENCHIZ.js} +0 -0
  293. /package/client/dist/assets/{format-command-CZsy-vHq.js → format-command-CMsBTOPN.js} +0 -0
  294. /package/client/dist/assets/{fsharp-CEfaXL-S.js → fsharp-D-4bv7FB.js} +0 -0
  295. /package/client/dist/assets/{go-Xp1OkZCh.js → go-djxbTJq7.js} +0 -0
  296. /package/client/dist/assets/{graphql-BwRXrUwe.js → graphql-DHIFrkZ6.js} +0 -0
  297. /package/client/dist/assets/{hcl-u06DtVFk.js → hcl-CXVoowNb.js} +0 -0
  298. /package/client/dist/assets/{ini-AmeIpFND.js → ini-Crzc5kly.js} +0 -0
  299. /package/client/dist/assets/{integrations-B9CEpNF0.js → integrations-9qxUNhPD.js} +0 -0
  300. /package/client/dist/assets/{integrations-DWz1eU_K.js → integrations-A9f08E0o.js} +0 -0
  301. /package/client/dist/assets/{integrations-BlvAdewo.js → integrations-B17KyA-i.js} +0 -0
  302. /package/client/dist/assets/{integrations-Bw8UM9Xd.js → integrations-B46ac3sf.js} +0 -0
  303. /package/client/dist/assets/{integrations-7YyTBuU9.js → integrations-C7u7SInG.js} +0 -0
  304. /package/client/dist/assets/{integrations-DiPR8Fzp.js → integrations-DkBi-Gsh.js} +0 -0
  305. /package/client/dist/assets/{integrations-C5SxNKnG.js → integrations-DwSVdCpf.js} +0 -0
  306. /package/client/dist/assets/{integrations-CJQKMmdW.js → integrations-jJGaKwff.js} +0 -0
  307. /package/client/dist/assets/{java-CyDbRQjX.js → java-CYLaJrdE.js} +0 -0
  308. /package/client/dist/assets/{jira-DOw8bkIR.js → jira-01H1RfQj.js} +0 -0
  309. /package/client/dist/assets/{jira-DKImM1YH.js → jira-0ldfMByG.js} +0 -0
  310. /package/client/dist/assets/{jira-Fob8EGxN.js → jira-4Fin3fu7.js} +0 -0
  311. /package/client/dist/assets/{jira-xZA2lixb.js → jira-BpnpUFlb.js} +0 -0
  312. /package/client/dist/assets/{jira-C-ATCti0.js → jira-BwACz875.js} +0 -0
  313. /package/client/dist/assets/{jira-DlA-wGp-.js → jira-CBU0200d.js} +0 -0
  314. /package/client/dist/assets/{jira-D7bkKAX8.js → jira-Dht8qNck.js} +0 -0
  315. /package/client/dist/assets/{jira-CmVfRM-b.js → jira-DzIVvNmy.js} +0 -0
  316. /package/client/dist/assets/{jobs-DAF8AGy5.js → jobs-BF9raUkL.js} +0 -0
  317. /package/client/dist/assets/{jobs-D93lG6If.js → jobs-Bw4hqEro.js} +0 -0
  318. /package/client/dist/assets/{jobs-F5PGJwbW.js → jobs-DM9owF1j.js} +0 -0
  319. /package/client/dist/assets/{jobs-Db3xrsp_.js → jobs-DRInW0AE.js} +0 -0
  320. /package/client/dist/assets/{jobs-fYWWxCUV.js → jobs-DcCONARH.js} +0 -0
  321. /package/client/dist/assets/{jobs-Brp44JDd.js → jobs-Oz3UtLQn.js} +0 -0
  322. /package/client/dist/assets/{jobs-Do4Ltqdj.js → jobs-jEQidSIb.js} +0 -0
  323. /package/client/dist/assets/{jobs-BGkI19S_.js → jobs-ym72SIR9.js} +0 -0
  324. /package/client/dist/assets/{julia-BqialFRG.js → julia-BJ7tUU-T.js} +0 -0
  325. /package/client/dist/assets/{kotlin-Dzz8TWAt.js → kotlin-CeWcU3lC.js} +0 -0
  326. /package/client/dist/assets/{less-DHRJD3TR.js → less-CviwWNG4.js} +0 -0
  327. /package/client/dist/assets/{lexon-5Y3QgTmT.js → lexon-Dt28jqDS.js} +0 -0
  328. /package/client/dist/assets/{lua-sKvhfPn5.js → lua-B6AOaJSi.js} +0 -0
  329. /package/client/dist/assets/{m3-DWDVwkFG.js → m3-VnMkHJcy.js} +0 -0
  330. /package/client/dist/assets/{markdown-CD_aSBxW.js → markdown-8vKNdvIM.js} +0 -0
  331. /package/client/dist/assets/{mips-687T03hg.js → mips-DoEcuzan.js} +0 -0
  332. /package/client/dist/assets/{msdax-C1St-dIV.js → msdax-CNzvHyEp.js} +0 -0
  333. /package/client/dist/assets/{mysql-BG7r8oBS.js → mysql-Buk3vUtL.js} +0 -0
  334. /package/client/dist/assets/{objective-c-Ds1-m05L.js → objective-c-DfOmda-5.js} +0 -0
  335. /package/client/dist/assets/{pascal-BKK9FpIi.js → pascal-DoAA2yjy.js} +0 -0
  336. /package/client/dist/assets/{pascaligo-SRS3nwtO.js → pascaligo-C65Vn1fu.js} +0 -0
  337. /package/client/dist/assets/{perl-B2hTOlrF.js → perl-INlfQ_ro.js} +0 -0
  338. /package/client/dist/assets/{pgsql-DIQJYNpL.js → pgsql-DtwRzglx.js} +0 -0
  339. /package/client/dist/assets/{php-BEaVe8X2.js → php-DfHqVNet.js} +0 -0
  340. /package/client/dist/assets/{pla-oPLHpZ-Q.js → pla-D3dNVRYk.js} +0 -0
  341. /package/client/dist/assets/{postiats-D_vzrAzD.js → postiats-UKXD1rM4.js} +0 -0
  342. /package/client/dist/assets/{powerquery-BKG6w-FH.js → powerquery-zE3E3O7s.js} +0 -0
  343. /package/client/dist/assets/{powershell-B3dLhDt4.js → powershell-Df9b3zQl.js} +0 -0
  344. /package/client/dist/assets/{protobuf-DC8SGjcl.js → protobuf-BF0nUVrW.js} +0 -0
  345. /package/client/dist/assets/{pug-D5E-4fI0.js → pug-Bj6Yikv_.js} +0 -0
  346. /package/client/dist/assets/{qsharp-6vJAWv0x.js → qsharp-BI4h-raZ.js} +0 -0
  347. /package/client/dist/assets/{r-CDwsEcbM.js → r-DhpnmaXx.js} +0 -0
  348. /package/client/dist/assets/{redis-CuQbbESS.js → redis-DwYYPr4d.js} +0 -0
  349. /package/client/dist/assets/{redshift-B9e1k-qI.js → redshift-D2f3Bc-4.js} +0 -0
  350. /package/client/dist/assets/{restructuredtext-BiJ5IwaU.js → restructuredtext-Dkiif6fe.js} +0 -0
  351. /package/client/dist/assets/{ruby-B0UAHY9b.js → ruby-C6hLmHy0.js} +0 -0
  352. /package/client/dist/assets/{rust-Dg_spmFr.js → rust-X8WAGtxB.js} +0 -0
  353. /package/client/dist/assets/{sb-DjU66I8Q.js → sb-4M2la0Kr.js} +0 -0
  354. /package/client/dist/assets/{scala-qvStIdfG.js → scala-CaCXz58E.js} +0 -0
  355. /package/client/dist/assets/{scheme-FstEk5Rh.js → scheme-CMdjpmP7.js} +0 -0
  356. /package/client/dist/assets/{scss-w0U3rQLK.js → scss-QopmvPyp.js} +0 -0
  357. /package/client/dist/assets/{settings-CewqtD9V.js → settings-0m2iuTzd.js} +0 -0
  358. /package/client/dist/assets/{settings-Puea5c8v.js → settings-BA1V6KdK.js} +0 -0
  359. /package/client/dist/assets/{settings-Cx97tHs5.js → settings-BN7OusER.js} +0 -0
  360. /package/client/dist/assets/{settings-BwMQ1lx5.js → settings-Bi5FFkIw.js} +0 -0
  361. /package/client/dist/assets/{settings-EMaKBwE0.js → settings-CRJxyTNN.js} +0 -0
  362. /package/client/dist/assets/{settings-DkB9Wh-f.js → settings-DyBxunCh.js} +0 -0
  363. /package/client/dist/assets/{settings-CqCY8gZq.js → settings-fk-WlnUt.js} +0 -0
  364. /package/client/dist/assets/{settings-CyixAx0X.js → settings-iQe5Dim-.js} +0 -0
  365. /package/client/dist/assets/{shell-DJ78wREd.js → shell-CDBchS00.js} +0 -0
  366. /package/client/dist/assets/{solidity-1aGIVsdX.js → solidity-DvBfi5mC.js} +0 -0
  367. /package/client/dist/assets/{sophia-40LqcGjB.js → sophia-HSnXR17u.js} +0 -0
  368. /package/client/dist/assets/{sparql-Cz5dqG_g.js → sparql-DhG_ppup.js} +0 -0
  369. /package/client/dist/assets/{specs-DfwDeADE.js → specs-Bku8SypT.js} +0 -0
  370. /package/client/dist/assets/{specs-B4GuOzuZ.js → specs-BvsFNKTs.js} +0 -0
  371. /package/client/dist/assets/{specs-ghyBMnib.js → specs-C2wW5bq8.js} +0 -0
  372. /package/client/dist/assets/{specs-VK-zXv7x.js → specs-CUE3xSFM.js} +0 -0
  373. /package/client/dist/assets/{specs-D-Sb6dre.js → specs-C_8j4ELZ.js} +0 -0
  374. /package/client/dist/assets/{specs-C62F2CDv.js → specs-CnH7dOiF.js} +0 -0
  375. /package/client/dist/assets/{specs-DFSkAeK8.js → specs-D4ORogcT.js} +0 -0
  376. /package/client/dist/assets/{specs-BVLKe2n5.js → specs-D6Y76Bgi.js} +0 -0
  377. /package/client/dist/assets/{sql-64f62Ni4.js → sql-DHeIS-tf.js} +0 -0
  378. /package/client/dist/assets/{st-gJe2yG8J.js → st-CMWchiRU.js} +0 -0
  379. /package/client/dist/assets/{swift-C6ME22mv.js → swift-CDXvBefj.js} +0 -0
  380. /package/client/dist/assets/{systemverilog-CEWz259w.js → systemverilog-0RTukYUE.js} +0 -0
  381. /package/client/dist/assets/{tcl-CcLVIi3m.js → tcl-CbBF_Ttl.js} +0 -0
  382. /package/client/dist/assets/{terminal-CPpK58RC.js → terminal-BLh00ouM.js} +0 -0
  383. /package/client/dist/assets/{terminal-CdxkpafL.js → terminal-BTanJIt_.js} +0 -0
  384. /package/client/dist/assets/{terminal-DHIkiWcs.js → terminal-CB33IsO1.js} +0 -0
  385. /package/client/dist/assets/{terminal-Ciia0wh2.js → terminal-CR6t-Oey.js} +0 -0
  386. /package/client/dist/assets/{terminal-DY42QANg.js → terminal-CY_sPfdD.js} +0 -0
  387. /package/client/dist/assets/{terminal-C0xx0SjA.js → terminal-Cj4HzP3p.js} +0 -0
  388. /package/client/dist/assets/{terminal-BYtreaaF.js → terminal-Cz_Puz0q.js} +0 -0
  389. /package/client/dist/assets/{terminal-DoxtVdma.js → terminal-DFEH9XTQ.js} +0 -0
  390. /package/client/dist/assets/{tickets-D5MSAPe_.js → tickets-BFrVcXAI.js} +0 -0
  391. /package/client/dist/assets/{tickets-DBV3wgQZ.js → tickets-C3gG--yT.js} +0 -0
  392. /package/client/dist/assets/{tickets-r4-oNV0R.js → tickets-Cfhwbdxj.js} +0 -0
  393. /package/client/dist/assets/{tickets-RZ0LyeQe.js → tickets-DcggvP3k.js} +0 -0
  394. /package/client/dist/assets/{tickets-d1A6EOHa.js → tickets-EnP6m_Ao.js} +0 -0
  395. /package/client/dist/assets/{tickets-Q0_pONEh.js → tickets-IbYhlr-6.js} +0 -0
  396. /package/client/dist/assets/{tickets-CVJQ-vRm.js → tickets-ZS5EsDxn.js} +0 -0
  397. /package/client/dist/assets/{tickets-CG_mo-Bg.js → tickets-lJR7pWNI.js} +0 -0
  398. /package/client/dist/assets/{twig-DvsO-WjW.js → twig-DCcGd8FE.js} +0 -0
  399. /package/client/dist/assets/{typespec-Brkt3IAA.js → typespec-HTphp-Uh.js} +0 -0
  400. /package/client/dist/assets/{vb-r121Uzxt.js → vb-Cb_yUcVd.js} +0 -0
  401. /package/client/dist/assets/{wgsl-BRX8uYh4.js → wgsl-DrKU3YXj.js} +0 -0
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editor.main-C7Rmw-hR.js","assets/chunk-CilyBKbf.js","assets/preload-helper-DSXbuxSR.js","assets/editor.api2-BPnIxMjz.js","assets/editor-Br_kD0ds.css","assets/workers-BvicOoDf.js","assets/monaco.contribution-YMAkHQcQ.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./preload-helper-DSXbuxSR.js";import{$t as n,Bt as r,Dt as i,Et as a,I as o,P as s,Rt as c,W as l,a as u,at as d,cn as f,en as p,gt as m,ht as h,in as g,it as _,l as v,m as y,mt as b,nt as x,on as S,ot as C,p as ee,rt as w,sn as T,tt as E,wt as D,zt as O}from"./index-BEGU2TCx.js";var k=D(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),te=D(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),A=D(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),j=e(f(),1),M=e(T(),1);function ne(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function N(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function P(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var F=(e,t)=>Math.abs(e-t)<1.01,I=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},L,R=()=>{if(L!==void 0)return L;if(typeof navigator>`u`)return L=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return L=!0;let e=navigator.maxTouchPoints;return L=navigator.platform===`MacIntel`&&e!==void 0&&e>0},z=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},re=e=>e,B=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},V=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(z(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(z(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},H={passive:!0},U=typeof window>`u`?!0:`onscrollend`in window,W=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&U,o=0,s=a?null:I(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,H),a&&r.addEventListener(`scrollend`,u,H),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},ie=(e,t)=>W(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),G=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},ae=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},oe=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:re,rangeExtractor:B,onChange:()=>{},measureElement:G,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}this.options=t},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=N(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!R()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,H),e.addEventListener(`touchend`,n,H),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=N(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=N(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{let c=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=this.options.gap,a=e*2,o=this._flatMeasurements;if(!o||o.length<a){let e=new Float64Array(a);o&&l>0&&e.set(o.subarray(0,l*2)),o=e,this._flatMeasurements=o}let s;if(l===0)s=t+n;else{let e=l-1;s=o[e*2]+o[e*2+1]+i}for(let t=l;t<e;t++){let e=r(t),n=c.get(e),a=typeof n==`number`?n:this.options.estimateSize(t);o[t*2]=s,o[t*2+1]=a,s+=a+i}let u=ne(e,o,r);return this.measurementsCache=u,u}let u=this.measurementsCache.slice(0,l),d=Array(a).fill(void 0);for(let e=0;e<l;e++){let t=u[e];t&&(d[t.lane]=e)}for(let i=l;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,l,f=o===`estimate`||c.has(e);if(a!==void 0&&this.options.lanes>1){s=a;let e=d[s],r=e===void 0?void 0:u[e];l=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?u[i-1]:this.getFurthestMeasurement(u,i);l=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,s)}let p=c.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=l+m;u[i]={index:i,start:l,size:m,end:h,key:e,lane:s},d[s]=i}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=N(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?ce({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:r===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=N(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);o!==0&&(this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&this.scrollDirection!==`backward`:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this))&&(R()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=o:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0})),(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,this.notify(!1))},this.getVirtualItems=N(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return P(t[se(0,t.length-1,r?e=>n[e*2]:e=>P(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&F(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},se=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function ce({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:i}){let a=e.length-1,o=i?e=>i[e*2]:t=>e[t].start,s=i?e=>i[e*2]+i[e*2+1]:t=>e[t].end;if(e.length<=r)return{startIndex:0,endIndex:a};let c=se(0,a,o,n),l=c;if(r===1)for(;l<a&&s(l)<n+t;)l++;else if(r>1){let i=Array(r).fill(0);for(;l<a&&i.some(e=>e<n+t);){let t=e[l];i[t.lane]=t.end,l++}let o=Array(r).fill(n+t);for(;c>=0&&o.some(e=>e>=n);){let t=e[c];o[t.lane]=t.start,c--}c=Math.max(0,c-c%r),l=Math.min(a,l+(r-1-l%r))}return{startIndex:c,endIndex:l}}var K=typeof document<`u`?j.useLayoutEffect:j.useEffect;function le({useFlushSync:e=!0,...t}){let n=j.useReducer(e=>e+1,0)[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,M.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=j.useState(()=>new oe(r));return i.setOptions(r),K(()=>i._didMount(),[]),K(()=>i._willUpdate()),i}function q(e){return le({observeElementRect:V,observeElementOffset:ie,scrollToFn:ae,...e})}var J=O(),Y=e=>`specrails-desktop:code-tree-filter:${e}`,X=e=>`specrails-desktop:code-tree-collapsed:${e}`;function ue(e){return e.split(`/`).length-1}function de(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function fe(e){return e?e.length>10?e.slice(0,10):e:null}function pe(e){return e===`created`?`added`:e===`modified`?`changed`:e===`deleted`?`deleted`:null}function me(e,t){if(t.size===0)return!1;let n=e.split(`/`);for(let e=1;e<n.length;e++)if(t.has(n.slice(0,e).join(`/`)))return!0;return!1}function he({onOpenFile:e,selectedPath:t,filterJobId:n,filterTicketId:o}){let{t:l}=p(`code`),{activeProjectId:u}=a(),{openTicketDetail:d}=v(),{registerHandler:f,unregisterHandler:g}=c(),[_,y]=(0,j.useState)(()=>{if(!u)return`touched-by-ai`;try{let e=localStorage.getItem(Y(u));if(e===`all`||e===`touched-by-ai`)return e}catch{}return`touched-by-ai`});(0,j.useEffect)(()=>{if(u)try{localStorage.setItem(Y(u),_)}catch{}},[_,u]);let[b,S]=(0,j.useState)(()=>{if(!u)return new Set;try{let e=localStorage.getItem(X(u));if(!e)return new Set;let t=JSON.parse(e);if(Array.isArray(t))return new Set(t.filter(e=>typeof e==`string`))}catch{}return new Set});(0,j.useEffect)(()=>{if(u)try{localStorage.setItem(X(u),JSON.stringify([...b]))}catch{}},[b,u]);let C=(0,j.useCallback)(e=>{S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ee=(0,j.useCallback)(()=>{S(new Set)},[]),{data:w,refresh:T,isFirstLoad:D}=i({namespace:`code-tree:${_}:${_===`touched-by-ai`?`${n??`all-jobs`}:${o??`all-specs`}`:`all`}`,projectId:u,initialValue:[],fetcher:(0,j.useCallback)(async()=>{let e=[],t=null;for(let i=0;i<100;i+=1){let i=new URLSearchParams({withProvenance:`1`,filter:_});_===`touched-by-ai`&&n&&i.set(`jobId`,n),_===`touched-by-ai`&&typeof o==`number`&&i.set(`ticketId`,String(o)),t&&i.set(`cursor`,t);let a=await fetch(`${r()}/code/tree?${i.toString()}`);if(!a.ok)break;let s=await a.json().catch(()=>({}));if(Array.isArray(s.entries)&&e.push(...s.entries),!s.nextCursor)break;t=s.nextCursor}return e},[_,n,o])}),O=(0,j.useRef)(u);(0,j.useEffect)(()=>{O.current=u},[u]),(0,j.useEffect)(()=>{if(!u)return;let e=`code-tree-${u}`;return f(e,e=>{let t=e;t.projectId===O.current&&t.type===`file.provenance_updated`&&T()}),()=>g(e)},[u,f,g,T]);let A=(0,j.useRef)(null),M=(0,j.useMemo)(()=>(w??[]).filter(e=>!me(e.path,b)),[w,b]),ne=(0,j.useCallback)(()=>{S(new Set((w??[]).filter(e=>e.kind===`dir`).map(e=>e.path)))},[w]),N=q({count:M.length,getScrollElement:()=>A.current,estimateSize:()=>28,overscan:12,initialRect:{width:320,height:600},observeElementRect:(e,t)=>{let n=e.scrollElement;if(!n)return()=>{};let r=()=>{let e=n.getBoundingClientRect(),r=e.height||n.clientHeight||600;t({width:e.width||n.clientWidth||320,height:r})};if(r(),typeof ResizeObserver<`u`){let e=new ResizeObserver(r);return e.observe(n),()=>e.disconnect()}return()=>{}}}),P=M.length===0,F=(0,j.useMemo)(()=>(w??[]).filter(e=>e.kind===`file`).length,[w]);return(0,J.jsxs)(`div`,{className:`flex flex-col h-full`,"data-testid":`file-tree`,children:[(0,J.jsxs)(`div`,{className:`px-2 py-2 border-b border-border text-xs space-y-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>y(`touched-by-ai`),className:s(`px-2 py-1 rounded-md transition-colors`,_===`touched-by-ai`?`bg-accent-primary/20 text-accent-primary`:`text-muted-foreground hover:text-foreground hover:bg-muted/50`),"aria-pressed":_===`touched-by-ai`,children:l(n?`tree.jobFiles`:o?`tree.specFiles`:`tree.touchedByAi`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>y(`all`),className:s(`px-2 py-1 rounded-md transition-colors`,_===`all`?`bg-accent-primary/20 text-accent-primary`:`text-muted-foreground hover:text-foreground hover:bg-muted/50`),"aria-pressed":_===`all`,children:l(`tree.allFiles`)}),(0,J.jsx)(`div`,{className:`flex-1`}),(0,J.jsx)(`button`,{type:`button`,onClick:ne,title:l(`tree.collapseAll`),className:`px-1.5 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,"aria-label":l(`tree.collapseAll`),children:(0,J.jsx)(h,{className:`w-3.5 h-3.5`})}),(0,J.jsx)(`button`,{type:`button`,onClick:ee,title:l(`tree.expandAll`),className:`px-1.5 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,"aria-label":l(`tree.expandAll`),children:(0,J.jsx)(m,{className:`w-3.5 h-3.5`})})]}),_===`touched-by-ai`&&F>0&&(0,J.jsx)(`div`,{className:`flex items-center justify-between gap-2 text-[11px] text-muted-foreground`,children:(0,J.jsx)(`span`,{children:l(`tree.touchedCount`,{count:F})})})]}),P&&D?(0,J.jsx)(`div`,{className:`flex-1 flex items-center justify-center px-4 text-center`,"data-testid":`file-tree-loading`,children:(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground animate-pulse`,children:l(`tree.loadingFiles`)})}):P&&_===`touched-by-ai`?(0,J.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center px-4 text-center gap-3`,children:[(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:l(`tree.emptyTouched`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>y(`all`),className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary/20 text-accent-primary hover:bg-accent-primary/30`,children:l(`tree.showAllFiles`)})]}):P?(0,J.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-muted-foreground px-4 text-center`,children:l(`tree.noFiles`)}):(0,J.jsx)(`div`,{ref:A,className:`flex-1 overflow-auto`,"data-testid":`file-tree-scroller`,children:(0,J.jsx)(`div`,{style:{height:N.getTotalSize(),position:`relative`,width:`100%`},children:N.getVirtualItems().map(n=>{let r=M[n.index],i=ue(r.path)*12,a=r.kind===`file`&&r.path===t,o=r.provenance?.createdByTicketId,c=r.provenance?.modifiedByTicketIds??[],u=r.provenance?.latest??null,f=fe(u?.jobId),p=pe(u?.kind),g=r.kind===`dir`,_=g&&b.has(r.path),v=r.provenance?.touchedFileCount??0;return(0,J.jsxs)(`div`,{style:{position:`absolute`,top:0,left:0,transform:`translateY(${n.start}px)`,height:n.size,width:`100%`},className:s(`flex items-center gap-2 px-2 text-xs cursor-pointer hover:bg-muted/50`,a&&`bg-muted text-foreground`),onClick:()=>{g?C(r.path):e(r.path)},role:`button`,tabIndex:0,"aria-expanded":g?!_:void 0,"data-testid":`file-tree-row-${r.path}`,children:[(0,J.jsxs)(`span`,{style:{paddingLeft:i},className:`flex items-center gap-1 min-w-0 flex-1`,children:[g?(0,J.jsxs)(J.Fragment,{children:[_?(0,J.jsx)(h,{className:`w-3 h-3 text-muted-foreground flex-shrink-0`}):(0,J.jsx)(m,{className:`w-3 h-3 text-muted-foreground flex-shrink-0`}),_?(0,J.jsx)(te,{className:`w-3.5 h-3.5 text-accent-info flex-shrink-0`}):(0,J.jsx)(x,{className:`w-3.5 h-3.5 text-accent-info flex-shrink-0`})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`w-3 flex-shrink-0`}),(0,J.jsx)(k,{className:`w-3.5 h-3.5 text-muted-foreground flex-shrink-0`})]}),(0,J.jsx)(`span`,{className:`truncate ml-0.5`,children:de(r.path)})]}),(0,J.jsxs)(`span`,{className:`flex items-center gap-1 flex-shrink-0`,children:[g&&v>0&&(0,J.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted/60 text-muted-foreground`,title:l(`tree.folderTouched`,{count:v}),children:v}),!g&&p&&(0,J.jsx)(`span`,{className:s(`text-[10px] px-1.5 py-0.5 rounded`,u?.kind===`created`&&`bg-accent-success/15 text-accent-success`,u?.kind===`modified`&&`bg-accent-info/15 text-accent-info`,u?.kind===`deleted`&&`bg-destructive/15 text-destructive`),title:u?.kind===`created`?l(`tree.latestTitleCreated`):u?.kind===`deleted`?l(`tree.latestTitleDeleted`):l(`tree.latestTitleModified`),children:l(`action.${p}`)}),!g&&f&&(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded bg-muted/60 text-muted-foreground font-mono`,title:l(`tree.jobTitle`,{jobId:u?.jobId??``}),children:[(0,J.jsx)(E,{className:`h-3 w-3`}),f]}),!g&&typeof o==`number`&&(0,J.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),d(o)},className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success`,"data-testid":`provenance-chip-created-${o}`,title:l(`tree.createdBySpec`,{id:o}),children:[`#`,o]}),!g&&c.slice(0,2).map(e=>(0,J.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),d(e)},className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-info/15 text-accent-info`,"data-testid":`provenance-chip-modified-${e}`,title:l(`tree.modifiedBySpec`,{id:e}),children:[`#`,e]},e))]})]},r.path)})})})]})}function ge(e){return new Worker(`/assets/editor.worker-Bd9IXS8d.js`,{name:e?.name})}function _e(e){return new Worker(`/assets/json.worker-DzV-CpCQ.js`,{name:e?.name})}function ve(e){return new Worker(`/assets/css.worker-Wv5dxAWO.js`,{name:e?.name})}function ye(e){return new Worker(`/assets/html.worker-CQP8QQsS.js`,{name:e?.name})}function be(e){return new Worker(`/assets/ts.worker-METxwbDZ.js`,{name:e?.name})}var xe=!1;function Se(e){let t=e.trim().match(/^hsl\(\s*([-\d.]+)[\s,]+([\d.]+)%[\s,]+([\d.]+)%\s*\)$/i);return t?[parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])]:null}function Z(e,t=`#1e1e1e`){if(e.startsWith(`#`))return e;let n=Se(e);if(!n)return t;let[r,i,a]=n,o=i/100,s=a/100,c=(1-Math.abs(2*s-1))*o,l=(r%360+360)%360/60,u=c*(1-Math.abs(l%2-1)),d=0,f=0,p=0;l<1?(d=c,f=u):l<2?(d=u,f=c):l<3?(f=c,p=u):l<4?(f=u,p=c):l<5?(d=u,p=c):(d=c,p=u);let m=s-c/2,h=e=>Math.round((e+m)*255).toString(16).padStart(2,`0`);return`#${h(d)}${h(f)}${h(p)}`}function Ce(e){return`specrails-${e}`}function we(e,t){let n=Ce(t.id),r=t.xterm,i=Z(r.background),a=Z(r.foreground),o=Z(r.brightBlack),s=Z(r.magenta),c=Z(r.yellow),l=Z(r.cyan),u=Z(r.blue),d=Z(r.green),f=Z(r.brightBlack),p=Z(r.brightCyan),m=Z(r.red),h=Z(r.selectionBackground);return e.editor.defineTheme(n,{base:t.scheme===`light`?`vs`:`vs-dark`,inherit:!0,rules:[{token:``,foreground:a.slice(1)},{token:`comment`,foreground:f.slice(1),fontStyle:`italic`},{token:`keyword`,foreground:s.slice(1)},{token:`string`,foreground:c.slice(1)},{token:`number`,foreground:l.slice(1)},{token:`constant`,foreground:p.slice(1)},{token:`constant.numeric`,foreground:l.slice(1)},{token:`type`,foreground:d.slice(1)},{token:`type.identifier`,foreground:d.slice(1)},{token:`identifier`,foreground:a.slice(1)},{token:`function`,foreground:u.slice(1)},{token:`tag`,foreground:m.slice(1)},{token:`attribute.name`,foreground:p.slice(1)},{token:`attribute.value`,foreground:c.slice(1)},{token:`delimiter`,foreground:o.slice(1)},{token:`operator`,foreground:o.slice(1)}],colors:{"editor.background":i,"editor.foreground":a,"editorLineNumber.foreground":o,"editorLineNumber.activeForeground":a,"editorCursor.foreground":Z(r.cursor),"editor.selectionBackground":h,"editor.inactiveSelectionBackground":h,"editor.lineHighlightBackground":Z(r.black),"editor.lineHighlightBorder":Z(r.black),"editorGutter.background":i,"editorWhitespace.foreground":o,"editorIndentGuide.background1":Z(r.black),"editorIndentGuide.activeBackground1":o,"scrollbarSlider.background":`${o}55`,"scrollbarSlider.hoverBackground":`${o}88`,"scrollbarSlider.activeBackground":`${o}bb`,"minimap.background":i}}),n}function Te(){xe||=(self.MonacoEnvironment={getWorker(e,t){switch(t){case`json`:return new _e;case`css`:case`scss`:case`less`:return new ve;case`html`:case`handlebars`:case`razor`:return new ye;case`typescript`:case`javascript`:return new be;default:return new ge}}},!0)}function Ee({content:e,language:n,readOnly:r,onChange:i}){let{t:a}=p(`code`),o=u(),s=(0,j.useRef)(null),c=(0,j.useRef)(null),l=(0,j.useRef)(null),[d,f]=(0,j.useState)(!1),m=(0,j.useRef)(e),h=(0,j.useRef)(n),g=(0,j.useRef)(o),_=(0,j.useRef)(r),v=(0,j.useRef)(i);return(0,j.useEffect)(()=>{m.current=e},[e]),(0,j.useEffect)(()=>{h.current=n},[n]),(0,j.useEffect)(()=>{g.current=o},[o]),(0,j.useEffect)(()=>{_.current=r},[r]),(0,j.useEffect)(()=>{v.current=i},[i]),(0,j.useEffect)(()=>{let e=!1;return Te(),t(()=>import(`./editor.main-C7Rmw-hR.js`).then(t=>{if(e||!s.current)return;l.current=t;let n=we(t,g.current),r=t.editor.create(s.current,{value:m.current,language:h.current,readOnly:_.current,theme:n,minimap:{enabled:!1},lineNumbers:`on`,scrollBeyondLastLine:!1,automaticLayout:!0,fontSize:13});r.onDidChangeModelContent(()=>{v.current?.(r.getValue())}),c.current=r}),__vite__mapDeps([0,1,2,3,4,5,6])).catch(()=>{e||f(!0)}),()=>{e=!0,c.current?.dispose?.(),c.current=null}},[]),(0,j.useEffect)(()=>{let t=c.current;t&&t.getValue?.()!==e&&t.setValue?.(e)},[e]),(0,j.useEffect)(()=>{c.current?.updateOptions?.({readOnly:r})},[r]),(0,j.useEffect)(()=>{let e=l.current,t=c.current;if(!e||!t)return;let r=t.getModel?.();r&&e.editor.setModelLanguage(r,n)},[n]),(0,j.useEffect)(()=>{let e=l.current;if(!e)return;let t=we(e,o);e.editor.setTheme(t)},[o]),d?(0,J.jsxs)(`div`,{className:`w-full h-full flex flex-col items-center justify-center gap-2 text-sm text-muted-foreground`,"data-testid":`monaco-load-error`,children:[(0,J.jsx)(`span`,{children:a(`monaco.loadFailed`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),className:`rounded-md bg-accent-primary/15 px-3 py-1 text-xs text-accent-primary hover:bg-accent-primary/25`,children:a(`monaco.reload`)})]}):(0,J.jsx)(`div`,{ref:s,className:`w-full h-full`,"data-testid":`monaco-host`})}var De=(0,j.lazy)(async()=>({default:Ee}));function Oe({content:e,language:t,readOnly:n=!0,onChange:r}){let{t:i}=p(`code`);return(0,J.jsx)(j.Suspense,{fallback:(0,J.jsx)(`div`,{className:`w-full h-full flex items-center justify-center text-sm text-muted-foreground animate-pulse`,children:i(`monaco.loadingEditor`)}),children:(0,J.jsx)(De,{content:e,language:t,readOnly:n,onChange:r})})}function ke(e,t){if(!e)return null;let n=Date.parse(e);if(Number.isNaN(n))return null;let r=Math.round((n-Date.now())/1e3),i=new Intl.RelativeTimeFormat(t,{numeric:`auto`}),a=Math.abs(r);return a<60?i.format(r,`second`):a<3600?i.format(Math.round(r/60),`minute`):a<86400?i.format(Math.round(r/3600),`hour`):i.format(Math.round(r/86400),`day`)}function Ae({path:e,summary:t,stale:n,regenerating:r,generateDisabledReason:i,onCollapse:a}){let{t:o,i18n:c}=p(`code`),{openTicketDetail:l}=v();if(!t)return(0,J.jsx)(`div`,{className:`border-b border-border px-4 py-3 bg-surface`,"data-testid":`summary-header-empty`,children:(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:e}),(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i?o(`summary.unavailable`,{reason:i}):o(`summary.empty`)})]}),a&&(0,J.jsxs)(`button`,{type:`button`,onClick:a,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,J.jsx)(b,{className:`h-3.5 w-3.5`}),o(`summary.hide`)]})]})});let u=ke(t.generatedAt,c.language),d=t.triggeredBy?.ticketId,f=t.triggeredBy?.modifiedTicketIds??[];return(0,J.jsx)(`div`,{className:`border-b border-border px-4 py-3 bg-surface`,"data-testid":`summary-header`,children:(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:e}),n&&(0,J.jsx)(`span`,{className:s(`text-[10px] px-1.5 py-0.5 rounded bg-accent-warning/20 text-accent-warning font-medium`),"data-testid":`summary-stale-badge`,children:o(`summary.stale`)}),r&&(0,J.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-accent-primary animate-pulse`,"aria-hidden":!0})]}),(0,J.jsx)(`p`,{className:`text-sm text-foreground mt-1`,children:t.summary}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2 mt-2 flex-wrap`,children:[typeof d==`number`&&(0,J.jsxs)(`button`,{type:`button`,onClick:()=>l(d),className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success`,children:[`#`,d]}),f.map(e=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>l(e),className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-info/15 text-accent-info`,children:[`#`,e]},e)),u&&(0,J.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:u})]})]}),a&&(0,J.jsxs)(`button`,{type:`button`,onClick:a,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,J.jsx)(b,{className:`h-3.5 w-3.5`}),o(`summary.hide`)]})]})})}function je({content:e}){return(0,J.jsx)(y,{remarkPlugins:[ee],children:e})}function Me(e,t){return t===`markdown`||t===`md`?!0:/\.(md|mdx|markdown)$/i.test(e)}var Q=180,Ne=120,Pe=240;function Fe(e){return e?`specrails-desktop:code-summary-collapsed:${e}`:null}function Ie(e){return e?`specrails-desktop:code-history-height:${e}`:null}function Le(e){return e?`specrails-desktop:code-history-collapsed:${e}`:null}function Re(e){let t=Ie(e);if(!t)return Q;try{let e=localStorage.getItem(t),n=e?Number(e):NaN;return Number.isFinite(n)&&n>0?n:Q}catch{return Q}}function ze(e,t){let n=Ie(e);if(n)try{localStorage.setItem(n,String(Math.round(t)))}catch{}}function Be(e){let t=Fe(e);if(!t)return!1;try{return localStorage.getItem(t)===`true`}catch{return!1}}function Ve(e,t){let n=Fe(e);if(n)try{localStorage.setItem(n,t?`true`:`false`)}catch{}}function He(e){let t=Le(e);if(!t)return!1;try{return localStorage.getItem(t)===`true`}catch{return!1}}function Ue(e,t){let n=Le(e);if(n)try{localStorage.setItem(n,t?`true`:`false`)}catch{}}function We(e,t){let n=Math.max(Ne,t-Pe);return Math.min(Math.max(e,Ne),n)}function Ge({relPath:e,onFilterJob:t,onSummaryActionChange:i,onCopyPathActionChange:o}){let{t:s}=p(`code`),{activeProjectId:l}=a(),{openTicketDetail:u}=v(),{registerHandler:d,unregisterHandler:f}=c(),h=(0,j.useRef)(null),[g,_]=(0,j.useState)(null),[y,x]=(0,j.useState)(!0),[S,C]=(0,j.useState)(!1),[ee,w]=(0,j.useState)(!1),[T,E]=(0,j.useState)(()=>Be(l)),[D,O]=(0,j.useState)(()=>Re(l)),[k,te]=(0,j.useState)(()=>He(l)),A=(0,j.useRef)(l);(0,j.useEffect)(()=>{A.current=l},[l]);let M=(0,j.useRef)(e);(0,j.useEffect)(()=>{M.current=e},[e]),(0,j.useEffect)(()=>{let e=h.current?.clientHeight||window.innerHeight;E(Be(l)),O(We(Re(l),e)),te(He(l))},[l]);let ne=(0,j.useCallback)(e=>{let t=e.clientY,n=D,r=h.current?.clientHeight||window.innerHeight,i=e.currentTarget;try{i.setPointerCapture(e.pointerId)}catch{}function a(e){O(We(n+(t-e.clientY),r))}function o(){window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),window.removeEventListener(`pointercancel`,o),O(e=>{let t=We(e,r);return ze(l,t),t})}window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o),window.addEventListener(`pointercancel`,o)},[l,D]),N=(0,j.useCallback)(()=>{let e=We(Q,h.current?.clientHeight||window.innerHeight);O(e),ze(l,e)},[l]),P=(0,j.useCallback)(()=>{E(e=>{let t=!e;return Ve(l,t),t})},[l]),F=(0,j.useCallback)(()=>{te(e=>{let t=!e;return Ue(l,t),t})},[l]);(0,j.useEffect)(()=>{C(!1),w(!1),V(`preview`),U(!1)},[e]);let I=(0,j.useRef)(0),L=(0,j.useCallback)(async()=>{let t=++I.current;x(!0);try{let n=await fetch(`${r()}/code/file?path=${encodeURIComponent(e)}`);if(t!==I.current)return;if(!n.ok){_(null);return}let i=await n.json();if(t!==I.current)return;_(i)}catch{t===I.current&&_(null)}finally{t===I.current&&x(!1)}},[e,l]);(0,j.useEffect)(()=>{L()},[L]),(0,j.useEffect)(()=>{if(!l)return;let e=`code-file-${l}`;return d(e,e=>{let t=e;t.projectId===A.current&&(t.type===`file.summary_updated`&&t.path===M.current?(C(!1),L()):t.type===`file.summary_failed`&&t.path===M.current?(n.error(t.reason??s(`summary.generationFailed`)),C(!1)):t.type===`file.summary_skipped`&&t.path===M.current&&(t.reason&&n(s(`summary.skipped`,{reason:t.reason})),C(!1)))}),()=>f(e)},[l,d,f,L,s]);let R=(0,j.useCallback)(async t=>{C(!0);try{let i=await fetch(`${r()}/code/file/regenerate-summary?path=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({overrideBudget:t})}),a=await i.json().catch(()=>({}));if(!i.ok){C(!1);let e=typeof a.skipped==`string`?a.skipped:null;n.error(e?s(`summary.skipped`,{reason:e}):s(`summary.generationFailed`));return}if(a.skipped===`budget`){C(!1),w(!0);return}if(a.skipped){C(!1),n(s(`summary.skipped`,{reason:a.skipped}));return}await L(),C(!1)}catch{C(!1),n.error(s(`summary.generationFailed`))}},[L,e,s]),z=(0,j.useCallback)(async()=>{let t=g?.absolutePath??e;try{await navigator.clipboard?.writeText(t),n.success(s(`viewer.pathCopied`))}catch{n.error(s(`viewer.copyPathFailed`))}},[g,e,s]),re=(0,j.useMemo)(()=>Me(e,g?.language),[e,g?.language]),[B,V]=(0,j.useState)(`preview`),[H,U]=(0,j.useState)(!1),[W,ie]=(0,j.useState)(``),[G,ae]=(0,j.useState)(!1),oe=g?.content!==void 0&&!g.binary&&!g.tooLarge&&g.reason!==`not-found`,se=(0,j.useCallback)(()=>{ie(g?.content??``),V(`raw`),U(!0)},[g]),ce=(0,j.useCallback)(async()=>{ae(!0);try{let t=await fetch(`${r()}/code/file`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({path:e,content:W})});if(!t.ok){let e=await t.json().catch(()=>({}));n.error(e.error??s(`viewer.saveFailed`));return}n.success(s(`viewer.saved`)),U(!1),L()}catch{n.error(s(`viewer.saveFailed`))}finally{ae(!1)}},[e,W,s,L]),K=g?.summary??null,le=!!g?.summaryStale,q=g?.provenance??[],Y=g?.reason===`not-found`,X=Y?s(`summary.reason.missing`):g?.binary?s(`summary.reason.binary`):g?.tooLarge?s(`summary.reason.tooLarge`):null;return(0,j.useEffect)(()=>{if(i){if(y&&!g){i(null);return}return i({hasSummary:!!K,regenerating:S,disabledReason:X,onClick:()=>R(!1)}),()=>i(null)}},[g,R,y,i,S,K,X]),(0,j.useEffect)(()=>{if(o){if(y&&!g){o(null);return}return o({onClick:z}),()=>o(null)}},[z,g,y,o]),y&&!g?(0,J.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-sm text-muted-foreground animate-pulse`,children:s(`viewer.loadingFile`)}):(0,J.jsxs)(`div`,{ref:h,className:`flex flex-col h-full`,"data-testid":`file-viewer`,children:[T?(0,J.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center justify-between border-b border-border bg-surface px-4`,"data-testid":`summary-header-collapsed`,children:[(0,J.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e}),(0,J.jsxs)(`button`,{type:`button`,onClick:P,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,J.jsx)(m,{className:`h-3.5 w-3.5`}),s(`viewer.showSummary`)]})]}):(0,J.jsx)(Ae,{path:e,summary:K,stale:le,regenerating:S,generateDisabledReason:X,onCollapse:P}),(0,J.jsxs)(`div`,{className:`px-4 py-1 border-b border-border flex items-center justify-between gap-3`,children:[(0,J.jsx)(`div`,{className:`flex items-center gap-2 min-w-0`,children:re&&g?.content!==void 0&&!g.binary&&!g.tooLarge&&(0,J.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px]`,role:`group`,"aria-label":s(`viewer.markdownViewMode`),children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>V(`preview`),"aria-pressed":B===`preview`,className:B===`preview`?`px-2 py-1 rounded-md bg-accent-primary/20 text-accent-primary`:`px-2 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,children:s(`viewer.preview`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>V(`raw`),"aria-pressed":B===`raw`,className:B===`raw`?`px-2 py-1 rounded-md bg-accent-primary/20 text-accent-primary`:`px-2 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,children:s(`viewer.raw`)})]})}),(0,J.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px] shrink-0`,children:[oe&&!H&&(0,J.jsx)(`button`,{type:`button`,onClick:se,className:`px-2 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,children:s(`viewer.edit`)}),H&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>U(!1),disabled:G,className:`px-2 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50 disabled:opacity-50`,children:s(`actions.cancel`,{ns:`common`})}),(0,J.jsx)(`button`,{type:`button`,onClick:ce,disabled:G,className:`px-2 py-1 rounded-md bg-accent-primary/20 text-accent-primary hover:bg-accent-primary/30 disabled:opacity-50`,children:s(G?`viewer.saving`:`viewer.save`)})]})]})]}),(0,J.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:Y?(0,J.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,"data-testid":`file-missing`,children:s(`viewer.missingFile`)}):g?.binary?(0,J.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,"data-testid":`file-binary`,children:s(`viewer.binaryFile`)}):g?.tooLarge?(0,J.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,"data-testid":`file-too-large`,children:s(`viewer.tooLarge`,{size:Math.round((g.sizeBytes??0)/1024/1024)})}):g?.content===void 0?(0,J.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,children:s(`viewer.noContent`)}):H?(0,J.jsx)(Oe,{content:W,language:g.language??`plaintext`,readOnly:!1,onChange:ie}):re&&B===`preview`?(0,J.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4 prose prose-invert prose-sm max-w-none prose-p:my-2 prose-headings:mt-4 prose-headings:mb-2 prose-pre:bg-muted/40 prose-pre:rounded-md prose-code:before:content-none prose-code:after:content-none`,"data-testid":`markdown-preview`,children:(0,J.jsx)(je,{content:g.content})}):(0,J.jsx)(Oe,{content:g.content,language:g.language??`plaintext`})}),q.length>0&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{role:`separator`,"aria-orientation":`horizontal`,"aria-label":s(`history.resize`),onPointerDown:k?void 0:ne,onDoubleClick:k?void 0:N,className:k?`flex h-8 shrink-0 items-center justify-between border-t border-border bg-card/35 px-4`:`flex h-8 shrink-0 cursor-row-resize items-center justify-between border-y border-border/40 bg-card/35 px-4 hover:bg-accent-primary/10`,title:k?void 0:s(`resizer.hint`),"data-testid":`code-history-resizer`,children:[(0,J.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:s(`history.title`,{count:q.length})}),(0,J.jsxs)(`button`,{type:`button`,onPointerDown:e=>e.stopPropagation(),onClick:F,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[k?(0,J.jsx)(b,{className:`h-3.5 w-3.5`}):(0,J.jsx)(m,{className:`h-3.5 w-3.5`}),s(k?`history.show`:`history.hide`)]})]}),!k&&(0,J.jsx)(Ke,{rows:q,onOpenTicket:u,onFilterJob:t,height:D})]}),ee&&(0,J.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,role:`dialog`,"aria-modal":`true`,"data-testid":`budget-prompt`,children:(0,J.jsxs)(`div`,{className:`bg-card border border-border rounded-lg p-4 w-80 flex flex-col gap-3`,children:[(0,J.jsx)(`p`,{className:`text-sm text-foreground`,children:s(`viewer.budgetPrompt`)}),(0,J.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>w(!1),className:`text-xs px-3 py-1.5 rounded-md text-muted-foreground hover:text-foreground`,children:s(`common:actions.cancel`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>{w(!1),R(!0)},className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white`,children:s(`common:actions.confirm`)})]})]})})]})}function Ke({rows:e,onOpenTicket:t,onFilterJob:n,height:i}){let{t:a}=p(`code`),[o,s]=(0,j.useState)(null),[c,l]=(0,j.useState)({});if(e.length===0)return null;async function u(e,t){if(o===t){s(null);return}if(s(t),!(!e.jobId||c[t])){l(e=>({...e,[t]:`loading`}));try{let n=new URLSearchParams({jobId:e.jobId,path:e.path}),i=await fetch(`${r()}/code/diff?${n.toString()}`);if(i.status===404){l(e=>({...e,[t]:`missing`}));return}if(!i.ok)throw Error(`diff failed`);let a=await i.json();l(e=>({...e,[t]:{patch:a.patch??``,truncated:a.truncated===!0}}))}catch{l(e=>({...e,[t]:`missing`}))}}}return(0,J.jsx)(`div`,{className:`shrink-0 border-t border-border bg-card/40 px-4 py-3 overflow-hidden`,style:{height:i},"data-testid":`file-provenance-timeline`,children:(0,J.jsx)(`div`,{className:`h-full overflow-auto space-y-1`,children:e.map((e,r)=>{let i=e.kind===`created`?_:e.kind===`deleted`?d:w,s=e.jobId?e.jobId.length>12?e.jobId.slice(0,12):e.jobId:a(`history.unknownJob`),l=`${e.jobId??`job`}:${e.path}:${e.at}:${r}`,f=c[l];return(0,J.jsxs)(`div`,{className:`rounded-md hover:bg-muted/40`,children:[(0,J.jsxs)(`div`,{className:`grid grid-cols-[minmax(72px,auto)_minmax(0,1fr)_auto] items-center gap-2 text-xs px-2 py-1.5`,children:[(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 min-w-0`,children:[(0,J.jsx)(i,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,J.jsx)(`span`,{className:`capitalize`,children:a(`kind.${e.kind}`)})]}),(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 min-w-0 text-muted-foreground`,children:[(0,J.jsx)(E,{className:`h-3.5 w-3.5 shrink-0`}),e.jobId&&n?(0,J.jsx)(`button`,{type:`button`,onClick:()=>n(e.jobId),className:`font-mono truncate hover:text-foreground`,title:a(`history.filterByJob`,{jobId:e.jobId}),children:s}):(0,J.jsx)(`span`,{className:`font-mono truncate`,title:e.jobId??void 0,children:s}),e.jobId&&(0,J.jsx)(`button`,{type:`button`,onClick:()=>u(e,l),className:`shrink-0 rounded bg-muted/60 px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground`,children:a(`history.diff`)}),typeof e.ticketId==`number`&&(0,J.jsx)(`button`,{type:`button`,onClick:()=>t(e.ticketId),className:`shrink-0 rounded bg-accent-primary/15 px-1.5 py-0.5 text-[10px] text-accent-primary hover:bg-accent-primary/25`,title:a(`history.openSpec`,{ticketId:e.ticketId}),children:a(`history.specChip`,{ticketId:e.ticketId})})]}),(0,J.jsx)(`time`,{className:`text-[11px] text-muted-foreground`,dateTime:new Date(e.at).toISOString(),children:new Date(e.at).toLocaleString()})]}),o===l&&(0,J.jsx)(`div`,{className:`px-2 pb-2`,children:f===`loading`?(0,J.jsx)(`div`,{className:`rounded-md bg-muted/35 px-2 py-2 text-[11px] text-muted-foreground`,children:a(`history.loadingDiff`)}):f===`missing`||!f?(0,J.jsx)(`div`,{className:`rounded-md bg-muted/35 px-2 py-2 text-[11px] text-muted-foreground`,children:a(`history.diffUnavailable`)}):(0,J.jsxs)(`pre`,{className:`max-h-72 overflow-auto rounded-md bg-muted/50 px-2 py-2 font-mono text-[11px] leading-relaxed text-foreground/85`,children:[f.patch,f.truncated?`\n${a(`history.diffTruncated`)}`:``]})})]},l)})})})}var qe=320,Je=240,Ye=520;function Xe(e){return e?`specrails-desktop:code-tree-width:${e}`:null}function Ze(e){let t=Xe(e);if(!t)return qe;try{let e=localStorage.getItem(t),n=e?Number(e):NaN;return Number.isFinite(n)&&n>0?n:qe}catch{return qe}}function Qe(e,t){let n=Xe(e);if(n)try{localStorage.setItem(n,String(Math.round(t)))}catch{}}function $(e,t){let n=Math.max(Je,t-Ye);return Math.min(Math.max(e,Je),n)}function $e(){let{t:e}=p(`code`),{activeProjectId:t}=a(),[n]=S(),r=g(),i=(0,j.useRef)(null),[o,s]=(0,j.useState)(n.get(`path`)),[c,l]=(0,j.useState)(null),[u,d]=(0,j.useState)(null),[f,m]=(0,j.useState)(()=>Ze(t)),h=n.get(`jobId`),_=(0,j.useMemo)(()=>{let e=n.get(`ticketId`);if(!e)return null;let t=Number(e);return Number.isInteger(t)&&t>0?t:null},[n]),[v,y]=(0,j.useState)(_==null?``:String(_));(0,j.useEffect)(()=>{let e=n.get(`path`);e!==o&&s(e)},[n]),(0,j.useEffect)(()=>{y(_==null?``:String(_))},[_]),(0,j.useEffect)(()=>{let e=i.current?.clientWidth||window.innerWidth;m($(Ze(t),e))},[t]),(0,j.useEffect)(()=>{let e=i.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(e=>{let t=e[0]?.contentRect.width;typeof t==`number`&&m(e=>$(e,t))});return t.observe(e),()=>t.disconnect()},[]);let b=(0,j.useCallback)(e=>{let n=e.clientX,r=f,a=i.current?.clientWidth||window.innerWidth,o=e.currentTarget;try{o.setPointerCapture(e.pointerId)}catch{}function s(e){m($(r+(e.clientX-n),a))}function c(){window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),m(e=>{let n=$(e,a);return Qe(t,n),n})}window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,c),window.addEventListener(`pointercancel`,c)},[t,f]),x=(0,j.useCallback)(()=>{let e=$(qe,i.current?.clientWidth||window.innerWidth);m(e),Qe(t,e)},[t]),C=(0,j.useCallback)(e=>{s(e);let t=new URLSearchParams(n);t.set(`path`,e),r({pathname:`/code`,search:`?${t.toString()}`},{replace:!0})},[r,n]),ee=(0,j.useCallback)(e=>{let t=new URLSearchParams(n);t.set(`jobId`,e),t.delete(`ticketId`),r({pathname:`/code`,search:`?${t.toString()}`},{replace:!0})},[r,n]),w=(0,j.useCallback)(()=>{let e=new URLSearchParams(n);e.delete(`jobId`),e.delete(`ticketId`),r({pathname:`/code`,search:e.toString()?`?${e.toString()}`:``},{replace:!0})},[r,n]),T=(0,j.useCallback)(e=>{let t=Number(e.trim());if(!Number.isInteger(t)||t<=0){w();return}let i=new URLSearchParams(n);i.set(`ticketId`,String(t)),i.delete(`jobId`),r({pathname:`/code`,search:`?${i.toString()}`},{replace:!0})},[w,r,n]);return(0,J.jsxs)(`div`,{ref:i,className:`flex h-full w-full`,"data-testid":`code-page`,children:[(0,J.jsx)(`aside`,{className:`overflow-hidden flex flex-col shrink-0`,style:{width:f},children:(0,J.jsx)(he,{onOpenFile:C,selectedPath:o,filterJobId:h,filterTicketId:_},t??`no-project`)}),(0,J.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":e(`page.resizeFileTree`),onPointerDown:b,onDoubleClick:x,className:`relative w-1.5 shrink-0 cursor-col-resize select-none touch-none border-x border-border/40 hover:bg-accent-primary/20 focus-visible:outline-none focus-visible:bg-accent-primary/30`,title:e(`resizer.hint`),"data-testid":`code-tree-resizer`}),(0,J.jsxs)(`main`,{className:`flex-1 overflow-hidden flex flex-col`,children:[(0,J.jsx)(et,{jobId:h,ticketId:_,ticketInput:v,onTicketInputChange:y,onApplyTicket:T,onClear:w,summaryAction:c,copyPathAction:u}),(h||_)&&(0,J.jsx)(tt,{jobId:h,ticketId:_,onOpenFile:C}),o?(0,J.jsx)(Ge,{relPath:o,onFilterJob:ee,onSummaryActionChange:l,onCopyPathActionChange:d}):(0,J.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,children:e(`page.selectFile`)})]})]})}function et({jobId:e,ticketId:t,ticketInput:n,onTicketInputChange:r,onApplyTicket:i,onClear:a,summaryAction:s,copyPathAction:c}){let{t:u}=p(`code`),d=t?`spec`:e?`job-context`:`all`;return(0,J.jsx)(`div`,{className:`border-b border-border bg-background/80 px-4 py-2`,"data-testid":`code-provenance-toolbar`,children:(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,J.jsx)(A,{className:`h-3.5 w-3.5`}),u(`toolbar.scope`)]}),(0,J.jsx)(`button`,{type:`button`,onClick:a,"aria-pressed":d===`all`,className:d===`all`?`rounded-md bg-accent-primary/20 px-2 py-1 text-xs text-accent-primary`:`rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:u(`toolbar.allAi`)}),(0,J.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border/70 bg-card/40 px-1 py-1`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>i(n),"aria-pressed":d===`spec`,className:d===`spec`?`rounded bg-accent-success/20 px-2 py-0.5 text-xs text-accent-success`:`rounded px-2 py-0.5 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:u(`toolbar.spec`)}),(0,J.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i(n)},placeholder:u(`toolbar.ticketIdPlaceholder`),inputMode:`numeric`,className:`h-6 w-20 bg-transparent px-1 font-mono text-xs outline-none placeholder:text-muted-foreground/60`})]}),(0,J.jsx)(`div`,{className:`flex-1`}),c&&(0,J.jsx)(`button`,{type:`button`,onClick:c.onClick,className:`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:u(`toolbar.copyFilePath`)}),s&&(0,J.jsxs)(`button`,{type:`button`,onClick:s.onClick,disabled:s.regenerating||!!s.disabledReason,"aria-label":s.hasSummary?u(`toolbar.regenerateSummary`):u(`toolbar.generateSummary`),className:`inline-flex items-center gap-1.5 rounded-md bg-accent-primary/15 px-2.5 py-1 text-xs text-accent-primary hover:bg-accent-primary/25 disabled:opacity-50`,title:s.disabledReason?u(`toolbar.summaryUnavailable`,{reason:s.disabledReason}):void 0,children:[(0,J.jsx)(l,{className:s.regenerating?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),s.hasSummary?s.regenerating?u(`toolbar.regenerating`):u(`toolbar.regenerateSummary`):s.regenerating?u(`toolbar.generating`):u(`toolbar.generateSummary`)]}),d===`job-context`&&(0,J.jsx)(`span`,{className:`rounded-md bg-accent-info/15 px-2 py-1 text-xs text-accent-info`,children:u(`toolbar.jobContext`)}),(e||t)&&(0,J.jsxs)(`button`,{type:`button`,onClick:a,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,J.jsx)(o,{className:`h-3.5 w-3.5`}),u(`toolbar.clear`)]})]})})}function tt({jobId:e,ticketId:t,onOpenFile:n}){let{t:i}=p(`code`),[a,o]=(0,j.useState)(null);(0,j.useEffect)(()=>{let n=!1,i=new URLSearchParams;return e&&i.set(`jobId`,e),t&&i.set(`ticketId`,String(t)),fetch(`${r()}/code/provenance?${i.toString()}`).then(e=>e.ok?e.json():[]).then(e=>{n||o(Array.isArray(e)?e:[])}).catch(()=>{n||o([])}),()=>{n=!0}},[e,t]);let s=(0,j.useMemo)(()=>{let e=a??[];return{created:e.filter(e=>e.kind===`created`),modified:e.filter(e=>e.kind===`modified`),deleted:e.filter(e=>e.kind===`deleted`)}},[a]),c=a?.length??0;return(0,J.jsx)(`section`,{className:`border-b border-border bg-card/35 px-4 py-3`,"data-testid":`provenance-result-panel`,children:(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-sm font-semibold truncate`,children:e?i(`provenancePanel.jobTitle`,{jobId:e}):i(`provenancePanel.specTitle`,{ticketId:t})}),(0,J.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:i(`provenancePanel.touchedFiles`,{count:c})})]}),(0,J.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,J.jsx)(nt,{label:i(`action.added`),rows:s.created,icon:`created`,onOpenFile:n}),(0,J.jsx)(nt,{label:i(`action.changed`),rows:s.modified,icon:`modified`,onOpenFile:n}),(0,J.jsx)(nt,{label:i(`action.deleted`),rows:s.deleted,icon:`deleted`,onOpenFile:n})]})]}),(0,J.jsx)(`div`,{className:`flex items-center gap-1 shrink-0`,children:e&&(0,J.jsxs)(`a`,{href:`/jobs/${encodeURIComponent(e)}`,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,J.jsx)(C,{className:`h-3.5 w-3.5`}),i(`provenancePanel.log`)]})})]})})}function nt({label:e,rows:t,icon:n,onOpenFile:r}){return(0,J.jsxs)(`details`,{className:`group min-w-[180px] max-w-[320px]`,children:[(0,J.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-1.5 rounded-md bg-muted/35 px-2 py-1 text-xs hover:bg-muted/55`,children:[(0,J.jsx)(n===`created`?_:n===`deleted`?d:w,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,J.jsx)(`span`,{children:e}),(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:t.length})]}),t.length>0&&(0,J.jsx)(`div`,{className:`mt-1 max-h-28 overflow-auto rounded-md border border-border/60 bg-background/60 p-1`,children:t.map((e,t)=>(0,J.jsx)(`button`,{type:`button`,onClick:()=>r(e.path),className:`block w-full truncate rounded px-1.5 py-1 text-left font-mono text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,title:e.path,children:e.path},`${e.path}-${e.jobId??`job`}-${e.at}-${t}`))})]})}export{$e as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./clsx-CnH-HMk3.js";import{At as n,Ft as r,It as i,K as a,Lt as o,Mt as s,Nt as c,Ot as l,P as u,Pt as d,Rt as f,a as p,cn as m,d as h,en as g,jt as _,wt as v,zt as y}from"./index-BEGU2TCx.js";import{$ as b,A as x,B as S,E as ee,F as C,H as w,K as T,L as E,N as D,O,P as te,Q as ne,R as re,S as ie,T as ae,U as oe,W as se,X as ce,Y as le,Z as ue,_ as de,_t as fe,a as pe,c as me,d as he,dt as k,et as A,ft as ge,g as _e,gt as ve,h as ye,ht as be,i as j,it as xe,j as Se,k as Ce,l as we,lt as M,mt as Te,n as Ee,nt as De,o as Oe,pt as N,q as ke,r as Ae,rt as je,s as Me,t as Ne,u as Pe,ut as P,v as Fe,w as F,z as Ie}from"./BarChart-Cwp6VuED.js";var Le=v(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]);function I(e,t){return _(e,{...t,weekStartsOn:1})}function L(e,t){let n=s(e,t?.in),i=n.getFullYear(),a=r(n,0);a.setFullYear(i+1,0,4),a.setHours(0,0,0,0);let o=I(a),c=r(n,0);c.setFullYear(i,0,4),c.setHours(0,0,0,0);let l=I(c);return n.getTime()>=o.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function R(e,t){let n=s(e,t?.in);return n.setHours(0,0,0,0),n}function Re(e,t,n){let[r,a]=d(n?.in,e,t),o=R(r),s=R(a),c=+o-h(o),l=+s-h(s);return Math.round((c-l)/i)}function ze(e,t){let n=L(e,t),i=r(t?.in||e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),I(i)}function Be(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function Ve(e){return!(!Be(e)&&typeof e!=`number`||isNaN(+s(e)))}function He(e,t){let n=s(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Ue(e,t){let n=s(e,t?.in);return Re(n,He(n))+1}function We(e,t){let n=s(e,t?.in),r=I(n)-+ze(n);return Math.round(r/o)+1}function z(e,t){let n=s(e,t?.in),i=n.getFullYear(),a=c(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,l=r(t?.in||e,0);l.setFullYear(i+1,0,o),l.setHours(0,0,0,0);let u=_(l,t),d=r(t?.in||e,0);d.setFullYear(i,0,o),d.setHours(0,0,0,0);let f=_(d,t);return+n>=+u?i+1:+n>=+f?i:i-1}function Ge(e,t){let n=c(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=z(e,t),o=r(t?.in||e,0);return o.setFullYear(a,0,i),o.setHours(0,0,0,0),_(o,t)}function Ke(e,t){let n=s(e,t?.in),r=_(n,t)-+Ge(n,t);return Math.round(r/o)+1}function B(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var V={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return B(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):B(n+1,2)},d(e,t){return B(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return B(e.getHours()%12||12,t.length)},H(e,t){return B(e.getHours(),t.length)},m(e,t){return B(e.getMinutes(),t.length)},s(e,t){return B(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return B(Math.trunc(r*10**(n-3)),t.length)}},H={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},qe={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return V.y(e,t)},Y:function(e,t,n,r){let i=z(e,r),a=i>0?i:1-i;return t===`YY`?B(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):B(a,t.length)},R:function(e,t){return B(L(e),t.length)},u:function(e,t){return B(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return B(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return B(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return V.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return B(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=Ke(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):B(i,t.length)},I:function(e,t,n){let r=We(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):B(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):V.d(e,t)},D:function(e,t,n){let r=Ue(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):B(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return B(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return B(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return B(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?H.noon:r===0?H.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?H.evening:r>=12?H.afternoon:r>=4?H.morning:H.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return V.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):V.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):B(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):B(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):V.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):V.s(e,t)},S:function(e,t){return V.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return Ye(r);case`XXXX`:case`XX`:return U(r);default:return U(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return Ye(r);case`xxxx`:case`xx`:return U(r);default:return U(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+Je(r,`:`);default:return`GMT`+U(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+Je(r,`:`);default:return`GMT`+U(r,`:`)}},t:function(e,t,n){return B(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return B(+e,t.length)}};function Je(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+B(a,2)}function Ye(e,t){return e%60==0?(e>0?`-`:`+`)+B(Math.abs(e)/60,2):U(e,t)}function U(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=B(Math.trunc(r/60),2),a=B(r%60,2);return n+i+t+a}var Xe=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},Ze=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},Qe={p:Ze,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Xe(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,Xe(r,t)).replace(`{{time}}`,Ze(i,t))}},$e=/^D+$/,et=/^Y+$/,tt=[`D`,`DD`,`YY`,`YYYY`];function nt(e){return $e.test(e)}function rt(e){return et.test(e)}function it(e,t,n){let r=at(e,t,n);if(console.warn(r),tt.includes(e))throw RangeError(r)}function at(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var ot=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,st=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ct=/^'([^]*?)'?$/,lt=/''/g,ut=/[a-zA-Z]/;function dt(e,t,r){let i=c(),a=r?.locale??i.locale??n,o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,l=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,u=s(e,r?.in);if(!Ve(u))throw RangeError(`Invalid time value`);let d=t.match(st).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=Qe[t];return n(e,a.formatLong)}return e}).join(``).match(ot).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:ft(e)};if(qe[t])return{isToken:!0,value:e};if(t.match(ut))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});a.localize.preprocessor&&(d=a.localize.preprocessor(u,d));let f={firstWeekContainsDate:o,weekStartsOn:l,locale:a};return d.map(n=>{if(!n.isToken)return n.value;let i=n.value;(!r?.useAdditionalWeekYearTokens&&rt(i)||!r?.useAdditionalDayOfYearTokens&&nt(i))&&it(i,t,String(e));let o=qe[i[0]];return o(u,i,a.localize,f)}).join(``)}function ft(e){let t=e.match(ct);return t?t[1].replace(lt,`'`):e}var W=e(m());function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G.apply(null,arguments)}var pt=e=>{var{cx:n,cy:r,r:i,className:a}=e,o=t(`recharts-dot`,a);return k(n)&&k(r)&&k(i)?W.createElement(`circle`,G({},ve(e),xe(e),{className:o,cx:n,cy:r,r:i})):null},mt=[`points`];function ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ht(Object(n),!0).forEach(function(t){gt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ht(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gt(e,t,n){return(t=_t(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _t(e){var t=vt(e,`string`);return typeof t==`symbol`?t:t+``}function vt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q.apply(null,arguments)}function yt(e,t){if(e==null)return{};var n,r,i=bt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function xt(e){var{option:n,dotProps:r,className:i}=e;if((0,W.isValidElement)(n))return(0,W.cloneElement)(n,r);if(typeof n==`function`)return n(r);var a=t(i,typeof n==`boolean`?``:n.className),o=r??{},{points:s}=o,c=yt(o,mt);return W.createElement(pt,q({},c,{className:a}))}function St(e,t){return e==null?!1:t?!0:e.length===1}function Ct(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:s,clipPathId:c,zIndex:l=E.scatter}=e;if(!St(t,n))return null;var u=F(n),d=be(n),f=t.map((e,r)=>{var s=K(K(K({r:3},o),d),{},{index:r,cx:e.x??void 0,cy:e.y??void 0,dataKey:a,value:e.value,payload:e.payload,points:t});return W.createElement(xt,{key:`dot-${r}`,option:n,dotProps:s,className:i})}),p={};return s&&c!=null&&(p.clipPath=`url(#clipPath-${u?``:`dots-`}${c})`),W.createElement(x,{zIndex:l},W.createElement(N,q({className:r},p),f))}function wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wt(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Tt(e,t,n){return(t=Et(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Et(e){var t=Dt(e,`string`);return typeof t==`symbol`?t:t+``}function Dt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Ot=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var s=J(J(J({},{index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??`none`,strokeWidth:2,stroke:`#fff`,payload:t.payload,value:t.value}),fe(i)),xe(i)),c=(0,W.isValidElement)(i)?(0,W.cloneElement)(i,s):typeof i==`function`?i(s):W.createElement(pt,s);return W.createElement(N,{className:`recharts-active-dot`,clipPath:o},c)};function kt(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=E.activeDot}=e,s=De(Se),c=Pe();if(t==null||c==null)return null;var l=t.find(e=>c.includes(e.payload));return P(l)?null:W.createElement(x,{zIndex:o},W.createElement(Ot,{point:l,childIndex:Number(s),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var At=(e,t,n,r)=>D(e,`xAxis`,t,r),jt=(e,t,n,r)=>te(e,`xAxis`,t,r),Mt=(e,t,n,r)=>D(e,`yAxis`,n,r),Nt=(e,t,n,r)=>te(e,`yAxis`,n,r),Pt=A([oe,At,Mt,jt,Nt],(e,t,n,r,i)=>b(e,`xAxis`)?le(t,r,!1):le(n,i,!1)),Ft=(e,t,n,r,i)=>i;function It(e){return e.type===`line`}var Lt=A([oe,At,Mt,jt,Nt,A([C,Ft],(e,t)=>e.filter(It).find(e=>e.id===t)),Pt,re],(e,t,n,r,i,a,o,s)=>{var{chartData:c,dataStartIndex:l,dataEndIndex:u}=s;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!==`horizontal`&&e!==`vertical`)){var{dataKey:d,data:f}=a,p=f!=null&&f.length>0?f:c?.slice(l,u+1);if(p!=null)return cn({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:p})}});function Rt(e){var t=fe(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),s=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(s)||s<0)&&(s=r),{r:o,strokeWidth:s}}return{r:n,strokeWidth:r}}var zt=[`id`],Bt=[`type`,`layout`,`connectNulls`,`needClip`,`shape`],Vt=[`activeDot`,`animateNewValues`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`hide`,`isAnimationActive`,`label`,`legendType`,`xAxisId`,`yAxisId`,`id`];function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(null,arguments)}function Ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ht(Object(n),!0).forEach(function(t){Ut(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ht(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ut(e,t,n){return(t=Wt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wt(e){var t=Gt(e,`string`);return typeof t==`symbol`?t:t+``}function Gt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Z(e,t){if(e==null)return{};var n,r,i=Kt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Kt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var qt=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:ue(n,t),payload:e}]},Jt=W.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:s,unit:c,tooltipType:l,id:u}=e,d={dataDefinedOnItem:n,getPosition:ge,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:ue(o,t),hide:s,type:l,color:r,unit:c,graphicalItemId:u}};return W.createElement(Fe,{tooltipEntrySettings:d})}),Q=(e,t)=>`${t}px ${e}px`;function Yt(e,t){for(var n=e.length%2==0?e:[...e,0],r=[],i=0;i<t;++i)r.push(...n);return r}var Xt=(e,t,n)=>{var r=n.reduce((e,t)=>e+t,0);if(!r)return Q(t,e);for(var i=Math.floor(e/r),a=e%r,o=[],s=0,c=0;s<n.length;c+=(l=n[s])??0,++s){var l,u=n[s];if(u!=null&&c+u>a){o=[...n.slice(0,s),a-c];break}}var d=o.length%2==0?[0,t]:[t];return[...Yt(n,i),...o,...d].map(e=>`${e}px`).join(`, `)};function Zt(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:s}=r,c=ve(Z(r,zt));return W.createElement(Ct,{points:n,dot:i,className:`recharts-line-dots`,dotClassName:`recharts-line-dot`,dataKey:a,baseProps:c,needClip:o,clipPathId:t})}function Qt(e){var{showLabels:t,children:n,points:r}=e,i=(0,W.useMemo)(()=>r?.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return X(X({},t),{},{value:e.value,payload:e.payload,viewBox:t,parentViewBox:void 0,fill:void 0})}),[r]);return W.createElement(ae,{value:t?i:void 0},n)}function $t(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:o,layout:s,connectNulls:c,needClip:l,shape:u}=a,d=X(X({},Te(Z(a,Bt))),{},{fill:`none`,className:`recharts-line-curve`,clipPath:l?`url(#clipPath-${t})`:void 0,points:r,type:o,layout:s,connectNulls:c,strokeDasharray:i??a.strokeDasharray});return W.createElement(W.Fragment,null,r?.length>1&&W.createElement(ie,Y({shapeType:`curve`,option:u},d,{pathRef:n})),W.createElement(Zt,{points:r,clipPathId:t,props:a}))}function en(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function tn(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:o,strokeDasharray:s,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,animateNewValues:f,width:p,height:m,onAnimationEnd:h,onAnimationStart:g}=n,_=i.current,v=Ie(o,`recharts-line-`),y=(0,W.useRef)(v),[b,x]=(0,W.useState)(!1),C=!b,w=(0,W.useCallback)(()=>{typeof h==`function`&&h(),x(!1)},[h]),T=(0,W.useCallback)(()=>{typeof g==`function`&&g(),x(!0)},[g]),E=en(r.current),D=(0,W.useRef)(0);y.current!==v&&(D.current=a.current,y.current=v);var O=D.current;return W.createElement(Qt,{points:o,showLabels:C},n.children,W.createElement(S,{animationId:v,begin:l,duration:u,isActive:c,easing:d,onAnimationEnd:w,onAnimationStart:T,key:v},e=>{var l=M(O,E+O,e),u=Math.min(l,E),d=c?s?Xt(u,E,`${s}`.split(/[,\s]+/gim).map(e=>parseFloat(e))):Q(E,u):s==null?void 0:String(s);if(e>0&&E>0&&(i.current=o,a.current=Math.max(a.current,u)),_){var h=_.length/o.length,g=e===1?o:o.map((t,n)=>{var r=Math.floor(n*h);if(_[r]){var i=_[r];return X(X({},t),{},{x:M(i.x,t.x,e),y:M(i.y,t.y,e)})}return f?X(X({},t),{},{x:M(p*2,t.x,e),y:M(m/2,t.y,e)}):X(X({},t),{},{x:t.x,y:t.y})});return i.current=g,W.createElement($t,{props:n,points:g,clipPathId:t,pathRef:r,strokeDasharray:d})}return W.createElement($t,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:d})}),W.createElement(ee,{label:n.label}))}function nn(e){var{clipPathId:t,props:n}=e,r=(0,W.useRef)(null),i=(0,W.useRef)(0),a=(0,W.useRef)(null);return W.createElement(tn,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var rn=(e,t)=>({x:e.x??void 0,y:e.y??void 0,value:e.value,errorVal:ne(e.payload,t)}),an=class extends W.Component{render(){var{hide:e,dot:n,points:r,className:i,xAxisId:a,yAxisId:o,top:s,left:c,width:l,height:u,id:d,needClip:f,zIndex:p}=this.props;if(e)return null;var m=t(`recharts-line`,i),h=d,{r:g,strokeWidth:_}=Rt(n),v=F(n),y=g*2+_,b=f?`url(#clipPath-${v?``:`dots-`}${h})`:void 0;return W.createElement(x,{zIndex:p},W.createElement(N,{className:m},f&&W.createElement(`defs`,null,W.createElement(Oe,{clipPathId:h,xAxisId:a,yAxisId:o}),!v&&W.createElement(`clipPath`,{id:`clipPath-dots-${h}`},W.createElement(`rect`,{x:c-y/2,y:s-y/2,width:l+y,height:u+y}))),W.createElement(me,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:rn,errorBarOffset:0},W.createElement(nn,{props:this.props,clipPathId:h}))),W.createElement(kt,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:b}))}},on={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,connectNulls:!1,dot:!0,fill:`#fff`,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:E.line,type:`linear`};function sn(e){var t=je(e,on),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:s,dot:c,hide:l,isAnimationActive:u,label:d,legendType:f,xAxisId:p,yAxisId:m,id:h}=t,g=Z(t,Vt),{needClip:_}=Me(p,m),v=he(),y=se(),b=ke(),x=De(e=>Lt(e,p,m,b,h));if(y!==`horizontal`&&y!==`vertical`||x==null||v==null)return null;var{height:S,width:ee,x:C,y:w}=v;return W.createElement(an,Y({},g,{id:h,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:u,hide:l,label:d,legendType:f,xAxisId:p,yAxisId:m,points:x,layout:y,height:S,width:ee,left:C,top:w,needClip:_}))}function cn(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:o,bandSize:s,displayedData:c}=e;return c.map((e,c)=>{var l=ne(e,o);if(t===`horizontal`)return{x:ce({axis:n,ticks:i,bandSize:s,entry:e,index:c}),y:(P(l)?null:r.scale.map(l))??null,value:l,payload:e};var u=P(l)?null:n.scale.map(l),d=ce({axis:r,ticks:a,bandSize:s,entry:e,index:c});return u==null||d==null?null:{x:u,y:d,value:l,payload:e}}).filter(Boolean)}function ln(e){var t=je(e,on),n=ke();return W.createElement(_e,{id:t.id,type:`line`},e=>W.createElement(W.Fragment,null,W.createElement(de,{legendPayload:qt(t)}),W.createElement(Jt,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),W.createElement(ye,{type:`line`,id:e,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),W.createElement(sn,Y({},t,{id:e}))))}var un=W.memo(ln,w);un.displayName=`Line`;var dn=[`axis`],fn=(0,W.forwardRef)((e,t)=>W.createElement(Ee,{chartName:`LineChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:dn,tooltipPayloadSearcher:Ce,categoricalChartProps:e,ref:t})),$=y(),pn=[{value:`7d`,labelKey:`periods.d7`},{value:`30d`,labelKey:`periods.d30`},{value:`90d`,labelKey:`periods.d90`},{value:`all`,labelKey:`periods.all`},{value:`custom`,labelKey:`periods.custom`}];function mn({period:e,from:t,to:n,onChange:r}){let{t:i}=g(`analytics`);function a(e){e===`custom`?r(`custom`,t,n):r(e)}function o(e){r(`custom`,e,n)}function s(e){r(`custom`,t,e)}return(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`div`,{className:`flex items-center gap-1`,children:pn.map(t=>(0,$.jsx)(`button`,{onClick:()=>a(t.value),className:u(`h-7 px-3 rounded-md text-xs font-medium transition-colors`,e===t.value?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent`),children:i(t.labelKey)},t.value))}),e===`custom`&&(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`date`,value:t,onChange:e=>o(e.target.value),"aria-label":i(`periods.startDate`),className:`h-7 px-2 rounded-md text-xs bg-card border border-border text-foreground focus:outline-none focus:ring-1 focus:ring-primary`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i(`periods.to`)}),(0,$.jsx)(`input`,{type:`date`,value:n,onChange:e=>s(e.target.value),"aria-label":i(`periods.endDate`),className:`h-7 px-2 rounded-md text-xs bg-card border border-border text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]})]})}function hn({kpi:e}){let{t}=g(`analytics`);return(0,$.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-3`,children:[{label:t(`desktop.totalCost`),value:`$${e.totalCostUsd.toFixed(4)}`,sub:t(`desktop.costToday`,{value:`$${e.costToday.toFixed(4)}`})},{label:t(`desktop.totalJobs`),value:e.totalJobs.toLocaleString(),sub:t(`desktop.jobsToday`,{n:e.jobsToday})},{label:t(`desktop.successRate`),value:`${(e.successRate*100).toFixed(1)}%`,sub:t(`desktop.acrossAllProjects`)},{label:t(`desktop.avgCostPerJob`),value:e.totalJobs>0?`$${(e.totalCostUsd/e.totalJobs).toFixed(5)}`:`—`,sub:t(`desktop.periodAverage`)}].map(e=>(0,$.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4`,children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground mb-1`,children:e.label}),(0,$.jsx)(`p`,{className:`text-xl font-semibold font-mono`,children:e.value}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:e.sub})]},e.label))})}function gn({data:e}){let{t}=g(`analytics`),n=p(),r=e.length>0&&e.some(e=>e.costUsd>0),i=Math.max(1,Math.floor(e.length/7)),a=e.filter((e,t)=>t%i===0).map(e=>e.date);return(0,$.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium mb-3`,children:t(`desktop.costOverTime`)}),r?(0,$.jsx)(T,{width:`100%`,height:200,children:(0,$.jsxs)(fn,{data:e,margin:{top:4,right:8,left:0,bottom:0},children:[(0,$.jsx)(we,{strokeDasharray:`3 3`,stroke:`var(--color-border)`}),(0,$.jsx)(j,{dataKey:`date`,ticks:a,tickFormatter:e=>{try{return dt(new Date(e),`MMM d`,{locale:l()})}catch{return e}},tick:{fontSize:10,fill:`var(--color-muted-foreground)`},axisLine:!1,tickLine:!1}),(0,$.jsx)(Ae,{tickFormatter:e=>`$${e.toFixed(2)}`,tick:{fontSize:10,fill:`var(--color-muted-foreground)`},axisLine:!1,tickLine:!1,width:55}),(0,$.jsx)(O,{content:({active:e,payload:t,label:n})=>e&&t?.length?(0,$.jsxs)(`div`,{className:`bg-popover border border-border/30 rounded-lg p-2 text-xs shadow-lg`,children:[(0,$.jsx)(`p`,{className:`text-muted-foreground mb-1`,children:n}),(0,$.jsxs)(`p`,{className:`font-medium`,children:[`$`,t[0].value.toFixed(4)]})]}):null}),(0,$.jsx)(un,{type:`monotone`,dataKey:`costUsd`,stroke:n.chart[0],strokeWidth:2,dot:!1,activeDot:{r:3,fill:n.chart[0]}})]})}):(0,$.jsx)(`div`,{className:`h-[200px] flex items-center justify-center text-xs text-muted-foreground`,children:t(`desktop.noCostData`)})]})}function _n({projects:e}){let{t}=g(`analytics`),n=p();if(e.length===0)return(0,$.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium mb-3`,children:t(`desktop.projectComparison`)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`desktop.noProjects`)})]});let r=Math.max(...e.map(e=>e.totalCostUsd),1e-4);return(0,$.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium mb-4`,children:t(`desktop.projectComparison`)}),(0,$.jsx)(`div`,{className:`space-y-3`,children:e.map((e,i)=>(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,$.jsx)(`span`,{className:`font-medium truncate max-w-[160px]`,title:e.projectName,children:e.projectName}),(0,$.jsxs)(`div`,{className:`flex items-center gap-4 text-muted-foreground`,children:[(0,$.jsx)(`span`,{children:t(`desktop.jobsCount`,{count:e.totalJobs})}),(0,$.jsx)(`span`,{children:t(`desktop.successPct`,{pct:(e.successRate*100).toFixed(0)})}),(0,$.jsxs)(`span`,{className:`font-mono text-foreground`,children:[`$`,e.totalCostUsd.toFixed(4)]})]})]}),(0,$.jsx)(`div`,{className:`h-1.5 rounded-full bg-border/30 overflow-hidden`,children:(0,$.jsx)(`div`,{className:`h-full rounded-full transition-all duration-500`,style:{width:`${e.totalCostUsd/r*100}%`,backgroundColor:n.chart[i%n.chart.length]}})})]},e.projectId))})]})}function vn({projects:e}){let{t}=g(`analytics`),n=p();if(e.length===0)return null;let r=e.map(e=>({name:e.projectName.slice(0,12),costUsd:e.totalCostUsd}));return(0,$.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium mb-3`,children:t(`desktop.costByProject`)}),(0,$.jsx)(T,{width:`100%`,height:180,children:(0,$.jsxs)(Ne,{data:r,margin:{top:4,right:8,left:0,bottom:0},children:[(0,$.jsx)(we,{strokeDasharray:`3 3`,stroke:`var(--color-border)`}),(0,$.jsx)(j,{dataKey:`name`,tick:{fontSize:10,fill:`var(--color-muted-foreground)`},axisLine:!1,tickLine:!1}),(0,$.jsx)(Ae,{tickFormatter:e=>`$${e.toFixed(2)}`,tick:{fontSize:10,fill:`var(--color-muted-foreground)`},axisLine:!1,tickLine:!1,width:55}),(0,$.jsx)(O,{content:({active:e,payload:t,label:n})=>e&&t?.length?(0,$.jsxs)(`div`,{className:`bg-popover border border-border/30 rounded-lg p-2 text-xs shadow-lg`,children:[(0,$.jsx)(`p`,{className:`text-muted-foreground mb-1`,children:n}),(0,$.jsxs)(`p`,{className:`font-medium`,children:[`$`,t[0].value.toFixed(4)]})]}):null}),(0,$.jsx)(pe,{dataKey:`costUsd`,fill:n.chart[1],radius:[3,3,0,0]})]})})]})}function yn(){let{t:e}=g(`analytics`),[t,n]=(0,W.useState)(`7d`),[r,i]=(0,W.useState)(``),[o,s]=(0,W.useState)(``),[c,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(!0),[p,m]=(0,W.useState)(null),{registerHandler:h,unregisterHandler:_}=f(),v=(0,W.useCallback)(e=>{let n=e;n.type===`log`&&n.event_type===`job_done`&&y(t,r,o)},[t,r,o]);(0,W.useEffect)(()=>(h(`desktop-analytics`,v),()=>_(`desktop-analytics`)),[v,h,_]);async function y(e,t,n){d(!0),m(null);try{let r=new URLSearchParams({period:e});e===`custom`&&t&&n&&(r.set(`from`,t),r.set(`to`,n));let i=await fetch(`/api/analytics?${r}`);if(!i.ok)throw Error(`HTTP ${i.status}`);l(await i.json())}catch(e){m(e.message)}finally{d(!1)}}(0,W.useEffect)(()=>{y(t,r,o)},[t,r,o]);function b(e,t,r){n(e),t!==void 0&&i(t),r!==void 0&&s(r)}return(0,$.jsx)(`div`,{className:`flex flex-col h-full overflow-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`p-4 space-y-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Le,{className:`w-4 h-4 text-muted-foreground`}),(0,$.jsx)(`h1`,{className:`text-sm font-semibold`,children:e(`desktop.title`)}),c&&(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c.period.label})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(mn,{period:t,from:r,to:o,onChange:b}),(0,$.jsx)(`button`,{onClick:()=>y(t,r,o),disabled:u,className:`flex items-center gap-1.5 h-7 px-2 rounded-md text-xs text-muted-foreground hover:text-foreground hover:bg-accent transition-colors disabled:opacity-50`,"aria-label":e(`desktop.refreshAria`),children:(0,$.jsx)(a,{className:`w-3 h-3 ${u?`animate-spin`:``}`})})]})]}),p&&(0,$.jsx)(`div`,{className:`rounded-lg border border-red-400/30 aurora-light:border-destructive/30 bg-red-400/10 aurora-light:bg-destructive/10 p-3 text-xs text-red-400 aurora-light:text-destructive`,children:e(`desktop.failedToLoad`,{error:p})}),u&&!c&&(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-3`,children:Array.from({length:4}).map((e,t)=>(0,$.jsx)(`div`,{className:`h-20 rounded-lg border border-border/40 bg-card/50 animate-pulse`},t))}),(0,$.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:Array.from({length:2}).map((e,t)=>(0,$.jsx)(`div`,{className:`h-[220px] rounded-lg border border-border/40 bg-card/50 animate-pulse`},t))})]}),c&&(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsx)(hn,{kpi:c.kpi}),(0,$.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,$.jsx)(gn,{data:c.costTimeline}),(0,$.jsx)(vn,{projects:c.projectBreakdown})]}),(0,$.jsx)(_n,{projects:c.projectBreakdown})]})]})})}export{yn as default};
@@ -1,11 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{E as t,P as n,Q as r,T as i,cn as a,en as o,ht as s,k as c,m as l,p as u,rt as d,vt as f,w as p,zt as m}from"./index-BEGU2TCx.js";import{t as h}from"./lib-BBoUS-5a.js";/* empty css */var g=e(a(),1),_=m();function v({categories:e,activeCategory:t,activeSlug:r,onSelect:i,onHome:a}){let{t:s}=o(`integrations`);return(0,_.jsxs)(`nav`,{className:`w-56 flex-shrink-0 border-r border-border overflow-y-auto py-4 px-3`,children:[(0,_.jsxs)(`button`,{onClick:a,className:`flex items-center gap-2 mb-4 px-2 text-xs font-bold text-muted-foreground hover:text-foreground transition-colors`,children:[(0,_.jsx)(f,{className:`w-3.5 h-3.5`}),s(`docs.title`)]}),(0,_.jsx)(`div`,{className:`space-y-4`,children:e.map(e=>(0,_.jsxs)(`div`,{children:[(0,_.jsxs)(`div`,{className:`px-2 mb-1 flex items-center justify-between`,children:[(0,_.jsx)(`span`,{className:`text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:e.name}),e.docs.length>0&&(0,_.jsx)(`span`,{className:`text-[9px] font-medium text-muted-foreground/60 bg-muted/40 rounded px-1 py-0.5 leading-none`,children:e.docs.length})]}),e.docs.length===0?(0,_.jsx)(`p`,{className:`px-2 text-xs text-muted-foreground italic`,children:s(`docs.sidebarEmpty`)}):(0,_.jsx)(`ul`,{className:`space-y-0.5`,children:e.docs.map(a=>(0,_.jsx)(`li`,{children:(0,_.jsxs)(`button`,{onClick:()=>i(e.slug,a.slug),className:n(`w-full flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-colors text-left`,t===e.slug&&r===a.slug?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`),children:[(0,_.jsx)(d,{className:`w-3 h-3 flex-shrink-0`}),a.title]})},a.slug))})]},e.slug))})]})}function y({categories:e,onSelect:t}){let{t:n}=o(`integrations`),r=e.reduce((e,t)=>e+t.docs.length,0),i=e.filter(e=>e.docs.length>0).length;return(0,_.jsxs)(`div`,{className:`max-w-2xl mx-auto py-8 px-6`,children:[(0,_.jsxs)(`div`,{className:`mb-8`,children:[(0,_.jsx)(`h1`,{className:`text-xl font-bold mb-2`,children:n(`docs.title`)}),(0,_.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r===0?n(`docs.indexEmpty`):n(`docs.summary`,{documents:n(`docs.documentCount`,{count:r}),categories:n(`docs.categoryCount`,{count:i})})})]}),(0,_.jsx)(`div`,{className:`space-y-6`,children:e.map(e=>(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`h2`,{className:`text-sm font-semibold text-muted-foreground uppercase tracking-wider mb-2`,children:e.name}),e.docs.length===0?(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground italic pl-2`,children:n(`docs.categoryEmpty`)}):(0,_.jsx)(`ul`,{className:`space-y-1`,children:e.docs.map(n=>(0,_.jsx)(`li`,{children:(0,_.jsxs)(`button`,{onClick:()=>t(e.slug,n.slug),className:`w-full flex items-center gap-2 px-3 py-2 rounded-md text-sm hover:bg-accent transition-colors group text-left`,children:[(0,_.jsx)(d,{className:`w-3.5 h-3.5 text-muted-foreground flex-shrink-0`}),(0,_.jsx)(`span`,{className:`text-foreground group-hover:text-foreground`,children:n.title}),(0,_.jsx)(s,{className:`w-3 h-3 text-muted-foreground ml-auto md:opacity-0 md:group-hover:opacity-100 transition-opacity`})]})},n.slug))})]},e.slug))})]})}var b=(0,g.memo)(function({content:e}){return(0,_.jsx)(l,{remarkPlugins:[u],rehypePlugins:[h],children:e})});function x({category:e,slug:t,lang:n,onNotFound:i,scrollContainerRef:a}){let{t:s}=o(`integrations`),[c,l]=(0,g.useState)(null),[u,d]=(0,g.useState)(null),f=(0,g.useRef)(0);return(0,g.useEffect)(()=>{let r=++f.current;d(null),fetch(`/api/docs/${e}/${t}?lang=${encodeURIComponent(n)}`).then(async e=>{if(e.status===404){i();return}if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{r===f.current&&e&&(l(e),a.current&&(a.current.scrollTop=0))}).catch(e=>{r===f.current&&d(e instanceof Error?e.message:s(`docs.loadError`))})},[e,t,n,i,a]),!c&&!u?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,_.jsx)(r,{className:`w-4 h-4 animate-spin text-muted-foreground`})}):u&&!c?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,_.jsx)(`p`,{className:`text-sm text-destructive`,children:u})}):c?(0,_.jsx)(`article`,{className:`max-w-2xl mx-auto py-8 px-6`,children:(0,_.jsx)(`div`,{className:`prose prose-sm max-w-none
2
- prose-headings:text-foreground prose-headings:font-bold
3
- prose-p:text-foreground/90
4
- prose-a:text-accent-primary prose-a:no-underline hover:prose-a:underline
5
- prose-strong:text-foreground
6
- prose-code:text-accent-info prose-code:bg-card prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:text-xs
7
- prose-pre:bg-card prose-pre:border prose-pre:border-border prose-pre:rounded-md prose-pre:p-0 prose-pre:overflow-x-auto
8
- prose-blockquote:border-l-accent-primary prose-blockquote:text-muted-foreground
9
- prose-hr:border-border
10
- prose-th:text-foreground prose-td:text-foreground/90
11
- prose-li:text-foreground/90`,children:(0,_.jsx)(b,{content:c.content})})}):null}function S({open:e,onClose:n}){let{t:a,i18n:s}=o(`integrations`),l=s.language||`en`,[u,d]=(0,g.useState)(null),[f,m]=(0,g.useState)(!0),[h,b]=(0,g.useState)(),[S,C]=(0,g.useState)(),w=(0,g.useRef)(null);(0,g.useEffect)(()=>{e&&(m(!0),fetch(`/api/docs?lang=${encodeURIComponent(l)}`).then(e=>e.json()).then(e=>d(e)).catch(()=>d({categories:[]})).finally(()=>m(!1)))},[e,l]);let T=(0,g.useCallback)((e,t)=>{b(e),C(t)},[]),E=(0,g.useCallback)(()=>{b(void 0),C(void 0)},[]),D=!!(h&&S);return(0,_.jsx)(p,{open:e,onOpenChange:e=>{e||n()},children:(0,_.jsxs)(i,{className:`max-w-5xl max-h-[90vh] overflow-hidden p-0 flex flex-col`,children:[(0,_.jsx)(c,{className:`sr-only`,children:a(`docs.title`)}),(0,_.jsx)(t,{className:`sr-only`,children:a(`docs.dialogDescription`)}),(0,_.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[f?(0,_.jsx)(`div`,{className:`w-56 flex-shrink-0 border-r border-border flex items-center justify-center`,children:(0,_.jsx)(r,{className:`w-3.5 h-3.5 animate-spin text-muted-foreground`})}):(0,_.jsx)(v,{categories:u?.categories??[],activeCategory:h,activeSlug:S,onSelect:T,onHome:E}),(0,_.jsx)(`main`,{ref:w,className:`flex-1 overflow-y-auto`,children:D&&h&&S?(0,_.jsx)(x,{category:h,slug:S,lang:l,onNotFound:E,scrollContainerRef:w}):u&&(0,_.jsx)(y,{categories:u.categories,onSelect:T})})]})]})})}var C=(0,g.memo)(S);export{C as default};
@@ -1,11 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{P as t,Q as n,an as r,cn as i,en as a,ht as o,in as s,m as c,p as l,rn as u,rt as d,vt as f,zt as p}from"./index-BEGU2TCx.js";import{t as m}from"./lib-BBoUS-5a.js";/* empty css */var h=e(i(),1),g=p();function _({categories:e,activeCategory:n,activeSlug:r}){let{t:i}=a(`integrations`);return(0,g.jsxs)(`nav`,{className:`w-56 flex-shrink-0 border-r border-border overflow-y-auto py-4 px-3`,children:[(0,g.jsxs)(u,{to:`/docs`,className:`flex items-center gap-2 mb-4 px-2 text-xs font-bold text-muted-foreground hover:text-foreground transition-colors`,children:[(0,g.jsx)(f,{className:`w-3.5 h-3.5`}),i(`docs.title`)]}),(0,g.jsx)(`div`,{className:`space-y-4`,children:e.map(e=>(0,g.jsxs)(`div`,{children:[(0,g.jsxs)(`div`,{className:`px-2 mb-1 flex items-center justify-between`,children:[(0,g.jsx)(`span`,{className:`text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:e.name}),e.docs.length>0&&(0,g.jsx)(`span`,{className:`text-[9px] font-medium text-muted-foreground/60 bg-muted/40 rounded px-1 py-0.5 leading-none`,children:e.docs.length})]}),e.docs.length===0?(0,g.jsx)(`p`,{className:`px-2 text-xs text-muted-foreground italic`,children:i(`docs.sidebarEmpty`)}):(0,g.jsx)(`ul`,{className:`space-y-0.5`,children:e.docs.map(i=>{let a=n===e.slug&&r===i.slug;return(0,g.jsx)(`li`,{children:(0,g.jsxs)(u,{to:`/docs/${e.slug}/${i.slug}`,className:t(`flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-colors`,a?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`),children:[(0,g.jsx)(d,{className:`w-3 h-3 flex-shrink-0`}),i.title]})},i.slug)})})]},e.slug))})]})}function v({categories:e}){let{t}=a(`integrations`),n=e.reduce((e,t)=>e+t.docs.length,0),r=e.filter(e=>e.docs.length>0).length;return(0,g.jsxs)(`div`,{className:`max-w-2xl mx-auto py-8 px-6`,children:[(0,g.jsxs)(`div`,{className:`mb-8`,children:[(0,g.jsx)(`h1`,{className:`text-xl font-bold mb-2`,children:t(`docs.title`)}),(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n===0?t(`docs.indexEmpty`):t(`docs.summary`,{documents:t(`docs.documentCount`,{count:n}),categories:t(`docs.categoryCount`,{count:r})})})]}),(0,g.jsx)(`div`,{className:`space-y-6`,children:e.map(e=>(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h2`,{className:`text-sm font-semibold text-muted-foreground uppercase tracking-wider mb-2`,children:e.name}),e.docs.length===0?(0,g.jsx)(`p`,{className:`text-xs text-muted-foreground italic pl-2`,children:t(`docs.categoryEmpty`)}):(0,g.jsx)(`ul`,{className:`space-y-1`,children:e.docs.map(t=>(0,g.jsx)(`li`,{children:(0,g.jsxs)(u,{to:`/docs/${e.slug}/${t.slug}`,className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm hover:bg-accent transition-colors group`,children:[(0,g.jsx)(d,{className:`w-3.5 h-3.5 text-muted-foreground flex-shrink-0`}),(0,g.jsx)(`span`,{className:`text-foreground group-hover:text-foreground`,children:t.title}),(0,g.jsx)(o,{className:`w-3 h-3 text-muted-foreground ml-auto md:opacity-0 md:group-hover:opacity-100 transition-opacity`})]})},t.slug))})]},e.slug))})]})}var y=(0,h.memo)(function({content:e}){return(0,g.jsx)(c,{remarkPlugins:[l],rehypePlugins:[m],children:e})});function b({category:e,slug:t,lang:r,scrollContainerRef:i}){let{t:o}=a(`integrations`),[c,l]=(0,h.useState)(null),[u,d]=(0,h.useState)(null),f=(0,h.useRef)(0),p=s();return(0,h.useEffect)(()=>{let n=++f.current;d(null),fetch(`/api/docs/${e}/${t}?lang=${encodeURIComponent(r)}`).then(async e=>{if(e.status===404){p(`/docs`,{replace:!0});return}if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{n===f.current&&e&&(l(e),i.current&&(i.current.scrollTop=0))}).catch(e=>{n===f.current&&d(e instanceof Error?e.message:o(`docs.loadError`))})},[e,t,r,p,i]),!c&&!u?(0,g.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,g.jsx)(n,{className:`w-4 h-4 animate-spin text-muted-foreground`})}):u&&!c?(0,g.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,g.jsx)(`p`,{className:`text-sm text-destructive`,children:u})}):c?(0,g.jsx)(`article`,{className:`max-w-2xl mx-auto py-8 px-6`,children:(0,g.jsx)(`div`,{className:`prose prose-sm max-w-none
2
- prose-headings:text-foreground prose-headings:font-bold
3
- prose-p:text-foreground/90
4
- prose-a:text-accent-primary prose-a:no-underline hover:prose-a:underline
5
- prose-strong:text-foreground
6
- prose-code:text-accent-info prose-code:bg-card prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:text-xs
7
- prose-pre:bg-card prose-pre:border prose-pre:border-border prose-pre:rounded-md prose-pre:p-0 prose-pre:overflow-x-auto
8
- prose-blockquote:border-l-accent-primary prose-blockquote:text-muted-foreground
9
- prose-hr:border-border
10
- prose-th:text-foreground prose-td:text-foreground/90
11
- prose-li:text-foreground/90`,children:(0,g.jsx)(y,{content:c.content})})}):null}function x(){let{category:e,slug:t}=r(),{i18n:i}=a(`integrations`),o=i.language||`en`,[s,c]=(0,h.useState)(null),[l,u]=(0,h.useState)(!0),d=(0,h.useRef)(null);(0,h.useEffect)(()=>{fetch(`/api/docs?lang=${encodeURIComponent(o)}`).then(e=>e.json()).then(e=>c(e)).catch(()=>c({categories:[]})).finally(()=>u(!1))},[o]);let f=!!(e&&t);return(0,g.jsxs)(`div`,{className:`flex h-full overflow-hidden`,children:[l?(0,g.jsx)(`div`,{className:`w-56 flex-shrink-0 border-r border-border flex items-center justify-center`,children:(0,g.jsx)(n,{className:`w-3.5 h-3.5 animate-spin text-muted-foreground`})}):(0,g.jsx)(_,{categories:s?.categories??[],activeCategory:e,activeSlug:t}),(0,g.jsx)(`main`,{ref:d,className:`flex-1 overflow-y-auto`,children:f&&e&&t?(0,g.jsx)(b,{category:e,slug:t,lang:o,scrollContainerRef:d}):s&&(0,g.jsx)(v,{categories:s.categories})})]})}export{x as default};
@@ -1,3 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{$t as t,Bt as n,C as r,Dt as i,Et as a,L as o,N as s,O as c,Q as l,R as u,Rt as d,S as f,T as p,Tt as m,Y as h,cn as g,dt as _,en as v,ft as y,k as b,nn as x,q as S,st as C,t as w,w as T,zt as E}from"./index-BEGU2TCx.js";var D=e(g(),1),O=E(),k=[`todo`,`in_progress`,`done`,`cancelled`],A={todo:`todo`,in_progress:`inProgress`,done:`done`,cancelled:`cancelled`};function j({state:e,onChanged:n}){let{t:r}=v(`jira`),i=e.connection,[a,o]=(0,D.useState)(i.enabled),[c,l]=(0,D.useState)(!1),[u,d]=(0,D.useState)(!1),[p,m]=(0,D.useState)([]),[h,g]=(0,D.useState)([]),[_,y]=(0,D.useState)(i.discardStatus??``),[b,x]=(0,D.useState)(i.statusMap??{}),S=e.outbox??{pending:0,inflight:0,done:0,dead:0},C=(0,D.useCallback)(async()=>{try{let{ops:e}=await f.listOutbox(`dead`);m(e)}catch{m([])}},[]);(0,D.useEffect)(()=>{C()},[C]),(0,D.useEffect)(()=>{let e=!1;return f.listStatuses().then(({statuses:t})=>{e||g(t)}).catch(()=>{e||g([])}),()=>{e=!0}},[]);async function w(e){let i=_;y(e);try{await f.patchConnection({discardStatus:e||null}),n()}catch(e){y(i),t.error(N(e,r))}}async function T(e,i){let a=b,o={...b,[e]:i||void 0};x(o);let s=Object.fromEntries(Object.entries(o).filter(([,e])=>e));try{await f.patchConnection({statusMap:Object.keys(s).length?s:null}),n()}catch(e){x(a),t.error(N(e,r))}}async function E(){let e=!a;o(e),d(!0);try{await f.setEnabled(e)}catch(n){o(!e),t.error(N(n,r))}finally{d(!1)}}async function j(){l(!0);try{let e=await f.syncNow();t.success(r(`status.syncedToast`,{count:e.upserted}))}catch(e){t.error(N(e,r))}finally{l(!1)}}async function P(){if(window.confirm(r(`status.disconnectConfirm`))){d(!0);try{await f.disconnect(),t.success(r(`status.disconnectedToast`)),n()}catch(e){t.error(N(e,r))}finally{d(!1)}}}async function F(e){try{await f.retryOutbox(e),await C()}catch(e){t.error(N(e,r))}}let I=S.pending+S.inflight;return(0,O.jsxs)(`div`,{className:`space-y-4`,"data-testid":`jira-connected`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:r(`status.connected`,{key:i.jiraProjectKey})}),(0,O.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[i.baseUrl,` · `,i.deployment===`cloud`?r(`review.cloud`):r(`review.dc`)]})]}),(0,O.jsx)(`a`,{href:`${i.baseUrl}/browse/${i.jiraProjectKey}`,target:`_blank`,rel:`noreferrer`,className:`text-xs text-accent-primary hover:underline`,children:r(`badge.openInJira`)})]}),(0,O.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-border p-3`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:r(`status.enabledLabel`)}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(a?`status.enabledHelp`:`status.pausedHelp`)})]}),(0,O.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":a,"aria-label":r(`status.enabledLabel`),disabled:u,onClick:E,className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${a?`bg-accent-success`:`bg-input`}`,children:(0,O.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-background shadow-sm transition-transform ${a?`translate-x-4`:`translate-x-0.5`}`})})]}),(0,O.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-status-map`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:r(`wizard.step3Title`)}),(0,O.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:r(`mapping.intro`)}),(0,O.jsx)(`div`,{className:`space-y-2`,children:k.map(e=>(0,O.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r(`mapping.${A[e]}`)}),(0,O.jsxs)(`select`,{value:b[e]??``,onChange:t=>void T(e,t.target.value),className:`w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-statusmap-${e}`,children:[(0,O.jsx)(`option`,{value:``,children:r(`mapping.auto`)}),h.map(e=>(0,O.jsx)(`option`,{value:e.name,children:e.name},e.id)),b[e]&&!h.some(t=>t.name===b[e])&&(0,O.jsx)(`option`,{value:b[e],children:b[e]})]})]},e))})]}),(0,O.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:r(`discard.configLabel`)}),(0,O.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:r(`discard.configHelp`)}),(0,O.jsxs)(`select`,{value:_,onChange:e=>void w(e.target.value),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-discard-status-select`,children:[(0,O.jsx)(`option`,{value:``,children:r(`discard.configNone`)}),h.map(e=>(0,O.jsx)(`option`,{value:e.name,children:e.name},e.id)),_&&!h.some(e=>e.name===_)&&(0,O.jsx)(`option`,{value:_,children:_})]})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(s,{variant:`outline`,size:`sm`,onClick:j,disabled:c,children:r(c?`status.syncing`:`status.syncNow`)}),(0,O.jsx)(s,{variant:`ghost`,size:`sm`,onClick:P,disabled:u,className:`text-destructive`,children:r(`status.disconnect`)})]}),(0,O.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-outbox`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:r(`outbox.title`)}),S.dead>0?(0,O.jsx)(`p`,{className:`mt-1 text-xs text-accent-warning`,children:r(`outbox.dead`,{count:S.dead})}):I>0?(0,O.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:r(`outbox.pending`,{count:I})}):(0,O.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:r(`outbox.allSynced`)}),p.length>0&&(0,O.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`outbox.deadHelp`)}),p.map(e=>(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded border border-border/60 px-2 py-1`,children:[(0,O.jsxs)(`span`,{className:`truncate text-xs`,children:[M(e,r),` · `,e.deadReason??e.lastError??``]}),(0,O.jsx)(s,{variant:`outline`,size:`sm`,onClick:()=>F(e.id),children:r(`outbox.retry`)})]},e.id))]})]})]})}function M(e,t){return e.opType===`transition`?t(`outbox.opTransition`):e.opType===`comment`?t(`outbox.opComment`):t(`outbox.opCreate`)}function N(e,t){return e instanceof Error?e.message:t(`errors.generic`)}function P({activeProjectId:e}){let{t}=v(`integrations`),[n,i]=(0,D.useState)(null),[a,o]=(0,D.useState)(!0),[s,l]=(0,D.useState)(!1),[u,d]=(0,D.useState)(!1),m=(0,D.useCallback)(async()=>{try{i(await f.getConnection())}catch{i({connected:!1})}finally{o(!1)}},[]);if((0,D.useEffect)(()=>{!r||!e||(o(!0),m())},[e,m]),!r)return null;let g=!!(n?.connected&&n.connection);return(0,O.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-4 flex flex-col gap-3 h-full`,"data-testid":`jira-integration-card`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,O.jsx)(`div`,{className:`grid place-items-center w-9 h-9 rounded-md bg-accent-info/15 text-accent-info shrink-0`,children:(0,O.jsx)(h,{className:`w-4 h-4`})}),(0,O.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold`,children:t(`jiraCard.title`)}),g&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success flex items-center gap-1`,"data-testid":`jira-connected-badge`,children:[(0,O.jsx)(y,{className:`w-3 h-3`}),` `,t(`jiraCard.connected`)]})]}),(0,O.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5`,children:t(`jiraCard.category`)})]})]}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:g&&n?.connection?t(`jiraCard.connectedDescription`,{key:n.connection.jiraProjectKey}):t(`jiraCard.description`)}),(0,O.jsxs)(`ul`,{className:`text-xs space-y-1 list-disc pl-4 text-foreground/80`,children:[(0,O.jsx)(`li`,{children:t(`jiraCard.bullet1`)}),(0,O.jsx)(`li`,{children:t(`jiraCard.bullet2`)}),(0,O.jsx)(`li`,{children:t(`jiraCard.bullet3`)})]}),(0,O.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:t(`jiraCard.requires`)}),(0,O.jsx)(`div`,{className:`mt-auto pt-2 flex items-center justify-end gap-2`,children:a?(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`…`}):g?(0,O.jsx)(`button`,{type:`button`,onClick:()=>d(!0),"data-testid":`jira-manage-btn`,className:`text-xs px-3 py-1.5 rounded-md border border-border hover:bg-muted/30 inline-flex items-center gap-1.5`,children:t(`jiraCard.manage`)}):(0,O.jsxs)(`button`,{type:`button`,onClick:()=>l(!0),"data-testid":`jira-connect-btn`,className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white hover:opacity-90 inline-flex items-center gap-1.5`,children:[(0,O.jsx)(h,{className:`w-3.5 h-3.5`}),t(`jiraCard.connect`)]})}),(0,O.jsx)(T,{open:s,onOpenChange:l,children:(0,O.jsxs)(p,{className:`max-w-lg`,children:[(0,O.jsx)(c,{children:(0,O.jsx)(b,{children:t(`jiraCard.modalTitle`)})}),(0,O.jsx)(w,{onConnected:()=>{l(!1),m()},onSkip:()=>l(!1)})]})}),(0,O.jsx)(T,{open:u,onOpenChange:d,children:(0,O.jsxs)(p,{className:`max-w-lg`,children:[(0,O.jsx)(c,{children:(0,O.jsx)(b,{children:t(`jiraCard.manageTitle`)})}),n?.connected&&n.connection&&(0,O.jsx)(j,{state:n,onChanged:()=>{m().then(()=>d(!1))}})]})})]})}function F(){let{t:e}=v(`integrations`),{activeProjectId:t,projects:s}=a(),c=s.find(e=>e.id===t),l=c?m(c).includes(`claude`):!0,{registerHandler:u,unregisterHandler:f}=d(),p=(0,D.useRef)(t);(0,D.useEffect)(()=>{p.current=t},[t]);let[h,g]=(0,D.useState)(null),[_,y]=(0,D.useState)(null),{data:b,isLoading:x,isFirstLoad:C,refresh:w}=i({namespace:`plugins`,projectId:t,initialValue:[],fetcher:(0,D.useCallback)(async()=>{let e=await fetch(`${n()}/plugins`);if(!e.ok)throw Error(`HTTP ${e.status}`);return(await e.json()).plugins??[]},[])});(0,D.useEffect)(()=>(u(`integrations-page`,e=>{let t=e;t.type&&(t.projectId&&t.projectId!==p.current||t.type.startsWith(`plugin.`)&&w())}),()=>f(`integrations-page`)),[u,f,w]),(0,D.useEffect)(()=>{g(!x&&!b?`Failed to load plugins`:null)},[x,b]);let T=(0,D.useMemo)(()=>(b??[]).filter(e=>e.status!==`orphan`),[b]),E=(0,D.useMemo)(()=>(b??[]).filter(e=>e.status===`orphan`),[b]);return t?(0,O.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,O.jsxs)(`div`,{className:`flex-shrink-0 border-b border-border px-6 pt-4 pb-3 flex items-center gap-2`,children:[(0,O.jsx)(S,{className:`w-4 h-4 text-accent-primary`}),(0,O.jsxs)(`div`,{className:`flex-1`,children:[(0,O.jsx)(`h1`,{className:`text-lg font-semibold`,children:e(`page.title`)}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`page.subtitle`)})]})]}),(0,O.jsx)(`div`,{className:`flex-1 overflow-auto p-6`,children:C&&x?(0,O.jsx)(G,{}):h&&l?(0,O.jsx)(K,{onRetry:w}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:[(0,O.jsx)(P,{activeProjectId:t}),l&&T.map(e=>(0,O.jsx)(I,{plugin:e,isInstalling:_===e.name,onInstall:()=>y(e.name),onCloseInstall:()=>{y(null),w()}},e.name))]}),l&&E.length>0&&(0,O.jsxs)(`div`,{className:`mt-10`,children:[(0,O.jsxs)(`h2`,{className:`text-sm font-semibold text-muted-foreground mb-3 flex items-center gap-2`,children:[(0,O.jsx)(o,{className:`w-3.5 h-3.5`}),` `,e(`page.deprecated`)]}),(0,O.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:E.map(e=>(0,O.jsx)(V,{plugin:e,onRemoved:w},e.name))})]}),!r&&(!l||T.length===0)&&(0,O.jsx)(q,{})]})})]}):(0,O.jsx)(`div`,{className:`flex flex-col items-center justify-center h-full text-muted-foreground text-sm`,children:e(`page.selectProject`)})}function I({plugin:e,isInstalling:t,onInstall:n,onCloseInstall:r}){let{t:i}=v(`integrations`),[a,s]=(0,D.useState)(!1);return(0,O.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-4 flex flex-col gap-3 h-full`,children:[(0,O.jsx)(`div`,{className:`flex items-start gap-2`,children:(0,O.jsxs)(`div`,{className:`flex-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.name}),(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground`,children:[`v`,e.version]}),e.status===`installed`&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success flex items-center gap-1`,children:[(0,O.jsx)(y,{className:`w-3 h-3`}),` `,i(`card.statusActive`)]}),e.status===`deactivated`&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground flex items-center gap-1`,children:[(0,O.jsx)(_,{className:`w-3 h-3`}),` `,i(`card.statusDeactivated`)]}),e.status===`degraded`&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-warning/20 text-accent-warning flex items-center gap-1`,children:[(0,O.jsx)(o,{className:`w-3 h-3`}),` `,i(`card.statusDegraded`)]}),e.updateAvailable&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-info/20 text-accent-info flex items-center gap-1`,children:[(0,O.jsx)(C,{className:`w-3 h-3`}),` `,i(`card.updateAvailable`)]})]}),e.category&&(0,O.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5`,children:e.category})]})}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:e.description}),e.whatItDoes.length>0&&(0,O.jsx)(`ul`,{className:`text-xs space-y-1 list-disc pl-4 text-foreground/80`,children:e.whatItDoes.map((e,t)=>(0,O.jsx)(`li`,{children:e},t))}),e.requirements.length>0&&(0,O.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:i(`card.requires`,{list:e.requirements.map(e=>`${e.name}${e.minVersion?` ≥ ${e.minVersion}`:``}`).join(`, `)})}),e.healthReason&&e.status===`degraded`&&(0,O.jsx)(`div`,{className:`text-[11px] text-accent-warning`,children:e.healthReason}),e.status===`deactivated`&&(0,O.jsx)(`div`,{className:`text-[11px] text-muted-foreground leading-relaxed`,children:(0,O.jsx)(x,{t:i,i18nKey:`card.deactivatedHint`,components:{strong:(0,O.jsx)(`strong`,{})}})}),e.marketplaceConflicts&&e.marketplaceConflicts.length>0&&(0,O.jsx)(B,{pluginName:e.name,conflicts:e.marketplaceConflicts}),e.marketplaceCachedButDisabled&&e.marketplaceCachedButDisabled.length>0&&(0,O.jsx)(R,{keys:e.marketplaceCachedButDisabled}),e.updateAvailable&&(0,O.jsx)(z,{pluginName:e.name}),(0,O.jsx)(`div`,{className:`mt-auto pt-2 flex items-center justify-end gap-2`,children:e.status===`not-installed`?(0,O.jsx)(`button`,{type:`button`,onClick:n,className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white hover:opacity-90`,children:i(`card.install`)}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(L,{pluginName:e.name,active:e.status===`installed`}),(0,O.jsxs)(`button`,{type:`button`,onClick:()=>s(!0),className:`text-xs px-3 py-1.5 rounded-md border border-border hover:bg-destructive/10 hover:text-destructive flex items-center gap-1.5`,children:[(0,O.jsx)(u,{className:`w-3 h-3`}),` `,i(`card.uninstall`)]})]})}),t&&(0,O.jsx)(H,{pluginName:e.name,onClose:r}),a&&(0,O.jsx)(U,{pluginName:e.name,onClose:()=>s(!1),onUninstalled:()=>{s(!1)}})]})}function L({pluginName:e,active:t}){let{t:r}=v(`integrations`),[i,a]=(0,D.useState)(!1),[o,s]=(0,D.useState)(null);return(0,O.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,O.jsx)(`button`,{type:`button`,disabled:i,onClick:async()=>{a(!0),s(null);try{let r=`${n()}/plugins/${e}/${t?`deactivate`:`activate`}`,i=await fetch(r,{method:`POST`});if(!i.ok)throw Error((await i.json()).error??`HTTP ${i.status}`)}catch(e){s(e.message)}finally{a(!1)}},role:`switch`,"aria-checked":t,className:`relative inline-flex items-center h-5 w-9 rounded-full transition-colors disabled:opacity-50 ${t?`bg-accent-success`:`bg-muted`}`,title:r(t?`toggle.titleActive`:`toggle.titleDeactivated`),children:(0,O.jsx)(`span`,{className:`inline-block h-4 w-4 rounded-full bg-white shadow transition-transform ${t?`translate-x-4`:`translate-x-0.5`}`})}),(0,O.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:r(t?`card.statusActive`:`common:states.off`)}),o&&(0,O.jsx)(`span`,{className:`text-[10px] text-destructive`,children:o})]})}function R({keys:e}){let{t}=v(`integrations`);return(0,O.jsxs)(`div`,{className:`text-[11px] rounded-md border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 p-2 leading-relaxed space-y-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,O.jsx)(o,{className:`w-3 h-3 text-yellow-500 aurora-light:text-accent-warning mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:(0,O.jsx)(x,{t,i18nKey:`cachedNotice.body`,components:{strong:(0,O.jsx)(`strong`,{}),code:(0,O.jsx)(`code`,{className:`bg-muted px-1 rounded`})}})})]}),(0,O.jsx)(`div`,{className:`pl-5 space-y-0.5`,children:e.map(e=>(0,O.jsxs)(`pre`,{className:`text-[10px] bg-muted/40 rounded px-1.5 py-0.5 inline-block font-mono`,children:[`/plugin uninstall `,e]},e))}),(0,O.jsx)(`div`,{className:`pl-5 text-[10px] text-muted-foreground`,children:t(`cachedNotice.runInstruction`)})]})}function z({pluginName:e}){let{t}=v(`integrations`),[r,i]=(0,D.useState)(!1),[a,o]=(0,D.useState)(null);return(0,O.jsxs)(`div`,{className:`text-[11px] rounded-md border border-accent-info/30 bg-accent-info/5 p-2 leading-relaxed space-y-1.5`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,O.jsx)(C,{className:`w-3 h-3 text-accent-info mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:(0,O.jsx)(x,{t,i18nKey:`update.body`,components:{code:(0,O.jsx)(`code`,{className:`bg-muted px-1 rounded`})}})})]}),(0,O.jsxs)(`button`,{type:`button`,disabled:r,onClick:async()=>{i(!0),o(null);try{let t=await fetch(`${n()}/plugins/${e}/update`,{method:`POST`});if(!t.ok)throw Error((await t.json()).error??`HTTP ${t.status}`)}catch(e){o(e.message)}finally{i(!1)}},className:`text-[10px] px-2 py-0.5 rounded border border-accent-info/40 hover:bg-accent-info/10 disabled:opacity-50 flex items-center gap-1`,children:[r&&(0,O.jsx)(l,{className:`w-2.5 h-2.5 animate-spin`}),(0,O.jsx)(x,{t,i18nKey:`update.button`,components:{code:(0,O.jsx)(`code`,{})}})]}),a&&(0,O.jsx)(`div`,{className:`text-destructive text-[10px]`,children:a})]})}function B({pluginName:e,conflicts:t}){let{t:r}=v(`integrations`),[i,a]=(0,D.useState)(null),[s,c]=(0,D.useState)(null),u=async e=>{a(e),c(null);try{let t=await fetch(`${n()}/plugins/_marketplace/disable`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({key:e})});if(!t.ok)throw Error((await t.json()).error??`HTTP ${t.status}`)}catch(e){c(e.message)}finally{a(null)}};return(0,O.jsxs)(`div`,{className:`text-[11px] rounded-md border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 p-2 leading-relaxed space-y-1.5`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,O.jsx)(o,{className:`w-3 h-3 text-yellow-500 aurora-light:text-accent-warning mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:(0,O.jsx)(x,{t:r,i18nKey:`conflict.body`,values:{name:e},components:{strong:(0,O.jsx)(`strong`,{})}})})]}),(0,O.jsx)(`div`,{className:`flex flex-wrap gap-1.5 pt-1`,children:t.map(e=>(0,O.jsxs)(`button`,{type:`button`,disabled:i===e,onClick:()=>u(e),className:`text-[10px] px-2 py-0.5 rounded border border-yellow-500/40 aurora-light:border-accent-warning/40 hover:bg-yellow-500/10 aurora-light:hover:bg-accent-warning/10 disabled:opacity-50 flex items-center gap-1`,children:[i===e&&(0,O.jsx)(l,{className:`w-2.5 h-2.5 animate-spin`}),(0,O.jsx)(x,{t:r,i18nKey:`conflict.disableButton`,values:{key:e},components:{code:(0,O.jsx)(`code`,{})}})]},e))}),s&&(0,O.jsx)(`div`,{className:`text-destructive`,children:s})]})}function V({plugin:e,onRemoved:t}){let{t:r}=v(`integrations`),[i,a]=(0,D.useState)(!1);return(0,O.jsxs)(`div`,{className:`rounded-lg border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 p-4 flex flex-col gap-3`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.name}),(0,O.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-yellow-500/20 aurora-light:bg-accent-warning/15 text-yellow-500 aurora-light:text-accent-warning`,children:r(`orphan.badge`)})]}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description}),(0,O.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,O.jsxs)(`button`,{type:`button`,disabled:i,onClick:async()=>{a(!0);try{await fetch(`${n()}/plugins/${e.name}`,{method:`DELETE`}),t()}finally{a(!1)}},className:`text-xs px-3 py-1.5 rounded-md border border-border hover:bg-destructive/10 hover:text-destructive flex items-center gap-1.5`,children:[(0,O.jsx)(u,{className:`w-3 h-3`}),` `,r(`orphan.removeButton`)]})})]})}function H({pluginName:e,onClose:t}){let{t:r}=v(`integrations`),[i,a]=(0,D.useState)(null),[s,c]=(0,D.useState)(null),[u,f]=(0,D.useState)(!1),[p,m]=(0,D.useState)(null),[h,g]=(0,D.useState)([]),[b,x]=(0,D.useState)(null),[S,w]=(0,D.useState)([]),{registerHandler:T,unregisterHandler:E}=d(),k=(0,D.useCallback)(()=>{a(null),c(null),fetch(`${n()}/plugins/${e}/preview-install`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>a(e)).catch(e=>c(e.message))},[e]);(0,D.useEffect)(()=>{k()},[k]),(0,D.useEffect)(()=>(T(`install-${e}`,t=>{let n=t;if(n.type===`plugin.install_progress`&&n.name===e&&n.line&&g(e=>[...e,n.line]),n.type===`plugin.prereq_install_progress`&&n.line&&w(e=>[...e,n.line]),n.type===`plugin.prereq_installed`){x(null);let e=n.reason;e&&w(t=>[...t,`► ${e}`]),n.ok&&k()}}),()=>E(`install-${e}`)),[e,T,E,k]);let A=async e=>{x(e),w([r(`installDialog.installingPrereq`,{name:e})]);try{await fetch(`${n()}/plugins/_prerequisites/${e}/install`,{method:`POST`})}catch(e){w(t=>[...t,r(`installDialog.prereqStartFailed`,{message:e.message})]),x(null)}},j=(i?.requirements??[]).every(e=>e.installed&&e.executable&&e.meetsMinimum);return(0,O.jsxs)(W,{onClose:t,title:r(`installDialog.title`,{name:e}),children:[s&&(0,O.jsx)(`div`,{className:`text-xs text-destructive`,children:s}),!i&&!s&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(l,{className:`w-3 h-3 animate-spin`}),` `,r(`installDialog.computingChanges`)]}),i&&(0,O.jsxs)(O.Fragment,{children:[i.platformNote&&(0,O.jsxs)(`div`,{className:`flex items-start gap-2 p-2.5 rounded-md border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 text-[11px] leading-relaxed`,children:[(0,O.jsx)(o,{className:`w-3.5 h-3.5 text-yellow-500 aurora-light:text-accent-warning mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:i.platformNote})]}),(0,O.jsxs)(`section`,{children:[(0,O.jsx)(`h4`,{className:`text-xs font-semibold mb-1.5`,children:r(`installDialog.filesHeading`)}),(0,O.jsx)(`ul`,{className:`text-xs space-y-0.5 font-mono`,children:i.files.map((e,t)=>(0,O.jsxs)(`li`,{className:e.op===`create`?`text-accent-success`:`text-accent-info`,children:[e.op===`create`?`+ `:`~ `,e.path,e.summary&&(0,O.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,e.summary]})]},t))})]}),i.requirements.length>0&&(0,O.jsxs)(`section`,{children:[(0,O.jsx)(`h4`,{className:`text-xs font-semibold mb-1.5`,children:r(`installDialog.prerequisites`)}),(0,O.jsx)(`ul`,{className:`text-xs space-y-1`,children:i.requirements.map(e=>{let t=e.installed&&e.executable&&e.meetsMinimum,n=e.name===`uv`;return(0,O.jsxs)(`li`,{className:`flex items-center gap-2`,children:[t?(0,O.jsx)(y,{className:`w-3 h-3 text-accent-success`}):(0,O.jsx)(_,{className:`w-3 h-3 text-accent-warning`}),(0,O.jsxs)(`span`,{children:[e.name,e.minVersion?` ≥ ${e.minVersion}`:``]}),e.version&&(0,O.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.version,`)`]}),!t&&n&&(0,O.jsxs)(`button`,{type:`button`,disabled:b===e.name,onClick:()=>A(e.name),className:`ml-auto text-[10px] px-2 py-0.5 rounded border border-border hover:bg-muted disabled:opacity-50 flex items-center gap-1`,children:[b===e.name&&(0,O.jsx)(l,{className:`w-2.5 h-2.5 animate-spin`}),r(`installDialog.autoInstall`)]})]},e.name)})}),S.length>0&&(0,O.jsx)(`pre`,{className:`mt-2 text-[11px] bg-muted/40 rounded p-2 max-h-24 overflow-auto font-mono`,children:S.join(`
2
- `)})]}),h.length>0&&(0,O.jsxs)(`section`,{children:[(0,O.jsx)(`h4`,{className:`text-xs font-semibold mb-1.5`,children:r(`installDialog.progress`)}),(0,O.jsx)(`pre`,{className:`text-[11px] bg-muted/40 rounded p-2 max-h-32 overflow-auto font-mono`,children:h.join(`
3
- `)})]}),p&&(0,O.jsx)(`div`,{className:`text-xs text-destructive`,children:p})]}),(0,O.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,O.jsx)(`button`,{type:`button`,onClick:t,className:`text-xs px-3 py-1.5 rounded-md border border-border`,children:r(`common:actions.cancel`)}),(0,O.jsxs)(`button`,{type:`button`,disabled:!i||!j||u,onClick:async()=>{f(!0),m(null);try{let r=await fetch(`${n()}/plugins/${e}/install`,{method:`POST`});if(!r.ok)throw Error((await r.json()).error??`HTTP ${r.status}`);setTimeout(t,1500)}catch(e){m(e.message)}finally{f(!1)}},className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white disabled:opacity-50 flex items-center gap-1.5`,children:[u?(0,O.jsx)(l,{className:`w-3 h-3 animate-spin`}):(0,O.jsx)(C,{className:`w-3 h-3`}),r(`card.install`)]})]})]})}function U({pluginName:e,onClose:t,onUninstalled:r}){let{t:i}=v(`integrations`),[a,o]=(0,D.useState)(!1),[s,c]=(0,D.useState)(null);return(0,O.jsxs)(W,{onClose:t,title:i(`uninstallDialog.title`,{name:e}),children:[(0,O.jsx)(`p`,{className:`text-xs`,children:(0,O.jsx)(x,{t:i,i18nKey:`uninstallDialog.body`,components:{code:(0,O.jsx)(`code`,{})}})}),s&&(0,O.jsx)(`div`,{className:`text-xs text-destructive`,children:s}),(0,O.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,O.jsx)(`button`,{type:`button`,onClick:t,className:`text-xs px-3 py-1.5 rounded-md border border-border`,children:i(`common:actions.cancel`)}),(0,O.jsxs)(`button`,{type:`button`,disabled:a,onClick:async()=>{o(!0);try{let t=await fetch(`${n()}/plugins/${e}`,{method:`DELETE`});if(!t.ok)throw Error((await t.json()).error??`HTTP ${t.status}`);r()}catch(e){c(e.message)}finally{o(!1)}},className:`text-xs px-3 py-1.5 rounded-md bg-destructive text-white disabled:opacity-50 flex items-center gap-1.5`,children:[a&&(0,O.jsx)(l,{className:`w-3 h-3 animate-spin`}),i(`card.uninstall`)]})]})]})}function W({title:e,onClose:t,children:n}){return(0,O.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40`,role:`dialog`,tabIndex:-1,onClick:t,children:(0,O.jsxs)(`div`,{className:`bg-card border border-border rounded-lg shadow-xl w-full max-w-md p-5 flex flex-col gap-3`,onClick:e=>e.stopPropagation(),children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold`,children:e}),n]})})}function G(){return(0,O.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:Array.from({length:3},(e,t)=>(0,O.jsx)(`div`,{className:`rounded-lg border border-border bg-card p-4 h-40 animate-pulse`},t))})}function K({onRetry:e}){let{t}=v(`integrations`);return(0,O.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 gap-3 text-sm text-muted-foreground`,children:[(0,O.jsx)(o,{className:`w-5 h-5 text-destructive`}),(0,O.jsx)(`p`,{children:t(`page.loadError`)}),(0,O.jsx)(`button`,{type:`button`,onClick:e,className:`text-xs px-3 py-1.5 rounded-md border border-border`,children:t(`common:actions.retry`)})]})}function q(){let{t:e}=v(`integrations`);return(0,O.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 gap-2 text-sm text-muted-foreground`,children:[(0,O.jsx)(S,{className:`w-6 h-6`}),(0,O.jsx)(`p`,{children:e(`page.empty`)})]})}export{F as default};
@@ -1,16 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{$t as t,Bt as n,Et as r,G as i,H as a,M as o,N as s,Ot as ee,P as c,Q as l,Rt as u,V as d,an as f,b as p,cn as m,ct as h,dt as g,en as _,ft as v,gt as y,ht as b,in as x,kt as S,l as C,m as w,mt as T,o as E,p as D,rn as O,st as te,u as ne,ut as k,wt as A,x as j,y as M,zt as N}from"./index-BEGU2TCx.js";import{t as P}from"./lib-BBoUS-5a.js";import{t as re}from"./format-command-CZsy-vHq.js";var F=A(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),ie=A(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),I=e(m(),1),L=N();function ae({phases:e,phaseDefinitions:t}){return t.length===0?null:(0,L.jsx)(`div`,{className:`flex items-center`,children:t.map((n,r)=>{let i=e[n.key]??`idle`,a=r<t.length-1?e[t[r+1].key]??`idle`:null;return(0,L.jsxs)(`div`,{className:`flex items-center`,children:[(0,L.jsxs)(M,{children:[(0,L.jsx)(j,{asChild:!0,children:(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5 cursor-default px-4`,children:[(0,L.jsx)(R,{state:i}),(0,L.jsx)(`span`,{className:c(`text-xs font-medium transition-colors`,i===`running`?`text-blue-400 aurora-light:text-accent-info`:i===`done`?`text-emerald-400 aurora-light:text-accent-success`:i===`error`?`text-red-400 aurora-light:text-destructive`:`text-muted-foreground/40`),children:n.label})]})}),(0,L.jsxs)(p,{side:`bottom`,className:`max-w-[200px]`,children:[(0,L.jsx)(`p`,{className:`font-medium`,children:n.label}),(0,L.jsx)(`p`,{className:`text-muted-foreground mt-0.5`,children:n.description})]})]}),a!==null&&(0,L.jsx)(`div`,{className:c(`h-px w-12 -mt-5 shrink-0 transition-all duration-300`,a===`done`||i===`done`?`bg-emerald-500/30 aurora-light:bg-accent-success/40`:a===`running`?`bg-blue-400/40 aurora-light:bg-accent-info/40`:`bg-border/30`)})]},n.key)})})}function R({state:e}){return(0,L.jsxs)(`div`,{className:c(`flex items-center justify-center w-10 h-10 rounded-full transition-all duration-300`,e===`running`?`bg-blue-500/10 aurora-light:bg-accent-info/10 ring-1 ring-blue-400/30 aurora-light:ring-accent-info/30 animate-pulse`:e===`done`?`bg-emerald-500/10 aurora-light:bg-accent-success/10`:e===`error`?`bg-red-500/10 aurora-light:bg-destructive/10`:`bg-muted/20`),children:[e===`running`&&(0,L.jsx)(l,{className:`w-6 h-6 text-blue-400 aurora-light:text-accent-info animate-spin`}),e===`done`&&(0,L.jsx)(v,{className:`w-6 h-6 text-emerald-400 aurora-light:text-accent-success`}),e===`error`&&(0,L.jsx)(g,{className:`w-6 h-6 text-red-400 aurora-light:text-destructive`}),e===`idle`&&(0,L.jsx)(k,{className:`w-6 h-6 text-muted-foreground/20`})]})}function z(e,t){let n=(typeof t==`number`?t:new Date(t).getTime())-new Date(e).getTime();if(!Number.isFinite(n)||n<0)return`—`;let r=Math.round(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60),a=r%60;return i<60?`${i}m ${a}s`:`${Math.floor(i/60)}h ${i%60}m`}function oe(e){let t=new Set;for(let n of e)if(n.event_type===`log`)try{let e=(JSON.parse(n.payload).line??``).match(/(?:Writing|Editing|Created?|Updated?)\s+(?:file:\s*)?([\w./\-]+\.\w+)/i);e&&t.add(e[1])}catch{}return Array.from(t).slice(0,20)}var se=new Set([`editing`,`writing`,`reading`,`searching`,`running`]);function B(e){return e.length>40?`${e.slice(0,39)}…`:e}function V(e){return typeof e!=`string`||e.length===0?``:B(e.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??``)}function H(e){return typeof e!=`string`||e.length===0?``:B(e.trim().split(/\s+/)[0]??``)}function ce(e){if(typeof e!=`string`)return``;try{let t=JSON.parse(e)?.command;if(Array.isArray(t))return H(t.filter(e=>typeof e==`string`).join(` `));if(typeof t==`string`)return H(t)}catch{}return``}function U(e,t){let n=t??{},r=V(n.file_path??n.path);switch(e){case`Edit`:case`MultiEdit`:case`NotebookEdit`:case`Update`:return{step:!0,actionKey:`editing`,actionArg:r};case`Write`:case`create`:return{step:!0,actionKey:`writing`,actionArg:r};case`Read`:return{step:!0,actionKey:`reading`,actionArg:r};case`Grep`:case`Glob`:case`search`:return{step:!0,actionKey:`searching`,actionArg:B(String(n.pattern??n.query??``))};case`Bash`:case`shell`:return{step:!0,actionKey:`running`,actionArg:H(n.command)};default:return{step:!0,actionKey:`working`}}}function W(e){let t=e.event_type,n={};try{let t=JSON.parse(e.payload);t&&typeof t==`object`&&!Array.isArray(t)&&(n=t)}catch{}if(t===`assistant`){let e=n.message?.content;if(Array.isArray(e)){let t=e.filter(e=>e?.type===`tool_use`);if(t.length>0){let e=t[t.length-1];return{...U(e.name,e.input),stepCount:t.length}}if(e.some(e=>e?.type===`text`))return{step:!0,actionKey:`thinking`}}return{step:!0}}if(t===`tool_use`)return U(n.name,n.input);if(t===`item.completed`){let e=n.item,t=e?.type;return t===`agent_message`?{step:!0,actionKey:`thinking`}:t===`agent_reasoning`?{step:!0,actionKey:`reasoning`}:t===`function_call`||t===`local_shell_call`||t===`command_execution`?{step:!0,actionKey:`running`,actionArg:H(e?.command)||ce(e?.arguments)||(typeof e?.name==`string`?B(e.name):``)||(t===`local_shell_call`?`shell`:``)}:{step:!0}}return{step:!1}}var G={steps:0,actionKey:``,actionArg:``,lastSeenIdx:0};function K(e,t){if(t.type===`reset`)return G;if(t.type===`consume`){let{events:n}=t,r=e.lastSeenIdx>n.length?n.length:e.lastSeenIdx;if(n.length<=r)return r===e.lastSeenIdx?e:{...e,lastSeenIdx:r};let{steps:i,actionKey:a,actionArg:o}=e;for(let e=r;e<n.length;e++){let t=W(n[e]);t.step&&(i+=t.stepCount??1),t.actionKey&&(a=t.actionKey,o=t.actionArg??``)}return{steps:i,actionKey:a,actionArg:o,lastSeenIdx:n.length}}return e}function le({job:e,events:t,defaultOpen:n=!0,pipelineTotals:r,phases:i,phaseDefinitions:a}){let{t:o}=_(`jobs`),[s,ee]=(0,I.useState)(n),u=(0,I.useMemo)(()=>oe(t),[t]),d=e.status===`running`,f=e.status===`completed`,[p,m]=(0,I.useState)(()=>Date.now());(0,I.useEffect)(()=>{if(!d)return;let e=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(e)},[d]);let[h,b]=(0,I.useReducer)(K,G),x=(0,I.useRef)(e.id);(0,I.useEffect)(()=>{x.current!==e.id&&(x.current=e.id,b({type:`reset`})),b({type:`consume`,events:t})},[e.id,t]);let[S,C]=(0,I.useState)(!0);(0,I.useEffect)(()=>{if(!d)return;C(!0);let e=window.setTimeout(()=>C(!1),8e3);return()=>window.clearTimeout(e)},[d,e.id]);let w=e.finished_at?z(e.started_at,e.finished_at):d?z(e.started_at,p):`—`,T=!!e.total_cost_usd_estimated,E=e.total_cost_usd==null?null:`${T?`~`:``}$${e.total_cost_usd.toFixed(4)}`,D=e.num_turns==null?null:String(e.num_turns),O=e.tokens_in==null?null:(e.tokens_in??0)+(e.tokens_out??0)+(e.tokens_cache_read??0)+(e.tokens_cache_create??0),te=O==null?null:`${(O/1e3).toFixed(1)}k`,ne=(0,I.useMemo)(()=>!i||!a?null:a.find(e=>i[e.key]===`running`)?.label??null,[i,a]),k=d&&h.steps===0?`connecting`:h.actionKey||`thinking`,A=se.has(k)&&h.actionArg!==``,j=se.has(k)&&!A?`working`:k,M=A?o(`statusPanel.activity.${j}`,{arg:h.actionArg}):o(`statusPanel.activity.${j}`),N=ne??(d&&h.steps===0?o(`statusPanel.activity.starting`):null),P=h.steps>0?o(`statusPanel.steps`,{count:h.steps}):null,re=o(d?`statusPanel.inProgress`:f?`statusPanel.completed`:`statusPanel.failed`),F=d?`border-accent-info/20 bg-accent-info/5`:f?`border-emerald-500/20 aurora-light:border-accent-success/30 bg-emerald-500/5 aurora-light:bg-accent-success/5`:`border-red-500/20 aurora-light:border-destructive/30 bg-red-500/5 aurora-light:bg-destructive/5`,ie=d?l:f?v:g,ae=d?`w-4 h-4 text-accent-info shrink-0 animate-spin`:f?`w-4 h-4 text-emerald-400 aurora-light:text-accent-success shrink-0`:`w-4 h-4 text-red-400 aurora-light:text-destructive shrink-0`;return(0,L.jsxs)(`div`,{className:c(`mx-4 my-2 rounded-xl border transition-colors duration-500`,F),children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>ee(!s),className:`w-full flex items-center gap-3 px-4 py-3`,children:[(0,L.jsx)(ie,{className:ae,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`text-sm font-semibold flex-1 text-left`,children:re}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 text-[11px] text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`tabular-nums`,children:w}),d?P&&(0,L.jsx)(`span`,{className:`tabular-nums`,children:P}):(0,L.jsxs)(L.Fragment,{children:[E&&(0,L.jsx)(`span`,{className:`tabular-nums text-yellow-400 aurora-light:text-accent-warning`,children:E}),u.length>0&&(0,L.jsx)(`span`,{children:o(`statusPanel.filesCount`,{count:u.length})})]})]}),(0,L.jsx)(y,{className:c(`w-4 h-4 text-muted-foreground/40 transition-transform duration-150 shrink-0`,s&&`rotate-180`)})]}),s&&(0,L.jsx)(`div`,{className:`px-4 pb-4 space-y-3 border-t border-border/20`,children:d?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`pt-3 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:o(`statusPanel.zoneInProgress`)}),(0,L.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-3 sm:items-stretch`,children:[(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2 sm:w-44 shrink-0`,children:[(0,L.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:[o(`statusPanel.duration`),(0,L.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-accent-info animate-pulse`,title:o(`statusPanel.liveTooltip`),"aria-label":o(`statusPanel.liveTooltip`)})]}),(0,L.jsx)(`p`,{className:`text-sm font-semibold tabular-nums mt-0.5 text-accent-info`,children:w})]}),(0,L.jsxs)(`div`,{className:`flex-1 flex items-center gap-2 bg-muted/10 rounded-lg px-3 py-2 min-w-0`,children:[(0,L.jsx)(l,{className:`w-3.5 h-3.5 text-accent-info shrink-0 animate-spin`,"aria-hidden":`true`}),N&&(0,L.jsx)(`span`,{className:`text-[11px] font-medium px-1.5 py-0.5 rounded bg-accent-info/15 text-accent-info shrink-0`,children:N}),(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground truncate flex-1 min-w-0`,children:M}),P&&(0,L.jsxs)(`span`,{className:`text-[11px] text-muted-foreground/60 tabular-nums shrink-0`,children:[`· `,P]})]})]}),S&&(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground/40 leading-snug`,children:o(`statusPanel.explainer`)}),(0,L.jsx)(`p`,{className:`pt-1 text-[10px] text-muted-foreground/50 uppercase tracking-wider border-t border-accent-info/10 mt-1`,children:o(`statusPanel.zoneFinalPending`)}),(0,L.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,L.jsx)(Y,{label:o(`statusPanel.cost`),caption:o(`statusPanel.pendingCaption`),tooltip:o(`statusPanel.costTooltip`)}),(0,L.jsx)(Y,{label:o(`statusPanel.turns`),caption:o(`statusPanel.pendingCaption`),tooltip:o(`statusPanel.pendingTooltip`)}),(0,L.jsx)(Y,{label:o(`statusPanel.tokens`),caption:o(`statusPanel.pendingCaption`),tooltip:o(`statusPanel.pendingTooltip`)})]})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`pt-3 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:o(`statusPanel.zoneFinal`)}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-2`,children:[(0,L.jsx)(q,{label:o(`statusPanel.duration`),value:w}),(0,L.jsx)(J,{label:o(`statusPanel.cost`),value:E,valueClass:`text-yellow-400 aurora-light:text-accent-warning`,naCaption:o(`statusPanel.notAvailable`)}),(0,L.jsx)(J,{label:o(`statusPanel.turns`),value:D,naCaption:o(`statusPanel.notAvailable`)}),(0,L.jsx)(J,{label:o(`statusPanel.tokens`),value:te,naCaption:o(`statusPanel.notAvailable`)})]}),r&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider mb-1.5`,children:o(`statusPanel.pipelineTotal`,{count:r.jobCount})}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,L.jsx)(q,{label:o(`statusPanel.totalCost`),value:`$${r.totalCostUsd.toFixed(4)}`,valueClass:`text-yellow-400 aurora-light:text-accent-warning`}),(0,L.jsx)(q,{label:o(`statusPanel.totalTokens`),value:`${((r.totalTokensIn+r.totalTokensOut+r.totalTokensCacheRead+r.totalTokensCacheCreate)/1e3).toFixed(1)}k`})]})]}),u.length>0&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider mb-1.5`,children:o(`statusPanel.filesModified`)}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:u.map(e=>(0,L.jsx)(`code`,{className:`text-[10px] font-mono bg-muted/30 px-2 py-0.5 rounded text-cyan-400/80 aurora-light:text-accent-info`,children:e},e))})]})]})})]})}function q({label:e,value:t,valueClass:n}){return(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2`,children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:e}),(0,L.jsx)(`p`,{className:c(`text-sm font-semibold tabular-nums mt-0.5`,n),children:t})]})}function J({label:e,value:t,valueClass:n,naCaption:r}){return(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2`,children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:e}),(0,L.jsx)(`p`,{className:c(`text-sm font-semibold tabular-nums mt-0.5`,t==null?`text-muted-foreground`:n),children:t??`—`}),t==null&&(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/30 mt-0.5`,children:r})]})}function Y({label:e,caption:t,tooltip:n}){return(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2 ring-1 ring-accent-info/10`,title:n,children:[(0,L.jsxs)(`p`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:[e,(0,L.jsx)(F,{className:`w-2.5 h-2.5 text-muted-foreground/30`,"aria-hidden":`true`})]}),(0,L.jsx)(`p`,{className:`text-sm font-semibold tabular-nums mt-0.5 text-muted-foreground/40`,children:`—`}),(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/30 mt-0.5`,children:t})]})}var X=4;function ue({tickets:e,onTicketClick:t}){let{t:n}=_(`jobs`),[r,i]=(0,I.useState)(!1);if(e.length===0)return null;let a=e.length>=X&&!r?e.slice(0,1):e,o=e.length-a.length;return(0,L.jsxs)(`div`,{className:`rounded-xl border border-border/40 bg-card/40 px-4 py-3 space-y-1.5`,children:[a.map(e=>(0,L.jsx)(Z,{ticket:e,onClick:()=>t(e.id)},e.id)),o>0&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[n(`ticketHeader.showMore`,{count:o}),(0,L.jsx)(y,{className:`w-3 h-3`})]}),r&&e.length>=X&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(!1),className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[n(`ticketHeader.showLess`),(0,L.jsx)(T,{className:`w-3 h-3`})]})]})}function Z({ticket:e,onClick:t}){let{t:n}=_(`jobs`),r=e.title==null,i=`inline-flex items-center px-1.5 py-0.5 rounded-md text-[11px] font-mono tabular-nums shrink-0`;return r?(0,L.jsx)(`div`,{className:`flex items-center gap-2 min-w-0`,children:(0,L.jsx)(`span`,{className:c(i,`text-muted-foreground bg-muted/20 select-none`),title:n(`ticketHeader.deletedTooltip`),children:n(`ticketHeader.deletedTicket`,{id:e.id})})}):(0,L.jsxs)(`button`,{type:`button`,onClick:t,className:`flex items-center gap-2 min-w-0 w-full text-left group`,title:e.title??void 0,children:[(0,L.jsxs)(`span`,{className:c(i,`text-accent-primary bg-accent-primary/10 group-hover:bg-accent-primary/20 transition-colors`),children:[`#`,e.id]}),(0,L.jsx)(`span`,{className:`text-lg font-semibold text-foreground truncate group-hover:text-accent-primary transition-colors`,children:e.title})]})}function Q(e){let t=e.trimStart();return!!(/^#{1,6}\s/.test(t)||/^[-*+]\s/.test(t)||/^\d+\.\s/.test(t)||/^\|.+\|/.test(t)||t.startsWith("```")||t.startsWith(`> `)||/\*\*[^*]+\*\*/.test(e)||/`[^`]+`/.test(e)||/\[.+\]\(.+\)/.test(e)||/^(-{3,}|_{3,}|\*{3,})$/.test(t)||/^- \[[ x]\]\s/.test(t))}function de(e,t){let n=`${e.id??t}`,r=e.timestamp;if(e.event_type===`log`)try{let t=JSON.parse(e.payload).line??``;return t.trim()?t.startsWith(`▸`)||t.match(/^(architect|developer|reviewer|ship|analyst)\s*:/i)?{id:n,content:t,type:`phase`,timestamp:r}:e.source===`stderr`?{id:n,content:t,type:`stderr`,timestamp:r}:Q(t)?{id:n,content:t,type:`assistant`,timestamp:r}:{id:n,content:t,type:`plain`,timestamp:r}:null}catch{return null}if(e.event_type!==`log`&&e.event_type!==`result`)return null;if(e.event_type===`result`)try{let t=JSON.parse(e.payload),i=[];return t.duration_ms&&i.push(`${(t.duration_ms/1e3).toFixed(1)}s`),t.total_cost_usd&&i.push(`$${t.total_cost_usd.toFixed(4)}`),t.num_turns&&i.push(S.t(`jobs:logViewer.turns`,{count:t.num_turns})),{id:n,content:`▸ ${S.t(`jobs:logViewer.completed`)}${i.length?` — ${i.join(` · `)}`:``}`,type:`result`,timestamp:r}}catch{return null}return null}function $(e){let t=`none`,n=[];for(let r of e){let e=r.type;if(e!==`plain`&&e!==`log`){t=`none`,n.push(r);continue}let i=r.content;i.startsWith(`--- `)?(t=`saw_minus`,n.push({...r,type:`diff-meta`})):t===`saw_minus`&&i.startsWith(`+++ `)?(t=`active`,n.push({...r,type:`diff-meta`})):t===`active`&&i.startsWith(`@@ `)?n.push({...r,type:`diff-hunk`}):t===`active`&&i.startsWith(`+`)&&!i.startsWith(`+++`)?n.push({...r,type:`diff-add`}):t===`active`&&i.startsWith(`-`)&&!i.startsWith(`---`)?n.push({...r,type:`diff-remove`}):(t===`active`&&(i.startsWith(` `)||i===``)||(t=`none`),n.push(r))}return n}function fe(e){let t=[{key:`__preamble__`,header:null,lines:[]}];for(let n of e)n.type===`phase`?t.push({key:n.id,header:n,lines:[]}):t[t.length-1].lines.push(n);return t.filter(e=>e.header!==null||e.lines.length>0)}function pe({events:e,isLoading:n}){let{t:r,i18n:i}=_(`jobs`),[o,ee]=(0,I.useState)(``),[c,l]=(0,I.useState)(!0),[u,d]=(0,I.useState)(new Set),f=(0,I.useRef)(null),p=(0,I.useRef)(null),{processedLines:m,groups:g,totalLines:v}=(0,I.useMemo)(()=>{let t=e.map((e,t)=>de(e,t)).filter(e=>e!==null),n=[];for(let e of t){let t=n.length>0?n[n.length-1]:null;e.type===`assistant`&&t?.type===`assistant`?t.content+=`
2
- `+e.content:n.push({...e})}let r=$(n);return{processedLines:r,groups:fe(r),totalLines:r.length}},[e,i.language]),b=(0,I.useMemo)(()=>{if(!o)return v;let e=o.toLowerCase();return m.filter(t=>t.content.toLowerCase().includes(e)).length},[o,m,v]),x=(0,I.useCallback)(()=>{let e=p.current;e&&(e.scrollTop=e.scrollHeight)},[]);(0,I.useEffect)(()=>{c&&x()},[e.length,c,x]);function S(){let e=p.current;e&&l(e.scrollHeight-e.scrollTop-e.clientHeight<50)}function C(e){d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return n?(0,L.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`logViewer.loading`)})}):v===0?(0,L.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`logViewer.empty`)})}):(0,L.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,L.jsxs)(`div`,{className:`px-4 py-2 border-b border-border flex items-center gap-2`,children:[(0,L.jsxs)(`div`,{className:`relative flex-1 max-w-xs`,children:[(0,L.jsx)(a,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground`}),(0,L.jsx)(E,{placeholder:r(`logViewer.filterPlaceholder`),value:o,onChange:e=>ee(e.target.value),className:`pl-7 h-7`})]}),(0,L.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground/50 hover:text-foreground`,onClick:()=>{let e=m.map(e=>e.content).join(`
3
- `);navigator.clipboard.writeText(e).then(()=>{t.success(r(`logViewer.copySuccess`))}).catch(()=>{t.error(r(`logViewer.copyFailed`))})},children:(0,L.jsx)(h,{className:`w-3.5 h-3.5`})}),(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:r(`logViewer.lineCount`,{filtered:b,total:v})})]}),(0,L.jsxs)(`div`,{ref:p,className:`flex-1 overflow-y-auto p-2 text-xs relative`,onScroll:S,children:[g.map(e=>(0,L.jsx)(me,{group:e,filter:o,collapsed:u.has(e.key),onToggle:()=>C(e.key)},e.key)),(0,L.jsx)(`div`,{ref:f})]}),!c&&(0,L.jsxs)(s,{size:`sm`,variant:`secondary`,onClick:()=>{l(!0),x()},className:`absolute bottom-16 right-6 h-7 gap-1 shadow-lg`,children:[(0,L.jsx)(y,{className:`w-3 h-3`}),r(`logViewer.jumpToBottom`)]})]})}var me=(0,I.memo)(function({group:e,filter:t,collapsed:n,onToggle:r}){let{t:i}=_(`jobs`),a=t?e.lines.filter(e=>e.content.toLowerCase().includes(t.toLowerCase())):e.lines;if(e.header===null)return a.length===0?null:(0,L.jsx)(`div`,{children:a.map((e,t)=>(0,L.jsx)(ge,{line:e,even:t%2==0},e.id))});let o=e.header.content;return(0,L.jsxs)(`div`,{className:`mt-3 rounded-md overflow-hidden border border-border/20`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:r,className:c(`flex items-center gap-2 w-full text-left px-3 py-2`,`bg-primary/5 border-b border-primary/20`,`hover:bg-primary/10 transition-colors duration-150 cursor-pointer`),children:[(0,L.jsx)(b,{className:c(`w-3 h-3 text-primary/60 shrink-0 transition-transform duration-150`,!n&&`rotate-90`)}),(0,L.jsx)(`span`,{className:`flex-1 text-[12px] font-semibold text-foreground leading-none`,children:o}),e.header.timestamp&&(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 font-mono tabular-nums shrink-0`,children:new Date(e.header.timestamp).toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}),(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 shrink-0`,children:i(`logViewer.phaseLines`,{count:e.lines.length})})]}),!n&&(0,L.jsx)(`div`,{className:`bg-muted/5`,children:a.length===0?(0,L.jsx)(`p`,{className:`px-4 py-2 text-[10px] text-muted-foreground/40 italic`,children:i(t?`logViewer.noMatchingLines`:`logViewer.noOutput`)}):a.map((e,t)=>(0,L.jsx)(ge,{line:e,even:t%2==0},e.id))})]})}),he=[P],ge=(0,I.memo)(function({line:e,even:t}){let n=e.type===`assistant`,r=e.type===`diff-add`,i=e.type===`diff-remove`,a=e.type===`diff-meta`,o=e.type===`diff-hunk`;return(0,L.jsxs)(`div`,{className:c(`flex items-start gap-2 group px-2 py-0.5 rounded-sm`,!(r||i||a||o)&&(t?`bg-muted/20`:`bg-transparent`),e.type===`result`&&`bg-emerald-500/5 aurora-light:bg-accent-success/10 border-l-2 border-emerald-500/40 aurora-light:border-accent-success/40 mt-2 py-2`,r&&`bg-emerald-500/8 aurora-light:bg-accent-success/10 border-l-2 border-emerald-500/50 aurora-light:border-accent-success/50`,i&&`bg-red-500/8 aurora-light:bg-destructive/10 border-l-2 border-red-500/50 aurora-light:border-destructive/50`,a&&`bg-accent-primary/5 border-l-2 border-accent-primary/30`,o&&`bg-accent-info/5 border-l-2 border-accent-info/30`),children:[e.timestamp&&(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 shrink-0 mt-0.5 w-[52px] font-mono tabular-nums`,children:new Date(e.timestamp).toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}),n?(0,L.jsx)(`div`,{className:`flex-1 min-w-0 prose prose-invert prose-xs max-w-none
4
- prose-p:my-1 prose-p:leading-relaxed
5
- prose-headings:mt-2 prose-headings:mb-1 prose-headings:text-sm prose-headings:font-semibold
6
- prose-ul:my-1 prose-ol:my-1 prose-li:my-0
7
- prose-code:text-cyan-300 prose-code:text-[11px] prose-code:bg-muted/40 prose-code:px-1 prose-code:py-0.5 prose-code:rounded
8
- prose-pre:my-1 prose-pre:bg-muted/30 prose-pre:rounded-md prose-pre:p-2 prose-pre:text-[11px]
9
- prose-strong:text-foreground prose-em:text-foreground/70
10
- prose-a:text-blue-400 prose-a:no-underline hover:prose-a:underline
11
- prose-table:my-2 prose-table:text-[11px]
12
- prose-thead:border-border prose-thead:bg-muted/30
13
- prose-th:px-3 prose-th:py-1.5 prose-th:text-left prose-th:font-semibold prose-th:text-foreground/90
14
- prose-td:px-3 prose-td:py-1.5 prose-td:border-border
15
- prose-tr:border-border
16
- text-foreground/80`,children:(0,L.jsx)(w,{remarkPlugins:[D],rehypePlugins:he,children:e.content})}):(0,L.jsx)(`span`,{className:c(`flex-1 break-all leading-relaxed whitespace-pre-wrap font-mono`,e.type===`tool-use`&&`text-cyan-400/80 aurora-light:text-accent-info text-[11px]`,e.type===`stderr`&&`text-orange-400 aurora-light:text-accent-warning`,e.type===`result`&&`text-emerald-400 aurora-light:text-accent-success font-medium`,e.type===`log`&&`text-foreground/60`,e.type===`plain`&&`text-foreground/70`,e.type===`tool-result`&&`text-muted-foreground/50`,r&&`text-emerald-400 aurora-light:text-accent-success`,i&&`text-red-400 aurora-light:text-destructive`,a&&`text-accent-primary/80`,o&&`text-accent-info/80`),children:e.content})]})}),_e={running:{variant:`running`,labelKey:`statusLabel.running`,tooltipKey:`statusTooltip.running`},completed:{variant:`success`,labelKey:`statusLabel.completed`,tooltipKey:`statusTooltip.completed`},failed:{variant:`failed`,labelKey:`statusLabel.failed`,tooltipKey:`statusTooltip.failed`},canceled:{variant:`canceled`,labelKey:`statusLabel.canceled`,tooltipKey:`statusTooltip.canceled`},queued:{variant:`queued`,labelKey:`statusLabel.queued`,tooltipKey:`statusTooltip.queued`}};function ve(){let{t:e}=_(`jobs`),{id:a}=f(),{activeProjectId:m,projects:h}=r(),g=h.find(e=>e.id===m)?.provider,y=x(),{openTicketDetail:S}=C(),[w,T]=(0,I.useState)(null),[E,D]=(0,I.useState)([]),[k,A]=(0,I.useState)([]),[N,P]=(0,I.useState)({}),[F,R]=(0,I.useState)([]),[z,oe]=(0,I.useState)(!0),[se,B]=(0,I.useState)(!1),[V,H]=(0,I.useState)(null),[ce,U]=(0,I.useState)(!1),[W,G]=(0,I.useState)(``),[K,q]=(0,I.useState)(!1),[J,Y]=(0,I.useState)(!1);(0,I.useEffect)(()=>{if(!a)return;let e=new AbortController;T(null),D([]),A([]),P({}),oe(!0),B(!1);async function t(){try{let t=await fetch(`${n()}/jobs/${a}`,{signal:e.signal});if(t.status===404){B(!0);return}if(!t.ok)throw Error(`Failed to fetch job`);let r=await t.json();T(r.job),D(r.events)}catch(e){if(e.name===`AbortError`)return;B(!0)}finally{e.signal.aborted||oe(!1)}}return t(),()=>e.abort()},[a,m]),(0,I.useEffect)(()=>{if(!w?.pipeline_id){R([]);return}let e=w.pipeline_id;fetch(`${n()}/pipelines/${e}`).then(e=>e.ok?e.json():null).then(e=>{e?.jobs&&R(e.jobs)}).catch(()=>{})},[w?.pipeline_id,w?.status]);let X=(0,I.useRef)(m);X.current=m;let Z=(0,I.useRef)([]),Q=(0,I.useRef)(null),de=(0,I.useCallback)(()=>{Q.current=null;let e=Z.current;e.length!==0&&(Z.current=[],D(t=>{let n=[...t,...e];return n.length>1e4?n.slice(n.length-8e3):n}))},[]),$=(0,I.useCallback)(e=>{let t=Z.current;t.push(e),t.length>1e4&&(Z.current=t.slice(-8e3)),Q.current||=requestAnimationFrame(de)},[de]);(0,I.useEffect)(()=>()=>{Q.current&&cancelAnimationFrame(Q.current)},[]);let fe=(0,I.useCallback)(e=>{let t=e;if(!(X.current&&t.projectId&&t.projectId!==X.current)){if(t.type===`init`){let e=t.phaseDefinitions??[];A(e);let n={};for(let r of e)n[r.key]=t.phases?.[r.key]??`idle`;P(n)}else if(t.type===`event`&&t.jobId===a)$({id:Date.now(),job_id:a??``,seq:t.seq??0,event_type:t.event_type,source:t.source,payload:t.payload,timestamp:t.timestamp});else if(t.type===`log`&&t.processId===a)$({id:Date.now(),job_id:a??``,seq:0,event_type:`log`,source:t.source,payload:JSON.stringify({line:t.line}),timestamp:t.timestamp});else if(t.type===`job.turn_user`&&t.jobId===a)U(!0);else if(t.type===`job.turn_done`&&t.jobId===a)H(t.totals),U(!1);else if(t.type===`job.finalized`&&t.jobId===a){U(!1),q(!1);let e=t.totals;e&&H(e),fetch(`${n()}/jobs/${a}`).then(e=>e.json()).then(e=>T(e.job)).catch(()=>{})}else if(t.type===`phase`){let e=t.phase,n=t.state;P(t=>({...t,[e]:n}))}else if(t.type===`queue`){let e=t.jobs?.find(e=>e.id===a);if(e){let t=e.status;T(e=>e&&{...e,status:t}),(t===`completed`||t===`failed`||t===`canceled`)&&fetch(`${n()}/jobs/${a}`).then(e=>e.json()).then(e=>T(e.job)).catch(()=>{})}}}},[a,$]),{registerHandler:me,unregisterHandler:he}=u();(0,I.useEffect)(()=>(me(`job-detail-${a}`,fe),()=>he(`job-detail-${a}`)),[a,fe,me,he]),(0,I.useEffect)(()=>{if(!a||!w||w.status!==`running`||w.hasTelemetry)return;let e=setInterval(()=>{fetch(`${n()}/jobs/${a}`).then(e=>e.ok?e.json():null).then(e=>{e?.job?.hasTelemetry&&T(e=>e&&{...e,hasTelemetry:!0})}).catch(()=>{})},8e3);return()=>clearInterval(e)},[a,w?.status,w?.hasTelemetry]);async function ge(){if(a)try{let r=await fetch(`${n()}/jobs/${a}`,{method:`DELETE`});if(r.ok)(await r.json()).status===`deleted`?(t.success(e(`detail.toast.jobDeleted`)),y(`/jobs`)):t.success(e(`detail.toast.cancelSignalSent`),{description:e(`detail.toast.cancelSignalSentDescription`)});else{let n=await r.json();t.error(e(`detail.toast.failed`),{description:n.error})}}catch{t.error(e(`detail.toast.networkError`))}}async function ve(){if(!(!a||K)){q(!0);try{let r=await fetch(`${n()}/jobs/${a}/finalize`,{method:`POST`});if(r.ok)t.success(e(`detail.toast.finalizeScheduled`));else{let n=await r.json().catch(()=>({}));t.error(e(`detail.toast.finalizeFailed`),{description:n.error}),q(!1)}}catch{t.error(e(`detail.toast.networkError`)),q(!1)}}}async function ye(){let r=W.trim();if(!(!a||!r||J)){Y(!0);try{let i=await fetch(`${n()}/jobs/${a}/messages`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:r})});if(i.ok)G(``);else{let n=await i.json().catch(()=>({}));t.error(e(`detail.toast.sendFailed`),{description:n.error})}}catch{t.error(e(`detail.toast.networkError`))}finally{Y(!1)}}}async function be(){if(w)try{let t=await fetch(`${n()}/jobs/${w.id}/diagnostic`);if(!t.ok){let n=await t.json().catch(()=>({}));throw Error(n.error??e(`detail.toast.exportFailedHttp`,{status:t.status}))}let r=await t.blob(),i=URL.createObjectURL(r),a=new Date().toISOString().slice(0,10),o=document.createElement(`a`);o.href=i,o.download=`specrails-diagnostic-${w.id}-${a}.zip`,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(i)}catch(n){t.error(e(`detail.toast.exportFailed`),{description:n.message})}}async function xe(){if(w)try{let r=await fetch(`${n()}/spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({command:w.command})}),i=await r.json();if(!r.ok)throw Error(i.error??e(`detail.toast.spawnFailed`));t.success(e(`detail.toast.jobRequeued`)),y(`/jobs/${i.jobId}`)}catch(e){t.error(e.message)}}if(z)return(0,L.jsx)(`div`,{className:`max-w-5xl mx-auto px-4 py-6`,children:(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(`div`,{className:`h-4 w-48 bg-muted/30 rounded animate-pulse`}),(0,L.jsx)(`div`,{className:`h-20 bg-muted/30 rounded-lg animate-pulse`}),(0,L.jsx)(`div`,{className:`h-64 bg-muted/30 rounded-lg animate-pulse`})]})});if(se||!w)return(0,L.jsxs)(`div`,{className:`max-w-5xl mx-auto px-4 py-6 flex flex-col items-center gap-3 mt-12`,children:[(0,L.jsx)(`p`,{className:`text-lg font-semibold`,children:e(`detail.notFound`)}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`detail.notFoundDescription`,{id:a})}),(0,L.jsx)(s,{asChild:!0,variant:`outline`,size:`sm`,children:(0,L.jsxs)(O,{to:`/`,children:[(0,L.jsx)(ie,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.backToDashboard`)]})})]});let Se=_e[w.status]??_e.queued,Ce=w.status===`running`,we=w.status===`completed`||w.status===`failed`,Te=!!w.interactive,Ee=Te&&Ce,De=(w.tickets?.length??0)>0,Oe=F.length>1?{totalCostUsd:F.reduce((e,t)=>e+(t.total_cost_usd??0),0),totalTokensIn:F.reduce((e,t)=>e+(t.tokens_in??0),0),totalTokensOut:F.reduce((e,t)=>e+(t.tokens_out??0),0),totalTokensCacheRead:F.reduce((e,t)=>e+(t.tokens_cache_read??0),0),totalTokensCacheCreate:F.reduce((e,t)=>e+(t.tokens_cache_create??0),0),jobCount:F.length}:null;return(0,L.jsxs)(`div`,{"data-job-detail-surface":!0,className:`flex flex-col h-full max-w-5xl mx-auto w-full`,children:[(0,L.jsxs)(`div`,{className:`px-4 py-4 border-b border-border space-y-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,L.jsxs)(O,{to:`/`,className:`hover:text-foreground transition-colors flex items-center gap-1`,children:[(0,L.jsx)(ie,{className:`w-3 h-3`}),e(`detail.breadcrumbDashboard`)]}),(0,L.jsx)(b,{className:`w-3 h-3`}),(0,L.jsx)(`span`,{className:`text-foreground font-mono`,children:e(`detail.breadcrumbJob`,{id:a?.slice(0,8)})})]}),De&&(0,L.jsx)(ue,{tickets:w.tickets??[],onTicketClick:S}),(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`space-y-1 min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,L.jsxs)(M,{children:[(0,L.jsx)(j,{asChild:!0,children:(0,L.jsx)(`div`,{children:(0,L.jsx)(o,{variant:Se.variant,children:e(Se.labelKey)})})}),(0,L.jsx)(p,{children:e(Se.tooltipKey)})]}),(0,L.jsx)(`code`,{className:c(`font-mono text-foreground/90 truncate`,De?`text-xs text-muted-foreground`:`text-sm`),children:re(w.command,g)})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground flex-wrap`,children:[(0,L.jsx)(`span`,{children:w.started_at?e(`detail.startedAgo`,{timeAgo:ne(new Date(w.started_at),{addSuffix:!0,locale:ee()})}):e(`detail.queuedWaiting`)}),w.model&&(0,L.jsx)(`span`,{className:`text-muted-foreground/40`,children:w.model})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[w.hasTelemetry&&(0,L.jsxs)(M,{children:[(0,L.jsx)(j,{asChild:!0,children:(0,L.jsxs)(s,{variant:`outline`,size:`sm`,className:`h-7`,onClick:be,"aria-label":e(`detail.exportDiagnosticAria`),children:[(0,L.jsx)(te,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.exportDiagnostic`)]})}),(0,L.jsx)(p,{children:e(`detail.exportDiagnosticTooltip`)})]}),we&&(0,L.jsxs)(M,{children:[(0,L.jsx)(j,{asChild:!0,children:(0,L.jsxs)(s,{variant:`outline`,size:`sm`,onClick:xe,className:`h-7`,children:[(0,L.jsx)(i,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.reExecute`)]})}),(0,L.jsx)(p,{children:e(`detail.reExecuteTooltip`)})]}),Ee&&(0,L.jsxs)(M,{children:[(0,L.jsx)(j,{asChild:!0,children:(0,L.jsxs)(s,{variant:`outline`,size:`sm`,onClick:ve,disabled:K,className:`h-7 border-accent-success/40 text-accent-success hover:bg-accent-success/10`,children:[(0,L.jsx)(v,{className:`w-3.5 h-3.5 mr-1.5`}),e(K?`detail.finalizing`:`detail.finalizeJob`)]})}),(0,L.jsx)(p,{children:e(`detail.finalizeJobTooltip`)})]}),Ce&&(0,L.jsxs)(M,{children:[(0,L.jsx)(j,{asChild:!0,children:(0,L.jsx)(s,{variant:`outline`,size:`sm`,onClick:ge,className:`h-7 border-destructive/30 text-destructive hover:bg-destructive/10`,children:e(Te?`detail.cancelInteractive`:`detail.cancelJob`)})}),(0,L.jsx)(p,{children:e(`detail.cancelJobTooltip`)})]})]})]}),(0,L.jsx)(ae,{phases:N,phaseDefinitions:k})]}),(w.status===`running`||w.status===`completed`||w.status===`failed`)&&(0,L.jsx)(le,{job:w,events:E,defaultOpen:w.status===`completed`||w.status===`running`,pipelineTotals:Oe??void 0,phases:N,phaseDefinitions:k}),(0,L.jsx)(`div`,{className:`flex-1 overflow-hidden relative`,children:(0,L.jsx)(pe,{events:E})}),Ee&&(0,L.jsxs)(`div`,{className:`shrink-0 border-t border-border/40 bg-surface/40 px-3 py-2 space-y-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] text-muted-foreground`,children:[(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[ce&&(0,L.jsx)(l,{className:`w-3 h-3 animate-spin`}),e(ce?`detail.interactive.working`:`detail.interactive.ready`)]}),V&&(0,L.jsx)(`span`,{className:`tabular-nums`,children:e(`detail.interactive.liveTotals`,{turns:V.num_turns,cost:V.total_cost_usd.toFixed(4)})})]}),(0,L.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,L.jsx)(`textarea`,{value:W,onChange:e=>G(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),ye())},rows:2,placeholder:e(`detail.interactive.placeholder`),"aria-label":e(`detail.interactive.placeholder`),className:`flex-1 resize-none rounded-md border border-border/50 bg-background px-2.5 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-ring`}),(0,L.jsxs)(s,{size:`sm`,onClick:()=>void ye(),disabled:J||!W.trim(),className:`h-9 shrink-0`,children:[(0,L.jsx)(d,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.interactive.send`)]})]})]})]})}export{ve as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{$ as t,$t as n,Bt as r,D as i,Dt as a,E as o,Et as s,I as c,M as l,N as u,O as d,Ot as f,R as p,T as m,b as h,cn as g,dt as _,en as v,ft as y,in as b,k as x,lt as S,m as C,n as w,p as ee,u as T,w as E,wt as D,x as O,y as k,zt as A}from"./index-BEGU2TCx.js";import{t as j}from"./ExportDropdown-I_8R48Yq.js";import{t as te}from"./format-command-CZsy-vHq.js";var ne=D(`git-compare-arrows`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]),M=e(g(),1),N=A();function P(e){if(e==null)return`—`;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function F(e){return e==null?`—`:e===0?`$0`:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function I(e){return e==null?`—`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function L({label:e,a:t,b:n,highlight:r}){return(0,N.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 py-2 border-b border-border/20 last:border-0 text-xs`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,N.jsx)(`span`,{className:`font-mono text-right ${r===`a`?`text-emerald-400 aurora-light:text-accent-success font-semibold`:``}`,children:t}),(0,N.jsx)(`span`,{className:`font-mono text-right ${r===`b`?`text-emerald-400 aurora-light:text-accent-success font-semibold`:``}`,children:n})]})}function R(e,t,n=!0){return e==null||t==null||e===t?null:n?e<t?`a`:`b`:e>t?`a`:`b`}function re({jobIds:e,onClose:t}){let{t:n}=v(`jobs`),[i,a]=(0,M.useState)(null),[o,s]=(0,M.useState)(!0),[l,u]=(0,M.useState)(null);(0,M.useEffect)(()=>{let t=new AbortController;return fetch(`${r()}/jobs/compare?jobIds=${e.join(`,`)}`,{signal:t.signal}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{a(e),s(!1)}).catch(e=>{e.name!==`AbortError`&&(u(e.message),s(!1))}),()=>t.abort()},[e]);function d(e,t){return(0,N.jsxs)(`div`,{className:`text-center space-y-1`,children:[(0,N.jsx)(`p`,{className:`text-[10px] text-muted-foreground font-medium uppercase tracking-wider`,children:n(`comparison.jobN`,{n:t+1})}),(0,N.jsx)(`code`,{className:`text-[10px] text-foreground/70 block truncate max-w-[160px] mx-auto`,children:e.command}),(0,N.jsxs)(`div`,{className:`flex items-center justify-center gap-1 text-[10px]`,children:[e.status===`completed`?(0,N.jsx)(y,{className:`w-3 h-3 text-emerald-400 aurora-light:text-accent-success`}):(0,N.jsx)(_,{className:`w-3 h-3 text-rose-400 aurora-light:text-destructive`}),(0,N.jsx)(`span`,{className:`capitalize text-muted-foreground`,children:n(`statusLabel.${e.status}`,{defaultValue:e.status})})]}),(0,N.jsx)(`p`,{className:`text-[10px] text-muted-foreground font-mono`,children:e.id.slice(0,8)})]})}return(0,N.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:t,children:(0,N.jsxs)(`div`,{className:`w-full max-w-lg rounded-xl border border-border/30 bg-popover p-5 shadow-xl space-y-4 mx-4`,onClick:e=>e.stopPropagation(),children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,N.jsx)(`h2`,{className:`text-sm font-semibold`,children:n(`comparison.title`)}),(0,N.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted-foreground hover:text-foreground transition-colors`,children:(0,N.jsx)(c,{className:`w-4 h-4`})})]}),o&&(0,N.jsx)(`div`,{className:`space-y-2`,children:[0,1,2,3].map(e=>(0,N.jsx)(`div`,{className:`h-8 bg-muted/20 rounded animate-pulse`},e))}),l&&(0,N.jsx)(`p`,{className:`text-xs text-red-400 aurora-light:text-destructive`,children:n(`comparison.loadFailed`,{error:l})}),i&&(()=>{let[e,t]=i.jobs,r=R(e.durationMs,t.durationMs,!0),a=R(e.totalCostUsd,t.totalCostUsd,!0),o=R(e.tokensOut==null?null:e.tokensOut,t.tokensOut==null?null:t.tokensOut,!0);return(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 pb-3 border-b border-border/30 mb-1`,children:[(0,N.jsx)(`div`,{}),d(e,0),d(t,1)]}),(0,N.jsx)(L,{label:n(`comparison.duration`),a:P(e.durationMs),b:P(t.durationMs),highlight:r}),(0,N.jsx)(L,{label:n(`comparison.cost`),a:F(e.totalCostUsd),b:F(t.totalCostUsd),highlight:a}),(0,N.jsx)(L,{label:n(`comparison.tokensOut`),a:I(e.tokensOut),b:I(t.tokensOut),highlight:o}),(0,N.jsx)(L,{label:n(`comparison.tokensIn`),a:I(e.tokensIn),b:I(t.tokensIn),highlight:null}),(0,N.jsx)(L,{label:n(`comparison.cacheRead`),a:I(e.tokensCacheRead),b:I(t.tokensCacheRead),highlight:null}),(0,N.jsx)(L,{label:n(`comparison.model`),a:e.model??`—`,b:t.model??`—`,highlight:null}),(0,N.jsx)(L,{label:n(`comparison.phasesDone`),a:e.phasesCompleted.length>0?e.phasesCompleted.join(`, `):`—`,b:t.phasesCompleted.length>0?t.phasesCompleted.join(`, `):`—`,highlight:null})]})})(),i&&(0,N.jsx)(`p`,{className:`text-[10px] text-muted-foreground/60 text-center`,children:n(`comparison.betterValueHint`)})]})})}var ie={running:{variant:`running`,labelKey:`statusLabel.running`,tooltipKey:`statusTooltip.running`},completed:{variant:`success`,labelKey:`statusLabel.done`,tooltipKey:`statusTooltip.completed`},failed:{variant:`failed`,labelKey:`statusLabel.failed`,tooltipKey:`statusTooltip.failed`},canceled:{variant:`canceled`,labelKey:`statusLabel.canceled`,tooltipKey:`statusTooltip.canceled`},queued:{variant:`queued`,labelKey:`statusLabel.queued`,tooltipKey:`statusTooltip.queuedToRun`},zombie_terminated:{variant:`failed`,labelKey:`statusLabel.zombie`,tooltipKey:`statusTooltip.zombie`},skipped:{variant:`warning`,labelKey:`statusLabel.skipped`,tooltipKey:`statusTooltip.skipped`}},ae=[`running`,`completed`,`failed`,`canceled`,`zombie_terminated`,`queued`,`skipped`],oe={critical:{className:`bg-red-500/15 aurora-light:bg-destructive/10 text-red-400 aurora-light:text-destructive border-red-500/30 aurora-light:border-destructive/30`,labelKey:`recent.priority.critical`},high:{className:`bg-orange-500/15 aurora-light:bg-accent-warning/10 text-orange-400 aurora-light:text-accent-warning border-orange-500/30 aurora-light:border-accent-warning/30`,labelKey:`recent.priority.high`},normal:{className:``,labelKey:`recent.priority.normal`},low:{className:`bg-gray-500/15 aurora-light:bg-muted text-gray-400 aurora-light:text-muted-foreground border-gray-500/30 aurora-light:border-border`,labelKey:`recent.priority.low`}};function se(e){return e==null||e===0?null:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function ce(e,t){if(!t)return null;let n=new Date(t).getTime()-new Date(e).getTime();if(n<0)return null;let r=Math.round(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60),a=r%60;return i<60?`${i}m ${a}s`:`${Math.floor(i/60)}h ${i%60}m`}function le(e){return e==null||e===0?null:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function ue(e){try{return T(new Date(e),{addSuffix:!0,locale:f()})}catch{return e}}var z=10;function B({jobs:e,isLoading:a,onJobsCleared:c,onProposalClick:f,onProposalDelete:g}){let{t:_}=v(`jobs`),y=b(),{activeProjectId:C,projects:w}=s(),ee=w.find(e=>e.id===C)?.provider,[T,D]=(0,M.useState)(null),[A,j]=(0,M.useState)(``),[P,F]=(0,M.useState)(``),[I,L]=(0,M.useState)(!1),[R,B]=(0,M.useState)(``),[V,H]=(0,M.useState)(``),[U,W]=(0,M.useState)(!1),[G,K]=(0,M.useState)(null),[q,J]=(0,M.useState)(z),[Y,de]=(0,M.useState)(!1),[X,Z]=(0,M.useState)([]),[fe,Q]=(0,M.useState)(null);(0,M.useEffect)(()=>{J(z)},[e.length]);function pe(){de(e=>!e),Z([])}function me(e){Z(t=>{if(t.includes(e))return t.filter(t=>t!==e);if(t.length>=2)return t;let n=[...t,e];return n.length===2&&Q(n),n})}let $=e.filter(e=>!(T&&e.status!==T||A&&e.started_at<A||P&&e.started_at>`${P}T23:59:59`)),he=e.filter(e=>!(R&&e.started_at<R||V&&e.started_at>`${V}T23:59:59`)).length;async function ge(e){W(!0);try{let t={};e===`range`&&(R&&(t.from=R),V&&(t.to=V));let i=await fetch(`${r()}/jobs`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(i.ok){let e=await i.json();n.success(_(`recent.toast.cleared`,{count:e.deleted})),L(!1),B(``),H(``),c?.()}else n.error(_(`recent.toast.clearFailed`))}catch{n.error(_(`recent.toast.networkError`))}finally{W(!1)}}return a?(0,N.jsx)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4 space-y-1`,children:[0,1,2].map(e=>(0,N.jsx)(`div`,{className:`h-9 bg-muted/30 rounded-md animate-pulse`},e))}):e.length===0?(0,N.jsxs)(`div`,{className:`rounded-lg border border-dashed border-border/40 bg-card/50 p-8 text-center space-y-2`,children:[(0,N.jsx)(S,{className:`w-8 h-8 text-muted-foreground/30 mx-auto`}),(0,N.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:_(`recent.emptyTitle`)}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground/60`,children:_(`recent.emptyDescription`)})]}):(0,N.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4 space-y-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,N.jsx)(`button`,{type:`button`,onClick:()=>D(null),className:`px-2 py-0.5 rounded text-[10px] font-medium transition-colors ${T===null?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`}`,children:_(`recent.filterAll`,{count:e.length})}),ae.map(t=>{let n=e.filter(e=>e.status===t).length;return n===0?null:(0,N.jsx)(`button`,{type:`button`,onClick:()=>D(T===t?null:t),className:`px-2 py-0.5 rounded text-[10px] font-medium capitalize transition-colors ${T===t?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`}`,children:_(`recent.filterStatus`,{status:_(`statusName.${t}`),count:n})},t)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(`input`,{type:`date`,value:A,onChange:e=>j(e.target.value),className:`h-6 rounded border border-border bg-input px-1.5 text-[10px] text-foreground`,title:_(`recent.fromDate`)}),(0,N.jsx)(`input`,{type:`date`,value:P,onChange:e=>F(e.target.value),className:`h-6 rounded border border-border bg-input px-1.5 text-[10px] text-foreground`,title:_(`recent.toDate`)}),(A||P)&&(0,N.jsx)(`button`,{type:`button`,onClick:()=>{j(``),F(``)},className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors`,children:_(`recent.clear`)}),(0,N.jsxs)(k,{children:[(0,N.jsx)(O,{asChild:!0,children:(0,N.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 transition-colors ${Y?`text-foreground bg-accent`:`text-muted-foreground hover:text-foreground`}`,onClick:pe,children:(0,N.jsx)(ne,{className:`w-3.5 h-3.5`})})}),(0,N.jsx)(h,{children:_(Y?`recent.exitCompareMode`:`recent.compareTwoJobs`)})]}),(0,N.jsxs)(k,{children:[(0,N.jsx)(O,{asChild:!0,children:(0,N.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 text-muted-foreground hover:text-destructive`,onClick:()=>L(!0),children:(0,N.jsx)(p,{className:`w-3.5 h-3.5`})})}),(0,N.jsx)(h,{children:_(`recent.clearJobs`)})]})]})]}),Y&&(0,N.jsxs)(`div`,{className:`flex items-center justify-between rounded-md bg-accent/40 px-3 py-1.5 text-[10px] text-muted-foreground`,children:[(0,N.jsxs)(`span`,{children:[X.length===0&&_(`recent.selectTwoToCompare`),X.length===1&&_(`recent.selectOneMore`),X.length===2&&_(`recent.readyToCompare`)]}),X.length===2&&(0,N.jsx)(`button`,{type:`button`,className:`text-[10px] font-medium text-foreground hover:underline`,onClick:()=>Q(X),children:_(`recent.compareAction`)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1 text-[10px] font-medium text-muted-foreground uppercase tracking-wider`,children:[(0,N.jsx)(`span`,{className:`w-14`,children:_(`recent.colStatus`)}),(0,N.jsx)(`span`,{className:`flex-1 min-w-0`,children:_(`recent.colCommand`)}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,N.jsx)(`span`,{className:`w-14 text-right`,children:_(`recent.colDuration`)}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:_(`recent.colTokens`)}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:_(`recent.colCost`)}),(0,N.jsx)(`span`,{className:`w-20 text-right`,children:_(`recent.colStarted`)})]})]}),(0,N.jsx)(`div`,{className:`space-y-0.5`,children:$.slice(0,q).map(e=>{let n=ie[e.status]??ie.queued,r=se(e.total_cost_usd),i=ce(e.started_at,e.finished_at),a=le((e.tokens_in??0)+(e.tokens_out??0)+(e.tokens_cache_read??0)+(e.tokens_cache_create??0)||null),o=e.id.startsWith(`proposal:`),s=o?e.id.replace(`proposal:`,``):null,c=X.includes(e.id),u=Y&&!o&&X.length===2&&!c;return(0,N.jsxs)(`div`,{role:`button`,tabIndex:0,className:`flex items-center gap-3 px-3 py-2 rounded-md transition-colors cursor-pointer group ${c?`bg-accent/70 ring-1 ring-border`:u?`opacity-40 cursor-not-allowed`:`hover:bg-accent/50`}`,onClick:()=>{if(Y&&!o){me(e.id);return}o&&s?f?.(s):y(`/jobs/${e.id}`)},children:[(0,N.jsxs)(k,{children:[(0,N.jsx)(O,{asChild:!0,children:(0,N.jsx)(`div`,{children:(0,N.jsx)(l,{variant:n.variant,children:_(n.labelKey)})})}),(0,N.jsx)(h,{children:_(n.tooltipKey)})]}),e.priority&&e.priority!==`normal`&&(0,N.jsx)(`span`,{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium border ${oe[e.priority].className}`,children:_(oe[e.priority].labelKey)}),e.profile_name&&(0,N.jsxs)(k,{children:[(0,N.jsx)(O,{asChild:!0,children:(0,N.jsx)(`span`,{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium border border-accent-primary/40 bg-accent-primary/10 text-accent-primary/90`,children:e.profile_name})}),(0,N.jsx)(h,{children:_(`recent.profileTooltip`,{name:e.profile_name})})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-1 flex-1 min-w-0`,children:[e.pipeline_id&&(0,N.jsxs)(k,{children:[(0,N.jsx)(O,{asChild:!0,children:(0,N.jsx)(t,{className:`w-3 h-3 text-accent-primary/60 shrink-0`})}),(0,N.jsxs)(h,{children:[_(`recent.pipelinePart`),e.depends_on_job_id&&` ${_(`recent.pipelineDependsOn`)}`,e.skip_reason&&` — ${e.skip_reason}`]})]}),(0,N.jsx)(`code`,{className:`text-xs text-foreground/80 truncate`,children:te(e.command,ee)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] text-muted-foreground shrink-0`,children:[(0,N.jsx)(`span`,{className:`w-14 text-right`,children:i??`—`}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:a?`${a}`:`—`}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:r??`—`}),(0,N.jsx)(`span`,{className:`w-20 text-right`,children:ue(e.started_at)}),o&&s&&(0,N.jsx)(`button`,{type:`button`,className:`w-4 h-4 md:opacity-0 md:group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all`,onClick:e=>{e.stopPropagation(),K(s)},title:_(`recent.deleteProposal`),children:(0,N.jsx)(p,{className:`w-3 h-3`})})]})]},e.id)})}),$.length>q&&(0,N.jsx)(`div`,{className:`pt-1 text-center`,children:(0,N.jsx)(`button`,{type:`button`,onClick:()=>J(e=>e+z),className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors px-3 py-1 rounded hover:bg-accent/50`,children:_(`recent.loadMore`,{count:$.length-q})})}),I&&(0,N.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:()=>L(!1),children:(0,N.jsxs)(`div`,{className:`w-80 rounded-xl border border-border/30 bg-popover p-4 shadow-lg space-y-4`,onClick:e=>e.stopPropagation(),children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h3`,{className:`text-sm font-semibold`,children:_(`recent.clearModal.title`)}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:_(`recent.clearModal.jobsInHistory`,{count:e.length})})]}),(0,N.jsx)(u,{variant:`destructive`,size:`sm`,className:`w-full`,disabled:U,onClick:()=>ge(`all`),children:_(`recent.clearModal.clearAll`,{count:e.length})}),(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:_(`recent.clearModal.orByRange`)}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsx)(`input`,{type:`date`,value:R,onChange:e=>B(e.target.value),className:`flex-1 h-7 rounded-md border border-border bg-input px-2 text-xs text-foreground`,placeholder:_(`recent.clearModal.fromPlaceholder`)}),(0,N.jsx)(`input`,{type:`date`,value:V,onChange:e=>H(e.target.value),className:`flex-1 h-7 rounded-md border border-border bg-input px-2 text-xs text-foreground`,placeholder:_(`recent.clearModal.toPlaceholder`)})]}),(0,N.jsx)(u,{variant:`outline`,size:`sm`,className:`w-full`,disabled:U||!R&&!V,onClick:()=>ge(`range`),children:R||V?_(`recent.clearModal.clearInRange`,{count:he}):_(`recent.clearModal.clearRange`)})]}),(0,N.jsx)(u,{variant:`ghost`,size:`sm`,className:`w-full`,onClick:()=>L(!1),children:_(`common:actions.cancel`)})]})}),(0,N.jsx)(E,{open:G!==null,onOpenChange:e=>!e&&K(null),children:(0,N.jsxs)(m,{className:`max-w-sm`,children:[(0,N.jsxs)(d,{children:[(0,N.jsx)(x,{children:_(`recent.deleteProposalConfirm.title`)}),(0,N.jsx)(o,{children:_(`recent.deleteProposalConfirm.description`)})]}),(0,N.jsxs)(i,{children:[(0,N.jsx)(u,{variant:`ghost`,size:`sm`,onClick:()=>K(null),children:_(`common:actions.cancel`)}),(0,N.jsx)(u,{variant:`destructive`,size:`sm`,onClick:()=>{G&&g?.(G),K(null)},children:_(`common:actions.delete`)})]})]})}),fe&&(0,N.jsx)(re,{jobIds:fe,onClose:()=>{Q(null),Z([]),de(!1)}})]})}function V(){let{t:e}=v(`jobs`),{activeProjectId:t}=s(),{recentJobs:o}=w(t),{data:c,isFirstLoad:f,refresh:p}=a({namespace:`jobs`,projectId:t,initialValue:o,fetcher:async()=>{let e=await fetch(`${r()}/jobs?limit=10`);return e.ok?(await e.json()).jobs:[]},pollInterval:1e4}),{data:h}=a({namespace:`proposals`,projectId:t,initialValue:[],fetcher:async()=>{let e=await fetch(`${r()}/propose?limit=10`);return e.ok?(await e.json()).proposals:[]},pollInterval:1e4}),g={input:`queued`,exploring:`running`,review:`running`,refining:`running`,creating_issue:`running`,created:`completed`,cancelled:`canceled`},_=h.map(e=>({id:`proposal:${e.id}`,command:`/specrails:propose-feature ${e.idea.length>60?e.idea.slice(0,57)+`...`:e.idea}`,started_at:e.created_at,status:g[e.status]??`queued`})),y=[...c,..._].sort((e,t)=>new Date(t.started_at).getTime()-new Date(e.started_at).getTime()),[b,S]=(0,M.useState)(null),T=(0,M.useCallback)(async e=>{try{let t=await fetch(`${r()}/propose/${e}`);if(!t.ok)return;S((await t.json()).proposal)}catch{}},[]),D=(0,M.useCallback)(async t=>{try{(await fetch(`${r()}/propose/${t}`,{method:`DELETE`})).ok&&(n.success(e(`page.proposalDeleted`)),p())}catch{}},[p,e]);return(0,N.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 py-6`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,N.jsx)(`h1`,{className:`text-sm font-semibold`,children:e(`page.title`)}),(0,N.jsx)(j,{baseUrl:`${r()}/jobs/export`,label:e(`page.exportJobs`)})]}),(0,N.jsx)(B,{jobs:y,isLoading:f,onJobsCleared:p,onProposalClick:T,onProposalDelete:D}),(0,N.jsx)(E,{open:b!==null,onOpenChange:e=>!e&&S(null),children:(0,N.jsx)(m,{className:`max-w-3xl glass-card`,children:b&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(d,{children:(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(x,{className:`flex-1 min-w-0`,children:e(`page.proposal.title`)}),(0,N.jsx)(l,{variant:b.status===`created`?`success`:b.status===`cancelled`?`destructive`:`secondary`,children:b.status})]})}),(0,N.jsx)(`div`,{className:`text-xs text-muted-foreground bg-muted/20 rounded px-2 py-1 italic`,children:b.idea}),b.result_markdown?(0,N.jsx)(`div`,{className:`max-h-[400px] overflow-y-auto rounded-lg px-3 py-2 text-xs bg-muted/40`,children:(0,N.jsx)(`div`,{className:`prose prose-invert prose-xs max-w-none prose-p:my-1 prose-headings:mt-2 prose-headings:mb-1 prose-headings:text-sm prose-headings:font-semibold prose-ul:my-1 prose-ol:my-1 prose-li:my-0 prose-code:text-cyan-300 prose-code:text-[10px] prose-code:bg-muted/40 prose-code:px-1 prose-code:py-0.5 prose-code:rounded text-foreground/80`,children:(0,N.jsx)(C,{remarkPlugins:[ee],children:b.result_markdown})})}):(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground py-4 text-center`,children:e(`page.proposal.noContent`)}),b.issue_url&&(0,N.jsxs)(`div`,{className:`text-xs`,children:[e(`page.proposal.githubIssue`),` `,(0,N.jsx)(`a`,{href:b.issue_url,target:`_blank`,rel:`noopener noreferrer`,className:`text-accent-primary hover:underline`,children:b.issue_url})]}),(0,N.jsxs)(i,{children:[(0,N.jsx)(u,{variant:`destructive`,size:`sm`,onClick:()=>{D(b.id),S(null)},children:e(`common:actions.delete`)}),(0,N.jsx)(u,{variant:`ghost`,size:`sm`,onClick:()=>S(null),children:e(`common:actions.close`)})]})]})})})]})}export{V as default};
@@ -1 +0,0 @@
1
- var e={job:`Jobs`,quickSpec:`Quick`,exploreSpec:`Explore`,aiEdit:`Verfeinern`,smash:`SMASH`,fileSummary:`Dateizusammenfassungen`},t={d7:`7d`,d30:`30d`,d90:`90d`,all:`Alle`,custom:`Benutzerdefiniert`,startDate:`Startdatum`,endDate:`Enddatum`,to:`bis`},n=`{{count}} Lauf`,r=`{{count}} Läufe`,i={title:`Analytics`,all:`Alle`,engine:`Engine`,ticketChip:`Ticket #{{id}} · ✕`,failedToLoad:`Laden fehlgeschlagen: {{error}}`},a={spending:`Ausgaben`,vsPrev:`{{pct}} % ggü. Vorperiode`,invocations_one:`{{count}} Aufruf`,invocations_other:`{{count}} Aufrufe`,tokens:`· {{tokens}} Tokens`,tokensTooltip:`Tokens gesamt = neue Eingabe + Ausgabe + Cache-Read + Cache-Create über alle Aufrufe in diesem Zeitraum.`,includesEstimated:`· enthält ~{{amount}} geschätzt`,includesEstimatedTooltip:`Enthält {{amount}} geschätzte Kosten von Providern ohne natives Kostenfeld (z. B. codex über die lokale Preistabelle).`,trackingStarted:`Tracking gestartet am {{date}}`,trackingStartedFallback:`Tracking beginnt mit dem ersten Aufruf`,emptyState:`Noch keine Aufrufe für diesen Filterzeitraum.`,segmentTitle:`{{label}}: {{value}}`},o={title:`Nach Provider`,description:`So verteilen sich die Kosten auf die KI-CLIs in diesem Projekt. Das Präfix <tilde>~</tilde> markiert Zeilen, deren Kosten über die lokale Preistabelle geschätzt sind (der Provider meldet sie nicht nativ).`,noCost:`Noch keine Kosten in diesem Zeitraum erfasst.`,segmentTitle:`{{label}}: {{value}} ({{count}})`},s={title:`Täglicher Verlauf`,subtitle:`gestapelt nach Surface`,empty:`Keine Ausgaben in diesem Zeitraum.`},c={title:`Quick vs. Explore`,quick:`Quick`,explore:`Explore`,sparseCta:`Probiere Explore für reichhaltigere Specs`,runsSoFar_one:`bisher {{count}} Lauf`,runsSoFar_other:`bisher {{count}} Läufe`,perSpec:`pro Spec`,createdRuns:`<strong>{{created}}</strong> erstellt · {{runs}} Läufe`,avgDuration:`Ø {{duration}}`,ratio:`{{ratio}}× mehr pro Spec`},l={title:`Modelle`,empty:`Keine Modelle erfasst.`},u={title:`Kosten vs. Turns`,empty:`Keine Aufrufe zum Darstellen.`,turnsLabel:`Turns`,costLabel:`Kosten`},d={title:`Top-Tickets`,empty:`Keine Ticket-Aktivität in diesem Zeitraum.`,breakdownItem:`{{n}} {{label}}`,unattributed:`Nicht zugeordnet`,deletedTicket:`gelöschtes Ticket #{{id}}`},f={title:`Alle Aufrufe`,statusFilterAria:`Statusfilter`,minCostFilterAria:`Mindestkosten-Filter`,minCostPlaceholder:`≥ $0.00`,allStatus:`Alle Status`,success:`Erfolgreich`,failed:`Fehlgeschlagen`,aborted:`Abgebrochen`,empty:`Keine Aufrufe entsprechen den aktuellen Filtern.`,colSurface:`Surface`,colTicket:`Ticket`,colCost:`Kosten`,colTurns:`Turns`,colTokens:`Tokens`,colModel:`Modell`,colStatus:`Status`,colStarted:`Gestartet`,contractLayer:`Contract Layer`,contractLayerRefinement:`Contract-Layer-Verfeinerung`,deleted:`(gelöscht)`,provisionalTitleTooltip:`Vorläufiger Explore-Titel – noch nicht committet`,estimatedCostTooltip:`Geschätzt anhand der lokalen Preistabelle – dieser Provider meldet Kosten nicht nativ.`,inferred:`abgeleitet`,statusValue:{success:`erfolgreich`,failed:`fehlgeschlagen`,aborted:`abgebrochen`},truncated:`Zeige die ersten {{shown}} von {{total}} passenden Zeilen.`},p={title:`Desktop-Analytics`,refreshAria:`Analytics aktualisieren`,failedToLoad:`Analytics konnten nicht geladen werden: {{error}}`,totalCost:`Gesamtkosten`,costToday:`{{value}} heute`,totalJobs:`Jobs gesamt`,jobsToday:`{{n}} heute`,successRate:`Erfolgsquote`,acrossAllProjects:`über alle Projekte`,avgCostPerJob:`Ø Kosten / Job`,periodAverage:`Durchschnitt im Zeitraum`,costOverTime:`Projektübergreifende Kosten im Zeitverlauf`,noCostData:`Keine Kostendaten für diesen Zeitraum`,projectComparison:`Projektvergleich`,noProjects:`Keine Projekte registriert.`,jobsCount_one:`{{count}} Job`,jobsCount_other:`{{count}} Jobs`,successPct:`{{pct}} % Erfolg`,costByProject:`Kosten nach Projekt`},m={surfaces:e,periods:t,runs_one:n,runs_other:r,page:i,hero:a,providerCard:o,timeline:s,quickVsExplore:c,models:l,scatter:u,topTickets:d,table:f,export:{summaryCsv:`Zusammenfassung (CSV)`,rawCsv:`Rohdaten (CSV)`,summaryJson:`Zusammenfassung (JSON)`,rawJson:`Rohdaten (JSON)`,downloading:`Wird heruntergeladen…`,noData:`Keine Daten für aktuelle Filter`,failed:`Export fehlgeschlagen`},desktop:p};export{m as default,p as desktop,a as hero,l as models,i as page,t as periods,o as providerCard,c as quickVsExplore,n as runs_one,r as runs_other,u as scatter,e as surfaces,f as table,s as timeline,d as topTickets};
@@ -1 +0,0 @@
1
- var e={job:`ジョブ`,quickSpec:`クイック`,exploreSpec:`Explore`,aiEdit:`リファイン`,smash:`SMASH`,fileSummary:`ファイル要約`},t={d7:`7日`,d30:`30日`,d90:`90日`,all:`すべて`,custom:`カスタム`,startDate:`開始日`,endDate:`終了日`,to:`〜`},n=`{{count}} 回の実行`,r=`{{count}} 回の実行`,i={title:`アナリティクス`,all:`すべて`,engine:`エンジン`,ticketChip:`チケット #{{id}} · ✕`,failedToLoad:`読み込みに失敗しました: {{error}}`},a={spending:`支出`,vsPrev:`前期間比 {{pct}}%`,invocations_one:`{{count}} 回の呼び出し`,invocations_other:`{{count}} 回の呼び出し`,tokens:`· {{tokens}} トークン`,tokensTooltip:`合計トークン = この期間の全呼び出しにおける新規入力 + 出力 + キャッシュ読み取り + キャッシュ作成の合計。`,includesEstimated:`· 約 {{amount}} の推定値を含む`,includesEstimatedTooltip:`ネイティブのコストフィールドを持たないプロバイダーからの推定コスト {{amount}} を含みます(例: ローカル料金表で算出する codex)。`,trackingStarted:`トラッキング開始: {{date}}`,trackingStartedFallback:`最初の呼び出しからトラッキングを開始`,emptyState:`このフィルター期間の呼び出しはまだありません。`,segmentTitle:`{{label}}: {{value}}`},o={title:`プロバイダー別`,description:`このプロジェクトの AI CLI 間でのコストの内訳。<tilde>~</tilde> プレフィックスは、コストがローカル料金表からの推定値である行を示します(プロバイダーがネイティブに報告しない場合)。`,noCost:`この期間に記録されたコストはまだありません。`,segmentTitle:`{{label}}: {{value}} ({{count}})`},s={title:`日次タイムライン`,subtitle:`サーフェス別の積み上げ`,empty:`この期間の支出はありません。`},c={title:`クイック vs Explore`,quick:`クイック`,explore:`Explore`,sparseCta:`より充実したスペックには Explore をお試しください`,runsSoFar_one:`これまで {{count}} 回実行`,runsSoFar_other:`これまで {{count}} 回実行`,perSpec:`スペックあたり`,createdRuns:`<strong>{{created}}</strong> 件作成 · {{runs}} 回実行`,avgDuration:`平均 {{duration}}`,ratio:`スペックあたり {{ratio}}× 多い`},l={title:`モデル`,empty:`記録されたモデルはありません。`},u={title:`コスト vs ターン`,empty:`プロットする呼び出しがありません。`,turnsLabel:`ターン`,costLabel:`コスト`},d={title:`上位チケット`,empty:`この期間のチケットアクティビティはありません。`,breakdownItem:`{{n}} {{label}}`,unattributed:`未割り当て`,deletedTicket:`削除済みチケット #{{id}}`},f={title:`すべての呼び出し`,statusFilterAria:`ステータスフィルター`,minCostFilterAria:`最小コストフィルター`,minCostPlaceholder:`≥ $0.00`,allStatus:`すべてのステータス`,success:`成功`,failed:`失敗`,aborted:`中断`,empty:`現在のフィルターに一致する呼び出しはありません。`,colSurface:`サーフェス`,colTicket:`チケット`,colCost:`コスト`,colTurns:`ターン`,colTokens:`トークン`,colModel:`モデル`,colStatus:`ステータス`,colStarted:`開始`,contractLayer:`Contract Layer`,contractLayerRefinement:`Contract Layer の改良`,deleted:`(削除済み)`,provisionalTitleTooltip:`暫定の Explore タイトル — まだコミットされていません`,estimatedCostTooltip:`ローカル料金表からの推定値 — このプロバイダーはコストをネイティブに報告しません。`,inferred:`推定`,statusValue:{success:`成功`,failed:`失敗`,aborted:`中断`},truncated:`一致する {{total}} 行のうち最初の {{shown}} 行を表示しています。`},p={title:`Desktop アナリティクス`,refreshAria:`アナリティクスを更新`,failedToLoad:`アナリティクスの読み込みに失敗しました: {{error}}`,totalCost:`合計コスト`,costToday:`本日 {{value}}`,totalJobs:`合計ジョブ数`,jobsToday:`本日 {{n}} 件`,successRate:`成功率`,acrossAllProjects:`全プロジェクト`,avgCostPerJob:`ジョブあたり平均コスト`,periodAverage:`期間平均`,costOverTime:`プロジェクト横断のコスト推移`,noCostData:`この期間のコストデータはありません`,projectComparison:`プロジェクト比較`,noProjects:`登録されたプロジェクトはありません。`,jobsCount_one:`{{count}} 件のジョブ`,jobsCount_other:`{{count}} 件のジョブ`,successPct:`成功率 {{pct}}%`,costByProject:`プロジェクト別コスト`},m={surfaces:e,periods:t,runs_one:n,runs_other:r,page:i,hero:a,providerCard:o,timeline:s,quickVsExplore:c,models:l,scatter:u,topTickets:d,table:f,export:{summaryCsv:`サマリー CSV`,rawCsv:`生データ CSV`,summaryJson:`サマリー JSON`,rawJson:`生データ JSON`,downloading:`ダウンロード中…`,noData:`現在のフィルターにデータがありません`,failed:`エクスポートに失敗しました`},desktop:p};export{m as default,p as desktop,a as hero,l as models,i as page,t as periods,o as providerCard,c as quickVsExplore,n as runs_one,r as runs_other,u as scatter,e as surfaces,f as table,s as timeline,d as topTickets};
@@ -1 +0,0 @@
1
- var e={job:`Job`,quickSpec:`Quick`,exploreSpec:`Explore`,aiEdit:`Raffinamento`,smash:`SMASH`,fileSummary:`Riepiloghi file`},t={d7:`7d`,d30:`30d`,d90:`90d`,all:`Tutto`,custom:`Personalizzato`,startDate:`Data di inizio`,endDate:`Data di fine`,to:`a`},n=`{{count}} esecuzione`,r=`{{count}} esecuzioni`,i={title:`Analytics`,all:`Tutti`,engine:`Engine`,ticketChip:`ticket #{{id}} · ✕`,failedToLoad:`Caricamento non riuscito: {{error}}`},a={spending:`Spesa`,vsPrev:`{{pct}}% vs prec.`,invocations_one:`{{count}} invocazione`,invocations_other:`{{count}} invocazioni`,tokens:`· {{tokens}} token`,tokensTooltip:`Token totali = input nuovo + output + lettura cache + creazione cache su tutte le invocazioni in questa finestra.`,includesEstimated:`· include ~{{amount}} stimati`,includesEstimatedTooltip:`Include {{amount}} di costo stimato da provider senza un campo di costo nativo (es. codex tramite la tabella prezzi locale).`,trackingStarted:`Tracciamento iniziato il {{date}}`,trackingStartedFallback:`Il tracciamento inizia alla prima invocazione`,emptyState:`Ancora nessuna invocazione per questa finestra di filtri.`,segmentTitle:`{{label}}: {{value}}`},o={title:`Per provider`,description:`Come si ripartisce il costo tra le CLI AI di questo progetto. Il prefisso <tilde>~</tilde> indica le righe in cui il costo è stimato dalla tabella prezzi locale (il provider non lo riporta nativamente).`,noCost:`Ancora nessun costo registrato in questa finestra.`,segmentTitle:`{{label}}: {{value}} ({{count}})`},s={title:`Timeline giornaliera`,subtitle:`impilata per origine`,empty:`Nessuna spesa in questo periodo.`},c={title:`Quick vs Explore`,quick:`Quick`,explore:`Explore`,sparseCta:`Prova Explore per spec più ricche`,runsSoFar_one:`{{count}} esecuzione finora`,runsSoFar_other:`{{count}} esecuzioni finora`,perSpec:`per spec`,createdRuns:`<strong>{{created}}</strong> create · {{runs}} esecuzioni`,avgDuration:`{{duration}} in media`,ratio:`{{ratio}}× in più per spec`},l={title:`Modelli`,empty:`Nessun modello registrato.`},u={title:`Costo vs Turni`,empty:`Nessuna invocazione da rappresentare.`,turnsLabel:`turni`,costLabel:`costo`},d={title:`Top ticket`,empty:`Nessuna attività sui ticket in questo periodo.`,breakdownItem:`{{n}} {{label}}`,unattributed:`Non attribuito`,deletedTicket:`ticket eliminato #{{id}}`},f={title:`Tutte le invocazioni`,statusFilterAria:`Filtro stato`,minCostFilterAria:`Filtro costo minimo`,minCostPlaceholder:`≥ $0.00`,allStatus:`Tutti gli stati`,success:`Riuscita`,failed:`Fallita`,aborted:`Interrotta`,empty:`Nessuna invocazione corrisponde ai filtri attuali.`,colSurface:`Origine`,colTicket:`Ticket`,colCost:`Costo`,colTurns:`Turni`,colTokens:`Token`,colModel:`Modello`,colStatus:`Stato`,colStarted:`Avvio`,contractLayer:`Contract Layer`,contractLayerRefinement:`Raffinamento Contract Layer`,deleted:`(eliminato)`,provisionalTitleTooltip:`Titolo Explore provvisorio — non ancora confermato`,estimatedCostTooltip:`Stimato dalla tabella prezzi locale — questo provider non riporta il costo nativamente.`,inferred:`dedotto`,statusValue:{success:`riuscita`,failed:`fallita`,aborted:`interrotta`},truncated:`Mostrate le prime {{shown}} di {{total}} righe corrispondenti.`},p={title:`Analytics di Desktop`,refreshAria:`Aggiorna le analytics`,failedToLoad:`Impossibile caricare le analytics: {{error}}`,totalCost:`Costo totale`,costToday:`{{value}} oggi`,totalJobs:`Job totali`,jobsToday:`{{n}} oggi`,successRate:`Tasso di successo`,acrossAllProjects:`su tutti i progetti`,avgCostPerJob:`Costo medio / job`,periodAverage:`media del periodo`,costOverTime:`Costo nel tempo tra i progetti`,noCostData:`Nessun dato di costo per questo periodo`,projectComparison:`Confronto progetti`,noProjects:`Nessun progetto registrato.`,jobsCount_one:`{{count}} job`,jobsCount_other:`{{count}} job`,successPct:`{{pct}}% di successo`,costByProject:`Costo per progetto`},m={surfaces:e,periods:t,runs_one:n,runs_other:r,page:i,hero:a,providerCard:o,timeline:s,quickVsExplore:c,models:l,scatter:u,topTickets:d,table:f,export:{summaryCsv:`CSV riepilogo`,rawCsv:`CSV raw`,summaryJson:`JSON riepilogo`,rawJson:`JSON raw`,downloading:`Download in corso…`,noData:`Nessun dato per i filtri attuali`,failed:`Esportazione non riuscita`},desktop:p};export{m as default,p as desktop,a as hero,l as models,i as page,t as periods,o as providerCard,c as quickVsExplore,n as runs_one,r as runs_other,u as scatter,e as surfaces,f as table,s as timeline,d as topTickets};
@@ -1 +0,0 @@
1
- var e={job:`任务`,quickSpec:`Quick`,exploreSpec:`Explore`,aiEdit:`AI 编辑`,smash:`SMASH`,fileSummary:`文件摘要`},t={d7:`7天`,d30:`30天`,d90:`90天`,all:`全部`,custom:`自定义`,startDate:`开始日期`,endDate:`结束日期`,to:`至`},n=`{{count}} 次运行`,r=`{{count}} 次运行`,i={title:`分析`,all:`全部`,engine:`引擎`,ticketChip:`工单 #{{id}} · ✕`,failedToLoad:`加载失败:{{error}}`},a={spending:`支出`,vsPrev:`较上期 {{pct}}%`,invocations_one:`{{count}} 次调用`,invocations_other:`{{count}} 次调用`,tokens:`· {{tokens}} token`,tokensTooltip:`总 token 数 = 此时间窗口内所有调用的新输入 + 输出 + 缓存读取 + 缓存创建之和。`,includesEstimated:`· 含约 {{amount}} 估算值`,includesEstimatedTooltip:`包含 {{amount}} 的估算成本,来自不原生上报成本的提供方(例如 codex,按本地价格表估算)。`,trackingStarted:`追踪始于 {{date}}`,trackingStartedFallback:`首次调用后开始追踪`,emptyState:`当前筛选窗口内暂无调用。`,segmentTitle:`{{label}}:{{value}}`},o={title:`按提供方`,description:`此项目中各 AI CLI 的成本分布。<tilde>~</tilde> 前缀表示该行成本由本地价格表估算(提供方不原生上报)。`,noCost:`此时间窗口内暂无成本记录。`,segmentTitle:`{{label}}:{{value}}({{count}})`},s={title:`每日时间线`,subtitle:`按来源堆叠`,empty:`此期间没有支出。`},c={title:`Quick vs Explore`,quick:`Quick`,explore:`Explore`,sparseCta:`试试 Explore,获得更丰富的 spec`,runsSoFar_one:`目前 {{count}} 次运行`,runsSoFar_other:`目前 {{count}} 次运行`,perSpec:`每个 spec`,createdRuns:`已创建 <strong>{{created}}</strong> · {{runs}} 次运行`,avgDuration:`平均 {{duration}}`,ratio:`每个 spec 多 {{ratio}}×`},l={title:`模型`,empty:`暂无模型记录。`},u={title:`成本 vs 轮次`,empty:`暂无可绘制的调用。`,turnsLabel:`轮次`,costLabel:`成本`},d={title:`热门工单`,empty:`此期间没有工单活动。`,breakdownItem:`{{n}} {{label}}`,unattributed:`未归属`,deletedTicket:`已删除工单 #{{id}}`},f={title:`全部调用`,statusFilterAria:`状态筛选`,minCostFilterAria:`最低成本筛选`,minCostPlaceholder:`≥ $0.00`,allStatus:`全部状态`,success:`成功`,failed:`失败`,aborted:`已中止`,empty:`没有符合当前筛选条件的调用。`,colSurface:`来源`,colTicket:`工单`,colCost:`成本`,colTurns:`轮次`,colTokens:`Token`,colModel:`模型`,colStatus:`状态`,colStarted:`开始时间`,contractLayer:`Contract Layer`,contractLayerRefinement:`Contract Layer 增强`,deleted:`(已删除)`,provisionalTitleTooltip:`Explore 临时标题——尚未提交`,estimatedCostTooltip:`按本地价格表估算——此提供方不原生上报成本。`,inferred:`推断`,statusValue:{success:`成功`,failed:`失败`,aborted:`已中止`},truncated:`显示前 {{shown}} 条,共 {{total}} 条匹配记录。`},p={title:`Desktop 分析`,refreshAria:`刷新分析数据`,failedToLoad:`加载分析数据失败:{{error}}`,totalCost:`总成本`,costToday:`今日 {{value}}`,totalJobs:`任务总数`,jobsToday:`今日 {{n}} 个`,successRate:`成功率`,acrossAllProjects:`所有项目汇总`,avgCostPerJob:`平均成本 / 任务`,periodAverage:`期间平均`,costOverTime:`跨项目成本走势`,noCostData:`此期间无成本数据`,projectComparison:`项目对比`,noProjects:`尚未注册任何项目。`,jobsCount_one:`{{count}} 个任务`,jobsCount_other:`{{count}} 个任务`,successPct:`成功率 {{pct}}%`,costByProject:`按项目统计成本`},m={surfaces:e,periods:t,runs_one:n,runs_other:r,page:i,hero:a,providerCard:o,timeline:s,quickVsExplore:c,models:l,scatter:u,topTickets:d,table:f,export:{summaryCsv:`摘要 CSV`,rawCsv:`原始 CSV`,summaryJson:`摘要 JSON`,rawJson:`原始 JSON`,downloading:`正在下载…`,noData:`当前筛选条件下无数据`,failed:`导出失败`},desktop:p};export{m as default,p as desktop,a as hero,l as models,i as page,t as periods,o as providerCard,c as quickVsExplore,n as runs_one,r as runs_other,u as scatter,e as surfaces,f as table,s as timeline,d as topTickets};
@@ -1 +0,0 @@
1
- var e={job:`Jobs`,quickSpec:`Quick`,exploreSpec:`Explore`,aiEdit:`Refinado`,smash:`SMASH`,fileSummary:`Resúmenes de archivo`},t={d7:`7d`,d30:`30d`,d90:`90d`,all:`Todo`,custom:`Personalizado`,startDate:`Fecha de inicio`,endDate:`Fecha de fin`,to:`a`},n=`{{count}} ejecución`,r=`{{count}} ejecuciones`,i={title:`Analíticas`,all:`Todo`,engine:`Motor`,ticketChip:`ticket #{{id}} · ✕`,failedToLoad:`Error al cargar: {{error}}`},a={spending:`Gasto`,vsPrev:`{{pct}}% vs anterior`,invocations_one:`{{count}} invocación`,invocations_other:`{{count}} invocaciones`,tokens:`· {{tokens}} tokens`,tokensTooltip:`Tokens totales = entrada nueva + salida + lectura de caché + creación de caché en todas las invocaciones de esta ventana.`,includesEstimated:`· incluye ~{{amount}} estimado`,includesEstimatedTooltip:`Incluye {{amount}} de coste estimado de proveedores sin campo de coste nativo (p. ej. codex mediante la tabla de precios local).`,trackingStarted:`Seguimiento iniciado el {{date}}`,trackingStartedFallback:`El seguimiento empieza con la primera invocación`,emptyState:`Aún no hay invocaciones para esta ventana de filtros.`,segmentTitle:`{{label}}: {{value}}`},o={title:`Por proveedor`,description:`Cómo se reparte el coste entre las CLI de IA de este proyecto. El prefijo <tilde>~</tilde> marca las filas cuyo coste se estima con la tabla de precios local (el proveedor no lo informa de forma nativa).`,noCost:`Aún no hay coste registrado en esta ventana.`,segmentTitle:`{{label}}: {{value}} ({{count}})`},s={title:`Cronología diaria`,subtitle:`apilada por superficie`,empty:`Sin gasto en este periodo.`},c={title:`Quick vs Explore`,quick:`Quick`,explore:`Explore`,sparseCta:`Prueba Explore para conseguir specs más completas`,runsSoFar_one:`{{count}} ejecución hasta ahora`,runsSoFar_other:`{{count}} ejecuciones hasta ahora`,perSpec:`por spec`,createdRuns:`<strong>{{created}}</strong> creadas · {{runs}} ejecuciones`,avgDuration:`{{duration}} de media`,ratio:`{{ratio}}× más por spec`},l={title:`Modelos`,empty:`No hay modelos registrados.`},u={title:`Coste vs turnos`,empty:`No hay invocaciones que representar.`,turnsLabel:`turnos`,costLabel:`coste`},d={title:`Tickets principales`,empty:`Sin actividad de tickets en este periodo.`,breakdownItem:`{{n}} {{label}}`,unattributed:`Sin atribuir`,deletedTicket:`ticket eliminado #{{id}}`},f={title:`Todas las invocaciones`,statusFilterAria:`Filtro de estado`,minCostFilterAria:`Filtro de coste mínimo`,minCostPlaceholder:`≥ $0.00`,allStatus:`Todos los estados`,success:`Éxito`,failed:`Fallido`,aborted:`Abortado`,empty:`Ninguna invocación coincide con los filtros actuales.`,colSurface:`Superficie`,colTicket:`Ticket`,colCost:`Coste`,colTurns:`Turnos`,colTokens:`Tokens`,colModel:`Modelo`,colStatus:`Estado`,colStarted:`Inicio`,contractLayer:`Contract Layer`,contractLayerRefinement:`Refinamiento de Contract Layer`,deleted:`(eliminado)`,provisionalTitleTooltip:`Título provisional de Explore — aún sin confirmar`,estimatedCostTooltip:`Estimado con la tabla de precios local — este proveedor no informa el coste de forma nativa.`,inferred:`inferido`,statusValue:{success:`éxito`,failed:`fallido`,aborted:`abortado`},truncated:`Mostrando las primeras {{shown}} de {{total}} filas coincidentes.`},p={title:`Analíticas de Desktop`,refreshAria:`Actualizar analíticas`,failedToLoad:`No se pudieron cargar las analíticas: {{error}}`,totalCost:`Coste total`,costToday:`{{value}} hoy`,totalJobs:`Jobs totales`,jobsToday:`{{n}} hoy`,successRate:`Tasa de éxito`,acrossAllProjects:`en todos los proyectos`,avgCostPerJob:`Coste medio / job`,periodAverage:`media del periodo`,costOverTime:`Coste entre proyectos a lo largo del tiempo`,noCostData:`Sin datos de coste para este periodo`,projectComparison:`Comparación de proyectos`,noProjects:`No hay proyectos registrados.`,jobsCount_one:`{{count}} job`,jobsCount_other:`{{count}} jobs`,successPct:`{{pct}}% de éxito`,costByProject:`Coste por proyecto`},m={surfaces:e,periods:t,runs_one:n,runs_other:r,page:i,hero:a,providerCard:o,timeline:s,quickVsExplore:c,models:l,scatter:u,topTickets:d,table:f,export:{summaryCsv:`CSV resumen`,rawCsv:`CSV en bruto`,summaryJson:`JSON resumen`,rawJson:`JSON en bruto`,downloading:`Descargando…`,noData:`Sin datos para los filtros actuales`,failed:`Error al exportar`},desktop:p};export{m as default,p as desktop,a as hero,l as models,i as page,t as periods,o as providerCard,c as quickVsExplore,n as runs_one,r as runs_other,u as scatter,e as surfaces,f as table,s as timeline,d as topTickets};