specrails-desktop 2.36.0 → 2.42.2
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.
- package/README.md +94 -247
- package/client/dist/assets/ActivityFeedPage-DoEMumQS.js +1 -0
- package/client/dist/assets/AgentBrowserCapture-DIh4K0gh.js +1 -0
- package/client/dist/assets/AgentModeAnalyticsPane-mbq4WEoO.js +2 -0
- package/client/dist/assets/AgentModeCodePane-CKh7zuA4.js +2 -0
- package/client/dist/assets/AgentModeJobsPane-BDokPiLJ.js +1 -0
- package/client/dist/assets/AgentsPage-BFVAZbBj.js +87 -0
- package/client/dist/assets/AnalyticsPage-3Y9LuWwz.js +1 -0
- package/client/dist/assets/CodePage-C9KyuV_C.js +3 -0
- package/client/dist/assets/DesktopAnalyticsPage-Bhi54bXQ.js +1 -0
- package/client/dist/assets/{DocsDialog-C76VdBJC.js → DocsDialog-Dj6mt4ga.js} +2 -2
- package/client/dist/assets/{DocsPage-ziMlj6B6.js → DocsPage-24yWglNI.js} +1 -1
- package/client/dist/assets/ExportDropdown-ophapHrT.js +1 -0
- package/client/dist/assets/InteractiveJobComposer-C1ucmxQh.js +19 -0
- package/client/dist/assets/JobDetailModal-DNWmgVHD.js +1 -0
- package/client/dist/assets/JobDetailPage-BcajZyuu.js +1 -0
- package/client/dist/assets/JobsPage-B9nTZw6e.js +1 -0
- package/client/dist/assets/LoopBuilderPage-Oc48iOFW.js +7 -0
- package/client/dist/assets/LoopPreviewModal-ae0Fr6SU.js +1 -0
- package/client/dist/assets/LoopsPage-CUEqzUBI.js +1 -0
- package/client/dist/assets/MinimizedChatsContext-Deg39peL.js +1 -0
- package/client/dist/assets/PluginsPage-C1xtARIx.js +2 -0
- package/client/dist/assets/ProjectSettingsDialog-JZzrXFBN.js +1 -0
- package/client/dist/assets/RepositoryDeliveries-CSDsiVUz.js +5 -0
- package/client/dist/assets/RepositoryScopeSelector-D-RCaknl.js +1 -0
- package/client/dist/assets/ReviewPacketPage-x5EfGTiL.js +1 -0
- package/client/dist/assets/TemplatePreviewModal-BSyuZxGq.js +1 -0
- package/client/dist/assets/TicketDetailModalContext-DqyF0so-.js +14 -0
- package/client/dist/assets/Trans-SnMX4MhW.js +1 -0
- package/client/dist/assets/agent-BdT0SB1D.js +1 -0
- package/client/dist/assets/agent-Bh9K7iEt.js +1 -0
- package/client/dist/assets/agent-C4ibdFk9.js +1 -0
- package/client/dist/assets/agent-CSFY22Zo.js +1 -0
- package/client/dist/assets/agent-DAnqxUn8.js +1 -0
- package/client/dist/assets/agent-DTQiu0Mi.js +1 -0
- package/client/dist/assets/agent-T54WuR_Y.js +1 -0
- package/client/dist/assets/agent-i75WDZOA.js +1 -0
- package/client/dist/assets/browser-05vRDg_y.js +1 -0
- package/client/dist/assets/browser-Bulb-cB1.js +1 -0
- package/client/dist/assets/browser-C7f-Jsg1.js +1 -0
- package/client/dist/assets/browser-CG0PE1j_.js +1 -0
- package/client/dist/assets/browser-CMzaqAjo.js +1 -0
- package/client/dist/assets/browser-DMajYdNX.js +1 -0
- package/client/dist/assets/browser-DxcOHrdP.js +1 -0
- package/client/dist/assets/browser-ObE7xVo3.js +1 -0
- package/client/dist/assets/builder-765NeYTp.js +1 -0
- package/client/dist/assets/builder-8MG3V6ea.js +1 -0
- package/client/dist/assets/builder-B-1UBs5K.js +1 -0
- package/client/dist/assets/builder-BTiGnPT0.js +1 -0
- package/client/dist/assets/builder-Cx9Rz-7u.js +1 -0
- package/client/dist/assets/builder-DKFMELBl.js +1 -0
- package/client/dist/assets/builder-OcmKrC0h.js +1 -0
- package/client/dist/assets/builder-P9qVBXFZ.js +1 -0
- package/client/dist/assets/{button-CJqFnUOL.js → button-DCBqEaZl.js} +1 -1
- package/client/dist/assets/{code-CkUuW4m9.js → code-B37GRg9C.js} +1 -1
- package/client/dist/assets/{code-B0O8-p8k.js → code-BBOEZbf9.js} +1 -1
- package/client/dist/assets/{code-B1VLZDhS.js → code-BRm-jcyx.js} +1 -1
- package/client/dist/assets/{code-Bpj4Ddml.js → code-CF7w62CR.js} +1 -1
- package/client/dist/assets/{code-BykBZ5-e.js → code-CLuvJt2r.js} +1 -1
- package/client/dist/assets/{code-B86IMAfz.js → code-D0RCm59f.js} +1 -1
- package/client/dist/assets/code-DaZ-ZwCT.js +1 -0
- package/client/dist/assets/{code-cAqaqMTx.js → code-iIHkGaCL.js} +1 -1
- package/client/dist/assets/commands-0XjAftla.js +1 -0
- package/client/dist/assets/commands-BAWSYHjQ.js +1 -0
- package/client/dist/assets/commands-BBwowgiE.js +1 -0
- package/client/dist/assets/commands-BacjIZLN.js +1 -0
- package/client/dist/assets/commands-Bs62IAZ3.js +1 -0
- package/client/dist/assets/commands-CLPdh-Hh.js +1 -0
- package/client/dist/assets/commands-DlbFzgrp.js +1 -0
- package/client/dist/assets/commands-LjPSsi5F.js +1 -0
- package/client/dist/assets/common-B5AZNYMH.js +1 -0
- package/client/dist/assets/common-BFZ0c_vN.js +1 -0
- package/client/dist/assets/common-BrlwEnL7.js +1 -0
- package/client/dist/assets/common-BttQx3z4.js +1 -0
- package/client/dist/assets/common-CM65k_-e.js +1 -0
- package/client/dist/assets/common-D4mvFFlu.js +1 -0
- package/client/dist/assets/common-TZ9Ny96S.js +1 -0
- package/client/dist/assets/common-nFpSF4GC.js +1 -0
- package/client/dist/assets/dashboard-B14uYXkG.js +1 -0
- package/client/dist/assets/dashboard-BK_mez-z.js +1 -0
- package/client/dist/assets/dashboard-BfBir_6o.js +1 -0
- package/client/dist/assets/dashboard-Bt0cCzeG.js +1 -0
- package/client/dist/assets/dashboard-BwkjxI6H.js +1 -0
- package/client/dist/assets/{dashboard-C8WOEiPu.js → dashboard-C3bDKf7s.js} +1 -1
- package/client/dist/assets/dashboard-CdvjGfog.js +1 -0
- package/client/dist/assets/dashboard-fRrP0Kv0.js +1 -0
- package/client/dist/assets/dialog-SRw01_QU.js +45 -0
- package/client/dist/assets/dist-js-CJ_2XX1Y.js +1 -0
- package/client/dist/assets/formatDistanceToNow-DSj5DprF.js +1 -0
- package/client/dist/assets/getTimezoneOffsetInMilliseconds-YhD8rIEs.js +1 -0
- package/client/dist/assets/index-DwAmL7m5.css +2 -0
- package/client/dist/assets/index-EzrkUb8B.js +76 -0
- package/client/dist/assets/{jira-api-B1-MUehg.js → jira-api-CSCqGr-Q.js} +1 -1
- package/client/dist/assets/{jobs-CN_zv4Gr.js → jobs-B8rrzfyZ.js} +1 -1
- package/client/dist/assets/{jobs-DUlWSYq2.js → jobs-BS6RTurf.js} +1 -1
- package/client/dist/assets/{jobs-Bpks6doU.js → jobs-BTT0Bsks.js} +1 -1
- package/client/dist/assets/{jobs-Bgq-PZkC.js → jobs-CezU69AE.js} +1 -1
- package/client/dist/assets/{jobs-SwYS2M-B.js → jobs-ClFJae0s.js} +1 -1
- package/client/dist/assets/{jobs-BAls3bWq.js → jobs-DJSFIFVy.js} +1 -1
- package/client/dist/assets/{jobs-DhxKgWFq.js → jobs-DhgGr8vm.js} +1 -1
- package/client/dist/assets/{jobs-B_TeSQxb.js → jobs-DzMjUcaN.js} +1 -1
- package/client/dist/assets/mcp-6rMoZfEO.js +1 -0
- package/client/dist/assets/mcp-BD8sL5mP.js +1 -0
- package/client/dist/assets/mcp-BkcA3I5s.js +1 -0
- package/client/dist/assets/mcp-CCpSelOh.js +1 -0
- package/client/dist/assets/mcp-CUAN6ORK.js +1 -0
- package/client/dist/assets/mcp-CqbRxRTE.js +1 -0
- package/client/dist/assets/mcp-DP2YfVhO.js +1 -0
- package/client/dist/assets/mcp-DUVQamDz.js +1 -0
- package/client/dist/assets/narration-B-ynWTpn.js +1 -0
- package/client/dist/assets/narration-Bj_laZwg.js +1 -0
- package/client/dist/assets/narration-BxHpmMv_.js +1 -0
- package/client/dist/assets/narration-C1Px0-0j.js +1 -0
- package/client/dist/assets/narration-CAXhGbzM.js +1 -0
- package/client/dist/assets/narration-DQ1l_Kq6.js +1 -0
- package/client/dist/assets/narration-XISXwqZd.js +1 -0
- package/client/dist/assets/narration-kwzfglQo.js +1 -0
- package/client/dist/assets/nav-1-Hh2kOz.js +1 -0
- package/client/dist/assets/nav-B34QkESm.js +1 -0
- package/client/dist/assets/nav-Bap_UXAq.js +1 -0
- package/client/dist/assets/{nav-pYuXq7sf.js → nav-BwxXIB24.js} +1 -1
- package/client/dist/assets/nav-Ch-zHBG5.js +1 -0
- package/client/dist/assets/nav-CygC_WN-.js +1 -0
- package/client/dist/assets/{nav-iwjCg5FR.js → nav-KnnLQtOQ.js} +1 -1
- package/client/dist/assets/nav-m00uxYUG.js +1 -0
- package/client/dist/assets/packet-BQ2tXfJI.js +1 -0
- package/client/dist/assets/packet-BdpOJ1Cy.js +1 -0
- package/client/dist/assets/packet-C3Ievb9R.js +1 -0
- package/client/dist/assets/packet-C4zJIG0Y.js +1 -0
- package/client/dist/assets/packet-Cx-zRuWn.js +1 -0
- package/client/dist/assets/packet-DUTGX52M.js +1 -0
- package/client/dist/assets/packet-DhsKtUPB.js +1 -0
- package/client/dist/assets/packet-z3LJ8Zyy.js +1 -0
- package/client/dist/assets/project-repositories-DYhTvwQ1.js +1 -0
- package/client/dist/assets/provider-capabilities-B-wOHfLP.js +1 -0
- package/client/dist/assets/settings-BBt2xtDQ.js +1 -0
- package/client/dist/assets/settings-BJB9RKJj.js +1 -0
- package/client/dist/assets/settings-CHwQR2rB.js +1 -0
- package/client/dist/assets/settings-CrMi3kSi.js +1 -0
- package/client/dist/assets/settings-DKyhDGD1.js +1 -0
- package/client/dist/assets/settings-Deupji9c.js +1 -0
- package/client/dist/assets/settings-DqRMmwAM.js +1 -0
- package/client/dist/assets/settings-J4rj6vo-.js +1 -0
- package/client/dist/assets/setup-2xGgu4Sk.js +1 -0
- package/client/dist/assets/setup-Ba11l2JA.js +1 -0
- package/client/dist/assets/setup-BzW4kMok.js +1 -0
- package/client/dist/assets/setup-COzwYhkJ.js +1 -0
- package/client/dist/assets/setup-CRVULhtF.js +1 -0
- package/client/dist/assets/setup-DgvlxwpE.js +1 -0
- package/client/dist/assets/setup-Dw_wYeEY.js +1 -0
- package/client/dist/assets/setup-ZPtEeJPW.js +1 -0
- package/client/dist/assets/spending-BqbdPm_4.js +1 -0
- package/client/dist/assets/square-Ci-PFcFe.js +1 -0
- package/client/dist/assets/{terminal-BFRZnMPP.js → terminal-BAzpHtpY.js} +1 -1
- package/client/dist/assets/{terminal-IahE4LW9.js → terminal-C7dHeR3x.js} +1 -1
- package/client/dist/assets/{terminal-tITa81iz.js → terminal-CMla5Qsz.js} +1 -1
- package/client/dist/assets/{terminal-BZiIu3rf.js → terminal-CdNXH-n9.js} +1 -1
- package/client/dist/assets/{terminal-ScjyXNxQ.js → terminal-Cw5bZsmV.js} +1 -1
- package/client/dist/assets/{terminal-C2NAd7BW.js → terminal-DFUP4eNv.js} +1 -1
- package/client/dist/assets/{terminal-d7GadXbN.js → terminal-DGqljeK_.js} +1 -1
- package/client/dist/assets/{terminal-QpXZU2Bn.js → terminal-cU70NodO.js} +1 -1
- package/client/dist/assets/useDesktop-RSMTyy7V.js +1 -0
- package/client/dist/assets/useSharedWebSocket-BOdS5_Iz.js +2 -0
- package/client/dist/index.html +34 -35
- package/docs/README.md +3 -0
- package/docs/agent-live-steering.md +57 -0
- package/docs/ci-cd.md +57 -0
- package/docs/code-explorer.md +48 -0
- package/docs/codex.md +12 -1
- package/docs/features/detachable-mission-windows.md +59 -0
- package/docs/guide/de/integrations/5-mcp-server.md +13 -9
- package/docs/guide/de/integrations/6-agent-chat.md +1 -0
- package/docs/guide/en/integrations/5-mcp-server.md +13 -9
- package/docs/guide/en/integrations/6-agent-chat.md +1 -0
- package/docs/guide/es/integrations/5-mcp-server.md +13 -9
- package/docs/guide/es/integrations/6-agent-chat.md +1 -0
- package/docs/guide/fr/integrations/5-mcp-server.md +13 -9
- package/docs/guide/fr/integrations/6-agent-chat.md +1 -0
- package/docs/guide/it/integrations/5-mcp-server.md +13 -9
- package/docs/guide/it/integrations/6-agent-chat.md +1 -0
- package/docs/guide/ja/integrations/5-mcp-server.md +13 -9
- package/docs/guide/ja/integrations/6-agent-chat.md +1 -0
- package/docs/guide/pt/integrations/5-mcp-server.md +13 -9
- package/docs/guide/pt/integrations/6-agent-chat.md +1 -0
- package/docs/guide/zh/integrations/5-mcp-server.md +13 -9
- package/docs/guide/zh/integrations/6-agent-chat.md +1 -0
- package/docs/internals/README.md +1 -0
- package/docs/internals/browser-capture-performance.md +55 -3
- package/docs/internals/browser-login-popups.md +45 -0
- package/docs/internals/browser-native-retina-audit.md +39 -0
- package/docs/internals/ci-cd-audit.md +39 -0
- package/docs/internals/core-runtime-updates.md +68 -0
- package/docs/internals/embedded-browser-native-webview-evaluation.md +2 -0
- package/docs/internals/implementation-reliability-audit.md +93 -0
- package/docs/internals/interactive-jobs.md +110 -6
- package/docs/internals/mcp-mission-audit.md +76 -0
- package/docs/internals/project-builder.md +404 -42
- package/docs/internals/safe-pr-review-flow.md +52 -10
- package/docs/internals/startup-recovery-audit.md +58 -0
- package/docs/mcp.md +74 -41
- package/docs/mission-processes.md +59 -0
- package/docs/multi-repo-projects.md +51 -0
- package/docs/platforms/windows-parity.md +70 -0
- package/docs/platforms/windows.md +13 -11
- package/docs/running-pipelines.md +14 -0
- package/mcp-bridge/dist/specrails-mcp.js +7186 -0
- package/package.json +9 -4
- package/server/dist/agent-chat-manager.js +537 -68
- package/server/dist/agent-chat-router.js +87 -6
- package/server/dist/agent-context-resolver.js +129 -25
- package/server/dist/agent-defaults.js +19 -11
- package/server/dist/agent-input-store.js +206 -0
- package/server/dist/agent-mcp-config.js +54 -15
- package/server/dist/agent-operator-prompt.js +255 -65
- package/server/dist/agent-spec-framing.js +202 -0
- package/server/dist/agent-steering.js +218 -0
- package/server/dist/agent-store.js +153 -0
- package/server/dist/api-not-found.js +8 -0
- package/server/dist/background-process-control.js +164 -0
- package/server/dist/background-process-service.js +61 -0
- package/server/dist/background-process-store.js +242 -0
- package/server/dist/background-windows-bootstrap.js +238 -0
- package/server/dist/blueprint-chat-manager.js +476 -62
- package/server/dist/blueprint-commit.js +21 -1
- package/server/dist/blueprint-draft-parser.js +122 -17
- package/server/dist/blueprint-generation.js +238 -0
- package/server/dist/blueprint-operator-prompt.js +91 -63
- package/server/dist/blueprint-router.js +55 -3
- package/server/dist/blueprint-spec-fixtures.js +85 -0
- package/server/dist/blueprint-spec-quality.js +57 -16
- package/server/dist/blueprint-store.js +92 -1
- package/server/dist/browser-capture-manager.js +86 -30
- package/server/dist/browser-playwright.js +168 -45
- package/server/dist/browser-viewport.js +26 -0
- package/server/dist/chat-manager.js +23 -15
- package/server/dist/chromium-archive.cjs +83 -0
- package/server/dist/chromium-resolver.js +72 -64
- package/server/dist/code-activity.js +145 -0
- package/server/dist/code-explorer-router.js +714 -114
- package/server/dist/core-compat.js +28 -1
- package/server/dist/core-execution.js +111 -0
- package/server/dist/core-package.js +4 -16
- package/server/dist/core-runtime.js +202 -0
- package/server/dist/core-update-manager.js +161 -60
- package/server/dist/core-update-state.js +29 -0
- package/server/dist/db.js +66 -35
- package/server/dist/delivery-evidence.js +142 -39
- package/server/dist/desktop-db.js +239 -43
- package/server/dist/desktop-router.js +109 -9
- package/server/dist/dev-ports.js +8 -3
- package/server/dist/file-provenance.js +34 -22
- package/server/dist/file-story-manager.js +62 -64
- package/server/dist/file-story.js +118 -35
- package/server/dist/file-summary-generator.js +46 -5
- package/server/dist/file-summary-manager.js +355 -106
- package/server/dist/framework-manager.js +98 -110
- package/server/dist/framework-reseed.js +76 -10
- package/server/dist/git-diagnostics.js +2 -2
- package/server/dist/headroom-manager.js +38 -3
- package/server/dist/host-control.js +52 -0
- package/server/dist/index.js +43 -2
- package/server/dist/interactive-job-session.js +149 -16
- package/server/dist/internal-api.js +48 -0
- package/server/dist/jira/jira-materializer.js +1 -0
- package/server/dist/json-tolerant.js +174 -0
- package/server/dist/legacy-migration.js +4 -2
- package/server/dist/loop-command-catalog.js +83 -21
- package/server/dist/loop-constants.js +6 -1
- package/server/dist/loop-decider.js +11 -1
- package/server/dist/loop-executors.js +194 -45
- package/server/dist/loop-factory.js +11 -4
- package/server/dist/loop-graph.js +90 -4
- package/server/dist/loop-run-manager.js +301 -69
- package/server/dist/loop-shell-invocation.js +21 -0
- package/server/dist/loop-step-idle.js +55 -0
- package/server/dist/loop-templates.js +31 -7
- package/server/dist/mcp/agent-capability.js +37 -4
- package/server/dist/mcp/guide.js +149 -36
- package/server/dist/mcp/mcp-admin-router.js +20 -4
- package/server/dist/mcp/mcp-server.js +89 -43
- package/server/dist/mcp/mcp-tiers.js +6 -5
- package/server/dist/mcp/mcp-token.js +3 -1
- package/server/dist/mcp/resources.js +5 -4
- package/server/dist/mcp/tools/catalog.js +4 -0
- package/server/dist/mcp/tools/code.js +125 -14
- package/server/dist/mcp/tools/context.js +153 -0
- package/server/dist/mcp/tools/git.js +15 -5
- package/server/dist/mcp/tools/jobs.js +84 -71
- package/server/dist/mcp/tools/loops.js +17 -6
- package/server/dist/mcp/tools/meta.js +74 -27
- package/server/dist/mcp/tools/mission.js +29 -0
- package/server/dist/mcp/tools/projects.js +22 -6
- package/server/dist/mcp/tools/rails.js +48 -11
- package/server/dist/mcp/tools/specs.js +86 -14
- package/server/dist/mcp/tools/support.js +1 -1
- package/server/dist/mcp/tools/types.js +117 -43
- package/server/dist/mcp/tools/watch.js +144 -51
- package/server/dist/milestone-chain-store.js +164 -0
- package/server/dist/milestone-chain.js +487 -0
- package/server/dist/milestone-progress.js +348 -0
- package/server/dist/mobile/mobile-devices.js +10 -7
- package/server/dist/mobile/mobile-gateway.js +2 -0
- package/server/dist/mobile/mobile-missions.js +214 -0
- package/server/dist/mobile/mobile-redact.js +17 -3
- package/server/dist/mobile/mobile-router.js +46 -4
- package/server/dist/mobile/mobile-ws.js +49 -4
- package/server/dist/multi-repo-bases.js +56 -0
- package/server/dist/multi-repo-checkout.js +101 -0
- package/server/dist/multi-repo-delivery.js +100 -0
- package/server/dist/multi-repo-execution-store.js +65 -0
- package/server/dist/multi-repo-execution.js +453 -0
- package/server/dist/offline-assemble.js +10 -8
- package/server/dist/openspec-runtime-plugin-commands.json +18 -0
- package/server/dist/openspec-runtime-plugin.js +120 -0
- package/server/dist/plugins/codex-spawn.js +49 -0
- package/server/dist/plugins/serena/manifest.js +2 -2
- package/server/dist/plugins/serena/templates/instructions.md +16 -0
- package/server/dist/pr-publisher.js +1 -1
- package/server/dist/profiles-router.js +3 -18
- package/server/dist/project-code-discovery.js +142 -0
- package/server/dist/project-git.js +19 -21
- package/server/dist/project-registry.js +272 -20
- package/server/dist/project-repositories.js +157 -0
- package/server/dist/project-repository-provenance.js +31 -0
- package/server/dist/project-router-background-processes.js +105 -0
- package/server/dist/project-router-git.js +75 -16
- package/server/dist/project-router-jobs.js +2 -126
- package/server/dist/project-router-loop-runs.js +72 -2
- package/server/dist/project-router-tickets.js +53 -8
- package/server/dist/project-router.js +239 -38
- package/server/dist/provider-detection.js +18 -6
- package/server/dist/provider-limit.js +64 -0
- package/server/dist/providers/claude-adapter.js +26 -1
- package/server/dist/providers/claude-background-tasks.js +18 -0
- package/server/dist/providers/claude-live-session.js +383 -0
- package/server/dist/providers/codex-adapter.js +19 -0
- package/server/dist/providers/codex-live-session.js +545 -0
- package/server/dist/providers/gemini-adapter.js +1 -0
- package/server/dist/providers/live-session-types.js +12 -0
- package/server/dist/providers/live-session.js +13 -0
- package/server/dist/providers/terminal-result.js +24 -0
- package/server/dist/queue-manager.js +2 -0
- package/server/dist/rail-isolated-launch.js +141 -16
- package/server/dist/rail-pr-decision.js +364 -99
- package/server/dist/rail-pr-store.js +24 -10
- package/server/dist/rail-worktree-release.js +34 -2
- package/server/dist/rail-worktrees-store.js +4 -4
- package/server/dist/rails-router.js +249 -55
- package/server/dist/repo-lock.js +92 -17
- package/server/dist/review-packet.js +23 -13
- package/server/dist/schemas/file-summary.v1.json +59 -59
- package/server/dist/schemas/profile.v1.json +137 -137
- package/server/dist/setup-manager.js +52 -8
- package/server/dist/shell-integration/bash-shim.bash +45 -0
- package/server/dist/shell-integration/fish-shim.fish +36 -0
- package/server/dist/shell-integration/powershell-shim.ps1 +48 -0
- package/server/dist/shell-integration/zsh-shim.zsh +47 -0
- package/server/dist/smash-runner.js +1 -0
- package/server/dist/spawn-lifecycle.js +44 -27
- package/server/dist/spec-contract-prompt.js +143 -0
- package/server/dist/spec-draft-parser.js +6 -1
- package/server/dist/spec-models.js +1 -0
- package/server/dist/stuck-run-detector.js +1 -0
- package/server/dist/terminal-manager.js +21 -1
- package/server/dist/terminal-shell-integration.js +4 -1
- package/server/dist/transient-children.js +619 -230
- package/server/dist/util/cli-prompt.js +78 -5
- package/server/dist/util/sqlite-migrations.js +20 -0
- package/server/dist/util/win-spawn.js +18 -3
- package/server/dist/util/windows-provider-shell.js +29 -0
- package/server/dist/verification-sentinel.js +14 -0
- package/server/dist/vitest-setup.js +2 -0
- package/server/dist/windows-job-supervisor.js +133 -0
- package/server/dist/workspace-manager.js +9 -30
- package/server/dist/worktree-manager.js +17 -2
- package/server/dist/worktree-overlay.js +3 -1
- package/client/dist/assets/ActivityFeedPage-tAQcWs1R.js +0 -1
- package/client/dist/assets/AgentBrowserCapture-BX8BNae5.js +0 -1
- package/client/dist/assets/AgentModeAnalyticsPane-BVAqCL0K.js +0 -2
- package/client/dist/assets/AgentModeCodePane-9XfqQc9c.js +0 -2
- package/client/dist/assets/AgentModeJobsPane-BCjLsPhc.js +0 -1
- package/client/dist/assets/AgentsPage-C8J_42sm.js +0 -87
- package/client/dist/assets/AnalyticsPage-BtQuyfJm.js +0 -1
- package/client/dist/assets/CodePage-BZ2MwdCu.js +0 -2
- package/client/dist/assets/DesktopAnalyticsPage-Bh_29V4g.js +0 -1
- package/client/dist/assets/ExportDropdown-BrtfWzEG.js +0 -1
- package/client/dist/assets/InteractiveJobComposer-BCZiSfzc.js +0 -19
- package/client/dist/assets/JobDetailModal-NAJmuYIT.js +0 -1
- package/client/dist/assets/JobDetailPage-fE0ZycUX.js +0 -1
- package/client/dist/assets/JobsPage-z5M_HVJG.js +0 -1
- package/client/dist/assets/LoopBuilderPage-j1FQS47c.js +0 -7
- package/client/dist/assets/LoopPreviewModal-DhDJjdCe.js +0 -1
- package/client/dist/assets/LoopsPage-Ll7zORZb.js +0 -1
- package/client/dist/assets/MinimizedChatsContext-Bd3OqR_S.js +0 -1
- package/client/dist/assets/PluginsPage-DN4kGvJt.js +0 -2
- package/client/dist/assets/ProjectSettingsDialog-OgsgxjzF.js +0 -1
- package/client/dist/assets/ReviewPacketPage-DFog4sXn.js +0 -1
- package/client/dist/assets/TemplatePreviewModal-L2XxqiOD.js +0 -1
- package/client/dist/assets/TicketDetailModal-CsF-AWZX.js +0 -14
- package/client/dist/assets/Trans-Bsz9_gyq.js +0 -1
- package/client/dist/assets/agent-BQgKv_2F.js +0 -1
- package/client/dist/assets/agent-C1NRDJqL.js +0 -1
- package/client/dist/assets/agent-CLNleiy6.js +0 -1
- package/client/dist/assets/agent-CmceArkQ.js +0 -1
- package/client/dist/assets/agent-D3UxQ3SR.js +0 -1
- package/client/dist/assets/agent-DB1JeE64.js +0 -1
- package/client/dist/assets/agent-DXkHcQ-D.js +0 -1
- package/client/dist/assets/agent-DjJJJ2M8.js +0 -1
- package/client/dist/assets/auth-D_5bQv5W.js +0 -1
- package/client/dist/assets/ban-E4EaZe3a.js +0 -1
- package/client/dist/assets/bot-DzuuuC5R.js +0 -1
- package/client/dist/assets/browser-BgqHDMXP.js +0 -1
- package/client/dist/assets/browser-CsKJtrpv.js +0 -1
- package/client/dist/assets/browser-Cu58EpZU.js +0 -1
- package/client/dist/assets/browser-CvXOJm-j.js +0 -1
- package/client/dist/assets/browser-DOrFh1c7.js +0 -1
- package/client/dist/assets/browser-DQv_Jo7x.js +0 -1
- package/client/dist/assets/browser-LPgxvJu2.js +0 -1
- package/client/dist/assets/browser-eL-3MIEI.js +0 -1
- package/client/dist/assets/builder-0IWtosUm.js +0 -1
- package/client/dist/assets/builder-Bf2N6XWn.js +0 -1
- package/client/dist/assets/builder-BnqaaBkT.js +0 -1
- package/client/dist/assets/builder-BxxfGgAO.js +0 -1
- package/client/dist/assets/builder-C5IIgWsq.js +0 -1
- package/client/dist/assets/builder-CHuahItu.js +0 -1
- package/client/dist/assets/builder-CjWosXL_.js +0 -1
- package/client/dist/assets/builder-CpCIOoKj.js +0 -1
- package/client/dist/assets/code-CHPkOkDS.js +0 -1
- package/client/dist/assets/commands-6tYQih5m.js +0 -1
- package/client/dist/assets/commands-BK2QinXN.js +0 -1
- package/client/dist/assets/commands-C2Nca76h.js +0 -1
- package/client/dist/assets/commands-CKdLihNX.js +0 -1
- package/client/dist/assets/commands-CYIBTAlc.js +0 -1
- package/client/dist/assets/commands-CjUtYJIM.js +0 -1
- package/client/dist/assets/commands-Cq_u_8y9.js +0 -1
- package/client/dist/assets/commands-D_ZHYQug.js +0 -1
- package/client/dist/assets/common-6MLbD-jM.js +0 -1
- package/client/dist/assets/common-BKGEu4rm.js +0 -1
- package/client/dist/assets/common-BNbnv8cE.js +0 -1
- package/client/dist/assets/common-BqGWtDbt.js +0 -1
- package/client/dist/assets/common-DBtTzeYm.js +0 -1
- package/client/dist/assets/common-DEW3Nr8n.js +0 -1
- package/client/dist/assets/common-DHsv9N5d.js +0 -1
- package/client/dist/assets/common-mkrEcW-Y.js +0 -1
- package/client/dist/assets/dashboard-B9GhC5ku.js +0 -1
- package/client/dist/assets/dashboard-CBnv6zOI.js +0 -1
- package/client/dist/assets/dashboard-CaP0fU87.js +0 -1
- package/client/dist/assets/dashboard-D4ZZ4x84.js +0 -1
- package/client/dist/assets/dashboard-DmuTQBX8.js +0 -1
- package/client/dist/assets/dashboard-DynLYj3d.js +0 -1
- package/client/dist/assets/dashboard-zj4gGFJ1.js +0 -1
- package/client/dist/assets/dialog-CdWCb02j.js +0 -45
- package/client/dist/assets/dist-bVqfYmby.js +0 -1
- package/client/dist/assets/dist-js-CWeUdf5Z.js +0 -1
- package/client/dist/assets/formatDistanceToNow-DQCvMgUc.js +0 -1
- package/client/dist/assets/getTimezoneOffsetInMilliseconds-C16cxSe1.js +0 -1
- package/client/dist/assets/git-refresh-wTW0rO0Z.js +0 -1
- package/client/dist/assets/i18n-hnX2DPmo.js +0 -2
- package/client/dist/assets/index-DIhMEAVw.js +0 -66
- package/client/dist/assets/index-DwygcU7s.css +0 -2
- package/client/dist/assets/mcp-B8X8wBLu.js +0 -1
- package/client/dist/assets/mcp-C2AojZZN.js +0 -1
- package/client/dist/assets/mcp-D8BT78_L.js +0 -1
- package/client/dist/assets/mcp-Df5RWBNk.js +0 -1
- package/client/dist/assets/mcp-Dj7BgMQW.js +0 -1
- package/client/dist/assets/mcp-Q7iT7rcz.js +0 -1
- package/client/dist/assets/mcp-YlvNvJbW.js +0 -1
- package/client/dist/assets/mcp-mKFpTSRb.js +0 -1
- package/client/dist/assets/narration-4Z2VUhZw.js +0 -1
- package/client/dist/assets/narration-BGuiEDj3.js +0 -1
- package/client/dist/assets/narration-BuSoqRmv.js +0 -1
- package/client/dist/assets/narration-CB9t29fy.js +0 -1
- package/client/dist/assets/narration-CU3x8FHD.js +0 -1
- package/client/dist/assets/narration-CWeXhfP5.js +0 -1
- package/client/dist/assets/narration-DRaDnhT5.js +0 -1
- package/client/dist/assets/narration-DtEbQgCw.js +0 -1
- package/client/dist/assets/nav-ApJVg3xu.js +0 -1
- package/client/dist/assets/nav-BKNky1Bg.js +0 -1
- package/client/dist/assets/nav-C6vWWKYx.js +0 -1
- package/client/dist/assets/nav-CXJ6Aw89.js +0 -1
- package/client/dist/assets/nav-CsmFBIDf.js +0 -1
- package/client/dist/assets/nav-DjkmQJjd.js +0 -1
- package/client/dist/assets/packet-B1IxaL5f.js +0 -1
- package/client/dist/assets/packet-Bh5kkbiB.js +0 -1
- package/client/dist/assets/packet-By8fqYxW.js +0 -1
- package/client/dist/assets/packet-CZdvA44E.js +0 -1
- package/client/dist/assets/packet-CrjHRQCP.js +0 -1
- package/client/dist/assets/packet-Dwi2pTtx.js +0 -1
- package/client/dist/assets/packet-_-ZIa0IR.js +0 -1
- package/client/dist/assets/packet-n0W6E1Hn.js +0 -1
- package/client/dist/assets/play-DNlrawbS.js +0 -1
- package/client/dist/assets/provider-capabilities-Doej9lfa.js +0 -1
- package/client/dist/assets/settings-Bd0x4TBa.js +0 -1
- package/client/dist/assets/settings-C1-7cXzC.js +0 -1
- package/client/dist/assets/settings-CAFaT38b.js +0 -1
- package/client/dist/assets/settings-Ct3v1nW2.js +0 -1
- package/client/dist/assets/settings-DHh7_IF5.js +0 -1
- package/client/dist/assets/settings-DQXAmdcv.js +0 -1
- package/client/dist/assets/settings-guzlhpup.js +0 -1
- package/client/dist/assets/settings-sZfTPMEH.js +0 -1
- package/client/dist/assets/setup-3jWaoVUO.js +0 -1
- package/client/dist/assets/setup-BjgRneb2.js +0 -1
- package/client/dist/assets/setup-BzFIjv-f.js +0 -1
- package/client/dist/assets/setup-C4VfQsxE.js +0 -1
- package/client/dist/assets/setup-DfUkpDbN.js +0 -1
- package/client/dist/assets/setup-ECe90Pmu.js +0 -1
- package/client/dist/assets/setup-dlqC4Jmm.js +0 -1
- package/client/dist/assets/setup-jwfLMiM2.js +0 -1
- package/client/dist/assets/spending-EC9xqio-.js +0 -1
- package/client/dist/assets/useDesktop-BQVt8lFd.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-zu2_FqZY.js";import{w as r}from"./i18n-hnX2DPmo.js";import{n as i,t as a}from"./createLucideIcon-Bjbbp_KS.js";import{n as o}from"./dist-bVqfYmby.js";import{t as s}from"./download-CFHyyHcw.js";import{t as c}from"./loader-circle-DcygOQpC.js";import{t as l}from"./search-Cq_gE3Ik.js";import{t as u}from"./trash-2-BOU3WdZZ.js";import{t as d}from"./triangle-alert-H9T4jAmh.js";import{n as f,t as p}from"./jira-api-B1-MUehg.js";import{a as m}from"./auth-D_5bQv5W.js";import{n as h,r as g}from"./useDesktop-BQVt8lFd.js";import{a as _,n as v,o as y,r as b,t as x}from"./dialog-CdWCb02j.js";import{t as S}from"./button-CJqFnUOL.js";import{t as C}from"./utils-BC4DHlz2.js";import{r as w}from"./provider-capabilities-Doej9lfa.js";import{At as T,Ot as E,_ as D,lt as O,nt as k,rt as A,tt as j}from"./index-DIhMEAVw.js";var M=a(`earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),ee=a(`folder-kanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),N=a(`plug-zap`,[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]]),P=a(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),F=a(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),I=e(t(),1),L=n(),te=[`todo`,`in_progress`,`on_review`,`done`,`cancelled`],R={todo:`todo`,in_progress:`inProgress`,on_review:`onReview`,done:`done`,cancelled:`cancelled`};function z({onConnected:e,onSkip:t,apiBase:n}){let{t:r}=i(`jira`),[a,s]=(0,I.useState)(1),[c,l]=(0,I.useState)(``),[u,d]=(0,I.useState)(``),[f,m]=(0,I.useState)(``),[h,g]=(0,I.useState)(`idle`),[_,v]=(0,I.useState)(null),[y,b]=(0,I.useState)(`cloud`),[x,C]=(0,I.useState)([]),[w,T]=(0,I.useState)(``),[E,O]=(0,I.useState)(``),[k,A]=(0,I.useState)(``),[j,M]=(0,I.useState)(!1),[ee,N]=(0,I.useState)([]),[P,F]=(0,I.useState)({}),[z,ne]=(0,I.useState)(``),[U,W]=(0,I.useState)(!1),G=()=>({baseUrl:c.trim(),accountEmail:u.trim()||null,token:f});async function K(){g(`testing`);try{let e=await p.test(G(),n);g(`ok`),v(e.displayName),b(e.deployment)}catch(e){g(`error`),o.error(H(e,r))}}async function q(){s(2),M(!0);try{let{projects:e}=await p.discoverProjects({...G(),query:w.trim()||void 0},n);C(e)}catch(e){o.error(H(e,r))}finally{M(!1)}}async function J(){if(s(3),E)try{let{statuses:e}=await p.discoverStatuses({...G(),projectKey:E},n);N(e)}catch{N([])}}async function Y(){W(!0);try{let t=Object.fromEntries(Object.entries(P).filter(([,e])=>e));await p.connect({...G(),jiraProjectKey:E.trim(),statusMap:Object.keys(t).length?t:null,discardStatus:z.trim()||null},n),o.success(r(`status.connected`,{key:E.trim()})),e()}catch(e){o.error(H(e,r))}finally{W(!1)}}return(0,L.jsxs)(`div`,{className:`space-y-4`,"data-testid":`jira-wizard`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`wizard.step`,{current:a,total:4})}),t&&(0,L.jsx)(`button`,{type:`button`,onClick:t,className:`text-xs text-muted-foreground hover:text-foreground hover:underline`,"data-testid":`jira-later`,children:r(`wizard.later`)})]}),a===1&&(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-semibold`,children:r(`wizard.step1Title`)}),(0,L.jsx)(B,{label:r(`creds.baseUrlLabel`),help:r(`creds.baseUrlHelp`),children:(0,L.jsx)(D,{value:c,onChange:e=>{l(e.target.value),g(`idle`)},placeholder:r(`creds.baseUrlPlaceholder`)})}),(0,L.jsx)(B,{label:r(`creds.emailLabel`),help:r(`creds.emailHelp`),children:(0,L.jsx)(D,{value:u,onChange:e=>{d(e.target.value),g(`idle`)},placeholder:r(`creds.emailPlaceholder`)})}),(0,L.jsx)(B,{label:r(`creds.tokenLabel`),help:r(`creds.tokenHelp`),children:(0,L.jsx)(D,{type:`password`,value:f,onChange:e=>{m(e.target.value),g(`idle`)}})}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(S,{size:`sm`,variant:`outline`,onClick:K,disabled:!c.trim()||!f.trim()||h===`testing`,children:r(h===`testing`?`creds.testing`:h===`ok`?`creds.retest`:`creds.test`)}),h===`ok`&&(0,L.jsxs)(`span`,{className:`text-xs text-accent-success`,"data-testid":`jira-test-ok`,children:[`✓ `,r(`creds.testOk`,{name:_??``}),` · `,r(y===`cloud`?`review.cloud`:`review.dc`)]})]}),(0,L.jsx)(`div`,{className:`flex justify-end`,children:(0,L.jsx)(S,{size:`sm`,onClick:q,disabled:h!==`ok`,children:r(`wizard.next`)})})]}),a===2&&(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-semibold`,children:r(`wizard.step2Title`)}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(D,{value:w,onChange:e=>T(e.target.value),placeholder:r(`project.searchPlaceholder`)}),(0,L.jsx)(S,{size:`sm`,variant:`outline`,onClick:q,children:r(`project.searchPlaceholder`)})]}),j?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`project.loading`)}):x.length===0?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`project.none`)}):(0,L.jsx)(`div`,{className:`max-h-48 space-y-1 overflow-y-auto`,"data-testid":`jira-project-list`,children:x.map(e=>(0,L.jsxs)(`button`,{type:`button`,onClick:()=>{O(e.key),A(e.name)},className:`flex w-full items-center justify-between rounded px-2 py-1.5 text-left text-sm hover:bg-muted ${E===e.key?`bg-muted`:``}`,children:[(0,L.jsx)(`span`,{className:`font-medium`,children:e.key}),(0,L.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.name})]},e.id))}),(0,L.jsx)(B,{label:r(`project.manualLabel`),children:(0,L.jsx)(D,{value:E,onChange:e=>{O(e.target.value.toUpperCase()),A(``)},placeholder:r(`project.manualPlaceholder`)})}),(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(S,{size:`sm`,variant:`ghost`,onClick:()=>s(1),children:r(`wizard.back`)}),(0,L.jsx)(S,{size:`sm`,onClick:J,disabled:!E.trim(),children:r(`wizard.next`)})]})]}),a===3&&(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-semibold`,children:r(`wizard.step3Title`)}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`mapping.intro`)}),te.map(e=>(0,L.jsx)(B,{label:r(`mapping.${R[e]}`),children:(0,L.jsxs)(`select`,{value:P[e]??``,onChange:t=>F(n=>({...n,[e]:t.target.value||void 0})),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm`,children:[(0,L.jsx)(`option`,{value:``,children:r(`mapping.auto`)}),ee.map(e=>(0,L.jsx)(`option`,{value:e.name,children:e.name},e.id))]})},e)),(0,L.jsx)(B,{label:r(`discard.configLabel`),help:r(`discard.configHelp`),children:(0,L.jsxs)(`select`,{value:z,onChange:e=>ne(e.target.value),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-discard-status-select`,children:[(0,L.jsx)(`option`,{value:``,children:r(`discard.configNone`)}),ee.map(e=>(0,L.jsx)(`option`,{value:e.name,children:e.name},e.id))]})}),(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(S,{size:`sm`,variant:`ghost`,onClick:()=>s(2),children:r(`wizard.back`)}),(0,L.jsx)(S,{size:`sm`,onClick:()=>s(4),children:r(`wizard.next`)})]})]}),a===4&&(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-semibold`,children:r(`wizard.step4Title`)}),(0,L.jsxs)(`dl`,{className:`space-y-1 text-sm`,children:[(0,L.jsx)(V,{label:r(`review.site`),value:c}),(0,L.jsx)(V,{label:r(`review.project`),value:k?`${E} — ${k}`:E}),(0,L.jsx)(V,{label:r(`review.account`),value:_??u}),(0,L.jsx)(V,{label:r(`review.type`),value:r(y===`cloud`?`review.cloud`:`review.dc`)}),(0,L.jsx)(V,{label:r(`discard.reviewLabel`),value:z||r(`discard.configNone`)})]}),(0,L.jsxs)(`div`,{className:`flex justify-between`,children:[(0,L.jsx)(S,{size:`sm`,variant:`ghost`,onClick:()=>s(3),children:r(`wizard.back`)}),(0,L.jsx)(S,{size:`sm`,onClick:Y,disabled:U,children:r(U?`wizard.connecting`:`wizard.connect`)})]})]})]})}function B({label:e,help:t,children:n}){return(0,L.jsxs)(`label`,{className:`block space-y-1`,children:[(0,L.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:e}),n,t&&(0,L.jsx)(`span`,{className:`block text-[11px] text-muted-foreground`,children:t})]})}function V({label:e,value:t}){return(0,L.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,L.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,L.jsx)(`dd`,{className:`truncate text-right font-medium`,children:t})]})}function H(e,t){return e instanceof Error?e.message:t(`errors.generic`)}var ne=[`todo`,`in_progress`,`on_review`,`done`,`cancelled`],U={todo:`todo`,in_progress:`inProgress`,on_review:`onReview`,done:`done`,cancelled:`cancelled`};function W({state:e,onChanged:t,apiBase:n}){let{t:r}=i(`jira`),a=e.connection,[s,c]=(0,I.useState)(a.enabled),[l,u]=(0,I.useState)(!1),[d,f]=(0,I.useState)(!1),[m,h]=(0,I.useState)([]),[g,_]=(0,I.useState)([]),[v,y]=(0,I.useState)(a.discardStatus??``),[b,x]=(0,I.useState)(a.statusMap??{}),C=e.outbox??{pending:0,inflight:0,done:0,dead:0},w=(0,I.useCallback)(async()=>{try{let{ops:e}=n?await p.listOutbox(`dead`,n):await p.listOutbox(`dead`);h(e)}catch{h([])}},[n]);(0,I.useEffect)(()=>{w()},[w]),(0,I.useEffect)(()=>{let e=!1;return p.listStatuses(n).then(({statuses:t})=>{e||_(t)}).catch(()=>{e||_([])}),()=>{e=!0}},[n]);async function T(e){let i=v;y(e);try{n?await p.patchConnection({discardStatus:e||null},n):await p.patchConnection({discardStatus:e||null}),t()}catch(e){y(i),o.error(K(e,r))}}async function E(e,i){let a=b,s={...b,[e]:i||void 0};x(s);let c=Object.fromEntries(Object.entries(s).filter(([,e])=>e));try{n?await p.patchConnection({statusMap:Object.keys(c).length?c:null},n):await p.patchConnection({statusMap:Object.keys(c).length?c:null}),t()}catch(e){x(a),o.error(K(e,r))}}async function D(){let e=!s;c(e),f(!0);try{n?await p.setEnabled(e,n):await p.setEnabled(e)}catch(t){c(!e),o.error(K(t,r))}finally{f(!1)}}async function O(){u(!0);try{let e=n?await p.syncNow(n):await p.syncNow();o.success(r(`status.syncedToast`,{count:e.upserted}))}catch(e){o.error(K(e,r))}finally{u(!1)}}async function k(){if(window.confirm(r(`status.disconnectConfirm`))){f(!0);try{n?await p.disconnect(n):await p.disconnect(),o.success(r(`status.disconnectedToast`)),t()}catch(e){o.error(K(e,r))}finally{f(!1)}}}async function A(e){try{n?await p.retryOutbox(e,n):await p.retryOutbox(e),await w()}catch(e){o.error(K(e,r))}}let j=C.pending+C.inflight;return(0,L.jsxs)(`div`,{className:`space-y-4`,"data-testid":`jira-connected`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:r(`status.connected`,{key:a.jiraProjectKey})}),(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[a.baseUrl,` · `,a.deployment===`cloud`?r(`review.cloud`):r(`review.dc`)]})]}),(0,L.jsx)(`a`,{href:`${a.baseUrl}/browse/${a.jiraProjectKey}`,target:`_blank`,rel:`noreferrer`,className:`text-xs text-accent-primary hover:underline`,children:r(`badge.openInJira`)})]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-border p-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-sm font-medium`,children:r(`status.enabledLabel`)}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(s?`status.enabledHelp`:`status.pausedHelp`)})]}),(0,L.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":s,"aria-label":r(`status.enabledLabel`),disabled:d,onClick:D,className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${s?`bg-accent-success`:`bg-input`}`,children:(0,L.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-background shadow-sm transition-transform ${s?`translate-x-4`:`translate-x-0.5`}`})})]}),(0,L.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-status-map`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium`,children:r(`wizard.step3Title`)}),(0,L.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:r(`mapping.intro`)}),(0,L.jsx)(`div`,{className:`space-y-2`,children:ne.map(e=>(0,L.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r(`mapping.${U[e]}`)}),(0,L.jsxs)(`select`,{value:b[e]??``,onChange:t=>void E(e,t.target.value),className:`w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-statusmap-${e}`,children:[(0,L.jsx)(`option`,{value:``,children:r(`mapping.auto`)}),g.map(e=>(0,L.jsx)(`option`,{value:e.name,children:e.name},e.id)),b[e]&&!g.some(t=>t.name===b[e])&&(0,L.jsx)(`option`,{value:b[e],children:b[e]})]})]},e))})]}),(0,L.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium`,children:r(`discard.configLabel`)}),(0,L.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:r(`discard.configHelp`)}),(0,L.jsxs)(`select`,{value:v,onChange:e=>void T(e.target.value),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-discard-status-select`,children:[(0,L.jsx)(`option`,{value:``,children:r(`discard.configNone`)}),g.map(e=>(0,L.jsx)(`option`,{value:e.name,children:e.name},e.id)),v&&!g.some(e=>e.name===v)&&(0,L.jsx)(`option`,{value:v,children:v})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(S,{variant:`outline`,size:`sm`,onClick:O,disabled:l,children:r(l?`status.syncing`:`status.syncNow`)}),(0,L.jsx)(S,{variant:`ghost`,size:`sm`,onClick:k,disabled:d,className:`text-destructive`,children:r(`status.disconnect`)})]}),(0,L.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-outbox`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium`,children:r(`outbox.title`)}),C.dead>0?(0,L.jsx)(`p`,{className:`mt-1 text-xs text-accent-warning`,children:r(`outbox.dead`,{count:C.dead})}):j>0?(0,L.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:r(`outbox.pending`,{count:j})}):(0,L.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:r(`outbox.allSynced`)}),m.length>0&&(0,L.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`outbox.deadHelp`)}),m.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded border border-border/60 px-2 py-1`,children:[(0,L.jsxs)(`span`,{className:`truncate text-xs`,children:[G(e,r),` · `,e.deadReason??e.lastError??``]}),(0,L.jsx)(S,{variant:`outline`,size:`sm`,onClick:()=>A(e.id),children:r(`outbox.retry`)})]},e.id))]})]})]})}function G(e,t){return e.opType===`transition`?t(`outbox.opTransition`):e.opType===`comment`?t(`outbox.opComment`):t(`outbox.opCreate`)}function K(e,t){return e instanceof Error?e.message:t(`errors.generic`)}var q=new Set([`claude`,`codex`,`kimi`]);function J(e){return{provider:e,label:e===`codex`?`Codex`:`Claude`,active:!1,available:!1,detectedRoute:!1,requests:0,inputTokens:0,inputTokensSaved:0,outputTokens:0,outputTokensSaved:0,outputSavingsPercent:0,outputSavingsMethod:`none`,outputSavingsAllocated:!1}}function Y(){return{updatedAt:null,proxyStatsAvailable:!1,durableSavingsAvailable:!1,outputSavingsAvailable:!1,outputSavingsMethod:null,outputConfidence:null,providers:{codex:J(`codex`),claude:J(`claude`)},lastIssue:null}}var X={installed:!1,installSource:null,version:null,executablePath:null,uvPath:null,port:8787,phase:`idle`,activeProviders:{codex:!1,claude:!1},availableProviders:{codex:!1,claude:!1},detectedRoutes:{codex:!1,claude:!1},proxyRunning:!1,proxyPid:null,learning:{enabled:!1,baselineReady:!1,baselineSamples:0,updatedAt:null,lastIssue:null},metrics:Y(),lastIssue:null,updatedAt:null};function re(e){let t=e?.metrics??Y();return{...X,...e,activeProviders:{...X.activeProviders,...e?.activeProviders},availableProviders:{...X.availableProviders,...e?.availableProviders},detectedRoutes:{...X.detectedRoutes,...e?.detectedRoutes},learning:{...X.learning,...e?.learning},metrics:{...Y(),...t,providers:{codex:{...J(`codex`),...t.providers?.codex},claude:{...J(`claude`),...t.providers?.claude}}}}}async function Z(e){let t=await e.text(),n=t?JSON.parse(t):{};if(!e.ok){let t=n.issue;throw Object.assign(Error(t?.title??n.error??`HTTP ${e.status}`),{payload:n})}return n}function Q(e){return`${m}/api/projects/${e}`}function ie(e,t=`en`){if(!Number.isFinite(e))return`0`;try{return Intl.NumberFormat(t,{notation:`compact`,maximumFractionDigits:1}).format(Math.max(0,e))}catch{return Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}).format(Math.max(0,e))}}function $(e,t,n){return`${ie(e,t)} ${n}`}function ae(){let{t:e}=i(`integrations`),{projects:t}=g(),{registerHandler:n,unregisterHandler:a}=r(),[o,s]=(0,I.useState)(``),[c,u]=(0,I.useState)(`all`),[d,f]=(0,I.useState)(X),[p,h]=(0,I.useState)(!0),[S,w]=(0,I.useState)(null),[T,E]=(0,I.useState)([]),[D,M]=(0,I.useState)(!1),[P,F]=(0,I.useState)(!1),[te,R]=(0,I.useState)(null),[z,B]=(0,I.useState)({jira:0,serena:0,projects:0}),V=(0,I.useCallback)(async()=>{try{let e=await fetch(`${m}/api/global-plugins/headroom`).then(e=>Z(e));f(re(e.state))}finally{h(!1)}},[]);(0,I.useEffect)(()=>{V()},[V]),(0,I.useEffect)(()=>(n(`plugins-page`,e=>{let t=e;t.type===`plugin.headroom_progress`&&(t.line&&E(e=>[...e.slice(-80),t.line]),V())}),()=>a(`plugins-page`)),[n,a,V]),(0,I.useEffect)(()=>{let e=!1;async function n(){let n=await Promise.all(t.map(async e=>{let[t,n]=await Promise.all([fetch(`${Q(e.id)}/jira/connection`).then(e=>Z(e)).catch(()=>({connected:!1})),fetch(`${Q(e.id)}/plugins`).then(e=>Z(e)).catch(()=>({plugins:[]}))]),r=n.plugins.find(e=>e.name===`serena`);return{jira:+!!t.connected,serena:r&&r.status!==`not-installed`&&r.status!==`orphan`?1:0}}));e||B({jira:n.reduce((e,t)=>e+t.jira,0),serena:n.reduce((e,t)=>e+t.serena,0),projects:t.length})}return n(),()=>{e=!0}},[t]);async function H(e,t){w(e),E([]);try{let e=(await t()).state;e&&f(re(e))}catch(e){let t=e.payload;t?.state&&f(re(t.state))}finally{w(null),V()}}let ne=(0,I.useMemo)(()=>[{id:`headroom-ai`,title:`Headroom AI`,scope:`global`,icon:N,description:e(`plugins.catalog.headroom.description`),installed:d.installed,status:d.lastIssue?`attention`:d.installed?d.activeProviders.codex||d.activeProviders.claude?d.installSource===`system`?`external-active`:`active`:d.installSource===`system`?`external`:`installed`:`available`,statusLabel:d.lastIssue?e(`plugins.status.attention`):d.installed?d.activeProviders.codex||d.activeProviders.claude?d.installSource===`system`?e(`plugins.status.externalActive`):e(`plugins.status.active`):d.installSource===`system`?e(`plugins.status.external`):e(`plugins.status.installed`):e(`plugins.status.available`),actionKind:d.lastIssue?`review`:d.installed?`manage`:`install`,actionLabel:d.lastIssue?e(`plugins.actions.review`):d.installed?e(`plugins.actions.manage`):e(`plugins.actions.install`),busy:S===`install`,action:()=>{if(d.lastIssue||d.installed){M(!0);return}H(`install`,()=>fetch(`${m}/api/global-plugins/headroom/install`,{method:`POST`}).then(e=>Z(e)))}}],[d,S,e]),U=(0,I.useMemo)(()=>[{id:`jira`,title:`Jira`,scope:`project`,icon:ee,description:e(`plugins.catalog.jira.description`),installed:z.jira>0,status:z.jira>0?`configured`:`available`,statusLabel:z.jira>0?e(`plugins.status.configuredCount`,{count:z.jira}):e(`plugins.status.available`),actionKind:z.jira>0?`manage`:`install`,actionLabel:z.jira>0?e(`plugins.actions.manage`):e(`plugins.actions.install`),action:()=>R(`jira`)},{id:`serena`,title:`Serena`,scope:`project`,icon:j,description:e(`plugins.catalog.serena.description`),installed:z.serena>0,status:z.serena>0?`installed`:`available`,statusLabel:z.serena>0?e(`plugins.status.installedCount`,{count:z.serena}):e(`plugins.status.available`),actionKind:z.serena>0?`manage`:`install`,actionLabel:z.serena>0?e(`plugins.actions.manage`):e(`plugins.actions.install`),action:()=>R(`serena`)}],[z,e]),W=o.trim().toLowerCase(),G=t=>`${t.title} ${t.description} ${t.statusLabel} ${e(`plugins.scope.${t.scope}`)}`.toLowerCase().includes(W),K=[...ne,...U].filter(e=>c!==`all`&&e.scope!==c?!1:G(e)),q=K.filter(e=>e.scope===`global`&&e.installed),J=K.filter(e=>e.scope===`project`&&e.installed),Y=K.filter(e=>e.scope===`global`&&!e.installed),ie=K.filter(e=>e.scope===`project`&&!e.installed),$=q.length>0||J.length>0,ae=Y.length>0||ie.length>0,ce=[d.installed,z.jira>0,z.serena>0].filter(Boolean).length;return(0,L.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[(0,L.jsxs)(`div`,{className:`border-b border-border px-6 py-4`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,L.jsx)(`div`,{className:`grid h-9 w-9 place-items-center rounded-lg border border-accent-primary/25 bg-accent-primary/10 text-accent-primary`,children:(0,L.jsx)(O,{className:`h-4 w-4`})}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`h1`,{className:`text-lg font-semibold tracking-normal`,children:e(`plugins.page.title`)}),(0,L.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:e(`plugins.page.subtitle`)})]}),(0,L.jsxs)(`div`,{className:`mr-12 flex items-center gap-2 rounded-lg border border-border bg-card/60 px-3 py-2 text-xs`,children:[(0,L.jsx)(A,{className:`h-3.5 w-3.5 text-accent-success`}),(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:e(`plugins.page.readyCount`,{count:ce})})]})]}),(0,L.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3 md:flex-row md:items-center`,children:[(0,L.jsxs)(`label`,{className:`relative flex-1`,children:[(0,L.jsx)(l,{className:`pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,L.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:e(`plugins.search.placeholder`),className:`h-9 w-full rounded-lg border border-border bg-background pl-9 pr-3 text-sm outline-none transition-colors focus:border-accent-primary/60`})]}),(0,L.jsx)(`div`,{className:`inline-flex h-9 rounded-lg border border-border bg-card p-1`,children:[`all`,`global`,`project`].map(t=>(0,L.jsx)(`button`,{type:`button`,onClick:()=>u(t),className:C(`rounded-md px-3 text-xs capitalize transition-colors`,c===t?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:e(`plugins.filters.${t}`)},t))})]})]}),(0,L.jsxs)(`div`,{className:`flex-1 overflow-auto px-6 py-5`,children:[(0,L.jsxs)(`section`,{className:`mb-6`,children:[(0,L.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,L.jsx)(k,{className:`h-3.5 w-3.5`}),e(`plugins.sections.installed`)]}),$?(0,L.jsx)(oe,{globalPlugins:q,projectPlugins:J}):(0,L.jsx)(se,{text:e(W?`plugins.empty.installedSearch`:`plugins.empty.installed`)})]}),(0,L.jsxs)(`section`,{children:[(0,L.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,L.jsx)(O,{className:`h-3.5 w-3.5`}),e(`plugins.sections.available`)]}),ae?(0,L.jsx)(oe,{globalPlugins:Y,projectPlugins:ie}):(0,L.jsx)(se,{text:e(W?`plugins.empty.availableSearch`:`plugins.empty.allInstalled`)})]})]}),(0,L.jsx)(x,{open:D,onOpenChange:M,children:(0,L.jsxs)(v,{className:`w-[calc(100vw-2rem)] max-w-xl overflow-x-hidden p-4 sm:p-6`,children:[(0,L.jsxs)(_,{children:[(0,L.jsx)(y,{children:e(`plugins.headroom.title`)}),(0,L.jsx)(b,{children:e(`plugins.headroom.dialogDescription`)})]}),(0,L.jsx)(de,{state:d,loading:p,busy:S,logs:T,onInstall:()=>H(`install`,()=>fetch(`${m}/api/global-plugins/headroom/install`,{method:`POST`}).then(e=>Z(e))),onToggleProvider:(e,t)=>H(`${t?`deactivate`:`activate`}-${e}`,()=>fetch(`${m}/api/global-plugins/headroom/${t?`deactivate`:`activate`}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:e})}).then(e=>Z(e))),onDeactivateAll:()=>H(`deactivate-all`,async()=>{let e={state:d};for(let t of[`codex`,`claude`])d.activeProviders[t]&&(e=await fetch(`${m}/api/global-plugins/headroom/deactivate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:t})}).then(e=>Z(e)));return e}),onUninstall:()=>H(`uninstall`,()=>fetch(`${m}/api/global-plugins/headroom/uninstall`,{method:`POST`}).then(e=>Z(e))),onSetPort:e=>H(`port`,()=>fetch(`${m}/api/global-plugins/headroom/port`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({port:e})}).then(e=>Z(e))),onOpenDiagnostics:()=>F(!0)})]})}),(0,L.jsx)(ve,{plugin:te,projects:t,onClose:()=>R(null)}),(0,L.jsx)(xe,{open:P,onClose:()=>F(!1)})]})}function oe({globalPlugins:e,projectPlugins:t}){let{t:n}=i(`integrations`);return(0,L.jsxs)(`div`,{className:C(`grid grid-cols-1 gap-4`,e.length>0&&t.length>0&&`xl:grid-cols-2`),children:[e.length>0&&(0,L.jsxs)(`section`,{children:[(0,L.jsx)(le,{title:n(`plugins.groups.global.title`),detail:n(`plugins.groups.global.detail`),scope:`global`}),(0,L.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(260px,320px))] justify-start gap-3`,children:e.map(e=>(0,L.jsx)(ue,{plugin:e},e.id))})]}),t.length>0&&(0,L.jsxs)(`section`,{children:[(0,L.jsx)(le,{title:n(`plugins.groups.project.title`),detail:n(`plugins.groups.project.detail`),scope:`project`}),(0,L.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(260px,320px))] justify-start gap-3`,children:t.map(e=>(0,L.jsx)(ue,{plugin:e},e.id))})]})]})}function se({text:e}){return(0,L.jsx)(`div`,{className:`flex h-[74px] max-w-[320px] items-center rounded-lg border border-dashed border-border bg-card/35 px-3 text-xs text-muted-foreground`,children:e})}function ce({scope:e}){let{t}=i(`integrations`);return(0,L.jsx)(`span`,{className:C(`rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wide`,e===`global`?`bg-accent-primary/10 text-accent-primary`:`bg-accent-info/10 text-accent-info`),children:t(`plugins.scope.${e}`)})}function le({title:e,detail:t,scope:n}){return(0,L.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,L.jsx)(`div`,{className:C(`h-px flex-1`,n===`global`?`bg-accent-primary/30`:`bg-accent-info/30`)}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border bg-card/70 px-2 py-1`,children:[(0,L.jsx)(ce,{scope:n}),(0,L.jsx)(`span`,{className:`text-xs font-medium`,children:e}),(0,L.jsx)(`span`,{className:`hidden text-[11px] text-muted-foreground sm:inline`,children:t})]}),(0,L.jsx)(`div`,{className:C(`h-px flex-1`,n===`global`?`bg-accent-primary/30`:`bg-accent-info/30`)})]})}function ue({plugin:e}){let{t}=i(`integrations`),n=e.icon,r=e.scope===`global`,a=e.status===`attention`,o=e.busy?c:e.actionKind===`install`?s:e.actionKind===`review`?d:F,l=C(`shrink-0 rounded border px-1.5 py-0.5 text-[10px] leading-none`,a?`border-accent-warning/30 bg-accent-warning/10 text-accent-warning`:e.installed?`border-accent-success/25 bg-accent-success/10 text-accent-success`:`border-border bg-muted text-muted-foreground`);return(0,L.jsxs)(`article`,{className:`grid h-[88px] w-full grid-cols-[38px_minmax(0,1fr)_auto] items-center gap-3 rounded-lg border border-border bg-card/70 px-3 transition-colors hover:border-accent-primary/35 hover:bg-card`,children:[(0,L.jsx)(`div`,{className:C(`grid h-[38px] w-[38px] shrink-0 place-items-center rounded-lg border`,r?`border-accent-primary/25 bg-accent-primary/10 text-accent-primary`:`border-accent-info/25 bg-accent-info/10 text-accent-info`),children:(0,L.jsx)(n,{className:`h-4 w-4`})}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`h2`,{className:`truncate text-sm font-semibold leading-5`,children:e.title}),(0,L.jsx)(`p`,{className:`mt-1 truncate text-[11px] leading-4 text-muted-foreground`,children:e.description}),(0,L.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,L.jsx)(ce,{scope:e.scope}),(0,L.jsx)(`span`,{className:l,children:e.statusLabel})]})]}),(0,L.jsxs)(`button`,{type:`button`,disabled:e.busy,onClick:e.action,className:`flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-border bg-background px-2.5 text-xs font-medium transition-colors hover:bg-muted disabled:opacity-50`,children:[(0,L.jsx)(o,{className:C(`h-3.5 w-3.5`,e.busy&&`animate-spin`)}),e.busy?t(`plugins.actions.installing`):e.actionLabel]})]})}function de({state:e,loading:t,busy:n,logs:r,onInstall:a,onToggleProvider:o,onDeactivateAll:l,onUninstall:d,onSetPort:p,onOpenDiagnostics:m}){let{t:h}=i(`integrations`),[g,_]=(0,I.useState)(String(e.port)),[v,y]=(0,I.useState)(!1);(0,I.useEffect)(()=>_(String(e.port)),[e.port]),(0,I.useEffect)(()=>{e.installed||y(!1)},[e.installed]);let b=e.activeProviders.codex||e.activeProviders.claude,x=e.installSource===`system`;return(0,L.jsxs)(`aside`,{className:`w-full min-w-0 overflow-hidden rounded-lg border border-border bg-card/80 p-4`,children:[(0,L.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,L.jsx)(`div`,{className:`grid h-10 w-10 place-items-center rounded-lg border border-accent-primary/25 bg-accent-primary/10 text-accent-primary`,children:(0,L.jsx)(N,{className:`h-4 w-4`})}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`h2`,{className:`text-sm font-semibold`,children:h(`plugins.headroom.title`)}),(0,L.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:h(`plugins.headroom.panelDescription`)})]})]}),(0,L.jsxs)(`div`,{className:`mb-4 grid grid-cols-3 gap-2 text-xs`,children:[(0,L.jsx)(fe,{label:h(`plugins.headroom.metrics.install`),value:t?h(`plugins.headroom.metrics.checking`):e.installed?h(`plugins.headroom.metrics.ready`):h(`plugins.headroom.metrics.missing`),good:e.installed}),(0,L.jsx)(fe,{label:h(`plugins.headroom.metrics.source`),value:e.installSource===`system`?h(`plugins.headroom.metrics.system`):e.installSource===`managed`?h(`plugins.headroom.metrics.specrails`):h(`plugins.headroom.metrics.none`),good:e.installed}),(0,L.jsx)(fe,{label:h(`plugins.headroom.metrics.proxy`),value:e.proxyRunning?`:${e.port}`:h(b?`plugins.headroom.metrics.starting`:`plugins.headroom.metrics.off`),good:e.proxyRunning||!b})]}),e.lastIssue&&(0,L.jsx)(pe,{issue:e.lastIssue}),e.installed?(0,L.jsxs)(`div`,{className:`mb-4 space-y-2`,children:[(0,L.jsx)(_e,{provider:`codex`,active:e.activeProviders.codex,available:e.availableProviders.codex,detectedRoute:e.detectedRoutes.codex,busy:n===`activate-codex`||n===`deactivate-codex`,onClick:()=>o(`codex`,e.activeProviders.codex)}),(0,L.jsx)(_e,{provider:`claude`,active:e.activeProviders.claude,available:e.availableProviders.claude,detectedRoute:e.detectedRoutes.claude,busy:n===`activate-claude`||n===`deactivate-claude`,onClick:()=>o(`claude`,e.activeProviders.claude)}),b&&(0,L.jsxs)(`button`,{type:`button`,disabled:!!n,onClick:l,className:`flex h-8 w-full items-center justify-center gap-2 rounded-lg border border-border bg-background/45 text-xs hover:bg-muted/50 disabled:opacity-50`,children:[n===`deactivate-all`?(0,L.jsx)(c,{className:`h-3.5 w-3.5 animate-spin`}):(0,L.jsx)(P,{className:`h-3.5 w-3.5`}),h(`plugins.headroom.actions.disableAllRoutes`)]})]}):(0,L.jsxs)(`button`,{type:`button`,disabled:!!n,onClick:a,className:`mb-3 flex h-9 w-full items-center justify-center gap-2 rounded-lg bg-accent-primary px-3 text-xs font-medium text-white disabled:opacity-50`,children:[n===`install`?(0,L.jsx)(c,{className:`h-3.5 w-3.5 animate-spin`}):(0,L.jsx)(s,{className:`h-3.5 w-3.5`}),h(`plugins.headroom.actions.installWithUv`)]}),e.installed&&(0,L.jsx)(me,{state:e}),(0,L.jsxs)(`div`,{className:`mb-4 rounded-lg border border-border bg-background/45 p-3`,children:[(0,L.jsx)(`label`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:h(`plugins.headroom.port.label`)}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(`input`,{value:g,onChange:e=>_(e.target.value),className:`h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-sm`}),(0,L.jsx)(`button`,{type:`button`,disabled:!!n||Number(g)===e.port,onClick:()=>p(Number(g)),className:`rounded-md border border-border px-2 text-xs hover:bg-muted disabled:opacity-50`,children:h(`plugins.headroom.port.apply`)})]})]}),r.length>0&&(0,L.jsx)(`pre`,{className:`mb-3 max-h-32 overflow-y-auto overflow-x-hidden whitespace-pre-wrap break-words rounded-lg border border-border bg-background/60 p-2 text-[10px] text-muted-foreground`,children:r.join(`
|
|
2
|
-
`)}),(0,L.jsxs)(`button`,{type:`button`,onClick:m,className:`mb-2 flex h-8 w-full items-center justify-center gap-2 rounded-lg border border-border text-xs hover:bg-muted/50`,children:[(0,L.jsx)(f,{className:`h-3.5 w-3.5`}),h(`plugins.headroom.actions.viewDiagnostics`)]}),e.installed&&(0,L.jsx)(`div`,{className:`rounded-lg border border-destructive/25 bg-destructive/5 p-3`,children:v?(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:h(x?`plugins.headroom.confirmDetach`:`plugins.headroom.confirmUninstall`)}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,L.jsx)(`button`,{type:`button`,disabled:!!n,onClick:()=>y(!1),className:`h-8 rounded-md border border-border text-xs hover:bg-muted/50 disabled:opacity-50`,children:h(`plugins.actions.cancel`)}),(0,L.jsxs)(`button`,{type:`button`,disabled:!!n,onClick:d,className:`flex h-8 items-center justify-center gap-2 rounded-md bg-destructive px-2 text-xs font-medium text-destructive-foreground disabled:opacity-50`,children:[n===`uninstall`?(0,L.jsx)(c,{className:`h-3.5 w-3.5 animate-spin`}):(0,L.jsx)(u,{className:`h-3.5 w-3.5`}),h(x?`plugins.headroom.actions.detach`:`plugins.headroom.actions.uninstall`)]})]})]}):(0,L.jsxs)(`button`,{type:`button`,disabled:!!n,onClick:()=>y(!0),className:`flex h-8 w-full items-center justify-center gap-2 rounded-md text-xs font-medium text-destructive hover:bg-destructive/10 disabled:opacity-50`,children:[(0,L.jsx)(u,{className:`h-3.5 w-3.5`}),h(x?`plugins.headroom.actions.detachHeadroom`:`plugins.headroom.actions.uninstallHeadroom`)]})})]})}function fe({label:e,value:t,good:n}){return(0,L.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/45 p-2`,children:[(0,L.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:e}),(0,L.jsx)(`div`,{className:C(`mt-0.5 font-medium`,n?`text-foreground`:`text-accent-warning`),children:t})]})}function pe({issue:e}){let{t}=i(`integrations`),n=`plugins.headroom.issues.${e.code}`,r=t(`${n}.title`,{defaultValue:e.title}),a=t(`${n}.guidance`,{defaultValue:e.guidance});return(0,L.jsx)(`div`,{className:`mb-3 rounded-lg border border-accent-warning/35 bg-accent-warning/10 p-3`,children:(0,L.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,L.jsx)(d,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-accent-warning`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`text-xs font-medium`,children:r}),(0,L.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-muted-foreground`,children:a}),(0,L.jsx)(`div`,{className:`mt-1 text-[10px] text-muted-foreground`,children:t(`plugins.headroom.issueCode`,{code:e.code})})]})]})})}function me({state:e}){let{t,i18n:n}=i(`integrations`),r=e.metrics,a=r.outputSavingsAvailable,o=[`codex`,`claude`].map(e=>({provider:e,metric:r.providers[e]})),s=t(`plugins.headroom.savings.tokens`),c=o.reduce((e,{metric:t})=>({inputTokens:e.inputTokens+t.inputTokens,inputTokensSaved:e.inputTokensSaved+t.inputTokensSaved,outputTokens:e.outputTokens+t.outputTokens,outputTokensSaved:e.outputTokensSaved+t.outputTokensSaved}),{inputTokens:0,inputTokensSaved:0,outputTokens:0,outputTokensSaved:0}),l=o.some(({metric:e})=>e.inputTokensSaved>0),u=o.some(({metric:e})=>e.active),d=t(a?`plugins.headroom.savings.statusInputOutput`:l?`plugins.headroom.savings.statusInputOnly`:u?`plugins.headroom.savings.statusRouting`:`plugins.headroom.savings.statusInactive`),f=a||l;return(0,L.jsxs)(`div`,{className:`mb-4 rounded-lg border border-border bg-background/45 p-3`,children:[(0,L.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,L.jsx)(T,{className:`h-3.5 w-3.5 text-accent-primary`}),(0,L.jsx)(`div`,{className:`truncate text-xs font-medium`,children:t(`plugins.headroom.savings.title`)})]}),(0,L.jsx)(`span`,{className:C(`shrink-0 rounded border px-1.5 py-0.5 text-[10px]`,f?`border-accent-success/25 bg-accent-success/10 text-accent-success`:u?`border-accent-primary/25 bg-accent-primary/10 text-accent-primary`:`border-border bg-muted text-muted-foreground`),children:d})]}),(0,L.jsxs)(`div`,{className:`mb-2 rounded-md bg-muted/35 px-2.5 py-2`,children:[(0,L.jsx)(`div`,{className:`mb-1.5 text-[10px] font-medium uppercase text-muted-foreground`,children:t(`plugins.headroom.savings.totals`)}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,L.jsx)(he,{label:t(`plugins.headroom.savings.input`),processed:c.inputTokens>0?$(c.inputTokens,n.language,s):t(`plugins.headroom.savings.noData`),saved:$(c.inputTokensSaved,n.language,s)}),(0,L.jsx)(he,{align:`right`,label:t(`plugins.headroom.savings.output`),processed:c.outputTokens>0?$(c.outputTokens,n.language,s):t(`plugins.headroom.savings.noData`),saved:a?$(c.outputTokensSaved,n.language,s):t(`plugins.headroom.savings.noData`)})]})]}),(0,L.jsx)(`div`,{className:`grid gap-2`,children:o.map(({provider:e,metric:t})=>(0,L.jsx)(ge,{metric:t,outputAvailable:r.outputSavingsAvailable},e))}),(0,L.jsx)(`div`,{className:`mt-2 flex items-center justify-end gap-2 text-[10px] text-muted-foreground`,children:r.updatedAt?t(`plugins.headroom.savings.updatedLive`):t(`plugins.headroom.savings.baselineSamples`,{count:e.learning.baselineSamples})})]})}function he({label:e,processed:t,saved:n,detail:r,align:a=`left`}){let{t:o}=i(`integrations`);return(0,L.jsxs)(`div`,{className:C(`min-w-0`,a===`right`&&`text-right`),children:[(0,L.jsx)(`div`,{className:`text-[10px] font-medium uppercase text-muted-foreground`,children:e}),(0,L.jsxs)(`div`,{className:`mt-1 space-y-0.5 text-[11px]`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-baseline justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:o(`plugins.headroom.savings.processed`)}),(0,L.jsx)(`span`,{className:`truncate font-semibold tabular-nums text-foreground`,children:t})]}),(0,L.jsxs)(`div`,{className:`flex min-w-0 items-baseline justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:o(`plugins.headroom.savings.saved`)}),(0,L.jsx)(`span`,{className:`truncate font-semibold tabular-nums text-foreground`,children:n})]})]}),r&&(0,L.jsx)(`div`,{className:`mt-1 truncate text-[10px] text-muted-foreground`,children:r})]})}function ge({metric:e,outputAvailable:t}){let{t:n,i18n:r}=i(`integrations`),a=!e.available,o=a||!e.active,s=n(`plugins.headroom.savings.tokens`),c=e.inputTokens>0?$(e.inputTokens,r.language,s):n(`plugins.headroom.savings.noData`),l=$(e.inputTokensSaved,r.language,s),u=e.outputTokens>0?$(e.outputTokens,r.language,s):n(`plugins.headroom.savings.noData`),d=t?$(e.outputTokensSaved,r.language,s):e.active?n(`plugins.headroom.savings.noData`):n(`plugins.headroom.savings.off`),f=e.requests>0?n(`plugins.headroom.savings.requestCount`,{count:ie(e.requests,r.language)}):a?n(`plugins.headroom.provider.noProjectUsesProvider`):e.active?n(`plugins.headroom.savings.inputSavingsActive`):n(`plugins.headroom.savings.routeDisabled`);return(0,L.jsxs)(`div`,{className:C(`rounded-md border border-border bg-card/45 px-2.5 py-2`,o&&`opacity-70`),children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,L.jsx)(`span`,{className:`text-xs font-medium`,children:e.label}),e.detectedRoute&&(0,L.jsx)(`span`,{className:`rounded bg-accent-primary/10 px-1.5 py-0.5 text-[9px] uppercase text-accent-primary`,children:n(`plugins.headroom.savings.detected`)})]}),(0,L.jsx)(`div`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground`,children:f}),(0,L.jsxs)(`div`,{className:`mt-2 grid grid-cols-2 gap-3`,children:[(0,L.jsx)(he,{label:n(`plugins.headroom.savings.input`),processed:c,saved:l}),(0,L.jsx)(he,{align:`right`,label:n(`plugins.headroom.savings.output`),processed:u,saved:d})]})]})}function _e({provider:e,active:t,available:n,detectedRoute:r,busy:a,onClick:o}){let{t:s}=i(`integrations`),l=s(n?t?`plugins.headroom.provider.routedThroughHeadroom`:r?`plugins.headroom.provider.detectedExternalRoute`:`plugins.headroom.provider.notRouted`:`plugins.headroom.provider.noProjectUsesProvider`);return(0,L.jsxs)(`button`,{type:`button`,onClick:o,disabled:a||!n,className:`flex w-full items-center gap-3 rounded-lg border border-border bg-background/45 p-3 text-left hover:bg-muted/35 disabled:opacity-50`,children:[(0,L.jsx)(`div`,{className:C(`grid h-8 w-8 place-items-center rounded-md`,t?`bg-accent-success/15 text-accent-success`:`bg-muted text-muted-foreground`),children:a?(0,L.jsx)(c,{className:`h-3.5 w-3.5 animate-spin`}):(0,L.jsx)(M,{className:`h-3.5 w-3.5`})}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`text-xs font-medium capitalize`,children:e}),(0,L.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:l})]}),(0,L.jsx)(`span`,{className:C(`h-5 w-9 rounded-full p-0.5 transition-colors`,t?`bg-accent-success`:`bg-muted`),children:(0,L.jsx)(`span`,{className:C(`block h-4 w-4 rounded-full bg-white shadow transition-transform`,t&&`translate-x-4`)})})]})}function ve({plugin:e,projects:t,onClose:n}){let{t:r}=i(`integrations`),[a,o]=(0,I.useState)(``);(0,I.useEffect)(()=>o(``),[e]);let s=t.find(e=>e.id===a)??null;return(0,L.jsx)(x,{open:!!e,onOpenChange:e=>{e||n()},children:(0,L.jsxs)(v,{className:`w-[calc(100vw-2rem)] max-w-3xl overflow-x-hidden p-4 sm:p-6`,children:[(0,L.jsxs)(_,{children:[(0,L.jsx)(y,{children:r(e===`jira`?`plugins.projectWizard.configureJira`:`plugins.projectWizard.installSerena`)}),(0,L.jsx)(b,{children:r(`plugins.projectWizard.description`)})]}),(0,L.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-[260px_minmax(0,1fr)]`,children:[(0,L.jsxs)(`div`,{className:`rounded-lg border border-border bg-card/70 p-3`,children:[(0,L.jsx)(`div`,{className:`mb-2 text-xs font-medium text-muted-foreground`,children:r(`plugins.projectWizard.chooseProject`)}),(0,L.jsx)(`div`,{className:`max-h-[52vh] space-y-1 overflow-auto`,children:t.map(t=>{let n=e===`serena`&&!h(t).some(e=>q.has(e));return(0,L.jsxs)(`button`,{type:`button`,disabled:n,onClick:()=>o(t.id),className:C(`w-full rounded-md px-2 py-2 text-left transition-colors`,t.id===a?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/45 hover:text-foreground`,n&&`cursor-not-allowed opacity-45`),children:[(0,L.jsx)(`div`,{className:`truncate text-xs font-medium`,children:t.name}),(0,L.jsx)(`div`,{className:`truncate text-[10px]`,children:n?r(`plugins.projectWizard.requiresSupportedProvider`,{defaultValue:`Requires Claude, Codex, or Kimi`}):t.path})]},t.id)})})]}),(0,L.jsx)(`div`,{className:`min-h-[360px] rounded-lg border border-border bg-card/70 p-4`,children:s?e===`jira`?(0,L.jsx)(ye,{project:s,onDone:n}):(0,L.jsx)(be,{project:s,onDone:n}):(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:r(`plugins.projectWizard.selectProjectToContinue`)})})]})]})})}function ye({project:e,onDone:t}){let{t:n}=i(`integrations`),r=Q(e.id),[a,o]=(0,I.useState)(null),[s,l]=(0,I.useState)(!0),[u,d]=(0,I.useState)(null),f=(0,I.useCallback)(async()=>{l(!0),d(null);try{let e=await fetch(`${r}/jira/connection`).then(e=>Z(e));o(e)}catch(e){o({connected:!1}),d(e.message)}finally{l(!1)}},[r]);return(0,I.useEffect)(()=>{f()},[f]),s?(0,L.jsxs)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:[(0,L.jsx)(c,{className:`mr-2 h-4 w-4 animate-spin`}),n(`plugins.jira.loading`,{defaultValue:`Loading Jira...`})]}):a?.connected&&a.connection?(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h3`,{className:`text-sm font-semibold`,children:n(`plugins.jira.titleForProject`,{name:e.name,defaultValue:`Jira for ${e.name}`})}),(0,L.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:n(`plugins.jira.configuredDescription`,{defaultValue:`Manage the Jira project, status mapping, discard status, sync, and connection state.`})})]}),(0,L.jsx)(W,{state:a,apiBase:r,onChanged:()=>{f()}})]}):(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h3`,{className:`text-sm font-semibold`,children:n(`plugins.jira.titleForProject`,{name:e.name,defaultValue:`Jira for ${e.name}`})}),(0,L.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:u?n(`plugins.jira.loadFailed`,{message:u,defaultValue:`Could not load the current Jira configuration: ${u}`}):n(`plugins.jira.notConfiguredDescription`,{defaultValue:`Connect this project to Jira.`})})]}),(0,L.jsx)(z,{apiBase:r,onConnected:()=>{f()},onSkip:t})]})}function be({project:e,onDone:t}){let{t:n}=i(`integrations`),r=(0,I.useMemo)(()=>h(e).filter(e=>q.has(e)),[e]),a=r.includes(e.provider)?e.provider:r[0]??e.provider,[o,l]=(0,I.useState)(a),[u,f]=(0,I.useState)(null),[p,m]=(0,I.useState)(null),[g,_]=(0,I.useState)(!1),[v,y]=(0,I.useState)(null),b=(0,I.useRef)(0);(0,I.useEffect)(()=>{l(a),f(null),m(null)},[e.id,a]);let x=(0,I.useCallback)(async()=>{let t=++b.current;y(null);try{let n=`?provider=${encodeURIComponent(o)}`,r=await fetch(`${Q(e.id)}/plugins${n}`).then(e=>Z(e));if(t!==b.current)return;let i=r.plugins.find(e=>e.name===`serena`)??null;if(f(i),m(null),i?.status===`not-installed`){let r=await fetch(`${Q(e.id)}/plugins/serena/preview-install${n}`).then(e=>Z(e));t===b.current&&m(r)}}catch(e){t===b.current&&y(e.message)}},[e.id,o]);(0,I.useEffect)(()=>{x()},[x]);async function S(){_(!0),y(null);try{await fetch(`${Q(e.id)}/plugins/serena/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:o})}).then(e=>Z(e)),await x(),t()}catch(e){y(e.message)}finally{_(!1)}}let C=(p?.requirements??[]).every(e=>e.installed&&e.executable&&e.meetsMinimum),T=u?n(`plugins.projectStatus.${u.status}`,{defaultValue:u.status}):``,D=u?.name===`serena`?n(`plugins.catalog.serena.description`):u?.description;return!u&&!v?(0,L.jsxs)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:[(0,L.jsx)(c,{className:`mr-2 h-4 w-4 animate-spin`}),` `,n(`plugins.serena.loading`)]}):(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h3`,{className:`text-sm font-semibold`,children:n(`plugins.serena.titleForProject`,{name:e.name})}),(0,L.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:n(`plugins.serena.description`)})]}),(0,L.jsxs)(`label`,{className:`block space-y-1`,children:[(0,L.jsx)(`span`,{className:`text-xs font-medium`,children:n(`plugins.serena.provider`,{defaultValue:`AI provider`})}),(0,L.jsx)(`select`,{"aria-label":n(`plugins.serena.provider`,{defaultValue:`AI provider`}),value:o,disabled:g,onChange:e=>{f(null),m(null),l(e.target.value)},className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs`,children:r.map(e=>(0,L.jsx)(`option`,{value:e,children:w(e)},e))})]}),u&&(0,L.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/45 p-3`,children:[(0,L.jsx)(`div`,{className:`text-xs font-medium`,children:n(`plugins.serena.status`,{status:T})}),D&&(0,L.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:D})]}),p&&(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:n(`plugins.serena.files`)}),(0,L.jsx)(`ul`,{className:`space-y-1 text-xs font-mono`,children:p.files.map(e=>(0,L.jsxs)(`li`,{className:e.op===`create`?`text-accent-success`:`text-accent-info`,children:[e.op===`create`?`+ `:`~ `,e.path]},e.path))})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:n(`plugins.serena.prerequisites`)}),(0,L.jsx)(`ul`,{className:`space-y-1 text-xs`,children:p.requirements.map(e=>(0,L.jsxs)(`li`,{className:`flex items-center gap-2`,children:[e.installed&&e.executable&&e.meetsMinimum?(0,L.jsx)(E,{className:`h-3 w-3 text-accent-success`}):(0,L.jsx)(d,{className:`h-3 w-3 text-accent-warning`}),(0,L.jsxs)(`span`,{children:[e.name,e.minVersion?` >= ${e.minVersion}`:``]}),e.version&&(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.version,`)`]})]},e.name))})]})]}),v&&(0,L.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/10 p-3 text-xs text-destructive`,children:v}),(0,L.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md border border-border px-3 py-1.5 text-xs`,children:n(`plugins.actions.cancel`)}),(0,L.jsxs)(`button`,{type:`button`,disabled:g||u?.status!==`not-installed`||!C,onClick:S,className:`flex items-center gap-2 rounded-md bg-accent-primary px-3 py-1.5 text-xs text-white disabled:opacity-50`,children:[g?(0,L.jsx)(c,{className:`h-3.5 w-3.5 animate-spin`}):(0,L.jsx)(s,{className:`h-3.5 w-3.5`}),n(`plugins.actions.install`)]})]})]})}function xe({open:e,onClose:t}){let{t:n}=i(`integrations`),[r,a]=(0,I.useState)(null);return(0,I.useEffect)(()=>{e&&fetch(`${m}/api/global-plugins/headroom/diagnostics`).then(e=>Z(e)).then(a).catch(e=>a({error:e.message}))},[e]),(0,L.jsx)(x,{open:e,onOpenChange:e=>{e||t()},children:(0,L.jsxs)(v,{className:`max-w-3xl`,children:[(0,L.jsxs)(_,{children:[(0,L.jsxs)(y,{className:`flex items-center gap-2`,children:[(0,L.jsx)(F,{className:`h-4 w-4`}),` `,n(`plugins.diagnostics.title`)]}),(0,L.jsx)(b,{children:n(`plugins.diagnostics.description`)})]}),(0,L.jsx)(`pre`,{className:`max-h-[62vh] overflow-y-auto overflow-x-hidden whitespace-pre-wrap break-words rounded-lg border border-border bg-background p-3 text-xs`,children:JSON.stringify(r,null,2)})]})})}export{ae as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-zu2_FqZY.js";import{n as r,t as i}from"./createLucideIcon-Bjbbp_KS.js";import{t as a}from"./git-branch-BRM0F5GN.js";import{r as o}from"./useDesktop-BQVt8lFd.js";import{a as s,n as c,o as l,r as u,t as d}from"./dialog-CdWCb02j.js";import{t as f}from"./utils-BC4DHlz2.js";import{Pt as p,Z as m,d as h,f as g,g as _,h as v,it as y,m as b,nt as x,p as S,tt as C}from"./index-DIhMEAVw.js";var w=i(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),T=e(t(),1),E=n(),D=[{id:`general`,icon:x,labelKey:`projectDialog.nav.general`},{id:`branch`,icon:a,labelKey:`projectDialog.nav.branch`},{id:`environment`,icon:w,labelKey:`projectDialog.nav.environment`},{id:`budget`,icon:m,labelKey:`projectDialog.nav.budget`},{id:`telemetry`,icon:p,labelKey:`projectDialog.nav.telemetry`},{id:`terminal`,icon:C,labelKey:`projectDialog.nav.terminal`}];function O({open:e,onClose:t}){let{t:n}=r(`settings`),{activeProjectId:i,projects:a}=o(),p=a.find(e=>e.id===i),[m,x]=(0,T.useState)(`general`),C=e=>f(`space-y-5`,m===e?``:`hidden`);return(0,E.jsx)(d,{open:e,onOpenChange:e=>{e||t()},children:(0,E.jsxs)(c,{movableResizable:!0,className:`flex max-w-5xl w-[92vw] h-[82vh] flex-col overflow-hidden`,children:[(0,E.jsxs)(s,{children:[(0,E.jsxs)(l,{className:`flex items-center gap-2`,children:[(0,E.jsx)(y,{className:`w-4 h-4`}),p?n(`projectDialog.title`,{name:p.name}):n(`page.title`)]}),(0,E.jsx)(u,{children:n(`projectDialog.description`)})]}),(0,E.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-5 py-2`,children:[(0,E.jsx)(`nav`,{className:`w-40 shrink-0 space-y-0.5 overflow-y-auto border-r border-border pr-2`,children:D.map(e=>{let t=e.icon;return(0,E.jsxs)(`button`,{type:`button`,onClick:()=>x(e.id),className:f(`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs transition-colors`,m===e.id?`bg-accent-primary/15 font-medium text-foreground`:`text-muted-foreground hover:bg-muted/40 hover:text-foreground`),children:[(0,E.jsx)(t,{className:`w-3.5 h-3.5 shrink-0`}),(0,E.jsx)(`span`,{className:`truncate`,children:n(e.labelKey)})]},e.id)})}),(0,E.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-y-auto pr-1`,children:[(0,E.jsx)(`div`,{className:C(`general`),children:(0,E.jsx)(S,{})}),(0,E.jsx)(`div`,{className:C(`branch`),children:(0,E.jsx)(g,{})}),(0,E.jsx)(`div`,{className:C(`environment`),children:(0,E.jsx)(v,{})}),(0,E.jsx)(`div`,{className:C(`budget`),children:(0,E.jsx)(h,{})}),(0,E.jsx)(`div`,{className:C(`telemetry`),children:(0,E.jsx)(b,{})}),(0,E.jsx)(`div`,{className:C(`terminal`),children:(0,E.jsx)(_,{mode:`project`})})]})]})]})})}export{O as ProjectSettingsDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-zu2_FqZY.js";import{d as r,u as i}from"./chunk-KS7C4IRE-DEKu087k.js";import{n as a,t as o}from"./createLucideIcon-Bjbbp_KS.js";import{n as s}from"./save-B6wGWwBR.js";import{$ as ee,Z as c,o as l}from"./TicketDetailModal-CsF-AWZX.js";import{d as u,u as d}from"./MinimizedChatsContext-Bd3OqR_S.js";import{t as te}from"./ban-E4EaZe3a.js";import{n as f}from"./file-text-BcLCfcWZ.js";import{t as p}from"./loader-circle-DcygOQpC.js";import{a as m,c as ne,t as re}from"./git-refresh-wTW0rO0Z.js";import{t as h}from"./sparkles-DrY8hb0X.js";import{t as g}from"./triangle-alert-H9T4jAmh.js";import{a as _,r as v}from"./useDesktop-BQVt8lFd.js";import{b as y,rt as b,vt as x}from"./index-DIhMEAVw.js";var S=o(`circle-dollar-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]),C=o(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),w=e(t(),1),T=(e={})=>({verbs:[],acceptMeaning:null,fineControlOnly:!1,inFlight:!1,terminal:!1,requiresIrreversibleConfirm:!1,...e});function E(e){let{decision:t,presentation:n,prUrl:r,canCreatePr:i}=e;if(t===`building`)return T({inFlight:!0});if(t===`merged`||t===`discarded`||n.superseded)return T({terminal:!0});if(n.manualRecovery||n.recoveryUnavailable||n.recoveryRecheck||n.retryablePush||n.retryablePrCreation||n.closed||n.deliveryBlocked&&!n.implementationFailed)return T({fineControlOnly:!0});if(n.noChanges)return T({verbs:[`accept`,`request-changes`],acceptMeaning:`mark-done`});if(n.implementationFailed)return T({verbs:n.succeededCount>0?[`request-changes`,`discard`]:[`discard`]});if(t===`pr_draft`)return T(r?{verbs:[`accept`,`request-changes`,`discard`],acceptMeaning:`publish`}:{fineControlOnly:!0});if(t===`pr_ready`)return T({verbs:[`request-changes`,`discard`]});if(t===`on_review`){let e=i?`create-pr`:`merge-local`;return T({verbs:[`accept`,`request-changes`,`discard`],acceptMeaning:e,requiresIrreversibleConfirm:e===`merge-local`})}return T({fineControlOnly:!0})}function ie(e,t){if(e===`discard`)return`discard`;if(e===`request-changes`)return null;switch(t.acceptMeaning){case`create-pr`:return`create-pr`;case`publish`:return`publish`;case`merge-local`:return`merge-local`;case`mark-done`:return`acknowledge-no-changes`;default:return null}}var D=n(),O=[`app-verified`,`ai-reported`,`reviewer-score`],k={"app-verified":b,"ai-reported":h,"reviewer-score":C},A={"app-verified":`text-accent-success border-accent-success/30 bg-accent-success/5`,"ai-reported":`text-accent-highlight border-accent-highlight/30 bg-accent-highlight/5`,"reviewer-score":`text-accent-info border-accent-info/30 bg-accent-info/5`};function j({item:e}){let{t}=a(`packet`);return(0,D.jsxs)(`li`,{className:`flex flex-col gap-1 py-1.5`,children:[(0,D.jsx)(`span`,{className:`text-sm text-foreground`,children:t(e.code,{...e.values??{},defaultValue:e.code})}),e.rawExcerpt?(0,D.jsx)(`pre`,{className:`max-h-32 overflow-auto rounded border border-border/60 bg-background-deep/60 p-2 text-[11px] leading-relaxed text-muted-foreground whitespace-pre-wrap`,children:e.rawExcerpt}):null]})}function M({title:e,children:t,defaultOpen:n=!1,badge:r}){let[i,a]=(0,w.useState)(n);return(0,D.jsxs)(`div`,{className:`rounded-lg border border-border/60 bg-surface/40`,children:[(0,D.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`flex w-full items-center gap-2 px-4 py-3 text-left`,"aria-expanded":i,children:[i?(0,D.jsx)(d,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}):(0,D.jsx)(f,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,D.jsx)(`span`,{className:`flex-1 text-sm font-medium text-foreground`,children:e}),r]}),i?(0,D.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3`,children:t}):null]})}function N(){let{prDeliveryId:e}=r(),{t}=a([`packet`,`common`]),n=i(),{activeProjectId:o}=v(),{act:d}=y(),{openTicketDetail:f}=l(),[h,b]=(0,w.useState)(null),[C,T]=(0,w.useState)(!0),[N,P]=(0,w.useState)(null),[F,I]=(0,w.useState)(null),[L,R]=(0,w.useState)(!1),[z,B]=(0,w.useState)(null),[V,H]=(0,w.useState)(``),[U,W]=(0,w.useState)(!1),[G,K]=(0,w.useState)(null),[q,J]=(0,w.useState)(!1),Y=(0,w.useCallback)(async()=>{if(!(!e||!o)){T(!0);try{let t=await fetch(`${_()}/rails/pr-deliveries/${e}/packet`);if(!t.ok){P(t.status===404?`notFound`:`loadFailed`),b(null);return}b(await t.json()),P(null)}catch{P(`loadFailed`)}finally{T(!1)}}},[e,o]);(0,w.useEffect)(()=>{Y()},[Y]);let X=h?.packet??null,Z=h?.acceptCapability??null,Q=(0,w.useMemo)(()=>{if(!X)return null;let e=m({decision:X.decision,ticketIds:X.ticketIds,prState:X.prUrl?`pr-created`:`none`,statusCode:X.statusCode,prUrl:X.prUrl,runIds:X.runIds});return E({decision:X.decision,presentation:e,prUrl:X.prUrl,canCreatePr:Z?.target===`create-pr`})},[X,Z]),$=(0,w.useCallback)(async e=>{if(!X||!Q)return;let t=ie(e,Q);if(t){B(null),I(e);try{let e=await d(X.railIndex,t,X.decision,X.prDeliveryId);e.ok?o&&re(o):B(e.status===409?`alreadyResolved`:`actionFailed`),await Y()}finally{I(null),R(!1)}}},[d,o,Y,X,Q]),ae=(0,w.useCallback)(async()=>{if(!(!X||!V.trim()||!o)){K(null),W(!0);try{let e=await fetch(`${_()}/rails/${X.railIndex}/launch`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({revisionOfDeliveryId:X.prDeliveryId,revisionNote:V.trim()})});if(!e.ok){let t=await e.json().catch(()=>null);K(t?.error===`invalid_revision_target`?`revisionStale`:`revisionFailed`);return}H(``),J(!1),await Y()}catch{K(`revisionFailed`)}finally{W(!1)}}},[o,Y,X,V]);if(C&&!X)return(0,D.jsxs)(`div`,{className:`flex h-full items-center justify-center text-muted-foreground`,children:[(0,D.jsx)(p,{className:`mr-2 size-4 animate-spin`,"aria-hidden":!0}),t(`common:states.loading`)]});if(N||!X||!Q)return(0,D.jsxs)(`div`,{className:`mx-auto flex max-w-2xl flex-col items-center gap-4 p-10 text-center`,children:[(0,D.jsx)(g,{className:`size-6 text-accent-warning`,"aria-hidden":!0}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(N===`notFound`?`error.notFound`:`error.loadFailed`)}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>n(`/`),className:`rounded-md border border-border px-3 py-1.5 text-sm text-foreground hover:bg-surface`,children:t(`backToBoard`)})]});let oe=O.map(e=>({tier:e,items:X.proof.filter(t=>t.tier===e)})).filter(e=>e.items.length>0),se=X.cost.totalUsd===null?`—`:`${X.cost.estimated?`~`:``}$${X.cost.totalUsd.toFixed(2)}`;return(0,D.jsxs)(`div`,{className:`mx-auto flex w-full max-w-3xl flex-col gap-4 p-6`,children:[(0,D.jsxs)(`button`,{type:`button`,onClick:()=>n(`/`),className:`flex w-fit items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,D.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),t(`backToBoard`)]}),(0,D.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-surface/60 p-5 shadow-sm`,children:[(0,D.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:t(X.headlineCode,{count:X.totalCount,succeeded:X.succeededCount,total:X.totalCount,defaultValue:X.headlineCode})}),(0,D.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs`,children:[X.confidence?.overall!==null&&X.confidence?.overall!==void 0?(0,D.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full border border-accent-info/30 bg-accent-info/10 px-2 py-0.5 text-accent-info`,title:t(`confidence.tooltip`),children:t(`confidence.pill`,{overall:X.confidence.overall})}):(0,D.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full border border-border bg-background-deep/50 px-2 py-0.5 text-muted-foreground`,children:t(`confidence.unavailable`)}),(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,D.jsx)(S,{className:`size-3.5`,"aria-hidden":!0}),t(`cost.thisBuild`,{amount:se})]}),X.prUrl?(0,D.jsxs)(`a`,{href:X.prUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-accent-info hover:underline`,children:[(0,D.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),t(`openPr`,{number:X.prNumber??``})]}):null]}),Q.fineControlOnly?(0,D.jsx)(`p`,{className:`mt-4 rounded-md border border-accent-warning/30 bg-accent-warning/5 px-3 py-2 text-xs text-accent-warning`,children:t(`fineControlOnly`)}):Q.inFlight?(0,D.jsxs)(`p`,{className:`mt-4 flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,D.jsx)(p,{className:`size-4 animate-spin`,"aria-hidden":!0}),t(`stillWorking`)]}):Q.terminal?(0,D.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:t(`alreadyResolved`)}):(0,D.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[Q.verbs.includes(`accept`)?L?(0,D.jsxs)(`div`,{className:`flex w-full flex-col gap-2 rounded-md border border-destructive/40 bg-destructive/5 p-3`,children:[(0,D.jsx)(`p`,{className:`text-xs text-foreground`,children:t(`accept.irreversibleWarning`)}),(0,D.jsxs)(`div`,{className:`flex gap-2`,children:[(0,D.jsx)(`button`,{type:`button`,onClick:()=>void $(`accept`),disabled:F!==null,className:`rounded-md bg-destructive px-3 py-1.5 text-sm font-medium text-white disabled:opacity-50`,"data-testid":`packet-accept-confirm`,children:t(`accept.irreversibleConfirm`)}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>R(!1),className:`rounded-md border border-border px-3 py-1.5 text-sm text-foreground`,children:t(`common:actions.cancel`)})]})]}):(0,D.jsxs)(`button`,{type:`button`,onClick:()=>{Q.requiresIrreversibleConfirm?R(!0):$(`accept`)},disabled:F!==null,className:`inline-flex items-center gap-1.5 rounded-md bg-accent-success px-3 py-1.5 text-sm font-medium text-white disabled:opacity-50`,"data-testid":`packet-accept`,children:[F===`accept`?(0,D.jsx)(p,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,D.jsx)(u,{className:`size-4`,"aria-hidden":!0}),t(`accept.${Q.acceptMeaning??`generic`}`)]}):null,Q.verbs.includes(`request-changes`)?(0,D.jsxs)(`button`,{type:`button`,onClick:()=>J(e=>!e),disabled:F!==null||U,"aria-expanded":q,className:`inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-sm text-foreground hover:bg-surface disabled:opacity-50`,"data-testid":`packet-request-changes`,children:[(0,D.jsx)(c,{className:`size-4`,"aria-hidden":!0}),t(`requestChanges.label`)]}):null,Q.verbs.includes(`discard`)?(0,D.jsxs)(`button`,{type:`button`,onClick:()=>void $(`discard`),disabled:F!==null,className:`inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-sm text-foreground hover:bg-surface disabled:opacity-50`,"data-testid":`packet-discard`,children:[F===`discard`?(0,D.jsx)(p,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,D.jsx)(te,{className:`size-4`,"aria-hidden":!0}),t(`discard.label`)]}):null]}),z?(0,D.jsx)(`p`,{className:`mt-3 text-xs text-accent-warning`,children:t(`error.${z}`)}):null,q?(0,D.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2 rounded-md border border-border/70 bg-background-deep/40 p-3`,children:[(0,D.jsx)(`label`,{htmlFor:`packet-revision-note`,className:`text-xs font-medium text-foreground`,children:t(`requestChanges.prompt`)}),(0,D.jsx)(`textarea`,{id:`packet-revision-note`,value:V,onChange:e=>H(e.target.value),rows:2,placeholder:t(`requestChanges.placeholder`),className:`resize-y rounded-md border border-border bg-surface px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground`,"data-testid":`packet-revision-input`}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsxs)(`button`,{type:`button`,onClick:()=>void ae(),disabled:U||V.trim().length===0,className:`inline-flex items-center gap-1.5 rounded-md bg-accent-primary px-3 py-1.5 text-sm font-medium text-white disabled:opacity-50`,"data-testid":`packet-revision-submit`,children:[U?(0,D.jsx)(p,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,D.jsx)(ne,{className:`size-4`,"aria-hidden":!0}),t(`requestChanges.submit`)]}),(0,D.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t(`requestChanges.hint`)})]}),G?(0,D.jsx)(`p`,{className:`text-xs text-accent-warning`,children:t(`error.${G}`)}):null]}):null]}),X.driftNudges.length>0?(0,D.jsxs)(`div`,{className:`rounded-lg border border-accent-highlight/30 bg-accent-highlight/5 p-4`,"data-testid":`packet-drift-nudges`,children:[(0,D.jsx)(`h2`,{className:`mb-1 text-sm font-medium text-accent-highlight`,children:t(`drift.title`)}),(0,D.jsx)(`ul`,{className:`space-y-1 text-xs text-foreground`,children:X.driftNudges.map(e=>(0,D.jsx)(`li`,{children:t(e.code,{...e.values,defaultValue:e.code})},e.code))}),(0,D.jsx)(`p`,{className:`mt-2 text-[11px] text-muted-foreground`,children:t(`drift.advisory`)})]}):null,X.versions.length>1?(0,D.jsxs)(M,{title:t(`versions.title`,{count:X.versions.length}),badge:(0,D.jsx)(x,{className:`size-3.5 text-muted-foreground`,"aria-hidden":!0}),children:[(0,D.jsx)(`ol`,{className:`space-y-2`,"data-testid":`packet-versions`,children:X.versions.map(e=>(0,D.jsxs)(`li`,{className:`flex flex-col gap-0.5 text-sm`,children:[(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(`span`,{className:e.current?`font-medium text-foreground`:`text-muted-foreground`,children:t(`versions.label`,{version:e.version})}),e.current?(0,D.jsx)(`span`,{className:`rounded-full border border-accent-primary/40 bg-accent-primary/10 px-1.5 text-[10px] text-accent-primary`,children:t(`versions.current`)}):null,(0,D.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.costUsd===null?`—`:`${e.costEstimated?`~`:``}$${e.costUsd.toFixed(2)}`})]}),(0,D.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.revisionNote??t(`versions.originalBuild`)})]},e.prDeliveryId))}),(0,D.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:t(`cost.allVersions`,{amount:X.chainCostUsd===null?`—`:`${X.chainCostEstimated?`~`:``}$${X.chainCostUsd.toFixed(2)}`})})]}):null,X.watchOut.length>0?(0,D.jsxs)(`div`,{className:`rounded-lg border border-accent-warning/30 bg-accent-warning/5 p-4`,children:[(0,D.jsxs)(`h2`,{className:`mb-2 flex items-center gap-1.5 text-sm font-medium text-accent-warning`,children:[(0,D.jsx)(g,{className:`size-4`,"aria-hidden":!0}),t(`watchOut.title`)]}),(0,D.jsx)(`ul`,{className:`space-y-1`,children:X.watchOut.map((e,t)=>(0,D.jsx)(j,{item:e},`${e.code}-${t}`))})]}):null,(0,D.jsx)(M,{title:t(`sections.whatYouAsked`),defaultOpen:!0,children:(0,D.jsx)(`ul`,{className:`space-y-3`,children:X.sections.map(e=>(0,D.jsxs)(`li`,{className:`text-sm`,children:[(0,D.jsxs)(`button`,{type:`button`,onClick:()=>f(e.ticketId),className:`text-accent-primary hover:underline`,children:[`#`,e.ticketId,` `,e.title??``]}),e.problem?(0,D.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:e.problem}):null]},e.ticketId))})}),(0,D.jsx)(M,{title:t(`sections.whatIDid`),children:(0,D.jsx)(`ul`,{className:`space-y-3`,children:X.sections.map(e=>(0,D.jsxs)(`li`,{className:`text-sm`,children:[(0,D.jsxs)(`span`,{className:`font-medium text-foreground`,children:[`#`,e.ticketId]}),` `,e.solution??(0,D.jsx)(`span`,{className:`text-muted-foreground`,children:t(`noSolutionRecorded`)}),e.churn?(0,D.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t(`churn.line`,{files:e.churn.filesTouched,added:e.churn.addedLines,removed:e.churn.removedLines})}):(0,D.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t(`churn.batchNotSplittable`)})]},e.ticketId))})}),(0,D.jsx)(M,{title:t(`sections.howItWasChecked`),badge:X.evidenceUnavailable?(0,D.jsx)(`span`,{className:`rounded-full border border-border bg-background-deep/50 px-2 py-0.5 text-[10px] text-muted-foreground`,children:t(`proof.evidenceUnavailable`)}):void 0,children:(0,D.jsx)(`div`,{className:`space-y-4`,children:oe.map(({tier:e,items:n})=>{let r=k[e];return(0,D.jsxs)(`div`,{className:`rounded-md border px-3 py-2 ${A[e]}`,children:[(0,D.jsxs)(`h3`,{className:`mb-1 flex items-center gap-1.5 text-xs font-medium`,children:[(0,D.jsx)(r,{className:`size-3.5`,"aria-hidden":!0}),t(`tier.${e}.title`)]}),(0,D.jsx)(`p`,{className:`mb-2 text-[11px] opacity-80`,children:t(`tier.${e}.caveat`)}),(0,D.jsx)(`ul`,{className:`space-y-1`,children:n.map((e,t)=>(0,D.jsx)(j,{item:e},`${e.code}-${t}`))})]},e)})})})]})}export{N as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-zu2_FqZY.js";import{n as t}from"./createLucideIcon-Bjbbp_KS.js";import{t as n}from"./brain-DI9lHkKY.js";import{t as r}from"./download-CFHyyHcw.js";import{t as i}from"./git-branch-BRM0F5GN.js";import{t as a}from"./play-DNlrawbS.js";import{a as o,i as s,n as c,o as l,r as u,t as d}from"./dialog-CdWCb02j.js";import{t as f}from"./button-CJqFnUOL.js";import{Q as p,Tt as m,et as h,w as g}from"./index-DIhMEAVw.js";var _=e(),v={start:a,"ai-step":n,shell:p,decider:i,condition:i,end:h};function y(e){return e.type===`ai-step`?typeof e.data?.prompt==`string`?e.data.prompt:null:e.type===`shell`?typeof e.data?.command==`string`?e.data.command:null:e.type===`decider`?typeof e.data?.goal==`string`?e.data.goal:null:e.type===`end`?e.data?.outcome===`failure`?`failure`:`success`:null}function b({template:e,onClose:i,onUse:a,mode:p=`use`}){let{t:b}=t(`loops`);return(0,_.jsx)(d,{open:e!==null,onOpenChange:e=>{e||i()},children:(0,_.jsx)(c,{movableResizable:!0,className:`max-w-lg`,children:e&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(o,{children:[(0,_.jsxs)(l,{className:`flex items-center gap-2`,children:[(0,_.jsx)(n,{className:`w-4 h-4 text-accent-highlight`}),e.name]}),(0,_.jsx)(u,{children:e.description})]}),(0,_.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[g(e.graph)?(0,_.jsx)(`span`,{title:b(`gallery.needsSpecHint`),className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-secondary/15 text-accent-secondary`,children:b(`gallery.needsSpec`)}):(0,_.jsx)(`span`,{title:b(`gallery.standaloneHint`),className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-success/15 text-accent-success`,children:b(`gallery.standalone`)}),e.category&&(0,_.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-info/15 text-accent-info`,children:b(`categories.${e.category}`,{defaultValue:e.category})}),e.tags.map(e=>(0,_.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-muted text-muted-foreground`,children:e},e))]}),(0,_.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.graph.config.timeoutMinutes>0?b(`preview.limits`,{iterations:e.graph.config.maxIterations,timeout:e.graph.config.timeoutMinutes}):b(`preview.limitsNoTimeout`,{iterations:e.graph.config.maxIterations})}),(0,_.jsxs)(`div`,{className:`max-h-[50vh] overflow-y-auto space-y-1.5 pr-1`,children:[(0,_.jsx)(`span`,{className:`block text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:b(`preview.steps`)}),e.graph.nodes.map((e,t)=>{let n=v[e.type]??h,r=y(e);return(0,_.jsxs)(`div`,{className:`rounded border border-border bg-surface/30 p-2`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,_.jsxs)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,_.jsx)(n,{className:`w-3.5 h-3.5 text-accent-primary`}),b(`builder.nodes.${e.type}`)]}),r&&(0,_.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words text-[11px] text-muted-foreground font-mono`,children:r})]},e.id)})]}),(0,_.jsxs)(s,{children:[(0,_.jsx)(f,{variant:`ghost`,onClick:i,children:b(`common:actions.cancel`)}),(0,_.jsxs)(f,{onClick:()=>a(e.id),children:[p===`fork`?(0,_.jsx)(m,{className:`w-3.5 h-3.5 mr-1.5`}):(0,_.jsx)(r,{className:`w-3.5 h-3.5 mr-1.5`}),b(p===`fork`?`actions.fork`:`actions.use`)]})]})]})})})}export{b as n,y as r,v as t};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-js-Rlh4FLH5.js","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{_ as o,a as s,f as c,h as l,o as u,v as d,w as f}from"./i18n-hnX2DPmo.js";import{t as p}from"./Trans-Bsz9_gyq.js";import{n as m,t as h}from"./createLucideIcon-Bjbbp_KS.js";import{n as g}from"./dist-bVqfYmby.js";import{n as _,t as v}from"./save-B6wGWwBR.js";import{c as y,d as b,f as x,n as S}from"./MinimizedChatsContext-Bd3OqR_S.js";import{t as C}from"./file-text-BcLCfcWZ.js";import{t as w}from"./circle-x-CMYsN4ZH.js";import{t as T}from"./download-CFHyyHcw.js";import{t as ee}from"./git-branch-BRM0F5GN.js";import{t as te}from"./loader-circle-DcygOQpC.js";import{t as ne}from"./pencil-C9RkrIPZ.js";import{t as E}from"./play-DNlrawbS.js";import{t as re}from"./plus-CsnjfkmX.js";import{t as ie}from"./search-Cq_gE3Ik.js";import{t as ae}from"./trash-2-BOU3WdZZ.js";import{t as D}from"./triangle-alert-H9T4jAmh.js";import{n as oe,t as se}from"./jira-api-B1-MUehg.js";import{t as ce}from"./x-CBMI9ejn.js";import{t as O}from"./zap-CHo3aCD1.js";import{a as k,n as A}from"./auth-D_5bQv5W.js";import{a as j,r as M}from"./useDesktop-BQVt8lFd.js";import{a as le,c as ue,i as de,n as fe,o as pe,r as me,s as he,t as ge}from"./dialog-CdWCb02j.js";import{t as N}from"./button-CJqFnUOL.js";import{t as P}from"./utils-BC4DHlz2.js";import{n as _e}from"./provider-capabilities-Doej9lfa.js";import{n as ve,t as F}from"./lib-CGdyxIWg.js";import{t as ye}from"./formatDistanceToNow-DQCvMgUc.js";import{n as be}from"./spending-EC9xqio-.js";var xe=h(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Se=h(`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`}]]),I=h(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Ce=h(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),we=h(`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`}]]),Te=h(`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`}]]),Ee=h(`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`}]]),De=h(`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`}]]),L=h(`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`}]]),Oe=h(`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`}]]),ke=h(`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`}]]),Ae=h(`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`}]]),R=h(`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`}]]),je=h(`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`}]]),Me=h(`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`}]]),z=new Map,Ne=2e3;function B(e){z.set(e,(z.get(e)??0)+1)}function Pe(e){(z.get(e)??0)<=0||setTimeout(()=>{let t=(z.get(e)??0)-1;t<=0?z.delete(e):z.set(e,t)},Ne)}function Fe(e){return e?(z.get(e)??0)>0:!1}var V=e(t(),1),Ie=3e3,Le=`
|
|
3
|
-
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Contract Layer
|
|
7
|
-
|
|
8
|
-
`;function H(e){return`${k}/api/projects/${encodeURIComponent(e)}`}function Re(e,t){return JSON.stringify(e)===JSON.stringify(t)}function ze(e,t){let n=new Map(e.map(e=>[e.id,e])),r=t.map(e=>{let t=n.get(e.id);return t&&Re(t,e)?t:e});return r.length===e.length&&r.every((t,n)=>t===e[n])?e:r}function Be(){let{t:e}=m(`tickets`),{activeProjectId:t}=M(),[n,r]=(0,V.useState)([]),[i,a]=(0,V.useState)(!1),[o,s]=(0,V.useState)(null),[c,l]=(0,V.useState)(new Set),[u,d]=(0,V.useState)(new Set),p=(0,V.useRef)(t);p.current=t;let h=(0,V.useRef)(0),_=(0,V.useRef)(null),v=(0,V.useRef)(new Set),{registerHandler:y,unregisterHandler:b,connectionStatus:x}=f(),S=(0,V.useId)(),C=(0,V.useCallback)(async(e,t)=>{let n=H(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??[]},[]),w=(0,V.useCallback)(async(t,n)=>{let i=++h.current;_.current?.abort();let o=new AbortController;_.current=o,p.current===t&&(a(!0),s(null));try{let a=await C(t,o.signal);if(o.signal.aborted||i!==h.current||p.current!==t)return;let s=v.current,c=new Set;if(n===`merge`)for(let e of a)s.size>0&&!s.has(e.id)&&c.add(e.id);v.current=new Set(a.map(e=>e.id)),r(n===`replace`?a:e=>ze(e,a)),c.size>0&&s.size>0&&(l(c),g.success(e(`toasts.newTicketsAdded`,{count:c.size}),{id:`tickets-added-${t}`}),setTimeout(()=>{p.current===t&&l(e=>{let t=new Set(e);for(let e of c)t.delete(e);return t})},Ie))}catch(e){if(o.signal.aborted||i!==h.current||p.current!==t)return;s(e instanceof Error?e.message:String(e))}finally{i===h.current&&(_.current===o&&(_.current=null),p.current===t&&a(!1))}},[C,e]),T=(0,V.useCallback)(async()=>{t&&await w(t,`merge`)},[t,w]);(0,V.useEffect)(()=>{if(h.current+=1,_.current?.abort(),_.current=null,r([]),a(!1),s(null),v.current=new Set,l(new Set),d(new Set),t)return w(t,`replace`),()=>{h.current+=1,_.current?.abort(),_.current=null}},[t,w]);let ee=(0,V.useCallback)(t=>{let n=t;if(!n||typeof n.type!=`string`)return;let i=p.current;if(!(n.projectId&&n.projectId!==i))switch(n.type){case`mcp.activity`:n.affectedProjectId&&n.affectedProjectId===i&&T();break;case`ticket_created`:{if(!n.ticket)break;let t=n.ticket;r(e=>e.some(e=>e.id===t.id)?e:[...e,t]),v.current.add(t.id),l(e=>new Set([...e,t.id])),Fe(i)||g.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})},Ie);break}case`ticket_updated`:{if(!n.ticket)break;if(n.ticket.id===0){T();break}let e=n.ticket;r(t=>t.map(t=>t.id===e.id?e:t)),typeof e.description==`string`&&e.description.includes(Le)&&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)),v.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}}},[T,e]);(0,V.useLayoutEffect)(()=>(y(`tickets-${S}`,ee),()=>b(`tickets-${S}`)),[ee,y,b,S]);let te=(0,V.useRef)(x);return(0,V.useEffect)(()=>{te.current!==`connected`&&x===`connected`&&p.current&&T(),te.current=x},[x,T]),{tickets:n,loading:i,isLoading:i,error:o,newTicketIds:c,contractRefiningIds:u,refetch:T,refresh:T,deleteTicket:(0,V.useCallback)(async e=>{let n=t;if(!n)return!1;try{let t=await fetch(`${H(n)}/tickets/${e}`,{method:`DELETE`});return t.ok&&p.current===n&&await w(n,`merge`),t.ok}catch{return!1}},[t,w]),updateTicketStatus:(0,V.useCallback)(async(e,n)=>{let r=t;if(!r)return!1;try{let t=await fetch(`${H(r)}/tickets/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({status:n})});return t.ok&&p.current===r&&await w(r,`merge`),t.ok}catch{return!1}},[t,w]),updateTicketPriority:(0,V.useCallback)(async(e,n)=>{let r=t;if(!r)return!1;try{let t=await fetch(`${H(r)}/tickets/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({priority:n})});return t.ok&&p.current===r&&await w(r,`merge`),t.ok}catch{return!1}},[t,w]),createTicket:(0,V.useCallback)(async e=>{let n=t;if(!n)return!1;try{let t=await fetch(`${H(n)}/tickets`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});return t.ok&&p.current===n&&await w(n,`merge`),t.ok}catch{return!1}},[t,w]),updateTicket:(0,V.useCallback)(async(e,n)=>{let r=t;if(!r)return!1;try{let t=await fetch(`${H(r)}/tickets/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)});return t.ok&&p.current===r&&await w(r,`merge`),t.ok}catch{return!1}},[t,w])}}var U=n(),W=224,Ve=8,He=8;function Ue({rails:e,onMoveToRail:t,onClose:n,anchorRect:r}){let{t:i}=m(`tickets`),a=(0,V.useRef)(null),[o,s]=(0,V.useState)(!1);(0,V.useLayoutEffect)(()=>{let e=requestAnimationFrame(()=>s(!0));return()=>cancelAnimationFrame(e)},[]),(0,V.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,V.useMemo)(()=>{let e=r.left+r.width/2,t=e-W/2,n=window.innerWidth-W-Ve,i=Math.max(Ve,Math.min(n,t)),a=e-i,o=Math.max(12,Math.min(W-12,a));return{top:r.bottom+He,left:i,caretLeft:o}},[r]);return(0,U.jsxs)(`div`,{ref:a,role:`dialog`,"aria-label":i(`rail.popoverTitle`),"data-testid":`move-to-rail-popover`,style:{top:c,left:l,width:W,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,U.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,U.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,U.jsx)(`div`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:i(`rail.noRails`)}):(0,U.jsx)(`ul`,{className:`flex flex-col`,children:e.map(e=>(0,U.jsx)(`li`,{children:(0,U.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,U.jsx)(E,{className:`w-3 h-3 text-accent-success animate-pulse shrink-0`,"aria-hidden":!0}):(0,U.jsx)(I,{className:`w-3 h-3 text-muted-foreground/60 shrink-0`,"aria-hidden":!0}),(0,U.jsx)(`span`,{className:`flex-1 truncate`,children:e.label}),(0,U.jsx)(Se,{className:`w-3.5 h-3.5 text-muted-foreground/40 shrink-0`,"aria-hidden":!0})]})},e.id))})]})}var We=/\n*##\s*Acceptance Criteria\s*\n([\s\S]*?)(?=\n##\s|\n*$)/i;function Ge(e){if(!e)return{body:``,criteria:[]};let t=We.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 Ke=new Set([`draft`,`todo`]);function qe(e){return!!(Ke.has(e.status)||e.source===`jira`&&e.jira_key&&e.status!==`cancelled`)}function Je(){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)})}var Ye=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_TERMINAL_PANEL;return typeof e!=`string`||e!==`false`})(),Xe=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_AGENTS_SECTION;return typeof e!=`string`||e!==`false`})(),Ze=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_CODE_EXPLORER;return typeof e!=`string`||e!==`false`})(),Qe=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_JIRA;return typeof e!=`string`||e!==`false`})(),$e=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_MCP;return typeof e!=`string`||e!==`false`})(),G=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_AGENT_CHAT;return typeof e!=`string`||e!==`false`})(),et=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_AGENT_MODE;return G&&(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 tt=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_LOOPS_SECTION;return typeof e!=`string`||e!==`false`})(),K=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_NATIVE_BROWSER;return typeof e!=`string`||e!==`false`})(),q=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_PROJECT_BUILDER;return typeof e!=`string`||e!==`false`})(),J=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_REVIEW_PACKET;return typeof e!=`string`||e!==`false`})(),nt=(()=>{let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_NARRATED_PROGRESS;return typeof e!=`string`||e!==`false`})();function rt(){let{activeProjectId:e}=M(),[t,n]=(0,V.useState)({connected:!1,key:null,discardStatus:null}),[r,i]=(0,V.useState)(!0);return(0,V.useEffect)(()=>{if(!Qe||!e){n({connected:!1,key:null,discardStatus:null}),i(!1);return}let t=!1;return i(!0),se.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 it({open:e,onOpenChange:t,ticket:n,discardStatus:r,onDiscarded:i}){let{t:a}=m(`jira`),[o,s]=(0,V.useState)(``),[c,l]=(0,V.useState)(!1);async function u(){l(!0);try{await se.discardSpec(n.id,o.trim()||null),g.success(a(`discard.movedToast`,{status:r,key:n.jira_key??`#${n.id}`})),t(!1),s(``),i?.()}catch(e){g.error(e instanceof Error?e.message:a(`errors.generic`))}finally{l(!1)}}return(0,U.jsx)(ge,{open:e,onOpenChange:e=>{c||t(e)},children:(0,U.jsxs)(fe,{movableResizable:!0,className:`max-w-md`,"data-testid":`jira-discard-dialog`,children:[(0,U.jsxs)(le,{children:[(0,U.jsx)(pe,{children:a(`discard.title`,{status:r})}),(0,U.jsx)(me,{children:a(`discard.body`,{status:r,key:n.jira_key??`#${n.id}`})})]}),(0,U.jsxs)(`label`,{className:`block space-y-1`,children:[(0,U.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:a(`discard.commentLabel`)}),(0,U.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,U.jsxs)(de,{children:[(0,U.jsx)(N,{variant:`outline`,size:`sm`,onClick:()=>t(!1),disabled:c,children:a(`wizard.cancel`)}),(0,U.jsxs)(N,{size:`sm`,onClick:u,disabled:c,"data-testid":`jira-discard-confirm`,children:[(0,U.jsx)(xe,{className:`w-3.5 h-3.5 mr-1.5`}),c?a(`discard.moving`):a(`discard.confirm`,{status:r})]})]})]})})}var at={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 ot({status:e,className:t}){let{t:n}=m(`specs`),r=at[e];return e===`done`?(0,U.jsx)(b,{className:P(`w-3.5 h-3.5 shrink-0`,r.dotClass,t),"aria-label":n(`status.done`)}):e===`cancelled`?(0,U.jsx)(ce,{className:P(`w-3.5 h-3.5 shrink-0`,r.dotClass,t),"aria-label":n(`status.cancelled`)}):r.pulsing?(0,U.jsxs)(`span`,{className:P(`relative flex shrink-0 h-2.5 w-2.5`,t),"aria-label":n(`status.inProgress`),children:[(0,U.jsx)(`span`,{className:P(`animate-ping absolute inline-flex h-full w-full rounded-full opacity-60`,r.dotClass)}),(0,U.jsx)(`span`,{className:P(`relative inline-flex rounded-full h-2.5 w-2.5`,r.dotClass)})]}):(0,U.jsx)(`span`,{className:P(`inline-flex rounded-full h-2.5 w-2.5 shrink-0`,r.dotClass,t),"aria-label":n(r.labelKey)})}function st({status:e,className:t}){let{t:n}=m(`specs`),r=at[e];return(0,U.jsxs)(`span`,{className:P(`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,U.jsx)(ot,{status:e}),n(r.labelKey)]})}async function ct(e,t,n){let r=new FormData;r.append(`file`,t);let i=await fetch(`${j()}/tickets/${e}/attachments`,{method:`POST`,body:r,signal:n});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e.error??u.t(`attachments:errors.uploadFailed`,{status:i.status}))}return(await i.json()).attachment}async function lt(e,t){let n=await fetch(`${j()}/tickets/${e}/attachments/${t}`,{method:`DELETE`});if(!n.ok&&n.status!==404)throw Error(u.t(`attachments:errors.deleteFailed`,{status:n.status}))}async function ut(e){let t=await fetch(`${j()}/tickets/${e}/attachments`,{method:`DELETE`});if(!t.ok&&t.status!==404)throw Error(u.t(`attachments:errors.bulkDeleteFailed`,{status:t.status}))}async function dt(e){let t=await fetch(`${j()}/tickets/${e}/attachments`);if(!t.ok)throw Error(u.t(`attachments:errors.listFailed`,{status:t.status}));return(await t.json()).attachments}function ft(e,t){return`${j()}/tickets/${e}/attachments/${t}`}async function pt(e,t){let n=await fetch(ft(e,t));if(!n.ok)throw Error(u.t(`attachments:errors.fetchFailed`,{status:n.status}));return n.blob()}var mt=`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`,ht=new Set(mt.split(`,`).filter(e=>!e.startsWith(`.`))),gt=/\.sql$/i,_t=/\.(png|jpe?g|gif|webp)$/i;function vt(e){return ht.has(e.type)||gt.test(e.name)||_t.test(e.name)}function yt(){return typeof window<`u`&&`__TAURI_INTERNALS__`in window||typeof window<`u`&&window.location.protocol!==`http:`&&window.location.protocol!==`https:`?`ws://localhost:4200`:`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}`}var bt=yt();function xt(){let e={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_FEATURE_BROWSER_CAPTURE;return typeof e!=`string`||e!==`false`}var St={desktop:{width:1280,height:800},tablet:{width:768,height:1024},mobile:{width:375,height:667}},Ct=class extends Error{},wt=class extends Error{};function Y(e){if(!e)throw Error(`A project owner is required for browser sessions`);return`${k}/api/projects/${encodeURIComponent(e)}`}async function Tt(e,t){let n=await fetch(`${Y(e)}/browser/sessions`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({initialUrl:t})});if(n.status===409)throw new Ct(`Too many open browser sessions`);if(n.status===502)throw new wt(`The browser failed to launch`);if(!n.ok)throw Error(`Failed to open browser (${n.status})`);return(await n.json()).session}async function Et(e,t,n,r){let i=await fetch(`${Y(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 Dt(e,t,n,r,i){let a=await fetch(`${Y(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 Ot(a));return await a.json()}async function Ot(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 kt(e,t,n,r,i,a=St){let o=await fetch(`${Y(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 Ot(o));return await o.json()}async function At(e,t,n){let r=new FormData;r.append(`file`,t,n);let i=await fetch(`${j()}/tickets/${e}/attachments`,{method:`POST`,body:r});if(!i.ok)throw Error(`Upload failed (${i.status})`);return(await i.json()).attachment}async function jt(e,t,n,r){let i=await fetch(`${Y(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 Mt(e,t,n,r){let i=await fetch(`${Y(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 Nt(e,t,n){try{await fetch(`${Y(e)}/browser/sessions/${t}/popup-view`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({target:n})})}catch{}}function Pt(e){if(!e||e===`about:blank`)return`…`;try{return new URL(e).hostname||`…`}catch{return`…`}}async function Ft(e,t){try{await fetch(`${Y(e)}/browser/sessions/${t}`,{method:`DELETE`})}catch{}}function It(e,t){return`${bt||(typeof window<`u`?`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}`:`ws://localhost:4200`)}/ws/browser/${e}?projectId=${encodeURIComponent(t)}`}function Lt(e,t){let n=It(e,t),r=A(),i=r?new WebSocket(n,[`specrails-desktop`,r]):new WebSocket(n);return i.binaryType=`arraybuffer`,i}function Rt(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 zt(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 Bt(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 Vt(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 Ht(e,t=8){return e.width>=t&&e.height>=t}function Ut(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 Wt(e){return{nodeCount:e.nodes.length,htmlBytes:e.html.length,truncated:e.htmlTruncated,networkCount:e.networkRequests?.length??0}}function Gt(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 Kt=`specrails-desktop:browser-capture-debug`;function qt(){try{return typeof localStorage<`u`&&localStorage.getItem(Kt)===`1`}catch{return!1}}function Jt(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 Yt(e,t=e=>console.table([e]),n=2e3,r=()=>Date.now()){let i=e(),a=r(),o=setInterval(()=>{let n=e(),o=r();t(Jt(i,n,o-a)),i=n,a=o},n);return()=>clearInterval(o)}function Xt(e){let{projectId:t,open:n,initialUrl:r}=e,i=(0,V.useRef)(null),a=(0,V.useRef)(null),o=(0,V.useRef)(null),s=(0,V.useRef)(0),c=(0,V.useRef)(new Map),l=(0,V.useCallback)(()=>{if(s.current!==0||c.current.size===0)return;let e=[...c.current.values()];c.current.clear();for(let t of e)Ft(t.projectId,t.sessionId)},[]),[d,f]=(0,V.useState)({status:`connecting`,errorMsg:null,url:null,title:null,viewport:{width:1280,height:800},hoverRect:null,hoverSelector:null,hoverPath:null,popup:null});(0,V.useEffect)(()=>{if(!n||!t)return;let e=!1,l=null;f(e=>({...e,status:`connecting`,errorMsg:null,popup:null}));let d=Gt({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()}),p=qt()?Yt(()=>d.stats()):null;return(async()=>{try{let n=await Tt(t,r);if(e){Ft(t,n.id);return}l=n.id,o.current={id:n.id,projectId:t},f(e=>({...e,url:n.url,title:n.title,viewport:{width:n.viewportWidth,height:n.viewportHeight}}));let i=Lt(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`)f(e=>({...e,status:`ready`,url:t.url??e.url,title:t.title??e.title,viewport:t.viewport??e.viewport}));else if(t.type===`nav`)f(e=>({...e,url:t.url??e.url,title:t.title??e.title}));else if(t.type===`hover`)f(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;f(n=>({...n,popup:e>0?{count:e,active:t.active===!0,url:t.url??null}:null}))}}catch{}return}d.push(e.data)},i.onopen=()=>{e||f(e=>({...e,status:`ready`}))},i.onerror=()=>{e||f(e=>({...e,status:`error`,errorMsg:u.t(`browser:session.connectionError`)}))},i.onclose=()=>{e||f(e=>e.status===`ready`?{...e,status:`error`,errorMsg:u.t(`browser:session.lostConnection`)}:e)}}catch(t){if(e)return;let n=t instanceof Ct?u.t(`browser:session.tooManySessions`):t instanceof wt?u.t(`browser:session.launchFailed`):u.t(`browser:session.openFailed`);f(e=>({...e,status:`error`,errorMsg:n}))}})(),()=>{e=!0,p?.(),d.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=l;r&&o.current?.id===r&&o.current.projectId===t&&(o.current=null),r&&(s.current>0?c.current.set(`${t}\0${r}`,{sessionId:r,projectId:t}):Ft(t,r))}},[n,t,r,l]);let p=(0,V.useCallback)(e=>{let t=a.current;if(t&&t.readyState===WebSocket.OPEN)try{t.send(JSON.stringify({type:`input`,event:e}))}catch{}},[]),m=(0,V.useCallback)(async(e,t)=>{let n=o.current;if(n)try{let r=await Et(n.projectId,n.id,e,t);if(o.current?.id!==n.id||o.current.projectId!==n.projectId)return;f(e=>({...e,url:r.url,title:r.title}))}catch{}},[]),h=(0,V.useCallback)(async(e,t,n)=>{let r=o.current;if(!r)throw Error(`No active browser session`);s.current+=1;try{return await Dt(r.projectId,r.id,e,t,n)}finally{s.current=Math.max(0,s.current-1),l()}},[l]),g=(0,V.useCallback)(async(e,t,n,r)=>{let i=o.current;if(!i)throw Error(`No active browser session`);s.current+=1;try{return await kt(i.projectId,i.id,e,t,n,r)}finally{s.current=Math.max(0,s.current-1),l()}},[l]),_=(0,V.useCallback)(async(e,t)=>{let n=o.current;return n?jt(n.projectId,n.id,e,t):{text:``}},[]),v=(0,V.useCallback)((e,t)=>{let n=Math.max(1,Math.round(e)),r=Math.max(1,Math.round(t));f(e=>({...e,viewport:{width:n,height:r}})),p({type:`resize`,width:n,height:r})},[p]),y=(0,V.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{}},[]),b=(0,V.useCallback)(()=>{f(e=>e.hoverRect||e.hoverPath?{...e,hoverRect:null,hoverSelector:null,hoverPath:null}:e)},[]),x=(0,V.useCallback)(async(e,t)=>{let n=o.current;return n?Mt(n.projectId,n.id,e,t):null},[]),S=(0,V.useCallback)(e=>{let t=o.current;t&&(f(t=>t.popup?{...t,popup:{...t.popup,active:e===`popup`}}:t),Nt(t.projectId,t.id,e))},[]);return{...d,canvasRef:i,forwardInput:p,navigate:m,capture:h,captureBreakpoints:g,clipboard:_,navigateElement:x,setViewport:v,probe:y,clearHover:b,setPopupView:S}}function Zt(){return typeof window<`u`&&window.__TAURI_INTERNALS__!==void 0}function Qt(e){return Function(`s`,`return import(s)`)(e).catch(()=>null)}async function $t(e){if(Zt()){try{let t=await Qt(`@tauri-apps/plugin-opener`);if(t?.revealItemInDir){await t.revealItemInDir(e);return}}catch{}try{await(await Qt(`@tauri-apps/api/shell`))?.open?.(e)}catch{}}}async function X(e){if(Zt())try{let t=await i(()=>import(`./dist-js-Rlh4FLH5.js`),__vite__mapDeps([0,1,2]));if(typeof t.open==`function`){await t.open(e);return}}catch(e){console.warn(`[openExternalUrl] tauri shell open failed:`,e)}try{window.open(e,`_blank`,`noopener,noreferrer`)}catch{}}function en(e,t){let n=()=>l(t?.in,NaN),r=t?.additionalDigits??2,i=on(e),a;if(i.date){let e=sn(i.date,r);a=cn(e.restDateString,e.year)}if(!a||isNaN(+a))return n();let o=+a,s=0,u;if(i.time&&(s=un(i.time),isNaN(s)))return n();if(i.timezone){if(u=fn(i.timezone),isNaN(u))return n()}else{let e=new Date(o+s),n=c(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return c(o+s+u,t?.in)}var tn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},nn=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,rn=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,an=/^([+-])(\d{2})(?::?(\d{2}))?$/;function on(e){let t={},n=e.split(tn.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],tn.timeZoneDelimiter.test(t.date)&&(t.date=e.split(tn.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){let e=tn.timezone.exec(r);e?(t.time=r.replace(e[1],``),t.timezone=e[1]):t.time=r}return t}function sn(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 cn(e,t){if(t===null)return new Date(NaN);let n=e.match(nn);if(!n)return new Date(NaN);let r=!!n[4],i=ln(n[1]),a=ln(n[2])-1,o=ln(n[3]),s=ln(n[4]),c=ln(n[5])-1;if(r)return vn(t,s,c)?pn(t,s,c):new Date(NaN);{let e=new Date(0);return!gn(t,a,o)||!_n(t,i)?new Date(NaN):(e.setUTCFullYear(t,a,Math.max(i,o)),e)}}function ln(e){return e?parseInt(e):1}function un(e){let t=e.match(rn);if(!t)return NaN;let n=dn(t[1]),r=dn(t[2]),i=dn(t[3]);return yn(n,r,i)?n*o+r*d+i*1e3:NaN}function dn(e){return e&&parseFloat(e.replace(`,`,`.`))||0}function fn(e){if(e===`Z`)return 0;let t=e.match(an);if(!t)return 0;let n=t[1]===`+`?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return bn(r,i)?n*(r*o+i*d):NaN}function pn(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 mn=[31,null,31,30,31,30,31,31,30,31,30,31];function hn(e){return e%400==0||e%4==0&&e%100!=0}function gn(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(mn[t]||(hn(e)?29:28))}function _n(e,t){return t>=1&&t<=(hn(e)?366:365)}function vn(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function yn(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function bn(e,t){return t>=0&&t<=59}function xn({ticketKey:e,attachment:t,onClose:n}){let{t:r}=m(`attachments`),[i,a]=(0,V.useState)(null),[o,s]=(0,V.useState)(null);if((0,V.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,V.useEffect)(()=>{if(!t){a(null),s(null);return}let n=!1;return a(null),s(null),pt(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,V.useEffect)(()=>()=>{i&&URL.revokeObjectURL(i)},[i]),!t)return null;let c=t.mimeType.startsWith(`image/`),l=t.mimeType===`application/pdf`;return(0,U.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,U.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,U.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,U.jsx)(_,{className:`w-4 h-4`}),r(`common:actions.back`)]}),(0,U.jsxs)(`div`,{className:`flex-1 text-center min-w-0 px-4`,children:[(0,U.jsx)(`div`,{className:`text-sm font-medium text-white/95 truncate`,children:t.filename}),(0,U.jsx)(`div`,{className:`text-[11px] text-white/50`,children:t.mimeType})]}),(0,U.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,U.jsx)(T,{className:`w-4 h-4`}),r(`lightbox.download`)]})]}),(0,U.jsx)(`div`,{className:P(`flex-1 flex items-center justify-center overflow-auto p-6`),onClick:n,children:o?(0,U.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,U.jsx)(`p`,{className:`text-sm`,children:r(`lightbox.loadError`,{error:o})})}):i?c?(0,U.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,U.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,U.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,U.jsx)(`p`,{className:`text-sm mb-3`,children:r(`lightbox.previewUnavailable`)}),(0,U.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,U.jsx)(T,{className:`w-4 h-4`}),r(`lightbox.downloadFile`,{name:t.filename})]})]}):(0,U.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,U.jsx)(`p`,{className:`text-sm`,children:r(`lightbox.loading`)})})})]})}function Sn(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 Cn(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function wn(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 Tn(e){try{return new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}catch{return e}}function En({ticketKey:e,attachments:t,onChange:n,className:r}){let{t:i}=m(`attachments`),[a,o]=(0,V.useState)(new Set),[s,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(null);if((0,V.useEffect)(()=>{let r=!1;return dt(e).then(e=>{if(r)return;let i=Sn(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 lt(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,U.jsxs)(`section`,{className:P(`mt-4`,r),"aria-label":i(`section.ariaLabel`),children:[(0,U.jsxs)(`header`,{className:`flex items-center justify-between mb-2`,children:[(0,U.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:i(`section.title`)}),(0,U.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:i(`section.fileCount`,{count:d.length})})]}),(0,U.jsx)(`ul`,{className:`flex flex-col gap-1`,children:d.map(e=>{let t=a.has(e.id);return(0,U.jsxs)(`li`,{className:P(`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,U.jsx)(`span`,{"aria-hidden":!0,className:`w-6 text-center text-sm shrink-0`,children:wn(e.mimeType)}),(0,U.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,U.jsx)(`span`,{className:`font-medium truncate text-foreground`,children:e.filename}),(0,U.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[Cn(e.size),` · `,Tn(e.addedAt)]})]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>u(e),className:`text-[11px] text-primary hover:underline shrink-0`,children:i(`common:actions.open`)}),(0,U.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,U.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:s}),(0,U.jsx)(xn,{ticketKey:e,attachment:l,onClose:()=>u(null)})]})}function Dn({ticketId:e,onClose:t}){let{t:n}=m(`code`),r=a(),{activeProjectId:i}=M(),[o,s]=(0,V.useState)(null);return(0,V.useEffect)(()=>{if(!Ze)return;let t=new AbortController;return s(null),fetch(`${j()}/code/provenance?ticketId=${e}`,{signal:t.signal}).then(e=>e.ok?e.json():[]).then(e=>{s(Array.isArray(e)?e:[])}).catch(e=>{e?.name!==`AbortError`&&s([])}),()=>t.abort()},[e,i]),!Ze||!o||o.length===0?null:(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:n(`ticketFiles.title`)}),(0,U.jsx)(`ul`,{className:`space-y-1`,children:o.map((e,i)=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{t(),r(`/code?path=${encodeURIComponent(e.path)}`)},className:`w-full text-left flex items-center gap-2 rounded px-2 py-1 text-xs hover:bg-muted/40`,children:[(0,U.jsx)(e.kind===`created`?Te:e.kind===`deleted`?we:C,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,U.jsx)(`span`,{className:`font-mono truncate flex-1`,children:e.path}),e.jobId&&(0,U.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,U.jsx)(Ee,{className:`h-3 w-3`}),e.jobId.length>10?e.jobId.slice(0,10):e.jobId]}),(0,U.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wider shrink-0`,children:n(`kind.${e.kind}`)})]})},`${e.path}-${i}`))})]})}var On={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 kn(e){try{return ye(new Date(e),{addSuffix:!0,locale:s()})}catch{return e}}function An({tickets:e,excludeIds:t,onSelect:n}){let{t:r}=m(`tickets`),[i,a]=(0,V.useState)(``),o=(0,V.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,U.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,U.jsxs)(`div`,{className:`px-4 py-3 border-b border-border/30 flex items-center gap-2`,children:[(0,U.jsx)(R,{className:`w-3.5 h-3.5 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:r(`comparePicker.title`)}),(0,U.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:r(`comparePicker.count`,{n:o.length})})]}),(0,U.jsx)(`div`,{className:`px-4 py-2 border-b border-border/20`,children:(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(ie,{className:`absolute left-2 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground`}),(0,U.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,U.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`spec-compare-picker-list`,children:o.length===0?(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full text-center px-4 py-8 gap-2`,children:[(0,U.jsx)(R,{className:`w-6 h-6 text-muted-foreground/40`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i.trim()?r(`comparePicker.noMatches`):r(`comparePicker.empty`)})]}):(0,U.jsx)(`ul`,{className:`divide-y divide-border/10`,children:o.map(e=>(0,U.jsx)(`li`,{children:(0,U.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,U.jsx)(ot,{status:e.status}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsxs)(`span`,{className:`text-[10px] font-mono text-muted-foreground`,children:[`#`,e.id]}),e.priority&&On[e.priority]&&(0,U.jsx)(`span`,{className:`inline-flex items-center rounded px-1 py-0.5 text-[9px] font-medium border ${On[e.priority]}`,children:r(`priority.${e.priority}`)})]}),(0,U.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,U.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,U.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:[e.labels.slice(0,3).map(e=>(0,U.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,U.jsxs)(`span`,{className:`text-[9px] text-muted-foreground`,children:[`+`,e.labels.length-3]})]}),(0,U.jsx)(`p`,{className:`mt-1 text-[9px] text-muted-foreground`,children:r(`meta.updatedAgo`,{time:kn(e.updated_at)})})]})]})},e.id))})})]})}var jn=e(r(),1),Mn=.25,Nn=.75;function Pn({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,V.useRef)(null),p=(0,V.useRef)(null),[m,h]=(0,V.useState)(!0);(0,V.useEffect)(()=>{let e=setTimeout(()=>h(!1),320);return()=>clearTimeout(e)},[]);let g=(0,V.useCallback)(e=>{if(!p.current)return;let t=window.innerWidth,n=e.clientX/t;u(Math.min(Nn,Math.max(Mn,n)))},[u]),_=(0,V.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,V.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,V.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,V.useCallback)(t=>{let n=.04;t.key===`ArrowLeft`?(t.preventDefault(),u(Math.max(Mn,e.splitRatio-n))):t.key===`ArrowRight`?(t.preventDefault(),u(Math.min(Nn,e.splitRatio+n))):t.key===`Home`?(t.preventDefault(),u(Mn)):t.key===`End`?(t.preventDefault(),u(Nn)):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,U.jsx)(Rr,{ticket:f,allLabels:i,allTickets:r,onClose:d?c:()=>l(null,u),onOpenTicket:s,onSave:a,onDelete:o,embedded:!0},`${u}-${f.id}`):(0,U.jsx)(An,{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,jn.createPortal)((0,U.jsxs)(`div`,{ref:f,"data-testid":`split-view-shell`,className:`fixed inset-0 z-[68] flex`,onClick:b,children:[(0,U.jsx)(`div`,{className:`absolute inset-0 bg-black/70 pointer-events-none`,"aria-hidden":!0}),(0,U.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,U.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,U.jsx)(`div`,{className:`h-full flex items-center justify-center p-2`,children:(0,U.jsx)(`div`,{className:`w-full h-full max-h-[95vh]`,children:x(`left`)})})}),(0,U.jsx)(`div`,{"data-testid":`split-divider`,role:`separator`,"aria-orientation":`vertical`,"aria-valuenow":Math.round(e.splitRatio*100),"aria-valuemin":Math.round(Mn*100),"aria-valuemax":Math.round(Nn*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,U.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,U.jsx)(`div`,{className:`h-full flex items-center justify-center p-2`,children:(0,U.jsx)(`div`,{className:`w-full h-full max-h-[95vh]`,children:x(`right`)})})})]})]}),document.body)}var Fn=.5,In=.25,Ln=.75,Rn={leftId:null,rightId:null,originSide:null,splitRatio:Fn};function zn(e){return Number.isFinite(e)?Math.min(Ln,Math.max(In,e)):Fn}function Bn(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:Fn}:e.originSide!==null&&(e.leftId===t.id||e.rightId===t.id)?e:{...Rn,leftId:t.id};case`closeAll`:return Rn;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:Fn}:{leftId:null,rightId:n,originSide:`right`,splitRatio:Fn}}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{...Rn,leftId:t}}case`setSplitRatio`:return{...e,splitRatio:zn(t.ratio)};default:return e}}var Vn=(0,V.createContext)(null),Hn=900;function Un({children:e}){let[t,n]=(0,V.useReducer)(Bn,Rn),{tickets:r,updateTicket:i,deleteTicket:a}=Be(),{activeProjectId:o,setActiveProjectId:s}=M(),c=(0,V.useRef)(null);(0,V.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,V.useCallback)(e=>n({type:`openCentered`,id:e}),[]),u=(0,V.useCallback)((e,t)=>{if(e===o){n({type:`openCentered`,id:t});return}c.current={projectId:e,ticketId:t},s(e)},[o,s]),d=(0,V.useCallback)(()=>n({type:`closeAll`}),[]),f=(0,V.useCallback)((e,t)=>{typeof window<`u`&&window.innerWidth<Hn||n({type:`enterSplit`,side:e,ticketId:t})},[]),p=(0,V.useCallback)((e,t)=>n({type:`setComparedTicket`,id:e,side:t}),[]),m=(0,V.useCallback)(()=>n({type:`exitSplit`}),[]),h=(0,V.useCallback)(e=>n({type:`setSplitRatio`,ratio:e}),[]);(0,V.useEffect)(()=>{if(typeof window>`u`)return;function e(){window.innerWidth<Hn&&n({type:`exitSplit`})}return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let g=(0,V.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,V.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,U.jsxs)(Vn.Provider,{value:y,children:[e,!b&&_&&(0,U.jsx)(Rr,{ticket:_,allLabels:g,allTickets:r,onClose:d,onOpenTicket:l,onSave:i,onDelete:a},_.id),b&&(0,U.jsx)(Pn,{state:t,leftTicket:_,rightTicket:v,allTickets:r,allLabels:g,onSave:i,onDelete:a,onOpenTicket:l,onCloseAll:d,onSetCompared:p,onSetRatio:h,onExitSplit:m})]})}function Wn(){return(0,V.useContext)(Vn)||{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:Rn}}function Gn(e){return e<.005?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function Kn(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 qn({ticketId:e}){let{t}=m(`tickets`),[n,r]=(0,V.useState)(null),i=a(),{activeProjectId:o}=M(),{closeTicketDetail:s}=Wn();if((0,V.useEffect)(()=>{let t=new AbortController;return r(null),fetch(`${j()}/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:be[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,h=n.totalTurns==null||p>0&&(n.turnsReportedRuns??0)===0,g=!h&&p>0;return(0,U.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,U.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?`≥`:``}${Gn(n.totalCostUsd)}`}),(0,U.jsx)(`span`,{className:`text-muted-foreground/60`,children:`·`}),(0,U.jsx)(`span`,{className:`tabular-nums`,"data-testid":h?`ticket-turns-unavailable`:void 0,title:h?t(`spendingLine.turnsUnavailableTooltip`):g?t(`spendingLine.turnsPartiallyUnavailableTooltip`):void 0,children:h?`—`:`${g?`≥`:``}${t(`spendingLine.turns`,{count:n.totalTurns})}`}),(0,U.jsx)(`span`,{className:`text-muted-foreground/60`,children:`·`}),(0,U.jsx)(`span`,{className:`tabular-nums`,children:t(`spendingLine.active`,{duration:Kn(n.activeDurationMs)})}),c&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-muted-foreground/60`,children:`·`}),(0,U.jsx)(`span`,{children:c})]}),(0,U.jsx)(xe,{className:`w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity`})]})}var Jn=/^\d{4}-\d{2}-\d{2}T/;function Yn(e){if(Jn.test(e))try{return{text:ye(en(e),{addSuffix:!0,locale:s()}),title:e}}catch{}return{text:e}}function Xn({localId:e}){let{t}=m(`jira`),{activeProjectId:n}=M(),r=rt(),[i,a]=(0,V.useState)(null);if((0,V.useEffect)(()=>{if(!Qe||!r.connected)return;let t=!1;return a(null),se.getSpecDetails(e).then(e=>{t||a(e)}).catch(()=>{t||a(null)}),()=>{t=!0}},[e,n,r.connected]),!Qe||!r.connected||!i)return null;let o=i.development,s=i.fields.length>0,c=o.pullRequests.length>0,l=o.branches.length>0,u=(o.commits?.length??0)>0;return!s&&!c&&!l&&!u?null:(0,U.jsxs)(`div`,{className:`space-y-4`,"data-testid":`jira-details-panel`,children:[s&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:t(`detail.detailsTitle`)}),(0,U.jsx)(`div`,{className:`space-y-1.5`,children:i.fields.map((e,t)=>{let n=Yn(e.value);return(0,U.jsxs)(`div`,{className:`text-xs`,children:[(0,U.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wide block`,children:e.label}),e.href?(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{X(e.href)},className:`inline-flex items-center gap-1 text-accent-info hover:underline text-left`,children:[(0,U.jsx)(`span`,{className:`truncate`,children:e.value}),(0,U.jsx)(y,{className:`w-3 h-3 shrink-0`})]}):(0,U.jsx)(`span`,{className:`text-foreground/80 whitespace-pre-line`,title:n.title,children:n.text})]},`${e.label}-${t}`)})})]}),(c||l||u)&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:t(`detail.developmentTitle`)}),c&&(0,U.jsxs)(`div`,{className:`mb-2`,children:[(0,U.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wide block mb-1`,children:t(`detail.dev.pullRequests`)}),(0,U.jsx)(`div`,{className:`space-y-1`,children:o.pullRequests.map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{X(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,U.jsx)(De,{className:`w-3 h-3 mt-0.5 shrink-0 text-accent-info`}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`truncate text-foreground/80 block`,children:e.title}),(0,U.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[e.status,e.sourceBranch?` · ${e.sourceBranch} → ${e.destBranch??``}`:``]})]})]},e.url))})]}),l&&(0,U.jsxs)(`div`,{className:`mb-2`,children:[(0,U.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wide block mb-1`,children:t(`detail.dev.branches`)}),(0,U.jsx)(`div`,{className:`space-y-1`,children:o.branches.map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{X(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,U.jsx)(ee,{className:`w-3 h-3 shrink-0 text-accent-info`}),(0,U.jsx)(`span`,{className:`truncate font-mono text-foreground/80`,children:e.name}),e.repo&&(0,U.jsx)(`span`,{className:`text-[10px] text-muted-foreground truncate`,children:e.repo})]},e.url))})]}),u&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wide block mb-1`,children:t(`detail.dev.commits`)}),(0,U.jsx)(`div`,{className:`space-y-1`,children:o.commits.map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{X(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,U.jsx)(Ee,{className:`w-3 h-3 shrink-0 text-accent-info`}),(0,U.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground shrink-0`,children:e.displayId}),(0,U.jsx)(`span`,{className:`truncate text-foreground/80`,children:e.message})]},e.url))})]})]})]})}var Zn=`native-browser:event`;function Qn(e){let t=(e??``).trim();if(!t)return null;if(t===`about:blank`)return t;let n=$n(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=$n(`https://${t}`);return r&&r.protocol===`https:`?r.toString():null}function $n(e){try{return new URL(e)}catch{return null}}function er(e){return{x:Math.max(0,Math.round(e.left)),y:Math.max(0,Math.round(e.top)),width:Math.max(1,Math.round(e.width)),height:Math.max(1,Math.round(e.height))}}var tr=null;async function nr(){return(await i(()=>import(`./core-B3mKBIh5.js`).then(e=>e.i),__vite__mapDeps([1,2]))).invoke}function rr(e){let t=e?.flag??K,n=e?.tauri??Zt();return!t||!n?Promise.resolve(!1):(tr||=(async()=>{try{return await(await nr())(`browser_supported`)===!0}catch{return!1}})(),tr)}async function Z(e,t){return(await nr())(e,t)}var Q={open:(e,t)=>Z(`browser_open`,{url:e,bounds:t}),navigate:e=>Z(`browser_navigate`,{url:e}),back:()=>Z(`browser_back`),forward:()=>Z(`browser_forward`),reload:()=>Z(`browser_reload`),setBounds:e=>Z(`browser_set_bounds`,{bounds:e}),show:()=>Z(`browser_show`),hide:()=>Z(`browser_hide`),close:()=>Z(`browser_close`),devtools:()=>Z(`browser_devtools`),zoom:e=>Z(`browser_zoom`,{factor:e}),onEvent:async e=>{let{listen:t}=await i(async()=>{let{listen:e}=await import(`./event-Bt7f3wXe.js`).then(e=>e.i);return{listen:e}},__vite__mapDeps([3,2,1]));return t(Zn,t=>e(t.payload))}};function ir({url:e,onClose:t,onFallback:n}){let{t:r}=m(`browser`),i=(0,V.useRef)(null),a=(0,V.useRef)(!1),[o,s]=(0,V.useState)(e),[c,l]=(0,V.useState)(e),[u,d]=(0,V.useState)(null),[f,p]=(0,V.useState)(!0),h=(0,V.useRef)(1);(0,V.useEffect)(()=>{let t=!1,r=null,o=0,c=null,u=()=>{t||(cancelAnimationFrame(o),o=requestAnimationFrame(()=>{let e=i.current?.getBoundingClientRect();e&&Q.setBounds(er(e)).catch(()=>{})}))};return(async()=>{try{if(r=await Q.onEvent(e=>{t||(e.kind===`nav`&&e.url?(l(e.url),a.current||s(e.url)):e.kind===`title`?d(e.title??null):e.kind===`load-started`?p(!0):e.kind===`load-finished`&&(p(!1),e.url&&!a.current&&s(e.url)))}),t)return;let n=i.current?.getBoundingClientRect();if(!n)throw Error(`hole not measurable`);if(await Q.open(e,er(n)),t){Q.close().catch(()=>{});return}c=new ResizeObserver(u),i.current&&c.observe(i.current),window.addEventListener(`resize`,u)}catch{t||n()}})(),()=>{t=!0,cancelAnimationFrame(o),c?.disconnect(),window.removeEventListener(`resize`,u),r?.(),Q.close().catch(()=>{})}},[]),(0,V.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]);let g=(0,V.useCallback)(()=>{let e=Qn(o);e&&(s(e),Q.navigate(e).catch(()=>{}))},[o]),v=(0,V.useCallback)(e=>{h.current=Math.min(3,Math.max(.25,e)),Q.zoom(h.current).catch(()=>{})},[]);return typeof document>`u`?null:(0,jn.createPortal)((0,U.jsx)(`div`,{className:`fixed inset-0 z-[80] bg-background-deep/60 backdrop-blur-md pointer-events-auto`,onClick:e=>{e.target===e.currentTarget&&t()},"data-testid":`native-browser-modal`,children:(0,U.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":r(`modal.dialogLabel`),onClick:e=>e.stopPropagation(),children:[(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(N,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":r(`common:actions.back`),onClick:()=>void Q.back().catch(()=>{}),children:(0,U.jsx)(_,{className:`w-4 h-4`})}),(0,U.jsx)(N,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":r(`modal.nav.forward`),onClick:()=>void Q.forward().catch(()=>{}),children:(0,U.jsx)(xe,{className:`w-4 h-4`})}),(0,U.jsx)(N,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":r(`modal.nav.reload`),onClick:()=>void Q.reload().catch(()=>{}),children:(0,U.jsx)(ke,{className:`w-4 h-4`})})]}),(0,U.jsxs)(`form`,{className:`flex-1 flex items-center gap-2 min-w-0`,onSubmit:e=>{e.preventDefault(),g()},children:[(0,U.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,U.jsx)(L,{className:`w-3.5 h-3.5 text-muted-foreground shrink-0`}),(0,U.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),onFocus:()=>{a.current=!0},onBlur:()=>{a.current=!1},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),g())},placeholder:r(`modal.address.placeholder`),"aria-label":r(`modal.address.label`),className:`flex-1 min-w-0 bg-transparent outline-none text-sm`})]}),(0,U.jsx)(N,{type:`submit`,size:`sm`,variant:`secondary`,className:`shrink-0`,children:r(`modal.address.go`)})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(N,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":r(`native.zoomOut`),title:r(`native.zoomOut`),onClick:()=>v(h.current-.1),children:(0,U.jsx)(Me,{className:`w-4 h-4`})}),(0,U.jsx)(N,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":r(`native.zoomIn`),title:r(`native.zoomIn`),onClick:()=>v(h.current+.1),children:(0,U.jsx)(je,{className:`w-4 h-4`})}),(0,U.jsx)(N,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":r(`native.devtools`),title:r(`native.devtools`),onClick:()=>void Q.devtools().catch(()=>{}),children:(0,U.jsx)(oe,{className:`w-4 h-4`})}),(0,U.jsx)(N,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":r(`native.openExternal`),title:r(`native.openExternal`),onClick:()=>void X(c),children:(0,U.jsx)(y,{className:`w-4 h-4`})}),(0,U.jsx)(N,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":r(`modal.closeBrowser`),onClick:t,children:(0,U.jsx)(ce,{className:`w-4 h-4`})})]})]}),(0,U.jsxs)(`div`,{className:`px-3 py-1 text-[11px] text-muted-foreground truncate shrink-0 flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full shrink-0 ${f?`bg-accent-warning animate-pulse`:`bg-accent-success`}`,"aria-hidden":!0}),(0,U.jsx)(`span`,{className:`truncate`,children:u||c}),(0,U.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:r(`native.badge`)})]}),(0,U.jsx)(`div`,{ref:i,className:`relative flex-1 min-h-0 overflow-hidden`,children:f&&(0,U.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm text-muted-foreground`,children:r(`modal.status.opening`)})})]})}),document.body)}function ar({open:e,url:t,projectId:n,onClose:r}){let[i,a]=(0,V.useState)(`probing`);return(0,V.useEffect)(()=>{if(!e)return;let t=!0;return rr().then(e=>{t&&a(e?`native`:`screencast`)}),()=>{t=!1}},[e]),!e||i===`probing`?null:i===`native`?(0,U.jsx)(ir,{url:t,onClose:r,onFallback:()=>a(`screencast`)}):(0,U.jsx)(or,{open:e,url:t,projectId:n,onClose:r})}function or({open:e,url:t,projectId:n,onClose:r}){let{t:i}=m(`browser`),a=Xt({projectId:n,open:e,initialUrl:t}),{canvasRef:o,viewport:s,status:c,errorMsg:l,url:u,title:d,popup:f}=a,[p,h]=(0,V.useState)(t),g=(0,V.useRef)(a.forwardInput);g.current=a.forwardInput;let v=(0,V.useRef)(null),b=(0,V.useCallback)(()=>(v.current??=Rt(e=>g.current(e)),v.current),[]);(0,V.useEffect)(()=>()=>{v.current?.dispose(),v.current=null},[]),(0,V.useEffect)(()=>{u&&h(u)},[u]),(0,V.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,r]);let x=(0,V.useCallback)((e,t)=>{let n=o.current?.getBoundingClientRect();return n?zt({x:e,y:t},{left:n.left,top:n.top,width:n.width,height:n.height},s):{x:0,y:0}},[o,s]),S=e=>e===2?`right`:e===1?`middle`:`left`,C=(0,V.useCallback)(e=>{let t=x(e.clientX,e.clientY);b().move(t.x,t.y)},[x,b]),w=(0,V.useCallback)(e=>{let t=x(e.clientX,e.clientY),n=b();n.move(t.x,t.y),n.flush(),a.forwardInput({type:`mouse`,action:`down`,x:t.x,y:t.y,button:S(e.button),clickCount:e.detail||1})},[x,a,b]),T=(0,V.useCallback)(e=>{let t=x(e.clientX,e.clientY),n=b();n.move(t.x,t.y),n.flush(),a.forwardInput({type:`mouse`,action:`up`,x:t.x,y:t.y,button:S(e.button),clickCount:e.detail||1})},[x,a,b]),ee=(0,V.useCallback)(e=>{let t=x(e.clientX,e.clientY);b().wheel(t.x,t.y,e.deltaX,e.deltaY)},[x,b]),te=(0,V.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]),ne=(0,V.useCallback)(e=>{e.key!==`Escape`&&a.forwardInput({type:`key`,action:`up`,key:e.key,code:e.code})},[a]),E=(0,V.useCallback)(()=>{a.navigate(`goto`,p)},[a,p]);return!e||typeof document>`u`?null:(0,jn.createPortal)((0,U.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,U.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,U.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,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(N,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":i(`common:actions.back`),onClick:()=>a.navigate(`back`),children:(0,U.jsx)(_,{className:`w-4 h-4`})}),(0,U.jsx)(N,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":i(`modal.nav.forward`),onClick:()=>a.navigate(`forward`),children:(0,U.jsx)(xe,{className:`w-4 h-4`})}),(0,U.jsx)(N,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":i(`modal.nav.reload`),onClick:()=>a.navigate(`reload`),children:(0,U.jsx)(ke,{className:`w-4 h-4`})})]}),(0,U.jsxs)(`form`,{className:`flex-1 flex items-center gap-2 min-w-0`,onSubmit:e=>{e.preventDefault(),E()},children:[(0,U.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,U.jsx)(L,{className:`w-3.5 h-3.5 text-muted-foreground shrink-0`}),(0,U.jsx)(`input`,{value:p,onChange:e=>h(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),E())},placeholder:i(`modal.address.placeholder`),"aria-label":i(`modal.address.label`),className:`flex-1 min-w-0 bg-transparent outline-none text-sm`})]}),(0,U.jsx)(N,{type:`submit`,size:`sm`,variant:`secondary`,className:`shrink-0`,disabled:c===`error`,children:i(`modal.address.go`)})]}),(0,U.jsx)(N,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":i(`modal.closeBrowser`),onClick:r,children:(0,U.jsx)(ce,{className:`w-4 h-4`})})]}),(0,U.jsxs)(`div`,{className:`px-3 py-1 text-[11px] text-muted-foreground truncate shrink-0 flex items-center gap-2`,children:[(0,U.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,U.jsx)(`span`,{className:`truncate`,children:c===`connecting`?i(`modal.status.connecting`):c===`error`?l??i(`modal.status.unavailable`):d||``})]}),f&&(0,U.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,U.jsx)(y,{className:`w-3.5 h-3.5 shrink-0`}),f.active?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`truncate font-medium`,children:i(`popup.loginWindow`,{origin:Pt(f.url)})}),f.count>1&&(0,U.jsx)(`span`,{className:`shrink-0 opacity-70`,children:i(`popup.stacked`,{count:f.count-1})}),(0,U.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,U.jsx)(_,{className:`w-3 h-3`}),i(`popup.backToPage`)]})]}):(0,U.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,U.jsx)(`span`,{className:`opacity-70`,children:i(`popup.stacked`,{count:f.count-1})})]})]}),(0,U.jsx)(`div`,{className:`relative flex-1 min-h-0 overflow-hidden flex items-center justify-center outline-none`,tabIndex:0,onKeyDown:te,onKeyUp:ne,children:c===`error`?(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center max-w-md px-6`,children:[(0,U.jsx)(D,{className:`w-8 h-8 text-accent-warning`}),(0,U.jsx)(`p`,{className:`text-sm text-foreground/90`,children:l??i(`modal.error.unavailable`)})]}):(0,U.jsx)(`canvas`,{ref:o,className:`max-w-full max-h-full block shadow-2xl cursor-default`,onPointerMove:C,onPointerDown:w,onPointerUp:T,onContextMenu:e=>e.preventDefault(),onWheel:ee})})]})}),document.body)}var sr=(0,V.createContext)(null);function cr({children:e}){let{activeProjectId:t}=M(),[n,r]=(0,V.useState)(null),i=(0,V.useCallback)(e=>r(e),[]),a=xt();return(0,U.jsxs)(sr.Provider,{value:{openWebView:i,canOpenWebView:a&&!!t},children:[e,a&&n&&t&&(0,U.jsx)(ar,{open:!0,url:n,projectId:t,onClose:()=>r(null)})]})}function lr(){return(0,V.useContext)(sr)??{openWebView:()=>{},canOpenWebView:!1}}var ur={analyzing:`activity:smash.stage.analyzing`,identifying:`activity:smash.stage.identifying`,ordering:`activity:smash.stage.ordering`},dr=(0,V.createContext)(null);function $(e){return`smash:${e}`}async function fr(e,t){try{let n=await fetch(`${k}/api/projects/${e}/tickets/${t}/smash`,{method:`POST`});if(n.ok)g.loading(u.t(`activity:smash.retrying`),{id:$(t)});else{let e=await n.json().catch(()=>({}));g.error(e.reason?u.t(`activity:smash.couldNotRetryWithReason`,{reason:e.reason}):u.t(`activity:smash.couldNotRetry`),{id:$(t)})}}catch(e){g.error(u.t(`activity:smash.retryFailed`,{message:e.message}),{id:$(t)})}}async function pr(e,t,n){try{let r=await fetch(`${k}/api/projects/${e}/tickets/${t}/smash/undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({smashedAt:n})});if(r.ok)g.success(u.t(`activity:smash.undone`),{id:$(t),duration:3e3});else{let e=await r.json().catch(()=>({}));g.error(e.reason?u.t(`activity:smash.undoFailedWithReason`,{reason:e.reason}):u.t(`activity:smash.undoFailed`),{id:$(t)})}}catch(e){g.error(u.t(`activity:smash.undoFailedWithReason`,{reason:e.message}),{id:$(t)})}}function mr({children:e}){let{registerHandler:t,unregisterHandler:n}=f(),[r,i]=(0,V.useState)({}),a=(0,V.useRef)(new Map),o=(0,V.useRef)(new Map),s=(0,V.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}})),g.loading(u.t(ur.analyzing),{id:$(n),description:c?u.t(`activity:smash.onTitled`,{title:c}):u.t(`activity:smash.onThisSpec`)}))},[]),c=(0,V.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}),g.loading(u.t(ur[r]),{id:$(n),description:a?u.t(`activity:smash.onTitled`,{title:a}):u.t(`activity:smash.onThisSpec`)})},[]),l=(0,V.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}),g.success(u.t(`activity:smash.split`,{count:c.length}),{id:$(n),duration:1e4,action:{label:u.t(`activity:smash.undoAction`),onClick:()=>void pr(a,n,s)}}))},[]),d=(0,V.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`?u.t(`activity:smash.failReason.invalidOutput`):o===`timeout`?u.t(`activity:smash.failReason.timeout`):o===`model_error`?u.t(`activity:smash.failReason.modelError`):o===`crashed`?u.t(`activity:smash.failReason.crashed`):u.t(`activity:smash.failReason.generic`,{reason:o});g.error(u.t(`activity:smash.couldNotComplete`),{id:$(n),description:s,action:{label:u.t(`common:actions.retry`),onClick:()=>void fr(r,n)},duration:15e3})},[]),p=(0,V.useCallback)(e=>{let t=e;if(!t||t.type!==`smash.undone`)return;let n=t.ticketId;typeof n==`number`&&(g.dismiss($(n)),g.success(u.t(`activity:smash.undone`),{id:$(n),duration:3e3}))},[]);(0,V.useLayoutEffect)(()=>(t(`_smash_started`,s),t(`_smash_progress`,c),t(`_smash_completed`,l),t(`_smash_failed`,d),t(`_smash_undone`,p),()=>{n(`_smash_started`),n(`_smash_progress`),n(`_smash_completed`),n(`_smash_failed`),n(`_smash_undone`)}),[t,n,s,c,l,d,p]),(0,V.useEffect)(()=>()=>{a.current.clear(),o.current.clear()},[]);let m=(0,V.useMemo)(()=>({inflight:r}),[r]);return(0,U.jsx)(dr.Provider,{value:m,children:e})}function hr(e){let t=(0,V.useContext)(dr);return!t||e==null?null:t.inflight[e]??null}var gr=150,_r={analyzing:0,identifying:1,ordering:2},vr={analyzing:`smash.stage.analyzing`,identifying:`smash.stage.identifying`,ordering:`smash.stage.ordering`};function yr({stage:e,minDisplayMs:t=gr}){let{t:n}=m(`activity`),[r,i]=(0,V.useState)(e),a=(0,V.useRef)(Date.now()),o=(0,V.useRef)(null);if((0,V.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=_r[r];return(0,U.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,U.jsx)(te,{className:`h-4 w-4 animate-spin text-accent-highlight`,"aria-hidden":!0}),(0,U.jsx)(`div`,{className:`flex items-center gap-1.5`,children:[`analyzing`,`identifying`,`ordering`].map(e=>(0,U.jsx)(`span`,{className:[`inline-block w-1.5 h-1.5 rounded-full transition-all`,_r[e]<=s?`bg-accent-highlight`:`bg-muted`,e===r?`scale-125`:`scale-100`].join(` `),"aria-hidden":!0},e))}),(0,U.jsx)(`span`,{className:`font-medium`,children:n(vr[r])})]})}var br={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 xr({open:e,ticketTitle:t,isReSmash:n,childrenCount:r,submitting:i=!1,onCancel:a,onConfirm:o}){let{t:s}=m(`activity`),[c,l]=(0,V.useState)(`simple`),{panelRef:u,panelStyle:d,headerHandleProps:f,resizeHandles:h,isFloating:g,guardBackdrop:_}=ue();return e?(0,jn.createPortal)((0,U.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,U.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-sm`,onClick:_(a)}),(0,U.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,U.jsxs)(`div`,{...f,className:`flex items-start justify-between gap-3 px-5 py-4 border-b border-border/30 ${g?`cursor-grab active:cursor-grabbing`:``}`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-2 min-w-0`,children:[(0,U.jsx)(Ae,{className:`w-5 h-5 text-accent-highlight shrink-0 mt-0.5`,"aria-hidden":!0}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:s(`smashModal.title`)}),(0,U.jsx)(`p`,{className:`text-[11px] text-muted-foreground truncate`,title:t,children:t})]})]}),(0,U.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,U.jsx)(ce,{className:`w-4 h-4`})})]}),n&&r>0&&(0,U.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,U.jsx)(p,{t:s,i18nKey:`smashModal.reSmashWarning`,count:r})}),(0,U.jsxs)(`div`,{className:`px-5 py-4 space-y-3`,children:[(0,U.jsx)(`p`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium`,children:s(`smashModal.modePickerLabel`)}),[`simple`,`full`].map(e=>{let t=br[e],n=c===e;return(0,U.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,U.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,U.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,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-1`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm font-semibold text-foreground`,children:[e===`full`&&(0,U.jsx)(O,{className:`w-3.5 h-3.5 text-accent-highlight`,"aria-hidden":!0}),s(t.titleKey)]}),(0,U.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:s(t.etaKey)})]}),(0,U.jsx)(`ul`,{className:`space-y-0.5`,children:t.bulletKeys.map(e=>(0,U.jsxs)(`li`,{className:`text-[11px] text-foreground/70 leading-snug`,children:[`• `,s(e)]},e))})]})]})},e)})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-border/30 bg-surface/20`,children:[(0,U.jsx)(N,{variant:`ghost`,size:`sm`,onClick:a,disabled:i,children:s(`common:actions.cancel`)}),(0,U.jsxs)(N,{size:`sm`,onClick:()=>o(c),disabled:i,"data-testid":`smash-confirm-modal-continue`,children:[(0,U.jsx)(Ae,{className:`w-3.5 h-3.5 mr-1.5`}),s(i?`smashModal.starting`:n?`smashModal.confirmReSmash`:`smashModal.smash`)]})]})]}),(0,U.jsx)(he,{handles:h})]}),document.body):null}var Sr=`## Contract Layer`;function Cr(e,t){return!(!t||e.status===`draft`||e.parent_epic_id!=null||!e.description?.includes(Sr))}function wr({ticket:e,projectId:t,provider:n,featureFlagOn:r,childrenCount:i}){let{t:a}=m(`activity`),o=hr(e.id),[s,c]=(0,V.useState)(!1),[l,u]=(0,V.useState)(!1),[d,f]=(0,V.useState)(e.origin_conversation_id?void 0:null);(0,V.useEffect)(()=>{let r=e.origin_conversation_id;if(!r){f(null);return}let i=!1;return f(void 0),fetch(`${k}/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||f(t.conversation?.provider??n??null)}).catch(()=>{i||f(null)}),()=>{i=!0}},[t,n,e.origin_conversation_id]);let p=e.origin_conversation_id?d:n,h=r&&_e(p),_=e.is_epic===!0,v=!_&&Cr(e,h),y=_&&h,b=_&&i>0,x=(0,V.useCallback)(async n=>{if(h){u(!0);try{let r=await fetch(`${k}/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(()=>({}));g.error(e.reason?a(`smash.couldNotStartWithReason`,{reason:e.reason}):a(`smash.couldNotStart`));return}c(!1)}catch(e){g.error(a(`smash.smashFailed`,{message:e.message}))}finally{u(!1)}}},[t,e.id,a,h]),S=(0,V.useCallback)(async n=>{if(h){if(b){u(!0);try{if(!(await fetch(`${k}/api/projects/${t}/tickets/${e.id}/children`,{method:`DELETE`})).ok){g.error(a(`smash.couldNotDeleteChildren`)),u(!1);return}}catch(e){g.error(a(`smash.deleteFailed`,{message:e.message})),u(!1);return}}await x(n)}},[b,x,t,e.id,a,h]);return!v&&!y?null:o?(0,U.jsx)(`div`,{className:`flex flex-col gap-2`,"data-testid":`smash-actions-streaming`,children:(0,U.jsx)(yr,{stage:o.stage})}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(N,{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,U.jsx)(Ae,{className:`w-3.5 h-3.5 mr-1.5`}),a(y?`smash.reSmashButton`:`smash.smashButton`)]}),(0,U.jsx)(xr,{open:s,ticketTitle:e.title,isReSmash:b,childrenCount:i,submitting:l,onCancel:()=>c(!1),onConfirm:S})]})}function Tr({epic:e,childExecutionOrder:t,totalChildren:n,onOpenEpic:r}){let{t:i}=m(`activity`);return(0,U.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,U.jsxs)(`button`,{type:`button`,onClick:r,className:`text-accent-secondary hover:underline font-medium`,children:[`← `,e.title]}),t!=null&&n>0&&(0,U.jsx)(`span`,{className:`text-foreground/60`,children:i(`epicChildren.step`,{order:t,total:n})})]})}var Er={critical:`bg-red-400`,high:`bg-orange-400`,medium:`bg-yellow-400`,low:`bg-slate-400`};function Dr(e){return e?Er[e]:`bg-muted`}function Or(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 kr({ticket:e,allTickets:t,onOpenTicket:n}){let{t:r}=m(`activity`),i=e.is_epic===!0,a=e.parent_epic_id!=null;if(!i&&!a)return null;if(i){let i=Or(t.filter(t=>t.parent_epic_id===e.id));return(0,U.jsx)(Ar,{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=Or(t.filter(t=>t.parent_epic_id===e.parent_epic_id)),c=o?[o,...s]:s;return(0,U.jsx)(Ar,{header:r(`family.familyHeader`,{count:s.length}),rows:c,currentId:e.id,onOpenTicket:n,emptyMessage:r(`family.noSiblings`)})}function Ar({header:e,rows:t,currentId:n,onOpenTicket:r,emptyMessage:i}){let{t:a}=m(`activity`);return(0,U.jsxs)(`div`,{"data-testid":`epic-family-sidebar`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 mb-1.5`,children:[(0,U.jsx)(Ae,{className:`w-3 h-3 text-accent-highlight`,"aria-hidden":!0}),(0,U.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider`,children:e})]}),t.length===0?(0,U.jsx)(`p`,{className:`text-[10px] text-foreground/50 italic`,children:i}):(0,U.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,U.jsx)(`li`,{children:(0,U.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,U.jsx)(x,{className:`w-3 h-3 text-accent-highlight flex-shrink-0`,"aria-hidden":!0}):(0,U.jsx)(`span`,{className:`text-[9px] tabular-nums text-foreground/40 w-3 text-center flex-shrink-0`,children:e.execution_order??`–`}),(0,U.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full flex-shrink-0 ${Dr(e.priority)}`,"aria-hidden":!0}),(0,U.jsx)(`span`,{className:`text-[11px] truncate ${t?`text-foreground font-medium`:`text-foreground/80`}`,title:e.title,children:e.title})]})},e.id)})})]})}var jr=900,Mr=.2,Nr=[`todo`,`in_progress`,`done`,`cancelled`],Pr={draft:`ticketStatus.draft`,todo:`ticketStatus.todo`,in_progress:`ticketStatus.inProgress`,on_review:`ticketStatus.onReview`,done:`ticketStatus.done`,cancelled:`ticketStatus.cancelled`},Fr=[{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 Ir(e){return e.jira_epic_key&&e.jira_url?e.jira_url.replace(/\/browse\/[^/]+$/,`/browse/${e.jira_epic_key}`):null}var Lr={manual:`source.manual`,"product-backlog":`source.productBacklog`,"propose-spec":`source.proposeSpec`,"get-backlog-specs":`source.getBacklogSpecs`,"free-prompt":`source.freePrompt`};function Rr({ticket:e,allLabels:t,allTickets:n,onClose:r,onOpenTicket:i,onSave:a,onDelete:o,rails:s,onMoveToRail:c,onRemoveFromRail:l,embedded:u=!1}){let{t:d}=m(`tickets`),{t:f}=m(`jira`),{activeProjectId:h,projects:_}=M(),{enterSplit:b,state:x}=Wn(),S=x.originSide!==null,C=_.find(e=>e.id===h)?.provider,T=_e(C),ee=(0,V.useMemo)(()=>(n??[]).filter(t=>t.parent_epic_id===e.id),[n,e.id]),E=(0,V.useMemo)(()=>e.parent_epic_id==null?null:(n??[]).find(t=>t.id===e.parent_epic_id)??null,[n,e.parent_epic_id]),ie=(0,V.useMemo)(()=>E?(n??[]).filter(e=>e.parent_epic_id===E.id).length:0,[n,E]),[D,oe]=(0,V.useState)(e.title),[O,k]=(0,V.useState)(e.description),[A,j]=(0,V.useState)(e.priority??`medium`),[P,ve]=(0,V.useState)([...e.labels??[]]),[F,ye]=(0,V.useState)(!1),[be,Se]=(0,V.useState)(!1),[I,we]=(0,V.useState)(``),[Te,Ee]=(0,V.useState)(!1),[De,L]=(0,V.useState)(!1),[Oe,ke]=(0,V.useState)(!1),[Ae,R]=(0,V.useState)(!1),[je,Me]=(0,V.useState)(!1),[z,Ne]=(0,V.useState)(!1),B=rt(),Pe=B.connected&&!!B.discardStatus&&e.source===`jira`&&!!e.jira_key,Fe=B.connected&&e.source===`jira`&&!!e.jira_key,[Ie,Le]=(0,V.useState)(e.attachments??[]);(0,V.useEffect)(()=>{Le(e.attachments??[])},[e.attachments,e.id]);let[H,Re]=(0,V.useState)(!1),[ze,Be]=(0,V.useState)(null);(0,V.useEffect)(()=>{if(!Fe)return;let e=!0;return se.listStatuses().then(t=>{e&&Be(t.statuses)}).catch(()=>{e&&Be([])}),()=>{e=!1}},[Fe,e.id]);let W=e.jira_status??``,Ve=async t=>{if(t!==e.status){Re(!0);try{await a(e.id,{status:t})}finally{Re(!1)}}},He=async t=>{if(!(!t||t===W)){Re(!0);try{await se.moveSpecToStatus(e.id,t),g.success(f(`moveToStatus.queued`,{status:t}))}catch{g.error(f(`moveToStatus.failed`))}finally{Re(!1)}}},Ue=(0,V.useRef)(null),We=(0,V.useRef)(null),Ge=(0,V.useRef)(null),Ke=(0,V.useMemo)(()=>D!==e.title||O!==e.description||A!==e.priority||JSON.stringify(P)!==JSON.stringify(e.labels),[D,O,A,P,e]);(0,V.useEffect)(()=>{F&&Ue.current?.focus()},[F]),(0,V.useEffect)(()=>{if(be){let e=We.current;e&&(e.focus(),e.selectionStart=e.value.length)}},[be]),(0,V.useEffect)(()=>{Te&&Ge.current?.focus()},[Te]),(0,V.useEffect)(()=>{function e(e){e.key===`Escape`&&!F&&!be&&!De&&r()}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r,F,be,De]);let qe=(0,V.useMemo)(()=>{if(!I.trim())return[];let e=I.toLowerCase();return t.filter(t=>t.toLowerCase().includes(e)&&!P.includes(t)).slice(0,5)},[I,t,P]),Je=(0,V.useCallback)(e=>{let t=e.trim();t&&!P.includes(t)&&ve(e=>[...e,t]),we(``)},[P]),Ye=(0,V.useCallback)(e=>{ve(t=>t.filter(t=>t!==e))},[]),Xe=(0,V.useCallback)(async()=>{let t={};if(D!==e.title&&(t.title=D),O!==e.description&&(t.description=O),A!==e.priority&&(t.priority=A),JSON.stringify(P)!==JSON.stringify(e.labels)&&(t.labels=P),Object.keys(t).length===0){r();return}Me(!0);let n=await a(e.id,t);Me(!1),n?(g.success(d(`detailModal.toast.updated`)),r()):g.error(d(`detailModal.toast.updateFailed`))},[D,O,A,P,e,a,r,d]),Ze=(0,V.useCallback)(async()=>{if(z)return;Ne(!0);let t=!1;try{t=await o(e.id)}catch{t=!1}if(Ne(!1),!t){g.error(d(`detailModal.toast.deleteFailed`));return}L(!1),r()},[z,e.id,o,r,d]),[Qe,$e]=(0,V.useState)(0),G=(0,V.useRef)(null),[et,tt]=(0,V.useState)(()=>typeof window<`u`&&window.innerWidth>=jr);(0,V.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>tt(window.innerWidth>=jr);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let K=!u&&!S&&et,q=(0,V.useCallback)(e=>{G.current&&$e(e.clientX-G.current.startX)},[]),J=(0,V.useCallback)(t=>{if(!G.current)return;let n=t.clientX-G.current.startX,i=window.innerWidth*Mr;if(window.removeEventListener(`pointermove`,q),window.removeEventListener(`pointerup`,J),window.removeEventListener(`pointercancel`,J),G.current=null,$e(0),Math.abs(n)>=i&&window.innerWidth>=jr){let t=x.leftId===e.id;b(n<0?`left`:`right`,e.id),t||r()}},[b,q,x.leftId,e.id,r]),nt=(0,V.useCallback)(e=>{K&&e.button===0&&(e.target.closest(`button, input, textarea, select, [contenteditable="true"]`)||(G.current={startX:e.clientX,pointerId:e.pointerId},window.addEventListener(`pointermove`,q),window.addEventListener(`pointerup`,J),window.addEventListener(`pointercancel`,J)))},[K,q,J]);(0,V.useEffect)(()=>()=>{G.current&&(window.removeEventListener(`pointermove`,q),window.removeEventListener(`pointerup`,J),window.removeEventListener(`pointercancel`,J))},[q,J]);let at=(0,V.useCallback)(()=>{if(!K||window.innerWidth<jr)return;let t=x.leftId===e.id;b(`right`,e.id),t||r()},[K,b,x.leftId,e.id,r]),{panelRef:ot,panelStyle:ct,resizeHandles:lt,guardBackdrop:ut}=ue({enabled:!u,allowMove:!1}),dt=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{ref:ot,className:u?`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]`,style:{...Qe===0?{transition:`transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1)`}:{transform:`translateX(${Qe}px)`,transition:`none`},...ct},children:[E&&(0,U.jsx)(`div`,{className:`px-5 pt-3`,children:(0,U.jsx)(Tr,{epic:E,childExecutionOrder:e.execution_order??null,totalChildren:ie,onOpenEpic:()=>i?.(E.id)})}),(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3 px-5 py-4 border-b border-border/30 ${K?`cursor-grab active:cursor-grabbing`:``}`,onPointerDown:nt,"data-testid":`ticket-modal-header`,children:[(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[F?(0,U.jsx)(`input`,{ref:Ue,value:D,onChange:e=>oe(e.target.value),onBlur:()=>ye(!1),onKeyDown:t=>{t.key===`Enter`&&ye(!1),t.key===`Escape`&&(oe(e.title),ye(!1))},className:`w-full bg-transparent border-b border-accent-primary/50 text-sm font-semibold text-foreground outline-none pb-0.5`}):(0,U.jsxs)(`button`,{type:`button`,onClick:()=>ye(!0),className:`group flex items-center gap-1.5 text-left w-full`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-foreground truncate`,children:D||d(`untitled`)}),(0,U.jsx)(ne,{className:`w-3 h-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5`,children:[(0,U.jsxs)(`span`,{className:`text-[10px] text-foreground font-mono`,children:[`#`,e.id]}),e.status===`on_review`&&(0,U.jsx)(`span`,{title:d(`specs:status.onReviewHint`),"data-testid":`ticket-modal-on-review-badge`,children:(0,U.jsx)(st,{status:`on_review`})})]}),(0,U.jsx)(qn,{ticketId:e.id})]}),h&&(0,U.jsx)(`div`,{className:`shrink-0`,children:(0,U.jsx)(wr,{ticket:e,projectId:h,provider:C,featureFlagOn:T,childrenCount:ee.length})}),(0,U.jsx)(Br,{ticket:e,title:D,description:O,priority:A,labels:P,onClose:r}),s&&(c||l)&&(0,U.jsx)(Vr,{ticket:e,rails:s,onMoveToRail:c,onRemoveFromRail:l}),K&&(0,U.jsxs)(N,{variant:`outline`,size:`sm`,className:`shrink-0 mr-1 gap-1.5`,"data-testid":`ticket-modal-compare`,onClick:at,title:d(`detailModal.compareTooltip`),children:[(0,U.jsx)(Ce,{className:`w-3.5 h-3.5`}),d(`detailModal.compare`)]}),(0,U.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,U.jsx)(ce,{className:`w-4 h-4`})})]}),(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto min-h-0`,children:(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row h-full`,children:[(0,U.jsxs)(`div`,{className:`flex-1 min-w-0 px-5 py-4 space-y-4 flex flex-col`,children:[(0,U.jsxs)(`div`,{className:`flex-1 flex flex-col`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5`,children:[(0,U.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider flex items-center gap-1.5`,children:d(`fields.description`)}),!be&&(0,U.jsxs)(`button`,{type:`button`,onClick:()=>Se(!0),className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1`,children:[(0,U.jsx)(ne,{className:`w-2.5 h-2.5`}),d(`common:actions.edit`)]})]}),be?(0,U.jsxs)(`div`,{className:`space-y-1.5 flex-1 flex flex-col`,children:[(0,U.jsx)(`textarea`,{ref:We,value:O,onChange:e=>k(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:d(`fields.markdownPlaceholder`)}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(N,{variant:`ghost`,size:`sm`,className:`h-6 text-[10px]`,onClick:()=>Se(!1),children:d(`detailModal.doneEditing`)}),(0,U.jsx)(`span`,{className:`text-[9px] text-muted-foreground`,children:d(`fields.supportsMarkdown`)})]})]}):O?(0,U.jsx)(Gr,{description:O,onEdit:()=>Se(!0)}):(0,U.jsx)(`button`,{type:`button`,onClick:()=>Se(!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:d(`detailModal.addDescription`)})]}),(0,U.jsx)(En,{ticketKey:e.id,attachments:Ie,onChange:Le}),(0,U.jsx)(Dn,{ticketId:e.id,onClose:r}),e.prerequisites&&e.prerequisites.length>0&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:d(`detailModal.prerequisites`)}),(0,U.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.prerequisites.map(e=>(0,U.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,U.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,U.jsxs)(`button`,{type:`button`,onClick:()=>{X(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,U.jsx)(y,{className:`w-3.5 h-3.5 shrink-0`}),f(`detail.goToTicket`,{key:e.jira_key})]}),e.jira_epic_key&&(0,U.jsxs)(`div`,{"data-testid":`jira-epic`,children:[(0,U.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:f(`detail.epic`)}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{let t=Ir(e);t&&X(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,U.jsx)(`span`,{className:`font-mono text-accent-highlight shrink-0`,children:e.jira_epic_key}),e.jira_epic_name&&(0,U.jsx)(`span`,{className:`truncate text-foreground/80`,children:e.jira_epic_name})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:d(`fields.status`)}),Fe?(0,U.jsx)(`select`,{value:W,disabled:H||ze===null,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-jira-status-select`,children:ze===null?(0,U.jsx)(`option`,{value:W,children:W||d(`states.loading`,{ns:`common`})}):(0,U.jsxs)(U.Fragment,{children:[W&&!ze.some(e=>e.name===W)&&(0,U.jsx)(`option`,{value:W,children:W}),ze.map(e=>(0,U.jsx)(`option`,{value:e.name,children:e.name},e.name))]})}):(0,U.jsxs)(`select`,{value:e.status,disabled:H,onChange:e=>{Ve(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:[!Nr.includes(e.status)&&(0,U.jsx)(`option`,{value:e.status,children:d(Pr[e.status],{ns:`tickets`})}),Nr.map(e=>(0,U.jsx)(`option`,{value:e,children:d(Pr[e],{ns:`tickets`})},e))]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:d(`fields.priority`)}),(0,U.jsx)(`select`,{value:A,onChange:e=>j(e.target.value),className:`w-full h-7 rounded border border-border bg-input px-2 text-xs text-foreground`,children:Fr.map(e=>(0,U.jsx)(`option`,{value:e.value,children:d(e.labelKey)},e.value))})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-1.5`,children:d(`fields.labels`)}),(0,U.jsx)(`div`,{className:`flex flex-wrap gap-1 mb-1.5`,children:P.map(e=>(0,U.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,U.jsx)(`button`,{type:`button`,onClick:()=>Ye(e),className:`text-muted-foreground hover:text-foreground opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,U.jsx)(w,{className:`w-2.5 h-2.5`})})]},e))}),Te?(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(`input`,{ref:Ge,value:I,onChange:e=>we(e.target.value),onKeyDown:e=>{e.key===`Enter`&&I.trim()&&(e.preventDefault(),Je(I)),e.key===`Escape`&&(Ee(!1),we(``))},onBlur:()=>{I.trim()&&Je(I),Ee(!1),we(``)},placeholder:d(`detailModal.addLabelPlaceholder`),className:`w-full h-6 rounded border border-border bg-input px-2 text-[10px] text-foreground placeholder:text-muted-foreground`}),qe.length>0&&(0,U.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:qe.map(e=>(0,U.jsx)(`button`,{type:`button`,onMouseDown:t=>{t.preventDefault(),Je(e)},className:`w-full text-left px-2 py-1 text-[10px] hover:bg-accent/50 text-foreground/80`,children:e},e))})]}):(0,U.jsxs)(`button`,{type:`button`,onClick:()=>Ee(!0),className:`flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors`,children:[(0,U.jsx)(re,{className:`w-2.5 h-2.5`}),d(`detailModal.addLabel`)]})]}),(0,U.jsx)(kr,{ticket:e,allTickets:n??[],onOpenTicket:e=>i?.(e)}),e.source===`jira`&&e.jira_key&&(0,U.jsx)(Xn,{localId:e.id}),e.metadata?.effort_level&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-0.5`,children:d(`detailModal.effort`)}),(0,U.jsx)(`span`,{className:`text-xs text-foreground/70`,children:e.metadata.effort_level})]}),e.assignee&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider block mb-0.5`,children:d(`detailModal.assignee`)}),(0,U.jsx)(`span`,{className:`text-xs text-foreground/70`,children:e.assignee})]})]})]})}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-3 border-t border-border/30`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] text-muted-foreground`,children:[(0,U.jsx)(`span`,{children:d(`meta.createdAgo`,{time:zr(e.created_at)})}),(0,U.jsx)(`span`,{children:d(`meta.updatedAgo`,{time:zr(e.updated_at)})}),e.source&&(0,U.jsx)(`span`,{className:`bg-muted/30 rounded px-1.5 py-0.5`,children:Lr[e.source]?d(Lr[e.source]):e.source})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[Pe?(0,U.jsxs)(N,{variant:`ghost`,size:`sm`,className:`h-7 text-xs text-accent-info hover:bg-accent-info/10`,onClick:()=>ke(!0),"data-testid":`jira-move-to-button`,children:[(0,U.jsx)(xe,{className:`w-3 h-3 mr-1`}),f(`discard.moveButton`,{status:B.discardStatus})]}):(0,U.jsxs)(N,{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:()=>L(!0),children:[(0,U.jsx)(ae,{className:`w-3 h-3 mr-1`}),d(`common:actions.delete`)]}),Ke&&(0,U.jsxs)(N,{size:`sm`,className:`h-7 text-xs`,onClick:()=>{Fe?R(!0):Xe()},disabled:je||!D.trim(),children:[(0,U.jsx)(v,{className:`w-3 h-3 mr-1`}),d(je?`common:states.saving`:`common:actions.save`)]})]})]})]}),(0,U.jsx)(ge,{open:De,onOpenChange:e=>{z||L(e)},children:(0,U.jsxs)(fe,{className:`max-w-sm`,children:[(0,U.jsxs)(le,{children:[(0,U.jsx)(pe,{children:d(`deleteDialog.title`)}),(0,U.jsx)(me,{children:(0,U.jsx)(p,{t:d,i18nKey:`deleteDialog.body`,values:{id:e.id,title:e.title},components:{strong:(0,U.jsx)(`span`,{className:`font-semibold text-foreground`})}})})]}),(0,U.jsxs)(de,{children:[(0,U.jsx)(N,{variant:`outline`,size:`sm`,onClick:()=>L(!1),disabled:z,children:d(`common:actions.cancel`)}),(0,U.jsxs)(N,{variant:`destructive`,size:`sm`,onClick:()=>{Ze()},disabled:z,"aria-busy":z,children:[z?(0,U.jsx)(te,{className:`w-3.5 h-3.5 mr-1.5 animate-spin`}):(0,U.jsx)(ae,{className:`w-3.5 h-3.5 mr-1.5`}),d(`common:actions.delete`)]})]})]})}),Pe&&B.discardStatus&&(0,U.jsx)(it,{open:Oe,onOpenChange:ke,ticket:{id:e.id,title:e.title,jira_key:e.jira_key},discardStatus:B.discardStatus,onDiscarded:r}),(0,U.jsx)(ge,{open:Ae,onOpenChange:R,children:(0,U.jsxs)(fe,{className:`max-w-md`,"data-testid":`jira-save-confirm`,children:[(0,U.jsxs)(le,{children:[(0,U.jsx)(pe,{children:f(`detail.saveTitle`)}),(0,U.jsx)(me,{children:f(`detail.saveBody`,{key:e.jira_key??`#${e.id}`})})]}),(0,U.jsxs)(de,{children:[(0,U.jsx)(N,{variant:`outline`,size:`sm`,onClick:()=>R(!1),children:d(`common:actions.cancel`)}),(0,U.jsxs)(N,{size:`sm`,onClick:()=>{R(!1),Xe()},disabled:je,"data-testid":`jira-save-confirm-btn`,children:[(0,U.jsx)(v,{className:`w-3.5 h-3.5 mr-1.5`}),f(`detail.saveConfirm`)]})]})]})})]});return u?dt:(0,jn.createPortal)((0,U.jsxs)(`div`,{className:`fixed inset-0 z-[68] flex items-center justify-center`,children:[(0,U.jsx)(`div`,{className:`absolute inset-0 bg-black/70`,onClick:ut(r)}),dt,(0,U.jsx)(he,{handles:lt})]}),document.body)}function zr(e){try{return ye(new Date(e),{addSuffix:!0,locale:s()})}catch{return e}}function Br({ticket:e,title:t,description:n,priority:r,labels:i,onClose:a}){let{t:o}=m(`tickets`),{triggerResume:s}=S(),{activeProjectId:c}=M(),{closeTicketDetail:l}=Wn();return qe(e)?(0,U.jsxs)(N,{variant:`default`,size:`sm`,onClick:()=>{if(!c)return;let{body:u,criteria:d}=Ge(n);s({kind:`explore-spec`,projectId:c,label:t||e.title||o(`detailModal.ticketFallbackLabel`,{id:e.id}),restoreRoute:`/`,params:{initialIdea:``,pendingSpecId:Je(),initialAttachmentIds:[],resumeConversationId:e.origin_conversation_id??void 0,editTicket:{id:e.id,title:t,description:u,labels:i,priority:r,acceptanceCriteria:d,status:e.status}}}),l(),a()},className:`shrink-0 mr-2`,"data-testid":`continue-editing`,children:[(0,U.jsx)(Oe,{className:`w-3.5 h-3.5 mr-1.5`}),o(`detailModal.continueEditing`)]}):null}function Vr({ticket:e,rails:t,onMoveToRail:n,onRemoveFromRail:r}){let{t:i}=m(`tickets`),[a,o]=(0,V.useState)(null),s=(0,V.useRef)(null),c=t.find(t=>t.ticketIds.includes(e.id));return c?r?(0,U.jsxs)(N,{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,U.jsx)(_,{className:`w-3.5 h-3.5`,"aria-hidden":!0}),i(`rail.removeFromRail`)]}):null:n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(N,{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,U.jsx)(xe,{className:`w-3.5 h-3.5`,"aria-hidden":!0})]}),a&&(0,U.jsx)(Ue,{rails:t,anchorRect:a,onMoveToRail:t=>n(e.id,t),onClose:()=>o(null)})]}):null}var Hr=`
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## Contract Layer
|
|
13
|
-
|
|
14
|
-
`;function Ur(e){let t=e.indexOf(Hr);return t<0?{user:e,contract:null}:{user:e.slice(0,t),contract:e.slice(t+26)}}function Wr(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 Gr({description:e,onEdit:t}){let{t:n}=m(`tickets`),{openWebView:r}=lr(),{user:i,contract:a}=Ur(e),o=i||e,s=(0,V.useMemo)(()=>({a:({href:e,children:t})=>(0,U.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,U.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,U.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,U.jsx)(ve,{remarkPlugins:[F],components:s,children:o})}),a&&(0,U.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,U.jsxs)(`summary`,{className:`cursor-pointer text-[10px] font-medium text-foreground/80 select-none flex items-center gap-2`,children:[n(`contractLayer.title`),(0,U.jsx)(`span`,{className:`rounded-full bg-muted/40 px-1.5 text-[9px] text-foreground/60`,children:n(`contractLayer.populated`,{n:Wr(a)})})]}),(0,U.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,U.jsx)(ve,{remarkPlugins:[F],components:s,children:a})})]})]})}export{De as $,rt as A,J as B,bt as C,ct as D,vt as E,Qe as F,Ue as G,Je as H,tt as I,Pe as J,Be as K,$e as L,G as M,et as N,ot as O,Ze as P,L as Q,nt as R,At as S,ut as T,qe as U,Ye as V,Ge as W,ke as X,R as Y,Oe as Z,Ht as _,Un as a,xe as at,Pt as b,Zt as c,Xt as d,Ee as et,St as f,xt as g,Wt as h,lr as i,I as it,Xe as j,it as k,X as l,Rt as m,mr as n,we as nt,Wn as o,Ut as p,B as q,cr as r,Ce as rt,Qt as s,Rr as t,Te as tt,$t as u,zt as v,mt as w,Vt as x,Bt as y,q as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,t}from"./rolldown-runtime-CNC7AqOf.js";import{n}from"./jsx-runtime-zu2_FqZY.js";import{T as r}from"./i18n-hnX2DPmo.js";import{a as i,d as a,f as o,i as s,l as c,p as l,s as u,u as d}from"./createLucideIcon-Bjbbp_KS.js";var f=t(((e,t)=>{t.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}})),p=e(n()),m=e(f()),h=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function g(e){var t={type:`tag`,name:``,voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(m.default[n[1]]||e.charAt(e.length-2)===`/`)&&(t.voidElement=!0),t.name.startsWith(`!--`))){var r=e.indexOf(`-->`);return{type:`comment`,comment:r===-1?``:e.slice(4,r)}}for(var i=new RegExp(h),a=null;(a=i.exec(e))!==null;)if(a[0].trim())if(a[1]){var o=a[1].trim(),s=[o,``];o.indexOf(`=`)>-1&&(s=o.split(`=`)),t.attrs[s[0]]=s[1],i.lastIndex--}else a[2]&&(t.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return t}var _=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,v=/^\s*$/,y=Object.create(null);function b(e,t){switch(t.type){case`text`:return e+t.content;case`tag`:return e+=`<`+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+`="`+e[n]+`"`);return t.length?` `+t.join(` `):``}(t.attrs):``)+(t.voidElement?`/>`:`>`),t.voidElement?e:e+t.children.reduce(b,``)+`</`+t.name+`>`;case`comment`:return e+`<!--`+t.comment+`-->`}}var x={parse:function(e,t){t||={},t.components||=y;var n,r=[],i=[],a=-1,o=!1;if(e.indexOf(`<`)!==0){var s=e.indexOf(`<`);r.push({type:`text`,content:s===-1?e:e.substring(0,s)})}return e.replace(_,function(s,c){if(o){if(s!==`</`+n.name+`>`)return;o=!1}var l,u=s.charAt(1)!==`/`,d=s.startsWith(`<!--`),f=c+s.length,p=e.charAt(f);if(d){var m=g(s);return a<0?(r.push(m),r):((l=i[a]).children.push(m),r)}if(u&&(a++,(n=g(s)).type===`tag`&&t.components[n.name]&&(n.type=`component`,o=!0),n.voidElement||o||!p||p===`<`||n.children.push({type:`text`,content:e.slice(f,e.indexOf(`<`,f))}),a===0&&r.push(n),(l=i[a-1])&&l.children.push(n),i[a]=n),(!u||n.voidElement)&&(a>-1&&(n.voidElement||n.name===s.slice(2,-1))&&(a--,n=a===-1?r:i[a]),!o&&p!==`<`&&p)){l=a===-1?r:i[a].children;var h=e.indexOf(`<`,f),_=e.slice(f,h===-1?void 0:h);v.test(_)&&(_=` `),(h>-1&&a+l.length>=0||_!==` `)&&l.push({type:`text`,content:_})}}),r},stringify:function(e){return e.reduce(function(e,t){return e+b(``,t)},``)}},S=(e,t)=>{if(!e)return!1;let n=e.props?.children??e.children;return t?n.length>0:!!n},C=e=>{if(!e)return[];let t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?T(t):t},w=e=>Array.isArray(e)&&e.every(p.isValidElement),T=e=>Array.isArray(e)?e:[e],E=(e,t)=>{let n={...t};return n.props={...t.props,...e.props},n},D=e=>{let t={};if(!e)return t;let n=e=>{T(e).forEach(e=>{a(e)||(S(e)?n(C(e)):d(e)&&!(0,p.isValidElement)(e)&&Object.assign(t,e))})};return n(e),t},O=(e,t,n,r)=>{if(!e)return``;let i=``,s=T(e),c=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((e,s)=>{if(a(e)){i+=`${e}`;return}if((0,p.isValidElement)(e)){let{props:o,type:l}=e,u=Object.keys(o).length,d=c.indexOf(l)>-1,f=o.children;if(!f&&d&&!u){i+=`<${l}/>`;return}if(!f&&(!d||u)||o.i18nIsDynamicList){i+=`<${s}></${s}>`;return}if(d&&u<=1){let e=a(f)?f:O(f,t,n,r);i+=`<${l}>${e}</${l}>`;return}let p=O(f,t,n,r);i+=`<${s}>${p}</${s}>`;return}if(e===null){o(n,`TRANS_NULL_VALUE`,`Passed in a null value as child`,{i18nKey:r});return}if(d(e)){let{format:t,...a}=e,s=Object.keys(a);if(s.length===1){let e=t?`${s[0]}, ${t}`:s[0];i+=`{{${e}}}`;return}o(n,`TRANS_INVALID_OBJ`,`Invalid child - Object should only have keys {{ value, format }} (format is optional).`,{i18nKey:r,child:e});return}o(n,`TRANS_INVALID_VAR`,`Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`,{i18nKey:r,child:e})}),i},k=(e,t=[],n={})=>{if(!e)return e;let r=Object.keys(n),i=[...t,...r],a=``,o=0;for(;o<e.length;)if(e[o]===`<`){let t=!1,n=e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(n){let e=n[1];(/^\d+$/.test(e)||i.includes(e))&&(t=!0,a+=n[0],o+=n[0].length)}if(!t){let n=e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(n){let e=n[1];(/^\d+$/.test(e)||i.includes(e))&&(t=!0,a+=n[0],o+=n[0].length)}}t||(a+=`<`,o+=1)}else a+=e[o],o+=1;return a},A=(e,t,n,r,i,o,s)=>{if(n===``)return[];let l=i.transKeepBasicHtmlNodesFor||[],f=n&&new RegExp(l.map(e=>`<${e}`).join(`|`)).test(n);if(!e&&!t&&!f&&!s)return[n];let m=t??{},h=e=>{T(e).forEach(e=>{a(e)||(S(e)?h(C(e)):d(e)&&!(0,p.isValidElement)(e)&&Object.assign(m,e))})};h(e);let g=k(n,l,m),_=x.parse(`<0>${g}</0>`),v={...m,...o},y=(e,t,n)=>{let r=C(e),i=D(r,t.children,n);return w(r)&&i.length===0||e.props?.i18nIsDynamicList?r:i},b=(e,t,n,r,i)=>{e.dummy?(e.children=t,n.push((0,p.cloneElement)(e,{key:r},i?void 0:t))):n.push(...p.Children.map([e],e=>{if(e.type===p.Fragment||e.props?.i18nIsDynamicList!==void 0){let n={key:r};return e&&e.props&&Object.keys(e.props).forEach(t=>{t===`children`||t===`i18nIsDynamicList`||(n[t]=e.props[t])}),(0,p.createElement)(e.type,n,i?null:t)}let n={key:r};return e&&e.props&&Object.keys(e.props).forEach(t=>{t===`ref`||t===`children`||(n[t]=e.props[t])}),(0,p.cloneElement)(e,n,i?null:t)}))},D=(e,n,o)=>{let m=T(e),h=T(n),g={};return h.reduce((e,n,h)=>{let _=n.children?.[0]?.content&&r.services.interpolator.interpolate(n.children[0].content,v,r.language);if(n.type===`tag`){let u=m[parseInt(n.name,10)];!u&&t&&(u=t[n.name]),o.length===1&&!u&&(u=o[0][n.name]),u||={};let x={...n.attrs};s&&Object.keys(x).forEach(e=>{let t=x[e];a(t)&&(x[e]=c(t))});let w=Object.keys(x).length===0?u:E({props:x},u),O=(0,p.isValidElement)(w),k=O&&S(n,!0)&&!n.voidElement,A=f&&d(w)&&w.dummy&&!O,j=d(t)&&Object.hasOwnProperty.call(t,n.name);if(a(w)){let t=r.services.interpolator.interpolate(w,v,r.language);e.push(t)}else if(S(w)||k){let t=y(w,n,o);b(w,t,e,h)}else if(A){let t=D(m,n.children,o);b(w,t,e,h)}else if(Number.isNaN(parseFloat(n.name)))if(j){let t=y(w,n,o);b(w,t,e,h,n.voidElement)}else if(i.transSupportBasicHtmlNodes&&l.indexOf(n.name)>-1)if(n.voidElement)e.push((0,p.createElement)(n.name,{key:`${n.name}-${h}`}));else{let t=g[n.name]||0;g[n.name]=t+1;let r,i=0;for(let e=0;e<m.length;e+=1){let a=m[e];if((0,p.isValidElement)(a)&&a.type===n.name){if(i===t){r=a;break}i+=1}}let a=r?T(C(r)):m,s=D(a,n.children,o);e.push((0,p.createElement)(n.name,{key:`${n.name}-${h}`},s))}else if(n.voidElement)e.push(`<${n.name} />`);else{let t=D(m,n.children,o);e.push(`<${n.name}>${t}</${n.name}>`)}else if(d(w)&&!O){let t=n.children[0]?_:null;t&&e.push(t)}else b(w,_,e,h,n.children.length!==1||!_)}else if(n.type===`text`){let t=i.transWrapTextNodes,a=typeof i.unescape==`function`?i.unescape:u().unescape,o=s?a(r.services.interpolator.interpolate(n.content,v,r.language)):r.services.interpolator.interpolate(n.content,v,r.language);t?e.push((0,p.createElement)(t,{key:`${n.name}-${h}`},o)):e.push(o)}return e},[])};return C(D([{dummy:!0,children:e||[]}],_,T(e||[]))[0])},j=(e,t,n)=>{let r=e.key||t,i=(0,p.cloneElement)(e,{key:r});if(!i.props||!i.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return i;function a(){return(0,p.createElement)(p.Fragment,null,i)}return(0,p.createElement)(a,{key:r})},M=(e,t)=>e.map((e,n)=>j(e,n,t)),N=(e,t)=>{let n={};return Object.keys(e).forEach(r=>{Object.assign(n,{[r]:j(e[r],r,t)})}),n},P=(e,t,n,r)=>e?Array.isArray(e)?M(e,t):d(e)?N(e,t):(l(n,`TRANS_INVALID_COMPONENTS`,`<Trans /> "components" prop expects an object or array`,{i18nKey:r}),null):null,F=e=>!d(e)||Array.isArray(e)?!1:Object.keys(e).reduce((e,t)=>e&&Number.isNaN(Number.parseFloat(t)),!0);function I({children:e,count:t,parent:n,i18nKey:o,context:s,tOptions:c={},values:d,defaults:f,components:m,ns:h,i18n:g,t:_,shouldUnescape:v,...y}){let b=g||i();if(!b)return l(b,`NO_I18NEXT_INSTANCE`,`Trans: You need to pass in an i18next instance using i18nextReactModule`,{i18nKey:o}),e;let x=_||b.t.bind(b)||(e=>e),S={...u(),...b.options?.react},C=h||x.ns||b.options?.defaultNS;C=a(C)?[C]:C||[`translation`];let{transDefaultProps:w}=S,T=w?.tOptions?{...w.tOptions,...c}:c,E=v??w?.shouldUnescape,k=w?.values?{...w.values,...d}:d,j=w?.components?{...w.components,...m}:m,M=O(e,S,b,o),N=f||T?.defaultValue||M||S.transEmptyNodeValue||(typeof o==`function`?r(o):o),{hashTransKey:I}=S,L=o||(I?I(M||N):M||N);d=b.options?.interpolation?.defaultVariables?k&&Object.keys(k).length>0?{...k,...b.options.interpolation.defaultVariables}:{...b.options.interpolation.defaultVariables}:k;let R=D(e);R&&typeof R.count==`number`&&t===void 0&&(t=R.count);let z=d||t!==void 0&&!b.options?.interpolation?.alwaysFormat||!e?T.interpolation:{interpolation:{...T.interpolation,prefix:`#$?`,suffix:`?$#`}},B={...T,context:s||T.context,count:t,...d,...z,defaultValue:N,ns:C},V=L?x(L,B):N;V===L&&N&&(V=N);let H=P(j,V,b,o),U=H||e,W=null;F(H)&&(W=H,U=e);let G=A(U,W,V,b,S,B,E),K=n??S.defaultTransParent;return K?(0,p.createElement)(K,y,G):G}function L({children:e,count:t,parent:n,i18nKey:r,context:a,tOptions:o={},values:c,defaults:l,components:u,ns:d,i18n:f,t:m,shouldUnescape:h,...g}){let{i18n:_,defaultNS:v}=(0,p.useContext)(s)||{},y=f||_||i(),b=m||y?.t.bind(y);return I({children:e,count:t,parent:n,i18nKey:r,context:a,tOptions:o,values:c,defaults:l,components:u,ns:d||b?.ns||v||y?.options?.defaultNS,i18n:y,t:m,shouldUnescape:h,...g})}export{L as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`任务中心`,t=`通过对话操作 Specrails`,n=`任务中心`,r=`让智能体做任何事…`,i=`发送`,a=`停止`,o=`复制`,s={openPreview:`预览 {{name}}`,openDownload:`下载 {{name}}`,previewTitle:`{{name}} 预览`,downloadTitle:`下载文件?`,downloadPrompt:`此文件无法在此处预览。要下载它吗?`,download:`下载`,cancelDownload:`暂不`,loading:`正在准备文件…`,loadFailed:`无法加载附件`,loadError:`无法加载附件:{{error}}`},c=`最大化`,l=`还原`,u=`最小化`,d=`关闭`,f=`新任务`,p=`这次的任务是什么?`,m=`先选择一个项目,然后提问。智能体工作时看板会实时更新。`,h=`思考中…`,g=`连接中…`,_=`正在查询应用…`,v={compact:`紧凑`,comfortable:`舒适`,max:`最大化`},y={label:`模型`,loading:`正在加载模型…`,unavailable:`模型不可用`},b={hint:`浏览提示历史 — 输入以编辑,↑↓ 导航`},x={queued:`排队中`,send:`发送到队列`,sendHint:`智能体仍在工作——此消息将排队并在之后执行`,placeholder:`智能体工作时可继续输入——消息将排队…`},S={editing:`正在编辑排队消息 {{n}}/{{m}}`,hint:`↑↓ 导航 · 回车保存 · Esc 取消`,save:`保存排队消息`,cancel:`取消编辑`,dispatched:`该排队消息已发送——你的文本已保留为草稿`,saveFailed:`无法保存排队消息`},C={branch:`分支`,detached:`(分离头指针)`,dirty:`有未提交的更改`,switched:`已切换到 {{branch}}`,switchFailed:`无法切换分支`,lockedWhileWorking:`智能体工作时分支已锁定`,searchPlaceholder:`搜索分支…`,noMatches:`没有匹配的分支`,worktrees:`工作树`,worktreePathCopied:`已复制工作树路径`,copyWorktreePath:`复制工作树路径`},w={label:`提供方`,claude:`Claude`,codex:`Codex`,gemini:`Gemini`,kimi:`Kimi`},T={cycleHint:`⇧⇥ 切换`,observe:{name:`观察`,desc:`只读 — 不做任何更改`},edit:{name:`编辑`,desc:`创建和编辑(可撤销)`},operate:{name:`操作`,desc:`启动 AI — 会产生费用`},autonomous:{name:`自主`,desc:`删除和终止 — 不可逆`},lockedTitle:`需要更高的级别`,lockedBody:`该操作需要「{{level}}」级别。你当前处于「{{current}}」。`,raiseHint:`⇧⇥ 提升级别,或换一种方式询问。`},E={title:`确认操作`,costAction:`{{action}} · ~{{cost}} · {{tier}}`,approve:`批准`,cancel:`取消`,dontAskAgain:`本次会话不再询问`,approved:`已批准`,cancelled:`已取消`},D={home:`主页`,searchPlaceholder:`与 Specrails 对话…`,searchProjectsPlaceholder:`搜索项目…`,recents:`最近`,allProjects:`所有项目`,searchAll:`在所有项目中搜索`,addProject:`添加项目…`,homeHint:`未选择项目 — 正在跨所有项目操作。`,askCreateOrSearch:`未选择任何项目。你想创建一个新项目,还是在所有项目中搜索?`},O={remove:`移除 {{label}}`,addContextAction:`添加上下文或操作`,filtering:`筛选 "{{query}}"`,keyboard:`↑↓ Enter Esc`,noMatches:`无匹配结果`,noMatchesFor:`没有 "{{query}}" 的匹配结果`,mode:{reference:{title:`引用`,hint:`@ 项目、规格、任务`},trace:{title:`追踪`,hint:`# 作业、运行、ID`},action:{title:`操作`,hint:`/ 此上下文的命令`}},plus:{reference:`引用`,referenceHint:`项目、规格、任务`,trace:`追踪`,traceHint:`作业、运行、ID`,action:`操作`,actionHint:`创建、启动、检查`,fileAttachment:`文件附件`,fileAttachmentHint:`添加文档、图片、日志`,browserCapture:`浏览器捕获`,browserCaptureHint:`捕获页面区域并添加到此任务`}},k={label:`切换任务`,untitled:`新任务`,new:`新任务`,searchPlaceholder:`搜索任务…`,noMatches:`没有匹配的任务`,working:`代理正在工作`,queuedBadge:`{{n}} 条排队`,delete:`删除任务 "{{title}}"`,deleteConfirm:`删除?`,deleteLiveConfirm:`代理正在工作 — 仍要删除?`,confirmDelete:`确认删除`,cancelDelete:`保留任务`,deleteFailed:`无法删除任务`},A={title:`未安装 AI 提供方`,body:`智能体需要在你的机器上安装 Claude、Codex、Gemini 或 Kimi。安装其中之一后重新打开智能体即可开始对话。`,placeholder:`请安装 AI 提供方以使用智能体…`},j={title:`Specrails MCP 已关闭`,body:`智能体需要内置的 MCP 服务器来操作应用。`,enable:`启用 Specrails MCP`,enabling:`正在启用…`,enabled:`MCP 已启用`},M={live:`实时`,queued:`排队中`,running:`运行中`,done:`已完成`,failed:`失败`},N={generic:`出了点问题。请重试。`,busy:`智能体正忙。请稍后重试。`},P={kindAgent:`智能体任务`},F=`新任务`,I=`切换到任务中心`,L=`切换到看板`,R=`搜索`,z=`主页`,B=`收藏任务`,V=`未命名`,H={title:`工作区`,terminal:`终端`,files:`文件`,browser:`浏览器`,requiresProject:`请选择一个项目以使用此工具`,resizeCode:`调整代码面板`,closeFiles:`关闭代码`,browserConfirm:`添加到智能体`,browserSelectStart:`选择以添加到任务`,browserCaptured:`已添加捕获`,uploadFailed:`上传失败`,requiresConversation:`启动任务后才能使用此工具`,jobs:`作业`,closeJobs:`关闭作业`,resizeJobs:`调整作业面板大小`,noJobs:`还没有作业——让智能体启动一个吧`,analytics:`分析`,closeAnalytics:`关闭分析`,resizeAnalytics:`调整分析面板大小`},U=`附加文件`,W=`删除「{{title}}」`,G=`确认删除「{{title}}」`,K=`将「{{title}}」添加到收藏`,q=`从收藏中移除「{{title}}」`,J=`确认?`,Y=`该提供商暂不支持读取图片 — 请附加文本文件`,X={label:`推理强度`,minimal:`最小`,low:`低`,medium:`中`,high:`高`,xhigh:`极高`,max:`最大`,ultra:`超级`},Z={operation:{inProgress:`操作进行中…`,"create-pr":`正在创建 PR…`,publish:`正在发布…`,discard:`正在丢弃…`,dismiss:`正在关闭后续任务…`,"poll-merge":`正在检查合并…`,reopen:`正在重新打开…`,"merge-local":`正在本地集成…`,"recover-and-retry":`正在提交并重新推送已保留的结果…`,"acknowledge-no-changes":`正在标记完成…`},markDone:`标记为完成`,refine:`细化`,completedNote:`已确认 — spec 已移至完成`,partialSummary:`{{total}} 个中 {{succeeded}} 个完成,{{failed}} 个失败`,unit:{failed:`实现失败`,blocked:`交付受阻`,noChanges:`无更改`,succeeded:`已就绪`},rail:`Rail {{index}}`,specCount_one:`{{count}} 个 Spec`,specCount_other:`{{count}} 个 Spec`,base:`基础分支`,openPr:`打开 PR`,existingPr:`现有 PR`,title:{no_changes:`无需更改`,partial:`部分实现完成`,delivery_blocked:`实现完成 — 交付需要处理`,update_failed:`实现完成 — 更新失败`,pr_closed:`PR 已关闭但未合并`,superseded:`已被较新的运行取代`,existing_pr_updated:`现有 PR 已更新`,building:`正在隔离的 worktree 中实现…`,buildingExistingPr:`正在向现有 PR 应用更改…`,paused:`需要人工决策`,on_review:`实现已完成,待评审`,pr_draft:`已创建草稿 PR`,pr_draft_degraded:`PR 交付未完成`,pr_ready:`PR 已就绪,可合并`,implementation_failed:`实现失败`,pr_failed:`PR 创建失败`,merged:`PR 已合并`,discarded:`已丢弃`},buildingHint:`完成后会询问你是否创建 PR。`,buildingExistingPrHint:`Specrails 正在现有 PR 的分支上工作,并会把 review 更改推送回同一个 PR。`,paused:`实现已暂停`,pausedForRun:`在 {{ref}} 暂停`,resume:`继续`,stopExecution:`停止执行`,stopExecutionSent:`已发送停止信号`,stopExecutionFailed:`无法停止执行`,createPr:`创建 PR`,publish:`发布`,checkout:`检出分支`,openReview:`审阅`,openReviewTooltip:`打开通俗语言的审阅`,checkoutTooltip:`在项目主目录检出 {{branch}}`,checkoutSuccess:`已检出 {{branch}}`,checkoutFailed:`无法检出 PR 分支`,checkoutDirtyTitle:`为保护你的更改,已阻止检出`,checkoutDirtyBody:`项目主目录中有未提交的更改。请先提交或暂存这些更改,然后重试。本次操作没有修改任何内容。`,checkoutSafetyUnknownTitle:`无法验证安全状态,已暂停检出`,checkoutSafetyUnknownBody:`Specrails 无法读取项目主目录的 Git 状态。没有释放或修改任何内容。请在 Git 恢复可用后重试。`,checkoutNotDeliverableTitle:`此 PR 分支不包含已保留的实现`,checkoutNotDeliverableBody:`尚未验证本次交付的精确提交。请改为检查或恢复本地结果。`,inspectLocalResult:`检查本地结果`,inspectLocalResultTooltip:`显示已保留的隔离 worktree 并复制其路径`,localResultPathCopied:`已复制本地结果路径`,localResultPath:`已保留的本地结果`,localResultUnavailableHere:`此电脑上没有可恢复的 worktree。请在运行该任务的电脑上查看运行日志。`,recoverAndRetry:`提交并重试推送`,recoverAndRetryVerified:`已恢复的提交 {{sha}} 已在 PR 中验证`,recoveryStillBlocked:`本地恢复仍需处理`,recheckRecovery:`再次检查`,recoveryUnavailable:`无法在此计算机上验证恢复结果`,recoveryUnavailableBody:`Specrails 无法在此克隆中安全证明唯一一个属于此次交付的结果。没有更改或删除任何内容。请检查阶段详情和运行日志。如果 run 在另一台计算机上执行,请在那里打开 Specrails,然后再次检查。`,recoveryDetailSummary:`恢复技术详情`,retry:`重试`,retryPr:`重试 PR`,checkMerge:`检查合并`,verifyPr:`验证 PR`,discard:`丢弃`,confirmDiscard:`确认丢弃?`,mergedNote:`已合并 — Spec 已移至完成`,discardedNote:`已丢弃 — Spec 已退回待办`,implementationFailedNote:`实现运行在生成可交付内容前失败。请打开运行日志查看失败原因,然后在重新启动前丢弃此卡片。`,dismiss:`关闭后续任务`,discardLocalResult:`丢弃本地结果`,retryPush:`重试推送`,retryPushVerified:`推送已验证 · 提交 {{sha}} 已在 PR 中`,commitAlreadyVerified:`提交 {{sha}} 已在 PR 中验证`,deliveryCommit:`提交 {{sha}}`,reopen:`重新打开`,createPartialPr:`用 {{count}} 个结果创建 PR`,supersededNote:`较新的实现运行已取代此卡片。`,noChangesExisting:`无需新的更改;现有 PR 保持不变。`,noChangesNote:`无需更改代码。请将 spec 标记为完成,或退回待办列表继续细化。`,deliveryNeedsAttention:`实现完成;交付需要处理`,deliveryBlockedNote:`实现已成功,但交付受阻。丢弃本地结果前,请查看阶段详情和运行日志。`,partialDeliveryBlockedNote:`部分实现已成功,但目前还没有可安全交付的内容。在选择下一步操作前,请查看各单元的结果和运行日志。`,retryPushNote:`实现已成功,更改安全保存在本地。请仅重试推送。`,cleanupIncomplete_one:`清理未完成({{count}} 条警告)`,cleanupIncomplete_other:`清理未完成({{count}} 条警告)`,safetyArchiveTitle:`安全存档({{count}})`,safetyArchiveHint:`为安全起见,临时工作区文件已保存在 PR 之外。你可以检查或手动删除它们。`,confirm:{recoverAndRetryTitle:`提交并推送已保留的结果?`,recoverAndRetryBody:`Specrails 只会使用 {{branch}} 对应的隔离 worktree 或已记录且可快进的分支。必要时,它会提交可交付文件;仅当 PR 仍以预期的源分支和目标分支保持打开状态时,才会推送这个精确提交。不会触碰项目主目录及其中尚未提交的更改。`,recheckRecoveryTitle:`再次检查此计算机?`,recheckRecoveryBody:`Specrails 将在此克隆中重新扫描属于 {{branch}} 交付的 worktree、分支、refs、reflogs 和孤立 Git 对象。如果能证明唯一结果,它可以提交隔离的更改并重试精确 push。不会触碰主项目文件夹。`,noChangesDoneTitle:`将这些 spec 标记为完成?`,noChangesDoneBody:`实现已确认无需更改代码。spec 将移至完成,并清理无更改的 worktree。`,refineTitle:`细化这些 spec?`,refineBody:`无更改结果将被关闭,spec 会返回待办列表以便细化。运行日志仍可查看。`,mergeLocalTitle:`在本地集成?`,mergeLocalBody:`已交付的分支将合并到本地 checkout 的 {{base}}。checkout 必须位于 {{base}},且工作树干净。`,freshDiscardTitle:`丢弃此交付?`,freshDiscardBody:`PR 将关闭,但不会删除其远程分支。只会删除归 SpecRails 所有且仍停留在已记录提交上的本地分支和 worktree;任何已更改的内容都会保留并显示警告。spec 将返回待办列表。已删除的本地资源无法恢复。`,implementationFailedDiscardTitle:`丢弃此失败的交付?`,implementationFailedDiscardBody:`卡片将被关闭,spec 会返回待办列表。本地工作和分支将保留以供检查。只有确认可安全清理的资源才可能被移除。`,dismissTitle:`关闭此后续任务?`,dismissBody:`此后续卡片将被关闭。仅在仍可安全删除时才会移除其专用 worktree;否则将保留并显示警告。现有 PR、分支和审查状态不会改变。`,discardLocalTitle:`丢弃本地结果?`,discardLocalBody:`仅在仍可安全删除时才会移除可恢复的本地迭代;如果它已发生变化,将保留并显示警告。任何现有 PR 及其分支都不会改变。已删除的结果无法恢复。`},degraded:{pushed:`分支已推送,但无法创建 PR — 请重试以完成。`,localOnly:`更改已在本地组装但未推送 — 请重试以发布 PR。`},alreadyResolved:`已在其他地方处理`,actionFailed:`操作失败`,notMergedYet:`尚未合并`,commitMissingRetry:`交付提交已不在 PR 中。你可以重新尝试推送。`,prVerifiedWaiting:`提交 {{sha}} 已验证 · 等待合并`,viewLog:`查看 {{ref}} 的运行日志`,runElapsedAria:`已运行 {{elapsed}}`,runCostAria:`已花费 {{cost}}`,pinned:{label:`已固定`,marker:`实现卡片 — 已固定在上方`,collapse:`最小化固定卡片`,expand:`展开固定卡片`,expandCard:`展开此卡片`,collapseCard:`最小化此卡片`,collapsed_one:`实现卡片`,collapsed_other:`{{count}} 张实现卡片`,state:{completed:`已完成`,no_changes:`无更改`,pr_closed:`已关闭`,superseded:`已取代`,building:`构建中`,on_review:`待审阅`,pr_draft:`草稿 PR`,pr_ready:`已发布`,implementation_failed:`失败`,pr_failed:`失败`,merged:`已合并`,discarded:`已丢弃`}},mergeLocal:`本地集成`,mergeLocalTooltip:`将交付的分支合并到本地检出的 {{base}}(无需 GitHub)`,mergeLocalBlockedDirty:`无法集成:{{base}} 上的工作树有未提交的更改。请提交或暂存后重试。`,mergeLocalBlockedBranch:`无法集成:当前检出在 {{current}},而不是 {{base}}。请切换到 {{base}} 后重试。`,mergedLocally:`已在本地集成到 {{base}}`},Q={heading:`规格草稿`,drafting:`正在更新草稿…`,acceptanceCriteria:`验收标准`,untitled:`未命名规格`,expand:`显示完整描述`,collapse:`收起描述`},$={openTicket:`打开 Spec #{{id}}`,openPullRequest:`打开 PR #{{id}}`,openJob:`打开任务 {{id}}`,openLoop:`打开循环 {{id}}`,ticketNotFound:`未找到 Spec #{{id}} — 可能已被删除`,pullRequestUrlMissing:`PR #{{id}} 被引用但没有 URL`,pullRequestNotFound:`在此项目中找不到 PR #{{id}}`,jobNotFound:`未找到任务 — 可能已被删除`,loopNotFound:`未找到循环 — 可能已被删除`,lookupFailed:`无法验证该引用 — 请重试`},ee={untitled:`未命名任务`,menu:`任务菜单`,rename:`重命名`,renamePlaceholder:`任务名称`,renameHint:`双击重命名`,renameFailed:`无法重命名`,addFavorite:`添加到收藏`,removeFavorite:`从收藏中移除`,copyName:`复制任务名称`,copyId:`复制任务 ID`,copyProject:`复制项目名称`,copyProjectPath:`复制项目路径`,copyFailed:`无法复制`,copyTranscript:`复制转录`,copyTranscriptSuccess:`转录已复制`,copyTranscriptFailed:`无法复制转录`,exportTranscript:`导出转录 (.txt)`,exportTranscriptSuccess:`转录导出已开始`,exportTranscriptFailed:`无法导出转录`,delete:`删除任务`,deleteConfirm:`删除此任务?此操作无法撤销。`,deleteFailed:`无法删除任务`},te=`接下来要构建什么?`,ne={title:`执行日志`,live:`实时`,empty:`本回合尚无工具活动。`,output:`输出`,error:`错误`,copyAll:`复制完整日志`,copyEntry:`复制条目`,copySuccess:`日志已复制到剪贴板`,copyFailed:`无法复制日志`,openLog:`查看执行日志`,close:`关闭`},re={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,queueEdit:S,git:C,provider:w,tier:T,approval:E,project:D,palette:O,mission:k,noProvider:A,degraded:j,toolCard:M,error:N,chip:P,newAgent:F,switchToAgent:I,switchToKanban:L,search:R,home:z,favoriteMissions:B,untitled:V,workspace:H,attachFile:U,deleteConversation:W,confirmDeleteConversation:G,addFavoriteConversation:K,removeFavoriteConversation:q,confirmShort:J,imagesUnsupported:Y,effort:X,prCard:Z,specDraft:Q,refs:$,header:ee,emptyTitleCodeRain:te,activity:ne};export{ne as activity,K as addFavoriteConversation,E as approval,U as attachFile,s as attachment,P as chip,d as close,r as composerPlaceholder,G as confirmDeleteConversation,J as confirmShort,g as connecting,_ as consultingCode,o as copy,re as default,j as degraded,W as deleteConversation,X as effort,m as emptyHint,p as emptyTitle,te as emptyTitleCodeRain,N as error,B as favoriteMissions,C as git,ee as header,b as history,z as home,Y as imagesUnsupported,c as maximize,u as minimize,k as mission,y as model,F as newAgent,f as newConversation,A as noProvider,O as palette,Z as prCard,D as project,w as provider,x as queue,S as queueEdit,$ as refs,q as removeFavoriteConversation,l as restore,R as search,i as send,v as size,Q as specDraft,a as stop,t as subtitle,I as switchToAgent,L as switchToKanban,h as thinking,T as tier,e as title,M as toolCard,n as trigger,V as untitled,H as workspace};
|