specrails-desktop 2.60.0 → 2.62.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 (190) hide show
  1. package/client/dist/assets/ActivityFeedPage-C_pqc281.js +1 -0
  2. package/client/dist/assets/{AgentBrowserCapture-D4a3wYM1.js → AgentBrowserCapture-vz6rbDtu.js} +1 -1
  3. package/client/dist/assets/AgentModeAnalyticsPane-BHCcUahS.js +2 -0
  4. package/client/dist/assets/AgentModeCodePane-DhmxgG3W.js +2 -0
  5. package/client/dist/assets/{AgentModeJobsPane-25tQlLpF.js → AgentModeJobsPane-99fBBLri.js} +1 -1
  6. package/client/dist/assets/{AgentsPage-CUDp_sfw.js → AgentsPage-CTwm_6T8.js} +3 -3
  7. package/client/dist/assets/{AnalyticsPage-DXWMGn8b.js → AnalyticsPage-YD8MLoPa.js} +1 -1
  8. package/client/dist/assets/CodePage-CLJn2F2e.js +3 -0
  9. package/client/dist/assets/{DesktopAnalyticsPage-BkFBq0E6.js → DesktopAnalyticsPage-MWGQVbwp.js} +1 -1
  10. package/client/dist/assets/{DocsDialog-BL7uSbIJ.js → DocsDialog-XUCYKoq0.js} +1 -1
  11. package/client/dist/assets/{DocsPage-CsDLbmZX.js → DocsPage-dOLC8bXA.js} +1 -1
  12. package/client/dist/assets/{ExportDropdown-B4Olg1Fk.js → ExportDropdown-BvKQgwM9.js} +1 -1
  13. package/client/dist/assets/InteractiveJobComposer-DxOvwmBF.js +19 -0
  14. package/client/dist/assets/{JobDetailModal-DS_Owxs6.js → JobDetailModal-CkiubrkZ.js} +1 -1
  15. package/client/dist/assets/JobDetailPage-CNe4Wn7l.js +1 -0
  16. package/client/dist/assets/JobsPage-DSts_L_d.js +1 -0
  17. package/client/dist/assets/LoopBuilderPage-C9D9eer5.js +1 -0
  18. package/client/dist/assets/{LoopPreviewModal-CH1r-KhU.js → LoopPreviewModal-Dv3dxHr_.js} +1 -1
  19. package/client/dist/assets/{LoopWindowSurface-CiZdI6aw.js → LoopWindowSurface-DN2lbSnL.js} +1 -1
  20. package/client/dist/assets/{LoopsPage-BwFujdGi.js → LoopsPage-DHgIreEW.js} +2 -2
  21. package/client/dist/assets/MinimizedChatsContext-Ds2-R6qJ.js +1 -0
  22. package/client/dist/assets/PluginsPage-D1EJ9oja.js +2 -0
  23. package/client/dist/assets/ProjectSettingsDialog-DKpa1wKk.js +1 -0
  24. package/client/dist/assets/{RepositoryDeliveries-NNorcGzT.js → RepositoryDeliveries-CW4eKG3x.js} +1 -1
  25. package/client/dist/assets/{RepositoryScopeSelector-D-jb4bI_.js → RepositoryScopeSelector-DrtPqvc_.js} +1 -1
  26. package/client/dist/assets/ReviewPacketPage-BtjPI0Cc.js +4 -0
  27. package/client/dist/assets/{TemplatePreviewModal-5CZdAZ0G.js → TemplatePreviewModal-DcFlhUxy.js} +1 -1
  28. package/client/dist/assets/TicketDetailModalContext-Dea22CI-.js +16 -0
  29. package/client/dist/assets/{Trans-wmTUDVyC.js → Trans-CAY2Rd2f.js} +1 -1
  30. package/client/dist/assets/agent-5bSixVzz.js +1 -0
  31. package/client/dist/assets/agent-BR4EHfhq.js +1 -0
  32. package/client/dist/assets/agent-C0IKkJP8.js +1 -0
  33. package/client/dist/assets/agent-C7li9ayC.js +1 -0
  34. package/client/dist/assets/agent-D0dRmEen.js +1 -0
  35. package/client/dist/assets/{agent-BjttZLIl.js → agent-DZVGHm7H.js} +1 -1
  36. package/client/dist/assets/agent-Dip4h2YE.js +1 -0
  37. package/client/dist/assets/agent-Pp-P-n1p.js +1 -0
  38. package/client/dist/assets/agentRuntime-B-myNBUP.js +1 -0
  39. package/client/dist/assets/agentRuntime-Bjt7Ij6_.js +1 -0
  40. package/client/dist/assets/agentRuntime-C_yLPKDy.js +1 -0
  41. package/client/dist/assets/agentRuntime-D2kYQqNO.js +1 -0
  42. package/client/dist/assets/agentRuntime-DvhEe1um.js +1 -0
  43. package/client/dist/assets/agentRuntime-DxC6-9rN.js +1 -0
  44. package/client/dist/assets/agentRuntime-TKQyg137.js +1 -0
  45. package/client/dist/assets/agentRuntime-WSv8G0pW.js +1 -0
  46. package/client/dist/assets/ban-E4EaZe3a.js +1 -0
  47. package/client/dist/assets/chevron-up-CwGUHd6D.js +1 -0
  48. package/client/dist/assets/dist-Bq10nS2m.js +1 -0
  49. package/client/dist/assets/{formatDistanceToNow-Dax4zqPF.js → formatDistanceToNow-DlQY1Lm_.js} +1 -1
  50. package/client/dist/assets/{getTimezoneOffsetInMilliseconds-dpIo42JZ.js → getTimezoneOffsetInMilliseconds-COUeq65G.js} +1 -1
  51. package/client/dist/assets/index-BacrO_ub.css +2 -0
  52. package/client/dist/assets/index-CONHvEJw.js +83 -0
  53. package/client/dist/assets/{jira-api-CLrIvXFm.js → jira-api-C94VNHNY.js} +1 -1
  54. package/client/dist/assets/layers-eDMjG41I.js +1 -0
  55. package/client/dist/assets/{loops-Cm55CXJ4.js → loops-B2PhQLKR.js} +1 -1
  56. package/client/dist/assets/{loops-3IutojWt.js → loops-BqbF46st.js} +1 -1
  57. package/client/dist/assets/{loops-BAosWtXE.js → loops-CINnHbfI.js} +1 -1
  58. package/client/dist/assets/{loops-kIJJkaxf.js → loops-D-3XhH04.js} +1 -1
  59. package/client/dist/assets/{loops-DHQtnfze.js → loops-DKkEEjZ_.js} +1 -1
  60. package/client/dist/assets/{loops-D7tL_Saw.js → loops-DzWR5-v6.js} +1 -1
  61. package/client/dist/assets/{loops--KWr0X-w.js → loops-WyWDkhok.js} +1 -1
  62. package/client/dist/assets/{loops-BISDssL5.js → loops-scD5fIBf.js} +1 -1
  63. package/client/dist/assets/{narration-DvLQBW9U.js → narration-BEKMVxGm.js} +1 -1
  64. package/client/dist/assets/{narration-CHI06czm.js → narration-CjLwGKap.js} +1 -1
  65. package/client/dist/assets/{narration-DjKB3pQZ.js → narration-DANWuGsW.js} +1 -1
  66. package/client/dist/assets/{narration-eSx3gR0W.js → narration-DGeEDWiT.js} +1 -1
  67. package/client/dist/assets/{narration-DtCYvRLM.js → narration-DJgpGwIP.js} +1 -1
  68. package/client/dist/assets/{narration-n3hOA7LY.js → narration-DbHnz0qV.js} +1 -1
  69. package/client/dist/assets/{narration-thJOeT2-.js → narration-bZSsTZG8.js} +1 -1
  70. package/client/dist/assets/{narration--hUhjM5v.js → narration-i6aKJKEc.js} +1 -1
  71. package/client/dist/assets/{project-repositories-BkyT8AjU.js → project-repositories-Cc3oNv8X.js} +1 -1
  72. package/client/dist/assets/save-B6wGWwBR.js +1 -0
  73. package/client/dist/assets/{settings-Dn-pXukr.js → settings-BKJZ2KEM.js} +1 -1
  74. package/client/dist/assets/{settings-BBj_kZaD.js → settings-BV3jocIx.js} +1 -1
  75. package/client/dist/assets/{settings-COlH_P33.js → settings-BjM2Dw8_.js} +1 -1
  76. package/client/dist/assets/settings-CKu0LTib.js +1 -0
  77. package/client/dist/assets/{settings-D77mC_Lb.js → settings-DA77M48m.js} +1 -1
  78. package/client/dist/assets/{settings-ByVE7jdZ.js → settings-LfFnl1UH.js} +1 -1
  79. package/client/dist/assets/{settings-DZKy7MqN.js → settings-P1IQvhnL.js} +1 -1
  80. package/client/dist/assets/{settings-B5Hy_Kol.js → settings-eIMJjyK_.js} +1 -1
  81. package/client/dist/assets/{spending-Oov7p52A.js → spending-DemeFfrH.js} +1 -1
  82. package/client/dist/assets/{useDesktop-DpiS8Uov.js → useDesktop-9Lwoel_8.js} +1 -1
  83. package/client/dist/assets/{useRuntimeRuns-DBm1mul0.js → useRuntimeRuns-DL0xYoZ2.js} +1 -1
  84. package/client/dist/assets/{useSharedWebSocket-BZxKaVNT.js → useSharedWebSocket-BEHPeU1Y.js} +2 -2
  85. package/client/dist/assets/zap-CHo3aCD1.js +1 -0
  86. package/client/dist/index.html +26 -22
  87. package/docs/guide/de/integrations/6-agent-chat.md +11 -0
  88. package/docs/guide/en/integrations/6-agent-chat.md +11 -0
  89. package/docs/guide/es/integrations/6-agent-chat.md +11 -0
  90. package/docs/guide/fr/integrations/6-agent-chat.md +11 -0
  91. package/docs/guide/it/integrations/6-agent-chat.md +11 -0
  92. package/docs/guide/ja/integrations/6-agent-chat.md +11 -0
  93. package/docs/guide/pt/integrations/6-agent-chat.md +11 -0
  94. package/docs/guide/zh/integrations/6-agent-chat.md +11 -0
  95. package/docs/internals/README.md +1 -0
  96. package/docs/internals/agent-sessions.md +157 -0
  97. package/docs/internals/api-reference.md +33 -4
  98. package/docs/internals/configuration.md +36 -0
  99. package/docs/internals/core-runtime-updates.md +10 -3
  100. package/docs/internals/operations-runbook.md +11 -0
  101. package/docs/internals/programmatic-agent-runtime.md +2 -0
  102. package/docs/internals/source-map.md +40 -1
  103. package/mcp-bridge/dist/specrails-mcp.js +82 -15
  104. package/package.json +1 -1
  105. package/server/dist/agent-mcp-config.js +41 -0
  106. package/server/dist/core-compat.js +2 -0
  107. package/server/dist/desktop-db.js +101 -4
  108. package/server/dist/desktop-router.js +31 -2
  109. package/server/dist/index.js +58 -0
  110. package/server/dist/mcp/tools/app-settings.js +11 -0
  111. package/server/dist/mcp/tools/mission.js +45 -2
  112. package/server/dist/mcp/tools/specs.js +2 -2
  113. package/server/dist/modules/accounting/runtime/result-event.js +9 -1
  114. package/server/dist/modules/agent-runtime/runtime/agent-runtime-bridge.js +12 -0
  115. package/server/dist/modules/agent-runtime/runtime/agent-runtime-controls.js +25 -0
  116. package/server/dist/modules/agent-runtime/runtime/agent-runtime-effective-config.js +2 -0
  117. package/server/dist/modules/agent-runtime/runtime/agent-runtime-settings-router.js +6 -2
  118. package/server/dist/modules/agent-runtime/runtime/agent-runtime-settings.js +18 -6
  119. package/server/dist/modules/agent-sessions/adapters/host-process.js +73 -0
  120. package/server/dist/modules/agent-sessions/adapters/http.js +31 -0
  121. package/server/dist/modules/agent-sessions/adapters/rpc-client.js +147 -0
  122. package/server/dist/modules/agent-sessions/application/session-event-pump.js +99 -0
  123. package/server/dist/modules/agent-sessions/domain/availability.js +25 -0
  124. package/server/dist/modules/agent-sessions/domain/errors.js +23 -0
  125. package/server/dist/modules/agent-sessions/domain/host-state.js +80 -0
  126. package/server/dist/modules/agent-sessions/domain/projection.js +147 -0
  127. package/server/dist/modules/agent-sessions/domain/protocol.js +59 -0
  128. package/server/dist/modules/agent-sessions/domain/subagent-policy.js +34 -0
  129. package/server/dist/modules/agent-sessions/index.js +31 -0
  130. package/server/dist/modules/agent-sessions/ports.js +2 -0
  131. package/server/dist/modules/agent-sessions/runtime/core-sessions-availability.js +43 -0
  132. package/server/dist/modules/agent-sessions/runtime/session-host-registry.js +226 -0
  133. package/server/dist/modules/agents/runtime/agent-store.js +3 -1
  134. package/server/dist/modules/loops/runtime/loop-core-factory.js +2 -2
  135. package/server/dist/modules/loops/runtime/loop-definition.js +1 -0
  136. package/server/dist/modules/loops/runtime/loop-factory.js +1 -1
  137. package/server/dist/modules/loops/runtime/loop-graph.js +8 -1
  138. package/server/dist/modules/loops/runtime/loop-implement-recipe.js +41 -11
  139. package/server/dist/modules/loops/runtime/loop-run-manager.js +4 -0
  140. package/server/dist/modules/loops/runtime/loop-templates.js +3 -3
  141. package/server/dist/modules/missions/runtime/agent-chat-manager.js +137 -40
  142. package/server/dist/modules/missions/runtime/agent-chat-router.js +68 -0
  143. package/server/dist/modules/missions/runtime/agent-operator-prompt.js +8 -9
  144. package/server/dist/modules/missions/runtime/agent-session-store.js +133 -0
  145. package/server/dist/modules/missions/runtime/core-session-runner.js +204 -0
  146. package/server/dist/modules/missions/runtime/mission-core-sessions.js +286 -0
  147. package/server/dist/modules/missions/runtime/mission-session-projector.js +168 -0
  148. package/server/dist/modules/project-settings/adapters/http.js +14 -2
  149. package/server/dist/modules/project-settings/adapters/sqlite.js +30 -2
  150. package/server/dist/modules/project-settings/domain.js +24 -0
  151. package/server/dist/modules/project-settings/index.js +2 -1
  152. package/server/dist/modules/specs/runtime/spec-models.js +1 -1
  153. package/server/dist/plugins/codex-spawn.js +15 -7
  154. package/server/dist/project-registry.js +32 -0
  155. package/server/dist/project-router-settings.js +7 -1
  156. package/server/dist/providers/claude-adapter.js +6 -1
  157. package/server/dist/schemas/agent-runtime.schema.json +9 -7
  158. package/client/dist/assets/ActivityFeedPage-3J7fR8yB.js +0 -1
  159. package/client/dist/assets/AgentModeAnalyticsPane-Dps30tk9.js +0 -2
  160. package/client/dist/assets/AgentModeCodePane-CvLimey8.js +0 -2
  161. package/client/dist/assets/CodePage-D981zRHy.js +0 -3
  162. package/client/dist/assets/InteractiveJobComposer-Z6fl4791.js +0 -19
  163. package/client/dist/assets/JobDetailPage-1TUQ9vlE.js +0 -1
  164. package/client/dist/assets/JobsPage-BSrl8P7u.js +0 -1
  165. package/client/dist/assets/LoopBuilderPage-Dh5uk2Qy.js +0 -1
  166. package/client/dist/assets/MinimizedChatsContext-BD2bsRBe.js +0 -1
  167. package/client/dist/assets/PluginsPage-B8f49Mvn.js +0 -2
  168. package/client/dist/assets/ProjectSettingsDialog-D7q-O6h3.js +0 -1
  169. package/client/dist/assets/ReviewPacketPage-DpZSzF-Q.js +0 -4
  170. package/client/dist/assets/TicketDetailModalContext-BHmtj1As.js +0 -16
  171. package/client/dist/assets/agent--8QAfoXL.js +0 -1
  172. package/client/dist/assets/agent-3HxXkIWX.js +0 -1
  173. package/client/dist/assets/agent-CpFCz32T.js +0 -1
  174. package/client/dist/assets/agent-DVnw6ybO.js +0 -1
  175. package/client/dist/assets/agent-Z5s_GTP0.js +0 -1
  176. package/client/dist/assets/agent-hv57-zyG.js +0 -1
  177. package/client/dist/assets/agent-xGrZ_aN1.js +0 -1
  178. package/client/dist/assets/agentRuntime-7Ydcvr6P.js +0 -1
  179. package/client/dist/assets/agentRuntime-BHVw9orA.js +0 -1
  180. package/client/dist/assets/agentRuntime-DCPDaQcV.js +0 -1
  181. package/client/dist/assets/agentRuntime-DKTw4Ajg.js +0 -1
  182. package/client/dist/assets/agentRuntime-DVhij_i_.js +0 -1
  183. package/client/dist/assets/agentRuntime-Doss-T8o.js +0 -1
  184. package/client/dist/assets/agentRuntime-eZSMUlkM.js +0 -1
  185. package/client/dist/assets/agentRuntime-qSSU7fQk.js +0 -1
  186. package/client/dist/assets/index-Bfunvi6w.css +0 -2
  187. package/client/dist/assets/index-g8S62tpS.js +0 -83
  188. package/client/dist/assets/save-OsUqVn99.js +0 -1
  189. package/client/dist/assets/settings-Dbyd6gmj.js +0 -1
  190. package/client/dist/assets/zap-CUOlvtT1.js +0 -1
