yepanywhere 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/@yep-anywhere/shared/dist/__tests__/codex-session-schema.test.d.ts +2 -0
- package/bundled/@yep-anywhere/shared/dist/__tests__/codex-session-schema.test.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/__tests__/codex-session-schema.test.js +39 -0
- package/bundled/@yep-anywhere/shared/dist/__tests__/codex-session-schema.test.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/__tests__/server-capabilities.test.js +14 -1
- package/bundled/@yep-anywhere/shared/dist/__tests__/server-capabilities.test.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/app-types.d.ts +31 -1
- package/bundled/@yep-anywhere/shared/dist/app-types.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/app-types.js +6 -0
- package/bundled/@yep-anywhere/shared/dist/app-types.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/capability-ids.d.ts +18 -0
- package/bundled/@yep-anywhere/shared/dist/capability-ids.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/capability-ids.js +18 -0
- package/bundled/@yep-anywhere/shared/dist/capability-ids.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/codex-plan-tool.d.ts +4 -0
- package/bundled/@yep-anywhere/shared/dist/codex-plan-tool.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/codex-plan-tool.js +9 -0
- package/bundled/@yep-anywhere/shared/dist/codex-plan-tool.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.d.ts +195 -7
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.js +100 -4
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/codex-schema/types.d.ts +1 -1
- package/bundled/@yep-anywhere/shared/dist/codex-schema/types.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/index.d.ts +7 -6
- package/bundled/@yep-anywhere/shared/dist/index.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/index.js +4 -3
- package/bundled/@yep-anywhere/shared/dist/index.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/local-resource.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/local-resource.js +3 -0
- package/bundled/@yep-anywhere/shared/dist/local-resource.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts +67 -1
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.js +72 -1
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/types.d.ts +11 -0
- package/bundled/@yep-anywhere/shared/dist/types.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/types.js.map +1 -1
- package/bundled/@yep-anywhere/shared/package.json +1 -1
- package/client-dist/assets/{ActivityPage-B9q2bxQG.js → ActivityPage-HYpN2q7X.js} +1 -1
- package/client-dist/assets/{AgentsPage-D2BeReoU.js → AgentsPage-DwW57z25.js} +1 -1
- package/client-dist/assets/App-Zb1JereM.js +2 -0
- package/client-dist/assets/AttachmentChip-C8bV8HCy.js +1 -0
- package/client-dist/assets/{AuthContext-ttH_RHyv.js → AuthContext-hh5gaMN1.js} +1 -1
- package/client-dist/assets/{BangCommandDisplayObject-Csd_4G38.js → BangCommandDisplayObject-Bw9ncUYZ.js} +1 -1
- package/client-dist/assets/{BangCommandsPage-4tAg1P-B.js → BangCommandsPage-DedVsg3g.js} +1 -1
- package/client-dist/assets/BrowserDebugToolbarButton-853TgFOC.js +1 -0
- package/client-dist/assets/{CodexUpdatePrompt-C0NYRpC1.js → CodexUpdatePrompt-Z8ohUTx0.js} +1 -1
- package/client-dist/assets/{EmulatorPage-CaGjOU02.js → EmulatorPage-TSRWfl3R.js} +1 -1
- package/client-dist/assets/FilePage-CNlZ-vA4.js +1 -0
- package/client-dist/assets/{FileViewer-4aDxZNTu.js → FileViewer-DGZdQyXp.js} +53 -53
- package/client-dist/assets/{FilterDropdown-DefBPgy4.js → FilterDropdown-LDO5HOKH.js} +1 -1
- package/client-dist/assets/{FloatingActionButton-CPVF8aGh.js → FloatingActionButton-DMj4jEx3.js} +1 -1
- package/client-dist/assets/{GitStatusPage-BMAX1XtQ.js → GitStatusPage-rM-D-tor.js} +2 -2
- package/client-dist/assets/{GlobalSessionsPage-BhQXZsnZ.js → GlobalSessionsPage-CLIFWs0i.js} +1 -1
- package/client-dist/assets/GlossaryContext-6cQEV5Uo.js +1 -0
- package/client-dist/assets/{HeartbeatTextArea-CjOFU5D8.js → HeartbeatTextArea-pIlTd6TX.js} +1 -1
- package/client-dist/assets/{HostIdentityContext-BuhXEIrO.js → HostIdentityContext-C0Vgqk-6.js} +1 -1
- package/client-dist/assets/{HostIdentityMarker-DKxUjPEf.js → HostIdentityMarker-B1D03-7A.js} +1 -1
- package/client-dist/assets/{HostsPage--bWNVMY2.js → HostsPage-D_TFbJzn.js} +1 -1
- package/client-dist/assets/{InboxContext-BKyIY7qc.js → InboxContext-D3a6m4xN.js} +1 -1
- package/client-dist/assets/{InboxPage-wbKwNVKg.js → InboxPage-BvjMsqRm.js} +1 -1
- package/client-dist/assets/{LoginPage-GYi_XEnG.js → LoginPage-B77DWkB_.js} +1 -1
- package/client-dist/assets/{MarkdownPreview-AEv1dNzV.js → MarkdownPreview-CvbXcyQJ.js} +1 -1
- package/client-dist/assets/MessageInput-BsqM97eX.js +3 -0
- package/client-dist/assets/MessageList--KVUIFfK.js +6 -0
- package/client-dist/assets/MessageList-DYEFp3d3.css +1 -0
- package/client-dist/assets/{Modal-C59BcdHD.js → Modal-B2SjK3d9.js} +1 -1
- package/client-dist/assets/NavigationLayout-CXqIKEKh.css +1 -0
- package/client-dist/assets/NavigationLayout-CxIF1Brv.js +2 -0
- package/client-dist/assets/NewSessionPage-CrpiBUT5.js +1 -0
- package/client-dist/assets/{PageHeader-DLhedAPm.js → PageHeader-CjCt5Gtf.js} +1 -1
- package/client-dist/assets/ProjectSessionDefaultsModal-DzVqBVWy.js +3 -0
- package/client-dist/assets/ProjectsPage--v8_jltg.js +1 -0
- package/client-dist/assets/{ProjectsPage-8yEzRoSP.css → ProjectsPage-KswRvQOG.css} +1 -1
- package/client-dist/assets/ProviderBadge-Cr5n2thE.js +1 -0
- package/client-dist/assets/ProviderChildSessionDetail-DicX3xoY.css +1 -0
- package/client-dist/assets/ProviderChildSessionDetail-Mpglk9rr.js +130 -0
- package/client-dist/assets/ProviderChildSessionPage-CZqlaEF3.js +1 -0
- package/client-dist/assets/{SchemaValidationContext-oxtR_d_G.js → SchemaValidationContext-DUH1M5Ah.js} +1 -1
- package/client-dist/assets/SessionPage-LqOVlzHg.js +34 -0
- package/client-dist/assets/{SourceFileHeaderActions-czvC1JKL.js → SourceFileHeaderActions-CK0xCR_P.js} +1 -1
- package/client-dist/assets/ThinkingControls-DHVNITMD.js +1 -0
- package/client-dist/assets/VoiceInputButton-D-JMM9BT.js +1 -0
- package/client-dist/assets/{WorkstreamsPage-BCC_7j6h.js → WorkstreamsPage-B0hQZKfY.js} +1 -1
- package/client-dist/assets/{YepAnywhereLogo-B15FCqEj.js → YepAnywhereLogo-BjfIuZpX.js} +1 -1
- package/client-dist/assets/activityBus-DeWSCW9E.js +42 -0
- package/client-dist/assets/attachmentFileNames-DY59buC0.js +1 -0
- package/client-dist/assets/{frontendReload-t1MBqojn.js → frontendReload-RsU7NgVs.js} +1 -1
- package/client-dist/assets/idb-Bq2mrrgB.js +1 -0
- package/client-dist/assets/index-BTaKS1J-.js +16 -0
- package/client-dist/assets/{index-YFIFpYSg.js → index-BzmHyWJi.js} +1 -1
- package/client-dist/assets/index-C1AW0pQC.js +1 -0
- package/client-dist/assets/index-CoIol1kC.js +2 -0
- package/client-dist/assets/index-DP9HSR1Q.js +33 -0
- package/client-dist/assets/index-DhotkFM0.css +1 -0
- package/client-dist/assets/{registerServiceWorker-DkTc70d4.js → registerServiceWorker-B-TB2f6g.js} +1 -1
- package/client-dist/assets/sessionHistorySearch.worker-C7ZldBcp.js +60 -0
- package/client-dist/assets/{sessionNavigationState-B0NurMU6.js → sessionNavigationState-DQtzqCRa.js} +1 -1
- package/client-dist/assets/{sourceControlNavigationState-w3TYNwib.js → sourceControlNavigationState-Jkj0V5EV.js} +1 -1
- package/client-dist/assets/sourceRuntime-DehqzGFl.js +11 -0
- package/client-dist/assets/sourceTransportPaths-DF_cC8jt.js +1 -0
- package/client-dist/assets/{speechDraftTransaction-B6k3bStO.js → speechDraftTransaction-D0x_KIWP.js} +1 -1
- package/client-dist/assets/uiTrace-DTwsVP-v.js +1 -0
- package/client-dist/assets/{useActivityBusState-DemwlSNp.js → useActivityBusState-C3Jvbe8z.js} +1 -1
- package/client-dist/assets/{useCodexUpdateStatus-bHHkvK4K.js → useCodexUpdateStatus-CP5I-sN6.js} +1 -1
- package/client-dist/assets/{useDocumentTitle-rx41kKWp.js → useDocumentTitle-frIApxrS.js} +1 -1
- package/client-dist/assets/{useEmulators-CpDUcdfL.js → useEmulators-DC6gTx-6.js} +1 -1
- package/client-dist/assets/{useFileActivity-C70dzD5U.js → useFileActivity-D1QofKjX.js} +1 -1
- package/client-dist/assets/{useFloatingActionButtonEnabled-sLWhUZYo.js → useFloatingActionButtonEnabled-BLm3ZEmC.js} +1 -1
- package/client-dist/assets/{useKeepMobileKeyboardOpenAfterDelivery-BMDI-BSY.js → useKeepMobileKeyboardOpenAfterDelivery-wA-2oCPX.js} +1 -1
- package/client-dist/assets/useProviders-NpVDnSAv.js +1 -0
- package/client-dist/assets/useRecentSessions-BSx1OY1a.css +1 -0
- package/client-dist/assets/useRecentSessions-auxvPTqp.js +1 -0
- package/client-dist/assets/{useRelativeNow-B6kyvcmL.js → useRelativeNow-DOLyQglQ.js} +1 -1
- package/client-dist/assets/{useReloadNotifications-B1Gip4qS.js → useReloadNotifications-JMGK9sGZ.js} +1 -1
- package/client-dist/assets/{useSidebarWidth-CNuw7NNf.js → useSidebarWidth-CX5sAdCc.js} +1 -1
- package/client-dist/assets/{useSourceControlCleanLanding-BSY1vDSq.js → useSourceControlCleanLanding-BznT844H.js} +1 -1
- package/client-dist/assets/useStableToolPreviewRendering-KQn7Oxrk.js +9 -0
- package/client-dist/assets/useStreamingEnabled-D--wvBjX.js +59 -0
- package/client-dist/assets/useStreamingEnabled-kg86RxrD.css +1 -0
- package/client-dist/assets/{useWiderConversationActivityPreviews-D-57jNSG.js → useWiderConversationActivityPreviews-BJ4FcSSx.js} +1 -1
- package/client-dist/index.html +1 -1
- package/dist/app.d.ts +3 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +2 -0
- package/dist/app.js.map +1 -1
- package/dist/augments/safe-markdown.d.ts.map +1 -1
- package/dist/augments/safe-markdown.js +3 -0
- package/dist/augments/safe-markdown.js.map +1 -1
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +9 -1
- package/dist/config.js.map +1 -1
- package/dist/desktop/providerDetection.d.ts.map +1 -1
- package/dist/desktop/providerDetection.js +12 -2
- package/dist/desktop/providerDetection.js.map +1 -1
- package/dist/envSettings.d.ts.map +1 -1
- package/dist/envSettings.js +5 -0
- package/dist/envSettings.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/metadata/SessionMetadataService.d.ts +7 -1
- package/dist/metadata/SessionMetadataService.d.ts.map +1 -1
- package/dist/metadata/SessionMetadataService.js +36 -0
- package/dist/metadata/SessionMetadataService.js.map +1 -1
- package/dist/routes/files.d.ts.map +1 -1
- package/dist/routes/files.js +5 -0
- package/dist/routes/files.js.map +1 -1
- package/dist/routes/local-resource-policy.d.ts.map +1 -1
- package/dist/routes/local-resource-policy.js +3 -0
- package/dist/routes/local-resource-policy.js.map +1 -1
- package/dist/routes/public-shares.d.ts.map +1 -1
- package/dist/routes/public-shares.js +21 -2
- package/dist/routes/public-shares.js.map +1 -1
- package/dist/routes/sessions.d.ts.map +1 -1
- package/dist/routes/sessions.js +89 -66
- package/dist/routes/sessions.js.map +1 -1
- package/dist/routes/settings.d.ts.map +1 -1
- package/dist/routes/settings.js +15 -1
- package/dist/routes/settings.js.map +1 -1
- package/dist/routes/version.d.ts.map +1 -1
- package/dist/routes/version.js +4 -1
- package/dist/routes/version.js.map +1 -1
- package/dist/sdk/cli-detection.d.ts +11 -1
- package/dist/sdk/cli-detection.d.ts.map +1 -1
- package/dist/sdk/cli-detection.js +56 -10
- package/dist/sdk/cli-detection.js.map +1 -1
- package/dist/sdk/providers/claude.d.ts +8 -8
- package/dist/sdk/providers/claude.d.ts.map +1 -1
- package/dist/sdk/providers/claude.js +46 -46
- package/dist/sdk/providers/claude.js.map +1 -1
- package/dist/sdk/providers/codex-model-catalog.d.ts.map +1 -1
- package/dist/sdk/providers/codex-model-catalog.js +8 -11
- package/dist/sdk/providers/codex-model-catalog.js.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/AsyncUserInputQuestion.d.ts +5 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/AsyncUserInputQuestion.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/AsyncUserInputQuestion.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/AsyncUserInputQuestion.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/Thread.d.ts +11 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/Thread.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoal.d.ts +12 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoal.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoal.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoal.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalClearParams.d.ts +4 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalClearParams.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalClearParams.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalClearParams.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalClearResponse.d.ts +4 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalClearResponse.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalClearResponse.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalClearResponse.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalGetParams.d.ts +4 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalGetParams.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalGetParams.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalGetParams.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalGetResponse.d.ts +5 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalGetResponse.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalGetResponse.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalGetResponse.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalSetParams.d.ts +8 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalSetParams.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalSetParams.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalSetParams.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalSetResponse.d.ts +5 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalSetResponse.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalSetResponse.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalSetResponse.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalStatus.d.ts +2 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalStatus.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalStatus.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadGoalStatus.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts +2 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnSettingsUpdateParams.d.ts +6 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnSettingsUpdateParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/index.d.ts +8 -0
- package/dist/sdk/providers/codex-protocol/index.d.ts.map +1 -1
- package/dist/sdk/providers/codex.d.ts +5 -5
- package/dist/sdk/providers/codex.d.ts.map +1 -1
- package/dist/sdk/providers/codex.js +297 -26
- package/dist/sdk/providers/codex.js.map +1 -1
- package/dist/sdk/providers/index.d.ts +2 -1
- package/dist/sdk/providers/index.d.ts.map +1 -1
- package/dist/sdk/providers/index.js +2 -0
- package/dist/sdk/providers/index.js.map +1 -1
- package/dist/sdk/providers/managed-runner-entry.js +1 -0
- package/dist/sdk/providers/managed-runner-entry.js.map +1 -1
- package/dist/sdk/providers/staticSlashCommands.d.ts.map +1 -1
- package/dist/sdk/providers/staticSlashCommands.js +7 -1
- package/dist/sdk/providers/staticSlashCommands.js.map +1 -1
- package/dist/sdk/types.d.ts +5 -1
- package/dist/sdk/types.d.ts.map +1 -1
- package/dist/services/ProjectQueueService.d.ts +1 -0
- package/dist/services/ProjectQueueService.d.ts.map +1 -1
- package/dist/services/ProjectQueueService.js +98 -32
- package/dist/services/ProjectQueueService.js.map +1 -1
- package/dist/services/ServerSettingsService.d.ts +3 -1
- package/dist/services/ServerSettingsService.d.ts.map +1 -1
- package/dist/services/ServerSettingsService.js +4 -1
- package/dist/services/ServerSettingsService.js.map +1 -1
- package/dist/sessions/claude-summary.d.ts +1 -0
- package/dist/sessions/claude-summary.d.ts.map +1 -1
- package/dist/sessions/claude-summary.js +5 -3
- package/dist/sessions/claude-summary.js.map +1 -1
- package/dist/sessions/codex-reader.d.ts +11 -3
- package/dist/sessions/codex-reader.d.ts.map +1 -1
- package/dist/sessions/codex-reader.js +272 -98
- package/dist/sessions/codex-reader.js.map +1 -1
- package/dist/sessions/codex-rollout-lineage.d.ts +46 -0
- package/dist/sessions/codex-rollout-lineage.d.ts.map +1 -0
- package/dist/sessions/codex-rollout-lineage.js +209 -0
- package/dist/sessions/codex-rollout-lineage.js.map +1 -0
- package/dist/sessions/codex-rollout-window.d.ts +43 -0
- package/dist/sessions/codex-rollout-window.d.ts.map +1 -0
- package/dist/sessions/codex-rollout-window.js +175 -0
- package/dist/sessions/codex-rollout-window.js.map +1 -0
- package/dist/sessions/normalization.d.ts +18 -1
- package/dist/sessions/normalization.d.ts.map +1 -1
- package/dist/sessions/normalization.js +123 -8
- package/dist/sessions/normalization.js.map +1 -1
- package/dist/sessions/pagination.d.ts +5 -2
- package/dist/sessions/pagination.d.ts.map +1 -1
- package/dist/sessions/pagination.js.map +1 -1
- package/dist/sessions/provider-resolution.d.ts.map +1 -1
- package/dist/sessions/provider-resolution.js +3 -1
- package/dist/sessions/provider-resolution.js.map +1 -1
- package/dist/sessions/reader.d.ts +2 -22
- package/dist/sessions/reader.d.ts.map +1 -1
- package/dist/sessions/reader.js +10 -70
- package/dist/sessions/reader.js.map +1 -1
- package/dist/sessions/recap-overlays.d.ts +8 -3
- package/dist/sessions/recap-overlays.d.ts.map +1 -1
- package/dist/sessions/recap-overlays.js +43 -4
- package/dist/sessions/recap-overlays.js.map +1 -1
- package/dist/sessions/types.d.ts +25 -0
- package/dist/sessions/types.d.ts.map +1 -1
- package/dist/supervisor/Process.d.ts +9 -2
- package/dist/supervisor/Process.d.ts.map +1 -1
- package/dist/supervisor/Process.js +73 -18
- package/dist/supervisor/Process.js.map +1 -1
- package/dist/supervisor/Supervisor.d.ts +2 -2
- package/dist/supervisor/Supervisor.d.ts.map +1 -1
- package/dist/supervisor/Supervisor.js +15 -2
- package/dist/supervisor/Supervisor.js.map +1 -1
- package/dist/supervisor/provider-command.d.ts +8 -0
- package/dist/supervisor/provider-command.d.ts.map +1 -0
- package/dist/supervisor/provider-command.js +12 -0
- package/dist/supervisor/provider-command.js.map +1 -0
- package/dist/supervisor/types.d.ts +5 -1
- package/dist/supervisor/types.d.ts.map +1 -1
- package/dist/supervisor/types.js.map +1 -1
- package/dist/uploads/AttachmentStagingService.d.ts +11 -0
- package/dist/uploads/AttachmentStagingService.d.ts.map +1 -1
- package/dist/uploads/AttachmentStagingService.js +95 -27
- package/dist/uploads/AttachmentStagingService.js.map +1 -1
- package/dist/utils/jsonl.d.ts +10 -0
- package/dist/utils/jsonl.d.ts.map +1 -1
- package/dist/utils/jsonl.js +11 -7
- package/dist/utils/jsonl.js.map +1 -1
- package/package.json +2 -2
- package/client-dist/assets/App-BCuhyupw.js +0 -2
- package/client-dist/assets/AttachmentChip-DeFRfm3S.js +0 -1
- package/client-dist/assets/BrowserDebugToolbarButton-d5UWhDkL.js +0 -1
- package/client-dist/assets/FilePage-CFYA8Jmz.js +0 -1
- package/client-dist/assets/GlossaryContext-Cp_4G9df.js +0 -1
- package/client-dist/assets/MessageInput-COCoVatC.js +0 -3
- package/client-dist/assets/MessageList-BHFVgfnL.js +0 -6
- package/client-dist/assets/MessageList-C9Z7aFHx.css +0 -1
- package/client-dist/assets/NavigationLayout-BNRJ1SpX.js +0 -2
- package/client-dist/assets/NavigationLayout-ChjNahB_.css +0 -1
- package/client-dist/assets/NewSessionPage-CNO3t_Zi.js +0 -1
- package/client-dist/assets/ProjectSessionDefaultsModal-D7s41P9z.js +0 -1
- package/client-dist/assets/ProjectsPage-D2-mjMXS.js +0 -1
- package/client-dist/assets/ProviderBadge-C8td51kV.js +0 -1
- package/client-dist/assets/ProviderChildSessionDetail-B9xcZcb6.js +0 -129
- package/client-dist/assets/ProviderChildSessionDetail-rZPKSfqF.css +0 -1
- package/client-dist/assets/ProviderChildSessionPage-DuJN7uHD.js +0 -1
- package/client-dist/assets/SessionPage-UUYKBNUl.js +0 -36
- package/client-dist/assets/ThinkingControls-Yv0aTXJC.js +0 -1
- package/client-dist/assets/VoiceInputButton-COdV4sNA.js +0 -1
- package/client-dist/assets/activityBus-VjgeGPMB.js +0 -42
- package/client-dist/assets/index-8yMgG4-w.css +0 -1
- package/client-dist/assets/index-BlfKG1Oa.js +0 -16
- package/client-dist/assets/index-CgkTqljR.js +0 -2
- package/client-dist/assets/index-D47M-JMk.js +0 -33
- package/client-dist/assets/index-DnwFOiB5.js +0 -1
- package/client-dist/assets/sessionHistorySearch.worker-3xcA03g5.js +0 -60
- package/client-dist/assets/sourceRuntime-Dzap6qZX.js +0 -11
- package/client-dist/assets/sourceTransportPaths-CbOCoJJb.js +0 -1
- package/client-dist/assets/useProviders-BWp3tEXv.js +0 -1
- package/client-dist/assets/useRecentSessions-BeuekUHb.js +0 -1
- package/client-dist/assets/useRecentSessions-Bks9U2oh.css +0 -1
- package/client-dist/assets/useStableToolPreviewRendering-RDapEGRz.js +0 -9
- package/client-dist/assets/useStreamingEnabled-CiYhaw0s.js +0 -59
- package/client-dist/assets/useStreamingEnabled-DkWnufW2.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as K,r as o,j as n,g as M}from"./index-
|
|
1
|
+
import{u as K,r as o,j as n,g as M}from"./index-DP9HSR1Q.js";const T="_container_mqrtc_12",$="_button_mqrtc_17",G="_buttonLabel_mqrtc_34",H="_chevron_mqrtc_41",J="_chip_mqrtc_50",Q="_hasSelection_mqrtc_48",U="_fullWidth_mqrtc_74",V="_optionIcon_mqrtc_84",X="_overlay_mqrtc_96",Y="_sheet_mqrtc_106",Z="_header_mqrtc_127",ee="_title_mqrtc_135",te="_options_mqrtc_141",ne="_option_mqrtc_84",re="_selected_mqrtc_170",se="_checkbox_mqrtc_174",ce="_checked_mqrtc_188",oe="_checkboxSpacer_mqrtc_194",le="_singleSelect_mqrtc_201",ae="_colorDot_mqrtc_206",ie="_labelWrapper_mqrtc_213",de="_meta_mqrtc_221",ue="_label_mqrtc_213",he="_description_mqrtc_231",_e="_count_mqrtc_237",me="_clear_mqrtc_245",pe="_divider_mqrtc_253",fe="_groupLabel_mqrtc_259",be="_dropdown_mqrtc_268",xe="_model_mqrtc_279",ve="_alignRight_mqrtc_326",t={container:T,button:$,buttonLabel:G,chevron:H,chip:J,hasSelection:Q,fullWidth:U,optionIcon:V,overlay:X,sheet:Y,header:Z,title:ee,options:te,option:ne,selected:re,checkbox:se,checked:ce,checkboxSpacer:oe,singleSelect:le,colorDot:ae,labelWrapper:ie,meta:de,label:ue,description:he,count:_e,clear:me,divider:pe,groupLabel:fe,dropdown:be,model:xe,alignRight:ve},w=769;function a(...l){return l.filter(Boolean).join(" ")}function je({label:l,options:b,selected:s,onChange:i,multiSelect:u=!0,placeholder:y,placeholderContent:N,triggerContent:L,triggerTitle:g,align:S="left",fullWidth:j=!1,triggerVariant:E="default",panelVariant:C="default",triggerClassName:D,className:k=""}){const{t:h}=K(),[c,p]=o.useState(!1),[d,B]=o.useState(()=>window.innerWidth>=w),f=o.useRef(null),_=o.useRef(null),W=()=>{var e;(e=f.current)==null||e.blur(),p(r=>!r)},R=b.some(e=>e.clearSelection),I=e=>{if(e.disabled)return;if(e.clearSelection){i([]),p(!1);return}const{value:r}=e;u?s.includes(r)?i(s.filter(v=>v!==r)):i([...s,r]):(s.includes(r)?i([]):i([r]),p(!1))},O=()=>{i([])},m=o.useCallback(()=>{p(!1)},[]);o.useEffect(()=>{const e=()=>{B(window.innerWidth>=w)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),o.useEffect(()=>{if(!c)return;const e=r=>{r.key==="Escape"&&(r.preventDefault(),r.stopPropagation(),m())};return document.addEventListener("keydown",e,!0),()=>document.removeEventListener("keydown",e,!0)},[c,m]),o.useEffect(()=>{if(!c||!d)return;const e=r=>{_.current&&!_.current.contains(r.target)&&f.current&&!f.current.contains(r.target)&&m()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[c,d,m]),o.useEffect(()=>{if(c&&!d)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[c,d]),o.useEffect(()=>{var e;c&&((e=_.current)==null||e.focus())},[c]);const P=e=>{e.target===e.currentTarget&&(e.preventDefault(),e.stopPropagation(),m())},F=(()=>{if(s.length===0)return N??y??l;if(s.length===1){const e=b.find(r=>r.value===s[0]);return(e==null?void 0:e.label)||l}return`${l} (${s.length})`})(),x=C==="model",q=n.jsxs(n.Fragment,{children:[u&&s.length>0&&!R&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:a(t.option,t.clear),onClick:O,children:n.jsx("span",{className:t.label,children:h("filterClearAll")})}),n.jsx("div",{className:t.divider})]}),b.map(e=>{const r=e.clearSelection?s.length===0:s.includes(e.value),v=u&&!e.clearSelection;return n.jsxs(o.Fragment,{children:[(e.dividerBefore||e.groupLabelBefore)&&n.jsx("div",{className:t.divider}),e.groupLabelBefore&&n.jsx("div",{className:t.groupLabel,children:e.groupLabelBefore}),n.jsxs("button",{type:"button",className:a(t.option,r&&t.selected,!u&&t.singleSelect,x&&t.model),onClick:()=>I(e),disabled:e.disabled,"aria-pressed":r,children:[v&&n.jsx("span",{className:a(t.checkbox,r&&t.checked),"aria-hidden":"true",children:r&&n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})}),u&&e.clearSelection&&n.jsx("span",{className:t.checkboxSpacer,"aria-hidden":"true"}),e.color&&n.jsx("span",{className:t.colorDot,style:{backgroundColor:e.color},"aria-hidden":"true"}),e.icon&&n.jsx("span",{className:a(t.optionIcon,x&&t.model),"aria-hidden":"true",children:e.icon}),n.jsxs("span",{className:t.labelWrapper,children:[n.jsx("span",{className:t.label,children:e.label}),e.description&&n.jsx("span",{className:t.description,children:e.description})]}),e.meta&&n.jsx("span",{className:t.meta,children:e.meta}),e.count!==void 0&&n.jsx("span",{className:t.count,children:e.count})]})]},e.value)})]}),z=c&&!d?M.createPortal(n.jsx("div",{className:t.overlay,onClick:P,onMouseDown:e=>e.stopPropagation(),children:n.jsxs("div",{ref:_,className:a(t.sheet,k),role:"dialog",tabIndex:-1,"aria-label":h("filterByLabel",{label:l}),children:[n.jsx("div",{className:t.header,children:n.jsx("span",{className:t.title,children:l})}),n.jsx("div",{className:t.options,children:q})]})}),document.body):null,A=c&&d?n.jsx("div",{ref:_,className:a(t.dropdown,S==="right"&&t.alignRight,x&&t.model),role:"dialog",tabIndex:-1,"aria-label":h("filterByLabel",{label:l}),children:n.jsx("div",{className:t.options,children:q})}):null;return n.jsxs("div",{className:a(t.container,j&&t.fullWidth,k),children:[n.jsxs("button",{ref:f,type:"button",className:a(t.button,s.length>0&&t.hasSelection,j&&t.fullWidth,E==="chip"&&t.chip,D),onClick:W,title:g??h("filterByLabel",{label:l}),"aria-label":g??h("filterByLabel",{label:l}),"aria-haspopup":"listbox","aria-expanded":c,children:[n.jsx("span",{className:t.buttonLabel,children:L??F}),n.jsx("svg",{className:t.chevron,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),A,z]})}export{je as F};
|
package/client-dist/assets/{FloatingActionButton-CPVF8aGh.js → FloatingActionButton-DMj4jEx3.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,u as re,c as Te,d as ye,j as c,h as Ce}from"./index-
|
|
1
|
+
import{r as n,u as re,c as Te,d as ye,j as c,h as Ce}from"./index-DP9HSR1Q.js";import"./activityBus-DeWSCW9E.js";import{r as Re}from"./types-Cm98CR-a.js";import{g as De,a as Pe,b as Ee,u as Me,c as ee,d as Ne,e as je,f as we,h as X,i as ke,m as Be,V as Le,j as Ke,r as te}from"./VoiceInputButton-D-JMM9BT.js";import{u as Fe,g as We,a as Ae}from"./useProviders-NpVDnSAv.js";import{a as _e}from"./frontendReload-RsU7NgVs.js";import{u as $e,f as ne,c as Ve,h as Oe}from"./speechDraftTransaction-D0x_KIWP.js";import{D as Ue,a as He,S as ze,c as Ge,e as qe,s as Xe}from"./useSidebarWidth-CX5sAdCc.js";import{u as Je}from"./useFloatingActionButtonEnabled-BLm3ZEmC.js";import{s as Qe}from"./newSessionPrefill-B03klTbN.js";import{u as Ye}from"./Modal-B2SjK3d9.js";import{b as Ze}from"./sourceRuntime-DehqzGFl.js";import{P as et}from"./ProviderBadge-Cr5n2thE.js";import"./react-runtime-Dw4bUKEF.js";import"./deviceDetection-BVPclkty.js";function tt(){const{providers:o,loading:a}=Fe(),{settings:f,isLoading:v}=_e();return n.useMemo(()=>{if(a||v||o.length===0)return null;const I=new Set(We(o).map(T=>T.name)),p=f==null?void 0:f.newSessionDefaults,j=p!=null&&p.provider&&I.has(p.provider)?p.provider:null,x=o.find(T=>T.name===j)??Ae(o);if(!x)return null;const h=De(p,x.name,{model:x.name==="claude"?Re(Pe()):void 0});return{provider:x.name,modelId:Ee(x.name,x.models??[],h.model)}},[o,a,f,v])}const nt=830,rt=100,J=24,st=80;function it(o,a){const f=o-a,v=Math.min(f,nt);return(f-v)/2}function ct(){const o=Me();return n.useMemo(()=>{if(o<Ue)return null;const a=He(),v=o<a+600?ze:a,I=it(o,v),p=rt+J*2;if(I<p)return null;const j=J,x=Math.min(I-J*2,300);return{visible:!0,right:j,bottom:st,maxWidth:x}},[o])}function ot(){return`speech-target-${Ce()}`}function at(){const{t:o}=re(),a=tt();return a?c.jsx("span",{className:"composer-model-chip-static",title:o("floatingComposerModelChipTitle"),children:c.jsx(et,{provider:a.provider,model:a.modelId??void 0})}):null}function Ct(){const{t:o}=re(),a=Te(),f=ye(),v=Ye(),I=Ze(),p=n.useMemo(()=>Ge(I),[I]),j=ct(),{floatingActionButtonEnabled:x}=Je(),[h,T]=n.useState(!1),[m,se,g]=$e(p),[w,K]=n.useState(""),C=n.useRef(w);C.current=w;const[U,Q]=n.useState(null),A=n.useRef(null),[,_]=n.useState(0),E=n.useRef(null),R=n.useRef(null),H=n.useRef(null),u=n.useRef(null),l=n.useRef(null),S=n.useRef(new Map),D=n.useRef(null),M=n.useRef(null),$=n.useRef(null),z=n.useRef(!1),V=n.useRef(null),F=u.current,O=ee(m,w,F),W=F?Ne(m,O,F.end,F.replaceEnd??F.end):je(m,O,m.length),k=qe(f.pathname);n.useEffect(()=>{k&&Xe(k)},[k]),n.useEffect(()=>{var e,t;h&&((e=E.current)==null||e.focus(),(t=R.current)==null||t.prewarm())},[h]),n.useLayoutEffect(()=>{const e=V.current,t=E.current;!e||!t||m!==e.value||t.value!==e.value||(V.current=null,e.restore(t))},[m]),n.useEffect(()=>{if(!h)return;const e=t=>{H.current&&!H.current.contains(t.target)&&T(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[h]);const B=n.useCallback(e=>{const t=typeof e=="string"?e:void 0,r=R.current;if(t===void 0&&((r==null?void 0:r.isListening)===!0||A.current!==null)){$.current=we(g.getDraft(),C.current,u.current),r!=null&&r.isListening&&r.stopAndFinalize();return}const s=(t??m).trim();if(s){if(Qe(I,s),g.clearDraft(),T(!1),k){a(`${v}/new-session?projectId=${encodeURIComponent(k)}`);return}a(`${v}/new-session`)}},[m,k,a,g,v,I]),ie=e=>{var t;if(!(e.key==="Enter"&&e.nativeEvent.isComposing)){if(e.key==="Escape"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&(U==="transcribing"||U==="finalizing")){e.preventDefault(),e.stopPropagation(),pe();return}if(e.key==="Escape"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&((t=R.current)!=null&&t.isListening)){e.preventDefault(),e.stopPropagation(),R.current.toggle();return}e.key==="Enter"&&!e.shiftKey?(e.preventDefault(),B()):e.key==="Escape"&&T(!1)}},ce=n.useCallback(()=>{T(!0)},[]),oe=n.useCallback(()=>{const e=E.current,t=g.getDraft(),r=Math.max(0,Math.min((e==null?void 0:e.selectionStart)??t.length,t.length)),s=Math.max(r,Math.min((e==null?void 0:e.selectionEnd)??r,t.length)),i=ot(),d=Ke(r,s);l.current=i,u.current=d,S.current.set(i,d),V.current=null,D.current=null,z.current=!1,e&&(ne(e),e.setSelectionRange(r,s)),C.current="",K("")},[g]),b=n.useCallback(()=>{const e=M.current;e!==null&&(clearTimeout(e.timer),M.current=null)},[]);n.useEffect(()=>b,[b]);const P=n.useCallback((e,t)=>{var Z;const r=e!==void 0,s=E.current,i=u.current;if(!s||!i)return;const d=s.selectionStart,L=s.selectionEnd,xe=y=>d===L?A.current==="listening"?te(y,d,L):X(y):y.replaceSelectedAtMs===void 0&&y.end===d&&y.replaceEnd===L?y:te(y,d,L);d===L&&b();const Ie=C.current.trim().length>0;if(r&&(Ie||D.current!==null)){D.current={draft:t??g.getDraft(),start:d,end:L};return}const q=xe(i);A.current==="listening"&&q!==i&&((Z=R.current)==null||Z.beginInsertionBoundary()),u.current=q,l.current&&S.current.set(l.current,q),_(y=>y+1)},[b,g]),G=n.useCallback(()=>{if(b(),!u.current)return;const e=X(u.current);u.current=e,l.current&&S.current.set(l.current,e),_(t=>t+1)},[b]),ae=n.useCallback(()=>{window.setTimeout(()=>P(!0),0)},[P]),N=n.useCallback((e,t)=>{const r=Ve({textareaRef:E,getDraft:g.getDraft,setDraft:g.setDraft,setInterimTranscript:i=>{C.current=i,K(i)},speechInsertionRangeRef:u,activeSpeechTargetIdRef:l,speechInsertionRangesRef:S,pendingTextareaSelectionRef:V,pendingSpeechRetargetRef:D,onInsertionBoundary:()=>{var i;return(i=R.current)==null?void 0:i.beginInsertionBoundary()},onSpeechTargetChanged:()=>_(i=>i+1),onSmartTurnSend:B,composerEditedDuringSpeech:()=>z.current},e,t),s=t==null?void 0:t.speechTargetId;return s&&s!==l.current&&S.current.delete(s)&&_(i=>i+1),r},[g,B]),le=n.useCallback((e,t)=>{const r=t!=null&&t.speechTargetId?S.current.get(t.speechTargetId)??null:u.current,s=t!=null&&t.smartTurnCommand||D.current?0:ke(r);if(s>0){b();const i=setTimeout(()=>{const d=M.current;!d||d.timer!==i||(M.current=null,N(d.transcript,d.metadata))},s);M.current={timer:i,transcript:e,metadata:t};return}return b(),N(e,t)},[b,N]),Y=n.useCallback(()=>{const e=M.current;e!==null&&(clearTimeout(e.timer),M.current=null,N(e.transcript,e.metadata))},[N]),ue=n.useCallback(()=>{const e=ee(g.getDraft(),C.current,u.current);return Y(),e&&N(e),D.current=null,C.current="",K(""),ne(E.current),!!e},[N,g,Y]),de=n.useCallback(e=>{C.current=e,K(e)},[]),fe=n.useCallback((e,t)=>{if(A.current=e,e==="listening"&&P(),e===null){const r=l.current;r&&S.current.delete(r),u.current=null,l.current=null,D.current=null;const s=$.current;$.current=null,t==="completed"&&s!==null&&B(s)}Q(e)},[P,B]),pe=n.useCallback(()=>{var t;(t=R.current)==null||t.cancelProcessing(),b();const e=l.current;e&&S.current.delete(e),u.current=null,l.current=null,D.current=null,$.current=null,Q(null),K("")},[b]),he=n.useCallback(()=>({draftKey:p,speechTargetId:l.current??void 0}),[p]),me=/\/sessions\/[^/]+/.test(f.pathname),ge=!x||!j||f.pathname.endsWith("/new-session")||me,{right:be,bottom:Se,maxWidth:ve}=j??{right:24,bottom:80,maxWidth:200};return c.jsxs("div",{ref:H,className:`fab-container ${h?"fab-expanded":"fab-collapsed"}`,style:{right:`${be}px`,bottom:`${Se}px`,width:`${ve}px`,display:ge?"none":void 0},children:[h&&c.jsxs("div",{className:"fab-input-panel",children:[c.jsxs("div",{className:`speech-draft-field ${O?"has-interim":""}`,children:[c.jsxs("div",{className:"speech-draft-inline",children:[O&&c.jsxs("div",{className:"speech-draft-mirror","aria-hidden":"true",children:[c.jsx("span",{children:W.before}),W.separatorBefore,c.jsx("span",{className:"speech-interim-inline",children:W.transcript}),c.jsx("span",{className:"speech-interim-caret"}),W.separatorAfter,c.jsx("span",{children:W.after})]}),c.jsx("textarea",{ref:E,value:m,onChange:e=>{const t=e.target.value;if(b(),S.current.size>0){const r=new Map;for(const[s,i]of S.current)r.set(s,X(Be(m,t,i)));S.current=r,u.current=l.current!==null?r.get(l.current)??null:null}l.current!==null&&Oe(m,t)&&(z.current=!0),P(!0,t),se(t)},onKeyDown:ie,onSelect:P,onPointerUp:P,onClick:ae,onKeyUp:P,onCut:G,onCopy:G,onPaste:G,placeholder:o("fabPlaceholder"),className:"fab-textarea",rows:3})]}),w&&c.jsx("div",{className:"speech-interim-status",role:"status","aria-live":"polite","aria-label":"Tentative speech transcript",children:w})]}),c.jsxs("div",{className:"fab-input-toolbar",children:[c.jsx(at,{}),c.jsx(Le,{ref:R,onTranscript:le,onInterimTranscript:de,onListeningStart:oe,onListeningStop:ue,onPendingSpeechChange:fe,getTranscriptionContext:he,className:"toolbar-button"}),c.jsx("button",{type:"button",className:"fab-submit",onClick:B,disabled:!(m.trim()||U!==null||w),"aria-label":o("fabGoToNewSession"),children:"↵"})]})]}),c.jsx("button",{type:"button",className:`fab-button ${h?"fab-button-active":""}`,onClick:h?()=>T(!1):ce,"aria-label":o(h?"fabClose":"fabNewSession"),children:c.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:h?"fab-icon-rotated":"",children:[c.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),c.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}export{Ct as FloatingActionButton};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Dn=Object.defineProperty;var Bn=(e,t,n)=>t in e?Dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var De=(e,t,n)=>Bn(e,typeof t!="symbol"?t+"":t,n);import{u as tn,r as a,c as ws,j as s,g as sn,E as Zt,w as rt,U as nn,L as on,d as es,b as ts}from"./index-D47M-JMk.js";import{h as On,S as In,s as Be,v as Hn,w as Un,P as Wn,x as zn,y as Gn,G as Kn,z as qn,u as Vn,C as Yn,E as Xn,F as Jn,I as Qn,J as Zn,K as eo,L as to,M as so}from"./activityBus-VjgeGPMB.js";import{P as no}from"./PageHeader-DLhedAPm.js";import{a as an,u as oo,b as ao}from"./NavigationLayout-BNRJ1SpX.js";import{u as ss,b as io,M as wt,f as ro}from"./Modal-C59BcdHD.js";import{G as Es}from"./GlossaryContext-Cp_4G9df.js";import{i as Ls,s as co,e as St,u as Bt,f as lo,h as uo,D as ho,C as Xt,j as mo,k as fo,l as rn,m as yt,n as Ft,S as At,F as bs,G as cn,o as ln,p as go,q as $t,r as un,t as po,v as xo,w as vo,x as bo,y as _o,z as So,A as wo}from"./FileViewer-4aDxZNTu.js";import{u as yo}from"./useDocumentTitle-rx41kKWp.js";import{a as me,b as dn,aa as Ts,ab as Co}from"./sourceRuntime-Dzap6qZX.js";import{r as jo,s as Ms}from"./useSidebarWidth-CNuw7NNf.js";import{u as ko}from"./useRelativeNow-B6kyvcmL.js";import{g as No,a as Ro}from"./frontendReload-t1MBqojn.js";import{u as Eo}from"./useSourceControlCleanLanding-BSY1vDSq.js";import{MainContent as Lo}from"./index-DnwFOiB5.js";import{a as hn}from"./appHref-ByaEnJGJ.js";import{p as To}from"./sourceControlNavigationState-w3TYNwib.js";import{S as mn}from"./SourceFileHeaderActions-czvC1JKL.js";import{u as Mo,g as Po,a as Fo}from"./useProviders-BWp3tEXv.js";import"./react-runtime-Dw4bUKEF.js";import"./text-BehwCDu9.js";import"./HostIdentityMarker-DKxUjPEf.js";import"./HostIdentityContext-BuhXEIrO.js";import"./useFileActivity-C70dzD5U.js";import"./ProviderBadge-C8td51kV.js";import"./YepAnywhereLogo-B15FCqEj.js";import"./sourceTransportPaths-CbOCoJJb.js";import"./index-CgkTqljR.js";import"./MarkdownPreview-AEv1dNzV.js";import"./newSessionPrefill-B03klTbN.js";import"./types-Cm98CR-a.js";const Ao="_container_132g3_23",$o="_button_132g3_31",Do="_text_132g3_51",Bo="_chevron_132g3_66",Oo="_dropdown_132g3_77",Io="_options_132g3_91",Ho="_option_132g3_91",Uo="_selected_132g3_114",Wo="_name_132g3_118",zo="_meta_132g3_126",Go="_overlay_132g3_132",Ko="_sheet_132g3_142",qo="_header_132g3_162",Vo="_title_132g3_167",We={container:Ao,button:$o,text:Do,chevron:Bo,dropdown:Oo,options:Io,option:Ho,selected:Uo,name:Wo,meta:zo,overlay:Go,sheet:Ko,header:qo,title:Vo},Ps=769;function Yo({currentProjectId:e,currentProjectName:t,onProjectChange:n}){const{t:o}=tn(),[i,r]=a.useState(!1),[u,l]=a.useState(()=>window.innerWidth>=Ps),c=a.useRef(null),m=a.useRef(null),d=ws(),_=ss(),{projects:y,loading:v}=an(),p=y.find(b=>b.id===e),k=(p==null?void 0:p.name)??t??o("projectSelectorFallback"),E=()=>{var b;(b=c.current)==null||b.blur(),r(!0)},g=b=>{b.id!==e&&(n?n(b):d(`${_}/new-session?projectId=${encodeURIComponent(b.id)}`)),r(!1)},x=a.useCallback(()=>{r(!1)},[]);a.useEffect(()=>{const b=()=>{l(window.innerWidth>=Ps)};return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]),a.useEffect(()=>{if(!i)return;const b=z=>{z.key==="Escape"&&(z.preventDefault(),z.stopPropagation(),x())};return document.addEventListener("keydown",b,!0),()=>document.removeEventListener("keydown",b,!0)},[i,x]),a.useEffect(()=>{if(!i||!u)return;const b=z=>{m.current&&!m.current.contains(z.target)&&c.current&&!c.current.contains(z.target)&&x()};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[i,u,x]),a.useEffect(()=>{if(i&&!u)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[i,u]),a.useEffect(()=>{var b;i&&((b=m.current)==null||b.focus())},[i]);const N=b=>{b.target===b.currentTarget&&(b.preventDefault(),b.stopPropagation(),x())};if(!v&&y.length<=1)return s.jsx("span",{className:"session-title",children:k});const C=s.jsx("div",{className:We.options,children:y.map(b=>{const z=b.id===e;return s.jsxs("button",{type:"button",className:`${We.option} ${z?We.selected:""}`,onClick:()=>g(b),children:[s.jsx("span",{className:We.name,children:b.name}),s.jsx("span",{className:We.meta,children:o("projectSelectorSessionsCount",{count:b.sessionCount})})]},b.id)})}),S=i&&!u?sn.createPortal(s.jsx("div",{className:We.overlay,onClick:N,onMouseDown:b=>b.stopPropagation(),children:s.jsxs("div",{ref:m,className:We.sheet,role:"dialog",tabIndex:-1,"aria-label":o("projectSelectorSelectProject"),children:[s.jsx("div",{className:We.header,children:s.jsx("span",{className:We.title,children:o("projectSelectorSelectProject")})}),C]})}),document.body):null,w=i&&u?s.jsx("div",{ref:m,className:We.dropdown,role:"dialog",tabIndex:-1,"aria-label":o("projectSelectorSelectProject"),children:C}):null;return s.jsxs("div",{className:`project-selector-container ${We.container}`,children:[s.jsxs("button",{ref:c,type:"button",className:`project-selector-button ${We.button}`,onClick:E,title:o("projectSelectorChangeProject"),"aria-haspopup":"listbox","aria-expanded":i,children:[s.jsx("span",{className:`project-selector-text ${We.text}`,children:k}),s.jsx("svg",{className:We.chevron,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:s.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),w,S]})}function Xo(){return document.visibilityState==="visible"&&document.hasFocus()}function Jo(e){return document.addEventListener("visibilitychange",e),window.addEventListener("focus",e),window.addEventListener("blur",e),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("focus",e),window.removeEventListener("blur",e)}}function Qo(){return a.useSyncExternalStore(Jo,Xo,()=>!1)}function Zo({projectId:e,status:t,routeRetentionKey:n,supportsRemoteCheck:o,supportsPull:i,supportsPush:r,supportsIntegrationOptions:u,onRefreshStatus:l,t:c}){const[m,d]=a.useState(null),[_,y]=a.useState(!1),[v,p]=a.useState(null),[k,E]=a.useState(null),[g,x]=a.useState(!1),[N,C]=a.useState(null),[S,w]=a.useState(null),[b,z]=a.useState(!1),[M,R]=a.useState(null),[L,O]=a.useState(null),[I,ee]=a.useState(!1),[P,V]=a.useState(null);a.useEffect(()=>{d(null),p(null),y(!1),E(null),C(null),x(!1),w(null),R(null),z(!1),O(null),V(null),ee(!1)},[e]);const j=_||g||b,F=oa(k,S),G=F?`${F.ahead}:${F.behind}:${F.upstream??""}`:"";a.useEffect(()=>{if(!e||!u||!G){O(null),V(null),ee(!1);return}let Y=!1;return ee(!0),O(null),V(null),me.getGitIntegrationOptions(e).then(ce=>{Y||O(ce)}).catch(ce=>{Y||V(ce instanceof Error?ce.message:c("gitStatusAutoOptionsFailed"))}).finally(()=>{Y||ee(!1)}),()=>{Y=!0}},[G,e,u,c]);const se=a.useCallback(async()=>{if(!(!e||!o||j)){y(!0),d(null),p(null),E(null),C(null),w(null),R(null),O(null),V(null);try{const Y=await me.checkGitRemote(e);d(Y),Y.status==="checked"&&await l()}catch(Y){p(Y instanceof Error?Y.message:c("gitStatusRemoteCheckFailed"))}finally{y(!1)}}},[j,l,e,o,c]),ne=a.useCallback(async()=>{if(!(!e||!i||j)){x(!0),E(null),C(null),d(null),p(null),w(null),R(null),O(null),V(null);try{const Y=await me.pullGit(e);E(Y),Y.status==="pulled"&&(n&&Ls(n),await l())}catch(Y){C(Y instanceof Error?Y.message:c("gitStatusPullFailed"))}finally{x(!1)}}},[j,l,e,n,i,c]),Q=a.useCallback(async()=>{if(!(!e||!r||j)){z(!0),w(null),R(null),d(null),p(null),E(null),C(null),O(null),V(null);try{const Y=await me.pushGit(e);w(Y),(Y.status==="pushed"||Y.status==="published"||Y.status==="up-to-date")&&(n&&Ls(n),await l())}catch(Y){R(Y instanceof Error?Y.message:c("gitStatusPushFailed"))}finally{z(!1)}}},[j,l,e,n,r,c]),J=v??ta(m,c),H=v||((m==null?void 0:m.status)??"checked")!=="checked"?"warning":m||t!=null&&t.checkedRemoteAt?"success":null,f=N??sa(k,c),B=N||k&&k.status!=="pulled"?"warning":k?"success":null,U=M??na(S,c),T=M||S&&!["pushed","published","up-to-date"].includes(S.status)?"warning":S?"success":null,$=J||f||U,X=J?H:f?B:U?T:null;return{supportsRemoteCheck:o,supportsPull:i,supportsPush:r,supportsIntegrationOptions:u,isRunning:j,isCheckingRemote:_,isPulling:g,isPushing:b,handleCheckRemote:se,handlePull:ne,handlePush:Q,checkedRemoteAt:(S==null?void 0:S.checkedRemoteAt)??(k==null?void 0:k.checkedRemoteAt)??(m==null?void 0:m.checkedRemoteAt)??(t==null?void 0:t.checkedRemoteAt)??null,checkFeedback:J,checkFeedbackTone:H,pullFeedback:f,pullFeedbackTone:B,pushFeedback:U,pushFeedbackTone:T,actionFeedback:$,actionFeedbackTone:X,divergedActionStatus:F,integrationOptions:L,isLoadingIntegrationOptions:I,integrationOptionsError:P}}function ea(e,t,n){if(!e)return n("gitStatusRemoteUnknown");const o=Date.parse(e);if(!Number.isFinite(o))return e;const i=Math.max(0,t-o),r=60*1e3,u=60*r,l=24*u;return i<r?n("gitStatusRemoteJustNow"):i<u?n("gitStatusRemoteMinutesAgo",{count:Math.floor(i/r)}):i<l?n("gitStatusRemoteHoursAgo",{count:Math.floor(i/u)}):new Date(o).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function ta(e,t){switch(e==null?void 0:e.status){case"checked":return t("gitStatusRemoteCheckSuccess");case"busy":return t("gitStatusRemoteCheckBusy");case"not-a-git-repo":return t("gitStatusRemoteCheckNotRepo");case"failed":return t("gitStatusRemoteCheckFailed");default:return""}}function sa(e,t){switch(e==null?void 0:e.status){case"pulled":return fn(e.commitsAdvanced)?e.commitsAdvanced===0?t("gitStatusPullAlreadyUpToDate"):t(e.commitsAdvanced===1?"gitStatusPullSuccessSingle":"gitStatusPullSuccessMultiple",{count:e.commitsAdvanced}):t("gitStatusPullSuccess");case"busy":return t("gitStatusPullBusy");case"not-a-git-repo":return t("gitStatusPullNotRepo");case"failed":return Jt(e.gitStatus)?t("gitStatusPullDiverged",{ahead:e.gitStatus.ahead,behind:e.gitStatus.behind}):t("gitStatusPullFailed");default:return""}}function na(e,t){switch(e==null?void 0:e.status){case"pushed":return fn(e.commitsAdvanced)?t(e.commitsAdvanced===1?"gitStatusPushSuccessSingle":"gitStatusPushSuccessMultiple",{count:e.commitsAdvanced}):t("gitStatusPushSuccess");case"published":return t("gitStatusPushPublished");case"up-to-date":return t("gitStatusPushAlreadyUpToDate");case"busy":return t("gitStatusPushBusy");case"no-upstream":return t("gitStatusPushNoUpstream");case"rejected":return Jt(e.gitStatus)?t("gitStatusPushDiverged",{ahead:e.gitStatus.ahead,behind:e.gitStatus.behind}):t("gitStatusPushRejected");case"not-a-git-repo":return t("gitStatusPushNotRepo");case"failed":return t("gitStatusPushFailed");default:return""}}function fn(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Jt(e){return!!(e&&e.ahead>0&&e.behind>0)}function oa(e,t){return(e==null?void 0:e.status)==="failed"&&Jt(e.gitStatus)?e.gitStatus:(t==null?void 0:t.status)==="rejected"&&Jt(t.gitStatus)?t.gitStatus:null}function aa(e){const[t,n]=a.useState(()=>typeof window<"u"?window.matchMedia(e).matches:!1);return a.useEffect(()=>{const o=window.matchMedia(e);n(o.matches);const i=r=>{n(r.matches)};return o.addEventListener("change",i),()=>o.removeEventListener("change",i)},[e]),t}function ns(e,t=!1){var m;const[n,o]=a.useState([]),[i,r]=a.useState([]),[u,l]=a.useState([]),c=a.useCallback(async()=>{if(!e){o([]),r([]),l([]);return}try{const d=await me.listReviewComments(e);o(d.comments),r(d.batches)}catch{}if(t)try{l(await me.listReviewSiteStates(e))}catch{}else l([])},[t,e]);return a.useEffect(()=>{if(e)return c(),co(e,()=>{c()})},[e,c]),{pending:n.filter(d=>d.status==="pending"),archived:n.filter(d=>d.status==="archived"),batches:i,recentReviewSessionId:i.length>0?((m=i[i.length-1])==null?void 0:m.targetSessionId)??null:null,siteStates:u,refresh:c}}const ia={loading:!0,error:null,generation:null,headSha:null,baseSha:null,files:[],directories:[],truncated:!1,totalFiles:null};function ra(e,t){return e!==null&&e.tracked===t.tracked&&e.untracked===t.untracked&&e.ignored===t.ignored&&ca(e.expandedPrefixes,t.expandedPrefixes)&&(e.filesystemScan??"bounded")===(t.filesystemScan??"bounded")}function ca(e,t){return e===t||e!==void 0&&t!==void 0&&e.length===t.length&&e.every((n,o)=>n===t[o])}function la(e){const t={tracked:!1,untracked:!1,ignored:!1},n=new Set;let o=!1,i=!1;for(const r of e)if(t.tracked||(t.tracked=r.coverage.tracked),t.untracked||(t.untracked=r.coverage.untracked),t.ignored||(t.ignored=r.coverage.ignored),i||(i=r.coverage.filesystemScan==="complete"),r.coverage.expandedPrefixes===void 0)o=!0;else for(const u of r.coverage.expandedPrefixes)n.add(u);return{...t,...o?{}:{expandedPrefixes:[...n].sort()},...i?{filesystemScan:"complete"}:{}}}function ua(e){if(!e||typeof e!="object"||!("type"in e))return!1;const t=e.type;return t==="git-worktree-snapshot"||t==="git-worktree-delta"}function da(e,t){return e!==null&&e.epoch===t.epoch&&t.sequence===e.sequence+1}class ha{constructor(t,n,o){De(this,"listeners",new Set);De(this,"leases",new Map);De(this,"files",new Map);De(this,"directories",new Map);De(this,"snapshot",ia);De(this,"stream",null);De(this,"activeCoverage",null);De(this,"nextLeaseId",1);De(this,"getSnapshot",()=>this.snapshot);De(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));this.projectId=t,this.transport=n,this.onEmpty=o}retain(t){const n=this.nextLeaseId++;return this.leases.set(n,{coverage:{...t,...t.expandedPrefixes?{expandedPrefixes:[...t.expandedPrefixes]}:{}}}),this.syncStream(),()=>{var o;if(this.leases.delete(n)){if(this.leases.size===0){(o=this.stream)==null||o.close(),this.stream=null,this.activeCoverage=null,this.onEmpty();return}this.syncStream()}}}syncStream(){var o;const t=la(this.leases.values());if(ra(this.activeCoverage,t)&&this.stream)return;(o=this.stream)==null||o.close(),this.activeCoverage=t;const n=On(this.transport,{subscribe:({transport:i,handlers:r})=>i.subscribeWorktree(this.projectId,t,r),onEvent:i=>{this.stream!==n||!ua(i.data)||this.applyEvent(i.data)},onError:i=>{this.stream===n&&this.publish({...this.snapshot,loading:this.snapshot.generation===null,error:i})}},{autoStart:!1,inactivityTimeoutMs:In});this.stream=n,this.snapshot.generation===null&&this.publish({...this.snapshot,loading:!0,error:null}),n.start()}applyEvent(t){if(t.type==="git-worktree-snapshot"){this.applySnapshot(t);return}this.applyDelta(t)}applySnapshot(t){this.files.clear();for(const n of t.files)this.files.set(n.path,n);this.directories.clear();for(const n of t.directories??[])this.directories.set(n.path,n);this.publish({loading:!1,error:null,generation:t.generation,headSha:t.headSha,baseSha:t.baseSha,files:[...this.files.values()],directories:[...this.directories.values()],truncated:t.truncated,totalFiles:t.totalFiles??null})}applyDelta(t){var n,o;if(!da(this.snapshot.generation,t.generation)){if(((n=this.snapshot.generation)==null?void 0:n.epoch)===t.generation.epoch&&t.generation.sequence<=this.snapshot.generation.sequence)return;(o=this.stream)==null||o.restart();return}for(const i of t.changes)i.changeType==="delete"?this.files.delete(i.path):i.file&&this.files.set(i.path,i.file);for(const i of t.directoryChanges??[])i.changeType==="delete"?this.directories.delete(i.path):i.directory&&this.directories.set(i.path,i.directory);this.publish({loading:!1,error:null,generation:t.generation,headSha:t.headSha,baseSha:t.baseSha,files:[...this.files.values()],directories:[...this.directories.values()],truncated:t.truncated??this.snapshot.truncated,totalFiles:t.totalFiles===void 0?this.snapshot.totalFiles:t.totalFiles})}publish(t){if(this.snapshot===t)return;this.snapshot=t;const n=Array.from(this.listeners);for(const o of n)o()}}const zt=new Map;function ma(e,t){return`${e}\0${t}`}function fa(e,t,n){const o=ma(e,t),i=zt.get(o);if(i)return i;let r;return r=new ha(t,n,()=>{zt.get(o)===r&&zt.delete(o)}),zt.set(o,r),r}const ga={loading:!1,error:null,generation:null,headSha:null,baseSha:null,files:[],directories:[],truncated:!1,totalFiles:null},_s=a.createContext(!1);function gn(e,t,n,o,i=!1,r=5e3){const u=io(),l=a.useContext(_s),c=o??l,m=a.useMemo(()=>n?fa(u.sourceKey,e,u.transport):null,[n,e,u.sourceKey,u.transport]),{expandedPrefixes:d,filesystemScan:_,ignored:y,tracked:v,untracked:p}=t,k=d==null?void 0:d.join("\0");a.useEffect(()=>{if(!(!m||c))return m.retain({ignored:y,tracked:v,untracked:p,...k===void 0?{}:{expandedPrefixes:k===""?[]:k.split("\0")},..._===void 0?{}:{filesystemScan:_}})},[k,_,y,c,m,v,p]);const E=a.useSyncExternalStore((m==null?void 0:m.subscribe)??pa,(m==null?void 0:m.getSnapshot)??Fs,Fs),g=a.useRef({store:m,snapshot:E}),x=a.useRef(c),N=a.useRef(null),C=a.useRef(!1),[,S]=a.useState(0),w=x.current&&!c;x.current=c,(g.current.store!==m||!c&&(!i||w||C.current)||g.current.snapshot.generation===null)&&(g.current={store:m,snapshot:E},C.current=!1,N.current=null);const b=!c&&i&&g.current.snapshot!==E;return a.useEffect(()=>{if(!b){N.current=null;return}const z=Date.now();N.current??(N.current=z+r);const M=setTimeout(()=>{C.current=!0,N.current=null,S(R=>R+1)},Math.max(0,N.current-z));return()=>clearTimeout(M)},[r,b]),g.current.snapshot}function pa(){return()=>{}}function Fs(){return ga}const xa="_revisionsHidden_1l9me_1",va="_handleGlyph_1l9me_7",hs={revisionsHidden:xa,handleGlyph:va},Gt=0,Kt=420,Mt=220,ba=380,As=16,_a=12,Sa=26;function $s({layout:e,containerWidth:t,revisionWidth:n,gapWidth:o,handleWidth:i}){const r=e==="history"?n+o:0;return Math.max(Mt,Math.floor(t-r-o/2-i/2))}function wa({containerWidth:e,gapWidth:t,naturalDetailWidth:n,currentFilesWidth:o,defaultFilesWidth:i,filesMax:r}){const u=Math.min(o,i);return Vt(Math.floor(e-t-n),u,r)}function ys({layout:e,enabled:t=!0,revisionPaneVisible:n=!0,initialFilesWidth:o,naturalDetailWidth:i,className:r,children:u,t:l}){const c=a.useRef(null),m=a.useRef(n),d=a.useRef(300),_=a.useRef(!1),y=a.useRef(null),v=a.useRef(null),p=a.useRef(null),k=a.useRef(!1),E=o??(e==="history"?340:ba),[g,x]=a.useState(()=>({revisions:300,files:E})),[N,C]=a.useState(!n),[S,w]=a.useState(null),[b,z]=a.useState(null),M=N?0:g.revisions,R=b?$s({layout:e,containerWidth:b.containerWidth,revisionWidth:M,gapWidth:b.gapWidth,handleWidth:b.handleWidth}):void 0;a.useEffect(()=>{m.current!==n&&(m.current=n,C(!n))},[n]),a.useLayoutEffect(()=>{const j=c.current;if(!j)return;const F=()=>{const se=getComputedStyle(j),ne=Number.parseFloat(se.columnGap),Q=j.querySelector(".source-pane-splitter-handle"),J={containerWidth:j.clientWidth,gapWidth:Number.isFinite(ne)?ne:_a,handleWidth:(Q==null?void 0:Q.offsetWidth)||Sa};J.containerWidth<=0||z(H=>H&&H.containerWidth===J.containerWidth&&H.gapWidth===J.gapWidth&&H.handleWidth===J.handleWidth?H:J)};if(F(),typeof ResizeObserver>"u")return window.addEventListener("resize",F),()=>window.removeEventListener("resize",F);const G=new ResizeObserver(F);return G.observe(j),()=>G.disconnect()},[]),a.useLayoutEffect(()=>{R!==void 0&&x(j=>j.files<=R?j:{...j,files:R})},[R]),a.useLayoutEffect(()=>{e!=="files"||i===void 0||b===null||R===void 0||x(j=>{const F=wa({containerWidth:b.containerWidth,gapWidth:b.gapWidth,naturalDetailWidth:i,currentFilesWidth:j.files,defaultFilesWidth:E,filesMax:R});return F===j.files?j:{...j,files:F}})},[E,R,e,b,i]),a.useEffect(()=>{if(!S)return;const j=c.current;if(!j)return;const F=Q=>{const J=Q-S.startX;let H;if(S.boundary==="revisions"){const f=Vt(S.startWidths.revisions+J,Gt,Kt),B=b?Math.min(S.startWidths.files,$s({layout:e,containerWidth:b.containerWidth,revisionWidth:f,gapWidth:b.gapWidth,handleWidth:b.handleWidth})):S.startWidths.files;H={revisions:f,files:B},f>0&&(d.current=f),j.classList.toggle(hs.revisionsHidden,f===0),j.style.setProperty("--source-revision-column-width",`${f}px`),j.style.setProperty("--source-files-column-width",`${B}px`)}else{const f=Vt(S.startWidths.files+J,Mt,R??S.startWidths.files);H={...S.startWidths,files:f},j.style.setProperty("--source-files-column-width",`${f}px`)}p.current=H},G=()=>{y.current=null;const Q=v.current;v.current=null,Q!==null&&F(Q)},se=Q=>{const J=Q.clientX-S.startX;if(Math.abs(J)>3&&(_.current=!0),v.current=Q.clientX,y.current===null){if(typeof window.requestAnimationFrame!="function"){G();return}y.current=window.requestAnimationFrame(G)}},ne=()=>{y.current!==null&&(window.cancelAnimationFrame(y.current),y.current=null),G();const Q=p.current??S.startWidths;x(Q),S.boundary==="revisions"&&C(Q.revisions===0),k.current=_.current,window.setTimeout(()=>{k.current=!1},0),p.current=null,w(null)};return window.addEventListener("pointermove",se),window.addEventListener("pointerup",ne,{once:!0}),window.addEventListener("pointercancel",ne,{once:!0}),document.body.classList.add("source-pane-resizing"),()=>{y.current!==null&&(window.cancelAnimationFrame(y.current),y.current=null),v.current=null,p.current=null,window.removeEventListener("pointermove",se),window.removeEventListener("pointerup",ne),window.removeEventListener("pointercancel",ne),document.body.classList.remove("source-pane-resizing")}},[S,R,e,b]);const L=(j,F)=>{const G=Vt(F,j==="revisions"?Gt:Mt,j==="revisions"?Kt:R??g.files);j==="revisions"&&(G>0&&(d.current=G),C(G===0)),x(se=>({...se,[j]:G}))},O=(j,F)=>{if(j.button!==0)return;j.preventDefault(),_.current=!1,v.current=null;const G=F==="revisions"?{...g,revisions:M}:g;p.current=G,w({boundary:F,startX:j.clientX,startWidths:G})},I=()=>{if(k.current){k.current=!1;return}if(M===0){const j=d.current;x(F=>({...F,revisions:j})),C(!1);return}d.current=M,C(!0)},ee=(j,F)=>{if(F==="revisions"&&(j.key==="Enter"||j.key===" ")){j.preventDefault(),I();return}const G=F==="revisions"?M:g.files,se=F==="revisions"?Gt:Mt,ne=F==="revisions"?Kt:R??G,Q=j.key==="ArrowLeft"?G-As:j.key==="ArrowRight"?G+As:j.key==="Home"?se:j.key==="End"?ne:null;Q!==null&&(j.preventDefault(),L(F,Q))},P={"--source-revision-column-width":`${M}px`,"--source-files-column-width":`${g.files}px`},V=e==="history"&&n?["revisions","files"]:["files"];return s.jsxs("div",{ref:c,className:`${r} ${e==="history"&&M===0?hs.revisionsHidden:""}`.trimEnd(),style:P,children:[u,t&&V.map(j=>s.jsxs("div",{className:`source-pane-splitter source-pane-splitter-${j} ${(S==null?void 0:S.boundary)===j?"dragging":""}`,children:[s.jsx("span",{className:"source-pane-splitter-guide","aria-hidden":"true"}),["top","bottom"].map(F=>s.jsx("hr",{className:`source-pane-splitter-handle ${hs.handleGlyph} ${F}`,"aria-label":l(j==="revisions"?"sourceResizeRevisionPane":"sourceResizeFilePane"),"aria-orientation":"vertical","aria-valuemin":j==="revisions"?Gt:Mt,"aria-valuemax":j==="revisions"?Kt:R,"aria-valuenow":j==="revisions"?M:g.files,title:j==="revisions"?l(M===0?"sourceShowRevisionPane":"sourceHideRevisionPane"):void 0,tabIndex:0,onPointerDown:G=>O(G,j),onClick:j==="revisions"?I:void 0,onKeyDown:G=>ee(G,j)},F))]},j))]})}function Vt(e,t,n){return Math.min(n,Math.max(t,e))}const ya="_outline_g5nwk_1",Ca="_group_g5nwk_8",ja="_groupButton_g5nwk_13",ka="_disclosure_g5nwk_36",Na="_groupLabel_g5nwk_43",Ra="_groupStatuses_g5nwk_52",Ea="_groupCount_g5nwk_59",La="_children_g5nwk_70",Ta="_sectionDivider_g5nwk_77",Ma="_sectionDividerButton_g5nwk_101",Pa="_sectionDisclosure_g5nwk_115",Ke={outline:ya,group:Ca,groupButton:ja,disclosure:ka,groupLabel:Na,groupStatuses:Ra,groupCount:Ea,children:La,sectionDivider:Ta,sectionDividerButton:Ma,sectionDisclosure:Pa};function os(e,t){const n=t==null?void 0:t.trim();if(!n)return null;const o=e.toLowerCase().indexOf(n.toLowerCase());if(o<0)return null;const i=o+n.length;return{start:o,end:i,prefix:e.slice(0,o),text:e.slice(o,i),suffix:e.slice(i)}}const Fa="_withMatch_rc7xr_1",Aa="_matchPrefix_rc7xr_6",$a="_matchSuffix_rc7xr_7",Da="_match_rc7xr_6",Ba="_wrapMatchOnNarrow_rc7xr_41",Nt={withMatch:Fa,matchPrefix:Aa,matchSuffix:$a,match:Da,wrapMatchOnNarrow:Ba};function bt({text:e,query:t,wrapMatchOnNarrow:n=!1,className:o,...i}){const r=os(e,t),u=[r?Nt.withMatch:"",r&&n?Nt.wrapMatchOnNarrow:"",o].filter(Boolean).join(" ");return r?s.jsxs("span",{...i,className:u,children:[r.prefix&&s.jsx("span",{className:Nt.matchPrefix,children:r.prefix}),s.jsx("mark",{className:Nt.match,children:r.text}),r.suffix&&s.jsx("span",{className:Nt.matchSuffix,children:r.suffix})]}):s.jsx("span",{...i,className:u,children:e})}const Oa="_path_yev28_1",Ia="_pathWithMatch_yev28_12",Ha="_reviewStates_yev28_31",Ua="_reviewState_yev28_31",Wa="_open_yev28_47",za="_addressed_yev28_51",Ga="_changed_yev28_55",Ka="_unchanged_yev28_59",qa="_unavailable_yev28_60",nt={path:Oa,pathWithMatch:Ia,reviewStates:Ha,reviewState:Ua,open:Wa,addressed:za,changed:Ga,unchanged:Ka,unavailable:qa};function as({path:e,children:t,...n}){const o=Zt(e);return s.jsx("button",{...n,...o,children:t})}function is({children:e,query:t,fullPath:n,className:o,...i}){const r=typeof e=="string"?e:null,u=[nt.path,r&&os(r,t)?nt.pathWithMatch:"",o].filter(Boolean).join(" ");return r?s.jsx(bt,{...i,className:u,"data-source-path":n??r,text:r,query:t,wrapMatchOnNarrow:!0}):s.jsx("span",{...i,className:u,children:e})}const Va={M:"sourceFileStatusModified",A:"sourceFileStatusAdded",D:"sourceFileStatusDeleted",R:"sourceFileStatusRenamed",C:"sourceFileStatusCopied",T:"sourceFileStatusTypeChanged",U:"sourceFileStatusUnmerged","?":"sourceFileStatusUntracked"};function Ot({status:e,t}){const n=t(Va[e]??"sourceFileStatusChanged"),o=`${e} — ${n}`,i=Zt(o);return s.jsx("span",{className:`git-status-badge git-status-${e.toLowerCase()}`,role:"img","aria-label":o,...i,children:e})}function pn({states:e,t}){if(e.length===0)return null;const n=e.filter(m=>m.state==="open").length,o=e.length-n,i=e.filter(m=>m.changeStatus==="changed").length,r=e.filter(m=>m.changeStatus==="unchanged").length,u=e.length-i-r,l=n>0?{label:t("sourceReviewStateOpen"),count:n,className:nt.open}:{label:t("sourceReviewStateAddressed"),count:o,className:nt.addressed},c=i>0?{label:t("sourceReviewSourceChanged"),count:i,className:nt.changed}:r>0?{label:t("sourceReviewSourceUnchanged"),count:r,className:nt.unchanged}:{label:t("sourceReviewSourceUnavailable"),count:u,className:nt.unavailable};return s.jsxs("span",{className:nt.reviewStates,children:[s.jsx(Ds,{...l,t}),s.jsx(Ds,{...c,t})]})}function Ds({label:e,count:t,className:n,t:o}){const i=o("sourceReviewSiteStateCount",{state:e,count:t}),r=Zt(i);return s.jsxs("span",{className:`${nt.reviewState} ${n}`,...r,children:[e," ",t]})}const Ya=14,Bs=29,xn=[];function Xa(e){return Cs(vn(e,xn))}function Ss({children:e,expanded:t,onToggle:n}){return n?s.jsxs("button",{type:"button",className:`${Ke.sectionDivider} ${Ke.sectionDividerButton}`,"aria-expanded":t,onClick:n,children:[s.jsx("span",{className:Ke.sectionDisclosure,"aria-hidden":"true",children:t?"▾":"▸"}),s.jsx("span",{children:e})]}):s.jsx("div",{className:Ke.sectionDivider,children:s.jsx("span",{children:e})})}function Pt({items:e,directories:t=xn,expandedDirectories:n,onToggleDirectory:o,scopeKey:i,query:r,className:u,activeItemId:l,focusRequest:c=0,toggleAllOnEnter:m=!1,renderFile:d,t:_,onKeyDown:y,...v}){const p=a.useRef(null),k=a.useRef(0),E=a.useRef(null),g=a.useRef(new Map),[x,N]=a.useState({}),[C,S]=a.useState(Ya),w=((r==null?void 0:r.trim().length)??0)>0,b=a.useMemo(()=>w?e.map(M=>({kind:"file",item:M,visiblePath:M.displayPath,pathProps:_n(M)})):Ja(e,t,i),[t,e,i,w]);a.useLayoutEffect(()=>{g.current.clear(),N({})},[]),a.useLayoutEffect(()=>{const M=p.current;if(!M)return;const R=ms(M),L=()=>{const I=(R==null?void 0:R.clientHeight)??M.clientHeight;I>0&&S(Math.max(1,Math.floor(I/Bs)))};if(L(),typeof ResizeObserver>"u")return;const O=new ResizeObserver(L);return O.observe(R??M),()=>O.disconnect()},[]),a.useLayoutEffect(()=>{var P;const M=Yt(b).filter(V=>!V.directory);if(M.length===0)return;const R=p.current,L=R?((P=ms(R))==null?void 0:P.clientHeight)??R.clientHeight:0,O=L>0?Math.max(1,Math.floor(L/Bs)):C;let I=Math.max(0,O-b.length),ee=!1;for(const V of M){if(g.current.has(V.key))continue;const j=V.children.length,F=j<=I;g.current.set(V.key,F),F&&(I-=j),ee=!0}ee&&N(V=>({...V}))},[C,b]),a.useLayoutEffect(()=>{if(c<=k.current||l===null||l===void 0||!e.some(R=>R.id===l))return;k.current=c,E.current=l;const M=Yt(b).filter(R=>!R.directory&&R.items.some(L=>L.id===l));M.length!==0&&N(R=>({...R,...Object.fromEntries(M.map(L=>[L.key,!0]))}))},[l,b,c,e]),a.useLayoutEffect(()=>{const M=E.current,R=p.current;if(!M||!R)return;const L=Array.from(R.querySelectorAll("[data-source-outline-id]")).find(I=>I.dataset.sourceOutlineId===M),O=L==null?void 0:L.closest("[data-source-list-item]");O&&(E.current=null,O.focus({preventScroll:!0}),ei(O,ms(R)))});const z=M=>{if(m&&M.key==="Enter"&&!M.altKey&&!M.ctrlKey&&!M.metaKey&&!M.shiftKey&&M.target instanceof HTMLElement&&M.target.closest("[data-source-list-item]")){if(M.preventDefault(),St(),M.repeat)return;const R=Yt(b).filter(O=>!O.directory),L=R.some(O=>!(x[O.key]??g.current.get(O.key)??!1));R.length>0&&N(O=>({...O,...Object.fromEntries(R.map(I=>[I.key,L||I.items.some(ee=>ee.id===l)]))}));return}y==null||y(M)};return s.jsx("ul",{...v,ref:p,className:[Ke.outline,u].filter(Boolean).join(" "),onKeyDown:z,children:Sn(b,x,g.current,(M,R)=>N(L=>({...L,[M]:!R})),n,o,d,_)})}function Ja(e,t,n){return bn(vn(e,t),"",n)}function vn(e,t){const n={files:[],directories:new Map};for(const o of e){const i=o.path.split("/").filter(Boolean);if(i.length<=1){n.files.push(o);continue}let r=n;for(const u of i.slice(0,-1)){let l=r.directories.get(u);l||(l={files:[],directories:new Map},r.directories.set(u,l)),r=l}r.files.push(o)}for(const o of t){const i=o.path.split("/").filter(Boolean);if(i.length===0)continue;let r=n;for(const u of i){let l=r.directories.get(u);l||(l={files:[],directories:new Map},r.directories.set(u,l)),r=l}r.directory=o}return n}function bn(e,t,n){const o=e.files.map(i=>({kind:"file",item:i,visiblePath:Qa(i,t),pathProps:_n(i)}));for(const[i,r]of e.directories){let u=r,l=`${t}${i}/`;for(;!u.directory&&u.files.length===0&&u.directories.size===1;){const m=u.directories.entries().next().value;if(!m)break;l+=`${m[0]}/`,u=m[1]}const c=Cs(u);o.push({kind:"group",key:`${n}\0${l}`,path:l,items:c,children:bn(u,l,n),statuses:Za(c),count:u.directory?u.files.length:c.length,...u.directory?{directory:u.directory}:{}})}return o}function _n(e){return{"data-source-outline-id":e.id,"data-source-outline-path":e.displayPath}}function Qa(e,t){return t?e.displayPath.split(" → ").map(n=>n.startsWith(t)?n.slice(t.length):n).join(" → "):e.displayPath}function Cs(e){return[...e.files,...Array.from(e.directories.values()).flatMap(Cs)]}function Za(e){const t=[],n=new Set;for(const o of e)for(const i of o.statuses??[])n.has(i)||(n.add(i),t.push(i));return t}function Yt(e){return e.flatMap(t=>t.kind==="group"?[t,...Yt(t.children)]:[])}function Sn(e,t,n,o,i,r,u,l){return e.map(c=>{var v,p,k,E;if(c.kind==="file")return u(c.item,c.visiblePath,c.pathProps);const m=!!(c.directory&&i&&r),d=m&&c.directory?(i==null?void 0:i.has(c.directory.path))===!0:t[c.key]??n.get(c.key)??!1,_=((v=c.directory)==null?void 0:v.pending)===!0&&d,y=c.directory?l(_?"sourceLoadingUntrackedFolder":d?"sourceCollapseDirectory":"sourceExpandDirectory",{path:c.path}):l(d?"sourceCollapsePathGroup":"sourceExpandPathGroup",{path:c.path,count:c.count});return s.jsxs("li",{className:Ke.group,children:[s.jsxs("button",{type:"button",className:Ke.groupButton,"data-source-list-item":!0,"aria-expanded":d,"aria-label":y,title:y,onClick:()=>{m&&c.directory&&r?r(c.directory.path,!d):o(c.key,d)},children:[s.jsx("span",{className:Ke.disclosure,"aria-hidden":"true",children:_?"…":d?"▾":"▸"}),s.jsx("span",{className:Ke.groupLabel,children:c.path}),c.statuses.length>0&&s.jsx("span",{className:Ke.groupStatuses,children:c.statuses.map(g=>s.jsx(Ot,{status:g,t:l},g))}),!((p=c.directory)!=null&&p.pending)&&s.jsxs("span",{className:Ke.groupCount,title:(k=c.directory)!=null&&k.truncated?l("sourceUntrackedFolderTruncated",{count:c.count}):void 0,children:[c.count,(E=c.directory)!=null&&E.truncated?"+":""]})]}),d&&c.children.length>0&&s.jsx("ul",{className:Ke.children,children:Sn(c.children,t,n,o,i,r,u,l)})]},c.key)})}function ms(e){let t=e;for(;t;){const n=getComputedStyle(t).overflowY;if(n==="auto"||n==="scroll")return t;t=t.parentElement}return e.parentElement}function ei(e,t){if(!t)return;const n=e.getBoundingClientRect(),o=t.getBoundingClientRect();n.top<o.top?t.scrollTop-=o.top-n.top:n.bottom>o.bottom&&(t.scrollTop+=n.bottom-o.bottom)}class wn{constructor(t){De(this,"normalized");De(this,"queryCache",new Map);this.files=t,this.normalized=t.map(n=>n.toLowerCase())}search(t){const n=t.trim().toLowerCase();if(!n)return this.files;let o=this.queryCache.get(n);return o||(o=(this.longestCachedPrefix(n)??Array.from({length:this.files.length},(r,u)=>u)).filter(r=>{var u;return(u=this.normalized[r])==null?void 0:u.includes(n)}),this.queryCache.set(n,o)),o.map(i=>this.files[i])}longestCachedPrefix(t){for(let n=t.length-1;n>0;n--){const o=this.queryCache.get(t.slice(0,n));if(o)return o}return null}}const ti="_inventory_o49d4_1",si="_sectionControls_o49d4_5",ni="_sectionToggle_o49d4_15",oi="_activeSectionToggle_o49d4_36",ai="_truncated_o49d4_42",ii="_detail_o49d4_69",ri="_detailModes_o49d4_88",ci="_activeMode_o49d4_116",Je={inventory:ti,sectionControls:si,sectionToggle:ni,activeSectionToggle:oi,truncated:ai,detail:ii,detailModes:ri,activeMode:ci},li="_root_1k07w_7",ui="_header_1k07w_15",di="_pathGroup_1k07w_27",hi="_path_1k07w_27",mi="_pathCopy_1k07w_45",fi="_lines_1k07w_50",gi="_run_1k07w_58",pi="_scrollable_1k07w_63",xi="_row_1k07w_67",vi="_hasReviewComment_1k07w_88",bi="_gutter_1k07w_92",_i="_commitLink_1k07w_106",Si="_authorColored_1k07w_113",wi="_uncommitted_1k07w_126",yi="_gutterLoading_1k07w_130",Ci="_lineNumber_1k07w_135",ji="_code_1k07w_156",ki="_truncated_1k07w_176",Ni="_provenanceStatus_1k07w_182",Ri="_provenanceError_1k07w_188",Ei="_contentError_1k07w_189",we={root:li,header:ui,pathGroup:di,path:hi,pathCopy:mi,lines:fi,run:gi,scrollable:pi,row:xi,hasReviewComment:vi,gutter:bi,commitLink:_i,authorColored:Si,uncommitted:wi,gutterLoading:yi,lineNumber:Ci,code:ji,truncated:ki,provenanceStatus:Ni,provenanceError:Ri,contentError:Ei},Li=68,Ti=44,Mi=2,Pi=128,Fi=320,mt=new Map;function Ai({projectId:e,path:t,lines:n,typography:o}){let i=2166136261,r=0;for(const u of n){for(let l=0;l<u.length;l+=1)i^=u.charCodeAt(l),i=Math.imul(i,16777619);i^=10,i=Math.imul(i,16777619),r+=u.length+1}return`${e}\0${t}\0${n.length}:${r}:${i>>>0}\0${o}`}function $i(e,t=0){const n=getComputedStyle(e);return[n.fontFamily,n.fontSize,n.lineHeight,n.fontWeight,n.fontStretch,n.fontVariationSettings,n.letterSpacing,n.getPropertyValue("tab-size"),t].join("|")}function Di(e,t){const n=mt.get(e);if(n!==void 0)return mt.delete(e),mt.set(e,n),n;const o=Math.max(0,Math.ceil(t()));for(mt.set(e,o);mt.size>Pi;){const i=mt.keys().next().value;if(i===void 0)break;mt.delete(i)}return o}function Bi(e,t){var c,m;const n=Array.from(e.querySelectorAll("[data-blame-code]")),o=Di(t,()=>n.reduce((d,_)=>Math.max(d,Oi(_)),0)),i=e.querySelector("[data-blame-row]"),r=((c=i==null?void 0:i.querySelector("[data-blame-gutter]"))==null?void 0:c.offsetWidth)||Li,u=((m=i==null?void 0:i.querySelector("[data-blame-lineno]"))==null?void 0:m.offsetWidth)||Ti,l=e.offsetWidth-e.clientWidth||Mi;return Math.max(Fi,Math.ceil(r+u+o+l))}function Oi(e){var o;const t=document.createRange();t.selectNodeContents(e);const n=((o=t.getBoundingClientRect)==null?void 0:o.call(t).width)??0;return t.detach(),n>0?n:e.scrollWidth}const _t=360;function Ii(e,t){const n=[];return e.forEach((o,i)=>{var m;const r=((m=t==null?void 0:t[i])==null?void 0:m.line)===i+1?t[i]:void 0,u=r?`${r.uncommitted?"uncommitted":"sha"}:${r.sha}`:`unknown:${i}`,l={content:o,index:i,line:r},c=n.at(-1);(c==null?void 0:c.identity)===u?c.rows.push(l):n.push({identity:u,key:`${u}:${i}`,rows:[l]})}),n}function yn(e){return`${e.author}\0${e.authorColorSeed??""}`}function Hi(e){const t=new Map;for(const u of e){if(u.uncommitted)continue;const l=yn(u);t.has(l)||t.set(l,u.authorColorSeed??zi(u.author))}if(t.size<=1)return new Map;const n=[...t].sort(([u,l],[c,m])=>l-m||u.localeCompare(c)),o=new Map,i=[],r=new Set;for(const[u,l]of n){const c=Wi(l,_t);if(r.size===_t){o.set(u,c);continue}const m=Array.from({length:_t},(v,p)=>p).filter(v=>!r.has(v));let d=m[0]??c,_=-1,y=Number.POSITIVE_INFINITY;for(const v of m){const p=i.length===0?_t:Math.min(...i.map(E=>Os(v,E))),k=Os(v,c);(p>_||p===_&&k<y)&&(d=v,_=p,y=k)}o.set(u,d),i.push(d),r.add(d)}return o}function Os(e,t){const n=Math.abs(e-t);return Math.min(n,_t-n)}function Ui(e){return 360/_t*e}function Wi(e,t){return(Math.round(e)%t+t)%t}function zi(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function Dt({projectId:e,path:t,rev:n,onOpenCommit:o,onToggleBlame:i,onContentWidthChange:r,captureReviewProjections:u=!1,t:l}){const[c,m]=a.useState(null),[d,_]=a.useState(null),[y,v]=a.useState(!0),[p,k]=a.useState(!0),[E,g]=a.useState(null),[x,N]=a.useState(null),[C,S]=a.useState(null),[w,b]=a.useState(0),z=a.useRef(null),M=Bt(l),{pending:R,defaultSession:L,busy:O,error:I,addToReview:ee,submitNow:P}=lo(e,t,u);a.useEffect(()=>{let T=!1;return v(!0),k(!0),g(null),N(null),m(null),_(null),S(null),n?v(!1):me.getFile(e,t,!1).then(X=>{T||(m(X),v(!1))}).catch(X=>{T||(g(X instanceof Error?X.message:l("fileViewerLoadFailed")),v(!1))}),(n?me.getGitBlame(e,t,n):me.getGitBlame(e,t)).then(X=>{T||(_(X),k(!1))}).catch(X=>{T||(N(X instanceof Error?X.message:l("sourceBlameLoadFailed")),k(!1))}),()=>{T=!0}},[e,t,n,l]);const V=a.useMemo(()=>d!=null&&d.highlightedHtml?Ji(d.highlightedHtml):null,[d]),j=a.useMemo(()=>(c==null?void 0:c.content)!==void 0?Yi(c.content):(d==null?void 0:d.lines.map(T=>T.content))??[],[d==null?void 0:d.lines,c==null?void 0:c.content]),F=a.useMemo(()=>Ii(j,d==null?void 0:d.lines),[d==null?void 0:d.lines,j]),G=a.useMemo(()=>Hi((d==null?void 0:d.lines)??[]),[d==null?void 0:d.lines]),se=`calc(${Math.max(1,String(j.length).length)}ch + 0.65rem)`;a.useEffect(()=>{const T=new MutationObserver(()=>{b($=>$+1)});return T.observe(document.documentElement,{attributes:!0,attributeFilter:["style"]}),()=>T.disconnect()},[]),a.useLayoutEffect(()=>{const T=z.current;if(!T||y||!r)return;const $=$i(T.querySelector("[data-blame-code]")??T,w),X=V?`highlight:${(d==null?void 0:d.highlightedLanguage)??"unknown"}`:"plain",Y=Ai({projectId:e,path:t,lines:j,typography:`${$}|${X}`});r(t,Bi(T,Y))},[d==null?void 0:d.highlightedLanguage,V,j,y,r,t,e,w]);const ne=a.useMemo(()=>{const T=new Set;for(const $ of R){if($.anchor.side!=="new"||$.anchor.newLine===null)continue;const X=d==null?void 0:d.lines[$.anchor.newLine-1];if(!X||X.line!==$.anchor.newLine)continue;($.anchor.revision.kind==="uncommitted"?X.uncommitted:!X.uncommitted&&$.anchor.revision.kind==="sha"&&$.anchor.revision.sha===X.sha)&&T.add($.anchor.newLine)}return T},[d==null?void 0:d.lines,R]),Q=a.useCallback(T=>[{label:l("sourceOpenCommit"),disabled:T.uncommitted||!o,onSelect:()=>{T.uncommitted||o==null||o(T.sha)}},{label:l("sourceCopyCommitHash"),onSelect:()=>{rt(T.sha)}}],[o,l]),J=T=>S({index:T}),H=T=>{if(!d)return null;const $=d.lines[T];if(!$)return null;const{snippet:X,offset:Y}=Is(d.lines,T);return{path:t,revision:$.uncommitted?{kind:"uncommitted",savedAt:new Date().toISOString()}:{kind:"sha",sha:$.sha},side:"new",oldLine:null,newLine:$.line,snippet:X,snippetAnchorOffset:Y,...u?{projection:{...n?{kind:"revision",revision:d.rev}:{kind:"worktree"},path:t,side:"new"}}:{}}},f=C&&d?d.lines[C.index]:null,B=T=>F.map($=>{var Y;const X=$.rows.filter(({index:ce})=>T==="all"?!0:T==="before"?C!==null&&ce<=C.index:C!==null&&ce>C.index);return X.length===0?null:s.jsx("div",{className:`${we.run} ${(Y=X[0])!=null&&Y.line?we.scrollable:""}`,children:X.map(({content:ce,index:K,line:de})=>{const ye=K+1,ie=de?Q(de):[],ue=de?G.get(yn(de)):void 0,le=ue===void 0?void 0:{"--blame-author-hue":`${Ui(ue)}deg`};return s.jsxs("div",{"data-blame-row":"",className:`${we.row} ${ne.has(ye)?`${we.hasReviewComment} has-review-comment`:""}`,children:[de!=null&&de.uncommitted?s.jsx("span",{className:`${we.gutter} ${we.uncommitted}`,"data-blame-gutter":"uncommitted",title:l("sourceBlameNotCommitted"),children:"·····"}):de?s.jsx("button",{type:"button",className:`${we.gutter} ${we.commitLink} ${ue===void 0?"":we.authorColored}`,"data-blame-gutter":"commit",style:le,title:Vi(de),...M.targetProps(ie,()=>o?o(de.sha):void rt(de.sha)),children:de.shortSha.slice(0,5)}):s.jsx("span",{className:`${we.gutter} ${we.gutterLoading}`,"data-blame-gutter":"loading",title:l("sourceBlameLoading"),children:"·····"}),s.jsx("button",{type:"button",className:we.lineNumber,"data-blame-lineno":"",disabled:!de,onClick:()=>J(K),children:ye}),s.jsx(Ki,{content:ce,highlightedHtml:V==null?void 0:V[K],enabled:!!de,onOpen:()=>J(K)})]},ye)})},`${$.key}:${T}`)}),U=C&&f&&d?s.jsx(uo,{projectId:e,anchorLabel:`${t}:${f.line}`,snippet:Is(d.lines,C.index).snippet,busy:O,error:I,onCancel:()=>S(null),onAddToReview:async T=>{const $=H(C.index);$&&await ee($,T)&&S(null)},defaultSession:L,onSubmit:async(T,$)=>{const X=H(C.index);if(!X)return;await P(X,T,$,l("sourceReviewSubmitQueued"),$==="new"?L==null?void 0:L.newSession:void 0)==="navigated"&&S(null)},t:l},C.index):null;return y&&!d?s.jsx("section",{className:`blame-view ${we.root}`,children:s.jsx("div",{className:"git-diff-loading",children:l("gitStatusLoading")})}):E&&x&&!d?s.jsx("section",{className:`blame-view ${we.root}`,children:s.jsx("div",{className:"git-diff-error",children:E})}):s.jsxs("section",{className:`blame-view ${we.root}`,ref:z,children:[s.jsxs("div",{className:we.header,children:[s.jsxs("span",{className:we.pathGroup,"data-blame-path-group":"",children:[s.jsx("span",{className:we.path,title:t,children:t}),s.jsx(Xt,{value:t,title:l("sourceCopyPath"),className:`source-detail-action source-detail-icon-action ${we.pathCopy}`,icon:"path"})]}),s.jsx(mo,{projectId:e,path:t,rev:n,dirtyLabel:l("fileRevisionDirty"),uncommittedLabel:l("fileRevisionUncommitted")}),i&&s.jsx("button",{type:"button",className:"source-detail-action source-detail-icon-action active",title:l("sourceToggleBlame"),"aria-label":l("sourceToggleBlame"),"aria-pressed":"true",onClick:i,children:s.jsx(Gi,{})}),p&&s.jsx("span",{className:we.provenanceStatus,role:"status",children:l("sourceBlameLoading")}),s.jsx(Xt,{value:(c==null?void 0:c.content)??"",title:l("sourceCopyRawContent"),className:"source-detail-action source-detail-icon-action",disabled:(c==null?void 0:c.content)===void 0||!c.metadata.isText,icon:"content"})]}),E&&s.jsx("div",{className:`git-diff-error ${we.contentError}`,children:E}),x&&s.jsx("div",{className:we.provenanceError,role:"status",children:l("sourceBlameUnavailable")}),c&&!c.metadata.isText&&!d&&s.jsx("div",{className:"git-status-empty",children:l("fileViewerBinary")}),s.jsx("div",{className:we.lines,style:{"--blame-line-number-column-width":se},children:s.jsx(fo,{before:B(C?"before":"all"),editor:U,after:C?B("after"):null})}),M.menu,((d==null?void 0:d.truncated)||(c==null?void 0:c.contentTruncated))&&s.jsx("div",{className:we.truncated,children:l("sourceBlameTruncated")})]})}function Gi(){return s.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),s.jsx("path",{d:"M3 4v5h5"}),s.jsx("path",{d:"M12 7v5l3 2"})]})}function Ki({content:e,highlightedHtml:t,enabled:n,onOpen:o}){const i={className:`${we.code} blame-line-target`,"data-blame-code":"",role:n?"button":void 0,tabIndex:n?0:void 0,onClick:r=>{n&&!qi(r.currentTarget)&&o(r.currentTarget)},onKeyDown:r=>{!n||r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),o(r.currentTarget))}};return t?s.jsx("span",{...i,dangerouslySetInnerHTML:{__html:t}}):s.jsx("span",{...i,children:e||" "})}function qi(e){const t=window.getSelection();return!!(t&&!t.isCollapsed&&t.toString().length>0&&t.containsNode(e,!0))}function Vi(e){const t=Xi(e.authorTime);return[e.sha,e.author,t,e.summary].filter(Boolean).join(" · ")}function Yi(e){if(!e)return[];const t=e.split(`
|
|
1
|
+
var Dn=Object.defineProperty;var Bn=(e,t,n)=>t in e?Dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var De=(e,t,n)=>Bn(e,typeof t!="symbol"?t+"":t,n);import{u as tn,r as a,c as ws,j as s,g as sn,I as Zt,x as rt,U as nn,L as on,d as es,b as ts}from"./index-DP9HSR1Q.js";import{i as On,S as In,s as Be,w as Hn,x as Un,P as Wn,y as zn,z as Gn,G as Kn,C as qn,v as Vn,E as Yn,F as Xn,I as Jn,J as Qn,K as Zn,L as eo,M as to,N as so}from"./activityBus-DeWSCW9E.js";import{P as no}from"./PageHeader-CjCt5Gtf.js";import{a as an,u as oo,b as ao}from"./NavigationLayout-CxIF1Brv.js";import{u as ss,b as io,M as wt,f as ro}from"./Modal-B2SjK3d9.js";import{G as Es}from"./GlossaryContext-6cQEV5Uo.js";import{h as Ls,s as co,j as St,u as Bt,k as lo,l as uo,D as ho,C as Xt,m as mo,n as fo,o as rn,p as yt,q as Ft,S as At,F as bs,G as cn,r as ln,t as go,v as $t,w as un,x as po,y as xo,z as vo,A as bo,B as _o,E as So,H as wo}from"./FileViewer-DGZdQyXp.js";import{u as yo}from"./useDocumentTitle-frIApxrS.js";import{a as me,b as dn,aa as Ts,ab as Co}from"./sourceRuntime-DehqzGFl.js";import{r as jo,s as Ms}from"./useSidebarWidth-CX5sAdCc.js";import{u as ko}from"./useRelativeNow-DOLyQglQ.js";import{g as No,a as Ro}from"./frontendReload-RsU7NgVs.js";import{u as Eo}from"./useSourceControlCleanLanding-BznT844H.js";import{MainContent as Lo}from"./index-C1AW0pQC.js";import{a as hn}from"./appHref-ByaEnJGJ.js";import{p as To}from"./sourceControlNavigationState-Jkj0V5EV.js";import{S as mn}from"./SourceFileHeaderActions-CK0xCR_P.js";import{u as Mo,c as Po,d as Fo}from"./useProviders-NpVDnSAv.js";import"./react-runtime-Dw4bUKEF.js";import"./text-BehwCDu9.js";import"./HostIdentityMarker-B1D03-7A.js";import"./HostIdentityContext-C0Vgqk-6.js";import"./useFileActivity-D1QofKjX.js";import"./ProviderBadge-Cr5n2thE.js";import"./YepAnywhereLogo-BjfIuZpX.js";import"./sourceTransportPaths-DF_cC8jt.js";import"./MarkdownPreview-CvbXcyQJ.js";import"./uiTrace-DTwsVP-v.js";import"./index-CoIol1kC.js";import"./idb-Bq2mrrgB.js";import"./newSessionPrefill-B03klTbN.js";import"./types-Cm98CR-a.js";const Ao="_container_132g3_23",$o="_button_132g3_31",Do="_text_132g3_51",Bo="_chevron_132g3_66",Oo="_dropdown_132g3_77",Io="_options_132g3_91",Ho="_option_132g3_91",Uo="_selected_132g3_114",Wo="_name_132g3_118",zo="_meta_132g3_126",Go="_overlay_132g3_132",Ko="_sheet_132g3_142",qo="_header_132g3_162",Vo="_title_132g3_167",We={container:Ao,button:$o,text:Do,chevron:Bo,dropdown:Oo,options:Io,option:Ho,selected:Uo,name:Wo,meta:zo,overlay:Go,sheet:Ko,header:qo,title:Vo},Ps=769;function Yo({currentProjectId:e,currentProjectName:t,onProjectChange:n}){const{t:o}=tn(),[i,r]=a.useState(!1),[u,l]=a.useState(()=>window.innerWidth>=Ps),c=a.useRef(null),m=a.useRef(null),d=ws(),_=ss(),{projects:y,loading:v}=an(),p=y.find(b=>b.id===e),k=(p==null?void 0:p.name)??t??o("projectSelectorFallback"),E=()=>{var b;(b=c.current)==null||b.blur(),r(!0)},g=b=>{b.id!==e&&(n?n(b):d(`${_}/new-session?projectId=${encodeURIComponent(b.id)}`)),r(!1)},x=a.useCallback(()=>{r(!1)},[]);a.useEffect(()=>{const b=()=>{l(window.innerWidth>=Ps)};return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]),a.useEffect(()=>{if(!i)return;const b=z=>{z.key==="Escape"&&(z.preventDefault(),z.stopPropagation(),x())};return document.addEventListener("keydown",b,!0),()=>document.removeEventListener("keydown",b,!0)},[i,x]),a.useEffect(()=>{if(!i||!u)return;const b=z=>{m.current&&!m.current.contains(z.target)&&c.current&&!c.current.contains(z.target)&&x()};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[i,u,x]),a.useEffect(()=>{if(i&&!u)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[i,u]),a.useEffect(()=>{var b;i&&((b=m.current)==null||b.focus())},[i]);const N=b=>{b.target===b.currentTarget&&(b.preventDefault(),b.stopPropagation(),x())};if(!v&&y.length<=1)return s.jsx("span",{className:"session-title",children:k});const C=s.jsx("div",{className:We.options,children:y.map(b=>{const z=b.id===e;return s.jsxs("button",{type:"button",className:`${We.option} ${z?We.selected:""}`,onClick:()=>g(b),children:[s.jsx("span",{className:We.name,children:b.name}),s.jsx("span",{className:We.meta,children:o("projectSelectorSessionsCount",{count:b.sessionCount})})]},b.id)})}),S=i&&!u?sn.createPortal(s.jsx("div",{className:We.overlay,onClick:N,onMouseDown:b=>b.stopPropagation(),children:s.jsxs("div",{ref:m,className:We.sheet,role:"dialog",tabIndex:-1,"aria-label":o("projectSelectorSelectProject"),children:[s.jsx("div",{className:We.header,children:s.jsx("span",{className:We.title,children:o("projectSelectorSelectProject")})}),C]})}),document.body):null,w=i&&u?s.jsx("div",{ref:m,className:We.dropdown,role:"dialog",tabIndex:-1,"aria-label":o("projectSelectorSelectProject"),children:C}):null;return s.jsxs("div",{className:`project-selector-container ${We.container}`,children:[s.jsxs("button",{ref:c,type:"button",className:`project-selector-button ${We.button}`,onClick:E,title:o("projectSelectorChangeProject"),"aria-haspopup":"listbox","aria-expanded":i,children:[s.jsx("span",{className:`project-selector-text ${We.text}`,children:k}),s.jsx("svg",{className:We.chevron,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:s.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),w,S]})}function Xo(){return document.visibilityState==="visible"&&document.hasFocus()}function Jo(e){return document.addEventListener("visibilitychange",e),window.addEventListener("focus",e),window.addEventListener("blur",e),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("focus",e),window.removeEventListener("blur",e)}}function Qo(){return a.useSyncExternalStore(Jo,Xo,()=>!1)}function Zo({projectId:e,status:t,routeRetentionKey:n,supportsRemoteCheck:o,supportsPull:i,supportsPush:r,supportsIntegrationOptions:u,onRefreshStatus:l,t:c}){const[m,d]=a.useState(null),[_,y]=a.useState(!1),[v,p]=a.useState(null),[k,E]=a.useState(null),[g,x]=a.useState(!1),[N,C]=a.useState(null),[S,w]=a.useState(null),[b,z]=a.useState(!1),[M,R]=a.useState(null),[L,O]=a.useState(null),[I,ee]=a.useState(!1),[P,V]=a.useState(null);a.useEffect(()=>{d(null),p(null),y(!1),E(null),C(null),x(!1),w(null),R(null),z(!1),O(null),V(null),ee(!1)},[e]);const j=_||g||b,F=oa(k,S),G=F?`${F.ahead}:${F.behind}:${F.upstream??""}`:"";a.useEffect(()=>{if(!e||!u||!G){O(null),V(null),ee(!1);return}let Y=!1;return ee(!0),O(null),V(null),me.getGitIntegrationOptions(e).then(ce=>{Y||O(ce)}).catch(ce=>{Y||V(ce instanceof Error?ce.message:c("gitStatusAutoOptionsFailed"))}).finally(()=>{Y||ee(!1)}),()=>{Y=!0}},[G,e,u,c]);const se=a.useCallback(async()=>{if(!(!e||!o||j)){y(!0),d(null),p(null),E(null),C(null),w(null),R(null),O(null),V(null);try{const Y=await me.checkGitRemote(e);d(Y),Y.status==="checked"&&await l()}catch(Y){p(Y instanceof Error?Y.message:c("gitStatusRemoteCheckFailed"))}finally{y(!1)}}},[j,l,e,o,c]),ne=a.useCallback(async()=>{if(!(!e||!i||j)){x(!0),E(null),C(null),d(null),p(null),w(null),R(null),O(null),V(null);try{const Y=await me.pullGit(e);E(Y),Y.status==="pulled"&&(n&&Ls(n),await l())}catch(Y){C(Y instanceof Error?Y.message:c("gitStatusPullFailed"))}finally{x(!1)}}},[j,l,e,n,i,c]),Q=a.useCallback(async()=>{if(!(!e||!r||j)){z(!0),w(null),R(null),d(null),p(null),E(null),C(null),O(null),V(null);try{const Y=await me.pushGit(e);w(Y),(Y.status==="pushed"||Y.status==="published"||Y.status==="up-to-date")&&(n&&Ls(n),await l())}catch(Y){R(Y instanceof Error?Y.message:c("gitStatusPushFailed"))}finally{z(!1)}}},[j,l,e,n,r,c]),J=v??ta(m,c),H=v||((m==null?void 0:m.status)??"checked")!=="checked"?"warning":m||t!=null&&t.checkedRemoteAt?"success":null,f=N??sa(k,c),B=N||k&&k.status!=="pulled"?"warning":k?"success":null,U=M??na(S,c),T=M||S&&!["pushed","published","up-to-date"].includes(S.status)?"warning":S?"success":null,$=J||f||U,X=J?H:f?B:U?T:null;return{supportsRemoteCheck:o,supportsPull:i,supportsPush:r,supportsIntegrationOptions:u,isRunning:j,isCheckingRemote:_,isPulling:g,isPushing:b,handleCheckRemote:se,handlePull:ne,handlePush:Q,checkedRemoteAt:(S==null?void 0:S.checkedRemoteAt)??(k==null?void 0:k.checkedRemoteAt)??(m==null?void 0:m.checkedRemoteAt)??(t==null?void 0:t.checkedRemoteAt)??null,checkFeedback:J,checkFeedbackTone:H,pullFeedback:f,pullFeedbackTone:B,pushFeedback:U,pushFeedbackTone:T,actionFeedback:$,actionFeedbackTone:X,divergedActionStatus:F,integrationOptions:L,isLoadingIntegrationOptions:I,integrationOptionsError:P}}function ea(e,t,n){if(!e)return n("gitStatusRemoteUnknown");const o=Date.parse(e);if(!Number.isFinite(o))return e;const i=Math.max(0,t-o),r=60*1e3,u=60*r,l=24*u;return i<r?n("gitStatusRemoteJustNow"):i<u?n("gitStatusRemoteMinutesAgo",{count:Math.floor(i/r)}):i<l?n("gitStatusRemoteHoursAgo",{count:Math.floor(i/u)}):new Date(o).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function ta(e,t){switch(e==null?void 0:e.status){case"checked":return t("gitStatusRemoteCheckSuccess");case"busy":return t("gitStatusRemoteCheckBusy");case"not-a-git-repo":return t("gitStatusRemoteCheckNotRepo");case"failed":return t("gitStatusRemoteCheckFailed");default:return""}}function sa(e,t){switch(e==null?void 0:e.status){case"pulled":return fn(e.commitsAdvanced)?e.commitsAdvanced===0?t("gitStatusPullAlreadyUpToDate"):t(e.commitsAdvanced===1?"gitStatusPullSuccessSingle":"gitStatusPullSuccessMultiple",{count:e.commitsAdvanced}):t("gitStatusPullSuccess");case"busy":return t("gitStatusPullBusy");case"not-a-git-repo":return t("gitStatusPullNotRepo");case"failed":return Jt(e.gitStatus)?t("gitStatusPullDiverged",{ahead:e.gitStatus.ahead,behind:e.gitStatus.behind}):t("gitStatusPullFailed");default:return""}}function na(e,t){switch(e==null?void 0:e.status){case"pushed":return fn(e.commitsAdvanced)?t(e.commitsAdvanced===1?"gitStatusPushSuccessSingle":"gitStatusPushSuccessMultiple",{count:e.commitsAdvanced}):t("gitStatusPushSuccess");case"published":return t("gitStatusPushPublished");case"up-to-date":return t("gitStatusPushAlreadyUpToDate");case"busy":return t("gitStatusPushBusy");case"no-upstream":return t("gitStatusPushNoUpstream");case"rejected":return Jt(e.gitStatus)?t("gitStatusPushDiverged",{ahead:e.gitStatus.ahead,behind:e.gitStatus.behind}):t("gitStatusPushRejected");case"not-a-git-repo":return t("gitStatusPushNotRepo");case"failed":return t("gitStatusPushFailed");default:return""}}function fn(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Jt(e){return!!(e&&e.ahead>0&&e.behind>0)}function oa(e,t){return(e==null?void 0:e.status)==="failed"&&Jt(e.gitStatus)?e.gitStatus:(t==null?void 0:t.status)==="rejected"&&Jt(t.gitStatus)?t.gitStatus:null}function aa(e){const[t,n]=a.useState(()=>typeof window<"u"?window.matchMedia(e).matches:!1);return a.useEffect(()=>{const o=window.matchMedia(e);n(o.matches);const i=r=>{n(r.matches)};return o.addEventListener("change",i),()=>o.removeEventListener("change",i)},[e]),t}function ns(e,t=!1){var m;const[n,o]=a.useState([]),[i,r]=a.useState([]),[u,l]=a.useState([]),c=a.useCallback(async()=>{if(!e){o([]),r([]),l([]);return}try{const d=await me.listReviewComments(e);o(d.comments),r(d.batches)}catch{}if(t)try{l(await me.listReviewSiteStates(e))}catch{}else l([])},[t,e]);return a.useEffect(()=>{if(e)return c(),co(e,()=>{c()})},[e,c]),{pending:n.filter(d=>d.status==="pending"),archived:n.filter(d=>d.status==="archived"),batches:i,recentReviewSessionId:i.length>0?((m=i[i.length-1])==null?void 0:m.targetSessionId)??null:null,siteStates:u,refresh:c}}const ia={loading:!0,error:null,generation:null,headSha:null,baseSha:null,files:[],directories:[],truncated:!1,totalFiles:null};function ra(e,t){return e!==null&&e.tracked===t.tracked&&e.untracked===t.untracked&&e.ignored===t.ignored&&ca(e.expandedPrefixes,t.expandedPrefixes)&&(e.filesystemScan??"bounded")===(t.filesystemScan??"bounded")}function ca(e,t){return e===t||e!==void 0&&t!==void 0&&e.length===t.length&&e.every((n,o)=>n===t[o])}function la(e){const t={tracked:!1,untracked:!1,ignored:!1},n=new Set;let o=!1,i=!1;for(const r of e)if(t.tracked||(t.tracked=r.coverage.tracked),t.untracked||(t.untracked=r.coverage.untracked),t.ignored||(t.ignored=r.coverage.ignored),i||(i=r.coverage.filesystemScan==="complete"),r.coverage.expandedPrefixes===void 0)o=!0;else for(const u of r.coverage.expandedPrefixes)n.add(u);return{...t,...o?{}:{expandedPrefixes:[...n].sort()},...i?{filesystemScan:"complete"}:{}}}function ua(e){if(!e||typeof e!="object"||!("type"in e))return!1;const t=e.type;return t==="git-worktree-snapshot"||t==="git-worktree-delta"}function da(e,t){return e!==null&&e.epoch===t.epoch&&t.sequence===e.sequence+1}class ha{constructor(t,n,o){De(this,"listeners",new Set);De(this,"leases",new Map);De(this,"files",new Map);De(this,"directories",new Map);De(this,"snapshot",ia);De(this,"stream",null);De(this,"activeCoverage",null);De(this,"nextLeaseId",1);De(this,"getSnapshot",()=>this.snapshot);De(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));this.projectId=t,this.transport=n,this.onEmpty=o}retain(t){const n=this.nextLeaseId++;return this.leases.set(n,{coverage:{...t,...t.expandedPrefixes?{expandedPrefixes:[...t.expandedPrefixes]}:{}}}),this.syncStream(),()=>{var o;if(this.leases.delete(n)){if(this.leases.size===0){(o=this.stream)==null||o.close(),this.stream=null,this.activeCoverage=null,this.onEmpty();return}this.syncStream()}}}syncStream(){var o;const t=la(this.leases.values());if(ra(this.activeCoverage,t)&&this.stream)return;(o=this.stream)==null||o.close(),this.activeCoverage=t;const n=On(this.transport,{subscribe:({transport:i,handlers:r})=>i.subscribeWorktree(this.projectId,t,r),onEvent:i=>{this.stream!==n||!ua(i.data)||this.applyEvent(i.data)},onError:i=>{this.stream===n&&this.publish({...this.snapshot,loading:this.snapshot.generation===null,error:i})}},{autoStart:!1,inactivityTimeoutMs:In});this.stream=n,this.snapshot.generation===null&&this.publish({...this.snapshot,loading:!0,error:null}),n.start()}applyEvent(t){if(t.type==="git-worktree-snapshot"){this.applySnapshot(t);return}this.applyDelta(t)}applySnapshot(t){this.files.clear();for(const n of t.files)this.files.set(n.path,n);this.directories.clear();for(const n of t.directories??[])this.directories.set(n.path,n);this.publish({loading:!1,error:null,generation:t.generation,headSha:t.headSha,baseSha:t.baseSha,files:[...this.files.values()],directories:[...this.directories.values()],truncated:t.truncated,totalFiles:t.totalFiles??null})}applyDelta(t){var n,o;if(!da(this.snapshot.generation,t.generation)){if(((n=this.snapshot.generation)==null?void 0:n.epoch)===t.generation.epoch&&t.generation.sequence<=this.snapshot.generation.sequence)return;(o=this.stream)==null||o.restart();return}for(const i of t.changes)i.changeType==="delete"?this.files.delete(i.path):i.file&&this.files.set(i.path,i.file);for(const i of t.directoryChanges??[])i.changeType==="delete"?this.directories.delete(i.path):i.directory&&this.directories.set(i.path,i.directory);this.publish({loading:!1,error:null,generation:t.generation,headSha:t.headSha,baseSha:t.baseSha,files:[...this.files.values()],directories:[...this.directories.values()],truncated:t.truncated??this.snapshot.truncated,totalFiles:t.totalFiles===void 0?this.snapshot.totalFiles:t.totalFiles})}publish(t){if(this.snapshot===t)return;this.snapshot=t;const n=Array.from(this.listeners);for(const o of n)o()}}const zt=new Map;function ma(e,t){return`${e}\0${t}`}function fa(e,t,n){const o=ma(e,t),i=zt.get(o);if(i)return i;let r;return r=new ha(t,n,()=>{zt.get(o)===r&&zt.delete(o)}),zt.set(o,r),r}const ga={loading:!1,error:null,generation:null,headSha:null,baseSha:null,files:[],directories:[],truncated:!1,totalFiles:null},_s=a.createContext(!1);function gn(e,t,n,o,i=!1,r=5e3){const u=io(),l=a.useContext(_s),c=o??l,m=a.useMemo(()=>n?fa(u.sourceKey,e,u.transport):null,[n,e,u.sourceKey,u.transport]),{expandedPrefixes:d,filesystemScan:_,ignored:y,tracked:v,untracked:p}=t,k=d==null?void 0:d.join("\0");a.useEffect(()=>{if(!(!m||c))return m.retain({ignored:y,tracked:v,untracked:p,...k===void 0?{}:{expandedPrefixes:k===""?[]:k.split("\0")},..._===void 0?{}:{filesystemScan:_}})},[k,_,y,c,m,v,p]);const E=a.useSyncExternalStore((m==null?void 0:m.subscribe)??pa,(m==null?void 0:m.getSnapshot)??Fs,Fs),g=a.useRef({store:m,snapshot:E}),x=a.useRef(c),N=a.useRef(null),C=a.useRef(!1),[,S]=a.useState(0),w=x.current&&!c;x.current=c,(g.current.store!==m||!c&&(!i||w||C.current)||g.current.snapshot.generation===null)&&(g.current={store:m,snapshot:E},C.current=!1,N.current=null);const b=!c&&i&&g.current.snapshot!==E;return a.useEffect(()=>{if(!b){N.current=null;return}const z=Date.now();N.current??(N.current=z+r);const M=setTimeout(()=>{C.current=!0,N.current=null,S(R=>R+1)},Math.max(0,N.current-z));return()=>clearTimeout(M)},[r,b]),g.current.snapshot}function pa(){return()=>{}}function Fs(){return ga}const xa="_revisionsHidden_1l9me_1",va="_handleGlyph_1l9me_7",hs={revisionsHidden:xa,handleGlyph:va},Gt=0,Kt=420,Mt=220,ba=380,As=16,_a=12,Sa=26;function $s({layout:e,containerWidth:t,revisionWidth:n,gapWidth:o,handleWidth:i}){const r=e==="history"?n+o:0;return Math.max(Mt,Math.floor(t-r-o/2-i/2))}function wa({containerWidth:e,gapWidth:t,naturalDetailWidth:n,currentFilesWidth:o,defaultFilesWidth:i,filesMax:r}){const u=Math.min(o,i);return Vt(Math.floor(e-t-n),u,r)}function ys({layout:e,enabled:t=!0,revisionPaneVisible:n=!0,initialFilesWidth:o,naturalDetailWidth:i,className:r,children:u,t:l}){const c=a.useRef(null),m=a.useRef(n),d=a.useRef(300),_=a.useRef(!1),y=a.useRef(null),v=a.useRef(null),p=a.useRef(null),k=a.useRef(!1),E=o??(e==="history"?340:ba),[g,x]=a.useState(()=>({revisions:300,files:E})),[N,C]=a.useState(!n),[S,w]=a.useState(null),[b,z]=a.useState(null),M=N?0:g.revisions,R=b?$s({layout:e,containerWidth:b.containerWidth,revisionWidth:M,gapWidth:b.gapWidth,handleWidth:b.handleWidth}):void 0;a.useEffect(()=>{m.current!==n&&(m.current=n,C(!n))},[n]),a.useLayoutEffect(()=>{const j=c.current;if(!j)return;const F=()=>{const se=getComputedStyle(j),ne=Number.parseFloat(se.columnGap),Q=j.querySelector(".source-pane-splitter-handle"),J={containerWidth:j.clientWidth,gapWidth:Number.isFinite(ne)?ne:_a,handleWidth:(Q==null?void 0:Q.offsetWidth)||Sa};J.containerWidth<=0||z(H=>H&&H.containerWidth===J.containerWidth&&H.gapWidth===J.gapWidth&&H.handleWidth===J.handleWidth?H:J)};if(F(),typeof ResizeObserver>"u")return window.addEventListener("resize",F),()=>window.removeEventListener("resize",F);const G=new ResizeObserver(F);return G.observe(j),()=>G.disconnect()},[]),a.useLayoutEffect(()=>{R!==void 0&&x(j=>j.files<=R?j:{...j,files:R})},[R]),a.useLayoutEffect(()=>{e!=="files"||i===void 0||b===null||R===void 0||x(j=>{const F=wa({containerWidth:b.containerWidth,gapWidth:b.gapWidth,naturalDetailWidth:i,currentFilesWidth:j.files,defaultFilesWidth:E,filesMax:R});return F===j.files?j:{...j,files:F}})},[E,R,e,b,i]),a.useEffect(()=>{if(!S)return;const j=c.current;if(!j)return;const F=Q=>{const J=Q-S.startX;let H;if(S.boundary==="revisions"){const f=Vt(S.startWidths.revisions+J,Gt,Kt),B=b?Math.min(S.startWidths.files,$s({layout:e,containerWidth:b.containerWidth,revisionWidth:f,gapWidth:b.gapWidth,handleWidth:b.handleWidth})):S.startWidths.files;H={revisions:f,files:B},f>0&&(d.current=f),j.classList.toggle(hs.revisionsHidden,f===0),j.style.setProperty("--source-revision-column-width",`${f}px`),j.style.setProperty("--source-files-column-width",`${B}px`)}else{const f=Vt(S.startWidths.files+J,Mt,R??S.startWidths.files);H={...S.startWidths,files:f},j.style.setProperty("--source-files-column-width",`${f}px`)}p.current=H},G=()=>{y.current=null;const Q=v.current;v.current=null,Q!==null&&F(Q)},se=Q=>{const J=Q.clientX-S.startX;if(Math.abs(J)>3&&(_.current=!0),v.current=Q.clientX,y.current===null){if(typeof window.requestAnimationFrame!="function"){G();return}y.current=window.requestAnimationFrame(G)}},ne=()=>{y.current!==null&&(window.cancelAnimationFrame(y.current),y.current=null),G();const Q=p.current??S.startWidths;x(Q),S.boundary==="revisions"&&C(Q.revisions===0),k.current=_.current,window.setTimeout(()=>{k.current=!1},0),p.current=null,w(null)};return window.addEventListener("pointermove",se),window.addEventListener("pointerup",ne,{once:!0}),window.addEventListener("pointercancel",ne,{once:!0}),document.body.classList.add("source-pane-resizing"),()=>{y.current!==null&&(window.cancelAnimationFrame(y.current),y.current=null),v.current=null,p.current=null,window.removeEventListener("pointermove",se),window.removeEventListener("pointerup",ne),window.removeEventListener("pointercancel",ne),document.body.classList.remove("source-pane-resizing")}},[S,R,e,b]);const L=(j,F)=>{const G=Vt(F,j==="revisions"?Gt:Mt,j==="revisions"?Kt:R??g.files);j==="revisions"&&(G>0&&(d.current=G),C(G===0)),x(se=>({...se,[j]:G}))},O=(j,F)=>{if(j.button!==0)return;j.preventDefault(),_.current=!1,v.current=null;const G=F==="revisions"?{...g,revisions:M}:g;p.current=G,w({boundary:F,startX:j.clientX,startWidths:G})},I=()=>{if(k.current){k.current=!1;return}if(M===0){const j=d.current;x(F=>({...F,revisions:j})),C(!1);return}d.current=M,C(!0)},ee=(j,F)=>{if(F==="revisions"&&(j.key==="Enter"||j.key===" ")){j.preventDefault(),I();return}const G=F==="revisions"?M:g.files,se=F==="revisions"?Gt:Mt,ne=F==="revisions"?Kt:R??G,Q=j.key==="ArrowLeft"?G-As:j.key==="ArrowRight"?G+As:j.key==="Home"?se:j.key==="End"?ne:null;Q!==null&&(j.preventDefault(),L(F,Q))},P={"--source-revision-column-width":`${M}px`,"--source-files-column-width":`${g.files}px`},V=e==="history"&&n?["revisions","files"]:["files"];return s.jsxs("div",{ref:c,className:`${r} ${e==="history"&&M===0?hs.revisionsHidden:""}`.trimEnd(),style:P,children:[u,t&&V.map(j=>s.jsxs("div",{className:`source-pane-splitter source-pane-splitter-${j} ${(S==null?void 0:S.boundary)===j?"dragging":""}`,children:[s.jsx("span",{className:"source-pane-splitter-guide","aria-hidden":"true"}),["top","bottom"].map(F=>s.jsx("hr",{className:`source-pane-splitter-handle ${hs.handleGlyph} ${F}`,"aria-label":l(j==="revisions"?"sourceResizeRevisionPane":"sourceResizeFilePane"),"aria-orientation":"vertical","aria-valuemin":j==="revisions"?Gt:Mt,"aria-valuemax":j==="revisions"?Kt:R,"aria-valuenow":j==="revisions"?M:g.files,title:j==="revisions"?l(M===0?"sourceShowRevisionPane":"sourceHideRevisionPane"):void 0,tabIndex:0,onPointerDown:G=>O(G,j),onClick:j==="revisions"?I:void 0,onKeyDown:G=>ee(G,j)},F))]},j))]})}function Vt(e,t,n){return Math.min(n,Math.max(t,e))}const ya="_outline_g5nwk_1",Ca="_group_g5nwk_8",ja="_groupButton_g5nwk_13",ka="_disclosure_g5nwk_36",Na="_groupLabel_g5nwk_43",Ra="_groupStatuses_g5nwk_52",Ea="_groupCount_g5nwk_59",La="_children_g5nwk_70",Ta="_sectionDivider_g5nwk_77",Ma="_sectionDividerButton_g5nwk_101",Pa="_sectionDisclosure_g5nwk_115",Ke={outline:ya,group:Ca,groupButton:ja,disclosure:ka,groupLabel:Na,groupStatuses:Ra,groupCount:Ea,children:La,sectionDivider:Ta,sectionDividerButton:Ma,sectionDisclosure:Pa};function os(e,t){const n=t==null?void 0:t.trim();if(!n)return null;const o=e.toLowerCase().indexOf(n.toLowerCase());if(o<0)return null;const i=o+n.length;return{start:o,end:i,prefix:e.slice(0,o),text:e.slice(o,i),suffix:e.slice(i)}}const Fa="_withMatch_rc7xr_1",Aa="_matchPrefix_rc7xr_6",$a="_matchSuffix_rc7xr_7",Da="_match_rc7xr_6",Ba="_wrapMatchOnNarrow_rc7xr_41",Nt={withMatch:Fa,matchPrefix:Aa,matchSuffix:$a,match:Da,wrapMatchOnNarrow:Ba};function bt({text:e,query:t,wrapMatchOnNarrow:n=!1,className:o,...i}){const r=os(e,t),u=[r?Nt.withMatch:"",r&&n?Nt.wrapMatchOnNarrow:"",o].filter(Boolean).join(" ");return r?s.jsxs("span",{...i,className:u,children:[r.prefix&&s.jsx("span",{className:Nt.matchPrefix,children:r.prefix}),s.jsx("mark",{className:Nt.match,children:r.text}),r.suffix&&s.jsx("span",{className:Nt.matchSuffix,children:r.suffix})]}):s.jsx("span",{...i,className:u,children:e})}const Oa="_path_yev28_1",Ia="_pathWithMatch_yev28_12",Ha="_reviewStates_yev28_31",Ua="_reviewState_yev28_31",Wa="_open_yev28_47",za="_addressed_yev28_51",Ga="_changed_yev28_55",Ka="_unchanged_yev28_59",qa="_unavailable_yev28_60",nt={path:Oa,pathWithMatch:Ia,reviewStates:Ha,reviewState:Ua,open:Wa,addressed:za,changed:Ga,unchanged:Ka,unavailable:qa};function as({path:e,children:t,...n}){const o=Zt(e);return s.jsx("button",{...n,...o,children:t})}function is({children:e,query:t,fullPath:n,className:o,...i}){const r=typeof e=="string"?e:null,u=[nt.path,r&&os(r,t)?nt.pathWithMatch:"",o].filter(Boolean).join(" ");return r?s.jsx(bt,{...i,className:u,"data-source-path":n??r,text:r,query:t,wrapMatchOnNarrow:!0}):s.jsx("span",{...i,className:u,children:e})}const Va={M:"sourceFileStatusModified",A:"sourceFileStatusAdded",D:"sourceFileStatusDeleted",R:"sourceFileStatusRenamed",C:"sourceFileStatusCopied",T:"sourceFileStatusTypeChanged",U:"sourceFileStatusUnmerged","?":"sourceFileStatusUntracked"};function Ot({status:e,t}){const n=t(Va[e]??"sourceFileStatusChanged"),o=`${e} — ${n}`,i=Zt(o);return s.jsx("span",{className:`git-status-badge git-status-${e.toLowerCase()}`,role:"img","aria-label":o,...i,children:e})}function pn({states:e,t}){if(e.length===0)return null;const n=e.filter(m=>m.state==="open").length,o=e.length-n,i=e.filter(m=>m.changeStatus==="changed").length,r=e.filter(m=>m.changeStatus==="unchanged").length,u=e.length-i-r,l=n>0?{label:t("sourceReviewStateOpen"),count:n,className:nt.open}:{label:t("sourceReviewStateAddressed"),count:o,className:nt.addressed},c=i>0?{label:t("sourceReviewSourceChanged"),count:i,className:nt.changed}:r>0?{label:t("sourceReviewSourceUnchanged"),count:r,className:nt.unchanged}:{label:t("sourceReviewSourceUnavailable"),count:u,className:nt.unavailable};return s.jsxs("span",{className:nt.reviewStates,children:[s.jsx(Ds,{...l,t}),s.jsx(Ds,{...c,t})]})}function Ds({label:e,count:t,className:n,t:o}){const i=o("sourceReviewSiteStateCount",{state:e,count:t}),r=Zt(i);return s.jsxs("span",{className:`${nt.reviewState} ${n}`,...r,children:[e," ",t]})}const Ya=14,Bs=29,xn=[];function Xa(e){return Cs(vn(e,xn))}function Ss({children:e,expanded:t,onToggle:n}){return n?s.jsxs("button",{type:"button",className:`${Ke.sectionDivider} ${Ke.sectionDividerButton}`,"aria-expanded":t,onClick:n,children:[s.jsx("span",{className:Ke.sectionDisclosure,"aria-hidden":"true",children:t?"▾":"▸"}),s.jsx("span",{children:e})]}):s.jsx("div",{className:Ke.sectionDivider,children:s.jsx("span",{children:e})})}function Pt({items:e,directories:t=xn,expandedDirectories:n,onToggleDirectory:o,scopeKey:i,query:r,className:u,activeItemId:l,focusRequest:c=0,toggleAllOnEnter:m=!1,renderFile:d,t:_,onKeyDown:y,...v}){const p=a.useRef(null),k=a.useRef(0),E=a.useRef(null),g=a.useRef(new Map),[x,N]=a.useState({}),[C,S]=a.useState(Ya),w=((r==null?void 0:r.trim().length)??0)>0,b=a.useMemo(()=>w?e.map(M=>({kind:"file",item:M,visiblePath:M.displayPath,pathProps:_n(M)})):Ja(e,t,i),[t,e,i,w]);a.useLayoutEffect(()=>{g.current.clear(),N({})},[]),a.useLayoutEffect(()=>{const M=p.current;if(!M)return;const R=ms(M),L=()=>{const I=(R==null?void 0:R.clientHeight)??M.clientHeight;I>0&&S(Math.max(1,Math.floor(I/Bs)))};if(L(),typeof ResizeObserver>"u")return;const O=new ResizeObserver(L);return O.observe(R??M),()=>O.disconnect()},[]),a.useLayoutEffect(()=>{var P;const M=Yt(b).filter(V=>!V.directory);if(M.length===0)return;const R=p.current,L=R?((P=ms(R))==null?void 0:P.clientHeight)??R.clientHeight:0,O=L>0?Math.max(1,Math.floor(L/Bs)):C;let I=Math.max(0,O-b.length),ee=!1;for(const V of M){if(g.current.has(V.key))continue;const j=V.children.length,F=j<=I;g.current.set(V.key,F),F&&(I-=j),ee=!0}ee&&N(V=>({...V}))},[C,b]),a.useLayoutEffect(()=>{if(c<=k.current||l===null||l===void 0||!e.some(R=>R.id===l))return;k.current=c,E.current=l;const M=Yt(b).filter(R=>!R.directory&&R.items.some(L=>L.id===l));M.length!==0&&N(R=>({...R,...Object.fromEntries(M.map(L=>[L.key,!0]))}))},[l,b,c,e]),a.useLayoutEffect(()=>{const M=E.current,R=p.current;if(!M||!R)return;const L=Array.from(R.querySelectorAll("[data-source-outline-id]")).find(I=>I.dataset.sourceOutlineId===M),O=L==null?void 0:L.closest("[data-source-list-item]");O&&(E.current=null,O.focus({preventScroll:!0}),ei(O,ms(R)))});const z=M=>{if(m&&M.key==="Enter"&&!M.altKey&&!M.ctrlKey&&!M.metaKey&&!M.shiftKey&&M.target instanceof HTMLElement&&M.target.closest("[data-source-list-item]")){if(M.preventDefault(),St(),M.repeat)return;const R=Yt(b).filter(O=>!O.directory),L=R.some(O=>!(x[O.key]??g.current.get(O.key)??!1));R.length>0&&N(O=>({...O,...Object.fromEntries(R.map(I=>[I.key,L||I.items.some(ee=>ee.id===l)]))}));return}y==null||y(M)};return s.jsx("ul",{...v,ref:p,className:[Ke.outline,u].filter(Boolean).join(" "),onKeyDown:z,children:Sn(b,x,g.current,(M,R)=>N(L=>({...L,[M]:!R})),n,o,d,_)})}function Ja(e,t,n){return bn(vn(e,t),"",n)}function vn(e,t){const n={files:[],directories:new Map};for(const o of e){const i=o.path.split("/").filter(Boolean);if(i.length<=1){n.files.push(o);continue}let r=n;for(const u of i.slice(0,-1)){let l=r.directories.get(u);l||(l={files:[],directories:new Map},r.directories.set(u,l)),r=l}r.files.push(o)}for(const o of t){const i=o.path.split("/").filter(Boolean);if(i.length===0)continue;let r=n;for(const u of i){let l=r.directories.get(u);l||(l={files:[],directories:new Map},r.directories.set(u,l)),r=l}r.directory=o}return n}function bn(e,t,n){const o=e.files.map(i=>({kind:"file",item:i,visiblePath:Qa(i,t),pathProps:_n(i)}));for(const[i,r]of e.directories){let u=r,l=`${t}${i}/`;for(;!u.directory&&u.files.length===0&&u.directories.size===1;){const m=u.directories.entries().next().value;if(!m)break;l+=`${m[0]}/`,u=m[1]}const c=Cs(u);o.push({kind:"group",key:`${n}\0${l}`,path:l,items:c,children:bn(u,l,n),statuses:Za(c),count:u.directory?u.files.length:c.length,...u.directory?{directory:u.directory}:{}})}return o}function _n(e){return{"data-source-outline-id":e.id,"data-source-outline-path":e.displayPath}}function Qa(e,t){return t?e.displayPath.split(" → ").map(n=>n.startsWith(t)?n.slice(t.length):n).join(" → "):e.displayPath}function Cs(e){return[...e.files,...Array.from(e.directories.values()).flatMap(Cs)]}function Za(e){const t=[],n=new Set;for(const o of e)for(const i of o.statuses??[])n.has(i)||(n.add(i),t.push(i));return t}function Yt(e){return e.flatMap(t=>t.kind==="group"?[t,...Yt(t.children)]:[])}function Sn(e,t,n,o,i,r,u,l){return e.map(c=>{var v,p,k,E;if(c.kind==="file")return u(c.item,c.visiblePath,c.pathProps);const m=!!(c.directory&&i&&r),d=m&&c.directory?(i==null?void 0:i.has(c.directory.path))===!0:t[c.key]??n.get(c.key)??!1,_=((v=c.directory)==null?void 0:v.pending)===!0&&d,y=c.directory?l(_?"sourceLoadingUntrackedFolder":d?"sourceCollapseDirectory":"sourceExpandDirectory",{path:c.path}):l(d?"sourceCollapsePathGroup":"sourceExpandPathGroup",{path:c.path,count:c.count});return s.jsxs("li",{className:Ke.group,children:[s.jsxs("button",{type:"button",className:Ke.groupButton,"data-source-list-item":!0,"aria-expanded":d,"aria-label":y,title:y,onClick:()=>{m&&c.directory&&r?r(c.directory.path,!d):o(c.key,d)},children:[s.jsx("span",{className:Ke.disclosure,"aria-hidden":"true",children:_?"…":d?"▾":"▸"}),s.jsx("span",{className:Ke.groupLabel,children:c.path}),c.statuses.length>0&&s.jsx("span",{className:Ke.groupStatuses,children:c.statuses.map(g=>s.jsx(Ot,{status:g,t:l},g))}),!((p=c.directory)!=null&&p.pending)&&s.jsxs("span",{className:Ke.groupCount,title:(k=c.directory)!=null&&k.truncated?l("sourceUntrackedFolderTruncated",{count:c.count}):void 0,children:[c.count,(E=c.directory)!=null&&E.truncated?"+":""]})]}),d&&c.children.length>0&&s.jsx("ul",{className:Ke.children,children:Sn(c.children,t,n,o,i,r,u,l)})]},c.key)})}function ms(e){let t=e;for(;t;){const n=getComputedStyle(t).overflowY;if(n==="auto"||n==="scroll")return t;t=t.parentElement}return e.parentElement}function ei(e,t){if(!t)return;const n=e.getBoundingClientRect(),o=t.getBoundingClientRect();n.top<o.top?t.scrollTop-=o.top-n.top:n.bottom>o.bottom&&(t.scrollTop+=n.bottom-o.bottom)}class wn{constructor(t){De(this,"normalized");De(this,"queryCache",new Map);this.files=t,this.normalized=t.map(n=>n.toLowerCase())}search(t){const n=t.trim().toLowerCase();if(!n)return this.files;let o=this.queryCache.get(n);return o||(o=(this.longestCachedPrefix(n)??Array.from({length:this.files.length},(r,u)=>u)).filter(r=>{var u;return(u=this.normalized[r])==null?void 0:u.includes(n)}),this.queryCache.set(n,o)),o.map(i=>this.files[i])}longestCachedPrefix(t){for(let n=t.length-1;n>0;n--){const o=this.queryCache.get(t.slice(0,n));if(o)return o}return null}}const ti="_inventory_o49d4_1",si="_sectionControls_o49d4_5",ni="_sectionToggle_o49d4_15",oi="_activeSectionToggle_o49d4_36",ai="_truncated_o49d4_42",ii="_detail_o49d4_69",ri="_detailModes_o49d4_88",ci="_activeMode_o49d4_116",Je={inventory:ti,sectionControls:si,sectionToggle:ni,activeSectionToggle:oi,truncated:ai,detail:ii,detailModes:ri,activeMode:ci},li="_root_1k07w_7",ui="_header_1k07w_15",di="_pathGroup_1k07w_27",hi="_path_1k07w_27",mi="_pathCopy_1k07w_45",fi="_lines_1k07w_50",gi="_run_1k07w_58",pi="_scrollable_1k07w_63",xi="_row_1k07w_67",vi="_hasReviewComment_1k07w_88",bi="_gutter_1k07w_92",_i="_commitLink_1k07w_106",Si="_authorColored_1k07w_113",wi="_uncommitted_1k07w_126",yi="_gutterLoading_1k07w_130",Ci="_lineNumber_1k07w_135",ji="_code_1k07w_156",ki="_truncated_1k07w_176",Ni="_provenanceStatus_1k07w_182",Ri="_provenanceError_1k07w_188",Ei="_contentError_1k07w_189",we={root:li,header:ui,pathGroup:di,path:hi,pathCopy:mi,lines:fi,run:gi,scrollable:pi,row:xi,hasReviewComment:vi,gutter:bi,commitLink:_i,authorColored:Si,uncommitted:wi,gutterLoading:yi,lineNumber:Ci,code:ji,truncated:ki,provenanceStatus:Ni,provenanceError:Ri,contentError:Ei},Li=68,Ti=44,Mi=2,Pi=128,Fi=320,mt=new Map;function Ai({projectId:e,path:t,lines:n,typography:o}){let i=2166136261,r=0;for(const u of n){for(let l=0;l<u.length;l+=1)i^=u.charCodeAt(l),i=Math.imul(i,16777619);i^=10,i=Math.imul(i,16777619),r+=u.length+1}return`${e}\0${t}\0${n.length}:${r}:${i>>>0}\0${o}`}function $i(e,t=0){const n=getComputedStyle(e);return[n.fontFamily,n.fontSize,n.lineHeight,n.fontWeight,n.fontStretch,n.fontVariationSettings,n.letterSpacing,n.getPropertyValue("tab-size"),t].join("|")}function Di(e,t){const n=mt.get(e);if(n!==void 0)return mt.delete(e),mt.set(e,n),n;const o=Math.max(0,Math.ceil(t()));for(mt.set(e,o);mt.size>Pi;){const i=mt.keys().next().value;if(i===void 0)break;mt.delete(i)}return o}function Bi(e,t){var c,m;const n=Array.from(e.querySelectorAll("[data-blame-code]")),o=Di(t,()=>n.reduce((d,_)=>Math.max(d,Oi(_)),0)),i=e.querySelector("[data-blame-row]"),r=((c=i==null?void 0:i.querySelector("[data-blame-gutter]"))==null?void 0:c.offsetWidth)||Li,u=((m=i==null?void 0:i.querySelector("[data-blame-lineno]"))==null?void 0:m.offsetWidth)||Ti,l=e.offsetWidth-e.clientWidth||Mi;return Math.max(Fi,Math.ceil(r+u+o+l))}function Oi(e){var o;const t=document.createRange();t.selectNodeContents(e);const n=((o=t.getBoundingClientRect)==null?void 0:o.call(t).width)??0;return t.detach(),n>0?n:e.scrollWidth}const _t=360;function Ii(e,t){const n=[];return e.forEach((o,i)=>{var m;const r=((m=t==null?void 0:t[i])==null?void 0:m.line)===i+1?t[i]:void 0,u=r?`${r.uncommitted?"uncommitted":"sha"}:${r.sha}`:`unknown:${i}`,l={content:o,index:i,line:r},c=n.at(-1);(c==null?void 0:c.identity)===u?c.rows.push(l):n.push({identity:u,key:`${u}:${i}`,rows:[l]})}),n}function yn(e){return`${e.author}\0${e.authorColorSeed??""}`}function Hi(e){const t=new Map;for(const u of e){if(u.uncommitted)continue;const l=yn(u);t.has(l)||t.set(l,u.authorColorSeed??zi(u.author))}if(t.size<=1)return new Map;const n=[...t].sort(([u,l],[c,m])=>l-m||u.localeCompare(c)),o=new Map,i=[],r=new Set;for(const[u,l]of n){const c=Wi(l,_t);if(r.size===_t){o.set(u,c);continue}const m=Array.from({length:_t},(v,p)=>p).filter(v=>!r.has(v));let d=m[0]??c,_=-1,y=Number.POSITIVE_INFINITY;for(const v of m){const p=i.length===0?_t:Math.min(...i.map(E=>Os(v,E))),k=Os(v,c);(p>_||p===_&&k<y)&&(d=v,_=p,y=k)}o.set(u,d),i.push(d),r.add(d)}return o}function Os(e,t){const n=Math.abs(e-t);return Math.min(n,_t-n)}function Ui(e){return 360/_t*e}function Wi(e,t){return(Math.round(e)%t+t)%t}function zi(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function Dt({projectId:e,path:t,rev:n,onOpenCommit:o,onToggleBlame:i,onContentWidthChange:r,captureReviewProjections:u=!1,t:l}){const[c,m]=a.useState(null),[d,_]=a.useState(null),[y,v]=a.useState(!0),[p,k]=a.useState(!0),[E,g]=a.useState(null),[x,N]=a.useState(null),[C,S]=a.useState(null),[w,b]=a.useState(0),z=a.useRef(null),M=Bt(l),{pending:R,defaultSession:L,busy:O,error:I,addToReview:ee,submitNow:P}=lo(e,t,u);a.useEffect(()=>{let T=!1;return v(!0),k(!0),g(null),N(null),m(null),_(null),S(null),n?v(!1):me.getFile(e,t,!1).then(X=>{T||(m(X),v(!1))}).catch(X=>{T||(g(X instanceof Error?X.message:l("fileViewerLoadFailed")),v(!1))}),(n?me.getGitBlame(e,t,n):me.getGitBlame(e,t)).then(X=>{T||(_(X),k(!1))}).catch(X=>{T||(N(X instanceof Error?X.message:l("sourceBlameLoadFailed")),k(!1))}),()=>{T=!0}},[e,t,n,l]);const V=a.useMemo(()=>d!=null&&d.highlightedHtml?Ji(d.highlightedHtml):null,[d]),j=a.useMemo(()=>(c==null?void 0:c.content)!==void 0?Yi(c.content):(d==null?void 0:d.lines.map(T=>T.content))??[],[d==null?void 0:d.lines,c==null?void 0:c.content]),F=a.useMemo(()=>Ii(j,d==null?void 0:d.lines),[d==null?void 0:d.lines,j]),G=a.useMemo(()=>Hi((d==null?void 0:d.lines)??[]),[d==null?void 0:d.lines]),se=`calc(${Math.max(1,String(j.length).length)}ch + 0.65rem)`;a.useEffect(()=>{const T=new MutationObserver(()=>{b($=>$+1)});return T.observe(document.documentElement,{attributes:!0,attributeFilter:["style"]}),()=>T.disconnect()},[]),a.useLayoutEffect(()=>{const T=z.current;if(!T||y||!r)return;const $=$i(T.querySelector("[data-blame-code]")??T,w),X=V?`highlight:${(d==null?void 0:d.highlightedLanguage)??"unknown"}`:"plain",Y=Ai({projectId:e,path:t,lines:j,typography:`${$}|${X}`});r(t,Bi(T,Y))},[d==null?void 0:d.highlightedLanguage,V,j,y,r,t,e,w]);const ne=a.useMemo(()=>{const T=new Set;for(const $ of R){if($.anchor.side!=="new"||$.anchor.newLine===null)continue;const X=d==null?void 0:d.lines[$.anchor.newLine-1];if(!X||X.line!==$.anchor.newLine)continue;($.anchor.revision.kind==="uncommitted"?X.uncommitted:!X.uncommitted&&$.anchor.revision.kind==="sha"&&$.anchor.revision.sha===X.sha)&&T.add($.anchor.newLine)}return T},[d==null?void 0:d.lines,R]),Q=a.useCallback(T=>[{label:l("sourceOpenCommit"),disabled:T.uncommitted||!o,onSelect:()=>{T.uncommitted||o==null||o(T.sha)}},{label:l("sourceCopyCommitHash"),onSelect:()=>{rt(T.sha)}}],[o,l]),J=T=>S({index:T}),H=T=>{if(!d)return null;const $=d.lines[T];if(!$)return null;const{snippet:X,offset:Y}=Is(d.lines,T);return{path:t,revision:$.uncommitted?{kind:"uncommitted",savedAt:new Date().toISOString()}:{kind:"sha",sha:$.sha},side:"new",oldLine:null,newLine:$.line,snippet:X,snippetAnchorOffset:Y,...u?{projection:{...n?{kind:"revision",revision:d.rev}:{kind:"worktree"},path:t,side:"new"}}:{}}},f=C&&d?d.lines[C.index]:null,B=T=>F.map($=>{var Y;const X=$.rows.filter(({index:ce})=>T==="all"?!0:T==="before"?C!==null&&ce<=C.index:C!==null&&ce>C.index);return X.length===0?null:s.jsx("div",{className:`${we.run} ${(Y=X[0])!=null&&Y.line?we.scrollable:""}`,children:X.map(({content:ce,index:K,line:de})=>{const ye=K+1,ie=de?Q(de):[],ue=de?G.get(yn(de)):void 0,le=ue===void 0?void 0:{"--blame-author-hue":`${Ui(ue)}deg`};return s.jsxs("div",{"data-blame-row":"",className:`${we.row} ${ne.has(ye)?`${we.hasReviewComment} has-review-comment`:""}`,children:[de!=null&&de.uncommitted?s.jsx("span",{className:`${we.gutter} ${we.uncommitted}`,"data-blame-gutter":"uncommitted",title:l("sourceBlameNotCommitted"),children:"·····"}):de?s.jsx("button",{type:"button",className:`${we.gutter} ${we.commitLink} ${ue===void 0?"":we.authorColored}`,"data-blame-gutter":"commit",style:le,title:Vi(de),...M.targetProps(ie,()=>o?o(de.sha):void rt(de.sha)),children:de.shortSha.slice(0,5)}):s.jsx("span",{className:`${we.gutter} ${we.gutterLoading}`,"data-blame-gutter":"loading",title:l("sourceBlameLoading"),children:"·····"}),s.jsx("button",{type:"button",className:we.lineNumber,"data-blame-lineno":"",disabled:!de,onClick:()=>J(K),children:ye}),s.jsx(Ki,{content:ce,highlightedHtml:V==null?void 0:V[K],enabled:!!de,onOpen:()=>J(K)})]},ye)})},`${$.key}:${T}`)}),U=C&&f&&d?s.jsx(uo,{projectId:e,anchorLabel:`${t}:${f.line}`,snippet:Is(d.lines,C.index).snippet,busy:O,error:I,onCancel:()=>S(null),onAddToReview:async T=>{const $=H(C.index);$&&await ee($,T)&&S(null)},defaultSession:L,onSubmit:async(T,$)=>{const X=H(C.index);if(!X)return;await P(X,T,$,l("sourceReviewSubmitQueued"),$==="new"?L==null?void 0:L.newSession:void 0)==="navigated"&&S(null)},t:l},C.index):null;return y&&!d?s.jsx("section",{className:`blame-view ${we.root}`,children:s.jsx("div",{className:"git-diff-loading",children:l("gitStatusLoading")})}):E&&x&&!d?s.jsx("section",{className:`blame-view ${we.root}`,children:s.jsx("div",{className:"git-diff-error",children:E})}):s.jsxs("section",{className:`blame-view ${we.root}`,ref:z,children:[s.jsxs("div",{className:we.header,children:[s.jsxs("span",{className:we.pathGroup,"data-blame-path-group":"",children:[s.jsx("span",{className:we.path,title:t,children:t}),s.jsx(Xt,{value:t,title:l("sourceCopyPath"),className:`source-detail-action source-detail-icon-action ${we.pathCopy}`,icon:"path"})]}),s.jsx(mo,{projectId:e,path:t,rev:n,dirtyLabel:l("fileRevisionDirty"),uncommittedLabel:l("fileRevisionUncommitted")}),i&&s.jsx("button",{type:"button",className:"source-detail-action source-detail-icon-action active",title:l("sourceToggleBlame"),"aria-label":l("sourceToggleBlame"),"aria-pressed":"true",onClick:i,children:s.jsx(Gi,{})}),p&&s.jsx("span",{className:we.provenanceStatus,role:"status",children:l("sourceBlameLoading")}),s.jsx(Xt,{value:(c==null?void 0:c.content)??"",title:l("sourceCopyRawContent"),className:"source-detail-action source-detail-icon-action",disabled:(c==null?void 0:c.content)===void 0||!c.metadata.isText,icon:"content"})]}),E&&s.jsx("div",{className:`git-diff-error ${we.contentError}`,children:E}),x&&s.jsx("div",{className:we.provenanceError,role:"status",children:l("sourceBlameUnavailable")}),c&&!c.metadata.isText&&!d&&s.jsx("div",{className:"git-status-empty",children:l("fileViewerBinary")}),s.jsx("div",{className:we.lines,style:{"--blame-line-number-column-width":se},children:s.jsx(fo,{before:B(C?"before":"all"),editor:U,after:C?B("after"):null})}),M.menu,((d==null?void 0:d.truncated)||(c==null?void 0:c.contentTruncated))&&s.jsx("div",{className:we.truncated,children:l("sourceBlameTruncated")})]})}function Gi(){return s.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),s.jsx("path",{d:"M3 4v5h5"}),s.jsx("path",{d:"M12 7v5l3 2"})]})}function Ki({content:e,highlightedHtml:t,enabled:n,onOpen:o}){const i={className:`${we.code} blame-line-target`,"data-blame-code":"",role:n?"button":void 0,tabIndex:n?0:void 0,onClick:r=>{n&&!qi(r.currentTarget)&&o(r.currentTarget)},onKeyDown:r=>{!n||r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),o(r.currentTarget))}};return t?s.jsx("span",{...i,dangerouslySetInnerHTML:{__html:t}}):s.jsx("span",{...i,children:e||" "})}function qi(e){const t=window.getSelection();return!!(t&&!t.isCollapsed&&t.toString().length>0&&t.containsNode(e,!0))}function Vi(e){const t=Xi(e.authorTime);return[e.sha,e.author,t,e.summary].filter(Boolean).join(" · ")}function Yi(e){if(!e)return[];const t=e.split(`
|
|
2
2
|
`);return e.endsWith(`
|
|
3
3
|
`)&&t.pop(),t}function Xi(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function Is(e,t,n=ho){const o=Math.max(0,t-n),i=Math.min(e.length,t+n+1);return{snippet:e.slice(o,i).map(u=>u.content).join(`
|
|
4
4
|
`),offset:t-o}}function Ji(e){if(typeof DOMParser>"u")return[];const n=new DOMParser().parseFromString(e,"text/html").querySelectorAll("code .line");return Array.from(n).map(o=>o.innerHTML)}const Qi={tracked:!0,untracked:!0,ignored:!1};function Cn({projectId:e,isWideScreen:t,initialPath:n,status:o,supportsWorkingTreeFiles:i=!1,supportsWorktreeSections:r=!1,supportsCompleteFilesystemScan:u=!1,onOpenCommit:l,captureReviewProjections:c=!1,t:m}){var re;const[d,_]=a.useState([]),[y,v]=a.useState([]),[p,k]=a.useState(Qi),[E,g]=a.useState([]),[x,N]=a.useState(!1),C=a.useRef(e),S=C.current===e?E:[],w=C.current===e&&x,b=r&&(o==null?void 0:o.isGitRepo)===!1,z=a.useMemo(()=>({...p,...b?{expandedPrefixes:S}:{},...b&&u&&w?{filesystemScan:"complete"}:{}}),[w,p,S,b,u]),[M,R]=a.useState(!1),L=a.useRef(null),O=a.useCallback(()=>{R(!0),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{L.current=null,R(!1)},200)},[]);a.useEffect(()=>()=>{L.current&&clearTimeout(L.current)},[]),a.useEffect(()=>{C.current!==e&&(C.current=e,g([]),N(!1))},[e]);const I=gn(e,z,r,void 0,M),[ee,P]=a.useState(!1),[V,j]=a.useState("contents"),[F,G]=a.useState(!0),[se,ne]=a.useState(null),[Q,J]=a.useState(""),[H,f]=a.useState(n??null),[B,U]=a.useState(null),T=a.useRef(null),$=Bt(m);rn(T);const{pending:X}=ns(e),Y=a.useMemo(()=>{const A=new Map;for(const he of X)A.set(he.anchor.path,(A.get(he.anchor.path)??0)+1);return A},[X]);a.useEffect(()=>{if(r)return;let A=!1;return G(!0),ne(null),_([]),v([]),P(!1),f(oe=>n??oe),(i?me.listGitWorkingTreeFiles(e,r?p:void 0).then(oe=>({files:oe.files.map(pe=>pe.path),workingTreeFiles:oe.files,truncated:oe.truncated})):me.listGitFiles(e).then(oe=>({files:oe.files,workingTreeFiles:[],truncated:oe.truncated}))).then(oe=>{A||(_(oe.files),v(oe.workingTreeFiles),P(oe.truncated),G(!1))}).catch(oe=>{A||(ne(oe instanceof Error?oe.message:String(oe)),G(!1))}),()=>{A=!0}},[p,e,n,i,r]);const ce=a.useMemo(()=>r?I.files.filter(A=>A.present!==!1&&p[Rt(A)??"untracked"]):y,[p,I.files,r,y]),K=a.useMemo(()=>r?ce.map(A=>A.path):d,[ce,d,r]),de=r?I.loading:F,ye=r?((re=I.error)==null?void 0:re.message)??null:se,ie=r?I.truncated:ee,ue=b?I.directories:[],le=a.useMemo(()=>new wn(K),[K]),fe=a.useMemo(()=>le.search(Q),[le,Q]),Ne=a.useMemo(()=>new Map(ce.map(A=>[A.path,A])),[ce]),Pe=a.useMemo(()=>{var he;const A=new Map;if(r)for(const oe of I.files){const pe=(he=oe.worktreeChanges)==null?void 0:he.at(-1);pe&&A.set(oe.path,pe.status)}else for(const oe of(o==null?void 0:o.files)??[])A.set(oe.path,oe.status);return A},[I.files,o==null?void 0:o.files,r]),Ae=a.useMemo(()=>fe.filter(A=>Rt(Ne.get(A))==="tracked"),[fe,Ne]),Oe=a.useMemo(()=>fe.filter(A=>Rt(Ne.get(A))==="untracked"),[fe,Ne]),_e=a.useMemo(()=>fe.filter(A=>Rt(Ne.get(A))==="ignored"),[fe,Ne]),ke=H?Ne.get(H):void 0;a.useEffect(()=>{H!==null&&j("contents")},[H]),a.useEffect(()=>{!t||de||ye||fe.length===0||f(A=>A&&fe.includes(A)?A:fe[0]??null)},[ye,de,fe,t]);const ze=a.useCallback(A=>[{label:m("sourceOpenFile"),onSelect:()=>f(A)},{label:m("sourceCopyPath"),onSelect:()=>{rt(A)}}],[m]),Me=a.useCallback((A,he)=>{U({path:A,width:he})},[]),ge=(B==null?void 0:B.path)===H?B.width:void 0,Re=a.useCallback(A=>{k(he=>({...he,[A]:!he[A]}))},[]),Le=a.useMemo(()=>new Set(S),[S]),Ve=a.useCallback((A,he)=>{g(oe=>{if(!he)return oe.filter(Ce=>Ce!==A&&!Ce.startsWith(`${A}/`));const pe=new Set(oe),Se=A.split("/");for(let Ce=1;Ce<=Se.length;Ce+=1)pe.add(Se.slice(0,Ce).join("/"));return[...pe].sort((Ce,Ye)=>{const ot=Ce.split("/").length-Ye.split("/").length;return ot!==0?ot:Ce.localeCompare(Ye)})})},[]),W=(A,he=A,oe)=>{const pe=Y.get(A)??0,Se=ze(A),Ce=Ne.get(A),Ye=Pe.get(A)??(Rt(Ce)==="untracked"?"?":void 0);return s.jsxs("li",{className:`commit-file-row ${Ft}`,children:[s.jsxs(as,{path:A,type:"button",className:`blame-file-item ${H===A?"selected":""}`,"data-source-list-item":!0,onFocus:()=>{t&&f(A)},...$.targetProps(Se,()=>{f(A)}),children:[s.jsx(is,{...oe,query:Q,fullPath:A,children:he}),Ye&&s.jsx(Ot,{status:Ye,t:m}),pe>0&&s.jsx("span",{className:"source-comment-badge",title:m("sourceCommentCount",{count:pe}),children:pe})]}),s.jsx(At,{actions:Se,label:m("sourceMoreActions"),onOpen:$.openFromButton})]},A)};return s.jsxs("div",{className:"blame-browser",children:[s.jsxs(ys,{layout:"files",initialFilesWidth:340,naturalDetailWidth:t?ge:void 0,className:"blame-browser-columns",t:m,children:[s.jsxs("div",{className:"blame-file-column",onPointerMove:r?O:void 0,children:[r&&s.jsx(Zi,{coverage:p,onToggle:Re,t:m}),s.jsxs("div",{className:"source-search-field",children:[s.jsx("input",{ref:T,type:"search",className:"source-search-input",value:Q,placeholder:m("sourceFilterFiles"),"aria-keyshortcuts":"/",onKeyDown:A=>{A.key==="Escape"&&Q&&(A.preventDefault(),J(""))},onChange:A=>J(A.target.value)}),s.jsx("kbd",{className:"source-search-shortcut",children:"/"})]}),de?s.jsx("div",{className:"git-diff-loading",children:m("gitStatusLoading")}):ye?s.jsx("div",{className:"git-diff-error",children:ye}):i?s.jsx(er,{trackedFiles:Ae,untrackedFiles:Oe,ignoredFiles:_e,directories:ue,coverage:p,sectionsEnabled:r,onToggle:Re,...b?{expandedDirectories:Le,onToggleDirectory:Ve}:{},scopeKey:e,query:Q,truncated:ie,totalFiles:I.totalFiles,onShowAll:b&&u&&!w&&I.totalFiles!==null&&I.totalFiles>I.files.length?()=>N(!0):void 0,renderFile:W,t:m}):fe.length===0?s.jsx("div",{className:"git-status-empty",children:m("sourceNoFiles")}):s.jsx("ul",{className:"blame-file-list",onKeyDown:yt,children:fe.map(A=>W(A))})]}),t&&H&&(i?s.jsx(Hs,{projectId:e,path:H,tracked:(ke==null?void 0:ke.tracked)??!1,mode:V,onModeChange:j,onOpenCommit:l,captureReviewProjections:c,t:m}):s.jsx(Dt,{projectId:e,path:H,onOpenCommit:l,captureReviewProjections:c,onContentWidthChange:Me,t:m}))]}),$.menu,!t&&H&&s.jsx(wt,{title:H,onClose:()=>f(null),closeOnBackGesture:!0,children:i?s.jsx(Hs,{projectId:e,path:H,tracked:(ke==null?void 0:ke.tracked)??!1,mode:V,onModeChange:j,onOpenCommit:l,captureReviewProjections:c,t:m}):s.jsx(Dt,{projectId:e,path:H,onOpenCommit:l,captureReviewProjections:c,t:m})})]})}function Zi({coverage:e,onToggle:t,t:n}){const o=[{kind:"tracked",label:n("sourceTrackedFiles")},{kind:"untracked",label:n("sourceUntrackedFiles")},{kind:"ignored",label:n("sourceIgnoredFiles")}];return s.jsx("fieldset",{className:Je.sectionControls,"aria-label":n("sourceWorkingTreeSections"),children:o.map(({kind:i,label:r})=>s.jsxs("button",{type:"button",className:`${Je.sectionToggle} ${e[i]?Je.activeSectionToggle:""}`,"aria-pressed":e[i],onClick:()=>t(i),children:[s.jsx("span",{"aria-hidden":"true",children:e[i]?"●":"○"}),r]},i))})}function er({trackedFiles:e,untrackedFiles:t,ignoredFiles:n,directories:o,coverage:i,sectionsEnabled:r,onToggle:u,expandedDirectories:l,onToggleDirectory:c,scopeKey:m,query:d,truncated:_,totalFiles:y,onShowAll:v,renderFile:p,t:k}){const E=d.trim().length>0,g=(N,C,S=[])=>s.jsx(Pt,{className:"blame-file-list",items:N.map(w=>({id:w,path:w,displayPath:w,value:w})),directories:S,...l&&c?{expandedDirectories:l,onToggleDirectory:c}:{},scopeKey:`${m}:${C}`,query:d,renderFile:(w,b,z)=>p(w.value,b,z),t:k}),x=[{kind:"tracked",label:k("sourceTrackedFiles"),files:e},{kind:"untracked",label:k("sourceUntrackedFiles"),files:t},{kind:"ignored",label:k("sourceIgnoredFiles"),files:n}];return r?s.jsxs("div",{className:Je.inventory,onKeyDown:yt,children:[x.map(({kind:N,label:C,files:S})=>s.jsxs("div",{children:[s.jsx(Ss,{expanded:i[N],onToggle:()=>u(N),children:C}),i[N]&&(S.length>0||N==="untracked"&&o.length>0)&&g(S,N,N==="untracked"?o:[])]},N)),_&&!E&&s.jsxs("div",{className:Je.truncated,role:"status",children:[s.jsx("span",{"aria-hidden":"true",children:"…"}),v&&y!==null?s.jsx("button",{type:"button",onClick:v,children:k("sourceWorkingTreeShowAll",{count:y})}):y!==null?k("sourceWorkingTreeFilesIncomplete",{count:y}):k("sourceWorkingTreeFilesTruncated",{count:e.length+t.length+n.length})]})]}):s.jsxs("div",{className:Je.inventory,onKeyDown:yt,children:[e.length>0&&g(e,"tracked"),t.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ss,{children:k("sourceUntrackedFiles")}),g(t,"untracked")]})]})}function Rt(e){return(e==null?void 0:e.kind)??(e?e.tracked?"tracked":"untracked":void 0)}function Hs({projectId:e,path:t,tracked:n,mode:o,onModeChange:i,onOpenCommit:r,captureReviewProjections:u,t:l}){const c=n?o:"contents";return s.jsxs("section",{className:Je.detail,children:[n&&s.jsxs("fieldset",{className:Je.detailModes,"aria-label":l("sourceViewMode"),children:[s.jsx("button",{type:"button",className:c==="contents"?Je.activeMode:"","aria-pressed":c==="contents",onClick:()=>i("contents"),children:l("sourceViewContents")}),s.jsx("button",{type:"button",className:c==="blame"?Je.activeMode:"","aria-pressed":c==="blame",onClick:()=>i("blame"),children:l("sourceViewBlame")})]}),c==="blame"?s.jsx(Dt,{projectId:e,path:t,onOpenCommit:r,captureReviewProjections:u,t:l}):s.jsx(bs,{projectId:e,filePath:t})]})}function fs(){try{const e=localStorage.getItem(nn.commitReadWatermarks);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[o,i]of Object.entries(t))typeof i=="string"&&(n[o]=i);return n}catch{return{}}}function tr(e){try{localStorage.setItem(nn.commitReadWatermarks,JSON.stringify(e))}catch{}}function sr(e){const[t,n]=a.useState(()=>fs()[e]??null);a.useEffect(()=>{n(fs()[e]??null)},[e]);const o=a.useCallback(l=>{n(l);const c=fs();l?c[e]=l:delete c[e],tr(c)},[e]),i=a.useCallback(l=>{if(!t)return!1;const c=new Date(t).getTime(),m=new Date(l).getTime();return Number.isNaN(c)||Number.isNaN(m)?!1:m<=c},[t]),r=a.useCallback(l=>{const c=new Date(l).getTime();Number.isNaN(c)||o(new Date(c).toISOString())},[o]),u=a.useCallback(l=>{const c=new Date(l).getTime();Number.isNaN(c)||o(new Date(c-1e3).toISOString())},[o]);return{watermark:t,isRead:i,markReadTo:r,markUnreadSince:u}}function jn({query:e,disabled:t=!1,onQueryChange:n,t:o}){const[i,r]=a.useState(!1),u=a.useRef(null);a.useEffect(()=>{var c;i&&((c=u.current)==null||c.focus())},[i]);const l=()=>{if(i){n(""),r(!1);return}r(!0)};return s.jsxs("span",{className:`changeset-file-filter ${i?"open":""}`,children:[s.jsx("button",{type:"button",className:"source-detail-action source-detail-icon-action changeset-file-filter-toggle",title:o("sourceFilterFiles"),"aria-label":o("sourceFilterFiles"),"aria-expanded":i,disabled:t,onClick:l,children:s.jsx(nr,{})}),i&&s.jsx("input",{ref:u,type:"search",className:"changeset-file-filter-input",value:e,placeholder:o("sourceFilterFiles"),"aria-label":o("sourceFilterFiles"),onKeyDown:c=>{c.key==="Escape"&&(c.preventDefault(),e?n(""):r(!1))},onChange:c=>n(c.target.value)})]})}function nr(){return s.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[s.jsx("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),s.jsx("path",{d:"m15.5 15.5 5 5"})]})}function Ze(e){return e.origPath?`${e.origPath} → ${e.path}`:e.path}function kn(e,t){const n=a.useMemo(()=>e.map(Ze),[e]),o=a.useMemo(()=>new wn(n),[n]),i=a.useMemo(()=>new Set(o.search(t)),[o,t]);return a.useMemo(()=>e.filter(r=>i.has(Ze(r))),[e,i])}const or=50,ar=/^\s*(?:[*\-•]|\d+\.)\s+/u,ir=/^[ \t]/;function Us(e){return e.trimEnd().length<=or}function rr(e,t){return e.trim().length===0||t.trim().length===0||ar.test(e)||ir.test(e)||Us(e)&&Us(t)}function cr(e){const t=e.split(`
|
|
@@ -12,4 +12,4 @@ ${js(n.authorDate)}`:t,children:(o==null?void 0:o.shortHash)??(n==null?void 0:n.
|
|
|
12
12
|
|
|
13
13
|
${e.body}`:e.subject;return s.jsxs("section",{className:"git-diff-preview-pane",children:[s.jsxs("div",{className:"git-diff-preview-header",children:[s.jsx("h3",{className:"git-diff-preview-title",title:e.hash,children:e.shortHash}),s.jsx("span",{className:"commit-message-time",children:js(e.authorDate)})]}),s.jsx("div",{className:"git-diff-preview-body",children:s.jsxs("div",{className:"commit-message-view",children:[s.jsxs("div",{className:"commit-message-view-meta",children:[e.authorName," · ",t("sourceCommitMessage")]}),s.jsx("pre",{className:"commit-message-full",children:n})]})})]})}const oc="_sourceHeader_gr3t2_5",ac="_actionGroup_gr3t2_21",ic="_headerControls_gr3t2_28",rc="_titleRow_gr3t2_33",cc="_headerTabs_gr3t2_37",lc="_fallbackRow_gr3t2_45",uc="_compatibilityActions_gr3t2_55",dc="_checkRemote_gr3t2_71",hc="_actionLabel_gr3t2_73",Qe={sourceHeader:oc,actionGroup:ac,headerControls:ic,titleRow:rc,headerTabs:cc,fallbackRow:lc,compatibilityActions:uc,checkRemote:dc,actionLabel:hc},mc="_bar_94zgz_2",fc="_warn_94zgz_17",gc="_inline_94zgz_22",pc="_copyButton_94zgz_39",xc="_branch_94zgz_49",vc="_branchName_94zgz_58",bc="_branchLink_94zgz_68",_c="_upstream_94zgz_79",Sc="_sync_94zgz_80",wc="_badge_94zgz_98",yc="_clean_94zgz_110",Cc="_dirty_94zgz_115",jc="_badgeAction_94zgz_120",kc="_upstreamButton_94zgz_130",Nc="_incomingDialog_94zgz_143",Rc="_incomingIntro_94zgz_147",Ec="_incomingState_94zgz_148",Lc="_incomingTruncated_94zgz_149",Tc="_incomingList_94zgz_154",Mc="_incomingCommit_94zgz_162",Pc="_incomingCommitHeader_94zgz_171",Fc="_incomingSubject_94zgz_183",Ac="_incomingMeta_94zgz_188",ve={bar:mc,warn:fc,inline:gc,copyButton:pc,branch:xc,branchName:vc,branchLink:bc,upstream:_c,sync:Sc,badge:wc,clean:yc,dirty:Cc,badgeAction:jc,upstreamButton:kc,incomingDialog:Nc,incomingIntro:Rc,incomingState:Ec,incomingTruncated:Lc,incomingList:Tc,incomingCommit:Mc,incomingCommitHeader:Pc,incomingSubject:Fc,incomingMeta:Ac};function $c({status:e,projectId:t,supportsIncomingCommits:n=!1,onSelectChanges:o,headCommitHref:i,onOpenHeadCommit:r,className:u,t:l}){var g;const[c,m]=a.useState(!1),d=e.ahead>0||e.behind>0,_=!e.isClean||d,y=(g=e.recentCommits)==null?void 0:g[0],v=e.branch??l("gitStatusDetachedHead"),p=e.branch??(y==null?void 0:y.hash),k=y!==void 0&&i!==void 0&&r!==void 0,E=n&&t!==void 0&&e.upstream!==null;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{"data-testid":"repo-status-bar",className:[ve.bar,ve.inline,_?ve.warn:"",u??""].filter(Boolean).join(" "),children:[s.jsxs("span",{className:ve.branch,children:[s.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),s.jsx("circle",{cx:"18",cy:"6",r:"3"}),s.jsx("circle",{cx:"6",cy:"18",r:"3"}),s.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),k?s.jsx("a",{className:`${ve.branchName} ${ve.branchLink}`,href:i,title:l("sourceOpenHeadCommit",{commit:y.shortHash}),onClick:x=>{x.button!==0||x.metaKey||x.ctrlKey||x.shiftKey||x.altKey||(x.preventDefault(),r())},children:v}):s.jsx("span",{className:ve.branchName,children:v}),p&&s.jsx(Xt,{value:p,title:e.branch?l("sourceCopyBranch"):l("sourceCopyCommitHash"),className:ve.copyButton})]}),e.upstream&&(E?s.jsxs("button",{type:"button",className:`${ve.upstream} ${ve.upstreamButton}`,title:l("sourceOpenIncomingCommits",{upstream:e.upstream}),onClick:()=>m(!0),children:["→ ",e.upstream]}):s.jsxs("span",{className:ve.upstream,title:e.upstream,children:["→ ",e.upstream]})),d&&s.jsxs("span",{className:ve.sync,children:[e.ahead>0&&` ↑${e.ahead}`,e.behind>0&&` ↓${e.behind}`]}),!e.isClean&&o?s.jsx("button",{type:"button",className:`${ve.badge} ${ve.dirty} ${ve.badgeAction}`,title:l("sourceOpenChanges"),onClick:o,children:l("gitStatusDirty")}):s.jsx("span",{className:`${ve.badge} ${e.isClean?ve.clean:ve.dirty}`,children:e.isClean?l("gitStatusClean"):l("gitStatusDirty")})]}),c&&t&&s.jsx(Dc,{projectId:t,onClose:()=>m(!1),t:l})]})}function Dc({projectId:e,onClose:t,t:n}){const[o,i]=a.useState(null),[r,u]=a.useState(!1);return a.useEffect(()=>{let l=!0;return me.getGitIncomingCommits(e).then(c=>{l&&i(c)}).catch(()=>{l&&u(!0)}),()=>{l=!1}},[e]),s.jsx(wt,{title:n("sourceIncomingCommitsTitle"),onClose:t,children:s.jsxs("div",{className:ve.incomingDialog,children:[s.jsx("p",{className:ve.incomingIntro,children:n("sourceIncomingCommitsDescription")}),r?s.jsx("p",{className:ve.incomingState,role:"alert",children:n("sourceIncomingCommitsError")}):o===null?s.jsx("p",{className:ve.incomingState,children:n("sourceIncomingCommitsLoading")}):o.commits.length===0?s.jsx("p",{className:ve.incomingState,children:n("sourceIncomingCommitsEmpty",{upstream:o.upstream})}):s.jsxs(s.Fragment,{children:[s.jsx("ul",{className:ve.incomingList,children:o.commits.map(l=>s.jsxs("li",{className:ve.incomingCommit,children:[s.jsxs("span",{className:ve.incomingCommitHeader,children:[s.jsx("code",{title:l.hash,children:l.shortHash}),s.jsx("strong",{className:ve.incomingSubject,children:l.subject})]}),s.jsxs("span",{className:ve.incomingMeta,children:[l.authorName," ·"," ",js(l.authorDate)]})]},l.hash))}),o.truncated&&s.jsx("p",{className:ve.incomingTruncated,children:n("sourceIncomingCommitsTruncated",{count:o.limit})})]})]})})}const Bc="_panel_ekf2m_2",Oc="_empty_ekf2m_9",Ic="_hint_ekf2m_14",Hc="_list_ekf2m_20",Uc="_row_ekf2m_29",Wc="_rowHead_ekf2m_36",zc="_location_ekf2m_43",Gc="_revision_ekf2m_59",Kc="_rowActions_ekf2m_66",qc="_edit_ekf2m_72",Vc="_text_ekf2m_94",Yc="_editor_ekf2m_101",Xc="_editorActions_ekf2m_117",Jc="_error_ekf2m_123",Qc="_actions_ekf2m_127",Fe={panel:Bc,empty:Oc,hint:Ic,list:Hc,row:Uc,rowHead:Wc,location:zc,revision:Gc,rowActions:Kc,edit:qc,delete:"_delete_ekf2m_73",text:Vc,editor:Yc,editorActions:Xc,error:Jc,actions:Qc};function Zc({projectId:e,pending:t,onOpenFile:n,onSubmit:o,t:i}){const[r,u]=a.useState(null),[l,c]=a.useState(null),[m,d]=a.useState(null),[_,y]=a.useState(""),[v,p]=a.useState(null),k=async g=>{if(l!==g){c(g);return}u(g),p(null);try{await me.deleteReviewComment(e,g),$t(e)}catch(x){p(x instanceof Error?x.message:i("sourceReviewDeleteFailed"))}finally{u(null),c(null)}},E=async g=>{const x=_.trim();if(x){u(g),p(null);try{await me.updateReviewComment(e,g,{text:x}),$t(e),d(null),y("")}catch(N){p(N instanceof Error?N.message:i("sourceReviewEditFailed"))}finally{u(null)}}};return t.length===0?s.jsx("section",{className:Fe.panel,children:s.jsxs("div",{className:Fe.empty,children:[s.jsx("div",{children:i("sourceReviewNoPending")}),s.jsx("div",{className:Fe.hint,children:i("sourceReviewCommentsHint")})]})}):s.jsxs("section",{className:Fe.panel,children:[v&&s.jsx("div",{className:Fe.error,children:v}),s.jsx("ul",{className:Fe.list,children:t.map(g=>s.jsxs("li",{className:Fe.row,children:[s.jsxs("div",{className:Fe.rowHead,children:[s.jsx("button",{type:"button",className:Fe.location,title:i("sourceReviewOpenInFiles"),onClick:()=>n(g.anchor.path),children:el(g)}),s.jsx("span",{className:Fe.revision,children:tl(g,i)}),s.jsxs("div",{className:Fe.rowActions,children:[s.jsx("button",{type:"button",className:Fe.edit,disabled:r===g.id,onClick:()=>{d(g.id),y(g.text),c(null)},children:i("sourceReviewEdit")}),s.jsx("button",{type:"button",className:Fe.delete,disabled:r===g.id,onClick:()=>void k(g.id),children:l===g.id?i("sourceReviewDeleteConfirm"):i("sourceReviewDelete")})]})]}),m===g.id?s.jsxs("div",{className:Fe.editor,children:[s.jsx("textarea",{"aria-label":i("sourceReviewEditComment"),value:_,maxLength:2e4,onChange:x=>y(x.target.value)}),s.jsxs("div",{className:Fe.editorActions,children:[s.jsx("button",{type:"button",onClick:()=>{d(null),y("")},children:i("cancel")}),s.jsx("button",{type:"button",disabled:r===g.id||!_.trim(),onClick:()=>void E(g.id),children:i("sourceReviewSaveEdit")})]})]}):s.jsx("div",{className:Fe.text,children:g.text})]},g.id))}),s.jsx("div",{className:Fe.actions,children:s.jsx("button",{type:"button",className:"review-submit-go",onClick:o,children:i("sourceReviewOpenSubmit")})})]})}function el(e){const{anchor:t}=e,n=t.side==="old"?t.oldLine:t.newLine,o=t.side==="old"?" (old)":"";return`${t.path}:${n??"?"}${o}`}function tl(e,t){const{revision:n}=e.anchor;return n.kind==="sha"?n.sha.slice(0,7):t("sourceBlameNotCommitted")}const sl="_panel_mxp7x_1",nl="_empty_mxp7x_8",ol="_submissionList_mxp7x_13",al="_siteList_mxp7x_14",il="_entryList_mxp7x_15",rl="_submissionButton_mxp7x_24",cl="_active_mxp7x_47",ll="_loadMore_mxp7x_52",ul="_unread_mxp7x_61",dl="_mobileSelector_mxp7x_69",hl="_detail_mxp7x_73",ml="_detailHeader_mxp7x_77",fl="_siteHeader_mxp7x_78",gl="_entryHead_mxp7x_79",pl="_outcomeHead_mxp7x_80",xl="_siteActions_mxp7x_81",vl="_detailActions_mxp7x_93",bl="_stateGroup_mxp7x_94",_l="_responseNotice_mxp7x_119",Sl="_submittedAt_mxp7x_130",wl="_awaitingSession_mxp7x_131",yl="_captureId_mxp7x_133",Cl="_sessionLink_mxp7x_138",jl="_site_mxp7x_14",kl="_location_mxp7x_156",Nl="_state_mxp7x_94",Rl="_open_mxp7x_175",El="_addressed_mxp7x_179",Ll="_resolved_mxp7x_183",Tl="_changed_mxp7x_187",Ml="_unchanged_mxp7x_191",Pl="_unavailable_mxp7x_192",Fl="_entry_mxp7x_15",Al="_commentTextRow_mxp7x_206",$l="_commentLine_mxp7x_214",Dl="_text_mxp7x_227",Bl="_source_mxp7x_233",Ol="_highlight_mxp7x_262",Il="_lineNumber_mxp7x_267",Hl="_captureMissing_mxp7x_276",Ul="_error_mxp7x_277",Wl="_outcome_mxp7x_80",zl="_followUp_mxp7x_306",te={panel:sl,empty:nl,submissionList:ol,siteList:al,entryList:il,submissionButton:rl,active:cl,loadMore:ll,unread:ul,mobileSelector:dl,detail:hl,detailHeader:ml,siteHeader:fl,entryHead:gl,outcomeHead:pl,siteActions:xl,detailActions:vl,stateGroup:bl,responseNotice:_l,submittedAt:Sl,awaitingSession:wl,captureId:yl,sessionLink:Cl,site:jl,location:kl,state:Nl,open:Rl,addressed:El,resolved:Ll,changed:Tl,unchanged:Ml,unavailable:Pl,entry:Fl,commentTextRow:Al,commentLine:$l,text:Dl,source:Bl,highlight:Ol,lineNumber:Il,captureMissing:Hl,error:Ul,outcome:Wl,followUp:zl};function Gl({projectId:e,initialSubmissionId:t,sessionHref:n,t:o}){const[i,r]=a.useState([]),[u,l]=a.useState(null),[c,m]=a.useState(null),[d,_]=a.useState(null),[y,v]=a.useState(!0),[p,k]=a.useState(null),E=a.useCallback(async C=>{const S=await me.listReviewSubmissions(e,{cursor:C,limit:50});r(w=>C?[...w,...S.submissions]:S.submissions),l(S.nextCursor),C||m(w=>{var b;return t||(S.submissions.some(z=>z.id===w)?w:((b=S.submissions[0])==null?void 0:b.id)??null)})},[t,e]),g=a.useCallback(async C=>{const S=await me.getReviewSubmission(e,C);_(S),r(w=>w.some(b=>b.id===S.submission.id)?w:[S.submission,...w])},[e]);a.useEffect(()=>{if(!d||d.submission.id!==c||d.submission.responseRevision<=d.submission.acknowledgedRevision)return;let C=!1;return me.acknowledgeReviewSubmission(e,d.submission.id).then(({submission:S})=>{C||(r(w=>w.map(b=>b.id===S.id?S:b)),_(w=>(w==null?void 0:w.submission.id)===S.id?{...w,submission:S}:w))}).catch(()=>{}),()=>{C=!0}},[d,e,c]),a.useEffect(()=>{let C=!1;return v(!0),k(null),E().catch(S=>{C||k(S instanceof Error?S.message:o("sourceReviewSubmissionsLoadFailed"))}).finally(()=>{C||v(!1)}),()=>{C=!0}},[E,o]),a.useEffect(()=>{if(!c){_(null);return}let C=!1;return k(null),g(c).catch(S=>{C||k(S instanceof Error?S.message:o("sourceReviewSubmissionLoadFailed"))}),()=>{C=!0}},[g,c,o]);const x=a.useCallback(async()=>{await E(),c&&await g(c)},[g,E,c]);if(y)return s.jsx("section",{className:te.empty,children:o("loading")});if(i.length===0)return s.jsx("section",{className:te.empty,children:o("sourceReviewNoSubmissions")});const N=i.find(C=>C.id===c)??i[0];return s.jsxs("section",{className:te.panel,children:[s.jsxs("ul",{className:te.submissionList,children:[i.map(C=>s.jsx("li",{children:s.jsxs("button",{type:"button",className:`${te.submissionButton} ${C.id===N.id?te.active:""}`.trimEnd(),onClick:()=>m(C.id),children:[s.jsx("span",{children:Zs(C,o)}),C.responseRevision>C.acknowledgedRevision&&s.jsx("span",{className:te.unread,role:"img","aria-label":o("sourceReviewUnread")})]})},C.id)),u&&s.jsx("li",{children:s.jsx("button",{type:"button",className:te.loadMore,onClick:()=>void E(u),children:o("sourceReviewLoadOlder")})})]}),s.jsxs("label",{className:te.mobileSelector,children:[s.jsx("span",{children:o("sourceReviewSelectSubmission")}),s.jsx("select",{value:N.id,onChange:C=>m(C.target.value),children:i.map(C=>s.jsx("option",{value:C.id,children:Zs(C,o)},C.id))})]}),s.jsxs("article",{className:te.detail,children:[p&&s.jsx("div",{className:te.error,children:p}),(d==null?void 0:d.submission.id)===N.id?s.jsx(Kl,{detail:d,projectId:e,sessionHref:n,refresh:x,t:o}):s.jsx("div",{className:te.empty,children:o("loading")})]})]})}function Kl({detail:e,projectId:t,sessionHref:n,refresh:o,t:i}){const[r,u]=a.useState(!1),[l,c]=a.useState(null),m=a.useMemo(()=>new Map(e.capturedSources.map(v=>[`${v.siteId}\0${v.entryId}`,v])),[e.capturedSources]),d=e.sites.flatMap(v=>v.entries).find(v=>v.submissionId===e.submission.id),_=e.submission.name??un((d==null?void 0:d.text)??""),y=async()=>{u(!0),c(null);try{const v=await me.refreshReviewSubmissionResponse(t,e.submission.id);c(nu(v.responseStatus,i)),$t(t),await o()}catch(v){c(v instanceof Error?v.message:i("sourceReviewResponseRefreshFailed"))}finally{u(!1)}};return s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:te.detailHeader,children:[s.jsxs("div",{children:[s.jsx("h2",{children:_}),s.jsx("div",{className:te.submittedAt,children:Ln(e.submission)})]}),s.jsxs("div",{className:te.detailActions,children:[s.jsx("button",{type:"button",disabled:r,onClick:()=>void y(),children:i(r?"sourceReviewRefreshingResponse":"sourceReviewRefreshResponse")}),e.submission.targetSessionId?s.jsx(on,{className:te.sessionLink,to:n(e.submission.targetSessionId),children:i("sourceReviewOpenSession")}):s.jsx("span",{className:te.awaitingSession,children:i("sourceReviewAwaitingSession")})]})]}),l&&s.jsx("div",{className:te.responseNotice,children:l}),s.jsx("ul",{className:te.siteList,children:e.sites.map(v=>s.jsx(ql,{site:v,sourceFor:p=>m.get(`${v.id}\0${p}`)??{siteId:v.id,entryId:p,source:{status:"legacy-missing"},changeStatus:"unavailable"},projectId:t,refresh:o,sessionHref:n,t:i},v.id))})]})}function ql({site:e,sourceFor:t,projectId:n,refresh:o,sessionHref:i,t:r}){const[u,l]=a.useState(""),[c,m]=a.useState(!1),[d,_]=a.useState(null),y=e.entries.at(-1),v=(y==null?void 0:y.submittedAt)===void 0,p=y?t(y.id):null,k=Yl(e,(p==null?void 0:p.changeStatus)??"unavailable"),E=async()=>{const x=u.trim();if(x){m(!0),_(null);try{await me.addReviewFollowUp(n,e.id,x),l(""),$t(n),await o()}catch(N){_(N instanceof Error?N.message:r("sourceReviewFollowUpFailed"))}finally{m(!1)}}},g=async()=>{m(!0),_(null);try{await me.resolveReviewSite(n,e.id),await o()}catch(x){_(x instanceof Error?x.message:r("sourceReviewResolveFailed"))}finally{m(!1)}};return s.jsxs("li",{className:te.site,children:[s.jsxs("header",{className:te.siteHeader,children:[s.jsx("span",{className:te.location,children:e.path}),s.jsxs("span",{className:te.stateGroup,children:[s.jsx("span",{className:`${te.state} ${eu(k)}`,children:Zl(k,r)}),s.jsx("span",{className:`${te.state} ${su((p==null?void 0:p.changeStatus)??"unavailable")}`,children:tu((p==null?void 0:p.changeStatus)??"unavailable",r)})]})]}),s.jsx("ol",{className:te.entryList,children:e.entries.map(x=>{const N=e.outcomes.filter(C=>C.entryId===x.id);return s.jsxs("li",{className:te.entry,children:[s.jsx("div",{className:te.entryHead,children:s.jsx("span",{children:x.submittedAt?r("sourceReviewSubmittedEntry"):r("sourceReviewPendingFollowUp")})}),s.jsxs("div",{className:te.commentTextRow,children:[s.jsx("span",{className:te.commentLine,title:Xl(x.anchor),children:Jl(x.anchor)}),s.jsx("div",{className:te.text,children:x.text})]}),s.jsx(Vl,{source:t(x.id).source,t:r}),N.map(C=>s.jsxs("div",{className:te.outcome,children:[s.jsxs("div",{className:te.outcomeHead,children:[s.jsx("span",{children:Ql(C.disposition,r)}),C.sessionId&&s.jsx(on,{to:i(C.sessionId),children:r("sourceReviewOutcomeSession")})]}),s.jsx("div",{children:C.text})]},C.responseHash))]},x.id)})}),d&&s.jsx("div",{className:te.error,children:d}),!v&&s.jsxs("div",{className:te.followUp,children:[s.jsx("textarea",{"aria-label":r("sourceReviewFollowUp"),value:u,maxLength:2e4,placeholder:r("sourceReviewFollowUpPlaceholder"),onChange:x=>l(x.target.value)}),s.jsxs("div",{className:te.siteActions,children:[!e.resolvedAt&&s.jsx("button",{type:"button",disabled:c,onClick:()=>void g(),children:r("sourceReviewResolve")}),s.jsx("button",{type:"button",disabled:c||!u.trim(),onClick:()=>void E(),children:r("sourceReviewAddFollowUp")})]})]})]})}function Vl({source:e,t}){return e.status==="legacy-missing"?s.jsx("div",{className:te.captureMissing,children:t("sourceReviewLegacyCaptureMissing")}):e.status==="unavailable"?s.jsx("div",{className:te.captureMissing,children:ou(e.reason,t)}):s.jsxs("div",{className:te.source,children:[s.jsxs("div",{className:te.captureId,children:[t("sourceReviewCapturedSource")," · ",e.captureBlobId.slice(0,12)]}),s.jsx("pre",{children:e.content.split(`
|
|
14
14
|
`).map((n,o)=>{const i=e.startLine+o;return s.jsxs("span",{className:i===e.highlightLine?te.highlight:"",children:[s.jsx("span",{className:te.lineNumber,children:i}),s.jsx("span",{children:n||" "}),`
|
|
15
|
-
`]},i)})})]})}function Yl(e,t){var o;if(e.resolvedAt)return"resolved";if(((o=e.entries.at(-1))==null?void 0:o.submittedAt)===void 0)return"open";const n=[...e.entries].reverse().find(i=>i.submittedAt);return n&&(e.outcomes.some(i=>i.entryId===n.id)||t==="changed")?"addressed":"open"}function Zs(e,t){return e.name??t("sourceReviewSubmission",{date:Ln(e)})}function Ln(e){const t=new Date(e.submittedAt);return Number.isNaN(t.getTime())?e.submittedAt:t.toLocaleString()}function Xl(e){const t=e.side==="old"?e.oldLine:e.newLine,n=e.side==="old"?" (old)":"";return`${e.path}:${t??"?"}${n}`}function Jl(e){const t=e.side==="old"?e.oldLine:e.newLine;return String(t??"?")}function Ql(e,t){return t(e==="wont_fix"?"sourceReviewOutcomeNoChange":e==="question"?"sourceReviewOutcomeQuestion":"sourceReviewOutcomeDone")}function Zl(e,t){return t(e==="addressed"?"sourceReviewStateAddressed":e==="resolved"?"sourceReviewStateResolved":"sourceReviewStateOpen")}function eu(e){return e==="addressed"?te.addressed:e==="resolved"?te.resolved:te.open}function tu(e,t){return t(e==="changed"?"sourceReviewSourceChanged":e==="unchanged"?"sourceReviewSourceUnchanged":"sourceReviewSourceUnavailable")}function su(e){return e==="changed"?te.changed:e==="unchanged"?te.unchanged:te.unavailable}function nu(e,t){return t(e==="ingested"?"sourceReviewResponseIngested":e==="unchanged"?"sourceReviewResponseUnchanged":e==="invalid"?"sourceReviewResponseInvalid":"sourceReviewResponseMissing")}function ou(e,t){return t(e==="binary"?"sourceReviewCaptureUnavailableBinary":e==="too-large"?"sourceReviewCaptureUnavailableTooLarge":"sourceReviewCaptureUnavailableMissing")}const au="_modal_z7m94_1",iu="_list_z7m94_8",ru="_row_z7m94_19",cu="_stale_z7m94_25",lu="_rowHead_z7m94_30",uu="_location_z7m94_36",du="_staleLabel_z7m94_41",hu="_movedLabel_z7m94_46",mu="_rowText_z7m94_51",fu="_destination_z7m94_56",gu="_field_z7m94_65",pu="_newSession_z7m94_85",xu="_targetError_z7m94_91",vu="_error_z7m94_92",bu="_actions_z7m94_100",_u="_name_z7m94_107",Su="_go_z7m94_112",Ee={modal:au,list:iu,row:ru,stale:cu,rowHead:lu,location:uu,staleLabel:du,movedLabel:hu,rowText:mu,destination:fu,field:gu,newSession:pu,targetError:xu,error:vu,actions:bu,name:_u,go:Su};function wu({projectId:e,recentReviewSessionId:t,submissionsEnabled:n=!1,onClose:o,onNavigateSession:i,t:r}){var H;const[u,l]=a.useState(null),[c,m]=a.useState(new Set),[d,_]=a.useState(t??"new"),y=a.useRef(!1),[v,p]=a.useState(!1),[k,E]=a.useState(null),[g,x]=a.useState(null),[N,C]=a.useState(!1),[S,w]=a.useState(""),b=a.useRef(null);n&&!b.current&&(b.current=crypto.randomUUID());const[z,M]=a.useState(null),[R,L]=a.useState(null),{providers:O,loading:I}=Mo(),ee=a.useMemo(()=>Po(O),[O]),[P,V]=a.useState(""),[j,F]=a.useState(""),G=ee.find(f=>f.name===P),se=u==null?void 0:u.find(f=>c.has(f.comment.id)),ne=un((se==null?void 0:se.comment.text)??"");a.useEffect(()=>{const f=Fo(O);f&&V(B=>B||f.name)},[O]),a.useEffect(()=>{let f=!1;return po(e).then(B=>{var U;f||(M(B),y.current||_(t||(((U=B[0])==null?void 0:U.id)??"new")))}).catch(B=>{f||L(B instanceof Error?B.message:r("sourceReviewSessionsUnavailable"))}),()=>{f=!0}},[e,t,r]),a.useEffect(()=>{let f=!1;return me.previewReview(e).then(B=>{f||(l(B.items),m(new Set(B.items.filter(U=>!U.defaultDiscard).map(U=>U.comment.id))))}).catch(B=>{f||E(B instanceof Error?B.message:"Failed to preview")}),()=>{f=!0}},[e]);const Q=a.useCallback(f=>{m(B=>{const U=new Set(B);return U.has(f)?U.delete(f):U.add(f),U})},[]),J=a.useCallback(async()=>{const f=[...c];if(f.length!==0){p(!0),E(null);try{const B=d==="new"?{provider:P||void 0,model:j||void 0}:void 0,U=n&&b.current?await me.submitReview(e,f,d,B,{id:b.current,name:S.trim()||void 0}):await me.submitReview(e,f,d,B);if($t(e),U.sessionId){i(U.sessionId),o();return}x(r(n?"sourceReviewSubmissionQueued":"sourceReviewSubmitQueued")),C(!0)}catch(B){E(B instanceof Error?B.message:"Failed to submit")}finally{p(!1)}}},[c,d,P,j,e,i,o,r,n,S]);return s.jsx(wt,{title:r("sourceReviewSubmitTitle"),onClose:o,children:s.jsxs("div",{className:Ee.modal,children:[k&&s.jsx("div",{className:Ee.error,children:k}),g&&s.jsx("div",{role:"status",children:g}),u===null?s.jsx("div",{children:r("loading")}):u.length===0?s.jsx("div",{children:r("sourceReviewNoPending")}):s.jsx("ul",{className:Ee.list,children:u.map(f=>s.jsx(yu,{item:f,checked:c.has(f.comment.id),onToggle:()=>Q(f.comment.id),t:r},f.comment.id))}),u&&u.length>0&&s.jsxs("div",{className:Ee.destination,children:[s.jsxs("label",{className:Ee.field,children:[s.jsx("span",{children:r("sourceReviewTargetLegend")}),s.jsxs("select",{value:d,onChange:f=>{y.current=!0,_(f.target.value)},children:[s.jsx("option",{value:"new",children:r("sourceReviewTargetNew")}),t&&!(z!=null&&z.some(f=>f.id===t))&&s.jsxs("option",{value:t,children:[r("sourceReviewTargetRecent")," ·"," ",t.slice(0,8)]}),z==null?void 0:z.map(f=>s.jsx("option",{value:f.id,children:xo(f,f.id===t?r("sourceReviewRecentSuffix"):void 0)},f.id))]})]}),R&&s.jsxs("div",{className:Ee.targetError,children:[r("sourceReviewSessionsUnavailable"),": ",R]}),d==="new"&&s.jsxs("div",{className:Ee.newSession,children:[s.jsxs("label",{className:Ee.field,children:[s.jsx("span",{children:r("sourceReviewProvider")}),s.jsx("select",{value:P,disabled:I||ee.length===0,onChange:f=>{V(f.target.value),F("")},children:ee.map(f=>s.jsx("option",{value:f.name,children:f.displayName},f.name))})]}),s.jsxs("label",{className:Ee.field,children:[s.jsx("span",{children:r("sourceReviewModel")}),s.jsxs("select",{value:j,disabled:!G,onChange:f=>F(f.target.value),children:[s.jsx("option",{value:"",children:r("sourceReviewModelDefault")}),(H=G==null?void 0:G.models)==null?void 0:H.map(f=>s.jsx("option",{value:f.id,children:f.name},f.id))]})]})]})]}),s.jsxs("div",{className:Ee.actions,children:[n&&s.jsxs("label",{className:`${Ee.field} ${Ee.name}`,children:[s.jsx("span",{children:r("sourceReviewSubmissionName")}),s.jsx("input",{value:S,maxLength:120,placeholder:ne,onChange:f=>w(f.target.value)})]}),s.jsx("button",{type:"button",onClick:o,disabled:v,children:r("cancel")}),s.jsx("button",{type:"button",className:Ee.go,onClick:J,disabled:v||N||c.size===0,children:r("sourceReviewSubmitReview",{count:c.size})})]})]})})}function yu({item:e,checked:t,onToggle:n,t:o}){const i=e.relocation.status==="gone",r=i?e.relocation.citeSha?`${e.relocation.path} @ ${e.relocation.citeSha.slice(0,8)}`:e.relocation.path:`${e.relocation.path}:${e.relocation.line}`;return s.jsxs("li",{className:`${Ee.row} ${i?Ee.stale:""}`,children:[s.jsxs("label",{className:Ee.rowHead,children:[s.jsx("input",{type:"checkbox",checked:t,onChange:n}),s.jsx("span",{className:Ee.location,children:r}),i&&s.jsx("span",{className:Ee.staleLabel,children:o("sourceReviewStale")}),!i&&e.relocation.moved&&s.jsx("span",{className:Ee.movedLabel,children:o("sourceReviewMoved")})]}),s.jsx("div",{className:Ee.rowText,children:e.comment.text})]})}const Cu="_tabs_zkbzy_2",ju="_tab_zkbzy_2",ku="_active_zkbzy_30",Nu="_count_zkbzy_35",Ru="_stacked_zkbzy_47",Tt={tabs:Cu,tab:ju,active:ku,count:Nu,stacked:Ru};function Eu({tab:e,tabs:t,counts:n,fileTabLabelKey:o,onSelect:i,variant:r="header",t:u}){return s.jsx("div",{className:`${Tt.tabs} ${r==="stacked"?Tt.stacked:""}`.trimEnd(),role:"tablist",children:t.map(l=>{const c=n==null?void 0:n[l];return s.jsxs("button",{type:"button",role:"tab","aria-selected":e===l,className:`${Tt.tab} ${e===l?Tt.active:""}`.trimEnd(),onClick:()=>i(l),children:[u(l==="files"&&o?o:Lu(l)),typeof c=="number"&&c>0&&s.jsx("span",{className:Tt.count,children:c})]},l)})})}function Lu(e){switch(e){case"changes":return"sourceTabChanges";case"files":return"sourceTabFiles";case"comments":return"sourceTabComments";case"reviews":return"sourceTabReviews"}}const Tu=300*1e3,Tn=["changes","files","comments"],Mu=[...Tn,"reviews"],Qt=["tab","history","rev","commitFile","blame","worktreeFile","bf","submission"];function Pu(e,t){if(!e)return null;const n=new Map(e.files.flatMap(i=>i.lastEditor?[[i.path,i.lastEditor]]:[])),o=[];for(const i of t)for(const r of i.worktreeChanges??[]){const u=r.lastEditor??n.get(i.path);o.push({path:i.path,...r,...u?{lastEditor:u}:{}})}return{...e,files:o,isClean:o.length===0}}function ks(e=!1){const[t,n]=ts(),o=es(),i=t.get("tab"),r=i==="files"?"files":i==="comments"?"comments":i==="reviews"&&e?"reviews":"changes",u=a.useCallback(l=>{n(c=>{const m=new URLSearchParams(c);return l==="changes"?m.delete("tab"):m.set("tab",l),m.delete("history"),m.delete("rev"),l!=="reviews"&&m.delete("submission"),m},{state:o.state})},[o.state,n]);return{tab:r,setTab:u}}function Fu(e,t,n){var _,y;const o=ss(),i=es(),[r,u]=ts(),l=(y=(_=t==null?void 0:t.recentCommits)==null?void 0:_[0])==null?void 0:y.hash,c=n&&l!==void 0&&e!==void 0,m=a.useMemo(()=>{if(!c)return;const v=new URLSearchParams(r);v.set("projectId",e);for(const p of Qt)v.delete(p);return v.set("rev",l),hn(`${o}/git-status?${v.toString()}`)},[c,o,l,e,r]),d=a.useCallback(()=>{c&&u(v=>{const p=new URLSearchParams(v);for(const k of Qt)p.delete(k);return p.set("rev",l),p},{state:i.state})},[c,l,i.state,u]);return c?{headCommitHref:m,onOpenHeadCommit:d}:{}}function Au({status:e,pendingCount:t,reviewsEnabled:n,supportsWorkingTreeFiles:o,t:i}){const{tab:r,setTab:u}=ks(n),l=zu(e);return s.jsx(Eu,{tab:r,tabs:n?Mu:Tn,variant:"stacked",counts:{changes:l,comments:t},fileTabLabelKey:o?"sourceTabWorkingTree":void 0,onSelect:u,t:i})}function $u({status:e,pendingCount:t,reviewsEnabled:n,supportsWorkingTreeFiles:o,worktreePaused:i,gitActions:r,isWideScreen:u,onToggleWorktreePaused:l,t:c}){const m=a.useRef(null),d=a.useRef(null),[_,y]=a.useState(!1);return a.useLayoutEffect(()=>{if(!u){y(!1);return}const v=m.current,p=d.current,k=v==null?void 0:v.closest(".session-header-inner"),E=k==null?void 0:k.querySelector(".session-header-left"),g=v==null?void 0:v.querySelector("[data-source-action-group]"),x=p==null?void 0:p.querySelector('[role="tablist"]');if(!v||!p||!k||!E||!g||!x)return;const N=()=>{const S=getComputedStyle(k),w=k.clientWidth-it(S.paddingLeft)-it(S.paddingRight),b=it(S.columnGap);if(w<=0){y(!1);return}const z=xs(E)+xs(g)+xs(x)+2*b;y(z<=w+.5)};if(N(),typeof ResizeObserver>"u")return;const C=new ResizeObserver(N);return C.observe(k),C.observe(E),C.observe(g),C.observe(x),()=>C.disconnect()},[u]),s.jsxs(s.Fragment,{children:[s.jsx("div",{ref:m,className:`${Qe.headerControls} ${_?Qe.titleRow:Qe.fallbackRow}`,"data-source-actions-placement":_?"title":"fallback",children:s.jsx(Mn,{gitActions:r,worktreePaused:i,onToggleWorktreePaused:l,t:c})}),s.jsx("div",{ref:d,className:Qe.headerTabs,children:s.jsx(Au,{status:e,pendingCount:t,reviewsEnabled:n,supportsWorkingTreeFiles:o,t:c})})]})}function xs(e){const t=getComputedStyle(e),n=Array.from(e.children).filter(i=>i instanceof HTMLElement&&getComputedStyle(i).display!=="none");return n.reduce((i,r)=>i+Math.max(r.getBoundingClientRect().width,r.scrollWidth),0)+Math.max(0,n.length-1)*it(t.columnGap)+it(t.paddingLeft)+it(t.paddingRight)+it(t.borderLeftWidth)+it(t.borderRightWidth)}function it(e){const t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function Mn({gitActions:e,worktreePaused:t,onToggleWorktreePaused:n,t:o}){const i=ko(),r=o("gitStatusLastCheckedRemote",{time:ea(e.checkedRemoteAt,i,o)});return s.jsxs("div",{className:Qe.actionGroup,"data-source-action-group":!0,children:[e.supportsPull&&s.jsx(vs,{action:"pull",label:o("gitStatusPull"),runningLabel:o("gitStatusPulling"),running:e.isPulling,feedback:e.pullFeedback,tone:e.pullFeedbackTone,onClick:e.handlePull,disabled:e.isRunning}),e.supportsPush&&s.jsx(vs,{action:"push",label:o("gitStatusPush"),runningLabel:o("gitStatusPushing"),running:e.isPushing,feedback:e.pushFeedback,tone:e.pushFeedbackTone,onClick:e.handlePush,disabled:e.isRunning}),e.supportsRemoteCheck&&s.jsx(vs,{action:"check",label:o("gitStatusCheckRemote"),runningLabel:o("gitStatusCheckingRemote"),running:e.isCheckingRemote,feedback:e.checkFeedback,tone:e.checkFeedbackTone,title:e.checkFeedback?`${e.checkFeedback} · ${r}`:r,className:Qe.checkRemote,onClick:e.handleCheckRemote,disabled:e.isRunning}),n&&s.jsxs("button",{type:"button",className:"git-status-action-button","aria-pressed":t,title:o(t?"sourceResumeLiveUpdates":"sourcePauseLiveUpdates"),onClick:n,children:[s.jsx("span",{className:"git-status-action-indicator","aria-hidden":"true",children:s.jsx(Pn,{action:t?"play":"pause"})}),s.jsx("span",{className:Qe.actionLabel,children:o(t?"sourceResumeLiveUpdates":"sourcePauseLiveUpdates")})]})]})}function vs({action:e,label:t,runningLabel:n,running:o,feedback:i,tone:r,title:u,className:l="",onClick:c,disabled:m}){const d=u??i,[_,y]=a.useState(!1);a.useEffect(()=>{if(!r||!i){y(!1);return}y(!0);const p=setTimeout(()=>y(!1),6e3);return()=>clearTimeout(p)},[r,i]);const v=_&&r!==null&&i!=="";return s.jsxs("button",{type:"button",className:`git-status-action-button ${l} ${v?`git-status-action-${r}`:""} ${o?"git-status-action-running":""}`,title:d,"aria-label":o?`${t}: ${n}`:i?`${t}: ${i}`:t,onClick:c,disabled:m,children:[s.jsx("span",{className:"git-status-action-indicator","aria-hidden":"true",children:o?null:v?r==="success"?"✓":"!":s.jsx(Pn,{action:e})}),s.jsx("span",{className:Qe.actionLabel,children:t})]})}function Pn({action:e}){if(e==="pause")return s.jsxs("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"currentColor",children:[s.jsx("rect",{x:"4",y:"3",width:"2.75",height:"10",rx:"0.6"}),s.jsx("rect",{x:"9.25",y:"3",width:"2.75",height:"10",rx:"0.6"})]});if(e==="play")return s.jsx("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"currentColor",children:s.jsx("path",{d:"M5 3.15 13 8 5 12.85Z"})});if(e==="check")return s.jsx("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M13 5V2.5L11.4 4A5.5 5.5 0 1 0 13.1 10"})});const t=e==="pull";return s.jsx("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:t?"M8 2v10M4.5 8.5 8 12l3.5-3.5":"M8 14V4M4.5 7.5 8 4l3.5 3.5"})})}function Du(e,t){return{sourceKey:e,routeId:"git-status",projectId:t,queryParams:{projectId:t}}}function Bu(e,t){So(e,n=>t(n??{}),{ttlMs:Tu})}function Ou(e){return wo(e,{touch:!1,recordDiagnostics:!1})}function Iu(e){return a.useSyncExternalStore(_o,()=>e?Ou(e):null,()=>null)}function jd(){const{t:e}=tn(),t=es(),[n,o]=ts(),i=n.get("projectId"),r=dn(),{openSidebar:u,isWideScreen:l,toggleSidebar:c,isSidebarCollapsed:m}=oo(),d=a.useRef(null),[_,y]=a.useState(!1),v=Qo(),p=_||!v,{projects:k,loading:E}=an(),g=i||jo(k)||void 0,{project:x}=ao(g),{version:N,loading:C,error:S}=ro(),{settings:w}=Ro(),b=Be(N,Kn)&&((w==null?void 0:w.sourceReviewSubmissionsEnabled)??!1),{setTab:z}=ks(b),M=Be(N,Vn),R=Be(N,Wn),L=Be(N,Xn),O=Be(N,zn),I=Be(N,Qn),ee=Be(N,Jn),P=Be(N,Gn),j=Be(N,Hn)&&Be(N,Un),F=j&&Be(N,Yn),G=Be(N,qn),se=Be(N,Zn),ne=Be(N,eo),Q=Be(N,to),J=Be(N,so),{gitStatus:H,untrackedFiles:f,untrackedLoading:B,untrackedError:U,loading:T,error:$,refetch:X}=vo(M?g:void 0,{omitUntracked:j,useUntrackedCache:P&&!j}),Y=!!(g&&j&&(H!=null&&H.isGitRepo)),ce=gn(g??"",{tracked:!0,untracked:!0,ignored:!1},Y,p),K=a.useMemo(()=>j&&ce.generation?Pu(H,ce.files):H,[ce.files,ce.generation,H,j]),de=j?null:f,ye=Y&&ce.generation===null,ie=T,ue=$,le=ns(O?g:void 0),fe=Fu(g,K,O),{defaultSession:Ne}=a.useMemo(()=>To(t.state),[t.state]),Pe=(Ne==null?void 0:Ne.projectId)===g?Ne??null:null,[Ae,Oe]=a.useState(!1),_e=a.useMemo(()=>g?Du(r,g):null,[g,r]),ke=Iu(_e),ze=Zo({projectId:g,status:K,routeRetentionKey:_e,supportsRemoteCheck:se,supportsPull:ne,supportsPush:Q,supportsIntegrationOptions:J,onRefreshStatus:X,t:e});yo(x==null?void 0:x.name,R?x==null?void 0:x.codeName:void 0,e("gitStatusTitle")),a.useLayoutEffect(()=>{K==null||K.files.length;const ge=ke==null?void 0:ke.pageScrollTop;typeof ge!="number"||!d.current||(d.current.scrollTop=ge)},[K==null?void 0:K.files.length,ke==null?void 0:ke.pageScrollTop]),a.useLayoutEffect(()=>()=>{!_e||!d.current||Bu(_e,ge=>{var Re;return{...ge,pageScrollTop:((Re=d.current)==null?void 0:Re.scrollTop)??0}})},[_e]),a.useEffect(()=>{g&&x&&Ms(g)},[g,x]);const Me=ge=>{Ms(ge),o({projectId:ge},{replace:!0,state:null})};return!g&&!E&&k.length===0?s.jsx("div",{className:"error",children:e("gitStatusNoProjects")}):s.jsxs(Lo,{isWideScreen:l,innerClassName:`source-control-main-content ${Qe.sourceHeader}`,children:[s.jsx(no,{title:(x==null?void 0:x.name)??e("gitStatusTitle"),titleElement:g?s.jsxs("div",{className:"source-header-identity",children:[s.jsx(Yo,{currentProjectId:g,currentProjectName:x==null?void 0:x.name,onProjectChange:ge=>Me(ge.id)}),(K==null?void 0:K.isGitRepo)&&s.jsx($c,{status:K,projectId:g,supportsIncomingCommits:G,className:"source-header-repo-status",onSelectChanges:O?()=>z("changes"):void 0,...fe,t:e})]}):void 0,onOpenSidebar:u,onToggleSidebar:c,isWideScreen:l,isSidebarCollapsed:m,actions:O&&g&&(K!=null&&K.isGitRepo)?s.jsx($u,{status:K,pendingCount:le.pending.length,reviewsEnabled:b,supportsWorkingTreeFiles:P,gitActions:ze,isWideScreen:l,worktreePaused:_,onToggleWorktreePaused:j?()=>y(ge=>!ge):void 0,t:e}):void 0}),s.jsx("main",{className:"page-scroll-container",ref:d,children:s.jsx("div",{className:"page-content-inner",children:C||E?s.jsx("div",{className:"loading",children:e("gitStatusLoading")}):S?s.jsxs("div",{className:"error",children:[e("gitStatusErrorPrefix")," ",S.message]}):M?ie?s.jsx("div",{className:"loading",children:e("gitStatusLoading")}):ue?s.jsxs("div",{className:"error",children:[e("gitStatusErrorPrefix")," ",ue.message]}):K&&!K.isGitRepo&&g&&j?s.jsx(Es,{projectId:g,children:s.jsx(_s.Provider,{value:p,children:s.jsx("div",{className:"git-status",children:s.jsx(Cn,{projectId:g,isWideScreen:l,status:K,supportsWorkingTreeFiles:P,supportsWorktreeSections:!0,supportsCompleteFilesystemScan:F,t:e})})})}):K&&!K.isGitRepo?s.jsx("div",{className:"git-status-empty",children:e("gitStatusNotRepo")}):K&&g&&O?s.jsx(Es,{projectId:g,children:s.jsx(_s.Provider,{value:p,children:s.jsx(bo.Provider,{value:Pe,children:s.jsx(Wu,{status:K,projectId:g,isWideScreen:l,supportsProjections:I,supportsInclusiveToHead:ee,supportsWorkingTreeFiles:P,supportsWorkingTreeSections:j,supportsCompleteFilesystemScan:F,untrackedFiles:de,untrackedLoading:B,untrackedError:U,inventoryPending:ye,inventoryLoading:ye&&ce.loading,inventoryError:ye?ce.error:null,supportsLastEditor:L,gitActions:ze,reviewComments:le,reviewsEnabled:b,showReviewModal:Ae,onOpenReview:()=>Oe(!0),onCloseReview:()=>Oe(!1),t:e},`${r}:${g}`)})})}):K&&g?s.jsx(Uu,{gitActions:ze,t:e},`${r}:${g}:compatibility`):null:s.jsx(Hu,{t:e})})})]})}function Hu({t:e}){return s.jsxs("div",{className:"git-status-upgrade",children:[s.jsx("h2",{children:e("gitStatusUpgradeRequiredTitle")}),s.jsx("p",{children:e("gitStatusUpgradeRequiredDescription")})]})}function Uu({gitActions:e,t}){return s.jsxs("div",{className:"git-status git-status-compatibility",children:[s.jsx("div",{className:`source-control-action-row ${Qe.compatibilityActions}`,children:s.jsx(Mn,{gitActions:e,t})}),s.jsx(Fn,{gitActions:e,t}),s.jsxs("section",{className:"git-status-compatibility-notice",children:[s.jsx("h2",{children:t("gitStatusCompatibilityTitle")}),s.jsx("p",{children:t("gitStatusCompatibilityDescription")})]})]})}function Wu({status:e,projectId:t,isWideScreen:n,supportsProjections:o,supportsInclusiveToHead:i,supportsWorkingTreeFiles:r,supportsWorkingTreeSections:u,supportsCompleteFilesystemScan:l,untrackedFiles:c,untrackedLoading:m,untrackedError:d,inventoryPending:_,inventoryLoading:y,inventoryError:v,supportsLastEditor:p,gitActions:k,reviewComments:E,reviewsEnabled:g,showReviewModal:x,onOpenReview:N,onCloseReview:C,t:S}){const w=ws(),b=es(),z=ss(),[M,R]=ts(),{tab:L}=ks(g),O=M.get("bf")??void 0,I=M.get("rev")??void 0,ee=M.get("commitFile")??void 0,P=M.get("blame")==="1",V=M.get("worktreeFile")??void 0,{sourceControlCleanLanding:j}=Eo(),F=L==="changes"&&(M.get("history")==="1"||M.get("tab")==="commits"||I===void 0&&e.isClean&&V===void 0&&j==="latest-commit"),[G,se]=a.useState(!1),[ne,Q]=a.useState(!1),[J,H]=a.useState(null),f=aa("(max-width: 600px)"),B=o&&G;a.useEffect(()=>{o||se(!1)},[o]);const U=a.useCallback(()=>{se(!1),H(null),Q(!0)},[]),T=a.useCallback(ie=>{const ue=ie instanceof Error&&ie.message?ie.message:S("gitStatusLoadDiffFailed");se(!1),Q(!1),H(S("sourceProjectionRequestError",{error:ue}))},[S]),$=a.useCallback(()=>{if(!G&&!o){H(null),Q(!0);return}se(!G)},[G,o]),X=ne?s.jsxs("div",{className:"source-projection-notice",role:"status",children:[s.jsx("span",{children:S("sourceProjectionUpgradeNotice")}),s.jsx("button",{type:"button",className:"source-projection-notice-dismiss","aria-label":S("sourceDismissProjectionNotice"),onClick:()=>Q(!1),children:"×"})]}):J?s.jsxs("div",{className:"source-projection-notice",role:"alert",children:[s.jsx("span",{children:J}),s.jsx("button",{type:"button",className:"source-projection-notice-dismiss","aria-label":S("sourceDismissProjectionError"),onClick:()=>H(null),children:"×"})]}):null,Y=a.useCallback(ie=>{R(ue=>{const le=new URLSearchParams(ue);return le.set("tab","files"),le.set("bf",ie),le},{state:b.state})},[b.state,R]),ce=a.useCallback(ie=>{R(ue=>{const le=new URLSearchParams(ue);return le.delete("tab"),le.delete("history"),le.set("rev",ie),le},{state:b.state})},[b.state,R]),K=a.useCallback(ie=>{const ue=new URLSearchParams(M);ue.set("projectId",t);for(const le of Qt)ue.delete(le);return ie&&ue.set("rev",ie),hn(`${z}/git-status?${ue.toString()}`)},[z,t,M]),de=a.useCallback(ie=>{R(ue=>{const le=new URLSearchParams(ue);for(const fe of Qt)le.delete(fe);return F&&le.set("history","1"),ie&&le.set("rev",ie),le},{state:b.state})},[F,b.state,R]),ye=a.useCallback(()=>{R(ie=>{const ue=new URLSearchParams(ie);return ue.delete("tab"),ue.set("history","1"),ue},{state:b.state})},[b.state,R]);return s.jsxs("div",{className:"git-status",children:[s.jsx(Fn,{gitActions:k,t:S}),X&&(f?sn.createPortal(X,document.body):X),L==="changes"&&!F&&!I?s.jsx(En,{projectId:t,status:e,isWideScreen:n,supportsUntrackedCache:r&&!u,untrackedFiles:c,untrackedLoading:m,untrackedError:d,inventoryPending:_,inventoryLoading:y,inventoryError:v,initialWorkingTreePath:V,onBrowseHistory:ye,onBlameFile:Y,captureReviewProjections:g,supportsLastEditor:p,ignoreWhitespace:B,onToggleIgnoreWhitespace:$,onProjectionRequestFailure:T,t:S}):L==="changes"?s.jsx(sc,{projectId:t,status:e,isWideScreen:n,supportsUntrackedCache:r&&!u,untrackedFiles:c,untrackedLoading:m,untrackedError:d,inventoryPending:_,inventoryLoading:y,inventoryError:v,initialSha:I,initialPath:ee,initialBlame:P,showRevisionPane:F,revisionHref:K,onSelectRevision:de,onBrowseHistory:ye,onBlameFile:Y,captureReviewProjections:g,supportsProjections:o,supportsInclusiveToHead:i,supportsLastEditor:p,ignoreWhitespace:B,onToggleIgnoreWhitespace:$,onProjectionUnavailable:U,onProjectionRequestFailure:T,t:S}):L==="comments"?s.jsx(Zc,{projectId:t,pending:E.pending,onOpenFile:Y,onSubmit:N,t:S}):L==="reviews"?s.jsx(Gl,{projectId:t,initialSubmissionId:M.get("submission")??void 0,sessionHref:ie=>`${z}/projects/${t}/sessions/${ie}`,t:S}):L==="files"?s.jsx(Cn,{projectId:t,isWideScreen:n,initialPath:O,status:e,supportsWorkingTreeFiles:r,supportsWorktreeSections:u,supportsCompleteFilesystemScan:l,onOpenCommit:ce,captureReviewProjections:g,t:S}):null,x&&s.jsx(wu,{projectId:t,recentReviewSessionId:E.recentReviewSessionId,submissionsEnabled:g,onClose:C,onNavigateSession:ie=>w(`${z}/projects/${t}/sessions/${ie}`),t:S})]})}function zu(e){return new Set(e.files.map(t=>t.path)).size}function Fn({gitActions:e,t}){const n=e.divergedActionStatus&&e.supportsIntegrationOptions;return!e.actionFeedback&&!n?null:s.jsxs("div",{className:"git-status-action-notices",children:[e.actionFeedback&&e.actionFeedbackTone&&s.jsx("div",{className:`git-status-action-message git-status-action-message-${e.actionFeedbackTone}`,role:e.actionFeedbackTone==="warning"?"alert":"status",children:e.actionFeedback}),n&&s.jsx(Gu,{options:e.integrationOptions,loading:e.isLoadingIntegrationOptions,error:e.integrationOptionsError,t})]})}function Gu({options:e,loading:t,error:n,t:o}){return t?s.jsx("div",{className:"git-integration-options",children:s.jsx("span",{children:o("gitStatusAutoOptionsChecking")})}):n?s.jsx("div",{className:"git-integration-options git-integration-options-warning",children:s.jsx("span",{children:n})}):e?e.status==="available"?s.jsxs("div",{className:"git-integration-options",children:[s.jsx("span",{className:"git-integration-options-label",children:o("gitStatusAutoOptionsLabel")}),s.jsx("span",{className:"git-integration-option-pill","aria-disabled":"true",title:o("gitStatusAutoActionNotEnabled"),children:o("gitStatusAutoRebase")}),s.jsx("span",{className:"git-integration-option-pill","aria-disabled":"true",title:o("gitStatusAutoActionNotEnabled"),children:o("gitStatusAutoMerge")}),s.jsx(en,{t:o})]}):s.jsxs("div",{className:"git-integration-options git-integration-options-warning",children:[s.jsx("span",{children:o("gitStatusAutoOptionsUnavailable",{reason:qu(e.reasons,o)})}),s.jsx(en,{t:o})]}):null}function en({t:e}){return s.jsxs("details",{className:"git-integration-help",children:[s.jsx("summary",{"aria-label":e("gitStatusAutoHelpLabel"),title:e("gitStatusAutoHelpLabel"),children:"?"}),s.jsx("div",{className:"git-integration-help-popover",children:e("gitStatusAutoHelp")})]})}const Ku=["operation-running","sequencer-in-progress","dirty-worktree","missing-upstream","detached-head","not-diverged","not-a-git-repo","status-unavailable"];function qu(e,t){switch(Ku.find(o=>e.includes(o))??"status-unavailable"){case"operation-running":return t("gitStatusAutoReasonOperationRunning");case"sequencer-in-progress":return t("gitStatusAutoReasonSequencer");case"dirty-worktree":return t("gitStatusAutoReasonDirty");case"missing-upstream":return t("gitStatusAutoReasonMissingUpstream");case"detached-head":return t("gitStatusAutoReasonDetached");case"not-diverged":return t("gitStatusAutoReasonNotDiverged");case"not-a-git-repo":return t("gitStatusAutoReasonNotRepo");case"status-unavailable":return t("gitStatusAutoReasonStatusUnavailable");default:return t("gitStatusAutoReasonStatusUnavailable")}}export{jd as GitStatusPage};
|
|
15
|
+
`]},i)})})]})}function Yl(e,t){var o;if(e.resolvedAt)return"resolved";if(((o=e.entries.at(-1))==null?void 0:o.submittedAt)===void 0)return"open";const n=[...e.entries].reverse().find(i=>i.submittedAt);return n&&(e.outcomes.some(i=>i.entryId===n.id)||t==="changed")?"addressed":"open"}function Zs(e,t){return e.name??t("sourceReviewSubmission",{date:Ln(e)})}function Ln(e){const t=new Date(e.submittedAt);return Number.isNaN(t.getTime())?e.submittedAt:t.toLocaleString()}function Xl(e){const t=e.side==="old"?e.oldLine:e.newLine,n=e.side==="old"?" (old)":"";return`${e.path}:${t??"?"}${n}`}function Jl(e){const t=e.side==="old"?e.oldLine:e.newLine;return String(t??"?")}function Ql(e,t){return t(e==="wont_fix"?"sourceReviewOutcomeNoChange":e==="question"?"sourceReviewOutcomeQuestion":"sourceReviewOutcomeDone")}function Zl(e,t){return t(e==="addressed"?"sourceReviewStateAddressed":e==="resolved"?"sourceReviewStateResolved":"sourceReviewStateOpen")}function eu(e){return e==="addressed"?te.addressed:e==="resolved"?te.resolved:te.open}function tu(e,t){return t(e==="changed"?"sourceReviewSourceChanged":e==="unchanged"?"sourceReviewSourceUnchanged":"sourceReviewSourceUnavailable")}function su(e){return e==="changed"?te.changed:e==="unchanged"?te.unchanged:te.unavailable}function nu(e,t){return t(e==="ingested"?"sourceReviewResponseIngested":e==="unchanged"?"sourceReviewResponseUnchanged":e==="invalid"?"sourceReviewResponseInvalid":"sourceReviewResponseMissing")}function ou(e,t){return t(e==="binary"?"sourceReviewCaptureUnavailableBinary":e==="too-large"?"sourceReviewCaptureUnavailableTooLarge":"sourceReviewCaptureUnavailableMissing")}const au="_modal_z7m94_1",iu="_list_z7m94_8",ru="_row_z7m94_19",cu="_stale_z7m94_25",lu="_rowHead_z7m94_30",uu="_location_z7m94_36",du="_staleLabel_z7m94_41",hu="_movedLabel_z7m94_46",mu="_rowText_z7m94_51",fu="_destination_z7m94_56",gu="_field_z7m94_65",pu="_newSession_z7m94_85",xu="_targetError_z7m94_91",vu="_error_z7m94_92",bu="_actions_z7m94_100",_u="_name_z7m94_107",Su="_go_z7m94_112",Ee={modal:au,list:iu,row:ru,stale:cu,rowHead:lu,location:uu,staleLabel:du,movedLabel:hu,rowText:mu,destination:fu,field:gu,newSession:pu,targetError:xu,error:vu,actions:bu,name:_u,go:Su};function wu({projectId:e,recentReviewSessionId:t,submissionsEnabled:n=!1,onClose:o,onNavigateSession:i,t:r}){var H;const[u,l]=a.useState(null),[c,m]=a.useState(new Set),[d,_]=a.useState(t??"new"),y=a.useRef(!1),[v,p]=a.useState(!1),[k,E]=a.useState(null),[g,x]=a.useState(null),[N,C]=a.useState(!1),[S,w]=a.useState(""),b=a.useRef(null);n&&!b.current&&(b.current=crypto.randomUUID());const[z,M]=a.useState(null),[R,L]=a.useState(null),{providers:O,loading:I}=Mo(),ee=a.useMemo(()=>Po(O),[O]),[P,V]=a.useState(""),[j,F]=a.useState(""),G=ee.find(f=>f.name===P),se=u==null?void 0:u.find(f=>c.has(f.comment.id)),ne=un((se==null?void 0:se.comment.text)??"");a.useEffect(()=>{const f=Fo(O);f&&V(B=>B||f.name)},[O]),a.useEffect(()=>{let f=!1;return po(e).then(B=>{var U;f||(M(B),y.current||_(t||(((U=B[0])==null?void 0:U.id)??"new")))}).catch(B=>{f||L(B instanceof Error?B.message:r("sourceReviewSessionsUnavailable"))}),()=>{f=!0}},[e,t,r]),a.useEffect(()=>{let f=!1;return me.previewReview(e).then(B=>{f||(l(B.items),m(new Set(B.items.filter(U=>!U.defaultDiscard).map(U=>U.comment.id))))}).catch(B=>{f||E(B instanceof Error?B.message:"Failed to preview")}),()=>{f=!0}},[e]);const Q=a.useCallback(f=>{m(B=>{const U=new Set(B);return U.has(f)?U.delete(f):U.add(f),U})},[]),J=a.useCallback(async()=>{const f=[...c];if(f.length!==0){p(!0),E(null);try{const B=d==="new"?{provider:P||void 0,model:j||void 0}:void 0,U=n&&b.current?await me.submitReview(e,f,d,B,{id:b.current,name:S.trim()||void 0}):await me.submitReview(e,f,d,B);if($t(e),U.sessionId){i(U.sessionId),o();return}x(r(n?"sourceReviewSubmissionQueued":"sourceReviewSubmitQueued")),C(!0)}catch(B){E(B instanceof Error?B.message:"Failed to submit")}finally{p(!1)}}},[c,d,P,j,e,i,o,r,n,S]);return s.jsx(wt,{title:r("sourceReviewSubmitTitle"),onClose:o,children:s.jsxs("div",{className:Ee.modal,children:[k&&s.jsx("div",{className:Ee.error,children:k}),g&&s.jsx("div",{role:"status",children:g}),u===null?s.jsx("div",{children:r("loading")}):u.length===0?s.jsx("div",{children:r("sourceReviewNoPending")}):s.jsx("ul",{className:Ee.list,children:u.map(f=>s.jsx(yu,{item:f,checked:c.has(f.comment.id),onToggle:()=>Q(f.comment.id),t:r},f.comment.id))}),u&&u.length>0&&s.jsxs("div",{className:Ee.destination,children:[s.jsxs("label",{className:Ee.field,children:[s.jsx("span",{children:r("sourceReviewTargetLegend")}),s.jsxs("select",{value:d,onChange:f=>{y.current=!0,_(f.target.value)},children:[s.jsx("option",{value:"new",children:r("sourceReviewTargetNew")}),t&&!(z!=null&&z.some(f=>f.id===t))&&s.jsxs("option",{value:t,children:[r("sourceReviewTargetRecent")," ·"," ",t.slice(0,8)]}),z==null?void 0:z.map(f=>s.jsx("option",{value:f.id,children:xo(f,f.id===t?r("sourceReviewRecentSuffix"):void 0)},f.id))]})]}),R&&s.jsxs("div",{className:Ee.targetError,children:[r("sourceReviewSessionsUnavailable"),": ",R]}),d==="new"&&s.jsxs("div",{className:Ee.newSession,children:[s.jsxs("label",{className:Ee.field,children:[s.jsx("span",{children:r("sourceReviewProvider")}),s.jsx("select",{value:P,disabled:I||ee.length===0,onChange:f=>{V(f.target.value),F("")},children:ee.map(f=>s.jsx("option",{value:f.name,children:f.displayName},f.name))})]}),s.jsxs("label",{className:Ee.field,children:[s.jsx("span",{children:r("sourceReviewModel")}),s.jsxs("select",{value:j,disabled:!G,onChange:f=>F(f.target.value),children:[s.jsx("option",{value:"",children:r("sourceReviewModelDefault")}),(H=G==null?void 0:G.models)==null?void 0:H.map(f=>s.jsx("option",{value:f.id,children:f.name},f.id))]})]})]})]}),s.jsxs("div",{className:Ee.actions,children:[n&&s.jsxs("label",{className:`${Ee.field} ${Ee.name}`,children:[s.jsx("span",{children:r("sourceReviewSubmissionName")}),s.jsx("input",{value:S,maxLength:120,placeholder:ne,onChange:f=>w(f.target.value)})]}),s.jsx("button",{type:"button",onClick:o,disabled:v,children:r("cancel")}),s.jsx("button",{type:"button",className:Ee.go,onClick:J,disabled:v||N||c.size===0,children:r("sourceReviewSubmitReview",{count:c.size})})]})]})})}function yu({item:e,checked:t,onToggle:n,t:o}){const i=e.relocation.status==="gone",r=i?e.relocation.citeSha?`${e.relocation.path} @ ${e.relocation.citeSha.slice(0,8)}`:e.relocation.path:`${e.relocation.path}:${e.relocation.line}`;return s.jsxs("li",{className:`${Ee.row} ${i?Ee.stale:""}`,children:[s.jsxs("label",{className:Ee.rowHead,children:[s.jsx("input",{type:"checkbox",checked:t,onChange:n}),s.jsx("span",{className:Ee.location,children:r}),i&&s.jsx("span",{className:Ee.staleLabel,children:o("sourceReviewStale")}),!i&&e.relocation.moved&&s.jsx("span",{className:Ee.movedLabel,children:o("sourceReviewMoved")})]}),s.jsx("div",{className:Ee.rowText,children:e.comment.text})]})}const Cu="_tabs_zkbzy_2",ju="_tab_zkbzy_2",ku="_active_zkbzy_30",Nu="_count_zkbzy_35",Ru="_stacked_zkbzy_47",Tt={tabs:Cu,tab:ju,active:ku,count:Nu,stacked:Ru};function Eu({tab:e,tabs:t,counts:n,fileTabLabelKey:o,onSelect:i,variant:r="header",t:u}){return s.jsx("div",{className:`${Tt.tabs} ${r==="stacked"?Tt.stacked:""}`.trimEnd(),role:"tablist",children:t.map(l=>{const c=n==null?void 0:n[l];return s.jsxs("button",{type:"button",role:"tab","aria-selected":e===l,className:`${Tt.tab} ${e===l?Tt.active:""}`.trimEnd(),onClick:()=>i(l),children:[u(l==="files"&&o?o:Lu(l)),typeof c=="number"&&c>0&&s.jsx("span",{className:Tt.count,children:c})]},l)})})}function Lu(e){switch(e){case"changes":return"sourceTabChanges";case"files":return"sourceTabFiles";case"comments":return"sourceTabComments";case"reviews":return"sourceTabReviews"}}const Tu=300*1e3,Tn=["changes","files","comments"],Mu=[...Tn,"reviews"],Qt=["tab","history","rev","commitFile","blame","worktreeFile","bf","submission"];function Pu(e,t){if(!e)return null;const n=new Map(e.files.flatMap(i=>i.lastEditor?[[i.path,i.lastEditor]]:[])),o=[];for(const i of t)for(const r of i.worktreeChanges??[]){const u=r.lastEditor??n.get(i.path);o.push({path:i.path,...r,...u?{lastEditor:u}:{}})}return{...e,files:o,isClean:o.length===0}}function ks(e=!1){const[t,n]=ts(),o=es(),i=t.get("tab"),r=i==="files"?"files":i==="comments"?"comments":i==="reviews"&&e?"reviews":"changes",u=a.useCallback(l=>{n(c=>{const m=new URLSearchParams(c);return l==="changes"?m.delete("tab"):m.set("tab",l),m.delete("history"),m.delete("rev"),l!=="reviews"&&m.delete("submission"),m},{state:o.state})},[o.state,n]);return{tab:r,setTab:u}}function Fu(e,t,n){var _,y;const o=ss(),i=es(),[r,u]=ts(),l=(y=(_=t==null?void 0:t.recentCommits)==null?void 0:_[0])==null?void 0:y.hash,c=n&&l!==void 0&&e!==void 0,m=a.useMemo(()=>{if(!c)return;const v=new URLSearchParams(r);v.set("projectId",e);for(const p of Qt)v.delete(p);return v.set("rev",l),hn(`${o}/git-status?${v.toString()}`)},[c,o,l,e,r]),d=a.useCallback(()=>{c&&u(v=>{const p=new URLSearchParams(v);for(const k of Qt)p.delete(k);return p.set("rev",l),p},{state:i.state})},[c,l,i.state,u]);return c?{headCommitHref:m,onOpenHeadCommit:d}:{}}function Au({status:e,pendingCount:t,reviewsEnabled:n,supportsWorkingTreeFiles:o,t:i}){const{tab:r,setTab:u}=ks(n),l=zu(e);return s.jsx(Eu,{tab:r,tabs:n?Mu:Tn,variant:"stacked",counts:{changes:l,comments:t},fileTabLabelKey:o?"sourceTabWorkingTree":void 0,onSelect:u,t:i})}function $u({status:e,pendingCount:t,reviewsEnabled:n,supportsWorkingTreeFiles:o,worktreePaused:i,gitActions:r,isWideScreen:u,onToggleWorktreePaused:l,t:c}){const m=a.useRef(null),d=a.useRef(null),[_,y]=a.useState(!1);return a.useLayoutEffect(()=>{if(!u){y(!1);return}const v=m.current,p=d.current,k=v==null?void 0:v.closest(".session-header-inner"),E=k==null?void 0:k.querySelector(".session-header-left"),g=v==null?void 0:v.querySelector("[data-source-action-group]"),x=p==null?void 0:p.querySelector('[role="tablist"]');if(!v||!p||!k||!E||!g||!x)return;const N=()=>{const S=getComputedStyle(k),w=k.clientWidth-it(S.paddingLeft)-it(S.paddingRight),b=it(S.columnGap);if(w<=0){y(!1);return}const z=xs(E)+xs(g)+xs(x)+2*b;y(z<=w+.5)};if(N(),typeof ResizeObserver>"u")return;const C=new ResizeObserver(N);return C.observe(k),C.observe(E),C.observe(g),C.observe(x),()=>C.disconnect()},[u]),s.jsxs(s.Fragment,{children:[s.jsx("div",{ref:m,className:`${Qe.headerControls} ${_?Qe.titleRow:Qe.fallbackRow}`,"data-source-actions-placement":_?"title":"fallback",children:s.jsx(Mn,{gitActions:r,worktreePaused:i,onToggleWorktreePaused:l,t:c})}),s.jsx("div",{ref:d,className:Qe.headerTabs,children:s.jsx(Au,{status:e,pendingCount:t,reviewsEnabled:n,supportsWorkingTreeFiles:o,t:c})})]})}function xs(e){const t=getComputedStyle(e),n=Array.from(e.children).filter(i=>i instanceof HTMLElement&&getComputedStyle(i).display!=="none");return n.reduce((i,r)=>i+Math.max(r.getBoundingClientRect().width,r.scrollWidth),0)+Math.max(0,n.length-1)*it(t.columnGap)+it(t.paddingLeft)+it(t.paddingRight)+it(t.borderLeftWidth)+it(t.borderRightWidth)}function it(e){const t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function Mn({gitActions:e,worktreePaused:t,onToggleWorktreePaused:n,t:o}){const i=ko(),r=o("gitStatusLastCheckedRemote",{time:ea(e.checkedRemoteAt,i,o)});return s.jsxs("div",{className:Qe.actionGroup,"data-source-action-group":!0,children:[e.supportsPull&&s.jsx(vs,{action:"pull",label:o("gitStatusPull"),runningLabel:o("gitStatusPulling"),running:e.isPulling,feedback:e.pullFeedback,tone:e.pullFeedbackTone,onClick:e.handlePull,disabled:e.isRunning}),e.supportsPush&&s.jsx(vs,{action:"push",label:o("gitStatusPush"),runningLabel:o("gitStatusPushing"),running:e.isPushing,feedback:e.pushFeedback,tone:e.pushFeedbackTone,onClick:e.handlePush,disabled:e.isRunning}),e.supportsRemoteCheck&&s.jsx(vs,{action:"check",label:o("gitStatusCheckRemote"),runningLabel:o("gitStatusCheckingRemote"),running:e.isCheckingRemote,feedback:e.checkFeedback,tone:e.checkFeedbackTone,title:e.checkFeedback?`${e.checkFeedback} · ${r}`:r,className:Qe.checkRemote,onClick:e.handleCheckRemote,disabled:e.isRunning}),n&&s.jsxs("button",{type:"button",className:"git-status-action-button","aria-pressed":t,title:o(t?"sourceResumeLiveUpdates":"sourcePauseLiveUpdates"),onClick:n,children:[s.jsx("span",{className:"git-status-action-indicator","aria-hidden":"true",children:s.jsx(Pn,{action:t?"play":"pause"})}),s.jsx("span",{className:Qe.actionLabel,children:o(t?"sourceResumeLiveUpdates":"sourcePauseLiveUpdates")})]})]})}function vs({action:e,label:t,runningLabel:n,running:o,feedback:i,tone:r,title:u,className:l="",onClick:c,disabled:m}){const d=u??i,[_,y]=a.useState(!1);a.useEffect(()=>{if(!r||!i){y(!1);return}y(!0);const p=setTimeout(()=>y(!1),6e3);return()=>clearTimeout(p)},[r,i]);const v=_&&r!==null&&i!=="";return s.jsxs("button",{type:"button",className:`git-status-action-button ${l} ${v?`git-status-action-${r}`:""} ${o?"git-status-action-running":""}`,title:d,"aria-label":o?`${t}: ${n}`:i?`${t}: ${i}`:t,onClick:c,disabled:m,children:[s.jsx("span",{className:"git-status-action-indicator","aria-hidden":"true",children:o?null:v?r==="success"?"✓":"!":s.jsx(Pn,{action:e})}),s.jsx("span",{className:Qe.actionLabel,children:t})]})}function Pn({action:e}){if(e==="pause")return s.jsxs("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"currentColor",children:[s.jsx("rect",{x:"4",y:"3",width:"2.75",height:"10",rx:"0.6"}),s.jsx("rect",{x:"9.25",y:"3",width:"2.75",height:"10",rx:"0.6"})]});if(e==="play")return s.jsx("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"currentColor",children:s.jsx("path",{d:"M5 3.15 13 8 5 12.85Z"})});if(e==="check")return s.jsx("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M13 5V2.5L11.4 4A5.5 5.5 0 1 0 13.1 10"})});const t=e==="pull";return s.jsx("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:t?"M8 2v10M4.5 8.5 8 12l3.5-3.5":"M8 14V4M4.5 7.5 8 4l3.5 3.5"})})}function Du(e,t){return{sourceKey:e,routeId:"git-status",projectId:t,queryParams:{projectId:t}}}function Bu(e,t){So(e,n=>t(n??{}),{ttlMs:Tu})}function Ou(e){return wo(e,{touch:!1,recordDiagnostics:!1})}function Iu(e){return a.useSyncExternalStore(_o,()=>e?Ou(e):null,()=>null)}function Nd(){const{t:e}=tn(),t=es(),[n,o]=ts(),i=n.get("projectId"),r=dn(),{openSidebar:u,isWideScreen:l,toggleSidebar:c,isSidebarCollapsed:m}=oo(),d=a.useRef(null),[_,y]=a.useState(!1),v=Qo(),p=_||!v,{projects:k,loading:E}=an(),g=i||jo(k)||void 0,{project:x}=ao(g),{version:N,loading:C,error:S}=ro(),{settings:w}=Ro(),b=Be(N,Kn)&&((w==null?void 0:w.sourceReviewSubmissionsEnabled)??!1),{setTab:z}=ks(b),M=Be(N,Vn),R=Be(N,Wn),L=Be(N,Xn),O=Be(N,zn),I=Be(N,Qn),ee=Be(N,Jn),P=Be(N,Gn),j=Be(N,Hn)&&Be(N,Un),F=j&&Be(N,Yn),G=Be(N,qn),se=Be(N,Zn),ne=Be(N,eo),Q=Be(N,to),J=Be(N,so),{gitStatus:H,untrackedFiles:f,untrackedLoading:B,untrackedError:U,loading:T,error:$,refetch:X}=vo(M?g:void 0,{omitUntracked:j,useUntrackedCache:P&&!j}),Y=!!(g&&j&&(H!=null&&H.isGitRepo)),ce=gn(g??"",{tracked:!0,untracked:!0,ignored:!1},Y,p),K=a.useMemo(()=>j&&ce.generation?Pu(H,ce.files):H,[ce.files,ce.generation,H,j]),de=j?null:f,ye=Y&&ce.generation===null,ie=T,ue=$,le=ns(O?g:void 0),fe=Fu(g,K,O),{defaultSession:Ne}=a.useMemo(()=>To(t.state),[t.state]),Pe=(Ne==null?void 0:Ne.projectId)===g?Ne??null:null,[Ae,Oe]=a.useState(!1),_e=a.useMemo(()=>g?Du(r,g):null,[g,r]),ke=Iu(_e),ze=Zo({projectId:g,status:K,routeRetentionKey:_e,supportsRemoteCheck:se,supportsPull:ne,supportsPush:Q,supportsIntegrationOptions:J,onRefreshStatus:X,t:e});yo(x==null?void 0:x.name,R?x==null?void 0:x.codeName:void 0,e("gitStatusTitle")),a.useLayoutEffect(()=>{K==null||K.files.length;const ge=ke==null?void 0:ke.pageScrollTop;typeof ge!="number"||!d.current||(d.current.scrollTop=ge)},[K==null?void 0:K.files.length,ke==null?void 0:ke.pageScrollTop]),a.useLayoutEffect(()=>()=>{!_e||!d.current||Bu(_e,ge=>{var Re;return{...ge,pageScrollTop:((Re=d.current)==null?void 0:Re.scrollTop)??0}})},[_e]),a.useEffect(()=>{g&&x&&Ms(g)},[g,x]);const Me=ge=>{Ms(ge),o({projectId:ge},{replace:!0,state:null})};return!g&&!E&&k.length===0?s.jsx("div",{className:"error",children:e("gitStatusNoProjects")}):s.jsxs(Lo,{isWideScreen:l,innerClassName:`source-control-main-content ${Qe.sourceHeader}`,children:[s.jsx(no,{title:(x==null?void 0:x.name)??e("gitStatusTitle"),titleElement:g?s.jsxs("div",{className:"source-header-identity",children:[s.jsx(Yo,{currentProjectId:g,currentProjectName:x==null?void 0:x.name,onProjectChange:ge=>Me(ge.id)}),(K==null?void 0:K.isGitRepo)&&s.jsx($c,{status:K,projectId:g,supportsIncomingCommits:G,className:"source-header-repo-status",onSelectChanges:O?()=>z("changes"):void 0,...fe,t:e})]}):void 0,onOpenSidebar:u,onToggleSidebar:c,isWideScreen:l,isSidebarCollapsed:m,actions:O&&g&&(K!=null&&K.isGitRepo)?s.jsx($u,{status:K,pendingCount:le.pending.length,reviewsEnabled:b,supportsWorkingTreeFiles:P,gitActions:ze,isWideScreen:l,worktreePaused:_,onToggleWorktreePaused:j?()=>y(ge=>!ge):void 0,t:e}):void 0}),s.jsx("main",{className:"page-scroll-container",ref:d,children:s.jsx("div",{className:"page-content-inner",children:C||E?s.jsx("div",{className:"loading",children:e("gitStatusLoading")}):S?s.jsxs("div",{className:"error",children:[e("gitStatusErrorPrefix")," ",S.message]}):M?ie?s.jsx("div",{className:"loading",children:e("gitStatusLoading")}):ue?s.jsxs("div",{className:"error",children:[e("gitStatusErrorPrefix")," ",ue.message]}):K&&!K.isGitRepo&&g&&j?s.jsx(Es,{projectId:g,children:s.jsx(_s.Provider,{value:p,children:s.jsx("div",{className:"git-status",children:s.jsx(Cn,{projectId:g,isWideScreen:l,status:K,supportsWorkingTreeFiles:P,supportsWorktreeSections:!0,supportsCompleteFilesystemScan:F,t:e})})})}):K&&!K.isGitRepo?s.jsx("div",{className:"git-status-empty",children:e("gitStatusNotRepo")}):K&&g&&O?s.jsx(Es,{projectId:g,children:s.jsx(_s.Provider,{value:p,children:s.jsx(bo.Provider,{value:Pe,children:s.jsx(Wu,{status:K,projectId:g,isWideScreen:l,supportsProjections:I,supportsInclusiveToHead:ee,supportsWorkingTreeFiles:P,supportsWorkingTreeSections:j,supportsCompleteFilesystemScan:F,untrackedFiles:de,untrackedLoading:B,untrackedError:U,inventoryPending:ye,inventoryLoading:ye&&ce.loading,inventoryError:ye?ce.error:null,supportsLastEditor:L,gitActions:ze,reviewComments:le,reviewsEnabled:b,showReviewModal:Ae,onOpenReview:()=>Oe(!0),onCloseReview:()=>Oe(!1),t:e},`${r}:${g}`)})})}):K&&g?s.jsx(Uu,{gitActions:ze,t:e},`${r}:${g}:compatibility`):null:s.jsx(Hu,{t:e})})})]})}function Hu({t:e}){return s.jsxs("div",{className:"git-status-upgrade",children:[s.jsx("h2",{children:e("gitStatusUpgradeRequiredTitle")}),s.jsx("p",{children:e("gitStatusUpgradeRequiredDescription")})]})}function Uu({gitActions:e,t}){return s.jsxs("div",{className:"git-status git-status-compatibility",children:[s.jsx("div",{className:`source-control-action-row ${Qe.compatibilityActions}`,children:s.jsx(Mn,{gitActions:e,t})}),s.jsx(Fn,{gitActions:e,t}),s.jsxs("section",{className:"git-status-compatibility-notice",children:[s.jsx("h2",{children:t("gitStatusCompatibilityTitle")}),s.jsx("p",{children:t("gitStatusCompatibilityDescription")})]})]})}function Wu({status:e,projectId:t,isWideScreen:n,supportsProjections:o,supportsInclusiveToHead:i,supportsWorkingTreeFiles:r,supportsWorkingTreeSections:u,supportsCompleteFilesystemScan:l,untrackedFiles:c,untrackedLoading:m,untrackedError:d,inventoryPending:_,inventoryLoading:y,inventoryError:v,supportsLastEditor:p,gitActions:k,reviewComments:E,reviewsEnabled:g,showReviewModal:x,onOpenReview:N,onCloseReview:C,t:S}){const w=ws(),b=es(),z=ss(),[M,R]=ts(),{tab:L}=ks(g),O=M.get("bf")??void 0,I=M.get("rev")??void 0,ee=M.get("commitFile")??void 0,P=M.get("blame")==="1",V=M.get("worktreeFile")??void 0,{sourceControlCleanLanding:j}=Eo(),F=L==="changes"&&(M.get("history")==="1"||M.get("tab")==="commits"||I===void 0&&e.isClean&&V===void 0&&j==="latest-commit"),[G,se]=a.useState(!1),[ne,Q]=a.useState(!1),[J,H]=a.useState(null),f=aa("(max-width: 600px)"),B=o&&G;a.useEffect(()=>{o||se(!1)},[o]);const U=a.useCallback(()=>{se(!1),H(null),Q(!0)},[]),T=a.useCallback(ie=>{const ue=ie instanceof Error&&ie.message?ie.message:S("gitStatusLoadDiffFailed");se(!1),Q(!1),H(S("sourceProjectionRequestError",{error:ue}))},[S]),$=a.useCallback(()=>{if(!G&&!o){H(null),Q(!0);return}se(!G)},[G,o]),X=ne?s.jsxs("div",{className:"source-projection-notice",role:"status",children:[s.jsx("span",{children:S("sourceProjectionUpgradeNotice")}),s.jsx("button",{type:"button",className:"source-projection-notice-dismiss","aria-label":S("sourceDismissProjectionNotice"),onClick:()=>Q(!1),children:"×"})]}):J?s.jsxs("div",{className:"source-projection-notice",role:"alert",children:[s.jsx("span",{children:J}),s.jsx("button",{type:"button",className:"source-projection-notice-dismiss","aria-label":S("sourceDismissProjectionError"),onClick:()=>H(null),children:"×"})]}):null,Y=a.useCallback(ie=>{R(ue=>{const le=new URLSearchParams(ue);return le.set("tab","files"),le.set("bf",ie),le},{state:b.state})},[b.state,R]),ce=a.useCallback(ie=>{R(ue=>{const le=new URLSearchParams(ue);return le.delete("tab"),le.delete("history"),le.set("rev",ie),le},{state:b.state})},[b.state,R]),K=a.useCallback(ie=>{const ue=new URLSearchParams(M);ue.set("projectId",t);for(const le of Qt)ue.delete(le);return ie&&ue.set("rev",ie),hn(`${z}/git-status?${ue.toString()}`)},[z,t,M]),de=a.useCallback(ie=>{R(ue=>{const le=new URLSearchParams(ue);for(const fe of Qt)le.delete(fe);return F&&le.set("history","1"),ie&&le.set("rev",ie),le},{state:b.state})},[F,b.state,R]),ye=a.useCallback(()=>{R(ie=>{const ue=new URLSearchParams(ie);return ue.delete("tab"),ue.set("history","1"),ue},{state:b.state})},[b.state,R]);return s.jsxs("div",{className:"git-status",children:[s.jsx(Fn,{gitActions:k,t:S}),X&&(f?sn.createPortal(X,document.body):X),L==="changes"&&!F&&!I?s.jsx(En,{projectId:t,status:e,isWideScreen:n,supportsUntrackedCache:r&&!u,untrackedFiles:c,untrackedLoading:m,untrackedError:d,inventoryPending:_,inventoryLoading:y,inventoryError:v,initialWorkingTreePath:V,onBrowseHistory:ye,onBlameFile:Y,captureReviewProjections:g,supportsLastEditor:p,ignoreWhitespace:B,onToggleIgnoreWhitespace:$,onProjectionRequestFailure:T,t:S}):L==="changes"?s.jsx(sc,{projectId:t,status:e,isWideScreen:n,supportsUntrackedCache:r&&!u,untrackedFiles:c,untrackedLoading:m,untrackedError:d,inventoryPending:_,inventoryLoading:y,inventoryError:v,initialSha:I,initialPath:ee,initialBlame:P,showRevisionPane:F,revisionHref:K,onSelectRevision:de,onBrowseHistory:ye,onBlameFile:Y,captureReviewProjections:g,supportsProjections:o,supportsInclusiveToHead:i,supportsLastEditor:p,ignoreWhitespace:B,onToggleIgnoreWhitespace:$,onProjectionUnavailable:U,onProjectionRequestFailure:T,t:S}):L==="comments"?s.jsx(Zc,{projectId:t,pending:E.pending,onOpenFile:Y,onSubmit:N,t:S}):L==="reviews"?s.jsx(Gl,{projectId:t,initialSubmissionId:M.get("submission")??void 0,sessionHref:ie=>`${z}/projects/${t}/sessions/${ie}`,t:S}):L==="files"?s.jsx(Cn,{projectId:t,isWideScreen:n,initialPath:O,status:e,supportsWorkingTreeFiles:r,supportsWorktreeSections:u,supportsCompleteFilesystemScan:l,onOpenCommit:ce,captureReviewProjections:g,t:S}):null,x&&s.jsx(wu,{projectId:t,recentReviewSessionId:E.recentReviewSessionId,submissionsEnabled:g,onClose:C,onNavigateSession:ie=>w(`${z}/projects/${t}/sessions/${ie}`),t:S})]})}function zu(e){return new Set(e.files.map(t=>t.path)).size}function Fn({gitActions:e,t}){const n=e.divergedActionStatus&&e.supportsIntegrationOptions;return!e.actionFeedback&&!n?null:s.jsxs("div",{className:"git-status-action-notices",children:[e.actionFeedback&&e.actionFeedbackTone&&s.jsx("div",{className:`git-status-action-message git-status-action-message-${e.actionFeedbackTone}`,role:e.actionFeedbackTone==="warning"?"alert":"status",children:e.actionFeedback}),n&&s.jsx(Gu,{options:e.integrationOptions,loading:e.isLoadingIntegrationOptions,error:e.integrationOptionsError,t})]})}function Gu({options:e,loading:t,error:n,t:o}){return t?s.jsx("div",{className:"git-integration-options",children:s.jsx("span",{children:o("gitStatusAutoOptionsChecking")})}):n?s.jsx("div",{className:"git-integration-options git-integration-options-warning",children:s.jsx("span",{children:n})}):e?e.status==="available"?s.jsxs("div",{className:"git-integration-options",children:[s.jsx("span",{className:"git-integration-options-label",children:o("gitStatusAutoOptionsLabel")}),s.jsx("span",{className:"git-integration-option-pill","aria-disabled":"true",title:o("gitStatusAutoActionNotEnabled"),children:o("gitStatusAutoRebase")}),s.jsx("span",{className:"git-integration-option-pill","aria-disabled":"true",title:o("gitStatusAutoActionNotEnabled"),children:o("gitStatusAutoMerge")}),s.jsx(en,{t:o})]}):s.jsxs("div",{className:"git-integration-options git-integration-options-warning",children:[s.jsx("span",{children:o("gitStatusAutoOptionsUnavailable",{reason:qu(e.reasons,o)})}),s.jsx(en,{t:o})]}):null}function en({t:e}){return s.jsxs("details",{className:"git-integration-help",children:[s.jsx("summary",{"aria-label":e("gitStatusAutoHelpLabel"),title:e("gitStatusAutoHelpLabel"),children:"?"}),s.jsx("div",{className:"git-integration-help-popover",children:e("gitStatusAutoHelp")})]})}const Ku=["operation-running","sequencer-in-progress","dirty-worktree","missing-upstream","detached-head","not-diverged","not-a-git-repo","status-unavailable"];function qu(e,t){switch(Ku.find(o=>e.includes(o))??"status-unavailable"){case"operation-running":return t("gitStatusAutoReasonOperationRunning");case"sequencer-in-progress":return t("gitStatusAutoReasonSequencer");case"dirty-worktree":return t("gitStatusAutoReasonDirty");case"missing-upstream":return t("gitStatusAutoReasonMissingUpstream");case"detached-head":return t("gitStatusAutoReasonDetached");case"not-diverged":return t("gitStatusAutoReasonNotDiverged");case"not-a-git-repo":return t("gitStatusAutoReasonNotRepo");case"status-unavailable":return t("gitStatusAutoReasonStatusUnavailable");default:return t("gitStatusAutoReasonStatusUnavailable")}}export{Nd as GitStatusPage};
|