@@ -1,16 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-B3mKBIh5.js","assets/rolldown-runtime-CNC7AqOf.js","assets/event-Bt7f3wXe.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-zu2_FqZY.js";import{t as r}from"./react-dom-DiWzBDP9.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{u as a}from"./chunk-KS7C4IRE-DEKu087k.js";import{n as o,t as s}from"./tauri-shell-DE6LfGPw.js";import{D as c,E as l,a as u,h as d,l as f,m as p,r as m,w as h,x as g}from"./useSharedWebSocket-BZxKaVNT.js";import{t as _}from"./Trans-wmTUDVyC.js";import{n as v,t as y}from"./createLucideIcon-Bjbbp_KS.js";import{a as b,r as x,s as S}from"./useDesktop-DpiS8Uov.js";import{a as C}from"./provider-capabilities-lePfeT_Y.js";import{r as w,t as T}from"./save-OsUqVn99.js";import{n as E,r as D}from"./spending-Oov7p52A.js";import{l as O,n as k,u as A}from"./MinimizedChatsContext-BD2bsRBe.js";import{n as j,t as M}from"./zap-CUOlvtT1.js";import{t as N}from"./file-text-BcLCfcWZ.js";import{t as ee}from"./circle-x-CMYsN4ZH.js";import{t as P}from"./download-CFHyyHcw.js";import{t as te}from"./external-link-D6XxC_Cu.js";import{t as F}from"./git-branch-BRM0F5GN.js";import{t as ne}from"./loader-circle-DcygOQpC.js";import{t as I}from"./pencil-C9RkrIPZ.js";import{n as L,t as R}from"./square-Ci-PFcFe.js";import{t as z}from"./plus-CsnjfkmX.js";import{t as B}from"./rotate-ccw-Wh4id13q.js";import{t as re}from"./search-Cq_gE3Ik.js";import{t as ie}from"./trash-2-BOU3WdZZ.js";import{t as V}from"./triangle-alert-H9T4jAmh.js";import{n as ae,t as oe}from"./jira-api-CLrIvXFm.js";import{t as se}from"./x-CBMI9ejn.js";import{F as ce,I as le,P as ue,a as de,i as fe,l as pe,o as me,r as he,t as ge}from"./dialog-CMgps2MY.js";import{t as H}from"./utils-BC4DHlz2.js";import{n as _e,t as U}from"./lib-CGdyxIWg.js";import{t as W}from"./formatDistanceToNow-Dax4zqPF.js";import{t as G}from"./button-D1xExSTF.js";import{t as ve}from"./RepositoryScopeSelector-D-jb4bI_.js";function ye(e=``){return e||(typeof window<`u`&&(`__TAURI_INTERNALS__`in window||window.location.hostname===`tauri.localhost`)||typeof window<`u`&&window.location.protocol!==`http:`&&window.location.protocol!==`https:`?`ws://127.0.0.1:4200`:`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}`)}var be=ye(),xe=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_TERMINAL_PANEL;return typeof e!=`string`||e!==`false`})(),Se=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_AGENTS_SECTION;return typeof e!=`string`||e!==`false`})(),Ce=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_CODE_EXPLORER;return typeof e!=`string`||e!==`false`})(),we=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_JIRA;return typeof e!=`string`||e!==`false`})(),Te=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_MCP;return typeof e!=`string`||e!==`false`})(),Ee=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_AGENT_CHAT;return typeof e!=`string`||e!==`false`})(),De=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_AGENT_MODE;return Ee&&(typeof e!=`string`||e!==`false`)})();(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_INTERACTIVE_JOBS;return typeof e!=`string`||e!==`false`})();var Oe=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_LOOPS_SECTION;return typeof e!=`string`||e!==`false`})(),ke=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_NATIVE_BROWSER;return typeof e!=`string`||e!==`false`})(),Ae=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_PROJECT_BUILDER;return typeof e!=`string`||e!==`false`})(),je=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_REVIEW_PACKET;return typeof e!=`string`||e!==`false`})(),Me=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_NARRATED_PROGRESS;return typeof e!=`string`||e!==`false`})(),Ne=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_LOCAL_ENGINES;return typeof e!=`string`||e!==`false`})();function Pe(){return Ne}var Fe=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_MISSION_RAIL_CARDS;return typeof e!=`string`||e!==`false`})(),Ie=y(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Le=y(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Re=y(`circle-arrow-right`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m12 16 4-4-4-4`,key:`1i9zcv`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),ze=y(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Be=y(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Ve=y(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),K=y(`droplet`,[[`path`,{d:`M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z`,key:`c7niix`}]]),He=y(`file-minus-corner`,[[`path`,{d:`M20 14V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12`,key:`l9p8hp`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),Ue=y(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),We=y(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),Ge=y(`git-pull-request-arrow`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M5 9v12`,key:`ih889a`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}]]),Ke=y(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),qe=y(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Je=y(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),Ye=y(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Xe=y(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),Ze=y(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Qe=y(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),$e=y(`redo-2`,[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]),et=y(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),q=y(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),tt=y(`split`,[[`path`,{d:`M16 3h5v5`,key:`1806ms`}],[`path`,{d:`M8 3H3v5`,key:`15dfkv`}],[`path`,{d:`M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3`,key:`1qrqzj`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}]]),nt=y(`ticket`,[[`path`,{d:`M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z`,key:`qn84l0`}],[`path`,{d:`M13 5v2`,key:`dyzc3o`}],[`path`,{d:`M13 17v2`,key:`1ont0d`}],[`path`,{d:`M13 11v2`,key:`1wjjxi`}]]),rt=y(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),it=y(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),J=y(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),at=y(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),ot=new Map,st=2e3;function ct(e){ot.set(e,(ot.get(e)??0)+1)}function lt(e){(ot.get(e)??0)<=0||setTimeout(()=>{let t=(ot.get(e)??0)-1;t<=0?ot.delete(e):ot.set(e,t)},st)}function ut(e){return e?(ot.get(e)??0)>0:!1}var Y=e(t(),1),dt=3e3,ft=`
3
-
4
- ---
5
-
6
- ## Contract Layer
7
-
8
- `;function pt(e){return`${f}/api/projects/${encodeURIComponent(e)}`}function mt(e,t){return JSON.stringify(e)===JSON.stringify(t)}function ht(e,t){let n=new Map(e.map(e=>[e.id,e])),r=t.map(e=>{let t=n.get(e.id);return t&&mt(t,e)?t:e});return r.length===e.length&&r.every((t,n)=>t===e[n])?e:r}function gt(){let{t:e}=v(`tickets`),{activeProjectId:t}=x(),[n,r]=(0,Y.useState)([]),[i,a]=(0,Y.useState)(!1),[o,s]=(0,Y.useState)(null),[c,l]=(0,Y.useState)(new Set),[u,d]=(0,Y.useState)(new Set),f=(0,Y.useRef)(t);f.current=t;let p=(0,Y.useRef)(0),h=(0,Y.useRef)(null),g=(0,Y.useRef)(new Set),{registerHandler:_,unregisterHandler:y,connectionStatus:b}=m(),C=(0,Y.useId)(),w=(0,Y.useCallback)(async(e,t)=>{let n=pt(e),r=await fetch(`${n}/tickets`,{signal:t,cache:`no-store`});if(!r.ok)throw Error(`Failed to fetch tickets: ${r.status}`);let i=await r.json();return Array.isArray(i)?i:i.tickets??[]},[]),T=(0,Y.useCallback)(async(t,n)=>{let i=++p.current;h.current?.abort();let o=new AbortController;h.current=o,f.current===t&&(a(!0),s(null));try{let a=await w(t,o.signal);if(o.signal.aborted||i!==p.current||f.current!==t)return;let s=g.current,c=new Set;if(n===`merge`)for(let e of a)s.size>0&&!s.has(e.id)&&c.add(e.id);g.current=new Set(a.map(e=>e.id)),r(n===`replace`?a:e=>ht(e,a)),c.size>0&&s.size>0&&(l(c),S.success(e(`toasts.newTicketsAdded`,{count:c.size}),{id:`tickets-added-${t}`}),setTimeout(()=>{f.current===t&&l(e=>{let t=new Set(e);for(let e of c)t.delete(e);return t})},dt))}catch(e){if(o.signal.aborted||i!==p.current||f.current!==t)return;s(e instanceof Error?e.message:String(e))}finally{i===p.current&&(h.current===o&&(h.current=null),f.current===t&&a(!1))}},[w,e]),E=(0,Y.useCallback)(async()=>{t&&await T(t,`merge`)},[t,T]);(0,Y.useEffect)(()=>{if(p.current+=1,h.current?.abort(),h.current=null,r([]),a(!1),s(null),g.current=new Set,l(new Set),d(new Set),t)return T(t,`replace`),()=>{p.current+=1,h.current?.abort(),h.current=null}},[t,T]);let D=(0,Y.useCallback)(t=>{let n=t;if(!n||typeof n.type!=`string`)return;let i=f.current;if(!(n.projectId&&n.projectId!==i))switch(n.type){case`desktop.project_recovered`:n.projectId===i&&E();break;case`mcp.activity`:n.affectedProjectId&&n.affectedProjectId===i&&E();break;case`ticket_created`:{if(!n.ticket)break;let t=n.ticket;r(e=>e.some(e=>e.id===t.id)?e:[...e,t]),g.current.add(t.id),l(e=>new Set([...e,t.id])),ut(i)||S.success(e(`toasts.newTicket`,{title:t.title}),{id:`new-ticket-${t.id}`}),setTimeout(()=>{l(e=>{let n=new Set(e);return n.delete(t.id),n})},dt);break}case`ticket_updated`:{if(!n.ticket)break;if(n.ticket.id===0){E();break}let e=n.ticket;r(t=>t.map(t=>t.id===e.id?e:t)),typeof e.description==`string`&&e.description.includes(ft)&&d(t=>{if(!t.has(e.id))return t;let n=new Set(t);return n.delete(e.id),n});break}case`ticket_deleted`:{if(n.ticketId==null)break;let e=n.ticketId;r(t=>t.filter(t=>t.id!==e)),g.current.delete(e);break}case`explore.contract_refine_started`:if(n.ticketId==null)break;d(e=>new Set([...e,n.ticketId]));break;case`explore.contract_refine_failed`:{if(n.ticketId==null)break;let e=n.ticketId;d(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n});break}}},[E,e]);(0,Y.useLayoutEffect)(()=>(_(`tickets-${C}`,D),()=>y(`tickets-${C}`)),[D,_,y,C]);let O=(0,Y.useRef)(b);return(0,Y.useEffect)(()=>{O.current!==`connected`&&b===`connected`&&f.current&&E(),O.current=b},[b,E]),{tickets:n,loading:i,isLoading:i,error:o,newTicketIds:c,contractRefiningIds:u,refetch:E,refresh:E,deleteTicket:(0,Y.useCallback)(async e=>{let n=t;if(!n)return!1;try{let t=await fetch(`${pt(n)}/tickets/${e}`,{method:`DELETE`});return t.ok&&f.current===n&&await T(n,`merge`),t.ok}catch{return!1}},[t,T]),updateTicketStatus:(0,Y.useCallback)(async(e,n)=>{let r=t;if(!r)return!1;try{let t=await fetch(`${pt(r)}/tickets/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({status:n})});return t.ok&&f.current===r&&await T(r,`merge`),t.ok}catch{return!1}},[t,T]),updateTicketPriority:(0,Y.useCallback)(async(e,n)=>{let r=t;if(!r)return!1;try{let t=await fetch(`${pt(r)}/tickets/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({priority:n})});return t.ok&&f.current===r&&await T(r,`merge`),t.ok}catch{return!1}},[t,T]),createTicket:(0,Y.useCallback)(async e=>{let n=t;if(!n)return!1;try{let t=await fetch(`${pt(n)}/tickets`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});return t.ok&&f.current===n&&await T(n,`merge`),t.ok}catch{return!1}},[t,T]),updateTicket:(0,Y.useCallback)(async(e,n)=>{let r=t;if(!r)return!1;try{let t=await fetch(`${pt(r)}/tickets/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)});return t.ok&&f.current===r&&await T(r,`merge`),t.ok}catch{return!1}},[t,T])}}function _t(e,t){let n=()=>h(t?.in,NaN),r=t?.additionalDigits??2,i=St(e),a;if(i.date){let e=Ct(i.date,r);a=wt(e.restDateString,e.year)}if(!a||isNaN(+a))return n();let o=+a,s=0,c;if(i.time&&(s=Et(i.time),isNaN(s)))return n();if(i.timezone){if(c=Ot(i.timezone),isNaN(c))return n()}else{let e=new Date(o+s),n=g(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return g(o+s+c,t?.in)}var vt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},yt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,bt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,xt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function St(e){let t={},n=e.split(vt.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],vt.timeZoneDelimiter.test(t.date)&&(t.date=e.split(vt.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){let e=vt.timezone.exec(r);e?(t.time=r.replace(e[1],``),t.timezone=e[1]):t.time=r}return t}function Ct(e,t){let n=RegExp(`^(?:(\\d{4}|[+-]\\d{`+(4+t)+`})|(\\d{2}|[+-]\\d{`+(2+t)+`})$)`),r=e.match(n);if(!r)return{year:NaN,restDateString:``};let i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((r[1]||r[2]).length)}}function wt(e,t){if(t===null)return new Date(NaN);let n=e.match(yt);if(!n)return new Date(NaN);let r=!!n[4],i=Tt(n[1]),a=Tt(n[2])-1,o=Tt(n[3]),s=Tt(n[4]),c=Tt(n[5])-1;if(r)return Pt(t,s,c)?kt(t,s,c):new Date(NaN);{let e=new Date(0);return!Mt(t,a,o)||!Nt(t,i)?new Date(NaN):(e.setUTCFullYear(t,a,Math.max(i,o)),e)}}function Tt(e){return e?parseInt(e):1}function Et(e){let t=e.match(bt);if(!t)return NaN;let n=Dt(t[1]),r=Dt(t[2]),i=Dt(t[3]);return Ft(n,r,i)?n*l+r*c+i*1e3:NaN}function Dt(e){return e&&parseFloat(e.replace(`,`,`.`))||0}function Ot(e){if(e===`Z`)return 0;let t=e.match(xt);if(!t)return 0;let n=t[1]===`+`?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return It(r,i)?n*(r*l+i*c):NaN}function kt(e,t,n){let r=new Date(0);r.setUTCFullYear(e,0,4);let i=r.getUTCDay()||7,a=(t-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var At=[31,null,31,30,31,30,31,31,30,31,30,31];function jt(e){return e%400==0||e%4==0&&e%100!=0}function Mt(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(At[t]||(jt(e)?29:28))}function Nt(e,t){return t>=1&&t<=(jt(e)?366:365)}function Pt(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Ft(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function It(e,t){return t>=0&&t<=59}async function Lt(e,t,n){let r=new FormData;r.append(`file`,t);let i=await fetch(`${b()}/tickets/${e}/attachments`,{method:`POST`,body:r,signal:n});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e.error??d.t(`attachments:errors.uploadFailed`,{status:i.status}))}return(await i.json()).attachment}async function Rt(e,t){let n=await fetch(`${b()}/tickets/${e}/attachments/${t}`,{method:`DELETE`});if(!n.ok&&n.status!==404)throw Error(d.t(`attachments:errors.deleteFailed`,{status:n.status}))}async function zt(e){let t=await fetch(`${b()}/tickets/${e}/attachments`,{method:`DELETE`});if(!t.ok&&t.status!==404)throw Error(d.t(`attachments:errors.bulkDeleteFailed`,{status:t.status}))}async function Bt(e){let t=await fetch(`${b()}/tickets/${e}/attachments`);if(!t.ok)throw Error(d.t(`attachments:errors.listFailed`,{status:t.status}));return(await t.json()).attachments}function Vt(e,t){return`${b()}/tickets/${e}/attachments/${t}`}async function Ht(e,t){let n=await fetch(Vt(e,t));if(!n.ok)throw Error(d.t(`attachments:errors.fetchFailed`,{status:n.status}));return n.blob()}var Ut=`image/jpeg,image/png,image/gif,image/webp,application/pdf,text/csv,text/plain,application/json,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,application/sql,application/x-sql,text/sql,text/x-sql,.sql`,Wt=new Set(Ut.split(`,`).filter(e=>!e.startsWith(`.`))),Gt=/\.sql$/i,Kt=/\.(png|jpe?g|gif|webp)$/i;function qt(e){return Wt.has(e.type)||Gt.test(e.name)||Kt.test(e.name)}var X=n();function Jt({ticketKey:e,attachment:t,onClose:n}){let{t:r}=v(`attachments`),[i,a]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null);if((0,Y.useEffect)(()=>{if(!t)return;function e(e){e.key===`Escape`&&n()}document.addEventListener(`keydown`,e);let r=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.removeEventListener(`keydown`,e),document.body.style.overflow=r}},[t,n]),(0,Y.useEffect)(()=>{if(!t){a(null),s(null);return}let n=!1;return a(null),s(null),Ht(e,t.id).then(e=>{n||a(URL.createObjectURL(e))}).catch(e=>{n||s(e instanceof Error?e.message:r(`errors.loadFailed`))}),()=>{n=!0}},[t,e]),(0,Y.useEffect)(()=>()=>{i&&URL.revokeObjectURL(i)},[i]),!t)return null;let c=t.mimeType.startsWith(`image/`),l=t.mimeType===`application/pdf`;return(0,X.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":r(`lightbox.preview`,{name:t.filename}),className:`fixed inset-0 z-[100] flex flex-col bg-black/85 backdrop-blur-sm animate-in fade-in-0 duration-200`,onClick:n,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-white/10 bg-black/40`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`button`,{type:`button`,onClick:n,"aria-label":r(`lightbox.backToDesktop`),className:`inline-flex items-center gap-2 px-3 py-1.5 rounded-md text-sm text-white/85 hover:bg-white/10 hover:text-white transition-colors`,children:[(0,X.jsx)(w,{className:`w-4 h-4`}),r(`common:actions.back`)]}),(0,X.jsxs)(`div`,{className:`flex-1 text-center min-w-0 px-4`,children:[(0,X.jsx)(`div`,{className:`text-sm font-medium text-white/95 truncate`,children:t.filename}),(0,X.jsx)(`div`,{className:`text-[11px] text-white/50`,children:t.mimeType})]}),(0,X.jsxs)(`a`,{href:i??`#`,download:t.filename,onClick:e=>{e.stopPropagation(),i||e.preventDefault()},className:`inline-flex items-center gap-2 px-3 py-1.5 rounded-md text-sm text-white/85 hover:bg-white/10 hover:text-white transition-colors`,"aria-label":r(`lightbox.download`),children:[(0,X.jsx)(P,{className:`w-4 h-4`}),r(`lightbox.download`)]})]}),(0,X.jsx)(`div`,{className:H(`flex-1 flex items-center justify-center overflow-auto p-6`),onClick:n,children:o?(0,X.jsx)(`div`,{onClick:e=>e.stopPropagation(),className:`text-center text-white/80 px-8 py-10 rounded-lg bg-white/5 border border-white/10`,children:(0,X.jsx)(`p`,{className:`text-sm`,children:r(`lightbox.loadError`,{error:o})})}):i?c?(0,X.jsx)(`img`,{src:i,alt:t.filename,onClick:e=>e.stopPropagation(),className:`max-h-full max-w-full rounded-lg shadow-2xl animate-in zoom-in-95 duration-200`}):l?(0,X.jsx)(`iframe`,{src:i,title:t.filename,onClick:e=>e.stopPropagation(),className:`w-full h-full max-w-5xl bg-white rounded-lg shadow-2xl`}):(0,X.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`text-center text-white/80 px-8 py-10 rounded-lg bg-white/5 border border-white/10`,children:[(0,X.jsx)(`p`,{className:`text-sm mb-3`,children:r(`lightbox.previewUnavailable`)}),(0,X.jsxs)(`a`,{href:i,download:t.filename,className:`inline-flex items-center gap-2 px-4 py-2 rounded-md bg-white/10 hover:bg-white/20 text-white transition-colors`,children:[(0,X.jsx)(P,{className:`w-4 h-4`}),r(`lightbox.downloadFile`,{name:t.filename})]})]}):(0,X.jsx)(`div`,{onClick:e=>e.stopPropagation(),className:`text-center text-white/70 px-8 py-10 rounded-lg bg-white/5 border border-white/10`,children:(0,X.jsx)(`p`,{className:`text-sm`,children:r(`lightbox.loading`)})})})]})}function Yt(e,t){let n=new Set,r=[];for(let i of[...e,...t])n.has(i.id)||(n.add(i.id),r.push(i));return r}function Xt(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Zt(e){return e.startsWith(`image/`)?`🖼`:e===`application/pdf`?`📄`:e===`text/csv`||e.includes(`spreadsheetml`)||e===`application/vnd.ms-excel`?`📊`:e===`application/json`?`{ }`:e===`text/plain`||e.includes(`sql`)?`📝`:`📎`}function Qt(e){try{return new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}catch{return e}}function $t({ticketKey:e,attachments:t,onChange:n,className:r}){let{t:i}=v(`attachments`),[a,o]=(0,Y.useState)(new Set),[s,c]=(0,Y.useState)(null),[l,u]=(0,Y.useState)(null);if((0,Y.useEffect)(()=>{let r=!1;return Bt(e).then(e=>{if(r)return;let i=Yt(t,e);i.length!==t.length&&n?.(i)}).catch(()=>{}),()=>{r=!0}},[e]),!t||t.length===0)return null;let d=[...t].sort((e,t)=>e.addedAt<t.addedAt?1:-1);async function f(r){c(null),o(e=>{let t=new Set(e);return t.add(r.id),t});try{await Rt(e,r.id),await new Promise(e=>setTimeout(e,160)),n?.(t.filter(e=>e.id!==r.id))}catch(e){c(e instanceof Error?e.message:i(`errors.removeFailed`)),o(e=>{let t=new Set(e);return t.delete(r.id),t})}}return(0,X.jsxs)(`section`,{className:H(`mt-4`,r),"aria-label":i(`section.ariaLabel`),children:[(0,X.jsxs)(`header`,{className:`flex items-center justify-between mb-2`,children:[(0,X.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:i(`section.title`)}),(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:i(`section.fileCount`,{count:d.length})})]}),(0,X.jsx)(`ul`,{className:`flex flex-col gap-1`,children:d.map(e=>{let t=a.has(e.id);return(0,X.jsxs)(`li`,{className:H(`flex items-center gap-3 px-2.5 py-2 rounded-md border border-border bg-card/60 hover:bg-card transition-all duration-200`,t&&`opacity-0 scale-95 max-h-0 py-0 border-transparent overflow-hidden`),children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`w-6 text-center text-sm shrink-0`,children:Zt(e.mimeType)}),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>u(e),className:`flex-1 min-w-0 flex flex-col text-sm text-left hover:text-primary transition-colors`,children:[(0,X.jsx)(`span`,{className:`font-medium truncate text-foreground`,children:e.filename}),(0,X.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[Xt(e.size),` · `,Qt(e.addedAt)]})]}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>u(e),className:`text-[11px] text-primary hover:underline shrink-0`,children:i(`common:actions.open`)}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>f(e),"aria-label":i(`removeFile`,{name:e.filename}),disabled:t,className:`w-6 h-6 inline-flex items-center justify-center rounded text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors disabled:opacity-50`,children:`×`})]},e.id)})}),s&&(0,X.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:s}),(0,X.jsx)(Jt,{ticketKey:e,attachment:l,onClose:()=>u(null)})]})}function en({ticketId:e,onClose:t}){let{t:n}=v(`code`),r=a(),{activeProjectId:i}=x(),o=`${i}:${e}`,s=(0,Y.useRef)(o);s.current=o;let c=(0,Y.useRef)(0),l=(0,Y.useRef)(null),[u,d]=(0,Y.useState)(null),[f,p]=(0,Y.useState)(!1),[m,h]=(0,Y.useState)(!1),[g,_]=(0,Y.useState)(null),y=(0,Y.useCallback)(async(t=null)=>{l.current?.abort();let n=new AbortController;l.current=n;let r=++c.current,i=()=>!n.signal.aborted&&c.current===r&&s.current===o;p(!0),h(!1),_(t);try{let r=new URLSearchParams({ticketId:String(e),limit:`50`});t&&r.set(`cursor`,t);let a=await fetch(`${b()}/code/activity?${r}`,{signal:n.signal});if(!a.ok)throw Error(`activity unavailable`);let s=await a.json();if(!Array.isArray(s.entries))throw Error(`invalid activity response`);if(!i())return;d(e=>{let n=t&&e?.scope===o?[...e.rows]:[],r=new Set(n.map(e=>`${e.repositoryId}\0${e.path}`));for(let e of s.entries){let t=`${e.repositoryId}\0${e.path}`;r.has(t)||(r.add(t),n.push(e))}return{scope:o,rows:n,nextCursor:s.nextCursor,truncated:!!s.truncated||!!t&&!!e?.truncated}})}catch{i()&&h(!0)}finally{i()&&p(!1)}},[o,e]);if((0,Y.useEffect)(()=>{if(Ce)return d(null),y(),()=>{l.current?.abort(),c.current++}},[y]),!Ce)return null;let S=u?.scope===o?u:null;return!f&&!m&&S&&!S.rows.length&&!S.truncated&&!S.nextCursor?null:(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:n(`ticketFiles.title`)}),f&&!S&&(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:n(`ticketFiles.loading`)}),m&&(0,X.jsxs)(`div`,{className:`text-xs`,role:`alert`,children:[(0,X.jsx)(`span`,{children:n(`ticketFiles.loadFailed`)}),` `,(0,X.jsx)(`button`,{type:`button`,onClick:()=>{y(g)},className:`underline`,children:n(`ticketFiles.retry`)})]}),S?.truncated&&(0,X.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[n(`ticketFiles.partial`),` `,(0,X.jsx)(`button`,{type:`button`,disabled:f,onClick:()=>{y()},className:`underline`,children:n(`ticketFiles.retry`)})]}),(0,X.jsx)(`ul`,{className:`space-y-1`,children:S?.rows.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{let n=new URLSearchParams({repositoryId:e.repositoryId,path:e.path});e.jobId&&n.set(`changeJobId`,e.jobId),t(),r(`/code?${n}`)},className:`w-full text-left flex items-center gap-2 rounded px-2 py-1 text-xs hover:bg-muted/40`,children:[(0,X.jsx)(e.kind===`created`?Ue:e.kind===`deleted`?He:N,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground truncate max-w-24`,title:e.repositoryName,children:e.repositoryName}),(0,X.jsx)(`span`,{className:`font-mono truncate flex-1`,children:e.path}),e.jobId&&(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] text-muted-foreground font-mono shrink-0`,title:n(`ticketFiles.jobTitle`,{jobId:e.jobId}),children:[(0,X.jsx)(We,{className:`h-3 w-3`}),e.jobId.length>10?e.jobId.slice(0,10):e.jobId]}),(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wider shrink-0`,children:n(`kind.${e.kind}`)})]})},`${e.repositoryId}:${e.path}`))}),S?.nextCursor&&(0,X.jsx)(`button`,{type:`button`,disabled:f,onClick:()=>{y(S.nextCursor)},className:`text-xs underline mt-2`,children:n(f?`ticketFiles.loading`:`ticketFiles.loadMore`)})]})}var tn=8e3,nn=[`change-request`,`review-feedback`,`clarification`,`constraint`],rn=[`open`,`in_flight`,`applied`,`dismissed`],an=class extends Error{code;constructor(e,t){super(t),this.code=e,this.name=`SpecAddendumValidationError`}};function on(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function sn(e){return typeof e==`string`&&nn.includes(e)}function cn(e){return typeof e==`string`&&rn.includes(e)}function ln(e){if(!on(e))throw new an(`not_object`,`addendum must be an object`);if((e.version===void 0?1:e.version)!==1)throw new an(`unsupported_version`,`addendum.version must be 1`);let t=e.kind===void 0||e.kind===null?`change-request`:e.kind;if(!sn(t))throw new an(`invalid_kind`,`addendum.kind must be one of ${nn.join(`, `)}`);if(e.body!==void 0&&e.body!==null&&typeof e.body!=`string`)throw new an(`body_required`,`addendum.body must be a string`);let n=typeof e.body==`string`?e.body.replace(/\r\n?/g,`
9
- `).trim():``;if(!n)throw new an(`body_required`,`addendum.body is required`);if(n.length>8e3)throw new an(`body_too_long`,`addendum.body exceeds ${tn} characters`);if(e.title!==void 0&&e.title!==null&&typeof e.title!=`string`)throw new an(`title_required`,`addendum.title must be a string`);let r=typeof e.title==`string`?e.title.replace(/\s+/g,` `).trim():``;if(r||=un(n),r.length>200)throw new an(`title_too_long`,`addendum.title exceeds 200 characters`);return{kind:t,title:r,body:n}}function un(e){let t=e.split(`
10
- `).map(e=>e.replace(/^[\s#>*-]+/,``).trim()).find(e=>e.length>0)??`Addendum`;return t.length>120?`${t.slice(0,117).trimEnd()}…`:t}function dn(e){if(!on(e)||typeof e.id!=`string`||!e.id||typeof e.hash!=`string`||!e.hash)return null;let t;try{t=ln({version:e.version,kind:e.kind,title:e.title,body:e.body})}catch{return null}let n=cn(e.status)?e.status:`open`,r=e=>typeof e==`string`&&e?e:null;return{id:e.id,version:1,...t,status:n,hash:e.hash,created_at:r(e.created_at)??``,updated_at:r(e.updated_at)??r(e.created_at)??``,created_by:r(e.created_by)??`user`,origin_conversation_id:r(e.origin_conversation_id),run_id:r(e.run_id),applied_at:r(e.applied_at)}}function fn(e){if(!Array.isArray(e))return[];let t=[],n=new Set;for(let r of e){let e=dn(r);!e||n.has(e.id)||(n.add(e.id),t.push(e))}return t}function pn(e){return(e??[]).filter(e=>e.status===`open`)}var mn={"change-request":Ge,"review-feedback":Xe,clarification:ze,constraint:q},hn={open:`border-accent-primary/50 bg-accent-primary/10 text-accent-primary`,in_flight:`border-accent-info/50 bg-accent-info/10 text-accent-info animate-pulse`,applied:`border-accent-success/50 bg-accent-success/10 text-accent-success`,dismissed:`border-border bg-muted/30 text-muted-foreground`},gn=`prose prose-invert prose-xs max-w-none prose-p:my-1 prose-headings:mt-2 prose-headings:mb-1 prose-headings:text-xs 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 text-xs`,_n={kind:`change-request`,title:``,body:``};function vn({ticket:e,onChanged:t}){let{t:n}=v(`tickets`),[r,i]=(0,Y.useState)(()=>fn(e.addenda)),[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),[l,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(()=>new Set),g=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{i(fn(e.addenda))},[e.id,e.updated_at,e.addenda]),(0,Y.useEffect)(()=>{a&&g.current?.focus()},[a]);let _=(0,Y.useMemo)(()=>pn(r).length,[r]),y=`${b()}/tickets/${e.id}/addenda`,x=(0,Y.useCallback)(e=>{let n=e.ticket?fn(e.ticket.addenda):null;n&&(i(n),t?.(n))},[t]),C=(0,Y.useCallback)(async(e,t,r)=>{u(!0);try{let i=await fetch(t,{method:e,headers:r===void 0?void 0:{"Content-Type":`application/json`},body:r===void 0?void 0:JSON.stringify(r)}),a=await i.json().catch(()=>({}));return i.ok?(x(a),!0):(a.error===`addendum_in_flight`?S.info(n(`addenda.toast.inFlight`)):S.error(a.detail?`${n(`addenda.toast.failed`)}: ${a.detail}`:n(`addenda.toast.failed`)),!1)}catch{return S.error(n(`addenda.toast.failed`)),!1}finally{u(!1)}},[x,n]),w=()=>{c(null),o({..._n}),f(null)},T=e=>{c(e.id),o({kind:e.kind,title:e.title,body:e.body}),f(null)},E=()=>{o(null),c(null)},D=async()=>{if(!a||!a.body.trim())return;let e={kind:a.kind,title:a.title.trim()||void 0,body:a.body};(s?await C(`PATCH`,`${y}/${encodeURIComponent(s)}`,e):await C(`POST`,y,e))&&(S.success(n(s?`addenda.toast.updated`:`addenda.toast.added`)),E())},k=async(e,t,r=!1)=>{await C(`PATCH`,`${y}/${encodeURIComponent(e.id)}`,r?{status:t,force:!0}:{status:t})&&S.success(n(`addenda.toast.updated`))},A=async e=>{if(d!==e.id){f(e.id);return}f(null),await C(`DELETE`,`${y}/${encodeURIComponent(e.id)}`)&&S.success(n(`addenda.toast.removed`))},M=e=>h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),N=e=>n(`addenda.who.${e===`agent`||e===`mcp`?e:`user`}`),ee=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?``:W(t,{addSuffix:!0,locale:p()})},P=()=>a&&(0,X.jsxs)(`div`,{"data-testid":`spec-addenda-form`,className:`rounded-lg border border-accent-primary/30 bg-accent-primary/[0.04] px-3 py-2.5 space-y-2`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`label`,{className:`flex items-center gap-1.5 text-[10px] text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`uppercase tracking-wider`,children:n(`addenda.form.kind`)}),(0,X.jsx)(`select`,{value:a.kind,onChange:e=>o({...a,kind:e.target.value}),className:`h-6 rounded-md border border-border/60 bg-input px-1.5 text-[11px] text-foreground outline-none focus:border-accent-primary/50`,"data-testid":`spec-addenda-kind`,children:nn.map(e=>(0,X.jsx)(`option`,{value:e,children:n(`addenda.kind.${e}`)},e))})]}),(0,X.jsx)(`input`,{value:a.title,onChange:e=>o({...a,title:e.target.value}),placeholder:n(`addenda.form.titlePlaceholder`),className:`h-6 min-w-0 flex-1 rounded-md border border-border/60 bg-input px-2 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/70 focus:border-accent-primary/50`,"data-testid":`spec-addenda-title`})]}),(0,X.jsx)(`textarea`,{ref:g,value:a.body,maxLength:8e3,onChange:e=>o({...a,body:e.target.value}),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),D()),e.key===`Escape`&&(e.preventDefault(),E())},placeholder:n(`addenda.form.bodyPlaceholder`),className:`w-full min-h-[96px] rounded-md border border-border/60 bg-input px-2.5 py-1.5 text-xs text-foreground outline-none placeholder:text-muted-foreground/70 focus:border-accent-primary/50 resize-y`,"data-testid":`spec-addenda-body`}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,X.jsx)(`span`,{className:`text-[9px] text-muted-foreground`,children:n(`addenda.form.hint`)}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(G,{variant:`ghost`,size:`sm`,className:`h-6 text-[10px]`,onClick:E,disabled:l,children:n(`addenda.form.cancel`)}),(0,X.jsxs)(G,{size:`sm`,className:`h-6 text-[10px]`,onClick:()=>void D(),disabled:l||!a.body.trim(),"data-testid":`spec-addenda-save`,children:[l?(0,X.jsx)(ne,{className:`mr-1 h-3 w-3 animate-spin`}):(0,X.jsx)(O,{className:`mr-1 h-3 w-3`}),n(l?`addenda.form.saving`:`addenda.form.save`)]})]})]})]});return(0,X.jsxs)(`section`,{"data-testid":`spec-addenda-section`,className:`space-y-2`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,title:n(`addenda.hint`),children:[(0,X.jsx)(Ye,{className:`h-3 w-3`}),n(`addenda.title`),r.length>0&&(0,X.jsx)(`span`,{"data-testid":`spec-addenda-open-count`,className:`rounded-full border px-1.5 py-px text-[9px] font-semibold normal-case tracking-normal ${_>0?hn.open:`border-border text-muted-foreground`}`,children:_>0?n(`addenda.openCount`,{count:_}):r.length})]}),!a&&(0,X.jsxs)(`button`,{type:`button`,onClick:w,className:`flex items-center gap-1 text-[10px] text-muted-foreground transition-colors hover:text-foreground`,"data-testid":`spec-addenda-add`,children:[(0,X.jsx)(z,{className:`h-2.5 w-2.5`}),n(`addenda.add`)]})]}),a&&!s&&P(),r.length===0&&!a?(0,X.jsx)(`button`,{type:`button`,onClick:w,className:`w-full rounded-lg border border-dashed border-border/40 bg-muted/10 px-3 py-3 text-left text-[11px] leading-relaxed text-muted-foreground transition-colors hover:bg-muted/20 hover:text-foreground`,"data-testid":`spec-addenda-empty`,children:n(`addenda.emptyCta`)}):(0,X.jsx)(`ul`,{className:`space-y-1.5`,children:r.map(e=>{let t=mn[e.kind],r=m.has(e.id),i=s===e.id&&a,o=e.status===`open`||e.status===`dismissed`,c=e.status===`open`||e.status===`applied`,u=e.status===`dismissed`||e.status===`applied`,p=e.status!==`in_flight`;return(0,X.jsx)(`li`,{"data-testid":`spec-addendum-${e.id}`,"data-status":e.status,className:`rounded-lg border px-3 py-2 transition-colors ${e.status===`dismissed`?`border-border/30 bg-muted/5 opacity-70`:`border-border/50 bg-muted/15`}`,children:i?P():(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,X.jsx)(t,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-accent-primary/80`}),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>M(e.id),className:`min-w-0 flex-1 text-left`,"aria-expanded":r,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,X.jsx)(`span`,{className:`text-xs font-medium text-foreground/90 ${e.status===`dismissed`?`line-through`:``}`,children:e.title}),(0,X.jsx)(`span`,{className:`rounded-full border border-border/50 px-1.5 py-px text-[9px] text-muted-foreground`,children:n(`addenda.kind.${e.kind}`)}),(0,X.jsx)(`span`,{className:`rounded-full border px-1.5 py-px text-[9px] font-medium ${hn[e.status]}`,title:n(`addenda.statusHint.${e.status}`),"data-testid":`spec-addendum-status`,children:n(`addenda.status.${e.status}`)})]}),!r&&(0,X.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[11px] leading-snug text-muted-foreground`,children:e.body})]}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[o&&(0,X.jsx)(`button`,{type:`button`,title:n(`addenda.actions.edit`),"aria-label":n(`addenda.actions.edit`),onClick:()=>T(e),disabled:l,className:`rounded p-1 text-muted-foreground transition-colors hover:bg-muted/40 hover:text-foreground`,children:(0,X.jsx)(I,{className:`h-3 w-3`})}),e.status===`in_flight`&&(0,X.jsx)(`button`,{type:`button`,title:n(`addenda.actions.releaseHint`),"aria-label":n(`addenda.actions.release`),onClick:()=>void k(e,`open`,!0),disabled:l,className:`rounded p-1 text-muted-foreground/60 transition-colors hover:bg-muted/40 hover:text-foreground`,"data-testid":`spec-addendum-release`,children:(0,X.jsx)(B,{className:`h-3 w-3`})}),u&&(0,X.jsx)(`button`,{type:`button`,title:n(`addenda.actions.reopen`),"aria-label":n(`addenda.actions.reopen`),onClick:()=>void k(e,`open`),disabled:l,className:`rounded p-1 text-muted-foreground transition-colors hover:bg-muted/40 hover:text-foreground`,children:(0,X.jsx)(B,{className:`h-3 w-3`})}),c&&(0,X.jsx)(`button`,{type:`button`,title:n(`addenda.actions.dismiss`),"aria-label":n(`addenda.actions.dismiss`),onClick:()=>void k(e,`dismissed`),disabled:l,className:`rounded p-1 text-muted-foreground transition-colors hover:bg-muted/40 hover:text-foreground`,children:(0,X.jsx)(j,{className:`h-3 w-3`})}),p&&(d===e.id?(0,X.jsxs)(`span`,{className:`flex items-center gap-0.5`,children:[(0,X.jsx)(`button`,{type:`button`,title:n(`addenda.actions.confirmDelete`),"aria-label":n(`addenda.actions.confirmDelete`),onClick:()=>void A(e),disabled:l,className:`rounded p-1 text-destructive transition-colors hover:bg-destructive/10`,children:(0,X.jsx)(O,{className:`h-3 w-3`})}),(0,X.jsx)(`button`,{type:`button`,"aria-label":n(`addenda.form.cancel`),onClick:()=>f(null),className:`rounded p-1 text-muted-foreground transition-colors hover:bg-muted/40`,children:(0,X.jsx)(se,{className:`h-3 w-3`})})]}):(0,X.jsx)(`button`,{type:`button`,title:n(`addenda.actions.delete`),"aria-label":n(`addenda.actions.delete`),onClick:()=>void A(e),disabled:l,className:`rounded p-1 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,children:(0,X.jsx)(ie,{className:`h-3 w-3`})}))]})]}),r&&(0,X.jsxs)(`div`,{className:`mt-2 space-y-1.5 pl-5`,children:[(0,X.jsx)(`div`,{className:gn,"data-testid":`spec-addendum-body`,children:(0,X.jsx)(_e,{remarkPlugins:[U],children:e.body})}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[9px] text-muted-foreground`,children:[(0,X.jsxs)(`span`,{children:[ee(e.created_at),` · `,n(`addenda.meta.by`,{who:N(e.created_by)})]}),e.run_id&&(0,X.jsx)(`span`,{className:`font-mono`,children:n(`addenda.meta.run`,{id:e.run_id.slice(0,8)})}),e.applied_at&&(0,X.jsx)(`span`,{children:n(`addenda.meta.applied`,{when:ee(e.applied_at)})}),(0,X.jsx)(`span`,{className:`font-mono`,children:n(`addenda.meta.hash`,{hash:e.hash.slice(0,12)})})]})]})]})},e.id)})})]})}function yn(e){return e<.005?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function bn(e){return e<1e3?`${e} ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`}function xn({ticketId:e}){let{t}=v(`tickets`),[n,r]=(0,Y.useState)(null),i=a(),{activeProjectId:o}=x(),{closeTicketDetail:s}=Zi();if((0,Y.useEffect)(()=>{let t=new AbortController;return r(null),fetch(`${b()}/tickets/${e}/spending-summary`,{signal:t.signal}).then(e=>e.ok?e.json():null).then(e=>{e&&r(e)}).catch(()=>{}),()=>t.abort()},[e,o]),!n||!n.bySurface||!n.totalRuns||n.totalRuns===0)return null;let c=Object.entries(n.bySurface).filter(([,e])=>e.count>0).map(([e,n])=>t(`spendingLine.breakdownItem`,{n:n.count,label:E[e].toLowerCase()})).join(` + `),l=n.unpricedRuns??0,u=n.pricedRuns??Math.max(0,n.totalRuns-l),d=l>0&&u===0,f=l>0&&u>0,p=n.turnsUnavailableRuns??0,m=n.totalTurns==null||p>0&&(n.turnsReportedRuns??0)===0,h=!m&&p>0;return(0,X.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),s(),i(`/analytics?ticketId=${e}`)},className:`mt-1.5 group inline-flex items-center gap-1.5 text-[11px] text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,"aria-label":t(`spendingLine.ariaLabel`),children:[(0,X.jsx)(`span`,{className:`tabular-nums font-medium text-foreground`,"data-testid":d?`ticket-cost-unavailable`:void 0,title:d?t(`spendingLine.costUnavailableTooltip`):f?t(`spendingLine.costPartiallyUnavailableTooltip`):(n.estimatedCostUsd??0)>0?t(`spendingLine.estimatedTooltip`):void 0,children:d?`—`:`${(n.estimatedCostUsd??0)>0?`~`:``}${f?`≥`:``}${yn(n.totalCostUsd)}`}),(0,X.jsx)(`span`,{className:`text-muted-foreground/60`,children:`·`}),(0,X.jsx)(`span`,{className:`tabular-nums`,"data-testid":m?`ticket-turns-unavailable`:void 0,title:m?t(`spendingLine.turnsUnavailableTooltip`):h?t(`spendingLine.turnsPartiallyUnavailableTooltip`):void 0,children:m?`—`:`${h?`≥`:``}${t(`spendingLine.turns`,{count:n.totalTurns})}`}),(0,X.jsx)(`span`,{className:`text-muted-foreground/60`,children:`·`}),(0,X.jsx)(`span`,{className:`tabular-nums`,children:t(`spendingLine.active`,{duration:bn(n.activeDurationMs)})}),c&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`text-muted-foreground/60`,children:`·`}),(0,X.jsx)(`span`,{children:c})]}),(0,X.jsx)(Ie,{className:`w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity`})]})}var Sn={draft:{dotClass:`bg-accent-secondary/60`,textClass:`text-accent-secondary`,borderClass:`border-l-[3px] border-dashed border-accent-secondary/50 pl-3`,labelKey:`common:status.draft`,pulsing:!1},todo:{dotClass:`bg-slate-500/70`,textClass:`text-muted-foreground`,borderClass:`border-l-[3px] border-dashed border-slate-500/40 pl-3`,labelKey:`status.todo`,pulsing:!1},in_progress:{dotClass:`bg-blue-400 aurora-light:bg-accent-info`,textClass:`text-foreground font-semibold`,borderClass:`border-l-[3px] border-solid border-blue-500 pl-3`,labelKey:`status.inProgress`,pulsing:!0},on_review:{dotClass:`bg-accent-warning/80`,textClass:`text-accent-warning`,borderClass:`border-l-[3px] border-solid border-accent-warning/60 pl-3`,labelKey:`status.onReview`,pulsing:!1},done:{dotClass:`text-emerald-400 aurora-light:text-accent-success`,textClass:`text-emerald-400/80 aurora-light:text-accent-success`,borderClass:`border-l-[3px] border-solid border-emerald-500 pl-3`,labelKey:`status.done`,pulsing:!1},cancelled:{dotClass:`text-red-400/60 aurora-light:text-destructive/70`,textClass:`text-muted-foreground/50`,borderClass:`pl-3`,labelKey:`status.cancelled`,pulsing:!1}};function Cn({status:e,className:t}){let{t:n}=v(`specs`),r=Sn[e];return e===`done`?(0,X.jsx)(O,{className:H(`w-3.5 h-3.5 shrink-0`,r.dotClass,t),"aria-label":n(`status.done`)}):e===`cancelled`?(0,X.jsx)(se,{className:H(`w-3.5 h-3.5 shrink-0`,r.dotClass,t),"aria-label":n(`status.cancelled`)}):r.pulsing?(0,X.jsxs)(`span`,{className:H(`relative flex shrink-0 h-2.5 w-2.5`,t),"aria-label":n(`status.inProgress`),children:[(0,X.jsx)(`span`,{className:H(`animate-ping absolute inline-flex h-full w-full rounded-full opacity-60`,r.dotClass)}),(0,X.jsx)(`span`,{className:H(`relative inline-flex rounded-full h-2.5 w-2.5`,r.dotClass)})]}):(0,X.jsx)(`span`,{className:H(`inline-flex rounded-full h-2.5 w-2.5 shrink-0`,r.dotClass,t),"aria-label":n(r.labelKey)})}function wn({status:e,className:t}){let{t:n}=v(`specs`),r=Sn[e];return(0,X.jsxs)(`span`,{className:H(`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[11px] font-medium border`,e===`todo`&&`bg-slate-500/10 border-slate-500/30 text-slate-400 aurora-light:bg-muted aurora-light:border-border aurora-light:text-muted-foreground`,e===`in_progress`&&`bg-blue-500/10 border-blue-500/30 text-blue-400 aurora-light:bg-accent-info/10 aurora-light:border-accent-info/30 aurora-light:text-accent-info`,e===`on_review`&&`bg-accent-warning/10 border-accent-warning/30 text-accent-warning`,e===`done`&&`bg-emerald-500/10 border-emerald-500/30 text-emerald-400 aurora-light:bg-accent-success/10 aurora-light:border-accent-success/30 aurora-light:text-accent-success`,e===`cancelled`&&`bg-red-500/10 border-red-500/30 text-red-400/60 aurora-light:bg-destructive/10 aurora-light:border-destructive/30 aurora-light:text-destructive/70`,t),children:[(0,X.jsx)(Cn,{status:e}),n(r.labelKey)]})}function Tn(){let{activeProjectId:e}=x(),[t,n]=(0,Y.useState)({connected:!1,key:null,discardStatus:null}),[r,i]=(0,Y.useState)(!0);return(0,Y.useEffect)(()=>{if(!we||!e){n({connected:!1,key:null,discardStatus:null}),i(!1);return}let t=!1;return i(!0),oe.getConnection().then(e=>{if(t)return;let r=!!(e.connected&&e.connection?.enabled);n({connected:r,key:e.connection?.jiraProjectKey??null,discardStatus:r?e.connection?.discardStatus??null:null})}).catch(()=>{t||n({connected:!1,key:null,discardStatus:null})}).finally(()=>{t||i(!1)}),()=>{t=!0}},[e]),{connected:t.connected,jiraProjectKey:t.key,discardStatus:t.discardStatus,loading:r}}function En({open:e,onOpenChange:t,ticket:n,discardStatus:r,onDiscarded:i}){let{t:a}=v(`jira`),[o,s]=(0,Y.useState)(``),[c,l]=(0,Y.useState)(!1);async function u(){l(!0);try{await oe.discardSpec(n.id,o.trim()||null),S.success(a(`discard.movedToast`,{status:r,key:n.jira_key??`#${n.id}`})),t(!1),s(``),i?.()}catch(e){S.error(e instanceof Error?e.message:a(`errors.generic`))}finally{l(!1)}}return(0,X.jsx)(ge,{open:e,onOpenChange:e=>{c||t(e)},children:(0,X.jsxs)(he,{movableResizable:!0,className:`max-w-md`,"data-testid":`jira-discard-dialog`,children:[(0,X.jsxs)(me,{children:[(0,X.jsx)(pe,{children:a(`discard.title`,{status:r})}),(0,X.jsx)(fe,{children:a(`discard.body`,{status:r,key:n.jira_key??`#${n.id}`})})]}),(0,X.jsxs)(`label`,{className:`block space-y-1`,children:[(0,X.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:a(`discard.commentLabel`)}),(0,X.jsx)(`textarea`,{value:o,onChange:e=>s(e.target.value),placeholder:a(`discard.commentPlaceholder`),rows:3,className:`w-full rounded-md border border-border bg-input px-3 py-2 text-xs text-foreground placeholder:text-muted-foreground resize-none`,"data-testid":`jira-discard-comment`})]}),(0,X.jsxs)(de,{children:[(0,X.jsx)(G,{variant:`outline`,size:`sm`,onClick:()=>t(!1),disabled:c,children:a(`wizard.cancel`)}),(0,X.jsxs)(G,{size:`sm`,onClick:u,disabled:c,"data-testid":`jira-discard-confirm`,children:[(0,X.jsx)(Ie,{className:`w-3.5 h-3.5 mr-1.5`}),c?a(`discard.moving`):a(`discard.confirm`,{status:r})]})]})]})})}var Dn=/^\d{4}-\d{2}-\d{2}T/;function On(e){if(Dn.test(e))try{return{text:W(_t(e),{addSuffix:!0,locale:p()}),title:e}}catch{}return{text:e}}function kn({localId:e}){let{t}=v(`jira`),{activeProjectId:n}=x(),r=Tn(),[i,a]=(0,Y.useState)(null);if((0,Y.useEffect)(()=>{if(!we||!r.connected)return;let t=!1;return a(null),oe.getSpecDetails(e).then(e=>{t||a(e)}).catch(()=>{t||a(null)}),()=>{t=!0}},[e,n,r.connected]),!we||!r.connected||!i)return null;let s=i.development,c=i.fields.length>0,l=s.pullRequests.length>0,u=s.branches.length>0,d=(s.commits?.length??0)>0;return!c&&!l&&!u&&!d?null:(0,X.jsxs)(`div`,{className:`space-y-4`,"data-testid":`jira-details-panel`,children:[c&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:t(`detail.detailsTitle`)}),(0,X.jsx)(`div`,{className:`space-y-1.5`,children:i.fields.map((e,t)=>{let n=On(e.value);return(0,X.jsxs)(`div`,{className:`text-xs`,children:[(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wide block`,children:e.label}),e.href?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{o(e.href)},className:`inline-flex items-center gap-1 text-accent-info hover:underline text-left`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:e.value}),(0,X.jsx)(te,{className:`w-3 h-3 shrink-0`})]}):(0,X.jsx)(`span`,{className:`text-foreground/80 whitespace-pre-line`,title:n.title,children:n.text})]},`${e.label}-${t}`)})})]}),(l||u||d)&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:t(`detail.developmentTitle`)}),l&&(0,X.jsxs)(`div`,{className:`mb-2`,children:[(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wide block mb-1`,children:t(`detail.dev.pullRequests`)}),(0,X.jsx)(`div`,{className:`space-y-1`,children:s.pullRequests.map(e=>(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{o(e.url)},className:`w-full flex items-start gap-1.5 text-left text-xs hover:bg-accent-info/10 rounded px-1 py-0.5`,"data-testid":`jira-dev-pr`,children:[(0,X.jsx)(Ke,{className:`w-3 h-3 mt-0.5 shrink-0 text-accent-info`}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`span`,{className:`truncate text-foreground/80 block`,children:e.title}),(0,X.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[e.status,e.sourceBranch?` · ${e.sourceBranch} → ${e.destBranch??``}`:``]})]})]},e.url))})]}),u&&(0,X.jsxs)(`div`,{className:`mb-2`,children:[(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wide block mb-1`,children:t(`detail.dev.branches`)}),(0,X.jsx)(`div`,{className:`space-y-1`,children:s.branches.map(e=>(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{o(e.url)},className:`w-full flex items-center gap-1.5 text-left text-xs hover:bg-accent-info/10 rounded px-1 py-0.5`,"data-testid":`jira-dev-branch`,children:[(0,X.jsx)(F,{className:`w-3 h-3 shrink-0 text-accent-info`}),(0,X.jsx)(`span`,{className:`truncate font-mono text-foreground/80`,children:e.name}),e.repo&&(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground truncate`,children:e.repo})]},e.url))})]}),d&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wide block mb-1`,children:t(`detail.dev.commits`)}),(0,X.jsx)(`div`,{className:`space-y-1`,children:s.commits.map(e=>(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{o(e.url)},className:`w-full flex items-center gap-1.5 text-left text-xs hover:bg-accent-info/10 rounded px-1 py-0.5`,"data-testid":`jira-dev-commit`,children:[(0,X.jsx)(We,{className:`w-3 h-3 shrink-0 text-accent-info`}),(0,X.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground shrink-0`,children:e.displayId}),(0,X.jsx)(`span`,{className:`truncate text-foreground/80`,children:e.message})]},e.url))})]})]})]})}var An=/\n*##\s*Acceptance Criteria\s*\n([\s\S]*?)(?=\n##\s|\n*$)/i;function jn(e){if(!e)return{body:``,criteria:[]};let t=An.exec(e);if(!t)return{body:e.replace(/\s+$/,``),criteria:[]};let n=t[1],r=e.slice(0,t.index),i=e.slice(t.index+t[0].length),a=`${r.replace(/\s+$/,``)}${i?`\n\n${i.replace(/^\s+/,``)}`:``}`,o=n.split(/\r?\n/).map(e=>e.replace(/^\s*[-*+]\s+/,``).trim()).filter(e=>e.length>0);return{body:a.replace(/\s+$/,``),criteria:o}}var Mn=new Set([`draft`,`todo`]);function Nn(e){return!!(Mn.has(e.status)||e.source===`jira`&&e.jira_key&&e.status!==`cancelled`)}function Pn(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function Fn(){let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_BROWSER_CAPTURE;return typeof e!=`string`||e!==`false`}var In={desktop:{width:1280,height:800},tablet:{width:768,height:1024},mobile:{width:375,height:667}},Ln=class extends Error{},Rn=class extends Error{};function zn(e){if(!e)throw Error(`A project owner is required for browser sessions`);return`${f}/api/projects/${encodeURIComponent(e)}`}async function Bn(e,t){let n=await fetch(`${zn(e)}/browser/sessions`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({initialUrl:t})});if(n.status===409)throw new Ln(`Too many open browser sessions`);if(n.status===502)throw new Rn(`The browser failed to launch`);if(!n.ok)throw Error(`Failed to open browser (${n.status})`);return(await n.json()).session}async function Vn(e,t,n,r){let i=await fetch(`${zn(e)}/browser/sessions/${t}/navigate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:n,url:r})});if(!i.ok)throw Error(`Navigation failed (${i.status})`);return await i.json()}async function Hn(e,t,n,r,i){let a=await fetch(`${zn(e)}/browser/sessions/${t}/capture`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({rect:n,pendingSpecId:r,captureNetwork:i?.captureNetwork??!0})});if(!a.ok)throw Error(await Un(a));return await a.json()}async function Un(e){let t=await e.json().then(e=>e.error).catch(()=>void 0);return t?`Capture failed (${e.status}): ${t}`:`Capture failed (${e.status})`}async function Wn(e,t,n,r,i,a=In){let o=await fetch(`${zn(e)}/browser/sessions/${t}/capture-breakpoints`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({rect:n,anchorPoint:r,pendingSpecId:i,breakpoints:a})});if(!o.ok)throw Error(await Un(o));return await o.json()}async function Gn(e,t,n){let r=new FormData;r.append(`file`,t,n);let i=await fetch(`${b()}/tickets/${e}/attachments`,{method:`POST`,body:r});if(!i.ok)throw Error(`Upload failed (${i.status})`);return(await i.json()).attachment}async function Kn(e,t,n,r){let i=await fetch(`${zn(e)}/browser/sessions/${t}/clipboard`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:n,text:r})});if(!i.ok)throw Error(`Clipboard failed (${i.status})`);return await i.json()}async function qn(e,t,n,r){let i=await fetch(`${zn(e)}/browser/sessions/${t}/element`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({selector:n,direction:r})});if(!i.ok)throw Error(`Element navigate failed (${i.status})`);return(await i.json()).probe}async function Jn(e,t,n){let r=await fetch(`${zn(e)}/browser/sessions/${t}/popup-view`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({target:n})});if(!r.ok)throw Error(`Could not switch browser view (${r.status})`)}function Yn(e){if(!e||e===`about:blank`)return`…`;try{return new URL(e).hostname||`…`}catch{return`…`}}async function Xn(e,t){try{await fetch(`${zn(e)}/browser/sessions/${t}`,{method:`DELETE`})}catch{}}function Zn(e,t){return`${be||(typeof window<`u`?`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}`:`ws://localhost:4200`)}/ws/browser/${e}?projectId=${encodeURIComponent(t)}`}function Qn(e,t){let n=Zn(e,t),r=u(),i=r?new WebSocket(n,[`specrails-desktop`,r]):new WebSocket(n);return i.binaryType=`arraybuffer`,i}function $n(e,t=e=>requestAnimationFrame(e),n=e=>cancelAnimationFrame(e)){let r=null,i=null,a=null,o=!1,s=()=>{a!=null&&(n(a),a=null);let t=r,o=i;r=null,i=null,t&&(!o||t.x!==o.x||t.y!==o.y)&&e({type:`mouse`,action:`move`,x:t.x,y:t.y}),o&&e({type:`wheel`,x:o.x,y:o.y,deltaX:o.deltaX,deltaY:o.deltaY})},c=()=>{a==null&&!o&&(a=t(()=>{a=null,s()}))};return{move(e,t){o||(r={x:e,y:t},c())},wheel(e,t,n,r){o||(i?(i.x=e,i.y=t,i.deltaX+=n,i.deltaY+=r):i={x:e,y:t,deltaX:n,deltaY:r},c())},flush(){o||s()},dispose(){o||(o=!0,a!=null&&(n(a),a=null),r=null,i=null)}}}function er(e,t,n){let r=t.width>0?(e.x-t.left)/t.width:0,i=t.height>0?(e.y-t.top)/t.height:0,a=Math.min(Math.max(r,0),1)*n.width,o=Math.min(Math.max(i,0),1)*n.height;return{x:Math.round(a),y:Math.round(o)}}function tr(e,t,n){let r=n.width>0?t.width/n.width:0,i=n.height>0?t.height/n.height:0;return{left:t.left+e.x*r,top:t.top+e.y*i,width:e.width*r,height:e.height*i}}function nr(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}function rr(e,t=8){return e.width>=t&&e.height>=t}function ir(e,t){let n=Math.max(1,t.width),r=Math.max(1,t.height),i=Math.max(0,Math.min(e.x,n-1)),a=Math.max(0,Math.min(e.y,r-1)),o=Math.min(n,Math.max(i+1,e.x+e.width)),s=Math.min(r,Math.max(a+1,e.y+e.height));return{x:Math.round(i),y:Math.round(a),width:Math.round(o-i),height:Math.round(s-a)}}function ar(e){return{nodeCount:e.nodes.length,htmlBytes:e.html.length,truncated:e.htmlTruncated,networkCount:e.networkRequests?.length??0}}function or(e,t){let n=e.indexOf(`,`);if(!e.startsWith(`data:`)||n===-1)throw Error(`dataUrlToFile: not a data URL`);let r=e.slice(0,n),i=/^data:([^;,]+)/.exec(r)?.[1]||`application/octet-stream`,a=e.slice(n+1);if(/;base64$/i.test(r)){let e=atob(a),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return new File([n],t,{type:i})}return new File([decodeURIComponent(a)],t,{type:i})}var sr={objects:[],past:[],future:[]};function cr(e,t){switch(t.type){case`add`:return{objects:[...e.objects,t.obj],past:[...e.past,e.objects],future:[]};case`delete`:return e.objects.some(e=>e.id===t.id)?{objects:e.objects.filter(e=>e.id!==t.id),past:[...e.past,e.objects],future:[]}:e;case`undo`:return e.past.length===0?e:{objects:e.past[e.past.length-1],past:e.past.slice(0,-1),future:[e.objects,...e.future]};case`redo`:return e.future.length===0?e:{objects:e.future[0],past:[...e.past,e.objects],future:e.future.slice(1)};case`clear`:return e.objects.length===0?e:{objects:[],past:[...e.past,e.objects],future:[]};default:return e}}function lr(e){let t=e.filter(e=>e.kind===`step`).map(e=>e.n);return t.length===0?1:Math.max(...t)+1}function ur(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),w:Math.abs(e.x-t.x),h:Math.abs(e.y-t.y)}}function dr(e,t,n=.04){let r=Math.atan2(t.y-e.y,t.x-e.x),i=r-Math.PI/7,a=r+Math.PI/7;return{left:{x:t.x-n*Math.cos(i),y:t.y-n*Math.sin(i)},right:{x:t.x-n*Math.cos(a),y:t.y-n*Math.sin(a)}}}function fr(e,t,n=.01){return Math.abs(e.x-t.x)>=n||Math.abs(e.y-t.y)>=n}function pr(e,t=.05){let n=e=>Math.min(1+t,Math.max(-t,e));return{x:n(e.x),y:n(e.y)}}function mr(e,t,n){return{schemaVersion:1,objects:e,baseWidth:t,baseHeight:n}}function hr({result:e,pendingSpecId:t,onConfirm:n,...r}){let i=(0,Y.useCallback)(async r=>{if(!r.annotations){await n(e);return}let i=`screen-annotated-${Date.now()}.png`,a=await Gn(t,or(r.screenshotDataUrl,i),i);await n({...e,rawScreenshot:e.screenshot,screenshot:a,screenshotDataUrl:r.screenshotDataUrl,annotations:r.annotations,...e.breakpoints?{breakpoints:Object.fromEntries(Object.entries(e.breakpoints).map(([t,n])=>[t,n.attachment.id===e.screenshot.id?{...n,attachment:a,dataUrl:r.screenshotDataUrl}:n]))}:{}})},[n,t,e]);return(0,X.jsx)(xr,{...r,responsive:Object.keys(e.breakpoints??{}).length>1,screenshotDataUrl:e.screenshotDataUrl,onConfirm:i})}var gr=[`#ef4444`,`#f59e0b`,`#3b82f6`,`#22c55e`,`#ffffff`],_r=`#111827`,vr=[{tool:`arrow`,icon:D,labelKey:`editor.tools.arrow`,key:`a`},{tool:`box`,icon:R,labelKey:`editor.tools.box`,key:`r`},{tool:`text`,icon:rt,labelKey:`editor.tools.text`,key:`t`},{tool:`blur`,icon:K,labelKey:`editor.tools.blur`,key:`b`},{tool:`step`,icon:Je,labelKey:`editor.tools.step`,key:`n`}],yr=0,br=()=>`a${++yr}-${Date.now().toString(36)}`;function xr({screenshotDataUrl:e,responsive:t,macOverlay:n,confirmLabel:r,onConfirm:i,onReselect:a,onCancel:o}){let{t:s}=v(`browser`),[c,l]=(0,Y.useReducer)(cr,sr),[u,d]=(0,Y.useState)(`arrow`),[f,p]=(0,Y.useState)(gr[0]),[m,h]=(0,Y.useState)(null),[g,_]=(0,Y.useState)({w:1,h:1}),[y,b]=(0,Y.useState)(!1),[x,S]=(0,Y.useState)(!1),C=(0,Y.useRef)(!1),T=(0,Y.useRef)(null),E=(0,Y.useRef)(null),D=c.objects,k=(0,Y.useCallback)(()=>{let e=T.current;if(!e)return;let t=E.current?.getBoundingClientRect();if(!t||t.width<=0||t.height<=0||e.naturalWidth<=0||e.naturalHeight<=0)return;let n=Math.min(1,t.width/e.naturalWidth,t.height/e.naturalHeight),r=e.naturalWidth*n,i=e.naturalHeight*n;_(e=>e.w===r&&e.h===i?e:{w:r,h:i})},[]);(0,Y.useEffect)(()=>{k();let e=typeof ResizeObserver>`u`?null:new ResizeObserver(k);return E.current&&e?.observe(E.current),window.addEventListener(`resize`,k),()=>{e?.disconnect(),window.removeEventListener(`resize`,k)}},[k]);let A=(0,Y.useCallback)((e,t)=>{let n=T.current;if(!n)return{x:0,y:0};let r=n.getBoundingClientRect();return pr({x:r.width>0?(e-r.left)/r.width:0,y:r.height>0?(t-r.top)/r.height:0})},[]),j=(0,Y.useCallback)(e=>{if(y)return;e.target.setPointerCapture?.(e.pointerId);let t=A(e.clientX,e.clientY);if(u===`text`){let e=window.prompt(s(`editor.notePrompt`))?.trim();e&&l({type:`add`,obj:{id:br(),kind:`text`,x:t.x,y:t.y,text:e,color:f}});return}if(u===`step`){l({type:`add`,obj:{id:br(),kind:`step`,x:t.x,y:t.y,n:lr(D),color:f}});return}h({start:t,cur:t})},[y,u,f,D,A,s]),M=(0,Y.useCallback)(e=>{m&&h(t=>t&&{...t,cur:A(e.clientX,e.clientY)})},[m,A]),N=(0,Y.useCallback)(()=>{if(!m)return;let{start:e,cur:t}=m;if(h(null),fr(e,t)){if(u===`arrow`)l({type:`add`,obj:{id:br(),kind:`arrow`,from:e,to:t,color:f}});else if(u===`box`){let n=ur(e,t);l({type:`add`,obj:{id:br(),kind:`box`,...n,color:f}})}else if(u===`blur`){let n=ur(e,t);l({type:`add`,obj:{id:br(),kind:`blur`,...n}})}}},[m,u,f]),ee=(0,Y.useCallback)(()=>{let e=T.current;if(!e||!e.naturalWidth||!e.naturalHeight)throw Error(`Capture image is not loaded`);let t=e.naturalWidth,n=e.naturalHeight,r=document.createElement(`canvas`);r.width=t,r.height=n;let i=r.getContext(`2d`);if(!i)throw Error(`Image rendering is unavailable`);i.drawImage(e,0,0,t,n);for(let e of D)e.kind===`blur`&&(i.fillStyle=_r,i.fillRect(e.x*t,e.y*n,e.w*t,e.h*n));let a=Math.max(2,t*.004);for(let e of D)if(e.kind===`box`)i.strokeStyle=e.color,i.lineWidth=a,i.strokeRect(e.x*t,e.y*n,e.w*t,e.h*n);else if(e.kind===`arrow`){let r={x:e.from.x*t,y:e.from.y*n},o={x:e.to.x*t,y:e.to.y*n},s=dr(e.from,e.to,.035);i.strokeStyle=e.color,i.lineWidth=a,i.lineCap=`round`,i.beginPath(),i.moveTo(r.x,r.y),i.lineTo(o.x,o.y),i.moveTo(s.left.x*t,s.left.y*n),i.lineTo(o.x,o.y),i.lineTo(s.right.x*t,s.right.y*n),i.stroke()}else if(e.kind===`text`){let r=Math.max(12,n*.03);i.font=`600 ${r}px sans-serif`,i.textBaseline=`top`,i.lineWidth=Math.max(2,r*.18),i.strokeStyle=`rgba(0,0,0,0.55)`,i.strokeText(e.text,e.x*t,e.y*n),i.fillStyle=e.color,i.fillText(e.text,e.x*t,e.y*n)}else if(e.kind===`step`){let r=Math.max(10,n*.025);i.beginPath(),i.arc(e.x*t,e.y*n,r,0,Math.PI*2),i.fillStyle=e.color,i.fill(),i.fillStyle=`#000`,i.font=`700 ${r*1.1}px sans-serif`,i.textAlign=`center`,i.textBaseline=`middle`,i.fillText(String(e.n),e.x*t,e.y*n),i.textAlign=`start`}let o=r.toDataURL(`image/png`);if(!o.startsWith(`data:image/png;base64,`))throw Error(`Image encoding failed`);return{screenshotDataUrl:o,annotations:mr(D,t,n)}},[D]),P=(0,Y.useCallback)(async()=>{if(!C.current){C.current=!0,b(!0),S(!1);try{await i(D.length===0?{screenshotDataUrl:e}:ee())}catch{S(!0)}finally{C.current=!1,b(!1)}}},[D,ee,e,i]),te=(0,Y.useCallback)(()=>{D.length>0&&!window.confirm(s(`editor.discardConfirm`))||o()},[D.length,o,s]);(0,Y.useEffect)(()=>{let e=e=>{if(y)return;let t=e.metaKey||e.ctrlKey;if(t&&e.key.toLowerCase()===`z`){e.preventDefault(),l({type:e.shiftKey?`redo`:`undo`});return}if(t&&e.key===`Enter`){e.preventDefault(),P();return}if(t)return;let n=vr.find(t=>t.key===e.key.toLowerCase());if(n){d(n.tool);return}e.key===`Escape`&&(e.preventDefault(),te())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[y,P,te]);let F=(e,t)=>e*(t===`w`?g.w:g.h),I=m?ur(m.start,m.cur):null;return(0,X.jsxs)(`div`,{className:`flex-1 min-h-0 min-w-0 flex flex-col items-center overflow-hidden p-3 gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex shrink-0 max-w-full items-center gap-1 overflow-x-auto rounded-lg border border-border/60 bg-surface/90 px-1.5 py-1 shadow-xl ${n?`ml-[80px]`:``}`,children:[vr.map(({tool:e,icon:t,labelKey:n})=>(0,X.jsx)(`button`,{type:`button`,title:s(n),"aria-label":s(n),"aria-pressed":u===e,onClick:()=>d(e),className:`h-7 w-7 inline-flex items-center justify-center rounded transition-colors ${u===e?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground hover:bg-card/60`}`,children:(0,X.jsx)(t,{className:`w-3.5 h-3.5`})},e)),(0,X.jsx)(`span`,{className:`w-px h-5 bg-border/60 mx-0.5`}),gr.map(e=>(0,X.jsx)(`button`,{type:`button`,"aria-label":s(`editor.colorLabel`,{color:e}),onClick:()=>p(e),className:`h-5 w-5 rounded-full border transition-transform ${f===e?`scale-110 border-foreground`:`border-border/60`}`,style:{background:e}},e)),(0,X.jsx)(`span`,{className:`w-px h-5 bg-border/60 mx-0.5`}),(0,X.jsx)(`button`,{type:`button`,"aria-label":s(`editor.undo`),title:s(`editor.undoTitle`),disabled:c.past.length===0,onClick:()=>l({type:`undo`}),className:`h-7 w-7 inline-flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-card/60 disabled:opacity-40`,children:(0,X.jsx)(it,{className:`w-3.5 h-3.5`})}),(0,X.jsx)(`button`,{type:`button`,"aria-label":s(`editor.redo`),title:s(`editor.redoTitle`),disabled:c.future.length===0,onClick:()=>l({type:`redo`}),className:`h-7 w-7 inline-flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-card/60 disabled:opacity-40`,children:(0,X.jsx)($e,{className:`w-3.5 h-3.5`})})]}),t&&(0,X.jsx)(`p`,{className:`shrink-0 max-w-prose text-center text-xs text-muted-foreground`,children:s(`editor.responsiveHint`)}),(0,X.jsx)(`div`,{ref:E,className:`relative flex-1 min-h-0 w-full flex items-center justify-center`,children:(0,X.jsxs)(`div`,{className:`relative shrink-0`,style:{width:g.w,height:g.h},children:[(0,X.jsx)(`img`,{ref:T,src:e,alt:s(`editor.capturedAlt`),onLoad:k,draggable:!1,className:`block w-full h-full select-none rounded shadow-2xl`}),D.map(e=>e.kind===`blur`?(0,X.jsx)(`div`,{className:`absolute pointer-events-none`,style:{backgroundColor:_r,left:`${e.x*100}%`,top:`${e.y*100}%`,width:`${e.w*100}%`,height:`${e.h*100}%`}},e.id):null),m&&u===`blur`&&I&&(0,X.jsx)(`div`,{className:`absolute border border-accent-info pointer-events-none`,style:{backgroundColor:_r,left:`${I.x*100}%`,top:`${I.y*100}%`,width:`${I.w*100}%`,height:`${I.h*100}%`}}),(0,X.jsxs)(`svg`,{className:`absolute inset-0 w-full h-full ${u===`text`||u===`step`?`cursor-pointer`:`cursor-crosshair`}`,viewBox:`0 0 ${g.w} ${g.h}`,preserveAspectRatio:`none`,onPointerDown:j,onPointerMove:M,onPointerUp:N,children:[D.map(e=>{if(e.kind===`box`)return(0,X.jsx)(`rect`,{x:F(e.x,`w`),y:F(e.y,`h`),width:F(e.w,`w`),height:F(e.h,`h`),fill:`none`,stroke:e.color,strokeWidth:Math.max(2,g.w*.004)},e.id);if(e.kind===`arrow`){let t=dr(e.from,e.to,.035),n=Math.max(2,g.w*.004);return(0,X.jsxs)(`g`,{stroke:e.color,strokeWidth:n,strokeLinecap:`round`,fill:`none`,children:[(0,X.jsx)(`line`,{x1:F(e.from.x,`w`),y1:F(e.from.y,`h`),x2:F(e.to.x,`w`),y2:F(e.to.y,`h`)}),(0,X.jsx)(`polyline`,{points:`${F(t.left.x,`w`)},${F(t.left.y,`h`)} ${F(e.to.x,`w`)},${F(e.to.y,`h`)} ${F(t.right.x,`w`)},${F(t.right.y,`h`)}`})]},e.id)}if(e.kind===`text`)return(0,X.jsx)(`text`,{x:F(e.x,`w`),y:F(e.y,`h`),dominantBaseline:`hanging`,fontSize:Math.max(12,g.h*.03),fontWeight:600,fill:e.color,stroke:`rgba(0,0,0,0.55)`,strokeWidth:1,paintOrder:`stroke`,children:e.text},e.id);if(e.kind===`step`){let t=Math.max(10,g.h*.025);return(0,X.jsxs)(`g`,{children:[(0,X.jsx)(`circle`,{cx:F(e.x,`w`),cy:F(e.y,`h`),r:t,fill:e.color}),(0,X.jsx)(`text`,{x:F(e.x,`w`),y:F(e.y,`h`),textAnchor:`middle`,dominantBaseline:`central`,fontSize:t*1.1,fontWeight:700,fill:`#000`,children:e.n})]},e.id)}return null}),m&&u===`box`&&I&&(0,X.jsx)(`rect`,{x:F(I.x,`w`),y:F(I.y,`h`),width:F(I.w,`w`),height:F(I.h,`h`),fill:`none`,stroke:f,strokeDasharray:`4 3`,strokeWidth:Math.max(2,g.w*.004)}),m&&u===`arrow`&&(0,X.jsx)(`line`,{x1:F(m.start.x,`w`),y1:F(m.start.y,`h`),x2:F(m.cur.x,`w`),y2:F(m.cur.y,`h`),stroke:f,strokeWidth:Math.max(2,g.w*.004),strokeLinecap:`round`})]}),y&&(0,X.jsxs)(`div`,{className:`absolute inset-0 flex items-center justify-center gap-2 bg-background-deep/50 text-sm text-foreground`,children:[(0,X.jsx)(ne,{className:`w-4 h-4 animate-spin`}),` `,s(`common:states.saving`)]})]})}),x&&(0,X.jsx)(`p`,{role:`alert`,className:`shrink-0 text-sm text-destructive`,children:s(`modal.toast.captureFailed`)}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,X.jsxs)(G,{size:`sm`,variant:`ghost`,className:`gap-1.5`,onClick:a,disabled:y,children:[(0,X.jsx)(w,{className:`w-3.5 h-3.5`}),` `,s(`editor.reselect`)]}),(0,X.jsxs)(G,{size:`sm`,variant:`ghost`,className:`gap-1.5`,onClick:te,disabled:y,children:[(0,X.jsx)(se,{className:`w-3.5 h-3.5`}),` `,s(`common:actions.cancel`)]}),(0,X.jsxs)(G,{size:`sm`,className:`gap-1.5`,onClick:()=>void P(),disabled:y,"data-testid":`annotation-confirm`,children:[(0,X.jsx)(O,{className:`w-3.5 h-3.5`}),` `,D.length>0?r??s(`editor.createSpec`):s(`editor.skipContinue`)]})]})]})}var Sr=`native-browser:event`;function Cr(e){let t=(e??``).trim();if(!t)return null;if(t===`about:blank`)return t;let n=wr(t);if(n){if(n.protocol===`http:`||n.protocol===`https:`)return n.toString();let e=`${n.pathname}${n.search}${n.hash}`;if(!/^\d+([/?#].*)?$/.test(e))return null}let r=wr(`https://${t}`);if(r&&r.protocol===`https:`){let e=r.hostname.toLowerCase();return(e===`localhost`||e.endsWith(`.localhost`)||e===`[::1]`||/^127\./.test(e))&&(r.protocol=`http:`),r.toString()}return null}function wr(e){try{return new URL(e)}catch{return null}}function Tr(e){let t=(e,t)=>Number.isFinite(e)?e:t;return{x:Math.max(0,Math.round(t(e.left,0))),y:Math.max(0,Math.round(t(e.top,0))),width:Math.max(1,Math.round(t(e.width,1))),height:Math.max(1,Math.round(t(e.height,1)))}}var Er=null,Dr=null,Or=Promise.resolve();async function kr(){return(await i(()=>import(`./core-B3mKBIh5.js`).then(e=>e.i),__vite__mapDeps([0,1]))).invoke}function Ar(e){let t=e?.flag??ke,n=e?.tauri??s();return!t||!n?Promise.resolve(!1):(Er||=(async()=>{try{return await(await kr())(`browser_supported`)===!0}catch{return Er=null,!1}})(),Er)}async function jr(e){return await Ar(e)?(Dr||=Z(`browser_capture_supported`).then(e=>e===!0).catch(()=>(Dr=null,!1)),Dr):!1}async function Z(e,t){return(await kr())(e,t)}function Mr(e){let t=Or.then(e,e);return Or=t.catch(()=>{}),t}var Q={open:(e,t,n)=>Mr(()=>Z(`browser_open`,{ownerId:e,url:t,bounds:n})),navigate:(e,t)=>Z(`browser_navigate`,{ownerId:e,url:t}),back:e=>Z(`browser_back`,{ownerId:e}),forward:e=>Z(`browser_forward`,{ownerId:e}),reload:e=>Z(`browser_reload`,{ownerId:e}),setBounds:(e,t)=>Z(`browser_set_bounds`,{ownerId:e,bounds:t}),show:e=>Z(`browser_show`,{ownerId:e}),hide:e=>Z(`browser_hide`,{ownerId:e}),close:e=>Mr(()=>Z(`browser_close`,{ownerId:e})),devtools:e=>Z(`browser_devtools`,{ownerId:e}),zoom:(e,t)=>Z(`browser_zoom`,{ownerId:e,factor:t}),setSelectMode:(e,t)=>Z(`browser_set_select_mode`,{ownerId:e,enabled:t}),selection:e=>Z(`browser_selection`,{ownerId:e}),capture:(e,t)=>Z(`browser_capture`,{ownerId:e,selectionOnly:t}),onEvent:async(e,t)=>{let n=n=>{n.payload.ownerId===e&&t(n.payload)},{listen:r}=await i(async()=>{let{listen:e}=await import(`./event-Bt7f3wXe.js`).then(e=>e.i);return{listen:e}},__vite__mapDeps([2,1,0]));return r(Sr,n)}},Nr=e(r(),1),Pr=new Map,Fr=new Map;function Ir(e,t){let n=(Fr.get(e)??Promise.resolve()).catch(()=>{}).then(t);return Fr.set(e,n),n.finally(()=>{Fr.get(e)===n&&Fr.delete(e)}).catch(()=>{}),n}function Lr({ownerId:e,leaseRevision:t=0,onBusyChange:n,transferError:r,url:i,onClose:a,onFallback:s,onUrlChange:c,onCaptured:l,confirmLabel:u,selectLabel:d}){let{t:f}=v(`browser`),p=(0,Y.useRef)(null),m=(0,Y.useRef)(!1),[h,g]=(0,Y.useState)(i),[_,y]=(0,Y.useState)(i),[b,x]=(0,Y.useState)(null),[S,C]=(0,Y.useState)(!0),[T,E]=(0,Y.useState)(!1),[D,O]=(0,Y.useState)(null),[k,A]=(0,Y.useState)(!1),[j,M]=(0,Y.useState)(null),[N,ee]=(0,Y.useState)(!1),[P,F]=(0,Y.useState)(null);(0,Y.useEffect)(()=>(n?.(k||j!==null||N||P!==null),()=>{n?.(!1)}),[n,k,j,N,P]);let ne=(0,Y.useRef)(1),I=(0,Y.useRef)(null),L=(0,Y.useRef)(!1),R=(0,Y.useRef)(!1),z=(0,Y.useRef)(!1),B=(0,Y.useRef)(null),re=(0,Y.useRef)(i),ie=(0,Y.useRef)({url:i,onFallback:s,onUrlChange:c});ie.current={url:i,onFallback:s,onUrlChange:c},z.current=P!==null;let V=(0,Y.useCallback)(async e=>{let t=I.current;if(!(!t||!L.current)){O(null);try{await e(t)}catch(e){I.current===t&&O(e instanceof Error?e.message:String(e))}}},[]);(0,Y.useEffect)(()=>{let t=!1,n=null,r=0,i=null,a=e??crypto.randomUUID(),o=Symbol(a);Pr.set(a,o);let s=()=>{Ir(a,async()=>{Pr.get(a)===o&&(Pr.delete(a),await Q.close(a))}).catch(()=>{})};I.current=a,L.current=!1,E(!1);let c=()=>{t||r||(r=requestAnimationFrame(()=>{if(r=0,!L.current||z.current||R.current)return;let e=p.current?.getBoundingClientRect();if(!e||e.width<=0||e.height<=0)return;let t=Tr(e);JSON.stringify(t)!==JSON.stringify(B.current)&&(B.current=t,Q.setBounds(a,t).catch(()=>{B.current=null}))}))};return(async()=>{try{let e=await Q.onEvent(a,e=>{if(!t){if(e.kind===`resume`){!z.current&&!R.current&&Ir(a,async()=>{if(t||Pr.get(a)!==o||z.current||R.current)return;let n=p.current?.getBoundingClientRect();n&&await Q.open(a,e.url??re.current,Tr(n))}).catch(e=>{t||O(String(e))});return}e.kind===`nav`&&e.url?(y(e.url),ie.current.onUrlChange?.(e.url),M(null),A(!1),m.current||g(e.url)):e.kind===`title`?x(e.title??null):e.kind===`load-started`?C(!0):e.kind===`load-finished`?(C(!1),e.url&&!m.current&&g(e.url)):e.kind===`popup-error`?O(f(`popup.openFailed`)):e.kind===`popup-opened`&&O(null)}});if(t){e();return}n=e;let r=p.current?.getBoundingClientRect();if(!r)throw Error(`hole not measurable`);re.current=Cr(ie.current.url)??`about:blank`,B.current=Tr(r);let l=B.current;if(!await Ir(a,async()=>t||Pr.get(a)!==o?!1:(await Q.open(a,re.current,l),!0)))return;if(t){s();return}L.current=!0,E(!0),i=new ResizeObserver(c),p.current&&i.observe(p.current),window.addEventListener(`resize`,c),window.addEventListener(`scroll`,c,!0),window.visualViewport?.addEventListener(`resize`,c),window.visualViewport?.addEventListener(`scroll`,c),c()}catch{t||ie.current.onFallback()}})(),()=>{t=!0,cancelAnimationFrame(r),i?.disconnect(),window.removeEventListener(`resize`,c),window.removeEventListener(`scroll`,c,!0),window.visualViewport?.removeEventListener(`resize`,c),window.visualViewport?.removeEventListener(`scroll`,c),n?.(),I.current===a&&(I.current=null,L.current=!1),s()}},[e,t]),(0,Y.useEffect)(()=>{let e=Cr(i)??`about:blank`;!T||e===re.current||(re.current=e,g(e),V(t=>Q.navigate(t,e)))},[i,T,V]);let oe=(0,Y.useCallback)(async e=>{let t=I.current;if(!(!t||!L.current||R.current)){R.current=!0,ee(!0),O(null);try{let n=await Q.capture(t,e);if(I.current!==t||(await Q.hide(t),I.current!==t))return;z.current=!0,A(!1),F(n)}catch(e){I.current===t&&O(e instanceof Error?e.message:String(e))}finally{R.current=!1,I.current===t&&ee(!1)}}},[]);(0,Y.useEffect)(()=>{if(!k||!T)return;let e=I.current,t=!1,n,r=async()=>{try{let n=await Q.selection(e);if(t||I.current!==e)return;if(n){if(await Q.setSelectMode(e,!1),t||I.current!==e)return;M(n),A(!1),await oe(!0);return}}catch(n){if(t||I.current!==e)return;O(String(n));try{await Q.setSelectMode(e,!1),!t&&I.current===e&&A(!1)}catch(n){!t&&I.current===e&&O(String(n))}return}t||(n=setTimeout(r,200))};return r(),()=>{t=!0,clearTimeout(n)}},[k,T,oe]);let ce=async()=>{await V(async e=>{await Q.setSelectMode(e,!k),M(null),A(!k)})},le=async()=>{F(null),await V(async e=>{await new Promise(e=>requestAnimationFrame(()=>e()));let t=p.current?.getBoundingClientRect();t&&t.width>0&&t.height>0&&(B.current=Tr(t),await Q.setBounds(e,B.current)),await Q.show(e)})};(0,Y.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!z.current&&a()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a]);let ue=(0,Y.useCallback)(()=>{let e=Cr(h);e&&(g(e),V(t=>Q.navigate(t,e)))},[h,V]),de=(0,Y.useCallback)(e=>{ne.current=Math.min(3,Math.max(.25,e)),V(e=>Q.zoom(e,ne.current))},[V]);return typeof document>`u`?null:(0,Nr.createPortal)((0,X.jsx)(`div`,{className:`fixed inset-0 z-[80] bg-background-deep/60 backdrop-blur-md pointer-events-auto`,onClick:e=>{e.target===e.currentTarget&&!P&&a()},"data-testid":`native-browser-modal`,children:(0,X.jsxs)(`div`,{className:`absolute inset-x-[4%] inset-y-[3.5%] flex flex-col border border-border/70 rounded-2xl bg-background-deep overflow-hidden shadow-2xl ring-1 ring-black/20`,role:`dialog`,"aria-modal":`true`,"aria-label":f(`modal.dialogLabel`),onClick:e=>e.stopPropagation(),children:[!P&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border/50 bg-surface/80 shrink-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(G,{disabled:!T,variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":f(`common:actions.back`),onClick:()=>void V(Q.back),children:(0,X.jsx)(w,{className:`w-4 h-4`})}),(0,X.jsx)(G,{disabled:!T,variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":f(`modal.nav.forward`),onClick:()=>void V(Q.forward),children:(0,X.jsx)(Ie,{className:`w-4 h-4`})}),(0,X.jsx)(G,{disabled:!T,variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":f(`modal.nav.reload`),onClick:()=>void V(Q.reload),children:(0,X.jsx)(et,{className:`w-4 h-4`})})]}),(0,X.jsxs)(`form`,{className:`flex-1 flex items-center gap-2 min-w-0`,onSubmit:e=>{e.preventDefault(),ue()},children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 rounded-md border border-border bg-background px-2.5 py-1`,children:[(0,X.jsx)(qe,{className:`w-3.5 h-3.5 text-muted-foreground shrink-0`}),(0,X.jsx)(`input`,{value:h,onChange:e=>g(e.target.value),onFocus:()=>{m.current=!0},onBlur:()=>{m.current=!1},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),ue())},placeholder:f(`modal.address.placeholder`),"aria-label":f(`modal.address.label`),className:`flex-1 min-w-0 bg-transparent outline-none text-sm`})]}),(0,X.jsx)(G,{type:`submit`,size:`sm`,variant:`secondary`,className:`shrink-0`,children:f(`modal.address.go`)})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(G,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":f(`native.zoomOut`),title:f(`native.zoomOut`),onClick:()=>de(ne.current-.1),children:(0,X.jsx)(at,{className:`w-4 h-4`})}),(0,X.jsx)(G,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":f(`native.zoomIn`),title:f(`native.zoomIn`),onClick:()=>de(ne.current+.1),children:(0,X.jsx)(J,{className:`w-4 h-4`})}),(0,X.jsx)(G,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":f(`native.devtools`),title:f(`native.devtools`),onClick:()=>void V(Q.devtools),children:(0,X.jsx)(ae,{className:`w-4 h-4`})}),(0,X.jsx)(G,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":f(`native.openExternal`),title:f(`native.openExternal`),onClick:()=>void o(_),children:(0,X.jsx)(te,{className:`w-4 h-4`})}),(0,X.jsx)(G,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":f(`modal.closeBrowser`),onClick:a,children:(0,X.jsx)(se,{className:`w-4 h-4`})})]})]}),(0,X.jsxs)(`div`,{className:`px-3 py-1 text-[11px] text-muted-foreground truncate shrink-0 flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full shrink-0 ${S?`bg-accent-warning animate-pulse`:`bg-accent-success`}`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:b||_}),(0,X.jsx)(`span`,{className:`ml-auto shrink-0 rounded-full border border-accent-success/30 bg-accent-success/10 text-accent-success px-2 py-px text-[10px] font-medium`,children:f(`native.badge`)})]}),l&&(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border/50 px-3 py-2 shrink-0`,children:[(0,X.jsxs)(G,{variant:k?`secondary`:`ghost`,size:`sm`,disabled:!T||N,"aria-pressed":k,onClick:()=>void ce(),children:[(0,X.jsx)(Qe,{className:`mr-1.5 h-3.5 w-3.5`}),d??f(`native.selectElement`)]}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-muted-foreground`,children:k?f(`native.selectHint`):j?.selector}),(0,X.jsxs)(G,{variant:`secondary`,size:`sm`,disabled:!T||N||k||_===`about:blank`,onClick:()=>void oe(j!==null),children:[(0,X.jsx)(Le,{className:`mr-1.5 h-3.5 w-3.5`}),f(N?`native.capturing`:j?`native.captureSelection`:`native.capturePage`)]})]})]}),(D||r)&&(0,X.jsx)(`div`,{role:`alert`,className:`border-b border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive shrink-0`,children:D||r}),P&&l&&(0,X.jsx)(xr,{screenshotDataUrl:P.screenshotDataUrl,confirmLabel:u,onConfirm:async e=>{await l({...P,screenshotDataUrl:e.screenshotDataUrl})},onReselect:()=>{le()},onCancel:a}),(0,X.jsx)(`div`,{ref:p,className:P?`hidden`:`relative flex-1 min-h-0 overflow-hidden`,children:S&&(0,X.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm text-muted-foreground`,children:f(`modal.status.opening`)})})]})}),document.body)}function Rr(e){let t=e.schedule??(e=>requestAnimationFrame(e)),n=e.cancel??(e=>cancelAnimationFrame(e)),r=e.now??(()=>typeof performance<`u`?performance.now():Date.now()),i=e.release??(()=>{}),a={received:0,decoded:0,drawn:0,droppedStale:0,droppedUndrawn:0,decodeMsTotal:0,drawMsTotal:0},o=!1,s=!1,c=null,l=null,u=null,d=()=>{u=null;let t=l;if(l=null,t==null||o){t!=null&&f(t);return}let n=r();try{e.draw(t),a.drawn++,a.drawMsTotal+=r()-n}catch{}finally{f(t)}},f=e=>{try{i(e)}catch{}},p=()=>{u==null&&!o&&(u=t(d))},m=t=>{s=!0;let n=r();e.decode(t).then(e=>{if(o){f(e);return}a.decoded++,a.decodeMsTotal+=r()-n,l!=null&&(a.droppedUndrawn++,f(l)),l=e,p(),h()},()=>{h()})},h=()=>{if(o){s=!1;return}let e=c;c=null,e==null?s=!1:m(e)};return{push(e){if(!o){if(a.received++,s){c!=null&&a.droppedStale++,c=e;return}m(e)}},stats(){return{...a}},dispose(){if(!o){if(o=!0,c=null,u!=null){try{n(u)}catch{}u=null}l!=null&&(f(l),l=null)}}}}var zr=`specrails-desktop:browser-capture-debug`;function Br(){try{return typeof localStorage<`u`&&localStorage.getItem(zr)===`1`}catch{return!1}}function Vr(e,t,n){let r=Math.max(1,n),i=t.decoded-e.decoded,a=t.drawn-e.drawn,o=e=>Math.round(e*10)/10;return{fpsReceived:o((t.received-e.received)*1e3/r),fpsDrawn:o(a*1e3/r),droppedStale:t.droppedStale-e.droppedStale,droppedUndrawn:t.droppedUndrawn-e.droppedUndrawn,avgDecodeMs:i>0?o((t.decodeMsTotal-e.decodeMsTotal)/i):0,avgDrawMs:a>0?o((t.drawMsTotal-e.drawMsTotal)/a):0}}function Hr(e,t=e=>console.table([e]),n=2e3,r=()=>Date.now()){let i=e(),a=r(),o=setInterval(()=>{let n=e(),o=r();t(Vr(i,n,o-a)),i=n,a=o},n);return()=>clearInterval(o)}function Ur(e){let{projectId:t,open:n,initialUrl:r}=e,i=(0,Y.useRef)(null),a=(0,Y.useRef)(null),o=(0,Y.useRef)(null),s=(0,Y.useRef)(0),c=(0,Y.useRef)(0),l=(0,Y.useRef)(null),u=(0,Y.useRef)(null),f=(0,Y.useCallback)(()=>{let e=l.current,t=u.current,n=a.current;if(!(!e||!n||n.readyState!==WebSocket.OPEN)&&!(t&&t.width===e.width&&t.height===e.height&&t.deviceScaleFactor===e.deviceScaleFactor))try{n.send(JSON.stringify({type:`input`,event:{type:`resize`,...e}})),u.current=e}catch{}},[]),p=(0,Y.useRef)(0),m=(0,Y.useRef)(new Map),h=(0,Y.useCallback)(()=>{if(p.current!==0||m.current.size===0)return;let e=[...m.current.values()];m.current.clear();for(let t of e)Xn(t.projectId,t.sessionId)},[]),[g,_]=(0,Y.useState)({status:`connecting`,errorMsg:null,url:null,title:null,viewport:{width:1280,height:800},hoverRect:null,hoverSelector:null,hoverPath:null,popup:null,popupError:null});(0,Y.useEffect)(()=>{if(!n||!t)return;let e=!1,c=null;u.current=null,_(e=>({...e,status:`connecting`,errorMsg:null,popup:null,popupError:null}));let h=Rr({decode:e=>createImageBitmap(new Blob([e],{type:`image/jpeg`})),draw:e=>{let t=i.current;t&&(t.width!==e.width&&(t.width=e.width),t.height!==e.height&&(t.height=e.height),t.getContext(`2d`)?.drawImage(e,0,0))},release:e=>e.close()}),g=Br()?Hr(()=>h.stats()):null;return(async()=>{try{let n=await Bn(t,r);if(e){Xn(t,n.id);return}c=n.id,o.current={id:n.id,projectId:t},_(e=>({...e,url:n.url,title:n.title,viewport:l.current??{width:n.viewportWidth,height:n.viewportHeight}}));let i=Qn(n.id,t);a.current=i,i.onmessage=e=>{if(typeof e.data==`string`){try{let t=JSON.parse(e.data);if(t.type===`ready`)_(e=>({...e,status:`ready`,url:t.url??e.url,title:t.title??e.title,viewport:l.current??t.viewport??e.viewport})),f();else if(t.type===`nav`)_(e=>({...e,url:t.url??e.url,title:t.title??e.title}));else if(t.type===`hover`)_(e=>({...e,hoverRect:t.rect??null,hoverSelector:t.selector??null,hoverPath:t.path??null}));else if(t.type===`popup`){let e=typeof t.count==`number`?t.count:0;s.current+=1,_(n=>({...n,popup:e>0?{count:e,active:t.active===!0,url:t.url??null}:null,popupError:null}))}}catch{}return}h.push(e.data)},i.onopen=()=>{e||(f(),_(e=>({...e,status:`ready`})))},i.onerror=()=>{e||_(e=>({...e,status:`error`,errorMsg:d.t(`browser:session.connectionError`)}))},i.onclose=()=>{e||_(e=>({...e,status:`error`,errorMsg:d.t(`browser:session.lostConnection`)}))}}catch(t){if(e)return;let n=t instanceof Ln?d.t(`browser:session.tooManySessions`):t instanceof Rn?d.t(`browser:session.launchFailed`):d.t(`browser:session.openFailed`);_(e=>({...e,status:`error`,errorMsg:n}))}})(),()=>{e=!0,g?.(),h.dispose();let n=a.current;if(n){n.onmessage=null,n.onopen=null,n.onerror=null,n.onclose=null;try{n.close()}catch{}}a.current=null;let r=c;r&&o.current?.id===r&&o.current.projectId===t&&(o.current=null),r&&(p.current>0?m.current.set(`${t}\0${r}`,{sessionId:r,projectId:t}):Xn(t,r))}},[n,t,r,h,f]);let v=(0,Y.useCallback)(e=>{let t=a.current;if(t&&t.readyState===WebSocket.OPEN)try{t.send(JSON.stringify({type:`input`,event:e}))}catch{}},[]),y=(0,Y.useCallback)(async(e,t)=>{let n=o.current;if(n)try{let r=await Vn(n.projectId,n.id,e,t);if(o.current!==n)return;r.target!==`popup`&&_(e=>({...e,url:r.url,title:r.title}))}catch{}},[]),b=(0,Y.useCallback)(async(e,t,n)=>{let r=o.current;if(!r)throw Error(`No active browser session`);p.current+=1;try{return await Hn(r.projectId,r.id,e,t,n)}finally{p.current=Math.max(0,p.current-1),h()}},[h]),x=(0,Y.useCallback)(async(e,t,n,r)=>{let i=o.current;if(!i)throw Error(`No active browser session`);p.current+=1;try{return await Wn(i.projectId,i.id,e,t,n,r)}finally{p.current=Math.max(0,p.current-1),h()}},[h]),S=(0,Y.useCallback)(async(e,t)=>{let n=o.current;return n?Kn(n.projectId,n.id,e,t):{text:``}},[]),C=(0,Y.useCallback)((e,t,n=window.devicePixelRatio||1)=>{if(!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0)return;let r=Math.max(1,Math.round(e)),i=Math.max(1,Math.round(t));l.current={width:r,height:i,deviceScaleFactor:Number.isFinite(n)?Math.min(2,Math.max(1,n)):1},_(e=>e.viewport.width===r&&e.viewport.height===i?e:{...e,viewport:{width:r,height:i}}),f()},[f]),w=(0,Y.useCallback)(e=>{let t=a.current;if(t&&t.readyState===WebSocket.OPEN)try{t.send(JSON.stringify({type:`probe`,x:e.x,y:e.y}))}catch{}},[]),T=(0,Y.useCallback)(()=>{_(e=>e.hoverRect||e.hoverPath?{...e,hoverRect:null,hoverSelector:null,hoverPath:null}:e)},[]),E=(0,Y.useCallback)(async(e,t)=>{let n=o.current;return n?qn(n.projectId,n.id,e,t):null},[]),D=(0,Y.useCallback)(async e=>{let t=o.current;if(!t)return;let n=s.current,r=++c.current,i=()=>o.current===t&&s.current===n&&c.current===r;try{await Jn(t.projectId,t.id,e),i()&&_(e=>({...e,popupError:null}))}catch{i()&&_(e=>({...e,popupError:d.t(`browser:session.connectionError`)}))}},[]);return{...g,canvasRef:i,forwardInput:v,navigate:y,capture:b,captureBreakpoints:x,clipboard:S,navigateElement:E,setViewport:C,probe:w,clearHover:T,setPopupView:D}}function Wr(e,t,n,r){let i=(0,Y.useRef)(t);i.current=t,(0,Y.useEffect)(()=>{let t=e.current;if(!n||!t)return;let a=!1,o=null,s=0,c=0,l=0,u=null,d=()=>{if(o=null,a)return;let e=r??t.getBoundingClientRect();if(!Number.isFinite(e.width)||!Number.isFinite(e.height)||e.width<=0||e.height<=0)return;let n=Math.max(1,Math.round(e.width)),u=Math.max(1,Math.round(e.height)),d=window.devicePixelRatio,f=Number.isFinite(d)?Math.min(2,Math.max(1,d)):1;n===s&&u===c&&f===l||(s=n,c=u,l=f,i.current(n,u,f))},f=()=>{a||o===null&&(o=requestAnimationFrame(d))},p=()=>{u?.removeEventListener(`change`,m),u=typeof window.matchMedia==`function`?window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`):null,u?.addEventListener(`change`,m)},m=()=>{f(),p()};d();let h=typeof ResizeObserver>`u`?null:new ResizeObserver(f);return h?.observe(t),window.addEventListener(`resize`,f),p(),()=>{a=!0,o!==null&&cancelAnimationFrame(o),h?.disconnect(),u?.removeEventListener(`change`,m),window.removeEventListener(`resize`,f)}},[e,n,r?.width,r?.height])}function Gr({open:e,url:t,projectId:n,onClose:r}){let[i,a]=(0,Y.useState)(`probing`);(0,Y.useEffect)(()=>{if(!e||i!==`probing`)return;let t=!0;return Ar().then(e=>{t&&a(e?`native`:`screencast`)}),()=>{t=!1}},[e,i]);let o=(0,Y.useCallback)(()=>a(`screencast`),[]);return!e||i===`probing`?null:i===`native`?(0,X.jsx)(Lr,{url:t,onClose:r,onFallback:o}):(0,X.jsx)(Kr,{open:e,url:t,projectId:n,onClose:r})}function Kr({open:e,url:t,projectId:n,onClose:r}){let{t:i}=v(`browser`),a=Ur({projectId:n,open:e,initialUrl:t}),{canvasRef:o,viewport:s,status:c,errorMsg:l,url:u,title:d,popup:f,popupError:p,setViewport:m}=a,[h,g]=(0,Y.useState)(t),_=(0,Y.useRef)(null);Wr(_,m,e);let y=(0,Y.useRef)(a.forwardInput);y.current=a.forwardInput;let b=(0,Y.useRef)(null),x=(0,Y.useCallback)(()=>(b.current??=$n(e=>y.current(e)),b.current),[]);(0,Y.useEffect)(()=>()=>{b.current?.dispose(),b.current=null},[]);let S=f?.active?f.url??`about:blank`:u??``;(0,Y.useEffect)(()=>{g(S)},[S,f?.active]),(0,Y.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,r]);let C=(0,Y.useCallback)((e,t)=>{let n=o.current?.getBoundingClientRect();return n?er({x:e,y:t},{left:n.left,top:n.top,width:n.width,height:n.height},s):{x:0,y:0}},[o,s]),T=e=>e===2?`right`:e===1?`middle`:`left`,E=(0,Y.useCallback)(e=>{let t=C(e.clientX,e.clientY);x().move(t.x,t.y)},[C,x]),D=(0,Y.useCallback)(e=>{let t=C(e.clientX,e.clientY),n=x();n.move(t.x,t.y),n.flush(),a.forwardInput({type:`mouse`,action:`down`,x:t.x,y:t.y,button:T(e.button),clickCount:e.detail||1})},[C,a,x]),O=(0,Y.useCallback)(e=>{let t=C(e.clientX,e.clientY),n=x();n.move(t.x,t.y),n.flush(),a.forwardInput({type:`mouse`,action:`up`,x:t.x,y:t.y,button:T(e.button),clickCount:e.detail||1})},[C,a,x]),k=(0,Y.useCallback)(e=>{let t=C(e.clientX,e.clientY);x().wheel(t.x,t.y,e.deltaX,e.deltaY)},[C,x]),A=(0,Y.useCallback)(e=>{if(e.key===`Escape`)return;let t=e.metaKey||e.ctrlKey;if(t&&(e.key===`c`||e.key===`v`||e.key===`x`)){e.preventDefault();let t=e.key;(async()=>{try{if(t===`v`){let e=await navigator.clipboard.readText();e&&await a.clipboard(`paste`,e)}else{let{text:e}=await a.clipboard(t===`x`?`cut`:`copy`);e&&await navigator.clipboard.writeText(e)}}catch{}})();return}let n={type:`key`,action:`down`,key:e.key,code:e.code,text:!t&&e.key.length===1?e.key:void 0};a.forwardInput(n),(e.key===`Tab`||e.key===` `||e.key.startsWith(`Arrow`))&&e.preventDefault()},[a]),j=(0,Y.useCallback)(e=>{e.key!==`Escape`&&a.forwardInput({type:`key`,action:`up`,key:e.key,code:e.code})},[a]),M=(0,Y.useCallback)(()=>{a.navigate(`goto`,h)},[a,h]);return!e||typeof document>`u`?null:(0,Nr.createPortal)((0,X.jsx)(`div`,{className:`fixed inset-0 z-[80] bg-background-deep/60 backdrop-blur-md pointer-events-auto`,onClick:e=>{e.target===e.currentTarget&&r()},"data-testid":`webview-modal`,children:(0,X.jsxs)(`div`,{className:`absolute inset-x-[4%] inset-y-[3.5%] flex flex-col border border-border/70 rounded-2xl bg-background-deep overflow-hidden shadow-2xl ring-1 ring-black/20`,role:`dialog`,"aria-modal":`true`,"aria-label":i(`modal.dialogLabel`),onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border/50 bg-surface/80 shrink-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(G,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":i(`common:actions.back`),onClick:()=>a.navigate(`back`),children:(0,X.jsx)(w,{className:`w-4 h-4`})}),(0,X.jsx)(G,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":i(`modal.nav.forward`),onClick:()=>a.navigate(`forward`),children:(0,X.jsx)(Ie,{className:`w-4 h-4`})}),(0,X.jsx)(G,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":i(`modal.nav.reload`),onClick:()=>a.navigate(`reload`),children:(0,X.jsx)(et,{className:`w-4 h-4`})})]}),(0,X.jsxs)(`form`,{className:`flex-1 flex items-center gap-2 min-w-0`,onSubmit:e=>{e.preventDefault(),M()},children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 rounded-md border border-border bg-background px-2.5 py-1`,children:[(0,X.jsx)(qe,{className:`w-3.5 h-3.5 text-muted-foreground shrink-0`}),(0,X.jsx)(`input`,{value:h,onChange:e=>g(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),M())},placeholder:i(`modal.address.placeholder`),"aria-label":i(`modal.address.label`),className:`flex-1 min-w-0 bg-transparent outline-none text-sm`})]}),(0,X.jsx)(G,{type:`submit`,size:`sm`,variant:`secondary`,className:`shrink-0`,disabled:c===`error`,children:i(`modal.address.go`)})]}),(0,X.jsx)(G,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":i(`modal.closeBrowser`),onClick:r,children:(0,X.jsx)(se,{className:`w-4 h-4`})})]}),(0,X.jsxs)(`div`,{className:`px-3 py-1 text-[11px] text-muted-foreground truncate shrink-0 flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full shrink-0 ${c===`ready`?`bg-accent-success`:c===`error`?`bg-destructive`:`bg-accent-warning animate-pulse`}`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:c===`connecting`?i(`modal.status.connecting`):c===`error`?l??i(`modal.status.unavailable`):f?.active?i(`popup.loginWindow`,{origin:Yn(f.url)}):d||``})]}),p&&(0,X.jsx)(`div`,{role:`alert`,className:`px-3 py-1.5 text-xs text-destructive border-b border-border/40 shrink-0`,children:p}),f&&(0,X.jsxs)(`div`,{"data-testid":`webview-popup-bar`,className:`flex items-center gap-2 px-3 py-1.5 text-xs border-b shrink-0 ${f.active?`bg-accent-info/10 border-accent-info/30 text-accent-info`:`bg-surface/70 border-border/40 text-muted-foreground`}`,children:[(0,X.jsx)(te,{className:`w-3.5 h-3.5 shrink-0`}),f.active?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`truncate font-medium`,children:i(`popup.loginWindow`,{origin:Yn(f.url)})}),f.count>1&&(0,X.jsx)(`span`,{className:`shrink-0 opacity-70`,children:i(`popup.stacked`,{count:f.count-1})}),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>a.setPopupView(`root`),className:`ml-auto shrink-0 inline-flex items-center gap-1 h-6 px-2 rounded-md border border-current/30 hover:bg-card/60 transition-colors`,children:[(0,X.jsx)(w,{className:`w-3 h-3`}),i(`popup.backToPage`)]})]}):(0,X.jsxs)(`button`,{type:`button`,onClick:()=>a.setPopupView(`popup`),className:`inline-flex items-center gap-1 h-6 px-2 rounded-md border border-border/50 hover:bg-card/60 hover:text-foreground transition-colors`,children:[i(`popup.show`),f.count>1&&(0,X.jsx)(`span`,{className:`opacity-70`,children:i(`popup.stacked`,{count:f.count-1})})]})]}),(0,X.jsx)(`div`,{ref:_,className:`relative flex-1 min-h-0 overflow-hidden flex items-center justify-center outline-none`,tabIndex:0,onKeyDown:A,onKeyUp:j,children:c===`error`?(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center max-w-md px-6`,children:[(0,X.jsx)(V,{className:`w-8 h-8 text-accent-warning`}),(0,X.jsx)(`p`,{className:`text-sm text-foreground/90`,children:l??i(`modal.error.unavailable`)})]}):(0,X.jsx)(`canvas`,{ref:o,style:{maxWidth:`min(100%, ${s.width}px)`,maxHeight:`min(100%, ${s.height}px)`},className:`max-w-full max-h-full block shadow-2xl cursor-default`,onPointerMove:E,onPointerDown:D,onPointerUp:O,onContextMenu:e=>e.preventDefault(),onWheel:k})})]})}),document.body)}var qr=(0,Y.createContext)(null);function Jr({children:e}){let{activeProjectId:t}=x(),[n,r]=(0,Y.useState)(null),i=(0,Y.useCallback)(e=>r(e),[]),a=Fn();return(0,X.jsxs)(qr.Provider,{value:{openWebView:i,canOpenWebView:a&&!!t},children:[e,a&&n&&t&&(0,X.jsx)(Gr,{open:!0,url:n,projectId:t,onClose:()=>r(null)})]})}function Yr(){return(0,Y.useContext)(qr)??{openWebView:()=>{},canOpenWebView:!1}}var Xr={analyzing:`activity:smash.stage.analyzing`,identifying:`activity:smash.stage.identifying`,ordering:`activity:smash.stage.ordering`},Zr=(0,Y.createContext)(null);function $(e){return`smash:${e}`}async function Qr(e,t){try{let n=await fetch(`${f}/api/projects/${e}/tickets/${t}/smash`,{method:`POST`});if(n.ok)S.loading(d.t(`activity:smash.retrying`),{id:$(t)});else{let e=await n.json().catch(()=>({}));S.error(e.reason?d.t(`activity:smash.couldNotRetryWithReason`,{reason:e.reason}):d.t(`activity:smash.couldNotRetry`),{id:$(t)})}}catch(e){S.error(d.t(`activity:smash.retryFailed`,{message:e.message}),{id:$(t)})}}async function $r(e,t,n){try{let r=await fetch(`${f}/api/projects/${e}/tickets/${t}/smash/undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({smashedAt:n})});if(r.ok)S.success(d.t(`activity:smash.undone`),{id:$(t),duration:3e3});else{let e=await r.json().catch(()=>({}));S.error(e.reason?d.t(`activity:smash.undoFailedWithReason`,{reason:e.reason}):d.t(`activity:smash.undoFailed`),{id:$(t)})}}catch(e){S.error(d.t(`activity:smash.undoFailedWithReason`,{reason:e.message}),{id:$(t)})}}function ei({children:e}){let{registerHandler:t,unregisterHandler:n}=m(),[r,i]=(0,Y.useState)({}),a=(0,Y.useRef)(new Map),o=(0,Y.useRef)(new Map),s=(0,Y.useCallback)(e=>{let t=e;if(!t||t.type!==`smash.started`)return;let n=t.ticketId,r=t.runId,o=t.projectId,s=t.timestamp,c=t.ticketTitle;typeof n!=`number`||!r||!o||(a.current.set(n,o),i(e=>({...e,[n]:{ticketId:n,runId:r,stage:`analyzing`,startedAt:s??new Date().toISOString(),ticketTitle:c}})),S.loading(d.t(Xr.analyzing),{id:$(n),description:c?d.t(`activity:smash.onTitled`,{title:c}):d.t(`activity:smash.onThisSpec`)}))},[]),c=(0,Y.useCallback)(e=>{let t=e;if(!t||t.type!==`smash.progress`)return;let n=t.ticketId,r=t.stage;if(typeof n!=`number`||!r)return;let a;i(e=>{let t=e[n];return t?(a=t.ticketTitle,{...e,[n]:{...t,stage:r}}):e}),S.loading(d.t(Xr[r]),{id:$(n),description:a?d.t(`activity:smash.onTitled`,{title:a}):d.t(`activity:smash.onThisSpec`)})},[]),l=(0,Y.useCallback)(e=>{let t=e;if(!t||t.type!==`smash.completed`)return;let n=t.ticketId,r=t.runId,a=t.projectId,s=t.smashedAt,c=t.childrenIds;typeof n!=`number`||!r||!a||!s||!c||(o.current.set(r,s),i(e=>{let t={...e};return delete t[n],t}),S.success(d.t(`activity:smash.split`,{count:c.length}),{id:$(n),duration:1e4,action:{label:d.t(`activity:smash.undoAction`),onClick:()=>void $r(a,n,s)}}))},[]),u=(0,Y.useCallback)(e=>{let t=e;if(!t||t.type!==`smash.failed`)return;let n=t.ticketId,r=t.projectId,o=t.reason??`unknown`;if(typeof n!=`number`||!r)return;a.current.set(n,r),i(e=>{let t={...e};return delete t[n],t});let s=o===`invalid-output`?d.t(`activity:smash.failReason.invalidOutput`):o===`timeout`?d.t(`activity:smash.failReason.timeout`):o===`model_error`?d.t(`activity:smash.failReason.modelError`):o===`crashed`?d.t(`activity:smash.failReason.crashed`):d.t(`activity:smash.failReason.generic`,{reason:o});S.error(d.t(`activity:smash.couldNotComplete`),{id:$(n),description:s,action:{label:d.t(`common:actions.retry`),onClick:()=>void Qr(r,n)},duration:15e3})},[]),f=(0,Y.useCallback)(e=>{let t=e;if(!t||t.type!==`smash.undone`)return;let n=t.ticketId;typeof n==`number`&&(S.dismiss($(n)),S.success(d.t(`activity:smash.undone`),{id:$(n),duration:3e3}))},[]);(0,Y.useLayoutEffect)(()=>(t(`_smash_started`,s),t(`_smash_progress`,c),t(`_smash_completed`,l),t(`_smash_failed`,u),t(`_smash_undone`,f),()=>{n(`_smash_started`),n(`_smash_progress`),n(`_smash_completed`),n(`_smash_failed`),n(`_smash_undone`)}),[t,n,s,c,l,u,f]),(0,Y.useEffect)(()=>()=>{a.current.clear(),o.current.clear()},[]);let p=(0,Y.useMemo)(()=>({inflight:r}),[r]);return(0,X.jsx)(Zr.Provider,{value:p,children:e})}function ti(e){let t=(0,Y.useContext)(Zr);return!t||e==null?null:t.inflight[e]??null}var ni=150,ri={analyzing:0,identifying:1,ordering:2},ii={analyzing:`smash.stage.analyzing`,identifying:`smash.stage.identifying`,ordering:`smash.stage.ordering`};function ai({stage:e,minDisplayMs:t=ni}){let{t:n}=v(`activity`),[r,i]=(0,Y.useState)(e),a=(0,Y.useRef)(Date.now()),o=(0,Y.useRef)(null);if((0,Y.useEffect)(()=>{if(e===r)return;let n=Date.now()-a.current,s=Math.max(0,t-n);return o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{i(e),a.current=Date.now(),o.current=null},s),()=>{o.current&&clearTimeout(o.current)}},[e,r,t]),!r)return null;let s=ri[r];return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 rounded-md border border-accent-highlight/40 bg-accent-highlight/10 text-sm text-foreground`,role:`status`,"aria-live":`polite`,"data-testid":`smash-status-pills`,children:[(0,X.jsx)(ne,{className:`h-4 w-4 animate-spin text-accent-highlight`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`flex items-center gap-1.5`,children:[`analyzing`,`identifying`,`ordering`].map(e=>(0,X.jsx)(`span`,{className:[`inline-block w-1.5 h-1.5 rounded-full transition-all`,ri[e]<=s?`bg-accent-highlight`:`bg-muted`,e===r?`scale-125`:`scale-100`].join(` `),"aria-hidden":!0},e))}),(0,X.jsx)(`span`,{className:`font-medium`,children:n(ii[r])})]})}var oi={simple:{titleKey:`smashModal.modes.simple.title`,bulletKeys:[`smashModal.modes.simple.bullet1`,`smashModal.modes.simple.bullet2`,`smashModal.modes.simple.bullet3`],etaKey:`smashModal.modes.simple.eta`},full:{titleKey:`smashModal.modes.full.title`,bulletKeys:[`smashModal.modes.full.bullet1`,`smashModal.modes.full.bullet2`,`smashModal.modes.full.bullet3`,`smashModal.modes.full.bullet4`],etaKey:`smashModal.modes.full.eta`}};function si({open:e,ticketTitle:t,isReSmash:n,childrenCount:r,submitting:i=!1,onCancel:a,onConfirm:o}){let{t:s}=v(`activity`),[c,l]=(0,Y.useState)(`simple`),{panelRef:u,panelStyle:d,headerHandleProps:f,resizeHandles:p,isFloating:m,guardBackdrop:h}=ce();return e?(0,Nr.createPortal)((0,X.jsxs)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center`,role:`dialog`,"aria-modal":`true`,"data-testid":`smash-confirm-modal`,children:[(0,X.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-sm`,onClick:h(a)}),(0,X.jsxs)(`div`,{ref:u,className:`relative w-full max-w-lg m-4 rounded-xl glass-card border border-border/30 animate-in fade-in zoom-in-95 duration-150`,style:d,children:[(0,X.jsxs)(`div`,{...f,className:`flex items-start justify-between gap-3 px-5 py-4 border-b border-border/30 ${m?`cursor-grab active:cursor-grabbing`:``}`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-2 min-w-0`,children:[(0,X.jsx)(tt,{className:`w-5 h-5 text-accent-highlight shrink-0 mt-0.5`,"aria-hidden":!0}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:s(`smashModal.title`)}),(0,X.jsx)(`p`,{className:`text-[11px] text-muted-foreground truncate`,title:t,children:t})]})]}),(0,X.jsx)(`button`,{type:`button`,onClick:a,className:`h-7 w-7 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-surface/50 transition-colors shrink-0`,"aria-label":s(`common:actions.close`),children:(0,X.jsx)(se,{className:`w-4 h-4`})})]}),n&&r>0&&(0,X.jsx)(`div`,{className:`mx-5 mt-4 rounded-md border border-accent-warning/40 bg-accent-warning/10 px-3 py-2 text-xs text-foreground`,children:(0,X.jsx)(_,{t:s,i18nKey:`smashModal.reSmashWarning`,count:r})}),(0,X.jsxs)(`div`,{className:`px-5 py-4 space-y-3`,children:[(0,X.jsx)(`p`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium`,children:s(`smashModal.modePickerLabel`)}),[`simple`,`full`].map(e=>{let t=oi[e],n=c===e;return(0,X.jsx)(`button`,{type:`button`,onClick:()=>l(e),disabled:i,className:`w-full text-left rounded-lg border px-3 py-3 transition-colors ${n?`border-accent-highlight/60 bg-accent-highlight/10`:`border-border/40 bg-card/40 hover:bg-card/60 hover:border-border/60`}`,"data-testid":`smash-mode-${e}`,children:(0,X.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,X.jsx)(`div`,{className:`mt-0.5 h-3.5 w-3.5 rounded-full border-2 shrink-0 ${n?`border-accent-highlight bg-accent-highlight`:`border-muted-foreground/60`}`,"aria-hidden":!0}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-1`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm font-semibold text-foreground`,children:[e===`full`&&(0,X.jsx)(M,{className:`w-3.5 h-3.5 text-accent-highlight`,"aria-hidden":!0}),s(t.titleKey)]}),(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:s(t.etaKey)})]}),(0,X.jsx)(`ul`,{className:`space-y-0.5`,children:t.bulletKeys.map(e=>(0,X.jsxs)(`li`,{className:`text-[11px] text-foreground/70 leading-snug`,children:[`• `,s(e)]},e))})]})]})},e)})]}),(0,X.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-border/30 bg-surface/20`,children:[(0,X.jsx)(G,{variant:`ghost`,size:`sm`,onClick:a,disabled:i,children:s(`common:actions.cancel`)}),(0,X.jsxs)(G,{size:`sm`,onClick:()=>o(c),disabled:i,"data-testid":`smash-confirm-modal-continue`,children:[(0,X.jsx)(tt,{className:`w-3.5 h-3.5 mr-1.5`}),s(i?`smashModal.starting`:n?`smashModal.confirmReSmash`:`smashModal.smash`)]})]})]}),(0,X.jsx)(ue,{handles:p})]}),document.body):null}var ci=`## Contract Layer`;function li(e,t){return!(!t||e.status===`draft`||e.parent_epic_id!=null||!e.description?.includes(ci))}function ui({ticket:e,projectId:t,provider:n,featureFlagOn:r,childrenCount:i}){let{t:a}=v(`activity`),o=ti(e.id),[s,c]=(0,Y.useState)(!1),[l,u]=(0,Y.useState)(!1),[d,p]=(0,Y.useState)(e.origin_conversation_id?void 0:null);(0,Y.useEffect)(()=>{let r=e.origin_conversation_id;if(!r){p(null);return}let i=!1;return p(void 0),fetch(`${f}/api/projects/${t}/chat/conversations/${encodeURIComponent(r)}`).then(async e=>{if(!e.ok)throw Error(`origin conversation lookup failed (${e.status})`);let t=await e.json();i||p(t.conversation?.provider??n??null)}).catch(()=>{i||p(null)}),()=>{i=!0}},[t,n,e.origin_conversation_id]);let m=e.origin_conversation_id?d:n,h=r&&C(m),g=e.is_epic===!0,_=!g&&li(e,h),y=g&&h,b=g&&i>0,x=(0,Y.useCallback)(async n=>{if(h){u(!0);try{let r=await fetch(`${f}/api/projects/${t}/tickets/${e.id}/smash`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({mode:n})});if(!r.ok){let e=await r.json().catch(()=>({}));S.error(e.reason?a(`smash.couldNotStartWithReason`,{reason:e.reason}):a(`smash.couldNotStart`));return}c(!1)}catch(e){S.error(a(`smash.smashFailed`,{message:e.message}))}finally{u(!1)}}},[t,e.id,a,h]),w=(0,Y.useCallback)(async n=>{if(h){if(b){u(!0);try{if(!(await fetch(`${f}/api/projects/${t}/tickets/${e.id}/children`,{method:`DELETE`})).ok){S.error(a(`smash.couldNotDeleteChildren`)),u(!1);return}}catch(e){S.error(a(`smash.deleteFailed`,{message:e.message})),u(!1);return}}await x(n)}},[b,x,t,e.id,a,h]);return!_&&!y?null:o?(0,X.jsx)(`div`,{className:`flex flex-col gap-2`,"data-testid":`smash-actions-streaming`,children:(0,X.jsx)(ai,{stage:o.stage})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(G,{size:`sm`,variant:`outline`,onClick:()=>c(!0),className:`border-accent-highlight/40 text-accent-highlight hover:bg-accent-highlight/10`,"data-testid":y?`resmash-button`:`smash-button`,children:[(0,X.jsx)(tt,{className:`w-3.5 h-3.5 mr-1.5`}),a(y?`smash.reSmashButton`:`smash.smashButton`)]}),(0,X.jsx)(si,{open:s,ticketTitle:e.title,isReSmash:b,childrenCount:i,submitting:l,onCancel:()=>c(!1),onConfirm:w})]})}function di({epic:e,childExecutionOrder:t,totalChildren:n,onOpenEpic:r}){let{t:i}=v(`activity`);return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-accent-secondary/30 bg-accent-secondary/10 px-3 py-1.5 text-xs`,"data-testid":`epic-breadcrumb`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:r,className:`text-accent-secondary hover:underline font-medium`,children:[`← `,e.title]}),t!=null&&n>0&&(0,X.jsx)(`span`,{className:`text-foreground/60`,children:i(`epicChildren.step`,{order:t,total:n})})]})}var fi={critical:`bg-red-400`,high:`bg-orange-400`,medium:`bg-yellow-400`,low:`bg-slate-400`};function pi(e){return e?fi[e]:`bg-muted`}function mi(e){return[...e].sort((e,t)=>{let n=e.execution_order??1/0,r=t.execution_order??1/0;return n===r?e.id-t.id:n-r})}function hi({ticket:e,allTickets:t,onOpenTicket:n}){let{t:r}=v(`activity`),i=e.is_epic===!0,a=e.parent_epic_id!=null;if(!i&&!a)return null;if(i){let i=mi(t.filter(t=>t.parent_epic_id===e.id));return(0,X.jsx)(gi,{header:r(`family.subSpecsHeader`,{count:i.length}),rows:i,currentId:e.id,onOpenTicket:n,emptyMessage:r(`family.emptySubSpecs`)})}let o=t.find(t=>t.id===e.parent_epic_id)??null,s=mi(t.filter(t=>t.parent_epic_id===e.parent_epic_id)),c=o?[o,...s]:s;return(0,X.jsx)(gi,{header:r(`family.familyHeader`,{count:s.length}),rows:c,currentId:e.id,onOpenTicket:n,emptyMessage:r(`family.noSiblings`)})}function gi({header:e,rows:t,currentId:n,onOpenTicket:r,emptyMessage:i}){let{t:a}=v(`activity`);return(0,X.jsxs)(`div`,{"data-testid":`epic-family-sidebar`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 mb-1.5`,children:[(0,X.jsx)(tt,{className:`w-3 h-3 text-accent-highlight`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider`,children:e})]}),t.length===0?(0,X.jsx)(`p`,{className:`text-[10px] text-foreground/50 italic`,children:i}):(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:t.map(e=>{let t=e.id===n,i=e.is_epic===!0;return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{t||r(e.id)},disabled:t,"aria-label":a(i?`family.openParentEpic`:`family.openSubSpec`,{title:e.title}),"aria-current":t?`page`:void 0,className:[`w-full flex items-center gap-1.5 rounded px-1.5 py-1 text-left transition-colors`,t?`bg-accent-highlight/15 cursor-default`:`hover:bg-muted/30 cursor-pointer`].join(` `),"data-testid":`epic-family-row-${e.id}`,children:[i?(0,X.jsx)(A,{className:`w-3 h-3 text-accent-highlight flex-shrink-0`,"aria-hidden":!0}):(0,X.jsx)(`span`,{className:`text-[9px] tabular-nums text-foreground/40 w-3 text-center flex-shrink-0`,children:e.execution_order??`–`}),(0,X.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full flex-shrink-0 ${pi(e.priority)}`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`text-[11px] truncate ${t?`text-foreground font-medium`:`text-foreground/80`}`,title:e.title,children:e.title})]})},e.id)})})]})}var _i=224,vi=8,yi=8;function bi({rails:e,onMoveToRail:t,onClose:n,anchorRect:r}){let{t:i}=v(`tickets`),a=(0,Y.useRef)(null),[o,s]=(0,Y.useState)(!1);(0,Y.useLayoutEffect)(()=>{let e=requestAnimationFrame(()=>s(!0));return()=>cancelAnimationFrame(e)},[]),(0,Y.useEffect)(()=>{function e(e){a.current&&(a.current.contains(e.target)||n())}function t(e){e.key===`Escape`&&n()}return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[n]);let{top:c,left:l,caretLeft:u}=(0,Y.useMemo)(()=>{let e=r.left+r.width/2,t=e-_i/2,n=window.innerWidth-_i-vi,i=Math.max(vi,Math.min(n,t)),a=e-i,o=Math.max(12,Math.min(_i-12,a));return{top:r.bottom+yi,left:i,caretLeft:o}},[r]);return(0,X.jsxs)(`div`,{ref:a,role:`dialog`,"aria-label":i(`rail.popoverTitle`),"data-testid":`move-to-rail-popover`,style:{top:c,left:l,width:_i,opacity:+!!o,transform:o?`translateY(0) scale(1)`:`translateY(-4px) scale(0.97)`,transformOrigin:`${u}px top`,transition:`opacity 140ms ease-out, transform 160ms cubic-bezier(0.2, 0.9, 0.3, 1)`},className:`fixed z-50 rounded-xl border border-border/60 bg-card/95 backdrop-blur shadow-xl shadow-black/40 p-1`,children:[(0,X.jsx)(`div`,{"aria-hidden":!0,className:`absolute w-2 h-2 rotate-45 bg-card/95 border-l border-t border-border/60`,style:{top:-5,left:u-4}}),(0,X.jsx)(`div`,{className:`px-2 py-1.5 text-[10px] uppercase tracking-wider text-muted-foreground/70 font-medium`,children:i(`rail.popoverTitle`)}),e.length===0?(0,X.jsx)(`div`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:i(`rail.noRails`)}):(0,X.jsx)(`ul`,{className:`flex flex-col`,children:e.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{t(e.id),n()},className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-lg text-left text-sm hover:bg-accent-info/10 hover:text-accent-info transition-colors`,children:[e.status===`running`?(0,X.jsx)(L,{className:`w-3 h-3 text-accent-success animate-pulse shrink-0`,"aria-hidden":!0}):(0,X.jsx)(Be,{className:`w-3 h-3 text-muted-foreground/60 shrink-0`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`flex-1 truncate`,children:e.label}),(0,X.jsx)(Re,{className:`w-3.5 h-3.5 text-muted-foreground/40 shrink-0`,"aria-hidden":!0})]})},e.id))})]})}var xi=900,Si=.2,Ci=[`todo`,`in_progress`,`done`,`cancelled`],wi={draft:`ticketStatus.draft`,todo:`ticketStatus.todo`,in_progress:`ticketStatus.inProgress`,on_review:`ticketStatus.onReview`,done:`ticketStatus.done`,cancelled:`ticketStatus.cancelled`},Ti=[{value:`critical`,labelKey:`priority.critical`,className:`text-red-400`},{value:`high`,labelKey:`priority.high`,className:`text-orange-400`},{value:`medium`,labelKey:`priority.medium`,className:`text-yellow-400`},{value:`low`,labelKey:`priority.low`,className:`text-slate-400`}];function Ei(e){return e.jira_epic_key&&e.jira_url?e.jira_url.replace(/\/browse\/[^/]+$/,`/browse/${e.jira_epic_key}`):null}var Di={manual:`source.manual`,"product-backlog":`source.productBacklog`,"propose-spec":`source.proposeSpec`,"get-backlog-specs":`source.getBacklogSpecs`,"free-prompt":`source.freePrompt`};function Oi({ticket:e,allLabels:t,allTickets:n,onClose:r,onOpenTicket:i,onSave:a,onDelete:s,rails:c,onMoveToRail:l,onRemoveFromRail:u,embedded:d=!1}){let{t:f}=v(`tickets`),{t:p}=v(`jira`),{activeProjectId:m,projects:h}=x(),{enterSplit:g,state:y}=Zi(),b=y.originSide!==null,w=h.find(e=>e.id===m)?.provider,E=C(w),D=(0,Y.useMemo)(()=>(n??[]).filter(t=>t.parent_epic_id===e.id),[n,e.id]),O=(0,Y.useMemo)(()=>e.parent_epic_id==null?null:(n??[]).find(t=>t.id===e.parent_epic_id)??null,[n,e.parent_epic_id]),k=(0,Y.useMemo)(()=>O?(n??[]).filter(e=>e.parent_epic_id===O.id).length:0,[n,O]),[A,j]=(0,Y.useState)(e.title),[M,N]=(0,Y.useState)(e.description),[P,F]=(0,Y.useState)(e.priority??`medium`),[L,R]=(0,Y.useState)([...e.labels??[]]),[B,re]=(0,Y.useState)(e.repositoryIds),[V,ae]=(0,Y.useState)(!1),[H,_e]=(0,Y.useState)(!1),[U,W]=(0,Y.useState)(``),[ye,be]=(0,Y.useState)(!1),[xe,Se]=(0,Y.useState)(!1),[Ce,we]=(0,Y.useState)(!1),[Te,Ee]=(0,Y.useState)(!1),[De,Oe]=(0,Y.useState)(!1),[ke,Ae]=(0,Y.useState)(!1),je=Tn(),Me=je.connected&&!!je.discardStatus&&e.source===`jira`&&!!e.jira_key,Ne=je.connected&&e.source===`jira`&&!!e.jira_key,[Pe,Fe]=(0,Y.useState)(e.attachments??[]);(0,Y.useEffect)(()=>{Fe(e.attachments??[])},[e.attachments,e.id]);let[Le,Re]=(0,Y.useState)(!1),[ze,Be]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{if(!Ne)return;let e=!0;return oe.listStatuses().then(t=>{e&&Be(t.statuses)}).catch(()=>{e&&Be([])}),()=>{e=!1}},[Ne,e.id]);let K=e.jira_status??``,He=async t=>{if(t!==e.status){Re(!0);try{await a(e.id,{status:t})}finally{Re(!1)}}},Ue=async t=>{if(!(!t||t===K)){Re(!0);try{await oe.moveSpecToStatus(e.id,t),S.success(p(`moveToStatus.queued`,{status:t}))}catch{S.error(p(`moveToStatus.failed`))}finally{Re(!1)}}},We=(0,Y.useRef)(null),Ge=(0,Y.useRef)(null),Ke=(0,Y.useRef)(null),qe=(0,Y.useMemo)(()=>A!==e.title||M!==e.description||P!==e.priority||JSON.stringify(L)!==JSON.stringify(e.labels)||JSON.stringify(B)!==JSON.stringify(e.repositoryIds),[A,M,P,L,B,e]);(0,Y.useEffect)(()=>{V&&We.current?.focus()},[V]),(0,Y.useEffect)(()=>{if(H){let e=Ge.current;e&&(e.focus(),e.selectionStart=e.value.length)}},[H]),(0,Y.useEffect)(()=>{ye&&Ke.current?.focus()},[ye]),(0,Y.useEffect)(()=>{function e(e){e.key===`Escape`&&!V&&!H&&!xe&&r()}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r,V,H,xe]);let Je=(0,Y.useMemo)(()=>{if(!U.trim())return[];let e=U.toLowerCase();return t.filter(t=>t.toLowerCase().includes(e)&&!L.includes(t)).slice(0,5)},[U,t,L]),Ye=(0,Y.useCallback)(e=>{let t=e.trim();t&&!L.includes(t)&&R(e=>[...e,t]),W(``)},[L]),Xe=(0,Y.useCallback)(e=>{R(t=>t.filter(t=>t!==e))},[]),Ze=(0,Y.useCallback)(async()=>{let t={};if(A!==e.title&&(t.title=A),M!==e.description&&(t.description=M),P!==e.priority&&(t.priority=P),JSON.stringify(L)!==JSON.stringify(e.labels)&&(t.labels=L),JSON.stringify(B)!==JSON.stringify(e.repositoryIds)&&(t.repositoryIds=B),Object.keys(t).length===0){r();return}Oe(!0);let n=await a(e.id,t);Oe(!1),n?(S.success(f(`detailModal.toast.updated`)),r()):S.error(f(`detailModal.toast.updateFailed`))},[A,M,P,L,B,e,a,r,f]),Qe=(0,Y.useCallback)(async()=>{if(ke)return;Ae(!0);let t=!1;try{t=await s(e.id)}catch{t=!1}if(Ae(!1),!t){S.error(f(`detailModal.toast.deleteFailed`));return}Se(!1),r()},[ke,e.id,s,r,f]),[$e,et]=(0,Y.useState)(0),q=(0,Y.useRef)(null),[tt,nt]=(0,Y.useState)(()=>typeof window<`u`&&window.innerWidth>=xi);(0,Y.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>nt(window.innerWidth>=xi);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let rt=!d&&!b&&tt,it=(0,Y.useCallback)(e=>{q.current&&et(e.clientX-q.current.startX)},[]),J=(0,Y.useCallback)(t=>{if(!q.current)return;let n=t.clientX-q.current.startX,i=window.innerWidth*Si;if(window.removeEventListener(`pointermove`,it),window.removeEventListener(`pointerup`,J),window.removeEventListener(`pointercancel`,J),q.current=null,et(0),Math.abs(n)>=i&&window.innerWidth>=xi){let t=y.leftId===e.id;g(n<0?`left`:`right`,e.id),t||r()}},[g,it,y.leftId,e.id,r]),at=(0,Y.useCallback)(e=>{rt&&e.button===0&&(e.target.closest(`button, input, textarea, select, [contenteditable="true"]`)||(q.current={startX:e.clientX,pointerId:e.pointerId},window.addEventListener(`pointermove`,it),window.addEventListener(`pointerup`,J),window.addEventListener(`pointercancel`,J)))},[rt,it,J]);(0,Y.useEffect)(()=>()=>{q.current&&(window.removeEventListener(`pointermove`,it),window.removeEventListener(`pointerup`,J),window.removeEventListener(`pointercancel`,J))},[it,J]);let ot=(0,Y.useCallback)(()=>{if(!rt||window.innerWidth<xi)return;let t=y.leftId===e.id;g(`right`,e.id),t||r()},[rt,g,y.leftId,e.id,r]),{panelRef:st,panelStyle:ct,resizeHandles:lt,guardBackdrop:ut}=ce({enabled:!d,allowMove:!1}),dt=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{ref:st,className:d?`relative w-full h-full rounded-xl bg-card border border-border/40 shadow-2xl shadow-black/50 flex flex-col overflow-hidden`:`relative w-full max-w-[67rem] m-4 rounded-xl bg-card border border-border/40 shadow-2xl shadow-black/50 flex flex-col animate-in fade-in zoom-in-95 duration-200 h-[90vh] max-h-[calc(100%-2rem)]`,style:{...$e===0?{transition:`transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1)`}:{transform:`translateX(${$e}px)`,transition:`none`},...ct},children:[O&&(0,X.jsx)(`div`,{className:`px-5 pt-3`,children:(0,X.jsx)(di,{epic:O,childExecutionOrder:e.execution_order??null,totalChildren:k,onOpenEpic:()=>i?.(O.id)})}),(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3 px-5 py-4 border-b border-border/30 ${rt?`cursor-grab active:cursor-grabbing`:``}`,onPointerDown:at,"data-testid":`ticket-modal-header`,children:[(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[V?(0,X.jsx)(`input`,{ref:We,value:A,onChange:e=>j(e.target.value),onBlur:()=>ae(!1),onKeyDown:t=>{t.key===`Enter`&&ae(!1),t.key===`Escape`&&(j(e.title),ae(!1))},className:`w-full bg-transparent border-b border-accent-primary/50 text-sm font-semibold text-foreground outline-none pb-0.5`}):(0,X.jsxs)(`button`,{type:`button`,onClick:()=>ae(!0),className:`group flex items-center gap-1.5 text-left w-full`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold text-foreground truncate`,children:A||f(`untitled`)}),(0,X.jsx)(I,{className:`w-3 h-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0`})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5`,children:[(0,X.jsxs)(`span`,{className:`text-[10px] text-foreground font-mono`,children:[`#`,e.id]}),e.status===`on_review`&&(0,X.jsx)(`span`,{title:f(`specs:status.onReviewHint`),"data-testid":`ticket-modal-on-review-badge`,children:(0,X.jsx)(wn,{status:`on_review`})})]}),(0,X.jsx)(xn,{ticketId:e.id})]}),m&&(0,X.jsx)(`div`,{className:`shrink-0`,children:(0,X.jsx)(ui,{ticket:e,projectId:m,provider:w,featureFlagOn:E,childrenCount:D.length})}),(0,X.jsx)(Ai,{ticket:e,title:A,description:M,priority:P,labels:L,repositoryIds:B,onClose:r}),c&&(l||u)&&(0,X.jsx)(ji,{ticket:e,rails:c,onMoveToRail:l,onRemoveFromRail:u}),rt&&(0,X.jsxs)(G,{variant:`outline`,size:`sm`,className:`shrink-0 mr-1 gap-1.5`,"data-testid":`ticket-modal-compare`,onClick:ot,title:f(`detailModal.compareTooltip`),children:[(0,X.jsx)(Ve,{className:`w-3.5 h-3.5`}),f(`detailModal.compare`)]}),(0,X.jsx)(`button`,{onClick:r,className:`h-7 w-7 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-surface/50 transition-colors cursor-pointer shrink-0`,"data-testid":`ticket-modal-close`,children:(0,X.jsx)(se,{className:`w-4 h-4`})})]}),(0,X.jsx)(`div`,{className:`flex-1 overflow-y-auto min-h-0`,children:(0,X.jsxs)(`div`,{className:`flex flex-col sm:flex-row h-full`,children:[(0,X.jsxs)(`div`,{className:`flex-1 min-w-0 px-5 py-4 space-y-4 flex flex-col`,children:[(0,X.jsxs)(`div`,{className:`flex-1 flex flex-col`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5`,children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider flex items-center gap-1.5`,children:f(`fields.description`)}),!H&&(0,X.jsxs)(`button`,{type:`button`,onClick:()=>_e(!0),className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1`,children:[(0,X.jsx)(I,{className:`w-2.5 h-2.5`}),f(`common:actions.edit`)]})]}),H?(0,X.jsxs)(`div`,{className:`space-y-1.5 flex-1 flex flex-col`,children:[(0,X.jsx)(`textarea`,{ref:Ge,value:M,onChange:e=>N(e.target.value),className:`w-full flex-1 rounded-lg border border-border bg-input px-3 py-2 text-xs text-foreground placeholder:text-muted-foreground resize-none min-h-[300px]`,placeholder:f(`fields.markdownPlaceholder`)}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(G,{variant:`ghost`,size:`sm`,className:`h-6 text-[10px]`,onClick:()=>_e(!1),children:f(`detailModal.doneEditing`)}),(0,X.jsx)(`span`,{className:`text-[9px] text-muted-foreground`,children:f(`fields.supportsMarkdown`)})]})]}):M?(0,X.jsx)(Fi,{description:M,onEdit:()=>_e(!0)}):(0,X.jsx)(`button`,{type:`button`,onClick:()=>_e(!0),className:`w-full rounded-lg border border-dashed border-border/40 bg-muted/10 px-3 py-4 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/20 transition-colors text-center`,children:f(`detailModal.addDescription`)})]}),(0,X.jsx)(vn,{ticket:e}),(0,X.jsx)($t,{ticketKey:e.id,attachments:Pe,onChange:Fe}),(0,X.jsx)(en,{ticketId:e.id,onClose:r}),e.prerequisites&&e.prerequisites.length>0&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:f(`detailModal.prerequisites`)}),(0,X.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.prerequisites.map(e=>(0,X.jsxs)(`span`,{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-mono bg-accent/60 text-foreground/70`,children:[`#`,e]},e))})]})]}),(0,X.jsxs)(`div`,{className:`sm:w-56 sm:border-l border-t sm:border-t-0 border-border/30 px-4 py-4 space-y-4 bg-muted/5`,children:[e.jira_url&&e.jira_key&&(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{o(e.jira_url)},"data-testid":`jira-go-to-ticket`,className:`w-full inline-flex items-center justify-center gap-1.5 h-7 rounded border border-accent-info/50 bg-accent-info/10 px-2 text-xs font-medium text-accent-info hover:bg-accent-info/20 transition-colors`,children:[(0,X.jsx)(te,{className:`w-3.5 h-3.5 shrink-0`}),p(`detail.goToTicket`,{key:e.jira_key})]}),e.jira_epic_key&&(0,X.jsxs)(`div`,{"data-testid":`jira-epic`,children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:p(`detail.epic`)}),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{let t=Ei(e);t&&o(t)},title:e.jira_epic_name??e.jira_epic_key,className:`w-full inline-flex items-center gap-1.5 rounded border border-accent-highlight/40 bg-accent-highlight/5 px-2 py-1.5 text-left text-xs hover:bg-accent-highlight/10 transition-colors`,children:[(0,X.jsx)(`span`,{className:`font-mono text-accent-highlight shrink-0`,children:e.jira_epic_key}),e.jira_epic_name&&(0,X.jsx)(`span`,{className:`truncate text-foreground/80`,children:e.jira_epic_name})]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:f(`fields.status`)}),Ne?(0,X.jsx)(`select`,{value:K,disabled:Le||ze===null,onChange:e=>{Ue(e.target.value)},className:`w-full h-7 rounded border border-border bg-input px-2 text-xs text-foreground disabled:opacity-60`,"data-testid":`ticket-jira-status-select`,children:ze===null?(0,X.jsx)(`option`,{value:K,children:K||f(`states.loading`,{ns:`common`})}):(0,X.jsxs)(X.Fragment,{children:[K&&!ze.some(e=>e.name===K)&&(0,X.jsx)(`option`,{value:K,children:K}),ze.map(e=>(0,X.jsx)(`option`,{value:e.name,children:e.name},e.name))]})}):(0,X.jsxs)(`select`,{value:e.status,disabled:Le,onChange:e=>{He(e.target.value)},className:`w-full h-7 rounded border border-border bg-input px-2 text-xs text-foreground disabled:opacity-60`,"data-testid":`ticket-status-select`,children:[!Ci.includes(e.status)&&(0,X.jsx)(`option`,{value:e.status,children:f(wi[e.status],{ns:`tickets`})}),Ci.map(e=>(0,X.jsx)(`option`,{value:e,children:f(wi[e],{ns:`tickets`})},e))]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:f(`fields.priority`)}),(0,X.jsx)(`select`,{value:P,onChange:e=>F(e.target.value),className:`w-full h-7 rounded border border-border bg-input px-2 text-xs text-foreground`,children:Ti.map(e=>(0,X.jsx)(`option`,{value:e.value,children:f(e.labelKey)},e.value))})]}),(0,X.jsx)(ve,{value:B,onChange:re,disabled:De}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:f(`fields.labels`)}),(0,X.jsx)(`div`,{className:`flex flex-wrap gap-1 mb-1.5`,children:L.map(e=>(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 rounded px-1.5 py-0.5 text-[10px] font-medium bg-accent/60 text-foreground/70 group`,children:[e,(0,X.jsx)(`button`,{type:`button`,onClick:()=>Xe(e),className:`text-muted-foreground hover:text-foreground opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,X.jsx)(ee,{className:`w-2.5 h-2.5`})})]},e))}),ye?(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`input`,{ref:Ke,value:U,onChange:e=>W(e.target.value),onKeyDown:e=>{e.key===`Enter`&&U.trim()&&(e.preventDefault(),Ye(U)),e.key===`Escape`&&(be(!1),W(``))},onBlur:()=>{U.trim()&&Ye(U),be(!1),W(``)},placeholder:f(`detailModal.addLabelPlaceholder`),className:`w-full h-6 rounded border border-border bg-input px-2 text-[10px] text-foreground placeholder:text-muted-foreground`}),Je.length>0&&(0,X.jsx)(`div`,{className:`absolute left-0 right-0 top-full mt-0.5 rounded border border-border/50 bg-popover shadow-lg z-10 py-0.5`,children:Je.map(e=>(0,X.jsx)(`button`,{type:`button`,onMouseDown:t=>{t.preventDefault(),Ye(e)},className:`w-full text-left px-2 py-1 text-[10px] hover:bg-accent/50 text-foreground/80`,children:e},e))})]}):(0,X.jsxs)(`button`,{type:`button`,onClick:()=>be(!0),className:`flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors`,children:[(0,X.jsx)(z,{className:`w-2.5 h-2.5`}),f(`detailModal.addLabel`)]})]}),(0,X.jsx)(hi,{ticket:e,allTickets:n??[],onOpenTicket:e=>i?.(e)}),e.source===`jira`&&e.jira_key&&(0,X.jsx)(kn,{localId:e.id}),e.metadata?.effort_level&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-0.5`,children:f(`detailModal.effort`)}),(0,X.jsx)(`span`,{className:`text-xs text-foreground/70`,children:e.metadata.effort_level})]}),e.assignee&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-0.5`,children:f(`detailModal.assignee`)}),(0,X.jsx)(`span`,{className:`text-xs text-foreground/70`,children:e.assignee})]})]})]})}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-3 border-t border-border/30`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] text-muted-foreground`,children:[(0,X.jsx)(`span`,{children:f(`meta.createdAgo`,{time:ki(e.created_at)})}),(0,X.jsx)(`span`,{children:f(`meta.updatedAgo`,{time:ki(e.updated_at)})}),e.source&&(0,X.jsx)(`span`,{className:`bg-muted/30 rounded px-1.5 py-0.5`,children:Di[e.source]?f(Di[e.source]):e.source})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[Me?(0,X.jsxs)(G,{variant:`ghost`,size:`sm`,className:`h-7 text-xs text-accent-info hover:bg-accent-info/10`,onClick:()=>we(!0),"data-testid":`jira-move-to-button`,children:[(0,X.jsx)(Ie,{className:`w-3 h-3 mr-1`}),p(`discard.moveButton`,{status:je.discardStatus})]}):(0,X.jsxs)(G,{variant:`ghost`,size:`sm`,className:`h-7 text-xs text-red-400 aurora-light:text-destructive hover:text-red-300 aurora-light:hover:text-destructive hover:bg-red-500/10 aurora-light:hover:bg-destructive/10`,onClick:()=>Se(!0),children:[(0,X.jsx)(ie,{className:`w-3 h-3 mr-1`}),f(`common:actions.delete`)]}),qe&&(0,X.jsxs)(G,{size:`sm`,className:`h-7 text-xs`,onClick:()=>{Ne?Ee(!0):Ze()},disabled:De||!A.trim(),children:[(0,X.jsx)(T,{className:`w-3 h-3 mr-1`}),f(De?`common:states.saving`:`common:actions.save`)]})]})]})]}),(0,X.jsx)(ge,{open:xe,onOpenChange:e=>{ke||Se(e)},children:(0,X.jsxs)(he,{className:`max-w-sm`,children:[(0,X.jsxs)(me,{children:[(0,X.jsx)(pe,{children:f(`deleteDialog.title`)}),(0,X.jsx)(fe,{children:(0,X.jsx)(_,{t:f,i18nKey:`deleteDialog.body`,values:{id:e.id,title:e.title},components:{strong:(0,X.jsx)(`span`,{className:`font-semibold text-foreground`})}})})]}),(0,X.jsxs)(de,{children:[(0,X.jsx)(G,{variant:`outline`,size:`sm`,onClick:()=>Se(!1),disabled:ke,children:f(`common:actions.cancel`)}),(0,X.jsxs)(G,{variant:`destructive`,size:`sm`,onClick:()=>{Qe()},disabled:ke,"aria-busy":ke,children:[ke?(0,X.jsx)(ne,{className:`w-3.5 h-3.5 mr-1.5 animate-spin`}):(0,X.jsx)(ie,{className:`w-3.5 h-3.5 mr-1.5`}),f(`common:actions.delete`)]})]})]})}),Me&&je.discardStatus&&(0,X.jsx)(En,{open:Ce,onOpenChange:we,ticket:{id:e.id,title:e.title,jira_key:e.jira_key},discardStatus:je.discardStatus,onDiscarded:r}),(0,X.jsx)(ge,{open:Te,onOpenChange:Ee,children:(0,X.jsxs)(he,{className:`max-w-md`,"data-testid":`jira-save-confirm`,children:[(0,X.jsxs)(me,{children:[(0,X.jsx)(pe,{children:p(`detail.saveTitle`)}),(0,X.jsx)(fe,{children:p(`detail.saveBody`,{key:e.jira_key??`#${e.id}`})})]}),(0,X.jsxs)(de,{children:[(0,X.jsx)(G,{variant:`outline`,size:`sm`,onClick:()=>Ee(!1),children:f(`common:actions.cancel`)}),(0,X.jsxs)(G,{size:`sm`,onClick:()=>{Ee(!1),Ze()},disabled:De,"data-testid":`jira-save-confirm-btn`,children:[(0,X.jsx)(T,{className:`w-3.5 h-3.5 mr-1.5`}),p(`detail.saveConfirm`)]})]})]})})]});return d?dt:(0,Nr.createPortal)((0,X.jsxs)(`div`,{style:le(),className:`fixed inset-0 z-[68] flex items-center justify-center`,children:[(0,X.jsx)(`div`,{className:`absolute inset-0 bg-black/70`,onClick:ut(r)}),dt,(0,X.jsx)(ue,{handles:lt})]}),document.body)}function ki(e){try{return W(new Date(e),{addSuffix:!0,locale:p()})}catch{return e}}function Ai({ticket:e,title:t,description:n,priority:r,labels:i,repositoryIds:a,onClose:o}){let{t:s}=v(`tickets`),{triggerResume:c}=k(),{activeProjectId:l}=x(),{closeTicketDetail:u}=Zi();return Nn(e)?(0,X.jsxs)(G,{variant:`default`,size:`sm`,onClick:()=>{if(!l)return;let{body:d,criteria:f}=jn(n);c({kind:`explore-spec`,projectId:l,label:t||e.title||s(`detailModal.ticketFallbackLabel`,{id:e.id}),restoreRoute:`/`,params:{initialIdea:``,pendingSpecId:Pn(),initialAttachmentIds:[],resumeConversationId:e.origin_conversation_id??void 0,editTicket:{id:e.id,title:t,description:d,labels:i,priority:r,repositoryIds:a,acceptanceCriteria:f,status:e.status}}}),u(),o()},className:`shrink-0 mr-2`,"data-testid":`continue-editing`,children:[(0,X.jsx)(Ze,{className:`w-3.5 h-3.5 mr-1.5`}),s(`detailModal.continueEditing`)]}):null}function ji({ticket:e,rails:t,onMoveToRail:n,onRemoveFromRail:r}){let{t:i}=v(`tickets`),[a,o]=(0,Y.useState)(null),s=(0,Y.useRef)(null),c=t.find(t=>t.ticketIds.includes(e.id));return c?r?(0,X.jsxs)(G,{variant:`outline`,size:`sm`,className:`shrink-0 mr-2 gap-1.5 border-accent-warning/30 text-accent-warning hover:bg-accent-warning/10 hover:text-accent-warning`,"data-testid":`modal-remove-from-rail`,onClick:()=>r(e.id),title:i(`rail.currentlyOn`,{rail:c.label}),children:[(0,X.jsx)(w,{className:`w-3.5 h-3.5`,"aria-hidden":!0}),i(`rail.removeFromRail`)]}):null:n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(G,{ref:s,variant:`outline`,size:`sm`,className:`shrink-0 mr-2 gap-1.5 border-accent-info/30 text-accent-info hover:bg-accent-info/10 hover:text-accent-info`,"data-testid":`modal-move-to-rail`,onClick:()=>{s.current&&o(s.current.getBoundingClientRect())},children:[i(`rail.moveToRail`),(0,X.jsx)(Ie,{className:`w-3.5 h-3.5`,"aria-hidden":!0})]}),a&&(0,X.jsx)(bi,{rails:t,anchorRect:a,onMoveToRail:t=>n(e.id,t),onClose:()=>o(null)})]}):null}var Mi=`
11
-
12
- ---
13
-
14
- ## Contract Layer
15
-
16
- `;function Ni(e){let t=e.indexOf(Mi);return t<0?{user:e,contract:null}:{user:e.slice(0,t),contract:e.slice(t+26)}}function Pi(e){let t=[`### Naming Contract`,`### Data Shapes`,`### State Machine`,`### Invariants`,`### File Touch List`],n=0;for(let r of t){let t=e.indexOf(r);if(t<0)continue;let i=e.slice(t+r.length),a=i.indexOf(`N/A — model did not produce items`),o=i.indexOf(`### `);a>=0&&(o<0||a<o)||n++}return n}function Fi({description:e,onEdit:t}){let{t:n}=v(`tickets`),{openWebView:r}=Yr(),{user:i,contract:a}=Ni(e),o=i||e,s=(0,Y.useMemo)(()=>({a:({href:e,children:t})=>(0,X.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,onClick:t=>{typeof e==`string`&&/^https?:\/\//i.test(e)&&(t.preventDefault(),t.stopPropagation(),r(e))},children:t})}),[r]);return(0,X.jsxs)(`div`,{className:`flex-1 rounded-lg bg-muted/20 px-3 py-2 overflow-y-auto transition-colors`,onClick:e=>{e.target.closest(`details, summary`)||t()},role:`button`,style:{cursor:`pointer`},children:[(0,X.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 text-xs`,children:(0,X.jsx)(_e,{remarkPlugins:[U],components:s,children:o})}),a&&(0,X.jsxs)(`details`,{"data-testid":`contract-layer-disclosure`,className:`mt-3 rounded-md border border-border/40 bg-muted/10 px-2 py-1`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`summary`,{className:`cursor-pointer text-[10px] font-medium text-foreground/80 select-none flex items-center gap-2`,children:[n(`contractLayer.title`),(0,X.jsx)(`span`,{className:`rounded-full bg-muted/40 px-1.5 text-[9px] text-foreground/60`,children:n(`contractLayer.populated`,{n:Pi(a)})})]}),(0,X.jsx)(`div`,{className:`mt-2 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 text-xs`,children:(0,X.jsx)(_e,{remarkPlugins:[U],components:s,children:a})})]})]})}var Ii={critical:`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`,high:`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`,medium:``,low:`bg-gray-500/15 aurora-light:bg-muted text-gray-400 aurora-light:text-muted-foreground border-gray-500/30 aurora-light:border-border`};function Li(e){try{return W(new Date(e),{addSuffix:!0,locale:p()})}catch{return e}}function Ri({tickets:e,excludeIds:t,onSelect:n}){let{t:r}=v(`tickets`),[i,a]=(0,Y.useState)(``),o=(0,Y.useMemo)(()=>{let n=new Set(t),r=e.filter(e=>e.status!==`cancelled`&&!n.has(e.id));if(!i.trim())return r;let a=i.toLowerCase();return r.filter(e=>e.title.toLowerCase().includes(a)||e.description.toLowerCase().includes(a))},[e,t,i]);return(0,X.jsxs)(`div`,{"data-testid":`spec-compare-picker`,className:`h-full flex flex-col rounded-xl bg-card border border-border/40 shadow-2xl shadow-black/50 overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`px-4 py-3 border-b border-border/30 flex items-center gap-2`,children:[(0,X.jsx)(nt,{className:`w-3.5 h-3.5 text-muted-foreground`}),(0,X.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:r(`comparePicker.title`)}),(0,X.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:r(`comparePicker.count`,{n:o.length})})]}),(0,X.jsx)(`div`,{className:`px-4 py-2 border-b border-border/20`,children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(re,{className:`absolute left-2 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground`}),(0,X.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:r(`comparePicker.searchPlaceholder`),className:`w-full h-7 rounded border border-border bg-input pl-7 pr-2 text-[11px] text-foreground placeholder:text-muted-foreground outline-none focus:border-accent-primary/60`})]})}),(0,X.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`spec-compare-picker-list`,children:o.length===0?(0,X.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full text-center px-4 py-8 gap-2`,children:[(0,X.jsx)(nt,{className:`w-6 h-6 text-muted-foreground/40`}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i.trim()?r(`comparePicker.noMatches`):r(`comparePicker.empty`)})]}):(0,X.jsx)(`ul`,{className:`divide-y divide-border/10`,children:o.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,"data-testid":`spec-compare-card-${e.id}`,onClick:()=>n(e.id),className:`w-full text-left px-4 py-2.5 hover:bg-accent/30 transition-colors flex items-start gap-2 group`,children:[(0,X.jsx)(Cn,{status:e.status}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsxs)(`span`,{className:`text-[10px] font-mono text-muted-foreground`,children:[`#`,e.id]}),e.priority&&Ii[e.priority]&&(0,X.jsx)(`span`,{className:`inline-flex items-center rounded px-1 py-0.5 text-[9px] font-medium border ${Ii[e.priority]}`,children:r(`priority.${e.priority}`)})]}),(0,X.jsx)(`p`,{className:`mt-0.5 text-xs text-foreground truncate group-hover:text-accent-primary transition-colors`,children:e.title||r(`untitled`)}),e.description&&(0,X.jsx)(`p`,{className:`mt-0.5 text-[10px] text-muted-foreground line-clamp-1`,children:e.description.slice(0,120)}),e.labels&&e.labels.length>0&&(0,X.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:[e.labels.slice(0,3).map(e=>(0,X.jsx)(`span`,{className:`inline-flex items-center rounded px-1 py-0.5 text-[9px] bg-accent/40 text-foreground/60`,children:e},e)),e.labels.length>3&&(0,X.jsxs)(`span`,{className:`text-[9px] text-muted-foreground`,children:[`+`,e.labels.length-3]})]}),(0,X.jsx)(`p`,{className:`mt-1 text-[9px] text-muted-foreground`,children:r(`meta.updatedAgo`,{time:Li(e.updated_at)})})]})]})},e.id))})})]})}var zi=.25,Bi=.75;function Vi({state:e,leftTicket:t,rightTicket:n,allTickets:r,allLabels:i,onSave:a,onDelete:o,onOpenTicket:s,onCloseAll:c,onSetCompared:l,onSetRatio:u,onExitSplit:d}){let f=(0,Y.useRef)(null),p=(0,Y.useRef)(null),[m,h]=(0,Y.useState)(!0);(0,Y.useEffect)(()=>{let e=setTimeout(()=>h(!1),320);return()=>clearTimeout(e)},[]);let g=(0,Y.useCallback)(e=>{if(!p.current)return;let t=window.innerWidth,n=e.clientX/t;u(Math.min(Bi,Math.max(zi,n)))},[u]),_=(0,Y.useCallback)(e=>{if(!p.current)return;let{pointerId:t,element:n}=p.current;try{n.releasePointerCapture(t)}catch{}p.current=null,window.removeEventListener(`pointermove`,g),window.removeEventListener(`pointerup`,_),window.removeEventListener(`pointercancel`,_)},[g]),v=(0,Y.useCallback)(e=>{let t=e.currentTarget;try{t.setPointerCapture(e.pointerId)}catch{}p.current={pointerId:e.pointerId,element:t},window.addEventListener(`pointermove`,g),window.addEventListener(`pointerup`,_),window.addEventListener(`pointercancel`,_)},[g,_]);(0,Y.useEffect)(()=>()=>{window.removeEventListener(`pointermove`,g),window.removeEventListener(`pointerup`,_),window.removeEventListener(`pointercancel`,_);let e=p.current;if(e){try{e.element.releasePointerCapture(e.pointerId)}catch{}p.current=null}},[g,_]);let y=(0,Y.useCallback)(t=>{let n=.04;t.key===`ArrowLeft`?(t.preventDefault(),u(Math.max(zi,e.splitRatio-n))):t.key===`ArrowRight`?(t.preventDefault(),u(Math.min(Bi,e.splitRatio+n))):t.key===`Home`?(t.preventDefault(),u(zi)):t.key===`End`?(t.preventDefault(),u(Bi)):t.key===`0`&&(t.preventDefault(),u(.5))},[u,e.splitRatio]),b=e=>{e.target===e.currentTarget&&c()},x=u=>{let d=u===e.originSide,f=u===`left`?t:n;return f?(0,X.jsx)(Oi,{ticket:f,allLabels:i,allTickets:r,onClose:d?c:()=>l(null,u),onOpenTicket:s,onSave:a,onDelete:o,embedded:!0},`${u}-${f.id}`):(0,X.jsx)(Ri,{tickets:r,excludeIds:[t?.id,n?.id].filter(e=>e!=null),onSelect:e=>l(e,u)})},S=(e.splitRatio*100).toFixed(2),C=((1-e.splitRatio)*100).toFixed(2);return(0,Nr.createPortal)((0,X.jsxs)(`div`,{ref:f,"data-testid":`split-view-shell`,style:le(),className:`fixed inset-0 z-[68] flex`,onClick:b,children:[(0,X.jsx)(`div`,{className:`absolute inset-0 bg-black/70 pointer-events-none`,"aria-hidden":!0}),(0,X.jsxs)(`div`,{className:`relative flex w-full h-full`,style:{transition:m?`opacity 280ms cubic-bezier(0.34, 1.56, 0.64, 1)`:void 0},children:[(0,X.jsx)(`div`,{"data-testid":`split-panel-left`,className:`relative h-full overflow-hidden`,style:{width:`${S}%`,transition:m?`width 280ms cubic-bezier(0.34, 1.56, 0.64, 1)`:void 0},children:(0,X.jsx)(`div`,{className:`h-full flex items-center justify-center p-2`,children:(0,X.jsx)(`div`,{className:`w-full h-full max-h-[95vh]`,children:x(`left`)})})}),(0,X.jsx)(`div`,{"data-testid":`split-divider`,role:`separator`,"aria-orientation":`vertical`,"aria-valuenow":Math.round(e.splitRatio*100),"aria-valuemin":Math.round(zi*100),"aria-valuemax":Math.round(Bi*100),tabIndex:0,onPointerDown:v,onKeyDown:y,className:`relative z-10 w-2 cursor-col-resize bg-border/40 hover:bg-accent-primary/40 transition-colors focus:outline-none focus:bg-accent-primary/60`}),(0,X.jsx)(`div`,{"data-testid":`split-panel-right`,className:`relative h-full overflow-hidden`,style:{width:`${C}%`,transition:m?`width 280ms cubic-bezier(0.34, 1.56, 0.64, 1)`:void 0},children:(0,X.jsx)(`div`,{className:`h-full flex items-center justify-center p-2`,children:(0,X.jsx)(`div`,{className:`w-full h-full max-h-[95vh]`,children:x(`right`)})})})]})]}),document.body)}var Hi=.5,Ui=.25,Wi=.75,Gi={leftId:null,rightId:null,originSide:null,splitRatio:Hi};function Ki(e){return Number.isFinite(e)?Math.min(Wi,Math.max(Ui,e)):Hi}function qi(e,t){switch(t.type){case`openCentered`:return e.originSide!==null&&e.leftId!==t.id&&e.rightId!==t.id?{leftId:t.id,rightId:null,originSide:null,splitRatio:Hi}:e.originSide!==null&&(e.leftId===t.id||e.rightId===t.id)?e:{...Gi,leftId:t.id};case`closeAll`:return Gi;case`enterSplit`:{let n=t.ticketId??e.leftId;return n===null||e.originSide!==null?e:t.side===`left`?{leftId:n,rightId:null,originSide:`left`,splitRatio:Hi}:{leftId:null,rightId:n,originSide:`right`,splitRatio:Hi}}case`setComparedTicket`:{if(e.originSide===null)return e;let n=e.originSide===`left`?`right`:`left`;return t.side===n?t.side===`left`?{...e,leftId:t.id}:{...e,rightId:t.id}:e}case`exitSplit`:{if(e.originSide===null)return e;let t=e.originSide===`left`?e.leftId:e.rightId;return{...Gi,leftId:t}}case`setSplitRatio`:return{...e,splitRatio:Ki(t.ratio)};default:return e}}var Ji=(0,Y.createContext)(null),Yi=900;function Xi({children:e}){let[t,n]=(0,Y.useReducer)(qi,Gi),{tickets:r,updateTicket:i,deleteTicket:a}=gt(),{activeProjectId:o,setActiveProjectId:s}=x(),c=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{n({type:`closeAll`});let e=c.current;e&&(c.current=null,e.projectId===o&&n({type:`openCentered`,id:e.ticketId}))},[o]);let l=(0,Y.useCallback)(e=>n({type:`openCentered`,id:e}),[]),u=(0,Y.useCallback)((e,t)=>{if(e===o){n({type:`openCentered`,id:t});return}c.current={projectId:e,ticketId:t},s(e)},[o,s]),d=(0,Y.useCallback)(()=>n({type:`closeAll`}),[]),f=(0,Y.useCallback)((e,t)=>{typeof window<`u`&&window.innerWidth<Yi||n({type:`enterSplit`,side:e,ticketId:t})},[]),p=(0,Y.useCallback)((e,t)=>n({type:`setComparedTicket`,id:e,side:t}),[]),m=(0,Y.useCallback)(()=>n({type:`exitSplit`}),[]),h=(0,Y.useCallback)(e=>n({type:`setSplitRatio`,ratio:e}),[]);(0,Y.useEffect)(()=>{if(typeof window>`u`)return;function e(){window.innerWidth<Yi&&n({type:`exitSplit`})}return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let g=(0,Y.useMemo)(()=>{let e=new Set;for(let t of r)for(let n of t.labels??[])e.add(n);return Array.from(e).sort()},[r]),_=t.leftId==null?null:r.find(e=>e.id===t.leftId)??null,v=t.rightId==null?null:r.find(e=>e.id===t.rightId)??null,y=(0,Y.useMemo)(()=>({openTicketDetail:l,openTicketDetailInProject:u,closeTicketDetail:d,enterSplit:f,setComparedTicket:p,exitSplit:m,setSplitRatio:h,state:t}),[l,u,d,f,p,m,h,t]),b=t.originSide!==null;return(0,X.jsxs)(Ji.Provider,{value:y,children:[e,!b&&_&&(0,X.jsx)(Oi,{ticket:_,allLabels:g,allTickets:r,onClose:d,onOpenTicket:l,onSave:i,onDelete:a},_.id),b&&(0,X.jsx)(Vi,{state:t,leftTicket:_,rightTicket:v,allTickets:r,allLabels:g,onSave:i,onDelete:a,onOpenTicket:l,onCloseAll:d,onSetCompared:p,onSetRatio:h,onExitSplit:m})]})}function Zi(){return(0,Y.useContext)(Ji)||{openTicketDetail:()=>{typeof console<`u`&&console.warn(`[TicketDetailModalContext] openTicketDetail called without provider`)},openTicketDetailInProject:()=>{typeof console<`u`&&console.warn(`[TicketDetailModalContext] openTicketDetailInProject called without provider`)},closeTicketDetail:()=>{},enterSplit:()=>{},setComparedTicket:()=>{},exitSplit:()=>{},setSplitRatio:()=>{},state:Gi}}export{ze as $,Cn as A,q as B,Yn as C,jn as D,Nn as E,Lt as F,Je as G,Ze as H,gt as I,We as J,qe as K,ct as L,Ut as M,zt as N,En as O,qt as P,Be as Q,lt as R,tr as S,Pn as T,Xe as U,et as V,Ye as W,He as X,Ue as Y,Ve as Z,$n as _,ei as a,Ce as at,rr as b,Wr as c,Oe as ct,jr as d,Me as dt,Le as et,Cr as f,Ae as ft,ir as g,be as gt,In as h,Pe as ht,bi as i,De as it,pn as j,Tn as k,Ur as l,Te as lt,or as m,xe as mt,Zi as n,Se as nt,Jr as o,we as ot,hr as p,je as pt,Ke as q,Oi as r,Ee as rt,Yr as s,Ne as st,Xi as t,Ie as tt,Lr as u,Fe as ut,ar as v,nr as w,er as x,Fn as y,nt as z};
@@ -1 +0,0 @@
1
- var e=`Contrôle des missions`,t=`Pilotez Specrails en discutant`,n=`Contrôle des missions`,r=`Quelle est la mission ?`,i=`Envoyer`,a=`Arrêter`,o=`Copier`,s={openPreview:`Prévisualiser {{name}}`,openDownload:`Télécharger {{name}}`,previewTitle:`Aperçu de {{name}}`,downloadTitle:`Télécharger le fichier ?`,downloadPrompt:`Ce fichier ne peut pas être prévisualisé ici. Voulez-vous le télécharger ?`,download:`Télécharger`,cancelDownload:`Pas maintenant`,loading:`Préparation du fichier…`,loadFailed:`Impossible de charger la pièce jointe`,loadError:`Impossible de charger la pièce jointe : {{error}}`},c=`Agrandir`,l=`Restaurer`,u=`Réduire`,d=`Fermer`,f=`Nouvelle mission`,p=`Quelle est la mission ?`,m=`Choisissez un projet, puis demandez. Le tableau se met à jour en direct pendant que l'agent travaille.`,h=`Réflexion…`,g=`Connexion…`,_=`Consultation de l'app…`,v={compact:`Compact`,comfortable:`Confortable`,max:`Agrandir`},y={label:`Modèle`,loading:`Chargement des modèles…`,unavailable:`Modèles indisponibles`},b={hint:`Parcours de l'historique — tapez pour modifier, ↑↓ pour naviguer`},x={queued:`En file d’attente`,send:`Envoyer le message`,sendHint:`Ajouté à la file pour le prochain tour. Choisissez « Orienter » sur un message en attente pour l’envoyer sans interrompre le modèle.`,placeholder:`Ajouter un message à la file…`,delivered:`Transmis à l’agent`,interrupted:`Transmission non confirmée`,cancelled:`Annulé avant transmission`,steer:`Orienter`,steerHint:`Envoyer sans interrompre le modèle`,steering:`Envoi à l’agent…`,remove:`Supprimer le message de la file`,more:`Options du message`,edit:`Modifier`,actionConflict:`Ce message est déjà en cours de transmission ou n’est plus dans la file.`,actionFailed:`Impossible de modifier le message en attente. Réessayez.`},S={sent:`Envoyé à l’agent`,received:`Transmis à l’agent`,read:`Lu par l’agent`,interrupted:`Transmission non confirmée`,cancelled:`Annulé avant transmission`},C={editing:`Modification du message en attente {{n}} sur {{m}}`,hint:`↑↓ pour naviguer · Entrée enregistre · Échap annule`,save:`Enregistrer le message en attente`,cancel:`Annuler la modification`,dispatched:`Ce message a déjà été transmis ; votre texte est conservé comme brouillon`,saveFailed:`Impossible d’enregistrer le message en attente`},w={branch:`Branche`,detached:`(détaché)`,dirty:`Modifications non commitées`,switched:`Basculé sur {{branch}}`,switchFailed:`Impossible de changer de branche`,lockedWhileWorking:`Branche verrouillée pendant que l'agent travaille`,searchPlaceholder:`Rechercher des branches…`,noMatches:`Aucune branche ne correspond`,worktrees:`Worktrees`,worktreePathCopied:`Chemin du worktree copié`,copyWorktreePath:`Copier le chemin du worktree`,repository:`Dépôt`,repositoryUnavailable:`Dépôt indisponible`,loadFailed:`État Git indisponible`,notGit:`Dossier de contexte · sans Git`,retry:`Réessayer`},T={label:`Fournisseur`,claude:`Claude`,codex:`Codex`,gemini:`Gemini`,kimi:`Kimi`},E={cycleHint:`⇧⇥ pour changer`,observe:{name:`Observer`,desc:`Lecture seule — rien ne change`},edit:{name:`Modifier`,desc:`Créer et modifier (réversible)`},operate:{name:`Opérer`,desc:`Lancer l'IA — c'est payant`},autonomous:{name:`Autonome`,desc:`Supprimer et arrêter — irréversible`},lockedTitle:`Nécessite un niveau supérieur`,lockedBody:`Cette action nécessite le niveau « {{level}} ». Vous êtes sur « {{current}} ».`,raiseHint:`⇧⇥ pour augmenter le niveau, ou demandez autrement.`},D={title:`Confirmer l'action`,costAction:`{{action}} · ~{{cost}} · {{tier}}`,approve:`Approuver`,cancel:`Annuler`,dontAskAgain:`Ne plus demander durant cette session`,approved:`Approuvé`,cancelled:`Annulé`},O={home:`Accueil`,searchPlaceholder:`Parlez à Specrails…`,searchProjectsPlaceholder:`Rechercher des projets…`,recents:`Récents`,allProjects:`Tous les projets`,searchAll:`Rechercher dans tous les projets`,addProject:`Ajouter un projet…`,homeHint:`Aucun projet sélectionné — opération sur tous les projets.`,askCreateOrSearch:`Aucun projet n'est sélectionné. Voulez-vous créer un nouveau projet ou rechercher dans tous les projets ?`},k={remove:`Retirer {{label}}`,addContextAction:`Ajouter un contexte ou une action`,filtering:`Filtrage de "{{query}}"`,keyboard:`↑↓ Enter Esc`,noMatches:`Aucun résultat`,noMatchesFor:`Aucun résultat pour "{{query}}"`,mode:{reference:{title:`Référence`,hint:`@ projets, specs, missions`},trace:{title:`Trace`,hint:`# jobs, exécutions, IDs`},action:{title:`Action`,hint:`/ commandes pour ce contexte`}},plus:{reference:`Référence`,referenceHint:`Projets, specs, missions`,trace:`Trace`,traceHint:`Jobs, exécutions, IDs`,action:`Action`,actionHint:`Créer, lancer, inspecter`,fileAttachment:`Pièce jointe`,fileAttachmentHint:`Ajouter docs, images, logs`,browserCapture:`Capture navigateur`,browserCaptureHint:`Capturer une zone de page pour cette mission`},railGroup:`Rails`,railGroupInUse:`Rails en cours d’utilisation`},A={label:`Changer de mission`,untitled:`Nouvelle mission`,new:`Nouvelle mission`,searchPlaceholder:`Rechercher des missions…`,noMatches:`Aucune mission ne correspond`,working:`L'agent travaille`,queuedBadge:`{{n}} en file`,delete:`Supprimer la mission "{{title}}"`,deleteConfirm:`Supprimer ?`,deleteLiveConfirm:`L'agent travaille — supprimer quand même ?`,confirmDelete:`Confirmer la suppression`,cancelDelete:`Garder la mission`,deleteFailed:`Impossible de supprimer la mission`},j={title:`Aucun fournisseur d'IA installé`,body:`L'agent a besoin de Claude ou Codex sur votre machine. Installez-en un, puis rouvrez l'agent pour discuter.`,placeholder:`Installez un fournisseur d'IA pour utiliser l'agent…`},M={title:`Le MCP Specrails est désactivé`,body:`L'agent a besoin du serveur MCP intégré pour piloter l'app.`,enable:`Activer le MCP Specrails`,enabling:`Activation…`,enabled:`MCP activé`},N={live:`en direct`,queued:`en file`,running:`en cours`,done:`terminé`,failed:`échoué`},P={generic:`Une erreur est survenue. Réessayez.`,busy:`L'agent est occupé. Réessayez dans un instant.`},F={kindAgent:`Mission de l'agent`},I=`Nouvelle mission`,L=`Passer au Contrôle des missions`,R=`Passer au tableau`,z=`Rechercher`,B=`Accueil`,V=`Missions favorites`,H=`Sans titre`,U={title:`Espace de travail`,terminal:`Terminal`,files:`Fichiers`,browser:`Navigateur`,requiresProject:`Sélectionnez un projet pour utiliser cet outil`,resizeCode:`Redimensionner le volet de code`,closeFiles:`Fermer le code`,browserConfirm:`Ajouter à l'agent`,browserSelectStart:`Sélectionner pour ajouter à la mission`,browserCaptured:`Capture ajoutée`,uploadFailed:`Échec du téléversement`,requiresConversation:`Lancez une mission pour utiliser cet outil`,jobs:`Jobs`,closeJobs:`Fermer les jobs`,resizeJobs:`Redimensionner le panneau des jobs`,noJobs:`Aucun job pour l'instant — demandez à l'agent d'en lancer un`,analytics:`Analytique`,closeAnalytics:`Fermer l'analytique`,resizeAnalytics:`Redimensionner le panneau d'analytique`},W=`Joindre un fichier`,G=`Supprimer «\xA0{{title}}\xA0»`,K=`Confirmer la suppression de «\xA0{{title}}\xA0»`,q=`Ajouter «\xA0{{title}}\xA0» aux favorites`,J=`Retirer «\xA0{{title}}\xA0» des favorites`,Y=`confirmer\xA0?`,X=`Ce fournisseur ne lit pas encore les images — joignez plutôt des fichiers texte`,Z={label:`Effort`,minimal:`Minimal`,low:`Faible`,medium:`Moyen`,high:`Élevé`,xhigh:`Très élevé`,max:`Maximum`,ultra:`Ultra`},Q=JSON.parse(`{"operation":{"inProgress":"Action en cours…","create-pr":"Création de la PR…","publish":"Publication…","discard":"Suppression…","dismiss":"Fermeture du suivi…","poll-merge":"Vérification de la fusion…","reopen":"Réouverture…","merge-local":"Intégration locale…","recover-and-retry":"Création du commit et nouvelle tentative d’envoi du résultat préservé…","acknowledge-no-changes":"Marquage comme terminé…"},"markDone":"Marquer comme terminées","refine":"Affiner","completedNote":"Confirmé — les specs sont passées à Terminé","partialSummary":"{{succeeded}} sur {{total}} terminées ; {{failed}} en échec","unit":{"failed":"échec de l’implémentation","blocked":"livraison bloquée","noChanges":"aucune modification","succeeded":"prête"},"rail":"Rail {{index}}","specCount_one":"{{count}} spec","specCount_other":"{{count}} specs","base":"Branche de base","openPr":"Ouvrir la PR","existingPr":"PR existante","title":{"no_changes":"Aucune modification nécessaire","partial":"Implémentation partielle","delivery_blocked":"Implémentation terminée — la livraison requiert votre attention","update_failed":"Implémentation terminée — échec de la mise à jour","pr_closed":"PR fermée sans fusion","superseded":"Remplacée par une exécution plus récente","existing_pr_updated":"PR existante mise à jour","building":"Implémentation dans un worktree isolé…","buildingExistingPr":"Application des changements sur une PR existante…","paused":"Décision humaine requise","on_review":"Implémentation prête pour la revue","pr_draft":"PR en brouillon créée","pr_draft_degraded":"Livraison de la PR incomplète","pr_ready":"PR prête à être fusionnée","implementation_failed":"Échec de l’implémentation","pr_failed":"Échec de la création de la PR","merged":"PR fusionnée","discarded":"Abandonnée"},"buildingHint":"À la fin, il vous sera proposé de créer la PR.","buildingExistingPrHint":"Specrails travaille sur la branche de la PR existante et poussera les changements de revue vers cette même PR.","paused":"Implémentation en pause","pausedForRun":"En pause sur {{ref}}","resume":"Reprendre","stopExecution":"Arrêter l’exécution","stopExecutionSent":"Signal d’arrêt envoyé","stopExecutionFailed":"Impossible d’arrêter l’exécution","createPr":"Créer la PR","publish":"Publier","checkout":"Changer de branche","openReview":"Relire","openReviewTooltip":"Ouvrir la relecture en langage clair","checkoutTooltip":"Basculer le dossier principal du projet sur {{branch}}","checkoutSuccess":"Checkout effectué sur {{branch}}","checkoutFailed":"Impossible de basculer sur la branche d’implémentation","checkoutDirtyTitle":"Checkout bloqué pour protéger vos modifications","checkoutDirtyBody":"Le dossier principal du projet contient des modifications non validées. Créez un commit ou mettez-les de côté, puis réessayez. Aucun changement n’a été effectué.","checkoutSafetyUnknownTitle":"Checkout suspendu, car la sécurité n’a pas pu être vérifiée","checkoutSafetyUnknownBody":"Specrails n’a pas pu lire l’état Git du dossier principal du projet. Rien n’a été libéré ni modifié. Réessayez lorsque Git sera disponible.","checkoutNotDeliverableTitle":"Cette branche ne contient pas l’implémentation conservée","checkoutNotDeliverableBody":"Le commit exact de la livraison n’a pas encore été vérifié. Inspectez ou récupérez plutôt le résultat local.","inspectLocalResult":"Inspecter le résultat local","inspectLocalResultTooltip":"Afficher le worktree isolé préservé et copier son chemin","localResultPathCopied":"Chemin du résultat local copié","localResultPath":"Résultat local préservé","localResultUnavailableHere":"Aucun worktree récupérable n’est disponible sur cet ordinateur. Consultez le journal d’exécution depuis la machine où l’opération a été lancée.","recoverAndRetry":"Créer le commit et réessayer l’envoi","recoverAndRetryVerified":"Le commit récupéré {{sha}} est vérifié dans la PR","recoveryStillBlocked":"La récupération locale nécessite encore votre attention","recheckRecovery":"Vérifier à nouveau","recoveryUnavailable":"La récupération n’a pas pu être vérifiée sur cet ordinateur","recoveryUnavailableBody":"Specrails n’a pas pu prouver de manière sûre un résultat unique appartenant à la livraison dans ce clone. Rien n’a été modifié ou supprimé. Consultez le détail de l’étape et les journaux d’exécution. Si le run a été exécuté sur un autre ordinateur, ouvrez-y Specrails puis vérifiez à nouveau.","recoveryDetailSummary":"Détail technique de récupération","retry":"Réessayer","retryPr":"Réessayer la PR","checkMerge":"Vérifier le merge","verifyPr":"Vérifier la PR","discard":"Abandonner","confirmDiscard":"Confirmer l'abandon ?","mergedNote":"Fusionnée — specs passées en Terminé","discardedNote":"Abandonnée — specs renvoyées vers le backlog","implementationFailedNote":"Le run d’implémentation a échoué avant de produire quelque chose de livrable. Ouvrez le journal du run pour inspecter l’échec, puis abandonnez cette carte avant de relancer.","dismiss":"Fermer le suivi","discardLocalResult":"Supprimer le résultat local","retryPush":"Réessayer le push","retryPushVerified":"Push vérifié · le commit {{sha}} est dans la PR","commitAlreadyVerified":"Le commit {{sha}} est déjà vérifié dans la PR","deliveryCommit":"commit {{sha}}","reopen":"Rouvrir","createPartialPr":"Créer une PR avec {{count}}","supersededNote":"Une exécution d’implémentation plus récente a remplacé cette carte.","noChangesExisting":"Aucune nouvelle modification n’était nécessaire ; la PR existante reste inchangée.","noChangesNote":"Aucune modification de code n’était nécessaire. Marquez les specs comme terminées ou renvoyez-les dans le backlog pour les affiner.","deliveryNeedsAttention":"Implémentation terminée ; la livraison requiert votre attention","deliveryBlockedNote":"L’implémentation a réussi, mais la livraison est bloquée. Consultez le détail de l’étape et les journaux avant de supprimer le résultat local.","partialDeliveryBlockedNote":"Une partie de l’implémentation a réussi, mais rien ne peut encore être livré en toute sécurité. Consultez les éléments par unité et les journaux avant de choisir l’action suivante.","retryPushNote":"L’implémentation a réussi et les modifications sont en sécurité localement. Réessayez uniquement le push.","cleanupIncomplete_one":"Nettoyage incomplet ({{count}} avertissement)","cleanupIncomplete_other":"Nettoyage incomplet ({{count}} avertissements)","safetyArchiveTitle":"Archive de sécurité ({{count}})","safetyArchiveHint":"Des fichiers temporaires de l’espace de travail ont été conservés hors de la PR par précaution. Vous pouvez les examiner ou les supprimer manuellement.","confirm":{"recoverAndRetryTitle":"Créer le commit et envoyer le résultat préservé ?","recoverAndRetryBody":"Specrails utilisera uniquement le worktree isolé ou la branche enregistrée compatible avec une avance rapide pour {{branch}}. Si nécessaire, il créera un commit avec les fichiers livrables, puis enverra ce commit exact uniquement si la PR est toujours ouverte sur les branches source et cible attendues. Le dossier principal de votre projet et ses modifications non validées resteront intacts.","recheckRecoveryTitle":"Vérifier à nouveau cet ordinateur ?","recheckRecoveryBody":"Specrails réanalysera dans ce clone le worktree, la branche, les refs, les reflogs et les objets Git orphelins appartenant à la livraison de {{branch}}. S’il prouve un résultat unique, il pourra committer les changements isolés et retenter le push exact. Le dossier principal du projet ne sera pas touché.","noChangesDoneTitle":"Marquer ces specs comme terminées ?","noChangesDoneBody":"L’implémentation a confirmé qu’aucune modification de code n’est nécessaire. Les specs passeront à Terminé et le worktree sans changement sera nettoyé.","refineTitle":"Affiner ces specs ?","refineBody":"Le résultat sans modification sera fermé et les specs retourneront dans le backlog pour être affinées. Les journaux d’exécution resteront disponibles.","mergeLocalTitle":"Intégrer localement ?","mergeLocalBody":"Les branches livrées seront fusionnées dans {{base}} localement. Les modifications existantes sont préservées ; les modifications qui se chevauchent peuvent nécessiter une résolution avant l’intégration.","freshDiscardTitle":"Supprimer cette livraison ?","freshDiscardBody":"La PR sera fermée sans supprimer sa branche distante. Seuls les branches locales et les worktrees appartenant à SpecRails et toujours positionnés sur leur commit enregistré seront supprimés ; tout élément modifié sera conservé avec un avertissement. Les specs retourneront dans le backlog. Les ressources locales supprimées ne peuvent pas être récupérées.","implementationFailedDiscardTitle":"Abandonner cette livraison en échec ?","implementationFailedDiscardBody":"La carte sera fermée et ses specs retourneront dans le backlog. Le travail local et les branches seront conservés pour inspection. Seules les ressources dont le nettoyage est prouvé sûr pourront être supprimées.","dismissTitle":"Fermer ce suivi ?","dismissBody":"Cette carte de suivi sera fermée. Son worktree ne sera supprimé que si cela reste sans risque ; sinon, il sera conservé avec un avertissement. La PR existante, sa branche et son état de revue resteront inchangés.","discardLocalTitle":"Supprimer le résultat local ?","discardLocalBody":"L’itération locale récupérable ne sera supprimée que si cela reste sans risque ; si elle a changé, elle sera conservée avec un avertissement. Toute PR existante et sa branche resteront inchangées. Un résultat supprimé ne peut pas être récupéré."},"degraded":{"pushed":"La branche a été poussée mais la PR n'a pas pu être créée — réessayez pour terminer.","localOnly":"Les modifications ont été assemblées en local mais pas poussées — réessayez pour publier la PR."},"alreadyResolved":"Déjà résolue ailleurs","actionFailed":"L'action a échoué","notMergedYet":"Pas encore fusionnée","commitMissingRetry":"Le commit de livraison n’est plus présent dans la PR. Vous pouvez réessayer le push.","prVerifiedWaiting":"Commit {{sha}} vérifié · en attente du merge","viewLog":"Voir le journal d'exécution de {{ref}}","runElapsedAria":"{{elapsed}} écoulées","runCostAria":"{{cost}} dépensés","pinned":{"label":"Épinglée","marker":"Carte d’implémentation — épinglée ci-dessus","collapse":"Réduire la carte épinglée","expand":"Déployer la carte épinglée","expandCard":"Développer cette carte","collapseCard":"Réduire cette carte","collapsed_one":"Carte d’implémentation","collapsed_other":"{{count}} cartes d’implémentation","state":{"completed":"Terminée","no_changes":"Aucune modification","pr_closed":"Fermée","superseded":"Remplacée","building":"En cours","on_review":"Revue","pr_draft":"PR brouillon","pr_ready":"Publiée","implementation_failed":"Échec","pr_failed":"Échec","merged":"Fusionnée","discarded":"Abandonnée"}},"mergeLocal":"Intégrer en local","mergeLocalTooltip":"Fusionne les branches livrées dans {{base}} dans votre checkout local (sans GitHub)","mergeLocalBlockedDirty":"Intégration impossible : les modifications locales sur {{base}} chevauchent la livraison. Commitez ou remisez ces modifications, puis réessayez.","mergeLocalBlockedBranch":"Impossible d'intégrer : votre checkout est sur {{current}}, pas sur {{base}}. Passez sur {{base}}, puis réessayez.","mergedLocally":"Intégré dans {{base}} en local","discardStackedNote":"Les rails suivants de ce jalon ont été construits sur cette livraison. L'abandonner met la chaîne du jalon en pause ; les rails suivants conservent leur travail."}`),$={heading:`Brouillon de spec`,drafting:`Mise à jour du brouillon…`,acceptanceCriteria:`Critères d'acceptation`,untitled:`Spec sans titre`,expand:`Afficher la description complète`,collapse:`Réduire la description`},ee={heading:`Cadrage`,framing:`Cadrage de la demande…`,restated:`Ce que j'ai compris`,alternative:`Cela pourrait aussi signifier`,pick:`Répondre avec ceci`,touches:`Toucherait`,discriminator:`Laquelle des deux ?`,assumptions:`Ce que je suppose`,unknowns:`Encore ouvert`},te={openTicket:`Ouvrir la spec #{{id}}`,openPullRequest:`Ouvrir la PR #{{id}}`,openJob:`Ouvrir le job {{id}}`,openLoop:`Ouvrir la boucle {{id}}`,ticketNotFound:`Spec #{{id}} introuvable — elle a peut-être été supprimée`,pullRequestUrlMissing:`La PR #{{id}} est mentionnée sans URL`,pullRequestNotFound:`PR #{{id}} introuvable dans ce projet`,jobNotFound:`Job introuvable — il a peut-être été supprimé`,loopNotFound:`Boucle introuvable — elle a peut-être été supprimée`,lookupFailed:`Impossible de vérifier la référence — réessayez`},ne={untitled:`Mission sans titre`,menu:`Menu de la mission`,rename:`Renommer`,renamePlaceholder:`Nom de la mission`,renameHint:`Double-clic pour renommer`,renameFailed:`Renommage impossible`,addFavorite:`Ajouter aux favorites`,removeFavorite:`Retirer des favorites`,copyName:`Copier le nom de la mission`,copyId:`Copier l'ID de la mission`,copyProject:`Copier le nom du projet`,copyProjectPath:`Copier le chemin du projet`,copyFailed:`Copie impossible`,copyTranscript:`Copier la transcription`,copyTranscriptSuccess:`Transcription copiée`,copyTranscriptFailed:`Impossible de copier la transcription`,exportTranscript:`Exporter la transcription (.txt)`,exportTranscriptSuccess:`Export de la transcription lancé`,exportTranscriptFailed:`Impossible d'exporter la transcription`,delete:`Supprimer la mission`,deleteConfirm:`Supprimer cette mission ? Action irréversible.`,deleteFailed:`Impossible de supprimer la mission`},re=`Que doit-on construire maintenant ?`,ie={title:`Journal d'exécution`,live:`En direct`,empty:`Aucune activité d'outil dans ce tour pour l'instant.`,output:`Sortie`,error:`Erreur`,copyAll:`Copier tout le journal`,copyEntry:`Copier l'entrée`,copySuccess:`Journal copié dans le presse-papiers`,copyFailed:`Impossible de copier le journal`,openLog:`Voir le journal d'exécution`,close:`Fermer`},ae={open:`Voir les logs de {{command}}`,logsTitle:`Logs du processus`,logsDescription:`Sortie en direct et historique enregistré de ce processus.`,close:`Fermer les logs`,command:`Commande`,directory:`Répertoire`,exitCode:`Code de sortie : {{code}}`,signal:`Signal : {{signal}}`,search:`Rechercher dans les logs…`,source:`Source de sortie`,allSources:`Toutes les sorties`,pause:`Pause`,resume:`Reprendre`,follow:`Suivre`,copy:`Copier les logs visibles`,download:`Télécharger les logs visibles`,stop:`Arrêter le processus`,stopCommand:`Arrêter {{command}}`,stopFailed:`Impossible d’arrêter le processus. Réessayez.`,truncated:`La fenêtre de logs est limitée. Des sorties anciennes ou des lignes longues peuvent être omises. La copie et le téléchargement incluent seulement cette vue.`,paused:`Vue en pause. Le processus continue.`,loadFailed:`Impossible de charger les logs. Leur durée de conservation a peut-être expiré ; la sortie déjà chargée reste visible.`,retry:`Réessayer`,copied:`Logs visibles copiés.`,exportFailed:`Impossible d’exporter les logs. Réessayez.`,output:`Sortie du processus`,loading:`Chargement des logs…`,noMatches:`Aucune sortie correspondante.`,empty:`Aucune sortie pour le moment.`,lineCount:`{{count}} lignes sur {{total}}`,exportHint:`L’export inclut seulement le filtre actuel et la sortie conservée.`,status:{starting:`Démarrage`,running:`En cours`,stopping:`Arrêt en cours`,exited:`Terminé`,killed:`Arrêté`,failed:`Échec`,interrupted:`Déconnecté`},repository:`Dépôt`,history:{button:`Processus`,title:`Processus de la mission`,open:`Voir l’historique des processus`,description:`Consultez les processus actifs et les journaux enregistrés des exécutions précédentes.`,search:`Rechercher une commande ou un dépôt…`,refresh:`Actualiser l’historique`,close:`Fermer l’historique des processus`,back:`Retour aux processus`,loading:`Chargement de l’historique…`,empty:`Aucun processus n’a encore été enregistré pour cette mission.`,noMatches:`Aucun processus correspondant.`,loadFailed:`Impossible de charger l’historique. Les entrées déjà chargées restent disponibles.`,showMore:`Afficher plus`,count:`Processus : {{count}}`},interruptedHint:`Specrails ne supervise plus ce processus. Son état dans le système d’exploitation est inconnu ; les journaux enregistrés restent disponibles.`,persistenceFailed:`L’historique du processus n’a pas pu être enregistré. La sortie disponible reste visible.`},oe={detach:`Ouvrir dans une fenêtre séparée`,attach:`Revenir à la fenêtre principale`,detached:`Cette mission est ouverte dans une autre fenêtre.`,focus:`Afficher la fenêtre de la mission`,loading:`Déplacement de la mission…`,failed:`Impossible de déplacer cette mission. Votre brouillon est conservé.`,dismiss:`Fermer`,wrongMission:`Ouvrez cette mission avant de la déplacer.`,finishPending:`Terminez l’opération en cours, ou enregistrez ou annulez le message ou la capture avant de déplacer la mission.`},se={heading:`Lancement de rail`,rail:`Rail {{index}}`,newRail:`Nouveau rail`,play:`Play`,launching:`Lancement…`,dismiss:`Ignorer`,playHint:`Ajustez ce que vous voulez, puis appuyez sur Play pour lancer sous votre propre autorité.`,pending:`Préparation d’une proposition de lancement…`,unreadable_one:`La proposition de lancement de l’agent n’a pas pu être lue.`,unreadable_other:`{{count}} propositions de lancement n’ont pas pu être lues.`,pinnedMarker:`Proposition de lancement épinglée au-dessus du composeur`,effortDefault:`Effort par défaut`,profileNone:`Aucun profil`,status:{proposal:`Proposition`,ready:`Prêt`,blocked:`Attention requise`,loading:`Vérification…`},availability:{free:`libre`,busy:`en cours d’exécution`,pending_decision:`en attente d’une décision`,on_review:`en revue`},fields:{rail:`Rail`,newRailName:`Nom du nouveau rail (facultatif)`,railName:`Nom du rail`,addSpec:`Ajouter une spec`,removeSpec:`Retirer #{{id}}`,loop:`Loop`,engine:`Moteur IA`,model:`Modèle`,effort:`Effort de raisonnement`,profile:`Profil d’agents`,targetPr:`PR cible #`,baseBranch:`Branche de base`},notes:{railMissing:`Le Rail {{index}} n’existe plus — choisissez un autre rail ou créez-en un.`,railBusy:`Le Rail {{index}} est {{state}} — impossible de lancer ici.`,useFree:`Utiliser le Rail {{index}}`,specsDropped:`Ne font plus partie de ce projet : {{ids}}`,engineStale:`{{engine}} n’est pas détecté sur cette machine — {{fallback}} sera utilisé.`,modelStale:`{{model}} n’est pas disponible — {{fallback}} sera utilisé.`},block:{noProject:`Cette mission n’est épinglée à aucun projet.`,loadFailed:`Impossible de charger les rails, specs ou dépôts du projet.`,noSpecs:`Ajoutez au moins une spec pour lancer.`,railLimit:`Les {{max}} rails existent déjà et aucun n’est libre.`},errors:{tickets_in_flight:`L’une de ces specs s’exécute déjà sur un autre rail.`,pr_decision_pending:`Ce rail attend une décision concernant la PR.`,rail_limit_reached:`Le projet a déjà atteint le nombre maximal de rails.`,invalid_base_branch:`Cette branche de base n’existe pas en local.`,base_branch_requires_isolation:`Une branche de base nécessite l’isolation par worktree (un dépôt git avec des commits).`,target_pr_requires_pr_mode:`Une PR cible nécessite l’isolation par worktree (un dépôt git avec des commits).`,invalid_response:`Réponse inattendue du serveur.`,scope_save_failed:`Impossible d’enregistrer les dépôts de la spec.`,repository_scope_incomplete:`Un dépôt requis par les specs manque au lancement. Vérifiez les attributions ci-dessus.`},stub:{launched:`Lancé → Rail {{rail}}`,dismissed:`Proposition ignorée`,viewRun:`Voir le run`,goToCard:`Aller à la carte`,goToCardTitle:`Aller à la carte d'implémentation de ce lancement`,viewRunTitle:`Ouvrir le journal en direct du run`},followUp:{title:`Résoudre {{count}} commentaire(s) de revue de la PR`,excluded:`Ne pas modifier`,verification:`Vérifier`,specUntouched:`La spec et sa description Jira ne sont pas modifiées : le périmètre voyage avec l’exécution.`,source:{pasted:`collé`,github:`depuis GitHub`}},addenda:{rides_one:`{{count}} addendum ouvert accompagne ce lancement :`,rides_other:`{{count}} addenda ouverts accompagnent ce lancement :`},repositories:{launch:`Dépôts pour ce lancement`,launchHint:`Inclut les dépôts requis par les specs. Vous pouvez ajouter d’autres dépôts du projet.`,assignments:`Attribués à chaque spec`,edit:`Modifier`,editSpec:`Modifier les dépôts de #{{id}}`,spec:`Dépôts de la spec #{{id}}`,saveHint:`L’enregistrement met aussi à jour les dépôts de cette spec pour les futurs lancements.`,save:`Enregistrer les dépôts`,cancel:`Annuler`,finishEditing:`Enregistrez ou annulez la modification des dépôts avant de lancer.`,missing:`Dépôts requis manquants : {{names}}. Incluez-les ci-dessus ou modifiez les attributions de la spec si ses cibles ont changé.`,unavailable:`Les dépôts sélectionnés ne sont pas disponibles pour l’implémentation : {{names}}. Modifiez la sélection ou les attributions des specs.`,refresh:`Actualiser`,retry:`Réessayer le chargement`,checkScope:`Vérifiez la sélection des dépôts avant de lancer.`}},ce={status:{running:`En cours`,paused:`En pause`,succeeded:`Réussi`,failed:`Échoué`,stalled:`Bloqué`,cancelled:`Annulé`,unknown:`Inconnu`},title:{running:`Implémentation dans le checkout du projet…`,paused:`Une décision humaine est nécessaire`,succeeded:`Implémentation terminée`,failed:`L’implémentation a échoué`,stalled:`L’implémentation est bloquée`,cancelled:`Run annulé`,unknown:`État du run inconnu`},noDeliveryNote:`Pas de phase PR — ce projet n’a ni dépôt git ni commits, le travail a donc été appliqué directement dans le dossier du projet.`,noDeliveryHint:`Exécution directe dans le dossier du projet (pas de dépôt git ni de commits — aucune PR ne sera proposée).`,failure:{title:`Pourquoi ça s’est arrêté`,step:`étape {{step}}`,unit:`#{{ticket}} · {{code}}`},actions:{resume:`Reprendre`,approve:`Approuver`,recover:`Récupérer et réessayer`,relaunch:`Relancer`},relaunchSent:`Rail {{index}} relancé — une nouvelle carte suivra le run.`,relaunchFailed:`Impossible de relancer le rail`,relaunchBlockedActive:`Le rail a encore un run actif`},le={marker:`Le Rail {{rail}} a échoué : {{code}}`,openCard:`Ouvrir la carte`,briefing:{title:`Compte rendu automatique de l’échec`}},ue={open:`Vue partagée`,menu:`Actions de conversation`,add:`Ajouter une conversation en vue partagée`,close:`Fermer la vue partagée`,loadFailed:`Impossible de charger cette conversation.`,retry:`Réessayer`},de={label:`Modèle et effort`,resetEffort:`Réinitialiser l’effort`,back:`Retour`},fe={0:`Quelle est la mission ?`,1:`Par quelle mission commençons-nous ?`,2:`Quelle est notre mission aujourd’hui ?`,3:`Quelle est notre prochaine mission ?`,4:`Que veux-tu accomplir avec cette mission ?`,5:`Quelle mission lançons-nous ?`,6:`Par où commencer cette mission ?`,7:`Quel est l’objectif de cette mission ?`,8:`Que construisons-nous dans cette mission ?`,9:`Qu’améliorons-nous avec cette mission ?`,10:`Quel défi relevons-nous dans cette mission ?`,11:`Quelle est la première étape de cette mission ?`,12:`Parle-moi de la mission que tu as en tête…`,13:`Décris ta prochaine mission…`,14:`Donnons forme à ta prochaine mission…`,15:`Que doit accomplir cette mission ?`,16:`Quelle mission aimerais-tu terminer ?`,17:`Que résolvons-nous dans cette mission ?`,18:`Qu’est-ce qui ferait de cette mission un succès ?`,19:`Tout est prêt pour une nouvelle mission. On commence ?`},pe={title:e,subtitle:t,trigger:n,composerPlaceholder:r,send:i,stop:a,copy:o,attachment:s,maximize:c,restore:l,minimize:u,close:d,newConversation:f,emptyTitle:p,emptyHint:m,thinking:h,connecting:g,consultingCode:_,size:v,model:y,history:b,queue:x,receipt:S,queueEdit:C,git:w,provider:T,tier:E,approval:D,project:O,palette:k,mission:A,noProvider:j,degraded:M,toolCard:N,error:P,chip:F,newAgent:I,switchToAgent:L,switchToKanban:R,search:z,home:B,favoriteMissions:V,untitled:H,workspace:U,attachFile:W,deleteConversation:G,confirmDeleteConversation:K,addFavoriteConversation:q,removeFavoriteConversation:J,confirmShort:Y,imagesUnsupported:X,effort:Z,prCard:Q,specDraft:$,problemFrame:ee,refs:te,header:ne,emptyTitleCodeRain:re,activity:ie,backgroundProcess:ae,window:oe,railCard:se,runCard:ce,runFailure:le,split:ue,runtimeSelector:de,missionPlaceholders:fe};export{ie as activity,q as addFavoriteConversation,D as approval,W as attachFile,s as attachment,ae as backgroundProcess,F as chip,d as close,r as composerPlaceholder,K as confirmDeleteConversation,Y as confirmShort,g as connecting,_ as consultingCode,o as copy,pe as default,M as degraded,G as deleteConversation,Z as effort,m as emptyHint,p as emptyTitle,re as emptyTitleCodeRain,P as error,V as favoriteMissions,w as git,ne as header,b as history,B as home,X as imagesUnsupported,c as maximize,u as minimize,A as mission,fe as missionPlaceholders,y as model,I as newAgent,f as newConversation,j as noProvider,k as palette,Q as prCard,ee as problemFrame,O as project,T as provider,x as queue,C as queueEdit,se as railCard,S as receipt,te as refs,J as removeFavoriteConversation,l as restore,ce as runCard,le as runFailure,de as runtimeSelector,z as search,i as send,v as size,$ as specDraft,ue as split,a as stop,t as subtitle,L as switchToAgent,R as switchToKanban,h as thinking,E as tier,e as title,N as toolCard,n as trigger,H as untitled,oe as window,U as workspace};
@@ -1 +0,0 @@
1
- var e=`Controllo missioni`,t=`Gestisci Specrails chattando`,n=`Controllo missioni`,r=`Qual è la missione?`,i=`Invia`,a=`Ferma`,o=`Copia`,s={openPreview:`Anteprima di {{name}}`,openDownload:`Scarica {{name}}`,previewTitle:`Anteprima di {{name}}`,downloadTitle:`Scaricare il file?`,downloadPrompt:`Questo file non può essere visualizzato qui. Vuoi scaricarlo?`,download:`Scarica`,cancelDownload:`Non ora`,loading:`Preparazione del file…`,loadFailed:`Impossibile caricare l'allegato`,loadError:`Impossibile caricare l'allegato: {{error}}`},c=`Massimizza`,l=`Ripristina`,u=`Riduci a icona`,d=`Chiudi`,f=`Nuova missione`,p=`Qual è la missione?`,m=`Scegli un progetto, poi chiedi. La board si aggiorna in tempo reale mentre l'agente lavora.`,h=`Sto pensando…`,g=`Connessione…`,_=`Consulto l'app…`,v={compact:`Compatto`,comfortable:`Comodo`,max:`Ingrandisci`},y={label:`Modello`,loading:`Caricamento modelli…`,unavailable:`Modelli non disponibili`},b={hint:`Cronologia prompt — scrivi per modificare, ↑↓ per navigare`},x={queued:`In coda`,send:`Invia messaggio`,sendHint:`In coda per il prossimo turno. Seleziona «Indirizza» su un messaggio in coda per inviarlo senza interrompere il modello.`,placeholder:`Aggiungi un messaggio alla coda…`,delivered:`Consegnato all’agente`,interrupted:`Consegna non confermata`,cancelled:`Annullato prima della consegna`,steer:`Indirizza`,steerHint:`Invia senza interrompere il modello`,steering:`Invio all’agente…`,remove:`Elimina messaggio dalla coda`,more:`Opzioni del messaggio`,edit:`Modifica`,actionConflict:`Il messaggio è già in fase di consegna o non è più in coda.`,actionFailed:`Impossibile aggiornare il messaggio in coda. Riprova.`},S={sent:`Inviato all’agente`,received:`Consegnato all’agente`,read:`Letto dall’agente`,interrupted:`Consegna non confermata`,cancelled:`Annullato prima della consegna`},C={editing:`Modifica del messaggio in attesa {{n}} di {{m}}`,hint:`↑↓ per navigare · Invio salva · Esc annulla`,save:`Salva messaggio in attesa`,cancel:`Annulla modifica`,dispatched:`Il messaggio è già stato consegnato; il testo rimane come bozza`,saveFailed:`Impossibile salvare il messaggio in attesa`},w={branch:`Branch`,detached:`(detached)`,dirty:`Modifiche non committate`,switched:`Passato a {{branch}}`,switchFailed:`Impossibile cambiare branch`,lockedWhileWorking:`Branch bloccato mentre l'agente lavora`,searchPlaceholder:`Cerca branch…`,noMatches:`Nessun branch corrisponde`,worktrees:`Worktree`,worktreePathCopied:`Percorso del worktree copiato`,copyWorktreePath:`Copia percorso del worktree`,repository:`Repository`,repositoryUnavailable:`Repository non disponibile`,loadFailed:`Stato Git non disponibile`,notGit:`Cartella di contesto · senza Git`,retry:`Riprova`},T={label:`Provider`,claude:`Claude`,codex:`Codex`,gemini:`Gemini`,kimi:`Kimi`},E={cycleHint:`⇧⇥ per cambiare`,observe:{name:`Osserva`,desc:`Solo lettura — niente cambia`},edit:{name:`Modifica`,desc:`Crea e modifica (reversibile)`},operate:{name:`Opera`,desc:`Avvia l'IA — ha un costo`},autonomous:{name:`Autonomo`,desc:`Elimina e arresta — irreversibile`},lockedTitle:`Serve un livello superiore`,lockedBody:`Quell'azione richiede il livello «{{level}}». Sei su «{{current}}».`,raiseHint:`⇧⇥ per alzare il livello, o chiedi in un altro modo.`},D={title:`Conferma azione`,costAction:`{{action}} · ~{{cost}} · {{tier}}`,approve:`Approva`,cancel:`Annulla`,dontAskAgain:`Non chiedere più in questa sessione`,approved:`Approvato`,cancelled:`Annullato`},O={home:`Home`,searchPlaceholder:`Parla con Specrails…`,searchProjectsPlaceholder:`Cerca progetti…`,recents:`Recenti`,allProjects:`Tutti i progetti`,searchAll:`Cerca in tutti i progetti`,addProject:`Aggiungi progetto…`,homeHint:`Nessun progetto selezionato — operando su tutti i progetti.`,askCreateOrSearch:`Nessun progetto è selezionato. Vuoi creare un nuovo progetto o cercare in tutti i progetti?`},k={remove:`Rimuovi {{label}}`,addContextAction:`Aggiungi contesto o azione`,filtering:`Filtro "{{query}}"`,keyboard:`↑↓ Enter Esc`,noMatches:`Nessun risultato`,noMatchesFor:`Nessun risultato per "{{query}}"`,mode:{reference:{title:`Riferimento`,hint:`@ progetti, spec, missioni`},trace:{title:`Traccia`,hint:`# job, esecuzioni, ID`},action:{title:`Azione`,hint:`/ comandi per questo contesto`}},plus:{reference:`Riferimento`,referenceHint:`Progetti, spec, missioni`,trace:`Traccia`,traceHint:`Job, esecuzioni, ID`,action:`Azione`,actionHint:`Crea, avvia, ispeziona`,fileAttachment:`File allegato`,fileAttachmentHint:`Aggiungi doc, immagini, log`,browserCapture:`Cattura browser`,browserCaptureHint:`Cattura un'area della pagina per questa missione`},railGroup:`Rail`,railGroupInUse:`Rail in uso`},A={label:`Cambia missione`,untitled:`Nuova missione`,new:`Nuova missione`,searchPlaceholder:`Cerca missioni…`,noMatches:`Nessuna missione corrisponde`,working:`L'agente sta lavorando`,queuedBadge:`{{n}} in coda`,delete:`Elimina missione "{{title}}"`,deleteConfirm:`Eliminare?`,deleteLiveConfirm:`L'agente sta lavorando — eliminare comunque?`,confirmDelete:`Conferma eliminazione`,cancelDelete:`Mantieni missione`,deleteFailed:`Impossibile eliminare la missione`},j={title:`Nessun provider IA installato`,body:`L'agente richiede Claude o Codex sul tuo computer. Installane uno e riapri l'agente per iniziare a chattare.`,placeholder:`Installa un provider IA per usare l'agente…`},M={title:`L'MCP di Specrails è spento`,body:`L'agente ha bisogno del server MCP integrato per gestire l'app.`,enable:`Attiva l'MCP di Specrails`,enabling:`Attivazione…`,enabled:`MCP attivato`},N={live:`in diretta`,queued:`in coda`,running:`in corso`,done:`completato`,failed:`fallito`},P={generic:`Qualcosa è andato storto. Riprova.`,busy:`L'agente è occupato. Riprova tra un momento.`},F={kindAgent:`Missione dell'agente`},I=`Nuova missione`,L=`Passa al Controllo missioni`,R=`Passa alla board`,z=`Cerca`,B=`Home`,V=`Missioni preferite`,H=`Senza titolo`,U={title:`Nel workspace`,terminal:`Terminale`,files:`File`,browser:`Browser`,requiresProject:`Seleziona un progetto per usare questo strumento`,resizeCode:`Ridimensiona pannello codice`,closeFiles:`Chiudi codice`,browserConfirm:`Aggiungi all'agente`,browserSelectStart:`Seleziona per aggiungere alla missione`,browserCaptured:`Cattura aggiunta`,uploadFailed:`Caricamento non riuscito`,requiresConversation:`Avvia una missione per usare questo strumento`,jobs:`Jobs`,closeJobs:`Chiudi jobs`,resizeJobs:`Ridimensiona pannello jobs`,noJobs:`Ancora nessun job — chiedi all'agente di lanciarne uno`,analytics:`Analytics`,closeAnalytics:`Chiudi analytics`,resizeAnalytics:`Ridimensiona pannello analytics`},W=`Allega file`,G=`Elimina «{{title}}»`,K=`Conferma eliminazione di «{{title}}»`,q=`Aggiungi «{{title}}» ai preferiti`,J=`Rimuovi «{{title}}» dai preferiti`,Y=`confermare?`,X=`Questo provider non legge ancora le immagini — allega file di testo`,Z={label:`Sforzo`,minimal:`Minimo`,low:`Basso`,medium:`Medio`,high:`Alto`,xhigh:`Extra alto`,max:`Massimo`,ultra:`Ultra`},Q=JSON.parse(`{"operation":{"inProgress":"Azione in corso…","create-pr":"Creazione PR…","publish":"Pubblicazione…","discard":"Eliminazione…","dismiss":"Chiusura del follow-up…","poll-merge":"Verifica merge…","reopen":"Riapertura…","merge-local":"Integrazione locale…","recover-and-retry":"Creazione del commit e nuovo tentativo di push del risultato preservato…","acknowledge-no-changes":"Contrassegno come completato…"},"markDone":"Segna come completate","refine":"Perfeziona","completedNote":"Confermato — le spec sono passate a Completate","partialSummary":"{{succeeded}} di {{total}} completate; {{failed}} non riuscite","unit":{"failed":"implementazione non riuscita","blocked":"consegna bloccata","noChanges":"nessuna modifica","succeeded":"pronta"},"rail":"Rail {{index}}","specCount_one":"{{count}} spec","specCount_other":"{{count}} spec","base":"Ramo base","openPr":"Apri PR","existingPr":"PR esistente","title":{"no_changes":"Nessuna modifica necessaria","partial":"Implementazione parziale","delivery_blocked":"Implementazione completa — la consegna richiede attenzione","update_failed":"Implementazione completa — aggiornamento non riuscito","pr_closed":"PR chiusa senza merge","superseded":"Sostituita da un’esecuzione più recente","existing_pr_updated":"PR esistente aggiornata","building":"Implementazione in un worktree isolato…","buildingExistingPr":"Applicazione delle modifiche su una PR esistente…","paused":"Serve una decisione umana","on_review":"Implementazione pronta per la revisione","pr_draft":"PR in bozza creata","pr_draft_degraded":"Consegna della PR incompleta","pr_ready":"PR pronta per il merge","implementation_failed":"Implementazione non riuscita","pr_failed":"Creazione della PR non riuscita","merged":"Merge della PR effettuato","discarded":"Scartata"},"buildingHint":"Al termine ti verrà chiesto se creare la PR.","buildingExistingPrHint":"Specrails sta lavorando sul branch della PR esistente e invierà le modifiche di review a quella stessa PR.","paused":"Implementazione in pausa","pausedForRun":"In pausa su {{ref}}","resume":"Riprendi","stopExecution":"Interrompi esecuzione","stopExecutionSent":"Segnale di stop inviato","stopExecutionFailed":"Impossibile interrompere l’esecuzione","createPr":"Crea PR","publish":"Pubblica","checkout":"Passa al branch","openReview":"Rivedi","openReviewTooltip":"Apri la revisione in linguaggio semplice","checkoutTooltip":"Esegui il checkout di {{branch}} nella cartella principale del progetto","checkoutSuccess":"Checkout eseguito su {{branch}}","checkoutFailed":"Impossibile eseguire il checkout del branch di implementazione","checkoutDirtyTitle":"Checkout bloccato per proteggere le tue modifiche","checkoutDirtyBody":"La cartella principale del progetto contiene modifiche senza commit. Esegui un commit o uno stash, quindi riprova. Non è stato modificato nulla.","checkoutSafetyUnknownTitle":"Checkout in pausa: impossibile verificare la sicurezza","checkoutSafetyUnknownBody":"Specrails non ha potuto leggere lo stato Git della cartella principale del progetto. Nulla è stato rilasciato o modificato. Riprova quando Git sarà disponibile.","checkoutNotDeliverableTitle":"Questo branch non contiene l’implementazione conservata","checkoutNotDeliverableBody":"Il commit esatto della consegna non è ancora stato verificato. Ispeziona o recupera invece il risultato locale.","inspectLocalResult":"Ispeziona il risultato locale","inspectLocalResultTooltip":"Mostra il worktree isolato preservato e copia il suo percorso","localResultPathCopied":"Percorso del risultato locale copiato","localResultPath":"Risultato locale preservato","localResultUnavailableHere":"Su questo computer non è disponibile alcun worktree recuperabile. Consulta il log dell’esecuzione dal computer su cui è stata eseguita.","recoverAndRetry":"Crea commit e riprova il push","recoverAndRetryVerified":"Il commit recuperato {{sha}} è verificato nella PR","recoveryStillBlocked":"Il recupero locale richiede ancora attenzione","recheckRecovery":"Controlla di nuovo","recoveryUnavailable":"Impossibile verificare il recupero su questo computer","recoveryUnavailableBody":"Specrails non ha potuto dimostrare in sicurezza un unico risultato appartenente alla consegna in questo clone. Nulla è stato modificato o rimosso. Controlla i dettagli della fase e i log di esecuzione. Se il run è stato eseguito su un altro computer, apri Specrails lì e controlla di nuovo.","recoveryDetailSummary":"Dettaglio tecnico del recupero","retry":"Riprova","retryPr":"Riprova PR","checkMerge":"Verifica merge","verifyPr":"Verifica PR","discard":"Scarta","confirmDiscard":"Confermare lo scarto?","mergedNote":"Merge effettuato — le spec sono passate a Completato","discardedNote":"Scartata — le spec sono tornate nel backlog","implementationFailedNote":"Il run di implementazione non è riuscito prima di produrre qualcosa di consegnabile. Apri il log del run per controllare l'errore, poi scarta questa scheda prima di rilanciare.","dismiss":"Chiudi follow-up","discardLocalResult":"Elimina risultato locale","retryPush":"Riprova push","retryPushVerified":"Push verificato · il commit {{sha}} è nella PR","commitAlreadyVerified":"Il commit {{sha}} è già verificato nella PR","deliveryCommit":"commit {{sha}}","reopen":"Riapri","createPartialPr":"Crea PR con {{count}}","supersededNote":"Un’esecuzione di implementazione più recente ha sostituito questa scheda.","noChangesExisting":"Non erano necessarie nuove modifiche; la PR esistente resta invariata.","noChangesNote":"Non erano necessarie modifiche al codice. Segna le spec come completate oppure riportale nel backlog per perfezionarle.","deliveryNeedsAttention":"Implementazione completa; la consegna richiede attenzione","deliveryBlockedNote":"L’implementazione è riuscita, ma la consegna è bloccata. Controlla il dettaglio della fase e i log prima di eliminare il risultato locale.","partialDeliveryBlockedNote":"Una parte dell’implementazione è riuscita, ma non c’è ancora nulla che possa essere consegnato in sicurezza. Controlla le evidenze per unità e i log prima di scegliere l’azione successiva.","retryPushNote":"L’implementazione è riuscita e le modifiche sono al sicuro in locale. Riprova solo il push.","cleanupIncomplete_one":"Pulizia incompleta ({{count}} avviso)","cleanupIncomplete_other":"Pulizia incompleta ({{count}} avvisi)","safetyArchiveTitle":"Archivio di sicurezza ({{count}})","safetyArchiveHint":"I file temporanei dell’area di lavoro sono stati conservati fuori dalla PR per precauzione. Puoi controllarli o rimuoverli manualmente.","confirm":{"recoverAndRetryTitle":"Creare il commit e inviare il risultato preservato?","recoverAndRetryBody":"Specrails userà esclusivamente il worktree isolato o il branch registrato compatibile con il fast-forward per {{branch}}. Se necessario, creerà un commit con i file consegnabili e invierà quel commit esatto solo se la PR è ancora aperta sui branch di origine e destinazione previsti. La cartella principale del progetto e le sue modifiche senza commit non verranno toccate.","recheckRecoveryTitle":"Controllare di nuovo questo computer?","recheckRecoveryBody":"Specrails riesaminerà in questo clone il worktree, il branch, i ref, i reflog e gli oggetti Git orfani appartenenti alla consegna di {{branch}}. Se dimostra un unico risultato, potrà eseguire il commit delle modifiche isolate e ritentare il push esatto. La cartella principale del progetto non verrà toccata.","noChangesDoneTitle":"Segnare queste spec come completate?","noChangesDoneBody":"L’implementazione ha confermato che non servono modifiche al codice. Le spec passeranno a Completate e il worktree senza modifiche verrà ripulito.","refineTitle":"Perfezionare queste spec?","refineBody":"Il risultato senza modifiche verrà chiuso e le spec torneranno nel backlog per essere perfezionate. I log di esecuzione resteranno disponibili.","mergeLocalTitle":"Integrare localmente?","mergeLocalBody":"I branch consegnati saranno uniti a {{base}} localmente. Le modifiche esistenti vengono preservate; quelle sovrapposte potrebbero richiedere una risoluzione prima dell’integrazione.","freshDiscardTitle":"Eliminare questa consegna?","freshDiscardBody":"La PR verrà chiusa senza eliminare il branch remoto. Verranno rimossi solo i branch locali e i worktree di proprietà di SpecRails che si trovano ancora sul commit registrato; qualsiasi elemento modificato sarà conservato con un avviso. Le spec torneranno nel backlog. Le risorse locali rimosse non possono essere recuperate.","implementationFailedDiscardTitle":"Scartare questa consegna non riuscita?","implementationFailedDiscardBody":"La scheda verrà chiusa e le spec torneranno nel backlog. Il lavoro locale e i branch saranno conservati per l’ispezione. Potranno essere rimosse solo le risorse la cui pulizia è dimostrata sicura.","dismissTitle":"Chiudere questo follow-up?","dismissBody":"Questa scheda di follow-up verrà chiusa. Il relativo worktree verrà rimosso solo se è ancora sicuro farlo; in caso contrario, sarà conservato con un avviso. La PR esistente, il suo branch e lo stato di revisione resteranno invariati.","discardLocalTitle":"Eliminare il risultato locale?","discardLocalBody":"L’iterazione locale recuperabile verrà rimossa solo se è ancora sicuro farlo; se è cambiata, sarà conservata con un avviso. Qualsiasi PR esistente e il suo branch resteranno invariati. Un risultato rimosso non può essere recuperato."},"degraded":{"pushed":"Il ramo è stato inviato ma non è stato possibile creare la PR — riprova per completare.","localOnly":"Le modifiche sono state assemblate in locale ma non inviate — riprova per pubblicare la PR."},"alreadyResolved":"Già risolta altrove","actionFailed":"Azione non riuscita","notMergedYet":"Ancora nessun merge","commitMissingRetry":"Il commit di consegna non è più presente nella PR. Puoi riprovare il push.","prVerifiedWaiting":"Commit {{sha}} verificato · in attesa del merge","viewLog":"Vedi il log di esecuzione di {{ref}}","runElapsedAria":"{{elapsed}} trascorsi","runCostAria":"{{cost}} spesi","pinned":{"label":"Fissata","marker":"Scheda di implementazione — fissata sopra","collapse":"Riduci la scheda fissata","expand":"Espandi la scheda fissata","expandCard":"Espandi questa scheda","collapseCard":"Riduci questa scheda","collapsed_one":"Scheda di implementazione","collapsed_other":"{{count}} schede di implementazione","state":{"completed":"Completata","no_changes":"Nessuna modifica","pr_closed":"Chiusa","superseded":"Sostituita","building":"In corso","on_review":"Revisione","pr_draft":"PR bozza","pr_ready":"Pubblicata","implementation_failed":"Fallita","pr_failed":"Fallita","merged":"Unita","discarded":"Scartata"}},"mergeLocal":"Integra in locale","mergeLocalTooltip":"Unisce i branch consegnati in {{base}} nel tuo checkout locale (senza GitHub)","mergeLocalBlockedDirty":"Impossibile integrare: le modifiche locali su {{base}} si sovrappongono alla consegna. Esegui il commit o lo stash di queste modifiche e riprova.","mergeLocalBlockedBranch":"Impossibile integrare: il tuo checkout è su {{current}}, non su {{base}}. Passa a {{base}} e riprova.","mergedLocally":"Integrato in {{base}} in locale","discardStackedNote":"I rail successivi di questa milestone sono stati costruiti su questa consegna. Scartarla mette in pausa la catena della milestone; i rail successivi conservano il loro lavoro."}`),$={heading:`Bozza della spec`,drafting:`Aggiornamento della bozza…`,acceptanceCriteria:`Criteri di accettazione`,untitled:`Spec senza titolo`,expand:`Mostra descrizione completa`,collapse:`Comprimi descrizione`},ee={heading:`Inquadramento`,framing:`Inquadramento della richiesta…`,restated:`Ciò che ho capito`,alternative:`Potrebbe anche significare`,pick:`Rispondi con questo`,touches:`Toccherebbe`,discriminator:`Quale delle due?`,assumptions:`Ciò che sto assumendo`,unknowns:`Ancora aperto`},te={openTicket:`Apri la spec #{{id}}`,openPullRequest:`Apri PR #{{id}}`,openJob:`Apri il job {{id}}`,openLoop:`Apri loop {{id}}`,ticketNotFound:`Spec #{{id}} non trovata — potrebbe essere stata eliminata`,pullRequestUrlMissing:`La PR #{{id}} è stata citata senza URL`,pullRequestNotFound:`La PR #{{id}} non è stata trovata in questo progetto`,jobNotFound:`Job non trovato — potrebbe essere stato eliminato`,loopNotFound:`Loop non trovato — potrebbe essere stato eliminato`,lookupFailed:`Impossibile verificare il riferimento — riprova`},ne={untitled:`Missione senza titolo`,menu:`Menu della missione`,rename:`Rinomina`,renamePlaceholder:`Nome della missione`,renameHint:`Doppio clic per rinominare`,renameFailed:`Impossibile rinominare`,addFavorite:`Aggiungi ai preferiti`,removeFavorite:`Rimuovi dai preferiti`,copyName:`Copia nome missione`,copyId:`Copia ID missione`,copyProject:`Copia nome progetto`,copyProjectPath:`Copia percorso progetto`,copyFailed:`Impossibile copiare`,copyTranscript:`Copia trascrizione`,copyTranscriptSuccess:`Trascrizione copiata`,copyTranscriptFailed:`Impossibile copiare la trascrizione`,exportTranscript:`Esporta trascrizione (.txt)`,exportTranscriptSuccess:`Esportazione della trascrizione avviata`,exportTranscriptFailed:`Impossibile esportare la trascrizione`,delete:`Elimina missione`,deleteConfirm:`Eliminare questa missione? Non è reversibile.`,deleteFailed:`Impossibile eliminare la missione`},re=`Cosa costruiamo adesso?`,ie={title:`Log di esecuzione`,live:`In diretta`,empty:`Nessuna attività degli strumenti in questo turno.`,output:`Output`,error:`Errore`,copyAll:`Copia log completo`,copyEntry:`Copia voce`,copySuccess:`Log copiato negli appunti`,copyFailed:`Impossibile copiare il log`,openLog:`Vedi log di esecuzione`,close:`Chiudi`},ae={open:`Visualizza i log di {{command}}`,logsTitle:`Log del processo`,logsDescription:`Output in diretta e cronologia salvata del processo.`,close:`Chiudi log`,command:`Comando`,directory:`Directory`,exitCode:`Codice di uscita: {{code}}`,signal:`Segnale: {{signal}}`,search:`Cerca nei log…`,source:`Origine dell’output`,allSources:`Tutto l’output`,pause:`Pausa`,resume:`Riprendi`,follow:`Segui`,copy:`Copia i log visibili`,download:`Scarica i log visibili`,stop:`Arresta processo`,stopCommand:`Arresta {{command}}`,stopFailed:`Impossibile arrestare il processo. Riprova.`,truncated:`La finestra dei log è limitata. Output precedente o righe lunghe possono essere omessi. Copia e download includono solo questa vista.`,paused:`Vista in pausa. Il processo continua.`,loadFailed:`Impossibile caricare i log. Il periodo di conservazione potrebbe essere scaduto; l’output già caricato resta visibile.`,retry:`Riprova`,copied:`Log visibili copiati.`,exportFailed:`Impossibile esportare i log. Riprova.`,output:`Output del processo`,loading:`Caricamento dei log…`,noMatches:`Nessun output corrispondente.`,empty:`Nessun output per ora.`,lineCount:`{{count}} di {{total}} righe`,exportHint:`L’esportazione include solo il filtro attuale e l’output conservato.`,status:{starting:`Avvio`,running:`In esecuzione`,stopping:`Arresto in corso`,exited:`Terminato`,killed:`Arrestato`,failed:`Non riuscito`,interrupted:`Disconnesso`},repository:`Repository`,history:{button:`Processi`,title:`Processi della missione`,open:`Visualizza cronologia dei processi`,description:`Consulta i processi attivi e i log salvati delle esecuzioni precedenti.`,search:`Cerca comando o repository…`,refresh:`Aggiorna cronologia`,close:`Chiudi cronologia dei processi`,back:`Torna ai processi`,loading:`Caricamento della cronologia…`,empty:`Non sono ancora stati registrati processi per questa missione.`,noMatches:`Nessun processo corrispondente.`,loadFailed:`Impossibile caricare la cronologia. Le voci già caricate restano disponibili.`,showMore:`Mostra altri`,count:`Processi: {{count}}`},interruptedHint:`Specrails non supervisiona più questo processo. Il suo stato nel sistema operativo è sconosciuto; i log salvati restano disponibili.`,persistenceFailed:`Impossibile salvare la cronologia del processo. L’output disponibile resta visibile.`},oe={detach:`Apri in una finestra separata`,attach:`Torna alla finestra principale`,detached:`Questa missione è aperta in un’altra finestra.`,focus:`Mostra la finestra della missione`,loading:`Spostamento della missione…`,failed:`Impossibile spostare la missione. La bozza è stata conservata.`,dismiss:`Chiudi`,wrongMission:`Apri questa missione prima di spostarla.`,finishPending:`Completa l’operazione in corso oppure salva o annulla il messaggio o la cattura prima di spostare la missione.`},se={heading:`Lancio del rail`,rail:`Rail {{index}}`,newRail:`Nuovo rail`,play:`Play`,launching:`Avvio in corso…`,dismiss:`Ignora`,playHint:`Modifica ciò che vuoi, poi premi Play per lanciare sotto la tua responsabilità.`,pending:`Preparazione di una proposta di lancio…`,unreadable_one:`Impossibile leggere la proposta di lancio dell’agente.`,unreadable_other:`Impossibile leggere {{count}} proposte di lancio.`,pinnedMarker:`Proposta di lancio fissata sopra il compositore`,effortDefault:`Sforzo predefinito`,profileNone:`Nessun profilo`,status:{proposal:`Proposta`,ready:`Pronto`,blocked:`Richiede attenzione`,loading:`Verifica in corso…`},availability:{free:`libero`,busy:`in esecuzione`,pending_decision:`in attesa di una decisione`,on_review:`in revisione`},fields:{rail:`Rail`,newRailName:`Nome del nuovo rail (facoltativo)`,railName:`Nome del rail`,addSpec:`Aggiungi spec`,removeSpec:`Rimuovi #{{id}}`,loop:`Loop`,engine:`Motore IA`,model:`Modello`,effort:`Sforzo di ragionamento`,profile:`Profilo agenti`,targetPr:`PR di destinazione #`,baseBranch:`Branch di base`},notes:{railMissing:`Il Rail {{index}} non esiste più — scegli un altro rail o creane uno.`,railBusy:`Il Rail {{index}} è {{state}} — il lancio lì è bloccato.`,useFree:`Usa il Rail {{index}}`,specsDropped:`Non più in questo progetto: {{ids}}`,engineStale:`{{engine}} non è rilevato su questa macchina — verrà usato {{fallback}}.`,modelStale:`{{model}} non è disponibile — verrà usato {{fallback}}.`},block:{noProject:`Questa missione non è fissata a nessun progetto.`,loadFailed:`Impossibile caricare i rail, le spec o i repository del progetto.`,noSpecs:`Aggiungi almeno una spec per lanciare.`,railLimit:`Tutti i {{max}} rail esistono già e nessuno è libero.`},errors:{tickets_in_flight:`Una di queste spec è già in esecuzione su un altro rail.`,pr_decision_pending:`Questo rail è in attesa di una decisione sulla PR.`,rail_limit_reached:`Il progetto ha già il numero massimo di rail.`,invalid_base_branch:`Quel branch di base non esiste in locale.`,base_branch_requires_isolation:`Un branch di base richiede l’isolamento tramite worktree (un repository git con commit).`,target_pr_requires_pr_mode:`Una PR di destinazione richiede l’isolamento tramite worktree (un repository git con commit).`,invalid_response:`Risposta inattesa dal server.`,scope_save_failed:`Impossibile salvare i repository della spec.`,repository_scope_incomplete:`Manca un repository richiesto dalle spec per l’avvio. Controlla le assegnazioni sopra.`},stub:{launched:`Lanciato → Rail {{rail}}`,dismissed:`Proposta ignorata`,viewRun:`Vedi run`,goToCard:`Vai alla scheda`,goToCardTitle:`Vai alla scheda di implementazione di questo lancio`,viewRunTitle:`Apri il log in tempo reale del run`},followUp:{title:`Risolvere {{count}} commento/i di revisione della PR`,excluded:`Non modificare`,verification:`Verifica`,specUntouched:`La spec e la sua descrizione Jira non vengono modificate: l’ambito viaggia con l’esecuzione.`,source:{pasted:`incollato`,github:`da GitHub`}},addenda:{rides_one:`{{count}} addendum aperto viaggia con questo lancio:`,rides_other:`{{count}} addenda aperti viaggiano con questo lancio:`},repositories:{launch:`Repository per questo avvio`,launchHint:`Include i repository richiesti dalle spec. Puoi aggiungere altri repository del progetto.`,assignments:`Assegnati a ogni spec`,edit:`Modifica`,editSpec:`Modifica i repository di #{{id}}`,spec:`Repository della spec #{{id}}`,saveHint:`Il salvataggio aggiorna le assegnazioni dei repository di questa spec anche per gli avvii futuri.`,save:`Salva repository`,cancel:`Annulla`,finishEditing:`Salva o annulla la modifica dei repository prima di avviare.`,missing:`Mancano repository necessari: {{names}}. Includili sopra o modifica le assegnazioni della spec se i suoi obiettivi sono cambiati.`,unavailable:`I repository selezionati non sono disponibili per l’implementazione: {{names}}. Aggiorna la selezione o le assegnazioni delle spec.`,refresh:`Aggiorna`,retry:`Riprova il caricamento`,checkScope:`Controlla la selezione dei repository prima di avviare.`}},ce={status:{running:`In esecuzione`,paused:`In pausa`,succeeded:`Completato`,failed:`Fallito`,stalled:`Bloccato`,cancelled:`Annullato`,unknown:`Sconosciuto`},title:{running:`Implementazione nel checkout del progetto…`,paused:`Richiede una decisione umana`,succeeded:`Implementazione terminata`,failed:`Implementazione fallita`,stalled:`Implementazione bloccata`,cancelled:`Run annullato`,unknown:`Stato del run sconosciuto`},noDeliveryNote:`Nessuna fase PR — questo progetto non ha un repository git né commit, quindi il lavoro è stato applicato direttamente nella cartella del progetto.`,noDeliveryHint:`Esecuzione diretta nella cartella del progetto (nessun repository git né commit — non verrà proposta alcuna PR).`,failure:{title:`Perché si è fermato`,step:`passo {{step}}`,unit:`#{{ticket}} · {{code}}`},actions:{resume:`Riprendi`,approve:`Approva`,recover:`Recupera e riprova`,relaunch:`Rilancia`},relaunchSent:`Rail {{index}} rilanciato — una nuova scheda seguirà il run.`,relaunchFailed:`Impossibile rilanciare il rail`,relaunchBlockedActive:`Il rail ha ancora un run attivo`},le={marker:`Il Rail {{rail}} è fallito: {{code}}`,openCard:`Apri scheda`,briefing:{title:`Resoconto automatico dell’errore`}},ue={open:`Vista divisa`,menu:`Azioni della conversazione`,add:`Aggiungi conversazione in vista divisa`,close:`Chiudi vista divisa`,loadFailed:`Impossibile caricare questa conversazione.`,retry:`Riprova`},de={label:`Modello e impegno`,resetEffort:`Ripristina impegno`,back:`Indietro`},fe={0:`Qual è la missione?`,1:`Con quale missione iniziamo?`,2:`Qual è la nostra missione oggi?`,3:`Qual è la prossima missione?`,4:`Cosa vuoi ottenere con questa missione?`,5:`Quale missione avviamo?`,6:`Da dove iniziamo questa missione?`,7:`Qual è l’obiettivo di questa missione?`,8:`Cosa costruiamo in questa missione?`,9:`Cosa miglioriamo con questa missione?`,10:`Quale sfida affrontiamo in questa missione?`,11:`Qual è il primo passo della missione?`,12:`Raccontami la missione che hai in mente…`,13:`Descrivi la tua prossima missione…`,14:`Diamo forma alla tua prossima missione…`,15:`Cosa dovrebbe realizzare questa missione?`,16:`Quale missione vorresti completare?`,17:`Cosa risolviamo in questa missione?`,18:`Cosa renderebbe questa missione un successo?`,19:`Tutto pronto per una nuova missione. Iniziamo?`},pe={title:e,subtitle:t,trigger:n,composerPlaceholder:r,send:i,stop:a,copy:o,attachment:s,maximize:c,restore:l,minimize:u,close:d,newConversation:f,emptyTitle:p,emptyHint:m,thinking:h,connecting:g,consultingCode:_,size:v,model:y,history:b,queue:x,receipt:S,queueEdit:C,git:w,provider:T,tier:E,approval:D,project:O,palette:k,mission:A,noProvider:j,degraded:M,toolCard:N,error:P,chip:F,newAgent:I,switchToAgent:L,switchToKanban:R,search:z,home:B,favoriteMissions:V,untitled:H,workspace:U,attachFile:W,deleteConversation:G,confirmDeleteConversation:K,addFavoriteConversation:q,removeFavoriteConversation:J,confirmShort:Y,imagesUnsupported:X,effort:Z,prCard:Q,specDraft:$,problemFrame:ee,refs:te,header:ne,emptyTitleCodeRain:re,activity:ie,backgroundProcess:ae,window:oe,railCard:se,runCard:ce,runFailure:le,split:ue,runtimeSelector:de,missionPlaceholders:fe};export{ie as activity,q as addFavoriteConversation,D as approval,W as attachFile,s as attachment,ae as backgroundProcess,F as chip,d as close,r as composerPlaceholder,K as confirmDeleteConversation,Y as confirmShort,g as connecting,_ as consultingCode,o as copy,pe as default,M as degraded,G as deleteConversation,Z as effort,m as emptyHint,p as emptyTitle,re as emptyTitleCodeRain,P as error,V as favoriteMissions,w as git,ne as header,b as history,B as home,X as imagesUnsupported,c as maximize,u as minimize,A as mission,fe as missionPlaceholders,y as model,I as newAgent,f as newConversation,j as noProvider,k as palette,Q as prCard,ee as problemFrame,O as project,T as provider,x as queue,C as queueEdit,se as railCard,S as receipt,te as refs,J as removeFavoriteConversation,l as restore,ce as runCard,le as runFailure,de as runtimeSelector,z as search,i as send,v as size,$ as specDraft,ue as split,a as stop,t as subtitle,L as switchToAgent,R as switchToKanban,h as thinking,E as tier,e as title,N as toolCard,n as trigger,H as untitled,oe as window,U as workspace};