yepanywhere 0.10.2 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/@yep-anywhere/shared/dist/capability-ids.d.ts +6 -0
- package/bundled/@yep-anywhere/shared/dist/capability-ids.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/capability-ids.js +6 -0
- package/bundled/@yep-anywhere/shared/dist/capability-ids.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/index.d.ts +4 -4
- package/bundled/@yep-anywhere/shared/dist/index.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/index.js +3 -3
- package/bundled/@yep-anywhere/shared/dist/index.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/issues.d.ts +16 -0
- package/bundled/@yep-anywhere/shared/dist/issues.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/issues.js +27 -0
- package/bundled/@yep-anywhere/shared/dist/issues.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/project-service.d.ts +12 -0
- package/bundled/@yep-anywhere/shared/dist/project-service.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/project-service.js +56 -0
- package/bundled/@yep-anywhere/shared/dist/project-service.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts +50 -50
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.js +48 -50
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/types.d.ts +6 -0
- package/bundled/@yep-anywhere/shared/dist/types.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/types.js +5 -0
- package/bundled/@yep-anywhere/shared/dist/types.js.map +1 -1
- package/bundled/@yep-anywhere/shared/package.json +1 -1
- package/client-dist/assets/{AboutSettings-DnDy6BEd.js → AboutSettings-Ck7P-jDQ.js} +1 -1
- package/client-dist/assets/{ActivityPage-MFWjNC-D.js → ActivityPage-lGdcdJ-e.js} +1 -1
- package/client-dist/assets/{AgentContextSettings-D8g4_T92.js → AgentContextSettings-UprX6zdD.js} +1 -1
- package/client-dist/assets/{AgentsPage-CXHC9oBL.js → AgentsPage-BNPVqFjZ.js} +1 -1
- package/client-dist/assets/App-3o8SyXXM.js +2 -0
- package/client-dist/assets/AppearanceSettings-DMW7A_Rf.js +2 -0
- package/client-dist/assets/{AppsSettings-BPk1YKiU.js → AppsSettings-D9Fdhvnq.js} +1 -1
- package/client-dist/assets/{AttachmentChip-BRmKgPA9.js → AttachmentChip-qYXy0CtC.js} +1 -1
- package/client-dist/assets/{AuthContext-BPHX3zIQ.js → AuthContext-IbT77aGw.js} +1 -1
- package/client-dist/assets/{BangCommandDisplayObject-DpwVa9Ll.js → BangCommandDisplayObject-BOag7vGT.js} +1 -1
- package/client-dist/assets/{BangCommandsPage-B8zpyOBf.js → BangCommandsPage--PeiFzRy.js} +1 -1
- package/client-dist/assets/{BlameBrowser-BLuAT9qK.js → BlameBrowser-DrfV_lH3.js} +1 -1
- package/client-dist/assets/{BrowserDebugToolbarButton-BXfPrxyA.js → BrowserDebugToolbarButton-DhIc8BpN.js} +1 -1
- package/client-dist/assets/{BrowserExtensionSettings-CZ0s6ASb.js → BrowserExtensionSettings-DAMeZFOL.js} +1 -1
- package/client-dist/assets/{CacheMissBillingSettings-ue0Jahu3.js → CacheMissBillingSettings-BW6Nf5ut.js} +1 -1
- package/client-dist/assets/{CodexUpdatePrompt-DXdrlvWV.js → CodexUpdatePrompt-H0-B1yB-.js} +1 -1
- package/client-dist/assets/{CommittedRangeInput-CLkpNnP_.js → CommittedRangeInput-C6In6Q8s.js} +1 -1
- package/client-dist/assets/{CommittedRangeNumberInput-Co1Mkg_Y.js → CommittedRangeNumberInput-DF-kPNGu.js} +1 -1
- package/client-dist/assets/{ConversationPreviewPage-B4Ph-QV7.js → ConversationPreviewPage-CTu-ffV7.js} +1 -1
- package/client-dist/assets/{CopyTextButton-Bpeo8K_-.js → CopyTextButton-oYhSruA8.js} +1 -1
- package/client-dist/assets/{DevelopmentSettings-B3XBUEkp.js → DevelopmentSettings-DGtUr0Qz.js} +1 -1
- package/client-dist/assets/{DevicesSettings-D_iWcxbb.js → DevicesSettings-XMDAT-N4.js} +1 -1
- package/client-dist/assets/{EmulatorPage-B1cu6Lq_.js → EmulatorPage-De0YMKUL.js} +1 -1
- package/client-dist/assets/{EmulatorSettings-nvQEL90Z.js → EmulatorSettings-C5TOwBvn.js} +1 -1
- package/client-dist/assets/{EnvironmentSettings-Ba6izhQj.js → EnvironmentSettings-B1gePTdK.js} +1 -1
- package/client-dist/assets/{FilePage-9Ss6nJ-y.js → FilePage-zx4PfIbF.js} +1 -1
- package/client-dist/assets/FileViewer-D8IcGVo-.js +63 -0
- package/client-dist/assets/{FilterDropdown-D-CDFjqG.js → FilterDropdown-BJ5npFAA.js} +1 -1
- package/client-dist/assets/FloatingActionButton-Dm0404b2.js +1 -0
- package/client-dist/assets/{GitStatusPage-CH31Bai2.js → GitStatusPage-D-4o8YmB.js} +6 -6
- package/client-dist/assets/{GlobalSessionsPage-CgxvBzzy.js → GlobalSessionsPage-DD6UMomT.js} +2 -2
- package/client-dist/assets/{GlossaryContext-PMCo1K6f.js → GlossaryContext-BA5X62Ck.js} +1 -1
- package/client-dist/assets/{HeartbeatTextArea-bCQAiAc-.js → HeartbeatTextArea-ywZAleeh.js} +1 -1
- package/client-dist/assets/{HostIdentityContext-B3FgYv0w.js → HostIdentityContext-_GKYzEQ6.js} +1 -1
- package/client-dist/assets/{HostsPage-BG_bgfeL.js → HostsPage-OGegHtTp.js} +1 -1
- package/client-dist/assets/{InboxContext-BnIIp9cf.js → InboxContext-CZTibzZl.js} +1 -1
- package/client-dist/assets/{InboxPage-D1M26n9s.js → InboxPage-DuvRGWdd.js} +1 -1
- package/client-dist/assets/IssueSettings-BE0SFhgx.js +1 -0
- package/client-dist/assets/IssueSettings-CPOZbMa8.css +1 -0
- package/client-dist/assets/IssuesPage-CA4k5N50.css +1 -0
- package/client-dist/assets/IssuesPage-CWd-GCCG.js +1 -0
- package/client-dist/assets/{LifecycleWebhooksSettings-CaNL4aDT.js → LifecycleWebhooksSettings-bzUj5dsE.js} +1 -1
- package/client-dist/assets/{LocalAccessSettings-7EI7L-wA.js → LocalAccessSettings-DSezlzqb.js} +1 -1
- package/client-dist/assets/LocalMediaModal-DMrKaM1a.js +14 -0
- package/client-dist/assets/LocalSourcePage-Cttx4S9P.js +1 -0
- package/client-dist/assets/{LoginPage-C4023DZw.js → LoginPage-DVf285Ok.js} +1 -1
- package/client-dist/assets/{MarkdownPreview-ClsW_S6S.js → MarkdownPreview-TXbYZwdp.js} +2 -2
- package/client-dist/assets/{MessageAge-B2tHxpYx.js → MessageAge-7FVIZWEv.js} +1 -1
- package/client-dist/assets/MessageDeliverySettings-iykyxRVS.js +4 -0
- package/client-dist/assets/MessageInput-D1epbc4v.js +7 -0
- package/client-dist/assets/{MessageInputToolbar-C79z9qW6.js → MessageInputToolbar-CgXvBkeG.js} +8 -8
- package/client-dist/assets/MessageList-Ce3MvdtI.js +4 -0
- package/client-dist/assets/{MicrophoneIcon-BLs10fC3.js → MicrophoneIcon-Dhu4NCe6.js} +1 -1
- package/client-dist/assets/{Modal-iT2_XPlO.js → Modal-CHNqXAgW.js} +9 -9
- package/client-dist/assets/{ModelSettings-B4fCDCIJ.js → ModelSettings-DBQKdWCg.js} +1 -1
- package/client-dist/assets/{NavigationLayout-BpvrdPoS.js → NavigationLayout-UkQvkodY.js} +1 -1
- package/client-dist/assets/NewSessionForm-Ds5dM9lx.js +9 -0
- package/client-dist/assets/NewSessionPage-BERKMRdN.js +2 -0
- package/client-dist/assets/{NotificationsSettings-I2SS2U9N.js → NotificationsSettings-1RBQorDi.js} +1 -1
- package/client-dist/assets/{PageHeader-Dbb8BZq2.js → PageHeader-DYCnk788.js} +1 -1
- package/client-dist/assets/{PerformanceSettings-Ci8oh2Js.js → PerformanceSettings-CGz5ct-T.js} +1 -1
- package/client-dist/assets/ProjectAppPage-EfNtdwLY.js +1 -0
- package/client-dist/assets/ProjectAppViewer-CRnJGIt-.css +1 -0
- package/client-dist/assets/ProjectAppViewer-slr3FXj4.js +1 -0
- package/client-dist/assets/{ProjectSessionDefaultsModal-D33bQF-Q.js → ProjectSessionDefaultsModal-5yjuvV8S.js} +1 -1
- package/client-dist/assets/{ProjectTemplatesSettings-D8Sr5dDj.js → ProjectTemplatesSettings-DWZfH0JJ.js} +1 -1
- package/client-dist/assets/{ProjectsPage-CIHRcMpx.js → ProjectsPage-BJV93FM-.js} +1 -1
- package/client-dist/assets/{ProviderBadge-DmhZSMRX.js → ProviderBadge-C-UpobLD.js} +1 -1
- package/client-dist/assets/{ProviderChildSessionDetail-D3xbfVZT.js → ProviderChildSessionDetail-CmyTKIwt.js} +3 -3
- package/client-dist/assets/ProviderChildSessionPage-Clp1hlBo.js +1 -0
- package/client-dist/assets/{ProviderSignIn-DRgPyX8J.js → ProviderSignIn-d13WuHAR.js} +1 -1
- package/client-dist/assets/{ProviderSignInPage-ByQPPIRT.js → ProviderSignInPage-CkeyyeWl.js} +1 -1
- package/client-dist/assets/{ProvidersSettings-nHJSxVfC.js → ProvidersSettings-Ddj2J4N2.js} +1 -1
- package/client-dist/assets/{RecapAfterSecondsControl-BsBxbSpd.js → RecapAfterSecondsControl-D_AiWfq1.js} +1 -1
- package/client-dist/assets/{RemoteAccessSettings-Cq_gn76d.js → RemoteAccessSettings-CaE3iqqj.js} +1 -1
- package/client-dist/assets/{RemoteExecutorsSettings-CTRjrID3.js → RemoteExecutorsSettings-snCnHbRp.js} +1 -1
- package/client-dist/assets/{RenderModeContext-CZwSZkSZ.js → RenderModeContext-CuIMXqQV.js} +1 -1
- package/client-dist/assets/{RenderModeGlyph-dL8kAPff.js → RenderModeGlyph-ldDSjj9f.js} +1 -1
- package/client-dist/assets/{RouterPoolSelector-Pmu8xrjx.js → RouterPoolSelector-H3X29mOM.js} +2 -2
- package/client-dist/assets/{SchemaValidationContext-DqOi1YmB.js → SchemaValidationContext-CPr8V317.js} +1 -1
- package/client-dist/assets/{SearchPreview-DIbIaW_4.js → SearchPreview-DvMlCBIp.js} +1 -1
- package/client-dist/assets/{SecureConnection-DwcGBdlV.js → SecureConnection-DeVWJw06.js} +2 -2
- package/client-dist/assets/{SessionHeader.module-Co1boPaC.js → SessionHeader.module-DfkDdP3M.js} +1 -1
- package/client-dist/assets/{SessionMetadataContext-Bfs4TAAj.js → SessionMetadataContext-D0F_4Wp0.js} +1 -1
- package/client-dist/assets/SessionPage-xeog2S54.js +50 -0
- package/client-dist/assets/{SettingsItem-C7eQXUQf.js → SettingsItem-BgyAjvy6.js} +1 -1
- package/client-dist/assets/{SourceControlSettings-D58qSFZm.js → SourceControlSettings-B9T3f2Et.js} +1 -1
- package/client-dist/assets/{SourceFileHeaderActions-DNRytjPK.js → SourceFileHeaderActions-ByzC_I1c.js} +1 -1
- package/client-dist/assets/{SpeechControlMenu-BA2W-shI.js → SpeechControlMenu-Dhkd9fo9.js} +1 -1
- package/client-dist/assets/SpeechSettings-DEZsiCyG.js +2 -0
- package/client-dist/assets/{SpeechSmartTurnControls-DgT6bhA4.js → SpeechSmartTurnControls-BdmFc3C9.js} +1 -1
- package/client-dist/assets/{StorageSettings-DsvbVixL.js → StorageSettings-CiuHgnzi.js} +1 -1
- package/client-dist/assets/{ThinkingControls-Bi0PcWyP.js → ThinkingControls-Bf_4_n66.js} +1 -1
- package/client-dist/assets/ToolbarSettings-DupwvB70.js +1 -0
- package/client-dist/assets/{TrackerStatusBadge-CYRbIvfC.js → TrackerStatusBadge-nbexFcyV.js} +1 -1
- package/client-dist/assets/{UsersSettings-BjSX_kKq.js → UsersSettings-CrGxlDav.js} +1 -1
- package/client-dist/assets/{ViewerModePage-BlsOYFrz.js → ViewerModePage-DCVHfUMc.js} +1 -1
- package/client-dist/assets/ViewerWindowActions-DV5bxAAy.js +1 -0
- package/client-dist/assets/VoiceInputButton-4SbrfhMk.js +1 -0
- package/client-dist/assets/{WorkstreamsPage-B10INHZx.js → WorkstreamsPage-CUsI5c-n.js} +1 -1
- package/client-dist/assets/YaServerProvider-Dt9IBXDZ.js +31 -0
- package/client-dist/assets/{YepAnywhereLogo-CIpZ5dke.js → YepAnywhereLogo-ccRUdgT-.js} +1 -1
- package/client-dist/assets/{abnfDiagram-VCTEODGH-sCU1nPAM.js → abnfDiagram-VCTEODGH-Dysqh90e.js} +1 -1
- package/client-dist/assets/{arc-DjiGPMMi.js → arc-BfmRVkD-.js} +1 -1
- package/client-dist/assets/{architectureDiagram-5GKGNRK7-3RzD-zEy.js → architectureDiagram-5GKGNRK7-Bp1GI0XP.js} +1 -1
- package/client-dist/assets/{attachmentFileNames-clPM_F1w.js → attachmentFileNames-CGZzPAjE.js} +1 -1
- package/client-dist/assets/{blockDiagram-I7D4REHJ-BU6A9-4i.js → blockDiagram-I7D4REHJ-9vaOU_YP.js} +1 -1
- package/client-dist/assets/{browserTab-BXElY_d5.js → browserTab-CLF9iteD.js} +1 -1
- package/client-dist/assets/{c4Diagram-7LVT6UL2-CxusgaWH.js → c4Diagram-7LVT6UL2-Cj9qrKnL.js} +1 -1
- package/client-dist/assets/channel-Bx4xMN3u.js +1 -0
- package/client-dist/assets/{chunk-2Q5K7J3B-CBi0JNQU.js → chunk-2Q5K7J3B-DD_50QMk.js} +1 -1
- package/client-dist/assets/{chunk-5VM5RSS4-CskSgDiX.js → chunk-5VM5RSS4-Ba0GJEZb.js} +1 -1
- package/client-dist/assets/{chunk-F27PBJKO-Dl65caQS.js → chunk-F27PBJKO-D3_CXW_b.js} +1 -1
- package/client-dist/assets/{chunk-IMKFNOWR-BHAs2B4i.js → chunk-IMKFNOWR-Bx7Jus4R.js} +1 -1
- package/client-dist/assets/{chunk-JWPE2WC7-CRWKI8Z7.js → chunk-JWPE2WC7-1B1j7YcM.js} +1 -1
- package/client-dist/assets/{chunk-POPQ4Y6H-CzdOCWYO.js → chunk-POPQ4Y6H-CgMmmF_H.js} +1 -1
- package/client-dist/assets/{chunk-SVP7TREG-DxoiR2Mk.js → chunk-SVP7TREG-DDSE5Wq6.js} +1 -1
- package/client-dist/assets/{chunk-TICWLB2K-cve5023y.js → chunk-TICWLB2K-DUZGu3ce.js} +1 -1
- package/client-dist/assets/{chunk-XXDRQBXY-mSd5ZgMm.js → chunk-XXDRQBXY-oJdOaI50.js} +1 -1
- package/client-dist/assets/classDiagram-ZZMXUADV-CTAikA-f.js +1 -0
- package/client-dist/assets/classDiagram-v2-VYDZK3BY-CTAikA-f.js +1 -0
- package/client-dist/assets/{clientSummaryStore-Cr4yWo-Y.js → clientSummaryStore-Dsgo1zWK.js} +1 -1
- package/client-dist/assets/{compactSettingsControls-BI6RhVII.js → compactSettingsControls-CgeiII5J.js} +1 -1
- package/client-dist/assets/{cose-bilkent-JH36ORCC-CoI7dvL-.js → cose-bilkent-JH36ORCC-CQKgCYKk.js} +1 -1
- package/client-dist/assets/{cynefin-OW5HDTMX-B6We6WUI.js → cynefin-OW5HDTMX-S85H965d.js} +1 -1
- package/client-dist/assets/{cynefinDiagram-5FMLGOSQ-BUzaWybE.js → cynefinDiagram-5FMLGOSQ-B4ri3nX3.js} +1 -1
- package/client-dist/assets/{dagre-GXQ25YYZ-BYhpPlP3.js → dagre-GXQ25YYZ-DoQhim_k.js} +1 -1
- package/client-dist/assets/{diagram-S7CK7UJ4-FkUIxzy0.js → diagram-S7CK7UJ4-DYy2x0Ta.js} +1 -1
- package/client-dist/assets/{diagram-UQ7AKVKN-B0_3U7US.js → diagram-UQ7AKVKN-DxCcDSWg.js} +1 -1
- package/client-dist/assets/{diagram-VSXAHHWV-DNF_DVVi.js → diagram-VSXAHHWV-tDbIkKUf.js} +1 -1
- package/client-dist/assets/{diagram-VX7I27RA-DgeEEgTw.js → diagram-VX7I27RA-Qdg9iySG.js} +1 -1
- package/client-dist/assets/{diagram-Z3DM3KII-S5soWFl_.js → diagram-Z3DM3KII-BTpWBWAH.js} +1 -1
- package/client-dist/assets/{ebnfDiagram-PWID7BFC-kfLCEtAi.js → ebnfDiagram-PWID7BFC-DBHufTpw.js} +1 -1
- package/client-dist/assets/{erDiagram-RLTQ6QDP-xI7CqDO3.js → erDiagram-RLTQ6QDP-DGkKs4b_.js} +1 -1
- package/client-dist/assets/{flowDiagram-HODETNUW-CVSTa2nO.js → flowDiagram-HODETNUW-DVKc1wL6.js} +1 -1
- package/client-dist/assets/{frontendReload-54GeNGj9.js → frontendReload-B4jfUIeG.js} +1 -1
- package/client-dist/assets/{ganttDiagram-EL5Y4UJY-CI03o3Me.js → ganttDiagram-EL5Y4UJY-lIq_NgbX.js} +1 -1
- package/client-dist/assets/{gitGraphDiagram-WWUBYQGX-BlnPaeW9.js → gitGraphDiagram-WWUBYQGX-BjX5H3_l.js} +1 -1
- package/client-dist/assets/index-BSMD-gHP.js +1 -0
- package/client-dist/assets/index-BhTv6hAY.js +64 -0
- package/client-dist/assets/{index-DrKoeozX.js → index-CdtGIhcy.js} +1 -1
- package/client-dist/assets/{index-1dMuvv06.js → index-DjQ2chjT.js} +1 -1
- package/client-dist/assets/{index-DvjdkG8Q.js → index-DnFlh5Zf.js} +2 -2
- package/client-dist/assets/{infoDiagram-27XIBGKW-C7GxDcfT.js → infoDiagram-27XIBGKW-BRxpTbKN.js} +1 -1
- package/client-dist/assets/{ishikawaDiagram-5VMMS53U-DBZVNUMP.js → ishikawaDiagram-5VMMS53U-BXr5zlby.js} +1 -1
- package/client-dist/assets/{journeyDiagram-3NMN7TZE-CT3nDRx4.js → journeyDiagram-3NMN7TZE-BO5vc5JN.js} +1 -1
- package/client-dist/assets/{kanban-definition-UXKFOSKX-Dgns21Ky.js → kanban-definition-UXKFOSKX-FJ2uF-MR.js} +1 -1
- package/client-dist/assets/{layout-CCGb-lVs.js → layout-BQ-_ERR1.js} +1 -1
- package/client-dist/assets/{limitedUserBrowserDefaults-C6cuD-wF.js → limitedUserBrowserDefaults-CwcMxPe5.js} +1 -1
- package/client-dist/assets/{limitedUserDefaultsClient-BPifr9h5.js → limitedUserDefaultsClient-CLg4zzsz.js} +1 -1
- package/client-dist/assets/{linear-BO4yAkdf.js → linear-BwwPzSrY.js} +1 -1
- package/client-dist/assets/{long-context-effort-warning-By1TxT0F.js → long-context-effort-warning-ims8_Hv4.js} +1 -1
- package/client-dist/assets/main-BX4yZXDF.js +43 -0
- package/client-dist/assets/mermaid.core-D26C4xkK.js +312 -0
- package/client-dist/assets/micTitleActivity-yQ5HgRnF.js +1 -0
- package/client-dist/assets/{mindmap-definition-YA3MSWOX-W-bMySj1.js → mindmap-definition-YA3MSWOX-Bv_gNy8_.js} +1 -1
- package/client-dist/assets/{newSessionPrefill-CHZfBHqQ.js → newSessionPrefill-BC5a8IpP.js} +1 -1
- package/client-dist/assets/{pegDiagram-XKGWAZYB-BMSL3Swk.js → pegDiagram-XKGWAZYB-CBB23R00.js} +1 -1
- package/client-dist/assets/{permissionModes-DJvRe3vP.js → permissionModes-C5_i_UDc.js} +1 -1
- package/client-dist/assets/{pieDiagram-E7YTZNPT-fzcyJjCG.js → pieDiagram-E7YTZNPT-C0uC29fl.js} +1 -1
- package/client-dist/assets/{quadrantDiagram-AXDQQJYC-EQecMBLb.js → quadrantDiagram-AXDQQJYC-BYcINwOa.js} +1 -1
- package/client-dist/assets/{railroadDiagram-O6MQD6OU-DvY2buxp.js → railroadDiagram-O6MQD6OU-DwLq6WlM.js} +1 -1
- package/client-dist/assets/{recentProjectPathLinks-Km2YzBV7.js → recentProjectPathLinks-Bp8ZFFVQ.js} +1 -1
- package/client-dist/assets/{registerServiceWorker-DvFS41on.js → registerServiceWorker-BEwfu1re.js} +1 -1
- package/client-dist/assets/{remoteRoutePaths-Crh_32jX.js → remoteRoutePaths-DpabBbC6.js} +1 -1
- package/client-dist/assets/{requirementDiagram-BXWQKSXE-CIdu0GYt.js → requirementDiagram-BXWQKSXE-H7ltzzju.js} +1 -1
- package/client-dist/assets/{sankeyDiagram-P5KCCOFB-BzupSIep.js → sankeyDiagram-P5KCCOFB-DQ_BH-ec.js} +1 -1
- package/client-dist/assets/{sequenceDiagram-WJ2MYXX4-BCz8DLSg.js → sequenceDiagram-WJ2MYXX4-CE5cJN0V.js} +1 -1
- package/client-dist/assets/{sessionNavigationState-pHYi3UxP.js → sessionNavigationState-nTMUDlwU.js} +1 -1
- package/client-dist/assets/sessionVhostApps-DbEDY32Q.js +1 -0
- package/client-dist/assets/{sessionViewerController-BKTu5sj-.js → sessionViewerController-BGKUu-Zg.js} +1 -1
- package/client-dist/assets/{sessionViewerPlacement-D4lCtx-b.js → sessionViewerPlacement-cjpznhMG.js} +1 -1
- package/client-dist/assets/{sizeCapture-INFHLROL-nGK4qjL2.js → sizeCapture-INFHLROL-DTs5ZL4J.js} +1 -1
- package/client-dist/assets/{sourceControlNavigationState-B1jkV2pd.js → sourceControlNavigationState-D8WJCFc_.js} +1 -1
- package/client-dist/assets/{sourceTransportPaths-COX454wy.js → sourceTransportPaths-BTR7eFi5.js} +1 -1
- package/client-dist/assets/{speechDraftTransaction-cFbNnQHh.js → speechDraftTransaction-Bn7ppW5b.js} +1 -1
- package/client-dist/assets/{stateDiagram-D77RDMKH-CFix9P5-.js → stateDiagram-D77RDMKH-CGP-PcgJ.js} +1 -1
- package/client-dist/assets/stateDiagram-v2-MP3YSRHH-BeSd02wx.js +1 -0
- package/client-dist/assets/{swimlanes-42K2YHIH-3cL-IerY.js → swimlanes-42K2YHIH-BUyuyk1Q.js} +1 -1
- package/client-dist/assets/swimlanesDiagram-VR7AAH4N-DJ-GHCq1.js +8 -0
- package/client-dist/assets/{timeline-definition-24CTP7MA-Cc4302bU.js → timeline-definition-24CTP7MA-CbhEbRKF.js} +1 -1
- package/client-dist/assets/{uiTrace-DGW4HhGn.js → uiTrace-CvAgW12D.js} +1 -1
- package/client-dist/assets/{useAcliCommentarySetting-Br7kBvtE.js → useAcliCommentarySetting-B9uDJlBW.js} +1 -1
- package/client-dist/assets/{useActivityBusState-CzYhbKlD.js → useActivityBusState-CJk1MiYW.js} +1 -1
- package/client-dist/assets/{useAttachmentUploadQuality-B_kWKCMo.js → useAttachmentUploadQuality-Bx88B-aj.js} +1 -1
- package/client-dist/assets/{useBackgroundRevalidation-BpXlX3fs.js → useBackgroundRevalidation-SUxysljm.js} +1 -1
- package/client-dist/assets/{useCodexUpdateStatus-w-5NajaG.js → useCodexUpdateStatus-CihSrx5C.js} +1 -1
- package/client-dist/assets/{useComposerPromptRail-DL5r3CAD.js → useComposerPromptRail-DcRpLRmu.js} +1 -1
- package/client-dist/assets/{useConnectedDevices-BJILFKIz.js → useConnectedDevices-Ciuv3J4o.js} +1 -1
- package/client-dist/assets/useDocumentTitle-wGc9OsUg.js +1 -0
- package/client-dist/assets/{useEmulators-cGrsK5mh.js → useEmulators-CQCzysEZ.js} +1 -1
- package/client-dist/assets/{useFileActivity-Y1m-dClR.js → useFileActivity-CpuLfNl9.js} +1 -1
- package/client-dist/assets/{useFloatingActionButtonEnabled-CgWMCFmO.js → useFloatingActionButtonEnabled-BKJ8RfOu.js} +1 -1
- package/client-dist/assets/{useForkSummaryAutoOpen-qfV9Dgsp.js → useForkSummaryAutoOpen-DRGGsQgo.js} +1 -1
- package/client-dist/assets/useGeneratedTitleLength-R5Q60VSi.js +1 -0
- package/client-dist/assets/{useKeepMobileKeyboardOpenAfterDelivery-DXTp5fUz.js → useKeepMobileKeyboardOpenAfterDelivery-DXMbsQWe.js} +1 -1
- package/client-dist/assets/{useLiveToolOutputEnabled-rQskgO0g.js → useLiveToolOutputEnabled-Qb_QFuzk.js} +1 -1
- package/client-dist/assets/{useModelSettings-DMjdRGMd.js → useModelSettings-BSbgwkL8.js} +1 -1
- package/client-dist/assets/{useNotifyInApp-BBmQnbh7.js → useNotifyInApp-BucZAqVF.js} +1 -1
- package/client-dist/assets/{useOnboarding-CF1WDG2d.js → useOnboarding-BzoWTXrR.js} +1 -1
- package/client-dist/assets/{usePanelSlideAnimations-C5qJWoVe.js → usePanelSlideAnimations-XdQhGgr-.js} +1 -1
- package/client-dist/assets/{useProjectAppComposing-C8gaOUg9.js → useProjectAppComposing-DBPyVUba.js} +1 -1
- package/client-dist/assets/{useProjectTemplateChoices-C0Uxthrq.js → useProjectTemplateChoices-niJIV5HQ.js} +1 -1
- package/client-dist/assets/{useProviders-B7fACEDA.js → useProviders-B54BXYv3.js} +1 -1
- package/client-dist/assets/{useQuestionAsideSetting-CR1M9_u6.js → useQuestionAsideSetting-CILJe25J.js} +1 -1
- package/client-dist/assets/{useRecentSessions-DBXvckSG.js → useRecentSessions-CQJcnOeU.js} +1 -1
- package/client-dist/assets/{useRelativeNow-B7XFLfKm.js → useRelativeNow-C2ME3OxV.js} +1 -1
- package/client-dist/assets/{useReloadNotifications-D2NJM_v_.js → useReloadNotifications-PKjb8H55.js} +1 -1
- package/client-dist/assets/{useRemoteExecutors-j1cpFGnw.js → useRemoteExecutors-CMd01rZ7.js} +1 -1
- package/client-dist/assets/{useSearchConcurrency-DlrPqVlr.js → useSearchConcurrency-BIVnIche.js} +1 -1
- package/client-dist/assets/useSessionRightPaneSetting-C5YgsyBy.js +1 -0
- package/client-dist/assets/{useSidebarWidth-DnB-wKom.js → useSidebarWidth-op0qbgd4.js} +1 -1
- package/client-dist/assets/{useSourceControlCleanLanding-ByQI1cWZ.js → useSourceControlCleanLanding-BE8h6VMD.js} +1 -1
- package/client-dist/assets/{useStableToolPreviewRendering-DtPpSoyX.js → useStableToolPreviewRendering-Bdiaz4I5.js} +1 -1
- package/client-dist/assets/{useTabTitleActivityPreference-DH0VanNM.js → useTabTitleActivityPreference-ZJ19N5_Q.js} +1 -1
- package/client-dist/assets/{useVhostAccess-D6l6YouM.js → useVhostAccess-CttxSyIC.js} +1 -1
- package/client-dist/assets/{useWorkflowTags-5i3ohGrH.js → useWorkflowTags-CsPhaG2p.js} +1 -1
- package/client-dist/assets/{vennDiagram-4TSXK5OY-BJaUYJ8y.js → vennDiagram-4TSXK5OY-DkXe2h8B.js} +1 -1
- package/client-dist/assets/{wardleyDiagram-VM6X3IG4-DEgI0m1V.js → wardleyDiagram-VM6X3IG4-BnBGhOBQ.js} +1 -1
- package/client-dist/assets/{xychartDiagram-S5SC5T6Z-BuAw5_xn.js → xychartDiagram-S5SC5T6Z-Bxkl9DZJ.js} +1 -1
- package/client-dist/index.html +3 -3
- package/client-dist/sw.js +2 -1
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +10 -2
- package/dist/app.js.map +1 -1
- package/dist/artifacts/ArtifactServer.d.ts.map +1 -1
- package/dist/artifacts/ArtifactServer.js +3 -20
- package/dist/artifacts/ArtifactServer.js.map +1 -1
- package/dist/artifacts/ProjectAppDelivery.d.ts.map +1 -1
- package/dist/artifacts/ProjectAppDelivery.js +31 -1
- package/dist/artifacts/ProjectAppDelivery.js.map +1 -1
- package/dist/artifacts/pdfInFrame.d.ts +17 -0
- package/dist/artifacts/pdfInFrame.d.ts.map +1 -0
- package/dist/artifacts/pdfInFrame.js +30 -0
- package/dist/artifacts/pdfInFrame.js.map +1 -0
- package/dist/projects/ProjectAppStore.d.ts +0 -1
- package/dist/projects/ProjectAppStore.d.ts.map +1 -1
- package/dist/projects/ProjectServiceManager.d.ts +88 -0
- package/dist/projects/ProjectServiceManager.d.ts.map +1 -1
- package/dist/projects/ProjectServiceManager.js +4 -2
- package/dist/projects/ProjectServiceManager.js.map +1 -1
- package/dist/projects/template-runtime.d.ts +5 -0
- package/dist/projects/template-runtime.d.ts.map +1 -1
- package/dist/projects/template-runtime.js +3 -1
- package/dist/projects/template-runtime.js.map +1 -1
- package/dist/routes/issue-content.d.ts +6 -0
- package/dist/routes/issue-content.d.ts.map +1 -0
- package/dist/routes/issue-content.js +25 -0
- package/dist/routes/issue-content.js.map +1 -0
- package/dist/routes/issues.d.ts +2 -1
- package/dist/routes/issues.d.ts.map +1 -1
- package/dist/routes/issues.js +34 -4
- package/dist/routes/issues.js.map +1 -1
- package/dist/routes/project-app.d.ts.map +1 -1
- package/dist/routes/project-app.js +27 -2
- package/dist/routes/project-app.js.map +1 -1
- package/dist/routes/project-creation.d.ts +7 -0
- package/dist/routes/project-creation.d.ts.map +1 -1
- package/dist/routes/project-creation.js +12 -0
- package/dist/routes/project-creation.js.map +1 -1
- package/dist/routes/projects.d.ts.map +1 -1
- package/dist/routes/projects.js +33 -11
- package/dist/routes/projects.js.map +1 -1
- package/dist/routes/sessions.d.ts.map +1 -1
- package/dist/routes/sessions.js +2 -0
- package/dist/routes/sessions.js.map +1 -1
- package/dist/routes/speech.d.ts.map +1 -1
- package/dist/routes/speech.js +3 -1
- package/dist/routes/speech.js.map +1 -1
- package/dist/routes/version.d.ts.map +1 -1
- package/dist/routes/version.js +1 -0
- package/dist/routes/version.js.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.d.ts +12 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationItem.d.ts +10 -2
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationItem.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/McpServerStatus.d.ts +4 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/McpServerStatus.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.d.ts +7 -2
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts +8 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnSteerParams.d.ts +8 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnSteerParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex.d.ts +10 -0
- package/dist/sdk/providers/codex.d.ts.map +1 -1
- package/dist/sdk/providers/codex.js +33 -3
- package/dist/sdk/providers/codex.js.map +1 -1
- package/dist/services/RendezWatchService.d.ts +3 -0
- package/dist/services/RendezWatchService.d.ts.map +1 -1
- package/dist/services/RendezWatchService.js +6 -0
- package/dist/services/RendezWatchService.js.map +1 -1
- package/dist/services/issues/IssueStore.d.ts +24 -0
- package/dist/services/issues/IssueStore.d.ts.map +1 -1
- package/dist/services/issues/IssueStore.js +67 -11
- package/dist/services/issues/IssueStore.js.map +1 -1
- package/dist/services/issues/confirm.d.ts.map +1 -1
- package/dist/services/issues/confirm.js +37 -3
- package/dist/services/issues/confirm.js.map +1 -1
- package/dist/services/issues/content.d.ts +36 -0
- package/dist/services/issues/content.d.ts.map +1 -0
- package/dist/services/issues/content.js +328 -0
- package/dist/services/issues/content.js.map +1 -0
- package/dist/services/issues/status.d.ts.map +1 -1
- package/dist/services/issues/status.js +12 -4
- package/dist/services/issues/status.js.map +1 -1
- package/dist/services/rendezSessions.d.ts +2 -1
- package/dist/services/rendezSessions.d.ts.map +1 -1
- package/dist/services/rendezSessions.js +17 -3
- package/dist/services/rendezSessions.js.map +1 -1
- package/dist/sessions/codex-reader.d.ts.map +1 -1
- package/dist/sessions/codex-reader.js +9 -2
- package/dist/sessions/codex-reader.js.map +1 -1
- package/dist/sessions/codex-rollout-window.d.ts +2 -0
- package/dist/sessions/codex-rollout-window.d.ts.map +1 -1
- package/dist/sessions/codex-rollout-window.js +1 -0
- package/dist/sessions/codex-rollout-window.js.map +1 -1
- package/dist/storage/discovery-sqlite.d.ts.map +1 -1
- package/dist/storage/discovery-sqlite.js +2 -0
- package/dist/storage/discovery-sqlite.js.map +1 -1
- package/dist/storage/migrations/012-issue-content.d.ts +3 -0
- package/dist/storage/migrations/012-issue-content.d.ts.map +1 -0
- package/dist/storage/migrations/012-issue-content.js +14 -0
- package/dist/storage/migrations/012-issue-content.js.map +1 -0
- package/dist/supervisor/Process.d.ts +10 -1
- package/dist/supervisor/Process.d.ts.map +1 -1
- package/dist/supervisor/Process.js +22 -0
- package/dist/supervisor/Process.js.map +1 -1
- package/package.json +5 -5
- package/client-dist/assets/App-BIHEvA6Q.js +0 -2
- package/client-dist/assets/AppearanceSettings-CDplyLIJ.js +0 -2
- package/client-dist/assets/FileViewer-Crw6E_2M.js +0 -63
- package/client-dist/assets/FloatingActionButton-BMjNa4vb.js +0 -1
- package/client-dist/assets/IssueSettings-BLIuCNxO.css +0 -1
- package/client-dist/assets/IssueSettings-Dr6JKfQf.js +0 -1
- package/client-dist/assets/IssuesPage-DOfq79D-.css +0 -1
- package/client-dist/assets/IssuesPage-QmPw-DCB.js +0 -1
- package/client-dist/assets/LocalMediaModal-5au-Ku3n.js +0 -14
- package/client-dist/assets/LocalSourcePage-YurHSY4M.js +0 -1
- package/client-dist/assets/MessageDeliverySettings-D2fzmys9.js +0 -4
- package/client-dist/assets/MessageInput-BUZmOeKI.js +0 -7
- package/client-dist/assets/MessageList-CJgDrWOy.js +0 -4
- package/client-dist/assets/NewSessionForm-4104gBMd.js +0 -9
- package/client-dist/assets/NewSessionPage-AzsvU8Mk.js +0 -2
- package/client-dist/assets/ProjectAppPage-CoxqMJ-6.js +0 -1
- package/client-dist/assets/ProjectAppViewer-D5Juq0Mx.css +0 -1
- package/client-dist/assets/ProjectAppViewer-D_8Lq6Oy.js +0 -1
- package/client-dist/assets/ProviderChildSessionPage-CrSrF2ST.js +0 -1
- package/client-dist/assets/SessionPage-DjR-n2cx.js +0 -50
- package/client-dist/assets/SpeechSettings-CObFsnUu.js +0 -2
- package/client-dist/assets/ToolbarSettings-CyhCBLrg.js +0 -1
- package/client-dist/assets/ViewerWindowActions-DM1Jwlo9.js +0 -1
- package/client-dist/assets/VoiceInputButton-jq6m-rwS.js +0 -1
- package/client-dist/assets/YaServerProvider-fGtUHCJb.js +0 -1
- package/client-dist/assets/channel-BMLLCpix.js +0 -1
- package/client-dist/assets/classDiagram-ZZMXUADV-CriLRYaG.js +0 -1
- package/client-dist/assets/classDiagram-v2-VYDZK3BY-CriLRYaG.js +0 -1
- package/client-dist/assets/index-C-4wHkcA.js +0 -46
- package/client-dist/assets/index-D73NQkRu.js +0 -1
- package/client-dist/assets/main-BpQ_EIjC.js +0 -43
- package/client-dist/assets/mermaid.core-CnOzO4__.js +0 -312
- package/client-dist/assets/sessionVhostApps-DJY4ZLda.js +0 -1
- package/client-dist/assets/stateDiagram-v2-MP3YSRHH-D-_jRHCc.js +0 -1
- package/client-dist/assets/swimlanesDiagram-VR7AAH4N-CMY1RzMZ.js +0 -8
- package/client-dist/assets/useDocumentTitle-CeauK1Xu.js +0 -1
- package/client-dist/assets/useGeneratedTitleLength-0cRz1f9b.js +0 -1
- package/client-dist/assets/useSessionRightPaneSetting-BOgcH2kB.js +0 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var fl=Object.defineProperty;var hl=(e,t,n)=>t in e?fl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var st=(e,t,n)=>hl(e,typeof t!="symbol"?t+"":t,n);import{j as i,r as c,b as xr,X as Ls,a as _s,i as or,s as ml,d as bo,ag as pl}from"./clientSummaryStore-Dsgo1zWK.js";import{c as te,i as So,U as Ve,g as Lt,u as Ie,w as we,bX as ko,t as Ht,aQ as kt,bY as Co,bJ as gl,bt as Sn,bn as wl,bw as vl,bZ as xl,d as yl}from"./main-BX4yZXDF.js";import{a as Wt,c as Es,b as bl,d as Sl,e as kl,r as Cl,u as Mn,t as ir,g as Ll}from"./sourceTransportPaths-BTR7eFi5.js";import{u as yr}from"./SessionMetadataContext-D0F_4Wp0.js";import{g as _l,e as Kt,d as br,h as El,i as jl,r as Rl,j as Ml,k as qn,p as Al,l as Pl,m as Tl,n as Fl,o as Nl,q as $l,s as Bl,t as Dl,V as Il,S as Ol,v as Hl,b as Ul,L as Vl,w as js,x as ql}from"./LocalMediaModal-DMrKaM1a.js";import{a as Wl,f as Sr,c as Kl,w as Dt,x as Ut,y as kr,z as Rs,S as zl,A as Gl,u as _t,o as Xl,s as Yl,m as Ql,Q as Ms,b as Cr,r as Jl,M as Lo,i as Zl,B as ec,D as tc,E as As,d as nc}from"./Modal-CHNqXAgW.js";import{n as Vt,g as qt,a as Lr,b as _o,i as lr,d as Eo,m as _r}from"./text-B4tk85DK.js";import{c as rc,aU as sc,Z as oc,s as lt,be as ic,bz as lc,bA as cc,S as Wn,_ as ac,bo as uc}from"./index-BhTv6hAY.js";import{i as jo,f as Ro,a as dc}from"./usePanelSlideAnimations-XdQhGgr-.js";import{a5 as kn,u as Mo,a6 as fc,a7 as hc,a8 as mc,a9 as pc,G as Ps,o as gc,Z as wc,$ as vc,a2 as xc,_ as yc,K as bc,R as Ts,U as Fs,V as Sc,W as kc,X as Cc,Y as Lc,aa as _c}from"./GlossaryContext-BA5X62Ck.js";import{a as at}from"./appHref-ByaEnJGJ.js";import{V as Ns}from"./ViewerWindowActions-DV5bxAAy.js";import{R as Ec,e as Ao,c as cr,F as Po,l as To,i as ar,f as jc,g as Rc,h as Mc}from"./sessionVhostApps-DbEDY32Q.js";import{a as Ac,M as Fo,u as Pc,c as $s,F as Tc,b as Fc,d as Nc,g as $c}from"./MarkdownPreview-TXbYZwdp.js";import Bc from"./katex-DLorvT8M.js";import{a as Dc,c as Ic}from"./RenderModeContext-CuIMXqQV.js";import{f as No,s as Oc,r as Hc,l as Uc,c as Vc}from"./uiTrace-CvAgW12D.js";import{b as qc,g as Wc,d as Kc,c as Bs,m as zc,p as $o}from"./sessionViewerController-BGKUu-Zg.js";import{C as Gc}from"./CopyTextButton-oYhSruA8.js";import{a as Xc}from"./RenderModeGlyph-ldDSjj9f.js";const Yc=Object.freeze({"\\textsc":"\\text{#1}","\\mbox":"\\text{#1}","\\mathbbm":"\\mathbb{#1}","\\mathds":"\\mathbb{#1}","\\O":"\\text{Ø}","\\textsubscript":"_{\\text{#1}}","\\nicefrac":"{}^{#1}\\!/\\!_{#2}"});function Qc(){return{...Yc}}const Jc=/\\(color|textcolor|colorbox|pagecolor)\s*\[\s*([A-Za-z]+)\s*\]\s*\{([^{}]*)\}/g;function ln(e){return Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0")}function Zc(e,t){const n=t.split(",").map(o=>o.trim()),r=n.map(Number),s=r.every(o=>Number.isFinite(o));switch(e){case"rgb":return n.length===3&&s?`#${r.map(o=>ln(o*255)).join("")}`:null;case"RGB":return n.length===3&&s?`#${r.map(ln).join("")}`:null;case"HTML":return/^[0-9A-Fa-f]{6}$/.test(t.trim())?`#${t.trim()}`:null;case"gray":{if(n.length!==1||!s)return null;const o=ln((r[0]??0)*255);return`#${o}${o}${o}`}case"cmyk":{if(n.length!==4||!s)return null;const[o=0,l=0,a=0,d=0]=r;return`#${[o,l,a].map(u=>ln(255*(1-u)*(1-d))).join("")}`}default:return null}}function ea(e){return e.includes("[")?e.replace(Jc,(t,n,r,s)=>{if(n==="pagecolor")return"";const o=Zc(r,s);return o?`\\${n}{${o}}`:t}):e}const wp=32,vp=64*1024;function xp(e){const t=e.trim().replace(/^#\s*/,""),n=/^acli: 1(?:\s+(.*))?$/.exec(t),r=/^acli-capabilities:\s+(.+)$/.exec(t),s=((n==null?void 0:n[1])??(r==null?void 0:r[1])??"").split(/\s+/);return s.includes(n?"+commentary-lines":"commentary-lines/1")?"lines":s.includes(n?"+commentary":"commentary/1")?"json":null}function ta(e){JSON.parse(e);const t=/\s*("(?:\\.|[^"\\])*"|[{}[\],:]|[^\s{}[\],:]+)/y;let n=0;const r=()=>{t.lastIndex=n;const o=t.exec(e);if(!o)throw new Error("Missing JSON token");return n=t.lastIndex,{text:o[1],start:n-o[1].length}},s=o=>{if(o>128)throw new Error("JSON nesting exceeds commentary limit");const l=r(),a={start:l.start,end:n};if(l.text==="{"){a.members=[];const d=new Set;for(;;){const u=r();if(u.text==="}")break;const f=JSON.parse(u.text);if(d.has(f))throw new Error("Ambiguous duplicate JSON member");if(d.add(f),r(),a.members.push({key:f,start:u.start,value:s(o+1)}),r().text==="}")break}a.end=n}else if(l.text==="["){a.items=[];const d=n;if(r().text!=="]"){n=d;do a.items.push(s(o+1));while(r().text!=="]")}a.end=n}return a};return s(0)}function Ds(e,t){const n=JSON.parse(e.slice(t.start,t.end));if(!n||Array.isArray(n)||typeof n!="object"||Object.keys(n).length!==1||!Array.isArray(n.commentary)||n.commentary.length===0)return null;const r=[];for(const s of n.commentary){if(!s||typeof s!="object"||Array.isArray(s)||Object.keys(s).length!==1||typeof s.text!="string"||!s.text.trim())return null;r.push(s.text)}return r}function Bo(e,t){const n=[];let r=t.start;for(const s of e.removed)s.start<t.start||s.end>t.end||(n.push(e.source.slice(r,s.start)),r=s.end);return n.push(e.source.slice(r,t.end)),n.join("")}function yp(e,t){return t.context?Bo(e,t.context):null}function bp(e){const t={source:e,data:e,commentary:[],removed:[],metadataOnly:!1};if(e.length>1024*1024)return t;if(!e.includes("_acli")&&!e.includes("\\")){try{JSON.parse(e),t.json=!0}catch{}return t}let n;try{n=ta(e)}catch{return t}t.json=!0;const r=o=>{var l;return((l=o.members)==null?void 0:l.length)===1&&o.members[0].key==="_acli"&&Ds(e,o.members[0].value)!==null},s=(o,l,a)=>{var d;if(o.items){let u=null;o.items.forEach((f,p)=>{s(f,`${l}/${p}`,u),r(f)||(u=f)})}(d=o.members)==null||d.forEach((u,f,p)=>{if(u.key!=="_acli"){s(u.value,`${l}/${u.key.replace(/~/g,"~0").replace(/\//g,"~1")}`,null);return}const w=Ds(e,u.value);if(!w)return;const x=r(o)?a:o===n?null:o;w.forEach((m,y)=>{t.commentary.push({id:`${l}/_acli/commentary/${y}`,text:m,context:x})});const h=p[f+1],b=p[f-1];t.removed.push({start:!h&&b?b.value.end:u.start,end:h?h.start:u.value.end})})};return s(n,"",null),t.removed.sort((o,l)=>o.start-l.start),t.metadataOnly=r(n),t.data=Bo(t,{start:0,end:e.length}),t}function Sp(e){const t="# _acli.commentary: ",n=e.startsWith(t)?e.slice(t.length).replace(/\r?\n$/,""):"",r=e.length<=1024*1024&&!!n.trim();return{source:e,data:r?"":e,commentary:r?[{id:"line",text:n,context:null}]:[],removed:r?[{start:0,end:e.length}]:[],metadataOnly:r}}class na{constructor(t="json"){st(this,"fragments",[]);st(this,"depth",0);st(this,"quoted",!1);st(this,"escaped",!1);st(this,"json",!1);st(this,"started",!1);this.format=t}append(t){const n=[];let r=0;for(let s=0;s<t.length;s++){const o=t[s];!this.started&&!/\s/.test(o)&&(this.started=!0,this.json=this.format==="json"&&(o==="{"||o==="[")),this.json&&(this.quoted?this.escaped?this.escaped=!1:o==="\\"?this.escaped=!0:o==='"'&&(this.quoted=!1):o==='"'?this.quoted=!0:o==="{"||o==="["?this.depth++:(o==="}"||o==="]")&&this.depth--),o===`
|
|
2
|
+
`&&(!this.json||!this.quoted&&this.depth<=0)&&(this.fragments.push(t.slice(r,s+1)),n.push(...this.finish()),r=s+1)}return r<t.length&&this.fragments.push(t.slice(r)),n}finish(){const t=this.fragments.join("");return this.fragments=[],this.depth=0,this.quoted=!1,this.escaped=!1,this.json=!1,this.started=!1,t?[t]:[]}}const ra=8e3,sa=120,oa=3;function kp(e){return(e.split(/\r?\n/u).map(n=>n.trim()).find(Boolean)??"Source review").slice(0,sa)}function ia(e,t,n=oa,r="new"){if(!Number.isInteger(t)||t<0)return null;let s=0;for(const o of e){if(t<s+o.lines.length)return la(o,t-s,n,r);s+=o.lines.length}return null}function la(e,t,n,r){var p,w;let s=e.oldStart,o=e.newStart;for(let x=0;x<t;x++){const h=(p=e.lines[x])==null?void 0:p[0];h==="-"?s++:(h==="+"||s++,o++)}const l=(w=e.lines[t])==null?void 0:w[0];let a,d,u;l==="-"?(a="old",d=s,u=null):l==="+"?(a="new",d=null,u=o):(a=r,d=s,u=o);const f=Math.max(0,t-n);return{side:a,oldLine:d,newLine:u,snippet:ca(e.lines,t,n),snippetAnchorOffset:t-f}}function ca(e,t,n){const r=Math.max(0,t-n),s=Math.min(e.length,t+n+1),o=[];for(let l=r;l<s;l++)o.push((e[l]??"").slice(1));return o.join(`
|
|
3
|
+
`).slice(0,ra)}const cn=/(?:https?:\/\/|www\.)[^\s<>]+/gi,aa=new Set([".",",",":",";","!","?","'",'"',"`","*","_","~"]),ua={")":"(","]":"[","}":"{"};function Is(e,t){let n=0;for(const r of e)r===t&&(n+=1);return n}function da(e){let t=e;for(;;){const n=t[t.length-1];if(n===void 0)break;if(aa.has(n)){t=t.slice(0,-1);continue}const r=ua[n];if(r){const s=t.slice(0,-1);if(Is(s,r)>Is(s,n))break;t=t.slice(0,-1);continue}break}return t}function fa(e){const t=e.startsWith("www.")?`https://${e}`:e;try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"||!n.hostname.includes(".")?null:t}catch{return null}}function Do(e,t){const n=[];let r=0;cn.lastIndex=0;for(let s=cn.exec(e);s!==null;s=cn.exec(e)){const o=da(s[0]),l=fa(o),a=s.index+o.length,d=(t==null?void 0:t.suppressTrailingUrl)===!0&&a>=e.length;!l||d||(s.index>r&&n.push({type:"text",text:e.slice(r,s.index)}),n.push({type:"url",text:o,href:l}),r=a,cn.lastIndex=a)}return r<e.length&&n.push({type:"text",text:e.slice(r)}),n}function Io(e){return/https?:\/\/|www\./i.test(e)}function Cp(e,t,n){if(!Io(e))return n(e);const r=t.external?' target="_blank" rel="noopener noreferrer"':"";return Do(e,t).map(s=>s.type==="url"&&s.href?`<a href="${n(s.href)}"${r}>${n(s.text)}</a>`:n(s.text)).join("")}const ha=/^([\w.-]+)\[(\d+)\]\{([^}]*)\}:\s*$/;function ma(e){const t=[];let n="",r=!1,s=!1;for(let o=0;o<e.length;o+=1){const l=e[o];if(r)l==='"'?e[o+1]==='"'?(n+='"',o+=1):(r=!1,s=!0):n+=l;else if(s){if(l!==",")return null;t.push(n),n="",s=!1}else if(l==='"'&&n==="")r=!0;else{if(l==='"')return null;l===","?(t.push(n),n=""):n+=l}}return r?null:(t.push(n),t)}function pa(e){var s,o;const t=e.trim().split(`
|
|
4
|
+
`),n=[];let r=0;for(;r<t.length;){if(!((s=t[r])!=null&&s.trim())){r+=1;continue}const l=(o=t[r])==null?void 0:o.trim().match(ha);if(!l)return null;const a=Number(l[2]),d=(l[3]??"").split(",").map(f=>f.trim());if(d.length===0||d.some(f=>!f))return null;r+=1;const u=[];for(let f=0;f<a;f+=1,r+=1){const p=t[r];if(p===void 0||!p.trim())return null;const w=ma(p.trim());if(!w||w.length!==d.length)return null;u.push(w)}n.push({name:l[1]??"",columns:d,rows:u})}return n.length>0?n:null}const ga="6.3.289";function wa(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M13.5 8h-11M6.5 4l-4 4 4 4"})})}const Oo=c.createContext(null);function va({children:e,onQuoteTextBlock:t}){return i.jsx(Oo.Provider,{value:t,children:e})}function An(){return c.useContext(Oo)}const xa=300*1e3,ya=32,ba=1024*1024,Sa=100,Ae=new Map,ur=new Set,xn=[];function Er(e){return(e==null?void 0:e.nowMs)??Date.now()}function Ho(e){return Array.isArray(e)?e.map(t=>Ho(t)):e??null}function Os(e){if(!e)return{};if(e instanceof URLSearchParams){const n={};for(const r of Array.from(new Set(e.keys())).sort()){const s=e.getAll(r);n[r]=s.length>1?s:s[0]??""}return n}const t={};for(const n of Object.keys(e).sort())t[n]=Ho(e[n]);return t}function dr(e){if(e===void 0)return"undefined";if(e===null||typeof e!="object")return JSON.stringify(e)??String(e);if(Array.isArray(e))return`[${e.map(n=>dr(n)).join(",")}]`;const t=e;return`{${Object.keys(t).sort().map(n=>`${JSON.stringify(n)}:${dr(t[n])}`).join(",")}}`}function Pn(e){const t=e.projectId??null;return{key:dr({sourceKey:e.sourceKey,routeId:e.routeId,projectId:t,routeParams:Os(e.routeParams),queryParams:Os(e.queryParams)}),sourceKey:e.sourceKey,routeId:e.routeId,projectId:t}}function Uo(e){var t;try{return((t=JSON.stringify(e))==null?void 0:t.length)??0}catch{return 0}}function Vo(){for(const e of Array.from(ur))e()}function ka(e){return{key:e.key,sourceKey:e.sourceKey,routeId:e.routeId,projectId:e.projectId,createdAt:e.createdAt,updatedAt:e.updatedAt,lastAccessedAt:e.lastAccessedAt,expiresAt:e.expiresAt,approxBytes:e.approxBytes}}function jr(){typeof window>"u"||(window.__YA_ROUTE_RETENTION__={entries:()=>Kn().entries,events:()=>Kn().events,diagnostics:Kn,clear:Ra,invalidate:ja})}function Ct(e,t={}){for(xn.push(e);xn.length>Sa;)xn.shift();jr(),t.emit&&Vo()}function zt(e,t,n,r=!0){const s=Ae.get(e);s&&(Ae.delete(e),Ct({type:t==="invalidate"?"invalidate":"evict",key:s.key,sourceKey:s.sourceKey,routeId:s.routeId,projectId:s.projectId,at:n,reason:t,approxBytes:s.approxBytes},{emit:r}))}function Ca(e){for(const t of Array.from(Ae.values()))t.expiresAt<=e&&zt(t.key,"expired",e,!1)}function La(){let e=0;for(const t of Ae.values())e+=t.approxBytes;return e}function _a(e,t){const n=e.maxEntries??ya,r=e.maxBytes??ba;for(;Ae.size>n||La()>r;){const s=Array.from(Ae.values()).sort((o,l)=>o.lastAccessedAt!==l.lastAccessedAt?o.lastAccessedAt-l.lastAccessedAt:o.updatedAt-l.updatedAt)[0];if(!s)break;zt(s.key,"lru",t,!1)}}function qo(e){return ur.add(e),jr(),()=>{ur.delete(e)}}function Ea(e,t={}){const n=Er(t),r=Pn(e),s=Ae.get(r.key),o=t.recordDiagnostics??!0;return s?s.expiresAt<=n?t.touch===!1&&!o?{value:null,missReason:"expired"}:(zt(s.key,"expired",n),o&&Ct({type:"miss",key:r.key,sourceKey:r.sourceKey,routeId:r.routeId,projectId:r.projectId,at:n,reason:"expired"}),{value:null,missReason:"expired"}):(t.touch!==!1&&(s.lastAccessedAt=n),o&&Ct({type:"hit",key:s.key,sourceKey:s.sourceKey,routeId:s.routeId,projectId:s.projectId,at:n,approxBytes:s.approxBytes}),{value:s.value}):(o&&Ct({type:"miss",key:r.key,sourceKey:r.sourceKey,routeId:r.routeId,projectId:r.projectId,at:n,reason:"missing"}),{value:null,missReason:"missing"})}function Rr(e,t){return Ea(e,t).value}function Mr(e,t,n={}){const r=Er(n);Ca(r);const s=Pn(e),o=Ae.get(s.key),l=n.ttlMs??xa,a={...s,value:t,createdAt:(o==null?void 0:o.createdAt)??r,updatedAt:r,lastAccessedAt:r,expiresAt:r+l,approxBytes:n.approxBytes??Uo(t)};Ae.set(s.key,a),_a(n,r),Ct({type:"write",key:a.key,sourceKey:a.sourceKey,routeId:a.routeId,projectId:a.projectId,at:r,approxBytes:a.approxBytes},{emit:!0})}function Lp(e,t,n={}){const r=Rr(e,{...n,touch:!1,recordDiagnostics:!1}),s=typeof t=="function"?t(r):Object.assign({},r,t);Mr(e,s,n);const o=Pn(e);Ct({type:"patch",key:o.key,sourceKey:o.sourceKey,routeId:o.routeId,projectId:o.projectId,at:Er(n),approxBytes:n.approxBytes??Uo(s)})}function ja(e){const t=Date.now();zt(Pn(e).key,"invalidate",t)}function Ra(){const e=Date.now();for(const t of Array.from(Ae.values()))zt(t.key,"invalidate",e,!1);Vo()}function Kn(){const e=Array.from(Ae.values(),ka);return{entries:e,events:[...xn],totalBytes:e.reduce((t,n)=>t+n.approxBytes,0)}}jr();const Ma=3e4,Aa=750,Pa=60*1e3;function Ta(){return Wl(),!0}function Wo(e,t,n,r){return{sourceKey:e,routeId:n?"git-status:data:cached-untracked":r?"git-status:data:no-untracked":"git-status:data",projectId:t}}function Fa(e,t,n,r){const s=c.useMemo(()=>t?Wo(e,t,n,r):null,[e,t,n,r]);return c.useSyncExternalStore(qo,()=>s?Rr(s,{touch:!1,recordDiagnostics:!1}):null,()=>null)}function Na(e,t={}){const n=xr(),r=Ta(),s=t.useUntrackedCache===!0,o=t.omitUntracked===!0,l=c.useMemo(()=>rc({endpoint:s?"git-status:cached-untracked":o?"git-status:no-untracked":"git-status",projectId:e??null}),[o,e,s]),a=Fa(n,e,s,o),d=`${n}\0${l}`,u=c.useRef({identity:d,value:a});u.current.identity!==d?u.current={identity:d,value:a}:a!==null&&(u.current.value=a);const f=a??u.current.value,[p,w]=c.useState(null),[x,h]=c.useState(!1),b=c.useMemo(()=>$a(f,p,s),[f,p,s]),[m,y]=c.useState(()=>!!e&&b===null),[S,_]=c.useState(null),[C,j]=c.useState(null),v=c.useRef(!0),k=c.useRef(0),g=c.useRef(0),E=c.useRef(null),A=c.useRef(b),B=c.useRef(p),T=c.useRef(a),P=c.useRef({queryKey:"",present:!1});A.current=b,B.current=p,T.current=a,c.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]),c.useEffect(()=>{g.current+=1,E.current=null,w(null),h(!1),j(null)},[o,e,n,s]),c.useEffect(()=>{_(null),y(!!e&&A.current===null)},[e,l,n]),c.useEffect(()=>{if(e)return sc({sourceKey:n,key:l})},[e,l,n]);const M=c.useCallback(async({background:H=!1}={})=>{if(!e||!r||!s||(a==null?void 0:a.isGitRepo)!==!0)return;const q=++g.current;(!H||B.current===null)&&j(null),B.current===null&&h(!0);const D=E.current,W=D??te.listGitUntrackedFiles(e);D||(E.current=W);try{const Y=await W;v.current&&q===g.current&&(w(Y),h(!1),j(null))}catch(Y){v.current&&q===g.current&&!Ls(Y)&&(!H||B.current===null)&&j(Y instanceof Error?Y:new Error(String(Y)))}finally{v.current&&q===g.current&&h(!1),E.current===W&&(E.current=null)}},[e,r,a==null?void 0:a.isGitRepo,s]),F=c.useCallback(async({force:H=!1,background:q=!1}={})=>{if(!e||!r)return;const D=++k.current,W=T.current!==null,Y=A.current!==null;!q&&!Y&&y(!0),q||_(null);const oe={projectId:e},X=(Z,J)=>{const ee=J.meta.projectId;ee&&Mr(Wo(J.sourceKey,ee,s,o),Z,{ttlMs:Pa})},fe=Z=>{const J=Z.meta.projectId;if(!J)throw new Error("Project id is required");return te.getGitStatus(J,{...o?{omitUntracked:!0}:{},...s?{useUntrackedCache:!0}:{}})};try{const Z=await oc({sourceKey:n,key:l,force:H||!W,meta:oe,fetcher:fe,applySnapshot:X});if(!v.current||D!==k.current)return;Z.status!=="obsolete"&&_(null)}catch(Z){if(!v.current||D!==k.current)return;A.current===null&&!Ls(Z)&&_(Z instanceof Error?Z:new Error(String(Z)))}finally{v.current&&D===k.current&&y(!1)}},[o,e,l,r,n,s]);c.useEffect(()=>{!e||!r||F({background:A.current!==null})},[F,e,r]),c.useEffect(()=>{const H=P.current,q=a!==null;P.current={queryKey:l,present:q},H.queryKey===l&&H.present&&!q&&e&&r&&document.visibilityState==="visible"&&document.hasFocus()&&F()},[F,e,l,r,a]),c.useEffect(()=>{(a==null?void 0:a.isGitRepo)===!0&&M({background:B.current!==null})},[M,a==null?void 0:a.isGitRepo]);const $=t.poll!==!1;c.useEffect(()=>{if(!e||!r)return;let H=document.visibilityState==="visible"&&document.hasFocus();const q=()=>{const D=document.visibilityState==="visible"&&document.hasFocus();if(D!==H&&(H=D,!!D)){if(T.current===null){F();return}$&&(F({force:!0,background:!0}),M({background:!0}))}};return document.addEventListener("visibilitychange",q),window.addEventListener("focus",q),window.addEventListener("blur",q),()=>{document.removeEventListener("visibilitychange",q),window.removeEventListener("focus",q),window.removeEventListener("blur",q)}},[F,M,$,e,r]),c.useEffect(()=>{if(!e||!r||t.poll===!1)return;let H=!1,q=!1,D=null,W=null;const Y=()=>{F({force:!0,background:!0}),M({background:!0})},oe=()=>{D&&(clearInterval(D),D=null)},X=()=>{D||(D=setInterval(Y,Ma))},fe=()=>{W&&(clearTimeout(W),W=null)},Z=()=>{oe(),H&&X()},J=()=>{H&&(fe(),W=setTimeout(()=>{W=null,Y(),Z()},Aa))},ee=()=>{const ye=document.visibilityState==="visible"&&document.hasFocus();q&&ye===H||(q=!0,H=ye,H?X():(oe(),fe()))},L=_s.onSource(n,"process-state-changed",ye=>{ye.projectId===e&&ye.activity!=="in-turn"&&J()}),re=_s.onSource(n,"reconnect",J);return ee(),document.addEventListener("visibilitychange",ee),window.addEventListener("focus",ee),window.addEventListener("blur",ee),()=>{H=!1,oe(),fe(),L(),re(),document.removeEventListener("visibilitychange",ee),window.removeEventListener("focus",ee),window.removeEventListener("blur",ee)}},[F,M,t.poll,e,r,n]);const I=c.useCallback(async()=>{await Promise.all([F({force:!0,background:A.current!==null}),M({background:B.current!==null})])},[F,M]);return{gitStatus:b,untrackedFiles:p,untrackedLoading:x,untrackedError:C,loading:m,error:S,refetch:I}}function $a(e,t,n){if(!n||(e==null?void 0:e.isGitRepo)===!1||!e||!t)return e;const r=[...t.files.map(l=>{var a;return{path:l,status:"?",staged:!1,linesAdded:null,linesDeleted:null,...(a=t.lastEditors)!=null&&a[l]?{lastEditor:t.lastEditors[l]}:{}}}),...t.folders.map(({path:l})=>({path:l,status:"?",staged:!1,linesAdded:null,linesDeleted:null}))],o=[...e.files.filter(l=>l.status!=="?"),...r];return{...e,files:o,isClean:o.length===0}}const Ba=5e3,Da=6e4;function Hs(e,t){return{sourceKey:e,routeId:"git-status:file-projections",projectId:t}}function Ia(e,t,n){const r=c.useMemo(()=>t?Hs(e,t):null,[t,e]),s=c.useSyncExternalStore(qo,()=>r?Rr(r,{touch:!1,recordDiagnostics:!1}):null,()=>null),o=(s==null?void 0:s.statusKey)===n?s.value:null,l=c.useRef(n);l.current=n;const a=Kl({sourceKey:e,key:{endpoint:"git-status:file-projections",projectId:t??null,statusKey:n},enabled:!!(t&&n),hasData:o!==null,staleTimeMs:Ba,meta:{projectId:t,statusKey:n},fetcher:async u=>{const f=u.meta;if(!f.projectId)throw new Error("Project is required for file projections");return te.getGitFileProjections(f.projectId)},applySnapshot:(u,f)=>{const p=f.meta;!p.projectId||!p.statusKey||p.statusKey!==l.current||Mr(Hs(f.sourceKey,p.projectId),{statusKey:p.statusKey,value:u},{ttlMs:Da})}});return{manifest:o??(n&&!a.error?(s==null?void 0:s.value)??null:null),loading:!!(n&&!o&&!a.error)}}function Oa(e){const t=Vt(e).replace(/^\.\/+/,""),n=t.startsWith("/")||t.startsWith("//")||/^[a-zA-Z]:\//.test(t),r=t===".."||t.startsWith("../");return t&&!n&&!r?t:null}function Us(e,t){return e?t.find(n=>n.path===e||n.origPath===e)??null:null}function Ha(e){var t,n;return JSON.stringify([((n=(t=e.recentCommits)==null?void 0:t[0])==null?void 0:n.hash)??null,e.files.map(r=>[r.path,r.origPath??null,r.status,r.staged,r.linesAdded,r.linesDeleted])])}function Ko(e,t){var x,h;const n=xr(),r=Sr(n),s=lt(r,ic),o=lt(r,lc),l=c.useMemo(()=>Oa(t),[t]),a=s&&o&&l?e:void 0,{gitStatus:d,loading:u,error:f}=Na(a,{poll:!1,omitUntracked:!1}),p=d!=null&&d.isGitRepo&&l?Ha(d):null,w=Ia(n,a,p);return{cumulativeFile:Us(l,((x=w.manifest)==null?void 0:x.cumulativeFiles)??[]),loading:!!(e&&l&&(r===null||o&&a&&(u||!d&&!f||d!=null&&d.isGitRepo&&w.loading))),relativePath:l,supported:o,worktreeFile:Us(l,((h=w.manifest)==null?void 0:h.worktreeFiles)??[])}}const Ua=["block","paragraph-hover","paragraph-always"],zo="paragraph-hover";function Va(e){return Ua.includes(e)?e:void 0}const It=So(Ve.quoteReplyButtonMode,zo,Va);It.set;function Go(){return{quoteReplyButtonMode:c.useSyncExternalStore(It.subscribe,It.read,()=>zo),setQuoteReplyButtonMode:It.set}}It.read;const qa="_cluster_ypdbz_1",Wa="_button_ypdbz_9",Ka="_text_ypdbz_37",za="_quote_ypdbz_56",Ga="_source_ypdbz_75",Xa="_rich_ypdbz_94",Ya="_newSession_ypdbz_112",Qa="_specimen_ypdbz_132",Ja="_mobile_ypdbz_137",Za="_docked_ypdbz_146",De={cluster:qa,button:Wa,text:Ka,quote:za,source:Ga,rich:Xa,newSession:Ya,specimen:Qa,mobile:Ja,docked:Za},eu=30,tu=44,$t=6;function Vs(){return i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"5",y:"5",width:"9",height:"9",rx:"1.5"}),i.jsx("path",{d:"M11 5V3.5A1.5 1.5 0 0 0 9.5 2H3.5A1.5 1.5 0 0 0 2 3.5v6A1.5 1.5 0 0 0 3.5 11H5"})]})}const qs={text:i.jsx(Vs,{}),quote:">",source:i.jsx(Vs,{}),rich:"Aa",newSession:"+"},nu={text:De.text,quote:De.quote,source:De.source,rich:De.rich,newSession:De.newSession};function ru({kind:e,label:t,onClick:n,onPointerDown:r,onPointerUp:s,specimen:o=!1}){const l=`${De.button} ${nu[e]} ${o?De.specimen:""}`;return o?i.jsx("span",{className:l,"aria-hidden":"true","data-selection-action-specimen":e,children:qs[e]}):i.jsx("button",{type:"button",className:l,onMouseDown:a=>a.preventDefault(),onPointerDown:a=>{a.preventDefault(),r==null||r(a)},onPointerUp:s,onClick:n,"aria-label":t,title:t,children:qs[e]})}function su({children:e,docked:t=!1,mobile:n=!1,placement:r,style:s}){return i.jsx("div",{className:[De.cluster,t?De.docked:"",n?De.mobile:""].filter(Boolean).join(" "),style:s,"data-selection-action-cluster":"true","data-selection-action-placement":r,children:e})}const ou="session-file-comments",Xo="data-session-file-comment-mode",Yo=100,iu=2e4,Ws=8e3;function lu({sourceKey:e,sessionId:t,projectId:n,filePath:r}){return[ou,e,t,n,r].map(encodeURIComponent).join(":")}function Ks(e){try{const t=JSON.parse(or.getItem(e)??"null");if(!Array.isArray(t))return[];const n=[];for(const r of t.slice(0,Yo)){if(!au(r))continue;const{id:s,location:o,quote:l,text:a,afterLine:d,afterBlock:u}=r;typeof s!="string"||!s||typeof o!="string"||!o||typeof l!="string"||!l.trim()||typeof a!="string"||!a.trim()||o.length>Ws||l.length>Ws||a.length>iu||d!==void 0&&(!Number.isInteger(d)||Number(d)<1)||u!==void 0&&(!Number.isInteger(u)||Number(u)<0)||n.push({id:s,location:o,quote:l,text:a,...d===void 0?{}:{afterLine:Number(d)},...u===void 0?{}:{afterBlock:Number(u)}})}return n}catch{return[]}}function zn(e,t){const n=t.filter(r=>r.text.trim()).slice(0,Yo);if(n.length===0){or.removeItem(e);return}or.setItem(e,JSON.stringify(n))}function Qo(e){const t=e.quote.replace(/\r\n?/g,`
|
|
5
|
+
`).replace(/^\n+|\n+$/g,"").split(`
|
|
6
|
+
`).map(n=>`> ${n}`).join(`
|
|
7
|
+
`);return`${e.location}
|
|
8
|
+
|
|
9
|
+
${t}
|
|
10
|
+
|
|
11
|
+
${e.text.trim()}`}function cu(e){return e.map(Qo).join(`
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
`)}function au(e){return typeof e=="object"&&e!==null}const wt="session-transcript-selection-active",uu=50;function zs(e,t,n){return Math.max(t,Math.min(n,e))}function Gs(e,t,n){const r=e.sourceElement.ownerDocument.createRange();return r.selectNodeContents(e.sourceElement),t==="after"?r.setStart(e.range.endContainer,e.range.endOffset):r.setEnd(e.range.startContainer,e.range.startOffset),!r.toString().trim()||typeof r.getClientRects!="function"?!0:!Array.from(r.getClientRects()).some(s=>s.width>0&&s.height>0&&s.bottom>n.top+1&&s.top<n.bottom-1)}function du(e){const t=new Set(e.map(r=>r.sourceElement)),n=[];for(const r of t){const s=r.ownerDocument.createRange();s.selectNodeContents(r),typeof s.getClientRects=="function"&&n.push(...Array.from(s.getClientRects()).filter(o=>o.width>0&&o.height>0))}return n}function fu(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Ar(e){var t;return((t=e.matchMedia)==null?void 0:t.call(e,"(pointer: coarse)").matches)===!0}function hu(e,t){if(Ar(t))return!0;const n=e.pointerType;return n==="touch"||n==="pen"}function mu(e,t,n){return t===0&&n===0?!0:e.ranges.some(r=>typeof r.getClientRects!="function"?!0:Array.from(r.getClientRects()).some(s=>t>=s.left-1&&t<=s.right+1&&n>=s.top-1&&n<=s.bottom+1))}function pu(e,t,n,r,s){const{snippets:o}=n,l=n.root,a=e.ownerDocument.defaultView??window,d=Ar(a),u=d?tu:eu,f=t.getRangeAt(t.rangeCount-1),p=typeof f.getBoundingClientRect=="function"?f.getBoundingClientRect():null,w=typeof f.getClientRects=="function"?Array.from(f.getClientRects()).filter(q=>q.width!==0||q.height!==0):[],x=p&&(p.width!==0||p.height!==0);if(!x&&!s)return null;const h=l.getBoundingClientRect(),b=x?p:{top:(s==null?void 0:s.clientY)??h.top,right:(s==null?void 0:s.clientX)??h.left,bottom:(s==null?void 0:s.clientY)??h.top,left:(s==null?void 0:s.clientX)??h.left,width:0,height:0},m=w[0]??b,y=w.at(-1)??b,S=r*u+(r-1)*$t,_=o[0],C=o.at(-1),j=C?Gs(C,"after",y):!1,v=_?Gs(_,"before",m):!1,k=h.right-y.right,g=m.left-h.left,E=h.bottom-b.bottom,A=b.top-h.top,B=Math.max(0,l.clientHeight-u),T=Math.max(0,l.clientWidth-S),P=b.left-h.left+(b.width-S)/2,M={after:{top:y.top-h.top+(y.height-u)/2,left:y.right-h.left+$t},before:{top:m.top-h.top+(m.height-u)/2,left:m.left-h.left-S-$t},below:{top:b.bottom-h.top+$t,left:P},above:{top:b.top-h.top-u-$t,left:P}},F=du(o),$=q=>{if(q==="after"&&!j||q==="before"&&!v)return!1;const D=M[q];if(D.left<0||D.top<0||D.left+S>l.clientWidth||D.top+u>l.clientHeight)return!1;const W={top:h.top+D.top,right:h.left+D.left+S,bottom:h.top+D.top+u,left:h.left+D.left};return W.left<0||W.top<0||W.right>a.innerWidth||W.bottom>a.innerHeight?!1:!F.some(Y=>fu(W,Y))},I=["after","before","below","above"].find($)??[["after",k-S],["before",g-S],["below",E-u],["above",A-u]].reduce((q,D)=>D[1]>q[1]?D:q)[0],H=M[I];return{side:I,docked:d&&l===e,mobile:d,snapshot:n,top:zs(H.top,0,B),left:zs(H.left,0,T)}}function gu({actionCount:e,getActionCount:t,containerRef:n,inert:r,isInteractiveTarget:s}){const o=c.useRef(!1),[l,a]=c.useState(null),d=c.useCallback(()=>a(null),[]),u=c.useCallback(()=>{const f=n.current,p=f==null?void 0:f.ownerDocument.getSelection();if(!f||!p||p.isCollapsed||p.rangeCount===0)return null;const w=Dt(f,p);if(!w)return null;const x=Ut(w);return x.length===0?null:{anchors:x.map(kn),snippets:x,ranges:x.map(h=>h.range.cloneRange()),root:w}},[n]);return c.useEffect(()=>{if(r)return;const f=p=>{if(p.defaultPrevented||!p.clipboardData)return;const w=n.current;if(!w)return;const x=Dt(w);if(x){const h=Ut(x);if(h.length===0)return;p.clipboardData.setData("text/plain",kr(h)),p.preventDefault()}};return document.addEventListener("copy",f),()=>document.removeEventListener("copy",f)},[n,r]),c.useEffect(()=>{if(r)return;const f=n.current,p=(f==null?void 0:f.ownerDocument)??document,w=x=>{const h=n.current;if(x.button!==0||!h||s(x.target))return;const b=p.getSelection(),m=Dt(h,b),y=Rs(h,x.target);m&&m===y&&(b==null||b.removeAllRanges())};return p.addEventListener("mousedown",w,!0),()=>p.removeEventListener("mousedown",w,!0)},[n,r,s]),c.useEffect(()=>{if(r)return;const f=n.current,p=(f==null?void 0:f.ownerDocument)??document,w=p.defaultView??window;if(!Ar(w))return;let x=null,h=null;const b=y=>{const S=n.current,_=(S==null?void 0:S.closest(".session-page"))??null,C=(S==null?void 0:S.ownerDocument.body)??null;x&&x!==_&&x.classList.remove(wt),h&&h!==C&&h.classList.remove(wt),x=_,h=C,_==null||_.classList.toggle(wt,y),C==null||C.classList.toggle(wt,y&&_!==null)},m=()=>{const y=n.current;b(y?Dt(y,y.ownerDocument.getSelection())!==null:!1)};return p.addEventListener("selectionchange",m),p.addEventListener("pointerup",m,!0),p.addEventListener("keyup",m,!0),w.addEventListener("blur",m),()=>{p.removeEventListener("selectionchange",m),p.removeEventListener("pointerup",m,!0),p.removeEventListener("keyup",m,!0),w.removeEventListener("blur",m),x==null||x.classList.remove(wt),h==null||h.classList.remove(wt)}},[n,r]),c.useEffect(()=>{var k;if(r||e===0){a(null);return}const f=((k=n.current)==null?void 0:k.ownerDocument)??document,p=f.defaultView??window;let w,x=!1;const h=()=>{x=!1,w!==void 0&&(p.clearTimeout(w),w=void 0)},b=g=>{if(o.current&&!g){a(null);return}const E=n.current,A=E==null?void 0:E.ownerDocument.getSelection(),B=u();if(!E||!A||!B){a(null);return}const T=(t==null?void 0:t(B))??e;if(T===0){a(null);return}a(pu(E,A,B,T,g))},m=()=>{w=p.setTimeout(()=>{w=void 0,x&&(x=!1,b(),m())},uu)},y=()=>{if(w!==void 0){x=!0;return}b(),m()},S=()=>{const g=f.getSelection();if(!g||g.isCollapsed||g.rangeCount===0){h();return}y()},_=g=>{const E=n.current;if(g.target instanceof Element&&g.target.closest('[data-selection-action-cluster="true"]')){o.current=!1,h();return}if(h(),!E||!Rs(E,g.target)){o.current=!1;return}o.current=!0,a(null)},C=g=>{const E=o.current;o.current=!1,E&&(h(),p.setTimeout(()=>{h(),b({clientX:g.clientX,clientY:g.clientY})},0))},j=()=>{o.current=!1,h()},v=()=>{if(o.current){h();return}const g=f.getSelection();if(!g||g.isCollapsed||g.rangeCount===0){h(),a(null);return}y()};return f.addEventListener("selectionchange",v),f.addEventListener("pointerdown",_,!0),f.addEventListener("pointercancel",j,!0),f.addEventListener("pointerup",C,!0),p.addEventListener("resize",S),p.addEventListener("scroll",S,!0),()=>{h(),f.removeEventListener("selectionchange",v),f.removeEventListener("pointerdown",_,!0),f.removeEventListener("pointercancel",j,!0),f.removeEventListener("pointerup",C,!0),p.removeEventListener("resize",S),p.removeEventListener("scroll",S,!0)}},[e,u,n,t,r]),{captureSnapshot:u,dismiss:d,state:l}}const an=Lt(Ve.selectionQuoteActionEnabled,!0),un=Lt(Ve.selectionTextCopyActionEnabled,!1),dn=Lt(Ve.selectionSourceCopyActionEnabled,!0),fn=Lt(Ve.selectionRichCopyActionEnabled,!1),hn=Lt(Ve.selectionNewSessionActionEnabled,!1);function wu(){const e=c.useSyncExternalStore(an.subscribe,an.read,an.read),t=c.useSyncExternalStore(un.subscribe,un.read,un.read),n=c.useSyncExternalStore(dn.subscribe,dn.read,dn.read),r=c.useSyncExternalStore(fn.subscribe,fn.read,fn.read),s=c.useSyncExternalStore(hn.subscribe,hn.read,hn.read);return{selectionQuoteActionEnabled:e,setSelectionQuoteActionEnabled:an.set,selectionTextCopyActionEnabled:t,setSelectionTextCopyActionEnabled:un.set,selectionSourceCopyActionEnabled:n,setSelectionSourceCopyActionEnabled:dn.set,selectionRichCopyActionEnabled:r,setSelectionRichCopyActionEnabled:fn.set,selectionNewSessionActionEnabled:s,setSelectionNewSessionActionEnabled:hn.set}}function Gn(e){return e.snippets.some(t=>t.sourceElement.closest(`[${Xo}="true"]`)!==null)}function vu(e){return kr(e.snippets)}function xu(e){return e.snippets.map(t=>t.markdown).join(`
|
|
16
|
+
|
|
17
|
+
`)}function Xs(e){return e.snippets.some(t=>!t.isLiteral&&t.markdown!==t.selectedText)}function yu(e){return e.anchors.map(t=>t.quotedText).join(`
|
|
18
|
+
|
|
19
|
+
`)}function bu(e){const t=e.snippets.map(o=>o.sourceLocation);if(t.some(o=>o===void 0))return null;const n=t[0];if(!n||t.some(o=>(o==null?void 0:o.projectId)!==n.projectId||o.filePath!==n.filePath))return null;const r=Math.min(...t.map(o=>(o==null?void 0:o.lineStart)??n.lineStart)),s=Math.max(...t.map(o=>(o==null?void 0:o.lineEnd)??n.lineEnd));return`${n.filePath}:${r}${s>r?`-${s}`:""}`}function Su(e){const t=yu(e),n=bu(e);return n?`${n}
|
|
20
|
+
|
|
21
|
+
${t}`:t}function ku({applyQuoteAnchors:e,applyQuoteFromSelection:t,containerRef:n,inert:r,isInteractiveTarget:s,onQuoteSelection:o,onStartNewSessionFromSelection:l}){const a=c.useRef(null),{selectionQuoteActionEnabled:d,selectionTextCopyActionEnabled:u,selectionSourceCopyActionEnabled:f,selectionRichCopyActionEnabled:p,selectionNewSessionActionEnabled:w}=wu(),{t:x}=Ie(),{menu:h,openAt:b}=Mo(x,{dismiss:x("sessionDismissSelectionActions"),menu:x("sessionSelectionActionMenu")}),m=c.useMemo(()=>{const P=[];return u&&P.push({kind:"text",label:x("sessionCopySelectionText")}),f&&P.push({kind:"source",label:x("sessionCopySelectionSource")}),p&&P.push({kind:"rich",label:x("sessionCopySelectionRich")}),d&&o&&P.push({kind:"quote",label:x("sessionQuoteSelection")}),w&&l&&P.push({kind:"newSession",label:x("sessionNewSessionFromSelection")}),P},[o,l,w,d,p,f,u,x]),y=c.useCallback(P=>{const M=Xs(P),F=Gn(P);return m.filter($=>($.kind!=="source"||M)&&($.kind!=="quote"||!F))},[m]),S=c.useCallback(P=>y(P).length,[y]),_=gu({actionCount:m.length,getActionCount:S,containerRef:n,inert:r,isInteractiveTarget:s});c.useEffect(()=>{if(r||!o||!d)return;const P=M=>{if(M.defaultPrevented||M.isComposing||M.ctrlKey||M.metaKey||M.altKey||M.key.length!==1||s(M.target))return;const F=_.captureSnapshot();F&&Gn(F)||t(M.key)&&(_.dismiss(),M.preventDefault(),M.stopPropagation())};return window.addEventListener("keydown",P,!0),()=>window.removeEventListener("keydown",P,!0)},[t,_.captureSnapshot,_.dismiss,r,s,o,d]);const C=c.useCallback((P,M)=>{if(P==="text"){const $=vu(M);return $?(we($),!0):!1}if(P==="quote"){const $=e(M.anchors);return $&&_.dismiss(),$}if(P==="source"){const $=xu(M);return $?(we($),!0):!1}if(P==="newSession")return l?(l(Su(M)),!0):!1;const F=_l(M.root,M.ranges);return F?(ko(F.html,F.text),!0):!1},[e,_.dismiss,l]),j=c.useCallback(P=>{const M=[{label:x("sessionCopySelectionText"),onSelect:()=>{C("text",P)}}];return Xs(P)&&M.push({label:x("sessionCopySelectionSource"),onSelect:()=>{C("source",P)}}),o&&!Gn(P)&&M.push({label:x("sessionQuoteSelection"),onSelect:()=>{C("quote",P)}}),l&&M.push({label:x("sessionNewSessionFromSelection"),onSelect:()=>{C("newSession",P)}}),M},[C,o,l,x]);c.useEffect(()=>{if(r)return;const P=n.current,M=P==null?void 0:P.ownerDocument;if(!P||!M)return;const F=M.defaultView??window,$=I=>{if(I.defaultPrevented||s(I.target)||hu(I,F))return;const H=_.captureSnapshot();!H||!mu(H,I.clientX,I.clientY)||(I.preventDefault(),I.stopPropagation(),b(I.clientX,I.clientY,M.activeElement instanceof HTMLElement?M.activeElement:null,j(H)))};return M.addEventListener("contextmenu",$),()=>M.removeEventListener("contextmenu",$)},[_.captureSnapshot,n,r,s,b,j]);const v=_.state,k=v!==null&&v.snapshot.root!==n.current,g=v!=null&&v.docked&&typeof document<"u"?document.querySelector("[data-selection-actions-mobile-slot]"):null,E=(v==null?void 0:v.docked)===!0&&g!==null,A=v?i.jsx(su,{docked:E,mobile:v.mobile,placement:v.side,style:E?void 0:{top:`${v.top}px`,left:`${v.left}px`},children:y(v.snapshot).map(({kind:P,label:M})=>i.jsx(ru,{kind:P,label:M,onPointerDown:()=>{a.current=null},onPointerUp:F=>{v.mobile&&(F.preventDefault(),C(P,v.snapshot)&&(a.current=P))},onClick:()=>{if(a.current===P){a.current=null;return}C(P,v.snapshot)}},P))}):null,B=E&&A?Ht.createPortal(A,g):null,T=v&&!E?k?v.snapshot.root.isConnected?Ht.createPortal(A,v.snapshot.root):null:A:null;return{dismiss:_.dismiss,floatingSelectionActions:T,mobileSelectionActions:B,selectionContextMenu:h}}function Cu({containerRef:e,composerDraftSignal:t,onQuoteSelection:n,quoteClearSignal:r}){const s=c.useRef(null),o=c.useRef([]),[l,a]=c.useState([]),d=c.useRef(null),u=c.useRef(null),f=c.useRef(t),p=c.useRef(()=>{}),w=c.useCallback(C=>{if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(C.length===0){CSS.highlights.delete("comment-tint");return}const j=C.filter(v=>fc(v,e.current)).map(hc).filter(v=>v!==null);if(j.length===0){CSS.highlights.delete("comment-tint");return}CSS.highlights.set("comment-tint",new Highlight(...j))},[e]),x=c.useCallback(()=>{var C;(C=u.current)==null||C.call(u),u.current=null},[]),h=c.useCallback(()=>{var C;(C=d.current)==null||C.disconnect(),d.current=null},[]),b=c.useCallback(C=>{var E;h();const j=Array.from(new Set(C.map(A=>A.sourceElement).filter(A=>A.isConnected))),v=j[0],k=(E=v==null?void 0:v.ownerDocument.defaultView)==null?void 0:E.MutationObserver;if(!v||!k)return;const g=new k(()=>{w(o.current)});for(const A of j)g.observe(A,{childList:!0,characterData:!0,subtree:!0});d.current=g},[w,h]),m=c.useCallback(()=>{x();const C=f.current;!C||o.current.length===0||(u.current=C.subscribeDraftChanges(j=>{p.current(j)}))},[x]),y=c.useCallback(C=>{const j=o.current;C!==j&&(o.current=C,a(Array.from(new Set(C.map(v=>v.renderId).filter(v=>v!==void 0)))),w(C),b(C),j.length===0&&C.length>0?m():j.length>0&&C.length===0&&x())},[w,b,m,x]);p.current=C=>{const j=o.current;if(j.length===0)return;const v=s.current;if(v===null&&C.metadata.mayAffectQuoteAnchors===!1)return;s.current=null;const k=mc(v??C.text),g=j.filter(E=>pc(k,E));g.length!==j.length&&y(g)},c.useEffect(()=>(f.current=t,m(),x),[t,m,x]),c.useEffect(()=>()=>{x(),h(),w([])},[w,h,x]);const S=c.useCallback((C,j="")=>{var g,E;if(!n||C.length===0)return!1;const v=C.map(A=>{const B=A.sourceLocation;return B?`re: ${B.filePath}:${B.lineStart}
|
|
22
|
+
${A.quotedText}`:A.quotedText}).join(`
|
|
23
|
+
|
|
24
|
+
`),k=n(j?`${v}
|
|
25
|
+
${j}`:`${v}
|
|
26
|
+
`);return k===null?!1:(s.current=k,y([...o.current,...C]),(E=(g=e.current)==null?void 0:g.ownerDocument.getSelection())==null||E.removeAllRanges(),!0)},[e,n,y]),_=c.useCallback((C="")=>{const j=e.current;if(!j)return!1;const v=Dt(j);if(!v)return!1;const k=Ut(v).map(kn);return S(k,C)},[S,e]);return c.useEffect(()=>{r>0&&y([])},[r,y]),{anchoredRenderIds:l,applyQuoteAnchors:S,applyQuoteFromSelection:_}}function Jo({containerRef:e,inert:t,onQuoteSelection:n,onStartNewSessionFromSelection:r,composerDraftSignal:s,quoteClearSignal:o,isInteractiveTarget:l}){const{quoteReplyButtonMode:a}=Go(),d=Cu({containerRef:e,composerDraftSignal:s,onQuoteSelection:n,quoteClearSignal:o}),u=ku({...d,containerRef:e,inert:t,isInteractiveTarget:l,onQuoteSelection:n,onStartNewSessionFromSelection:r}),f=c.useCallback(p=>{d.applyQuoteAnchors([p])&&u.dismiss()},[d.applyQuoteAnchors,u.dismiss]);return{anchoredRenderIds:d.anchoredRenderIds,alwaysShowQuoteCircles:a==="paragraph-always",paragraphQuoteCirclesEnabled:a!=="block",handleQuoteTextBlock:f,mobileSelectionActions:u.mobileSelectionActions,floatingSelectionActions:u.floatingSelectionActions,selectionContextMenu:u.selectionContextMenu}}const _p=Jo;function Ys(e,t){const n=new Map(t.map(r=>[r.id,r.text]));return e.filter(r=>n.get(r.id)!==r.text)}function Lu({active:e,storageKey:t,sendComment:n}){const[r,s]=c.useState([]),[o,l]=c.useState(null),[a,d]=c.useState(new Set),[u,f]=c.useState(!1),p=c.useRef(r),w=c.useRef(o),x=c.useRef(a),h=c.useRef(n),b=c.useRef(t);w.current=o,x.current=a,h.current=n,b.current=t,c.useEffect(()=>{var A;const g=t?Ks(t):[];p.current=g,w.current=((A=g.at(-1))==null?void 0:A.id)??null,s(g),l(w.current);const E=new Set;x.current=E,d(E),f(!1)},[t]),c.useEffect(()=>{if(t)return ml(t,()=>{const g=Ks(t);p.current=g,s(g)})},[t]);const m=c.useCallback(()=>{const g=b.current;g&&zn(g,p.current),s(p.current)},[]),y=c.useCallback(g=>{p.current=g,s(g)},[]),S=c.useCallback(g=>{w.current=g,l(g)},[]),_=c.useCallback(g=>{f(!1);const E=p.current.find(P=>P.id===w.current);if((E==null?void 0:E.location)===g.location&&E.quote===g.quote)return;const A=p.current.filter(P=>P.id!==w.current||P.text.trim()),B=A.find(P=>P.location===g.location&&P.quote===g.quote);if(B){y(A),S(B.id);return}const T={...g,id:bo(),text:""};y([...A,T]),S(T.id)},[y,S]),C=c.useCallback((g,E)=>{f(!1),p.current=p.current.map(A=>A.id===g?{...A,text:E}:A)},[]),j=c.useCallback(g=>{f(!1),y(p.current.filter(E=>E.id!==g)),w.current===g&&S(null)},[y,S]),v=c.useCallback(async g=>{const E=p.current.find($=>$.id===g),A=h.current;if(!(E!=null&&E.text.trim())||!A||x.current.has(g))return!1;const B=new Set(x.current).add(g);x.current=B,d(B),m();const T=await A(Qo(E)),P=new Set(x.current);if(P.delete(g),x.current=P,d(P),!T)return f(!0),!1;const M=Ys(p.current,[E]);y(M),w.current===g&&!M.some($=>$.id===g)&&S(null);const F=b.current;return F&&zn(F,M),f(!1),!0},[m,y,S]),k=c.useCallback(async()=>{const g=h.current,E=p.current.filter($=>$.text.trim()&&!x.current.has($.id));if(E.length===0)return m(),!0;if(!g)return m(),!1;const A=new Set(E.map($=>$.id)),B=new Set([...x.current,...A]);x.current=B,d(B),m();const T=await g(cu(E)),P=new Set(x.current);for(const $ of A)P.delete($);if(x.current=P,d(P),!T)return f(!0),!1;const M=Ys(p.current,E);y(M),w.current&&A.has(w.current)&&!M.some($=>$.id===w.current)&&S(null);const F=b.current;return F&&zn(F,M),f(!1),!0},[m,y,S]);return c.useEffect(()=>{if(e)return()=>{k()}},[e,k]),{activeDraft:r.find(g=>g.id===o)??null,cancel:j,error:u,flush:k,open:_,persist:m,sendOne:v,sendingIds:a,update:C}}function _u(e){return e.replace(/<\/span>\r?\n(?=<span class="line(?:\s|"))/g,"</span>")}function Eu(e){const t=[];let n=0;const r=/\r\n|\r|\n/g;for(let s=r.exec(e);s;s=r.exec(e)){const o=s.index;t.push({start:n,end:o,text:e.slice(n,o)}),n=s.index+s[0].length}return t.push({start:n,end:e.length,text:e.slice(n)}),t}function Zo(e,t,n){e.setAttribute(zl,String(t)),e.setAttribute(Gl,String(n))}function ju(e,t){const n=new Map,r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);let s=0;for(let o=r.nextNode();o;o=r.nextNode()){const l=o,a=l.data;if(t.text.slice(s,s+a.length)!==a)return;const d=t.start+s,u=d+a.length;for(let f=l.parentElement;f&&f!==e;f=f.parentElement){const p=n.get(f);n.set(f,{start:p?Math.min(p.start,d):d,end:p?Math.max(p.end,u):u})}s+=a.length}if(s===t.text.length)for(const[o,l]of n)Zo(o,l.start,l.end)}function ei(e,t){const n=_u(e);return t===void 0||typeof document>"u"?n:Ru(n,t)}function Ru(e,t){const n=document.createElement("template");n.innerHTML=e;const r=Array.from(n.content.querySelectorAll("code .line")),s=Eu(t);for(let o=0;o<r.length;o+=1){const l=r[o],a=s[o];!l||!a||l.textContent!==a.text||(Zo(l,a.start,a.end),ju(l,a))}return n.innerHTML}function Mu(e,t){if(typeof document>"u")return null;const n=document.createElement("template");if(n.innerHTML=e,!Array.from(n.content.querySelectorAll("code .line[data-line]")).some(o=>Number(o.dataset.line)===t))return null;const s=o=>{const l=n.content.cloneNode(!0);for(const d of l.querySelectorAll("code .line[data-line]")){const u=Number(d.dataset.line);(!Number.isInteger(u)||!o(u))&&d.remove()}const a=document.createElement("div");return a.append(l),a.innerHTML};return{before:s(o=>o<=t),after:s(o=>o>t)}}function ti(e){return c.useMemo(()=>({__html:e}),[e])}const Au="_container_1s663_7",Pu={container:Au};function Tu({html:e,source:t,className:n,...r}){const s=c.useMemo(()=>ei(e,t),[e,t]),o=ti(s);return i.jsx("div",{...r,className:`shiki-container ${Pu.container}${n?` ${n}`:""}`,dangerouslySetInnerHTML:o})}function Fu({value:e,title:t,className:n,disabled:r=!1,icon:s="copy"}){const[o,l]=c.useState(!1),[a,d]=c.useState(!1);return c.useEffect(()=>{if(!o)return;const u=setTimeout(()=>l(!1),1200);return()=>clearTimeout(u)},[o]),i.jsx("button",{type:"button",className:`copy-button ${o?"copied":""} ${n??""}`,title:t,"aria-label":t,disabled:r||a,onClick:async u=>{u.stopPropagation(),d(!0);const f=typeof e=="function"?await kt(e()):await we(e);d(!1),f&&l(!0)},children:o?i.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("polyline",{points:"20 6 9 17 4 12"})}):i.jsx(Nu,{icon:s})})}function Nu({icon:e}){const t={width:13,height:13,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};return e==="path"?i.jsxs("svg",{...t,"aria-hidden":"true",children:[i.jsx("path",{d:"M3 7h6l2 2h10v9H3z"}),i.jsx("path",{d:"M8 14h8"}),i.jsx("path",{d:"m13 11 3 3-3 3"})]}):e==="content"?i.jsxs("svg",{...t,"aria-hidden":"true",children:[i.jsx("path",{d:"M6 2h8l4 4v16H6z"}),i.jsx("path",{d:"M14 2v5h5"}),i.jsx("path",{d:"M9 12h6M9 16h6"})]}):i.jsxs("svg",{...t,"aria-hidden":"true",children:[i.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),i.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}const $u="_root_eaud3_1",Bu="_commit_eaud3_14",Du="_age_eaud3_23",Iu="_dirty_eaud3_27",Ou="_uncommitted_eaud3_33",vt={root:$u,commit:Bu,age:Du,dirty:Iu,uncommitted:Ou};function Pr({projectId:e,path:t,rev:n,origPath:r,dirtyLabel:s,uncommittedLabel:o,className:l}){const a=xr(),d=Sr(a),u=_t(),f=lt(d,cc),p=`${a}\0${e}\0${t}\0${n??""}\0${r??""}`,[w,x]=c.useState({identity:p,value:null}),h=w.identity===p?w.value:null,[b,m]=c.useState(null);if(c.useEffect(()=>{if(!f||!e||!t)return;let C=!1;return te.getGitFileRevision(e,{path:t,rev:n,origPath:r}).then(j=>{C||x({identity:p,value:j})}).catch(()=>{C||x({identity:p,value:null})}),()=>{C=!0}},[p,r,t,e,n,f]),!f||!(h!=null&&h.isGitRepo))return null;if(!h.commit)return i.jsx("span",{className:`${vt.root} ${vt.uncommitted} ${l??""}`,children:o});const y=new URLSearchParams({projectId:e,rev:h.commit.hash,commitFile:n?t:r??t}),S=at(`${u}/git-status?${y.toString()}`),_=Uu(h.commit);return i.jsxs("span",{className:`${vt.root} ${l??""}`,children:[i.jsx("a",{className:vt.commit,href:S,title:_,onContextMenu:C=>{C.preventDefault(),C.stopPropagation(),m({identity:p,x:C.clientX,y:C.clientY})},children:h.commit.shortHash}),i.jsxs("span",{className:vt.age,children:["(",Hu(h.commit.authorDate),")"]}),h.dirty&&i.jsx("span",{className:vt.dirty,children:s}),(b==null?void 0:b.identity)===p&&i.jsx(Ec,{x:b.x,y:b.y,onClose:()=>m(null),onOpen:()=>window.open(S,"_blank","noopener,noreferrer"),fileTarget:{projectId:e,path:n?t:r??t,rev:h.commit.hash}})]})}function Hu(e,t=Date.now()){const n=Math.max(0,Math.floor((t-new Date(e).getTime())/1e3));if(n<60)return"now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const s=Math.floor(r/60);if(s<24)return`${s}h ago`;const o=Math.floor(s/24);return o<30?`${o}d ago`:o<365?`${Math.floor(o/30)}mo ago`:`${Math.floor(o/365)}y ago`}function Uu(e){const t=new Date(e.authorDate).toLocaleString(),n=`${e.message}${e.messageTruncated?`
|
|
27
|
+
...`:""}`;return`${e.authorName}
|
|
28
|
+
${t}
|
|
29
|
+
|
|
30
|
+
${n}`}function Xn(e,t,n,r){if(r){const s=Wt(r,{filePath:n});if(!s)return!1;e.setAttribute("href",s),e.dataset.publicShareFileLink="true"}else e.setAttribute("href",Kt({projectId:t,filePath:n})),e.dataset.yaPrivateProjectFileLink="true";return e.dataset.yaResource="project-file",e.dataset.yaProjectId=t,e.dataset.yaPath=n,e.title=`${n}
|
|
31
|
+
Click to view, or use a browser link gesture to open this file`,!0}function Vu(e,t,n,r,s={projectPaths:!0,mentionedDirectories:!0}){var h,b;const o=qu.test(e);if(!e||!(t!=null&&t.length)&&s.projectPaths&&!o&&!e.includes("data-ya-directory-file")||!n||typeof document>"u")return{changed:!1,html:e};const l=new Map(t==null?void 0:t.map(m=>[m.text,m.filePath])),a=document.createElement("template");a.innerHTML=e;let d=!1;const u=()=>(o&&zu(a.content)&&(d=!0),{changed:d,html:d?a.innerHTML:e});if(!s.projectPaths&&!r){for(const m of a.content.querySelectorAll('a[data-ya-resource="project-file"], a[data-ya-resource="local-file"], a[data-fixed-font-file-path]'))m.replaceWith(...m.childNodes),d=!0;return{changed:d,html:d?a.innerHTML:e}}const f=new Set;if(s.mentionedDirectories&&!r)for(const m of a.content.querySelectorAll("[data-ya-directory-file]")){const y=m.dataset.yaDirectoryFile;if(!y)continue;const S=m.closest("a")??m.querySelector("a")??document.createElement("a");Xn(S,n,y,null),S.contains(m)?m.textContent=y:(S.textContent=y,m.replaceChildren(S)),S.setAttribute("href",Kt({projectId:n,filePath:y,lineNumber:Number(S.dataset.yaLine)||void 0,columnNumber:Number(S.dataset.yaColumn)||void 0})),f.add(S),d=!0}if(l.size===0)return u();for(const m of a.content.querySelectorAll('a[data-ya-resource="project-file"]')){if(f.has(m))continue;const y=l.get(((h=m.textContent)==null?void 0:h.trim())??"");y&&Xn(m,n,y,r)&&(d=!0)}const p=document.createTreeWalker(a.content,NodeFilter.SHOW_TEXT),w=[];let x=p.nextNode();for(;x;)x instanceof Text&&!((b=x.parentElement)!=null&&b.closest("a,button,script,style,textarea"))&&w.push(x),x=p.nextNode();for(const m of w){const y=No(m.data).filter(S=>l.has(S.text));for(let S=y.length-1;S>=0;S-=1){const _=y[S];if(!_)continue;const C=document.createElement("a");if(!Xn(C,n,l.get(_.text),r))continue;m.splitText(_.end);const j=m.splitText(_.start);j.replaceWith(C),C.append(j),d=!0}}return u()}const qu=/data-ya-line="|:\d+(?:[-:]\d+)?(?:<\/code>)?<\/a>|<\/a>:\d/,Wu='a[data-ya-resource="project-file"], a[data-ya-resource="local-file"], a[data-fixed-font-file-path]',Ku=[["data-ya-line","line","lineNumber"],["data-ya-line-end","lineEnd","lineEnd"],["data-ya-column","column","columnNumber"]];function zu(e){let t=!1;for(const n of e.querySelectorAll(Wu)){const r=Gu(n)??Xu(n);r&&(n.after(r),t=!0)}return t}function Gu(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let n=t.nextNode();for(;n&&!(n instanceof Text&&n.data);)n=t.nextNode();if(!(n instanceof Text)||n.data!==e.textContent)return null;const r=Oc(n.data);if(!r)return null;const{position:s}=r,o=e.dataset.yaPath??e.dataset.fixedFontFilePath??"";if(!(e.dataset.yaLine?Number(e.dataset.yaLine)===s.lineNumber:!o.endsWith(s.text)))return null;const a=n.splitText(r.path.length);e.replaceWith(...e.childNodes),n.replaceWith(e),e.append(n);const d=ni(e,s);return d.append(a),ri(e,null),d}function Xu(e){const t=e.nextSibling;if(e.dataset.yaLine||!(t instanceof Text))return null;const n=Hc(t.data);if(!n)return null;t.splitText(n.text.length);const r=ni(e,n);return r.append(t),r}function ni(e,t){const n=e.cloneNode(!1);return ri(n,t),n}function ri(e,t){const n=e.getAttribute("href"),r=n?new URL(n,"http://localhost"):null;for(const[s,o,l]of Ku){const a=t==null?void 0:t[l];a===void 0?(e.removeAttribute(s),r==null||r.searchParams.delete(o)):(e.setAttribute(s,String(a)),r==null||r.searchParams.set(o,String(a)))}n&&r&&e.setAttribute("href",n.startsWith("/")?`${r.pathname}${r.search}${r.hash}`:r.href)}const Qs=8;function Js(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Yu(){if(typeof window>"u")return Qs;const e=window.__RENDER_PROFILE__;if(e&&typeof e=="object"){const t=e.thresholdMs;if(typeof t=="number"&&Number.isFinite(t))return Math.max(0,t)}return Qs}function Qu(){return Co()||typeof window<"u"&&window.__RENDER_PROFILE__!==void 0}function si(e,t,n){if(!Qu())return n();const r=Js();try{return n()}finally{const s=Js()-r;if(s>=Yu()){const o=typeof t=="function"?t():t,l={name:e,durationMs:Math.round(s*10)/10,...o};Uc("render-profile",l),typeof window<"u"&&window.__RENDER_PROFILE__!==void 0&&!Co()&&console.log("[RenderProfile]",l)}}}function fr(e,t){return!e||!t?null:{scrollRoot:e,initialOffset:t.getBoundingClientRect().top-e.getBoundingClientRect().top}}function oi(e,t){if(!e||!t)return;const r=t.getBoundingClientRect().top-e.scrollRoot.getBoundingClientRect().top-e.initialOffset;Math.abs(r)>1&&(e.scrollRoot.scrollTop+=r)}function Ju(e,t){const n=c.useRef(null),r=c.useRef(null),s=c.useCallback(()=>{const o=n.current;if(o){let l=o.parentElement;for(;l;){const{overflowY:a}=window.getComputedStyle(l);if(a==="auto"||a==="scroll")break;l=l.parentElement}r.current=fr(l,o)}t()},[t]);return c.useLayoutEffect(()=>{const o=r.current;o&&(r.current=null,oi(o,n.current))},[e]),{btnRef:n,handleClick:s}}function Zu(e){const t=e.trim().replace(/^#\s*/,"");return/^acli: 1(?:\s+\+?[a-z][a-z0-9-]*)*$/.test(t)||/^acli-capabilities: (?:[a-z][a-z0-9-]*\/1)(?:\s+[a-z][a-z0-9-]*\/1)*$/.test(t)}function ed(e){JSON.parse(e);const t=e.match(/"(?:\\.|[^"\\])*"|[{}[\],:]|[^\s{}[\],:]+/g)??[];let n=0,r="";const s=()=>`
|
|
32
|
+
${" ".repeat(n)}`;return t.forEach((o,l)=>{o==="{"||o==="["?(r+=o,n++,t[l+1]!==(o==="{"?"}":"]")&&(r+=s())):o==="}"||o==="]"?(n--,t[l-1]!==(o==="}"?"{":"[")&&(r+=s()),r+=o):o===","?r+=o+s():o===":"?r+=": ":r+=o}),r+(e.endsWith(`
|
|
33
|
+
`)?`
|
|
34
|
+
`:"")}function td(e){const t=new na,n=[...t.append(e),...t.finish()];let r;return n.map(s=>{var l;const o=(l=/^\s*(`{3,}|~{3,})/.exec(s))==null?void 0:l[1];if(o)return r?o[0]===r[0]&&o.length>=r.length&&(r=void 0):r=o,{kind:"text",source:s,text:s};if(!r&&Zu(s))return{kind:"metadata",source:s,text:s};if(!r&&/^[\s]*[[{]/.test(s))try{return{kind:"json",source:s,text:ed(s)}}catch{}return{kind:"text",source:s,text:s}})}const Zs=new Map;function ii(e){let t=Zs.get(e);return t||(t=So(`yep-anywhere-session-last-file:${e}`,"",n=>n),Zs.set(e,t)),t}function li(e,t){ii(e).set(t)}function Ep(e){const t=ii(e);return c.useSyncExternalStore(t.subscribe,t.read,()=>"")}const nd="yep-anywhere-session-open-file:",Cn=new Map;function hr(e){return`${nd}${e}`}function Tn(e){try{const t=sessionStorage.getItem(hr(e));if(!t)return null;const n=JSON.parse(t);return typeof n.route!="string"||!n.route?null:{route:n.route,minimized:n.minimized===!0,scrollTop:typeof n.scrollTop=="number"&&n.scrollTop>=0?n.scrollTop:void 0}}catch{return null}}function Ln(e,t){try{t?sessionStorage.setItem(hr(e),JSON.stringify(t)):sessionStorage.removeItem(hr(e))}catch{}}function rd(e,t,n){const r=Tn(e);Cn.set(e,t),Ln(e,(r==null?void 0:r.route)===n?r:{route:n,minimized:!1})}function sd(e,t,n){if(Cn.get(e)!==t)return;const r=Tn(e);!r||r.scrollTop===n||Ln(e,{...r,scrollTop:n})}qc(()=>{const e=Wc();for(const[t,n]of Cn){if((e==null?void 0:e.id)===n){const r=Tn(t);r&&r.minimized!==e.minimized&&Ln(t,{...r,minimized:e.minimized});continue}Cn.delete(t),Ln(t,null)}});const od="_root_e552i_1",id="_link_e552i_7",ld="_inline_e552i_17",cd="_cluster_e552i_21",ad="_inlineLink_e552i_50",ud="_header_e552i_60",dd="_headerLink_e552i_67",fd="_active_e552i_74",Qe={root:od,link:id,inline:ld,cluster:cd,inlineLink:ad,header:ud,headerLink:dd,active:fd};function hd({children:e,className:t}){return i.jsx("span",{className:`${Qe.cluster} ${t??""}`,children:e})}function ut({basePath:e="",diffMode:t,filePath:n,lineEnd:r,lineNumber:s,projectId:o,viewMode:l}){return`${e}${Kt({diffMode:t,filePath:n,lineEnd:r,lineNumber:s,projectId:o,viewMode:l})}`}function ci({activeView:e="source",availability:t,className:n,onSelect:r,projectId:s,variant:o}){const{t:l}=Ie(),a=_t(),d=t.relativePath;if(!t.supported||!d||!t.worktreeFile&&!t.cumulativeFile)return null;const u=w=>at(ut({basePath:a,diffMode:w,filePath:d,projectId:s})),f=w=>x=>{x.stopPropagation(),!(!r||x.button!==0||x.metaKey||x.ctrlKey||x.shiftKey||x.altKey)&&(x.preventDefault(),r(w))},p=w=>[Qe.link,o==="header"?Qe.headerLink:Qe.inlineLink,e===w?Qe.active:null].filter(Boolean).join(" ");return i.jsxs("span",{className:[Qe.root,o==="header"?Qe.header:Qe.inline,n].filter(Boolean).join(" "),"data-file-diff-links":o,role:"group","aria-label":l("fileDiffViews"),children:[t.worktreeFile&&i.jsx("a",{className:p("worktree"),href:u("worktree"),"aria-current":e==="worktree"?"page":void 0,"aria-label":l("fileDiffVsHeadTitle",{path:d}),title:l("fileDiffVsHeadTitle",{path:d}),onClick:f("worktree"),children:l("fileDiffVsHead")}),t.cumulativeFile&&i.jsx("a",{className:p("cumulative"),href:u("cumulative"),"aria-current":e==="cumulative"?"page":void 0,"aria-label":l("fileDiffVsParentTitle",{path:d}),title:l("fileDiffVsParentTitle",{path:d}),onClick:f("cumulative"),children:l("fileDiffVsParent")})]})}function md(e,t){const n=document.createElement("template");return n.innerHTML=e,Cl(n.content,t),n.innerHTML}function Tr(e){return{loadFile:async(t,n,r,s,o,l)=>{const a={};return r&&(a.highlight="true"),s!==void 0&&(a.line=String(s)),o!==void 0&&(a.lineEnd=String(o)),l==="range"&&(a.view="range"),await Sl({relayUrl:e.relayUrl,relayUsername:e.relayUsername,path:kl(e,"content",n,a)})},getRawFileUrl:()=>null,fetchRawFileBlob:(t,n)=>Es(e,t,n),createMediaSource:t=>({buildApiPath:n=>bl(e,n),fetchBlob:n=>Es(e,t??null,n)}),transformRenderedMarkdownHtml:t=>md(t,e)}}const pd="_paneViewer_w9qdr_1",gd="_nestedPaneViewer_w9qdr_9",wd="_fileViewerModal_w9qdr_15",vd="_fileViewerModalCompact_w9qdr_29",mn={paneViewer:pd,nestedPaneViewer:gd,fileViewerModal:wd,fileViewerModalCompact:vd};function xd({className:e,filePath:t,projectId:n}){const r=Ko(n,_n(n,t)),s=br(),o=An(),l=c.useId(),[a,d]=c.useState(),u=r.relativePath;return!r.supported||!u?null:i.jsxs(i.Fragment,{children:[i.jsx(ci,{availability:r,className:e,projectId:n,variant:"inline",onSelect:f=>{f!=="source"&&(s?ui({id:l,sessionId:s,projectId:n,filePath:u,diffMode:f,quoteReply:o}):d(f))}}),a&&i.jsx(Et,{projectId:n,filePath:u,diffMode:a,onClose:()=>d(void 0)})]})}function yd({filePath:e}){return i.jsx(Gc,{text:e,label:"Copy path",copiedLabel:"Copied path",className:"file-path-copy",onClick:t=>t.stopPropagation()})}function ai(e){if(!jo(e))return null;try{const t=Ro(e);return _o(t)}catch{return null}}function _n(e,t){const n=ai(e),r=Lr(t,n);if(r!==null)return r;const s=Vt(t);return!(s.startsWith("/")||/^[a-zA-Z]:\//.test(s))&&t.includes("\\")?Vt(t):t}function Fr(e,t){return e===void 0?"":t!==void 0&&t>e?`:${e}-${t}`:`:${e}`}function ui({id:e,sessionId:t,projectId:n,filePath:r,lineNumber:s,lineEnd:o,viewMode:l="full",diffMode:a,presentation:d,quoteReply:u,source:f,openInNewTabUrl:p}){const w=Fr(s,o);li(t,ut({projectId:n,filePath:r,lineNumber:s,lineEnd:o,viewMode:l,diffMode:a})),$o({id:e,kind:"file",sessionId:t,label:`${r}${w}`,briefLabel:qt(r),filePath:r,lineSuffix:w,supportsRightPane:!0,renderContent:(x,h)=>i.jsx(Et,{managedViewerId:e,inactive:x,rightPane:h,quoteReply:u,projectId:n,filePath:r,lineNumber:s,lineEnd:o,viewMode:l,diffMode:a,initialPresentation:d,source:f,openInNewTabUrl:p},e)})}const jp=c.memo(function({filePath:t,projectId:n,lineNumber:r,lineEnd:s,columnNumber:o,displayText:l,showLineSuffix:a=!0,showFullPath:d=!1,viewMode:u="full",showCopyButton:f=!0,showVersionControlLinks:p=!0}){const w=Mn(),x=br(),h=An(),b=_t(),m=Cr().transport,y=c.useId(),[S,_]=c.useState(!1),[C,j]=c.useState(),[v,k]=c.useState(null),g=c.useMemo(()=>_n(n,t),[n,t]),E=Ao(n,g),A=c.useMemo(()=>ai(n),[n]),B=c.useMemo(()=>lr(g)?Lr(g,A):Vt(g).replace(/^\.\/+/,""),[A,g]),T=c.useMemo(()=>Eo(lr(t)?t:g,A),[t,A,g]),P=To(n,T,B,w!==null),M=cr(g),F=w?Wt(w,{columnNumber:o,filePath:g,lineEnd:s,lineNumber:r,viewMode:u}):null,$=w!==null?F:at(ut({basePath:b,filePath:g,lineEnd:s,lineNumber:r,projectId:n,viewMode:u})),I=c.useMemo(()=>w?Tr(w):void 0,[w]),H=c.useCallback(z=>{if(x&&w===null){ui({id:y,sessionId:x,projectId:n,filePath:g,lineNumber:r,lineEnd:s,viewMode:u,presentation:z,quoteReply:h,source:I,openInNewTabUrl:$});return}j(z),_(!0)},[$,s,r,y,n,w,I,x,h,u,g]),q=c.useCallback(z=>{if(z.stopPropagation(),!(z.button!==0||z.metaKey||z.ctrlKey||z.shiftKey||z.altKey)){if(w&&!F){z.preventDefault();return}z.preventDefault(),H()}},[H,w,F]),D=c.useCallback(()=>{_(!1)},[]),W=c.useCallback(z=>{z.preventDefault(),z.stopPropagation(),k({x:z.clientX,y:z.clientY})},[]),Y=c.useCallback(()=>k(null),[]),oe=c.useCallback(z=>H(z),[H]),X=c.useCallback(()=>{$&&we(new URL($,window.location.href).href)},[$]),fe=c.useCallback(()=>{const z=I?I.loadFile(n,g,!1):te.getFile(n,g);kt(z.then(he=>he.content??""))},[n,I,g]),Z=c.useCallback(()=>{const z=I?I.loadFile(n,g,!0):te.getFile(n,g,!0);gl(z.then(he=>Rl(g,he)))},[n,I,g]),J=c.useCallback(()=>{const z=I==null?void 0:I.fetchRawFileBlob;return{fileName:qt(g),directUrl:I?void 0:Sn(n,g,!0),loadBlob:I&&z?()=>I.loadFile(n,g,!1).then(he=>z(he,g,!0)):()=>m.fetchBlob(ir(Sn(n,g,!0)))}},[n,I,m,g]),ee=d?t:qt(t),L=l||ee,re=Fr(r,s),ye=re&&o!==void 0&&s===void 0?`:${o}`:"",ke=`${re}${ye}`,ue=a?ke:"",Pe=wl(`${t}${ke}`);return i.jsxs(i.Fragment,{children:[i.jsxs(hd,{children:[i.jsxs("a",{href:$??"#",className:"file-path-link",onClick:q,onContextMenu:W,...Pe,children:[i.jsx("span",{className:"file-path-link-name",children:L}),ue&&i.jsx("span",{className:"file-path-link-line",children:ue})]}),f&&i.jsx(yd,{filePath:g}),w===null&&p&&i.jsx(xd,{projectId:n,filePath:g})]}),v&&i.jsx(Po,{x:v.x,y:v.y,canStartNewSession:w===null,onClose:Y,onOpen:()=>oe(),download:J(),onOpenSource:M?()=>oe("source"):void 0,onOpenPreview:M?()=>oe("preview"):void 0,onStartNewSession:E,localSource:P,fileTarget:w===null?{projectId:n,path:B??g}:void 0,onCopyProjectRelativePath:B?()=>void we(B):void 0,onCopyAbsolutePath:w===null&&T?()=>void we(T):void 0,onCopyFilePath:!B&&!T?()=>void we(g):void 0,onCopyViewerLink:$?X:void 0,onCopyContents:fe,onCopyRenderedContents:M?Z:void 0}),S&&i.jsx(Et,{projectId:n,filePath:g,lineNumber:r,lineEnd:s,viewMode:u,initialPresentation:C,source:I,openInNewTabUrl:$,onClose:D})]})});function bd(e){return i.jsx(Et,{...e})}function Et({projectId:e,filePath:t,lineNumber:n,lineEnd:r,viewMode:s="full",diffMode:o,initialPresentation:l,source:a,openInNewTabUrl:d,managedViewerId:u,inactive:f=!1,rightPane:p=!1,nestedViewer:w=!1,quoteReply:x,onClose:h}){const b=Mn(),m=c.useMemo(()=>b?Tr(b):void 0,[b]),y=a??m,S=An(),_=x??S,C=br(),j=El(),v=u===void 0&&(w||j!==null),k=p||v&&!!(j!=null&&j.target),g=u===void 0&&!v&&!!C&&b===null,E=yr(),A=c.useId(),B=u??A,T=jl(),P=!!(f||v&&(j!=null&&j.inactive)||(T==null?void 0:T.id)===B&&T.minimized),M=c.useRef(h);M.current=h;const F=c.useCallback(()=>{var L;if(u!==void 0){Kc(B);return}Bs(B),(L=M.current)==null||L.call(M)},[B,u]),$=c.useCallback(()=>zc(B),[B]);c.useLayoutEffect(()=>{if(u!==void 0||v||b!==null)return;const L=Fr(n,r);$o({id:B,kind:"file",sessionId:C??(E==null?void 0:E.sessionId)??"",label:`${t}${L}`,briefLabel:qt(t),onClose:F,filePath:t,lineSuffix:L,...g?{supportsRightPane:!0,renderContent:(re,ye)=>i.jsx(bd,{managedViewerId:B,inactive:re,rightPane:ye,quoteReply:_,projectId:e,filePath:t,lineNumber:n,lineEnd:r,viewMode:s,diffMode:o,initialPresentation:l,source:y,openInNewTabUrl:d})}:{}})},[F,t,r,n,u,v,B,b,E==null?void 0:E.sessionId,C,g,e,s,l,o,y,d,_]),c.useEffect(()=>{if(!(u!==void 0||g||v))return()=>Bs(B)},[u,B,g,v]);const I=L=>{L.target===L.currentTarget&&F()},H=!g&&!P&&(!k||v||(T==null?void 0:T.id)===B),q=C??(v?T==null?void 0:T.sessionId:void 0)??(E==null?void 0:E.sessionId);c.useEffect(()=>{u!==void 0||b!==null||!q||li(q,ut({projectId:e,filePath:_n(e,t),lineNumber:n,lineEnd:r,viewMode:s,diffMode:o}))},[u,b,q,o,e,t,n,r,s]);const D=u!==void 0&&!v&&b===null&&!y&&(T==null?void 0:T.id)===u&&T.sessionId||null,W=ut({projectId:e,filePath:_n(e,t),lineNumber:n,lineEnd:r,viewMode:s,diffMode:o}),Y=c.useMemo(()=>{if(!D||u===void 0)return;const L=Tn(D);return{initialTop:(L==null?void 0:L.route)===W?L.scrollTop:void 0,save:re=>sd(D,u,re)}},[D,u,W]);c.useEffect(()=>{D&&u!==void 0&&rd(D,u,W)},[D,u,W]);const oe=k&&(j==null?void 0:j.docked)===!0;if(Xl(F,H,"__fileViewerModal"),Yl(F,H),Ql(F,H&&!oe),g)return null;const X=i.jsx(Bm,{projectId:e,filePath:t,lineNumber:n,lineEnd:r,viewMode:s,initialPresentation:l,diffMode:o,source:y,openInNewTabUrl:d,onClose:F,onMinimize:b===null&&!v?$:void 0,parentViewerId:u,scrollMemory:Y}),fe=_?i.jsx(va,{onQuoteTextBlock:_,children:X}):X;if(k){const L=i.jsx(Ps,{projectId:e,children:i.jsx("div",{className:`${mn.paneViewer} ${v?mn.nestedPaneViewer:""}`,role:"dialog","aria-label":t,onKeyDown:oe&&H?re=>{re.key!=="Escape"||re.defaultPrevented||(re.preventDefault(),re.stopPropagation(),F())}:void 0,...Ms,children:fe})});return v&&(j!=null&&j.target)?Ht.createPortal(L,j.target):L}const Z=b===null?document.querySelector(".navigation-route-layer.is-active [data-session-viewer-layer]")??document.querySelector("[data-session-viewer-layer]"):null,J=i.jsx("div",{className:"modal-overlay","aria-hidden":P||void 0,style:P?{display:"none"}:void 0,onClick:I,onMouseDown:L=>L.stopPropagation(),children:i.jsx("dialog",{className:`modal file-viewer-modal ${mn.fileViewerModal} ${s==="range"?`file-viewer-modal-compact ${mn.fileViewerModalCompact}`:""}`,...Ms,open:!0,onClick:L=>L.stopPropagation(),children:fe})}),ee=b===null?Z??document.querySelector(".navigation-route-layer.is-active .session-page")??document.querySelector(".session-page"):null;return Ht.createPortal(b?J:i.jsx(Ps,{projectId:e,children:J}),ee??document.body)}const Sd=new RegExp(String.raw`\x1b(?:\[[0-?]*[ -/]*[@-~]|\][^\x07]*(?:\x07|\x1b\\)|[@-Z\\-_])`,"g");function pe(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function ct(e){return pe(e).replaceAll(`
|
|
35
|
+
`," ")}function Nr(e){return e.replace(Sd,"")}function pn(e){return e.replace(/^[ab]\//,"")}function kd(e){const t=e.replace(/\r\n/g,`
|
|
36
|
+
`).split(`
|
|
37
|
+
`);for(const n of t){const r=/^\+\+\+\s+(?!\/dev\/null)(?:[ab]\/)?(.+?)\s*$/.exec(n);if(r!=null&&r[1])return pn(r[1].trim())}for(const n of t){const r=/^---\s+(?!\/dev\/null)(?:[ab]\/)?(.+?)\s*$/.exec(n);if(r!=null&&r[1])return pn(r[1].trim())}for(const n of t){const r=/^diff --git\s+a\/(.+?)\s+b\/(.+?)\s*$/.exec(n);if(r!=null&&r[2])return pn(r[2].trim());if(r!=null&&r[1])return pn(r[1].trim())}}function eo(e){const t=[];for(const n of e.replace(/\\/g,"/").split("/"))if(!(!n||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n)}return t.join("/")}function Cd(e,t){const n=e.trim();if(!n||n.startsWith("#")||n.startsWith("//")||/^[a-z][a-z0-9+.-]*:/i.test(n))return null;const r=n.split(/[?#]/,1)[0]??"";if(!r)return null;if(r.startsWith("/"))return eo(r.slice(1));const s=t!=null&&t.includes("/")?t.slice(0,t.lastIndexOf("/")):"";return eo(s?`${s}/${r}`:r)}function Ld(e,t,n={}){const r=Cd(t,n.baseFilePath);if(!r)return null;const s=pe(e||t);if(!n.projectId)return{html:s,changed:!0};const l=(n.publicShare&&Wt(n.publicShare,{filePath:r}))??at(`${n.basePath??""}${Kt({projectId:n.projectId,filePath:r})}`),a=`/${r}`,d=_r(a,n.projectPath);return{html:`<a class="fixed-font-file-link" href="${ct(l)}" data-fixed-font-file-path="${ct(r)}" data-tooltip="${ct(d)}">${s}</a>`,changed:!0}}function Bt(e,t){return!t.linkifyUrls||!Io(e)?pe(e):Do(e).map(n=>n.type==="url"&&n.href?`<a href="${ct(n.href)}" target="_blank" rel="noopener noreferrer">${pe(n.text)}</a>`:pe(n.text)).join("")}function to(e,t){var l;if(!t.projectId||!((l=t.projectPathLinks)!=null&&l.length)){const a=Bt(e,t);return{html:a,changed:a!==pe(e)}}const n=new Map(t.projectPathLinks.map(a=>[a.text,a.filePath])),r=No(e).filter(a=>n.has(a.text));if(r.length===0){const a=Bt(e,t);return{html:a,changed:a!==pe(e)}}let s="",o=0;for(const a of r){if(a.start<o)continue;const d=n.get(a.text),{pathEnd:u,end:f,position:p}=Vc(e,a,d),w=no(t.projectId,d,e.slice(a.start,u),t);if(!w){s+=Bt(e.slice(o,f),t),o=f;continue}s+=Bt(e.slice(o,a.start),t),s+=w,p&&(s+=no(t.projectId,d,p.text,t,p)??pe(p.text)),o=f}return s+=Bt(e.slice(o),t),{html:s,changed:!0}}function no(e,t,n,r,s){const o={filePath:t,lineNumber:s==null?void 0:s.lineNumber,lineEnd:s==null?void 0:s.lineEnd,columnNumber:s==null?void 0:s.columnNumber},l=r.publicShare?Wt(r.publicShare,o):at(`${r.basePath??""}${Kt({projectId:e,...o})}`);if(!l)return null;const a=`${_r(t,r.projectPath)}${(s==null?void 0:s.text)??""}`,d=s?` data-ya-line="${s.lineNumber}"${s.lineEnd?` data-ya-line-end="${s.lineEnd}"`:""}`:"";return`<a class="fixed-font-file-link" href="${ct(l)}" data-fixed-font-file-path="${ct(t)}"${d} data-tooltip="${ct(a)}">${pe(n)}</a>`}function En(e,t){try{return Bc.renderToString(ea(e),{throwOnError:!1,displayMode:t,macros:Qc(),output:"htmlAndMathml",strict:"ignore",trust:!1})}catch{const n=t?`$$${e}$$`:`$${e}$`;return`<span class="fixed-font-math-error">${pe(n)}</span>`}}function $r(e,t){let n=0;for(let r=t-1;r>=0&&e[r]==="\\";r-=1)n+=1;return n%2===1}function di(e,t,n){let r=n;for(;r<e.length;){const s=e.indexOf(t,r);if(s<0||!$r(e,s))return s;r=s+t.length}return-1}function fi(e,t){const n=e.startsWith("$$",t)?{close:"$$",open:"$$"}:e.startsWith("\\[",t)&&!$r(e,t)?{close:"\\]",open:"\\["}:null;if(!n)return null;const r=di(e,n.close,t+n.open.length);if(r<0)return null;const s=e.slice(t+n.open.length,r).trim();return s?{end:r+n.close.length,html:En(s,!0)}:null}function hi(e,t){if(e.startsWith("\\(",t)&&!$r(e,t)){const a=di(e,"\\)",t+2);if(a<0)return null;const d=e.slice(t+2,a).trim();return!d||d.includes(`
|
|
38
|
+
`)?null:{end:a+2,html:En(d,!1)}}if(e[t]!=="$")return null;const n=e[t+1];if(!n||/\s/.test(n))return null;let r=t+1;for(;r<e.length;){const a=e[r];if(a===`
|
|
39
|
+
`)return null;if(a==="$")break;r+=1}if(r>=e.length||e[r]!=="$")return null;const s=e[r-1];if(!s||/\s/.test(s))return null;const o=e[r+1];if(o&&(/\d/.test(o)||o==="$"))return null;const l=e.slice(t+1,r);return!l||!/[\\^{}+]/.test(l)&&!/\d/.test(l)?null:{end:r+1,html:En(l,!1)}}function mi(e){return{chars:e.length,lines:e.length===0?0:e.split(`
|
|
40
|
+
`).length}}function pi(e){let t="",n=!1,r=0,s=0;for(;s<e.length;){const o=fi(e,s),l=o?null:hi(e,s),a=o??l;if(!a){s+=1;continue}t+=pe(e.slice(r,s)),t+=a.html,n=!0,s=a.end,r=s}return t+=pe(e.slice(r)),{html:t,changed:n}}function _d(e,t={}){return si("fixed-font-math",()=>({...mi(e),diffAware:t.diffAware??!1}),()=>t.diffAware?Pd(e):pi(e))}function Ed(e){const t=e.replace(/\r\n/g,`
|
|
41
|
+
`).split(`
|
|
42
|
+
`);if(t.some(s=>s.startsWith("@@ "))||t.some(s=>s.startsWith("diff --git "))||t.some(s=>s.startsWith("--- "))&&t.some(s=>s.startsWith("+++ ")))return!0;let n=0,r=0;for(const s of t)s.startsWith("+")&&!s.startsWith("+++")&&(n+=1),s.startsWith("-")&&!s.startsWith("---")&&(r+=1);return n>0&&r>0&&n+r>=2}function gi(e,t){return t&&e.length>0&&(e[0]===" "||e[0]==="+"&&!e.startsWith("+++")||e[0]==="-"&&!e.startsWith("---"))?{prefix:e[0],content:e.slice(1)}:{prefix:"",content:e}}function mr(e){const t=e.trim();return t.startsWith("|")&&t.endsWith("|")&&t.split("|").length>=4}function yn(e){return e.trim().slice(1,-1).split("|").map(n=>n.trim())}function Yn(e){if(!mr(e))return!1;const t=yn(e);return t.length>0&&t.every(n=>/^:?-{2,}:?$/.test(n.replace(/\s+/g,"")))}function jd(e){const t=e.replace(/\s+/g,""),n=t.startsWith(":"),r=t.endsWith(":");return n&&r?"center":r?"right":n?"left":null}function ot(e,t={}){let n="",r=!1,s=0,o=0;const l=a=>{if(a>s){const d=to(e.slice(s,a),t);n+=d.html,d.changed&&(r=!0)}};for(;o<e.length;){const a=e[o];if(a==="`"){const w=e.indexOf("`",o+1);if(w>o+1){l(o);const x=to(e.slice(o+1,w),t);n+=`<code>${x.html}</code>`,r=!0,o=w+1,s=o;continue}}if(a==="["){const w=e.indexOf("]",o+1);if(w>o+1&&e[w+1]==="("){const x=e.indexOf(")",w+2);if(x>w+2){const h=e.slice(o+1,w),b=e.slice(w+2,x),m=Ld(h,b,t);if(m){l(o),n+=m.html,r=!0,o=x+1,s=o;continue}}}}const d=fi(e,o),u=d?null:hi(e,o),f=d??u;if(f){l(o),n+=f.html,r=!0,o=f.end,s=o;continue}const p=e.startsWith("**",o)?"**":e.startsWith("__",o)?"__":null;if(p){const w=e.indexOf(p,o+2);if(w>o+2){l(o);const x=ot(e.slice(o+2,w),t);n+=`<strong>${x.html}</strong>`,r=!0,o=w+2,s=o;continue}}o+=1}return l(e.length),{html:n,changed:r}}function pr(e){return e==="+"?"fixed-font-diff-added":e==="-"?"fixed-font-diff-removed":e===" "?"fixed-font-diff-context":""}function gr(e){return`<span class="fixed-font-diff-gutter">${e===""||e===" "?" ":pe(e)}</span>`}function Rd(e,t,n={}){var x,h;const r=e[t],s=e[t+1];if(!r||!mr(r.content))return null;const o=!!s&&Yn(s.content);let l=o?t+2:t+1;for(;l<e.length&&mr(((x=e[l])==null?void 0:x.content)??"")&&!(l+1<e.length&&Yn(((h=e[l+1])==null?void 0:h.content)??""));)l+=1;if(!o&&l-t<2)return null;const a=o?yn(s.content).map(jd):[],d=o?e.slice(t+2,l).filter(b=>!Yn(b.content)):e.slice(t,l),u=e.slice(t,l).some(b=>b.prefix!==""),f=(b,m,y)=>{const S=a[y],_=S?` style="text-align: ${S}"`:"";return`<${b}${_}>${ot(m,n).html}</${b}>`},p=o?(()=>{const b=yn(r.content).map((y,S)=>f("th",y,S)).join(""),m=u?`<th class="fixed-font-diff-gutter-cell">${gr(r.prefix)}</th>`:"";return`<thead><tr class="${pr(r.prefix)}">${m}${b}</tr></thead>`})():"",w=d.map(b=>{const m=yn(b.content).map((S,_)=>f("td",S,_)).join(""),y=u?`<td class="fixed-font-diff-gutter-cell">${gr(b.prefix)}</td>`:"";return`<tr class="${pr(b.prefix)}">${y}${m}</tr>`}).join("");return{end:l,html:`<div class="fixed-font-markdown-block"><table class="fixed-font-markdown-table">${p}<tbody>${w}</tbody></table></div>`}}function Md(e,t,n){var f;if(n)return null;const s=(((f=e[t])==null?void 0:f.content.trim())??"").match(/^[\w.-]+\[(\d+)\]\{[^}]*\}:$/);if(!s)return null;const o=t+1+Number(s[1]);if(o>e.length)return null;const l=pa(e.slice(t,o).map(p=>p.content).join(`
|
|
43
|
+
`)),a=(l==null?void 0:l.length)===1?l[0]:void 0;if(!a)return null;const d=`<thead><tr>${a.columns.map(p=>`<th>${pe(p)}</th>`).join("")}</tr></thead>`,u=a.rows.map(p=>`<tr>${p.map(w=>`<td>${pe(w)}</td>`).join("")}</tr>`).join("");return{end:o,html:`<div class="fixed-font-markdown-block"><table class="fixed-font-markdown-table">${d}<tbody>${u}</tbody></table></div>`}}function Ad(e,t={}){var a;const n=/^\s{0,3}(#{1,6})\s+(.+?)\s*#*\s*$/.exec(e);if(n!=null&&n[1]&&n[2])return{html:ot(n[2],t).html,changed:!0,className:`fixed-font-markdown-heading fixed-font-markdown-heading-${n[1].length}`};if(/^\s{0,3}(?:-{3,}|\*{3,}|_{3,})\s*$/.test(e))return{html:'<span class="fixed-font-markdown-rule" aria-hidden="true"></span>',changed:!0,className:"fixed-font-markdown-rule-line"};const r=/^\s{0,3}>\s?(.*)$/.exec(e);if(r)return{html:ot(r[1]??"",t).html,changed:!0,className:"fixed-font-markdown-blockquote"};const s=/^(\s*)([-*+]|\d+[.)])\s+(.+)$/.exec(e);if(s!=null&&s[2]&&s[3]){const d=((a=s[1])==null?void 0:a.length)??0,u=s[2].length+1;return{html:`<span class="fixed-font-markdown-list-marker">${/^\d/.test(s[2])?pe(s[2]):"•"}</span><span class="fixed-font-markdown-list-body">${ot(s[3],t).html}</span>`,changed:!0,className:"fixed-font-markdown-list-line",style:`--fixed-font-list-indent-ch:${d};--fixed-font-list-marker-ch:${u};`}}const o=/^(\s+)(\S[\s\S]*)$/.exec(e);if(o!=null&&o[1]&&o[2]){const d=ot(o[2],t);return{html:`<span class="fixed-font-leading-indent" style="--fixed-font-leading-ch:${o[1].length};"></span>${d.html}`,changed:d.changed}}return ot(e,t)}function wi(e,t,n){var d,u,f;const r=(d=e[t])==null?void 0:d.content.trim(),s=r==="$$"?"$$":r==="\\["?"\\]":null;if(!s)return null;let o=t+1;for(;o<e.length&&((u=e[o])==null?void 0:u.content.trim())!==s;)o+=1;if(o>=e.length)return null;const l=e.slice(t+1,o).map(p=>p.content).join(`
|
|
44
|
+
`).trim();if(!l)return null;const a=En(l,!0);if(n){const p=e.slice(t,o+1),w=((f=p[0])==null?void 0:f.prefix)??"";return p.some(x=>x.prefix!==w)?null:{end:o+1,html:Br({prefix:w},{className:"fixed-font-markdown-display-math",html:a})}}return{end:o+1,html:a}}function Br(e,t){const n=["fixed-font-rendered-line",pr(e.prefix),t.className].filter(Boolean).join(" "),r=t.style?` style="${t.style}"`:"";return`<div class="${n}">${gr(e.prefix)}<div class="fixed-font-rendered-line__content"${r}>${t.html}</div></div>`}function Pd(e){const t=Nr(e).replace(/\r\n/g,`
|
|
45
|
+
`).split(`
|
|
46
|
+
`).map(o=>gi(o,!0));let n="",r=!1,s=0;for(;s<t.length;){const o=wi(t,s,!0);if(o){n+=o.html,r=!0,s=o.end;continue}const l=t[s];if(!l){s+=1;continue}const a=pi(l.content);n+=Br(l,a),a.changed&&(r=!0),s+=1}return{html:n,changed:r}}function Td(e,t={}){const n=Nr(e),r=t.baseFilePath??kd(n),s=t.diffAware??Ed(n);if(!s&&td(n).some(f=>f.kind!=="text"))return{html:pe(n),changed:!1};const o={...t,baseFilePath:r},l=n.replace(/\r\n/g,`
|
|
47
|
+
`).split(`
|
|
48
|
+
`).map(f=>gi(f,s));let a="",d=!1,u=0;for(;u<l.length;){const f=wi(l,u,s);if(f){a+=f.html,f.end<l.length&&(a+=`
|
|
49
|
+
`),d=!0,u=f.end;continue}const p=Md(l,u,s);if(p){a+=p.html,d=!0,u=p.end;continue}const w=Rd(l,u,o);if(w){a+=w.html,d=!0,u=w.end;continue}const x=l[u];if(!x){u+=1;continue}const h=Ad(x.content,o);h.changed&&(d=!0),s?a+=Br(x,h):(a+=h.html,u<l.length-1&&(a+=`
|
|
50
|
+
`)),u+=1}return{html:a,changed:d}}function wr(e,t={}){return si("fixed-font-rich-content",()=>({...mi(e),diffAware:t.diffAware??null,hasProjectId:!!t.projectId,hasBaseFilePath:!!t.baseFilePath}),()=>Td(e,t))}function Fd(e,t){return t==="themed"?e:e.replace(/ data-tooltip="([^"]*)"/g,(n,r)=>` title="${r}"`)}function Rp({sourceText:e,sourceView:t,renderRenderedView:n,diffAware:r,baseFilePath:s,initialMode:o,precomputedRendered:l,renderMode:a="rich",projectPathLinks:d}){const u=yr(),f=Mn(),p=_t(),w=vl(),{projectPaths:x,mentionedDirectories:h}=Dc(),b=gc(s),[m,y]=c.useState(null),S=c.useRef(null),_=c.useMemo(()=>Nr(e),[e]),C=c.useMemo(()=>f?Tr(f):void 0,[f]),j=c.useMemo(()=>l??(a==="math"?_d(e,{diffAware:r}):wr(e,{diffAware:r,projectId:u==null?void 0:u.projectId,projectPath:(u==null?void 0:u.projectPath)??void 0,baseFilePath:s,basePath:p,publicShare:f,projectPathLinks:d})),[l,e,a,r,u==null?void 0:u.projectId,u==null?void 0:u.projectPath,s,p,f,d]),{showRendered:v,toggleLocalMode:k}=Ic(j.changed,{initialMode:o,renderWhenDisabled:!1,resetDependencies:[e,a]}),{btnRef:g,handleClick:E}=Ju(v,k),A=c.useMemo(()=>{var $;const M=Vu(j.html,void 0,u==null?void 0:u.projectId,f,{projectPaths:x,mentionedDirectories:h}).html,F=Fd(M,w);return Ac(F,b.state==="ready"&&(($=b.result)==null?void 0:$.status)==="ready"?b.result.artifact:void 0).html},[b,j.html,w,x,h,u==null?void 0:u.projectId,f]);c.useEffect(()=>{const M=S.current;if(!(!M||!_.trim()))return Jl(M,_,void 0,v&&j.changed?"rendered":"literal")},[_,v,j.changed]);const B=c.useCallback(M=>{var $,I;const F=(I=($=M.target)==null?void 0:$.closest)==null?void 0:I.call($,"a[data-fixed-font-file-path]");F&&(M.button!==0||M.metaKey||M.ctrlKey||M.shiftKey||M.altKey||(M.preventDefault(),M.stopPropagation(),y({filePath:F.dataset.fixedFontFilePath??"",href:F.getAttribute("href"),lineNumber:Number(F.dataset.yaLine)||void 0,lineEnd:Number(F.dataset.yaLineEnd)||void 0})))},[]),T=c.useCallback(M=>{const F=S.current,$=F?kr(Ut(F)):"";Ml(M.nativeEvent,M.currentTarget)&&$&&M.clipboardData.setData("text/plain",$)},[]),P=(u==null?void 0:u.projectId)??(f==null?void 0:f.projectId)??"";return i.jsxs("div",{ref:S,className:"fixed-font-render-toggle","data-render-mode":v&&j.changed?"rendered":"source",children:[v&&j.changed?i.jsx("div",{onClick:B,onCopy:T,children:n(A)}):t,j.changed&&i.jsx("button",{ref:g,type:"button",className:`fixed-font-render-toggle__button ${v?"is-rendered":""}`,onClick:E,"aria-label":v?"Show source":"Show rendered view",title:v?"Show source":"Show rendered view","aria-pressed":v,children:i.jsx(Xc,{})}),m&&P!==""&&i.jsx(Et,{projectId:P,filePath:m.filePath,lineNumber:m.lineNumber,lineEnd:m.lineEnd,source:C,openInNewTabUrl:m.href,onClose:()=>y(null)})]})}function Nd(e){return e==="auto"||e==="unified"||e==="side-by-side"}function $d(){try{const e=localStorage.getItem(Ve.diffViewMode);if(Nd(e))return e}catch{}return"auto"}function Bd(){const[e,t]=c.useState($d),n=c.useCallback(r=>{t(r);try{localStorage.setItem(Ve.diffViewMode,r)}catch{}},[]);return[e,n]}const Dd="[data-source-list-item]:not(:disabled)",Id="[data-source-file-item]:not(:disabled)",Od=100;function Qn(){xl(Od)}function Mp(e,{filesOnly:t=!1,onPage:n}={}){var f,p;const r=e.key==="PageDown"?1:e.key==="PageUp"?-1:null;if(r===null&&e.key!=="ArrowDown"&&e.key!=="ArrowUp"&&e.key!=="ArrowLeft"&&e.key!=="ArrowRight"||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;if(r!==null){if(!n)return;e.preventDefault(),Qn(),n(r);return}const s=Array.from(e.currentTarget.querySelectorAll(t?Id:Dd));if(s.length===0)return;const o=document.activeElement,l=s.indexOf(o);if(l<0)return;if(e.key==="ArrowLeft"||e.key==="ArrowRight"){const w=s[l],x=w.getAttribute("aria-expanded");if(e.preventDefault(),Qn(),e.key==="ArrowRight"){if(x==="false"){w.click();return}if(x==="true"){const m=s[l+1];if(!m||!((f=w.parentElement)!=null&&f.contains(m)))return;m.focus()}return}if(x==="true"){w.click();return}const h=w.closest("ul");if(!h||h===e.currentTarget)return;const b=(p=h.parentElement)==null?void 0:p.querySelector(":scope > [data-source-list-item]:not(:disabled)");if(!b)return;b.focus();return}const a=e.key==="ArrowDown"?1:-1,d=Math.min(s.length-1,Math.max(0,l+a)),u=s[d];u&&(e.preventDefault(),Qn(),u!==o&&u.focus())}function Ap(e,t=!0){c.useEffect(()=>{if(!t)return;const n=r=>{if(r.defaultPrevented||r.key!=="/"||r.altKey||r.ctrlKey||r.metaKey||vi(r.target))return;const s=e.current;s&&(r.preventDefault(),s.focus(),s.select())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t,e])}function vi(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT":!1}const Hd=1e3;function Ud(e,t){return e==="unified"||e==="side-by-side"?e:t>=Hd?"side-by-side":"unified"}function Vd(e){const t=[];let n=0;for(const r of e){t.push({type:"header",text:`@@ -${r.oldStart},${r.oldLines} +${r.newStart},${r.newLines} @@`});let s=[],o=[];const l=()=>{const a=Math.max(s.length,o.length);for(let d=0;d<a;d++)t.push({type:"line",left:s[d]??null,right:o[d]??null});s=[],o=[]};for(const a of r.lines){const d=n++,u=a[0];u==="-"?s.push(d):u==="+"?o.push(d):(l(),t.push({type:"line",left:d,right:d}))}l()}return t}function xi(e,t=!1){var s;const n=new Map;if(typeof DOMParser>"u")return n;const r=new DOMParser().parseFromString(e,"text/html");for(const o of r.querySelectorAll("[data-diff-line]")){const l=Number(o.getAttribute("data-diff-line"));Number.isInteger(l)&&(t&&((s=o.querySelector(".diff-prefix"))==null||s.remove()),n.set(l,o.outerHTML))}return n}const qd=c.createContext(null);function Wd(){return c.useContext(qd)}const bn=new Map;function Kd(e,t){let n=bn.get(e);return n||(n=new Set,bn.set(e,n)),n.add(t),()=>{n==null||n.delete(t),n&&n.size===0&&bn.delete(e)}}function ro(e){for(const t of bn.get(e)??[])t()}function zd(e,t,n=!1){const r=yl(),s=_t(),o=Wd(),[l,a]=c.useState([]),[d,u]=c.useState(!1),[f,p]=c.useState(null),w=c.useRef(null),x=c.useCallback(async()=>{try{const m=await te.listReviewComments(e);a(m.comments.filter(y=>y.status==="pending"&&y.anchor.path===t))}catch{}},[e,t]);c.useEffect(()=>(x(),Kd(e,()=>{x()})),[e,x]);const h=c.useCallback(async(m,y)=>{u(!0),p(null);try{const{comment:S}=await te.addReviewComment(e,m,y);return a(_=>[..._,S]),ro(e),!0}catch(S){return p(S instanceof Error?S.message:"Failed to add comment"),!1}finally{u(!1)}},[e]),b=c.useCallback(async(m,y,S,_,C)=>{var j;u(!0),p(null);try{const v=JSON.stringify({anchor:m,text:y,target:S}),k=n&&((j=w.current)==null?void 0:j.key)===v?w.current:null,g=k?k.commentId:(await te.addReviewComment(e,m,y)).comment.id,E=(k==null?void 0:k.submissionId)??bo();n&&!k&&(w.current={key:v,commentId:g,submissionId:E});const A=n?{id:E}:void 0,B=A?await te.submitReview(e,[g],S,S==="new"?C:void 0,A):S==="new"&&C?await te.submitReview(e,[g],S,C):await te.submitReview(e,[g],S);return ro(e),B.sessionId?(w.current=null,r(`${s}/projects/${e}/sessions/${B.sessionId}`),"navigated"):(n&&(w.current=null),p(_),x(),"queued")}catch(v){return p(v instanceof Error?v.message:"Failed to submit"),"error"}finally{u(!1)}},[e,r,s,x,n]);return{pending:l,defaultSession:o,busy:d,error:f,setError:p,refreshPending:x,addToReview:h,submitNow:b}}function so({sessionId:e,fallback:t,children:n,className:r}){var S,_;const s=pl(e),{showDelayMs:o,warmShowDelayMs:l,maxHeightPx:a}=wc(),d=c.useRef(null),{anchor:u,hoverCardId:f,clear:p,onPointerEnter:w,onPointerMove:x,onPointerLeave:h}=vc({targetRef:d,showDelayMs:o,warmShowDelayMs:l,refreshPreview:{projectId:t.projectId,sessionId:e,lastAgentText:s==null?void 0:s.lastAgentText,owner:(S=s==null?void 0:s.ownership)==null?void 0:S.owner,available:!!s}});c.useEffect(()=>{if(!u)return;const C=()=>p();return window.addEventListener("scroll",C,!0),window.addEventListener("resize",C),()=>{window.removeEventListener("scroll",C,!0),window.removeEventListener("resize",C)}},[u,p]);const m=((_=!!(s!=null&&s.customTitle)?s==null?void 0:s.title:(s==null?void 0:s.initialPrompt)??(s==null?void 0:s.fullTitle)??(s==null?void 0:s.title))==null?void 0:_.trim())||t.title,y=(s==null?void 0:s.provider)??t.provider;return i.jsxs("span",{ref:d,className:r,onPointerEnter:w,onPointerMove:x,onPointerLeave:h,children:[n,u&&i.jsx(xc,{hoverCardId:f,anchor:u,prompt:m,lastAgentText:s==null?void 0:s.lastAgentText,provider:y,model:(s==null?void 0:s.model)??t.model,projectName:s==null?void 0:s.projectName,ageLabel:yc(s==null?void 0:s.updatedAt,s==null?void 0:s.createdAt),status:s==null?void 0:s.ownership,pendingInputType:s==null?void 0:s.pendingInputType,hasUnread:s==null?void 0:s.hasUnread,activity:s==null?void 0:s.activity,maxHeightPx:a,onMouseLeave:p})]})}async function Gd(e){var r;const t=[];let n;for(;;){const s=await te.getGlobalSessions({project:e,limit:500,after:n});if(t.push(...s.sessions),!s.hasMore)return t;const o=(r=s.sessions[s.sessions.length-1])==null?void 0:r.updatedAt;if(!o||o===n)throw new Error("Existing-session list did not advance");n=o}}function Xd(e,t){const n=e.customTitle||e.title||e.id.slice(0,8),r=e.model?`${e.provider}/${e.model}`:e.provider;return t?`${n} · ${r} · ${t}`:`${n} · ${r}`}const Yd="_window_1f36g_1",Qd="_anchor_1f36g_12",Jd="_snippet_1f36g_18",Zd="_input_1f36g_30",ef="_error_1f36g_41",tf="_actions_1f36g_46",nf="_submitActions_1f36g_53",rf="_destination_1f36g_62",sf="_destinationError_1f36g_76",of="_defaultSessionTarget_1f36g_82",lf="_submit_1f36g_53",_e={window:Yd,anchor:Qd,snippet:Jd,input:Zd,error:ef,actions:tf,submitActions:nf,destination:rf,destinationError:sf,defaultSessionTarget:of,submit:lf};function cf({projectId:e,anchorLabel:t,snippet:n,busy:r,error:s,onCancel:o,onAddToReview:l,defaultSession:a,onSubmit:d,t:u}){const[f,p]=c.useState(""),[w,x]=c.useState(null),[h,b]=c.useState(!1),[m,y]=c.useState((a==null?void 0:a.id)??"new"),S=c.useRef(!1),_=f.trim().length>0&&!r;c.useEffect(()=>{let v=!1;return Gd(e).then(k=>{var g;v||(x(k),!a&&!S.current&&y(((g=k[0])==null?void 0:g.id)??"new"))}).catch(()=>{v||b(!0)}),()=>{v=!0}},[a,e]);const C=(w==null?void 0:w.find(v=>v.id===m))??null,j=i.jsx("button",{type:"button",className:_e.submit,onClick:()=>d(f,m),disabled:!_,children:u("sourceReviewSubmitComment")});return i.jsx(yi,{anchorLabel:t,snippet:n,text:f,placeholder:u("sourceReviewCommentPlaceholder"),error:s,onChange:p,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"review-comment-window-cancel",onClick:o,disabled:r,children:u("cancel")}),i.jsx("button",{type:"button",className:"review-comment-window-add",onClick:()=>l(f),disabled:!_,children:u("sourceReviewAddToReview")}),i.jsxs("div",{className:_e.submitActions,children:[i.jsxs("label",{className:_e.destination,children:[i.jsx("span",{children:u("sourceReviewTargetLegend")}),i.jsxs("select",{value:m,onChange:v=>{S.current=!0,y(v.target.value)},children:[i.jsx("option",{value:"new",children:u("sourceReviewTargetNew")}),a&&!(w!=null&&w.some(v=>v.id===a.id))&&i.jsxs("option",{value:a.id,children:[a.title," ·"," ",a.newSession.provider,a.newSession.model?`/${a.newSession.model}`:""," ","· ",u("sourceReviewCurrentSuffix")]}),w==null?void 0:w.map(v=>i.jsx("option",{value:v.id,children:Xd(v,v.id===(a==null?void 0:a.id)?u("sourceReviewCurrentSuffix"):void 0)},v.id))]})]}),h&&i.jsx("span",{className:_e.destinationError,children:u("sourceReviewSessionsUnavailable")}),a&&m===a.id?i.jsx(so,{sessionId:a.id,fallback:{projectId:a.projectId,title:a.title,provider:a.newSession.provider,model:a.newSession.model},className:_e.defaultSessionTarget,children:j}):C?i.jsx(so,{sessionId:C.id,fallback:{projectId:C.projectId,title:C.customTitle||C.title||C.id.slice(0,8),provider:C.provider,model:C.model},className:_e.defaultSessionTarget,children:j}):j]})]})})}function yi({anchorLabel:e,snippet:t,text:n,placeholder:r,autoFocus:s=!0,error:o,onChange:l,onBlur:a,onKeyDown:d,actions:u}){return i.jsxs("div",{className:_e.window,"data-markdown-copy-ignore":"true",children:[i.jsx("div",{className:_e.anchor,children:e}),i.jsx("pre",{className:_e.snippet,children:t}),i.jsx("textarea",{className:_e.input,autoFocus:s,rows:3,value:n,placeholder:r,onBlur:a,onChange:f=>l(f.target.value),onKeyDown:d}),o&&i.jsx("div",{className:_e.error,children:o}),i.jsx("div",{className:_e.actions,children:u})]})}const af="_menuTrigger_qenm5_1",uf={menuTrigger:af};function df({container:e,structuredPatch:t,pending:n,revisions:r,consumeLongPressClick:s,onOpenComment:o,onOpenMenu:l,onBeginLongPress:a,onMoveLongPress:d,onEndLongPress:u,t:f}){const[p,w]=c.useState(null),x=c.useCallback(m=>{if(!(m instanceof HTMLElement))return null;const y=m.closest("[data-diff-line]");return!y||!e.contains(y)?null:Jn(e,y,t)},[e,t]),h=c.useCallback(m=>{w(y=>(y==null?void 0:y.flatIndex)===m.flatIndex&&y.contextSide===m.contextSide&&y.top===m.top?y:m)},[]),b=c.useCallback(()=>{if(!p)return null;const m=e.querySelectorAll(`[data-diff-line="${p.flatIndex}"]`),y=Array.from(m).find(S=>bi(S)===p.contextSide)??m[0];return y?Jn(e,y,t):null},[p,e,t]);return c.useLayoutEffect(()=>{const m=g=>{var A;if(s()||!(((A=window.getSelection())==null?void 0:A.isCollapsed)??!0))return;const E=x(g.target);E&&o(E)},y=g=>{const E=x(g.target);E&&(g.preventDefault(),g.stopPropagation(),h(E.target),l(E,{x:g.clientX,y:g.clientY}))},S=g=>{const E=x(g.target);E&&(h(E.target),a(E,g))},_=g=>{d(g);const E=x(g.target);E&&h(E.target)},C=()=>u(),j=()=>{u(),w(null)},v=g=>{const E=x(g.target);E&&h(E.target)},k=g=>{const E=x(g.target);if(!E)return;if(g.key==="ContextMenu"||g.shiftKey&&g.key==="F10"){g.preventDefault(),g.stopPropagation();const P=E.node.getBoundingClientRect();l(E,{x:P.left+Math.min(32,P.width/2),y:P.bottom});return}if(g.key==="Enter"||g.key===" "){g.preventDefault(),o(E);return}if(g.key!=="ArrowDown"&&g.key!=="ArrowUp")return;const A=Array.from(e.querySelectorAll("[data-diff-line]")),B=A.indexOf(E.node),T=A[B+(g.key==="ArrowDown"?1:-1)];T&&(g.preventDefault(),T.focus())};return e.addEventListener("click",m),e.addEventListener("contextmenu",y),e.addEventListener("pointerdown",S),e.addEventListener("pointermove",_),e.addEventListener("pointerup",C),e.addEventListener("pointercancel",C),e.addEventListener("pointerleave",j),e.addEventListener("focusin",v),e.addEventListener("keydown",k),()=>{e.removeEventListener("click",m),e.removeEventListener("contextmenu",y),e.removeEventListener("pointerdown",S),e.removeEventListener("pointermove",_),e.removeEventListener("pointerup",C),e.removeEventListener("pointercancel",C),e.removeEventListener("pointerleave",j),e.removeEventListener("focusin",v),e.removeEventListener("keydown",k)}},[h,s,e,a,u,d,o,l,x]),c.useLayoutEffect(()=>{const m=new Set(n.map(_=>hf(_.anchor))),y=()=>{const _=e.querySelectorAll("[data-diff-line]");for(const C of _){const j=Jn(e,C,t),v=j?r==null?void 0:r[j.location.side]:void 0;C.classList.toggle("has-review-comment",!!j&&m.has(Si(j.location,v))),C.tabIndex=0,C.setAttribute("aria-label",f("sourceDiffLineActions"))}};y();const S=new MutationObserver(y);return S.observe(e,{childList:!0,subtree:!0}),()=>S.disconnect()},[e,n,r,t,f]),{activeLine:p,resolveActiveLine:b}}function Jn(e,t,n){const r=Number(t.getAttribute("data-diff-line")),s=bi(t),o=ia(n,r,void 0,s);if(!o)return null;const l=t.getBoundingClientRect(),a=e.getBoundingClientRect();return{node:t,target:{flatIndex:r,contextSide:s,top:l.top-a.top+e.scrollTop},location:o}}function bi(e){var t;return((t=e.closest("[data-diff-col]"))==null?void 0:t.getAttribute("data-diff-col"))==="old"?"old":"new"}function ff(e){return(e==null?void 0:e.kind)==="sha"?`sha:${e.sha}`:"uncommitted"}function Si(e,t){return`${ff(t)}:${e.side}:${e.oldLine}:${e.newLine}`}function hf(e){return Si(e,e.revision)}function mf({projectId:e,filePath:t,structuredPatch:n,revisions:r,projections:s,container:o,onOpenChange:l,renderSource:a,t:d}){const[u,f]=c.useState(null),{pending:p,defaultSession:w,busy:x,error:h,setError:b,addToReview:m,submitNow:y}=zd(e,t,s!==void 0);c.useLayoutEffect(()=>(l==null||l(u!==null),()=>{u&&(l==null||l(!1))}),[l,u]);const S=c.useCallback(v=>{b(null),f(v)},[b]),_=c.useCallback(async v=>{u&&await m(u.anchor,v)&&f(null)},[m,u]),C=c.useCallback(async(v,k,g)=>{if(!u)return;await y(u.anchor,v,k,d("sourceReviewSubmitQueued"),g)==="navigated"&&f(null)},[u,y,d]),j=u?i.jsx(cf,{projectId:e,anchorLabel:`${t}:${u.anchor.newLine??u.anchor.oldLine??"?"}`,snippet:u.anchor.snippet,busy:x,error:h,onCancel:()=>f(null),onAddToReview:_,defaultSession:w,onSubmit:(v,k)=>C(v,k,k==="new"?w==null?void 0:w.newSession:void 0),t:d},`${u.anchor.side}:${u.flatIndex}`):null;return i.jsxs(i.Fragment,{children:[a({openComment:u,editor:j}),i.jsx(pf,{filePath:t,structuredPatch:n,revisions:r,projections:s,container:o,pending:p,onOpenComment:S,t:d})]})}function pf({filePath:e,structuredPatch:t,revisions:n,projections:r,container:s,pending:o,onOpenComment:l,t:a}){const{menu:d,openAt:u,openFromButton:f,beginLongPressAt:p,moveLongPressAt:w,endLongPress:x,consumeLongPressClick:h}=Mo(a),b=c.useCallback(v=>({path:e,revision:(n==null?void 0:n[v.side])??{kind:"uncommitted",savedAt:new Date().toISOString()},side:v.side,oldLine:v.oldLine,newLine:v.newLine,snippet:v.snippet,snippetAnchorOffset:v.snippetAnchorOffset,...r!=null&&r[v.side]?{projection:r[v.side]}:{}}),[e,r,n]),m=c.useCallback(({location:v,target:k})=>{l({anchor:b(v),flatIndex:k.flatIndex})},[b,l]),y=c.useCallback((v,k,g)=>{const E=k.snippet.split(`
|
|
51
|
+
`)[k.snippetAnchorOffset]??"",A=k.newLine??k.oldLine;return[{label:a("sourceCommentOnLine"),onSelect:()=>m({target:v,location:k,node:g})},{label:a("sourceCopyLine"),separatorBefore:!0,onSelect:()=>{we(E)}},{label:a("sourceCopyPathLine"),onSelect:()=>{we(A?`${e}:${A}`:e)}}]},[e,m,a]),S=c.useCallback((v,k)=>{u(k.x,k.y,v.node,y(v.target,v.location,v.node))},[y,u]),_=c.useCallback((v,k)=>{p(k,v.node,y(v.target,v.location,v.node))},[p,y]),{activeLine:C,resolveActiveLine:j}=df({container:s,structuredPatch:t,pending:o,revisions:n,consumeLongPressClick:h,onOpenComment:m,onOpenMenu:S,onBeginLongPress:_,onMoveLongPress:w,onEndLongPress:x,t:a});return i.jsxs(i.Fragment,{children:[C&&i.jsx("button",{type:"button",className:uf.menuTrigger,style:{top:C.top},"aria-label":a("sourceMoreActions"),title:a("sourceMoreActions"),onClick:v=>{const k=j();k&&f(v,y(k.target,k.location,k.node))},children:"⋯"}),d]})}const Dr=c.memo(function({as:t="div",trustedHtml:n,...r}){const s=ti(n);return i.jsx(t,{...r,dangerouslySetInnerHTML:s})}),gf="_root_nfjne_1",wf="_source_nfjne_7",vf="_editor_nfjne_11",yt={root:gf,source:wf,editor:vf};function Ot({before:e,editor:t,after:n}){return t?i.jsxs("div",{className:yt.root,"data-review-comment-split":"",children:[i.jsx("div",{className:yt.source,"data-review-comment-before":"",children:e}),i.jsx("div",{className:yt.editor,children:t}),i.jsx("div",{className:yt.source,"data-review-comment-after":"",children:n})]}):i.jsx(i.Fragment,{children:e})}function xf({editor:e}){return e?i.jsx("div",{className:yt.root,"data-review-comment-inline":"",children:i.jsx("div",{className:yt.editor,children:e})}):null}const yf=c.memo(function({diffHtml:t,structuredPatch:n,splitAfterLine:r,editor:s=null}){const o=c.useMemo(()=>xi(t),[t]),l=c.useMemo(()=>Vd(n),[n]),a=r===void 0?-1:l.findIndex(d=>d.type==="line"&&(d.left===r||d.right===r));return a<0||!s?i.jsx(Zn,{rows:l,fragments:o}):i.jsx(Ot,{before:i.jsx(Zn,{rows:l.slice(0,a+1),fragments:o}),editor:s,after:i.jsx(Zn,{rows:l.slice(a+1),fragments:o})})});function Zn({rows:e,fragments:t}){return i.jsx("div",{className:"side-by-side-diff",children:e.map((n,r)=>n.type==="header"?i.jsx(Dr,{className:"sbs-header highlighted-diff",trustedHtml:`<pre class="shiki"><code><span class="line line-hunk">${bf(n.text)}</span></code></pre>`},`h-${r}`):i.jsxs("div",{className:"sbs-row",children:[i.jsx(io,{col:"old",html:oo(t,n.left)}),i.jsx(io,{col:"new",html:oo(t,n.right)})]},`r-${r}`))})}function oo(e,t){return t===null?null:e.get(t)??null}function io({col:e,html:t}){return t===null?i.jsx("div",{className:"sbs-cell sbs-empty"}):i.jsx(Dr,{className:"sbs-cell highlighted-diff","data-diff-col":e,trustedHtml:`<pre class="shiki"><code>${t}</code></pre>`})}function bf(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}const Sf="_plain_v5smy_1",kf="_hunkHeader_v5smy_22",lo={plain:Sf,hunkHeader:kf},er=".line-deleted, .line-inserted, .diff-removed, .diff-added, .fixed-font-diff-removed, .fixed-font-diff-added",co=c.memo(function({diffHtml:t,structuredPatch:n,splitAfterLine:r,editor:s=null,plain:o=!1,hideRemovedLines:l=!1}){const a=c.useMemo(()=>o?new Map:xi(t,l),[t,l,o]),d=c.useMemo(()=>o?[]:Lf(n,l),[l,o,n]);if(o)return i.jsx(Cf,{hunks:n,hideRemovedLines:l});const u=r===void 0?-1:d.findIndex(f=>f.type==="line"&&f.flatIndex===r);return u<0||!s?i.jsx(tr,{rows:d,fragments:a,omitDiffPrefixes:l}):i.jsx(Ot,{before:i.jsx(tr,{rows:d.slice(0,u+1),fragments:a,omitDiffPrefixes:l}),editor:s,after:i.jsx(tr,{rows:d.slice(u+1),fragments:a,omitDiffPrefixes:l})})});function Cf({hunks:e,hideRemovedLines:t}){return i.jsx("div",{className:lo.plain,"data-diff-rendering":"plain",children:i.jsx("pre",{children:i.jsx("code",{children:e.map((n,r)=>i.jsxs(c.Fragment,{children:[!t&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:`${lo.hunkHeader} line-hunk`,children:`@@ -${n.oldStart},${n.oldLines} +${n.newStart},${n.newLines} @@`}),`
|
|
52
|
+
`]}),n.lines.filter(s=>!t||!s.startsWith("-")).map(s=>t?s.slice(1):s).join(`
|
|
53
|
+
`),r+1<e.length?`
|
|
54
|
+
`:""]},`${n.oldStart}:${n.newStart}:${r}`))})})})}function Lf(e,t){const n=[];let r=0;for(const s of e){t||n.push({type:"header",text:`@@ -${s.oldStart},${s.oldLines} +${s.newStart},${s.newLines} @@`});for(const o of s.lines)(!t||!o.startsWith("-"))&&n.push({type:"line",flatIndex:r,text:o}),r+=1}return n}function tr({rows:e,fragments:t,omitDiffPrefixes:n}){const r=e.map(s=>s.type==="header"?`<span class="line line-hunk">${nr(s.text)}</span>`:t.get(s.flatIndex)??`<span class="${_f(s.text)}" data-diff-line="${s.flatIndex}">${n?"":`<span class="diff-prefix">${nr(s.text[0]??" ")}</span>`}${nr(s.text.slice(1))}</span>`).join("");return i.jsx(Dr,{className:"highlighted-diff",trustedHtml:`<pre class="shiki"><code>${r}</code></pre>`})}function _f(e){return e[0]==="-"?"line line-deleted":e[0]==="+"?"line line-inserted":"line line-context"}function nr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}const Ef="_plainNotice_xkep3_1",jf={plainNotice:Ef},Rf=1e6*20;function Mf(e){return e.flatMap(t=>t.lines).join(`
|
|
55
|
+
`)}function ao(e){return e.length===0?null:e.map(t=>t.lines.filter(n=>n.startsWith(" ")||n.startsWith("+")).map(n=>n.slice(1)).join(`
|
|
56
|
+
`)).join(`
|
|
57
|
+
`)}function gn(e){return e.closest(".git-diff-preview-body, .modal-content")??e}const Gt={kind:"worktree"},Af={kind:"working-tree-history"};function jn(e){if(e.kind==="commit")return e.sha;if(e.kind==="comparison"||e.kind==="inclusive-comparison")return e.headSha}function Ir(e){const t=Math.max(0,e.scrollHeight-e.clientHeight);return t===0?0:Math.min(1,Math.max(0,e.scrollTop/t))}function Pf(e,t){const n=Math.max(0,e.scrollHeight-e.clientHeight);e.scrollTop=n*Math.min(1,Math.max(0,t))}function vr(e,t,n,r){return e==="commit"?{kind:"commit",sha:t}:e==="comparison"||e==="inclusive-comparison"?{kind:e,baseSha:t,headSha:n}:e==="file-projection"?{kind:"file-projection",mode:r}:e==="working-tree-history"?Af:Gt}function ki(e,t,n,r,s){return n.kind==="commit"?te.getGitCommitDiff(e,{sha:n.sha,path:t.path,status:t.status,...t.origPath?{origPath:t.origPath}:{},fullContext:r,...s?{ignoreWhitespace:!0}:{}}):n.kind==="comparison"||n.kind==="inclusive-comparison"?(n.kind==="inclusive-comparison"?te.getGitInclusiveComparisonDiff:te.getGitComparisonDiff)(e,{baseSha:n.baseSha,headSha:n.headSha,path:t.path,status:t.status,...t.origPath?{origPath:t.origPath}:{},fullContext:r,...s?{ignoreWhitespace:!0}:{}}):n.kind==="file-projection"?te.getGitFileProjectionDiff(e,{path:t.path,mode:n.mode,...t.origPath?{origPath:t.origPath}:{},fullContext:r}):te.getGitDiff(e,{path:t.path,staged:t.staged,status:t.status,...n.kind==="working-tree-history"?{againstHead:!0,...t.origPath?{origPath:t.origPath}:{}}:{},fullContext:r,...s?{ignoreWhitespace:!0}:{}})}function Tf(e){if(e.kind==="commit"){const t={kind:"sha",sha:e.sha};return{old:t,new:t}}if(e.kind==="comparison"||e.kind==="inclusive-comparison")return{old:{kind:"sha",sha:e.baseSha},new:{kind:"sha",sha:e.headSha}}}const Pp=c.forwardRef(function({file:t,fileKey:n,projectId:r,source:s=Gt,headerActions:o,retainedScrollRatio:l,retainedDiffView:a,onRetainScrollRatio:d,onRetainDiffView:u,onCommentEditorOpenChange:f,captureReviewProjections:p=!1,ignoreWhitespace:w=!1,onToggleIgnoreWhitespace:x,onProjectionRequestFailure:h,t:b},m){const y=t?t.path.split("/").pop()||t.path:null,S=c.useRef(null),_=c.useRef(null),C=c.useCallback(j=>{_.current=j},[]);return c.useImperativeHandle(m,()=>({jumpToNextHunk:()=>{var j;return((j=_.current)==null?void 0:j.next())??!1},jumpToPreviousHunk:()=>{var j;return((j=_.current)==null?void 0:j.previous())??!1},scrollByPage:j=>{const v=S.current;if(!v)return;const k=Math.max(0,v.scrollHeight-v.clientHeight);v.scrollTop=Math.min(k,Math.max(0,v.scrollTop+j*v.clientHeight))}}),[]),c.useLayoutEffect(()=>{const j=S.current;return()=>{!n||!j||d==null||d(n,Ir(j))}},[n,d]),i.jsx("section",{className:"git-diff-preview-pane",children:i.jsx("div",{className:"git-diff-preview-body",ref:S,children:t&&n?i.jsx(Or,{file:t,fileKey:n,projectId:r,source:s,retainedScrollRatio:l,scrollContainerRef:S,retainedDiffView:a,onRetainDiffView:u,paneHeader:{title:y??t.path,path:t.path,actions:o,revision:i.jsx(Pr,{projectId:r,path:t.path,origPath:jn(s)?void 0:t.origPath,rev:jn(s),dirtyLabel:b("fileRevisionDirty"),uncommittedLabel:b("fileRevisionUncommitted")})},onHunkNavigationChange:C,onCommentEditorOpenChange:f,captureReviewProjections:p,ignoreWhitespace:w,onToggleIgnoreWhitespace:x,onProjectionRequestFailure:h,t:b}):i.jsxs(i.Fragment,{children:[i.jsx(Hr,{title:b("gitStatusDiffPreview"),path:"",actions:o}),i.jsx("div",{className:"git-diff-placeholder",children:b("gitStatusSelectFileForDiff")})]})})})});function Tp({file:e,fileKey:t,projectId:n,source:r=Gt,headerActions:s,retainedScrollRatio:o,retainedDiffView:l,onRetainScrollRatio:a,onRetainDiffView:d,onCommentEditorOpenChange:u,captureReviewProjections:f=!1,ignoreWhitespace:p=!1,onToggleIgnoreWhitespace:w,onProjectionRequestFailure:x,t:h,onClose:b}){const m=c.useRef(null);return c.useLayoutEffect(()=>{const y=m.current;return()=>{y&&(a==null||a(t,Ir(y)))}},[t,a]),i.jsxs(Lo,{title:e.path,onClose:b,closeOnBackGesture:!0,contentRef:m,children:[i.jsxs("div",{className:"git-diff-preview-header-actions",children:[i.jsx(Pr,{projectId:n,path:e.path,origPath:jn(r)?void 0:e.origPath,rev:jn(r),dirtyLabel:h("fileRevisionDirty"),uncommittedLabel:h("fileRevisionUncommitted")}),s]}),i.jsx(Or,{file:e,fileKey:t,projectId:n,source:r,retainedScrollRatio:o,scrollContainerRef:m,retainedDiffView:l,onRetainDiffView:d,onCommentEditorOpenChange:u,captureReviewProjections:f,ignoreWhitespace:p,onToggleIgnoreWhitespace:w,onProjectionRequestFailure:x,t:h})]})}function Or({file:e,fileKey:t,projectId:n,source:r=Gt,retainedDiffView:s,onRetainDiffView:o,paneHeader:l,onHunkNavigationChange:a,onCommentEditorOpenChange:d,captureReviewProjections:u=!1,ignoreWhitespace:f=!1,onToggleIgnoreWhitespace:p,onProjectionRequestFailure:w,retainedScrollRatio:x,scrollContainerRef:h,t:b}){const m=r.kind,y=r.kind==="commit"?r.sha:r.kind==="comparison"||r.kind==="inclusive-comparison"?r.baseSha:"",S=r.kind==="comparison"||r.kind==="inclusive-comparison"?r.headSha:"",_=r.kind==="file-projection"?r.mode:"worktree",C=JSON.stringify([t,m,y,S,_,f]),[j,v]=c.useState(()=>({requestKey:C,result:null,loading:!0,error:null})),k=j.requestKey===C?j:{result:null,loading:!0,error:null},{result:g,loading:E,error:A}=k,B=c.useRef({fileKey:t,view:s});B.current.fileKey!==t&&(B.current={fileKey:t,view:s});const T=c.useCallback(($,I)=>{B.current.fileKey===$&&(B.current.view={...B.current.view,...I}),o==null||o($,I)},[o]),P=c.useRef(g),M=c.useRef(x===void 0?null:{fileKey:t,ratio:x});P.current=g,c.useLayoutEffect(()=>{M.current=x===void 0?null:{fileKey:t,ratio:x}},[t,x]),c.useLayoutEffect(()=>{const $=M.current;if(!g||($==null?void 0:$.fileKey)!==t)return;const I=h==null?void 0:h.current;I&&(Pf(I,$.ratio),M.current=null)},[g,t,h]),c.useEffect(()=>{let $=!1;return v(I=>I.requestKey===C?{...I,loading:!0,error:null}:{requestKey:C,result:null,loading:!0,error:null}),ki(n,e,vr(m,y,S,_),void 0,f).then(I=>{if(!$){const H=h==null?void 0:h.current;P.current&&H&&(M.current={fileKey:t,ratio:Ir(H)}),v({requestKey:C,result:I,loading:!1,error:null})}}).catch(I=>{if(!$){(f||m==="comparison"||m==="inclusive-comparison")&&(w==null||w(I));const H=I.message||b("gitStatusLoadDiffFailed");v(q=>q.requestKey===C?{...q,loading:!1,error:H}:{requestKey:C,result:null,loading:!1,error:H})}}),()=>{$=!0}},[n,e,t,C,m,y,S,_,f,w,h,b]);const F=E&&!g;return i.jsxs(i.Fragment,{children:[l&&(F||!g&&A)&&i.jsx(Hr,{title:l.title,path:l.path,actions:l.actions,revision:l.revision}),F&&i.jsx("div",{className:"git-diff-loading",children:b("gitStatusLoadingDiff")}),!g&&A&&i.jsx("div",{className:"git-diff-error",children:A}),g&&i.jsxs(i.Fragment,{children:[A&&i.jsx("div",{className:"git-diff-error",children:A}),i.jsx(Ff,{file:e,fileKey:t,projectId:n,source:r,diffResult:g,retainedDiffView:B.current.view,onRetainDiffView:T,paneHeader:l,onHunkNavigationChange:a,onCommentEditorOpenChange:d,captureReviewProjections:u,ignoreWhitespace:f,onToggleIgnoreWhitespace:p,onProjectionRequestFailure:w,t:b},C)]})]})}function Ff({file:e,fileKey:t,projectId:n,source:r=Gt,diffResult:s,retainedDiffView:o,onRetainDiffView:l,paneHeader:a,onHunkNavigationChange:d,onCommentEditorOpenChange:u,captureReviewProjections:f=!1,ignoreWhitespace:p=!1,onToggleIgnoreWhitespace:w,onProjectionRequestFailure:x,t:h}){const[b,m]=c.useState(()=>((o==null?void 0:o.showFullContext)??!1)||((o==null?void 0:o.hideRemovedLines)??!1)),[y,S]=c.useState(()=>(o==null?void 0:o.hideRemovedLines)??!1),_=c.useMemo(()=>JSON.stringify([s.structuredPatch,s.previewSkipped??null]),[s.previewSkipped,s.structuredPatch]),[C,j]=c.useState({revisionKey:null,result:null,loading:!1,error:null}),v=C.revisionKey===_?C:{result:null,loading:!1,error:null},{result:k,loading:g,error:E}=v,[A,B]=c.useState(()=>(o==null?void 0:o.showMarkdownPreview)??!1),T=c.useRef(null),P=c.useRef(null),[M,F]=c.useState(null),$=c.useCallback(U=>{T.current=U,F(U)},[]),[I,H]=Bd(),[q,D]=c.useState(0),W=r.kind,Y=r.kind==="commit"?r.sha:r.kind==="comparison"||r.kind==="inclusive-comparison"?r.baseSha:"",oe=r.kind==="comparison"||r.kind==="inclusive-comparison"?r.headSha:"",X=r.kind==="file-projection"?r.mode:"worktree",fe=c.useMemo(()=>Tf(vr(W,Y,oe,X)),[Y,X,oe,W]);c.useEffect(()=>{const U=T.current;if(!U||typeof ResizeObserver>"u")return;const O=new ResizeObserver(Q=>{var ge;const me=(ge=Q[0])==null?void 0:ge.contentRect.width;typeof me=="number"&&D(me)});return O.observe(U),()=>O.disconnect()},[]);const Z=c.useCallback(()=>{H(I==="auto"?"unified":I==="unified"?"side-by-side":"auto")},[I,H]),J=ar(e.path),ee=c.useMemo(()=>J?wr(Mf(s.structuredPatch),{diffAware:!0,baseFilePath:e.path,projectId:n}):null,[s.structuredPatch,e.path,J,n]),L=c.useMemo(()=>k?ao(k.structuredPatch):null,[k]),re=c.useMemo(()=>!J||L===null||k!=null&&k.markdownHtml?null:wr(L,{baseFilePath:e.path,projectId:n}),[e.path,k==null?void 0:k.markdownHtml,L,J,n]),ye=(k==null?void 0:k.markdownHtml)||(re==null?void 0:re.html),ke=J&&(!!s.markdownHtml||(ee==null?void 0:ee.changed)===!0||(re==null?void 0:re.changed)===!0),ue=A&&ke,Pe=b?ye:ee==null?void 0:ee.html,z=c.useCallback(U=>{l==null||l(t,U)},[t,l]),he=c.useCallback(async()=>{if(k)return k;if(g)return null;const U=_;j(O=>O.revisionKey===U?{...O,loading:!0,error:null}:{revisionKey:U,result:null,loading:!0,error:null});try{const O=await ki(n,e,vr(W,Y,oe,X),!0,p);return j(Q=>Q.revisionKey===U?{revisionKey:U,result:O,loading:!1,error:null}:Q),O}catch(O){(p||W==="comparison"||W==="inclusive-comparison")&&(x==null||x(O));const Q=O instanceof Error?O.message:h("gitStatusLoadContextFailed");return j(me=>me.revisionKey===U?{revisionKey:U,result:null,loading:!1,error:Q}:me),null}},[k,g,_,n,e,W,Y,oe,X,p,x,h]),qe=c.useCallback(async()=>{const U=!b;if(U&&!await he())return;const O=T.current,Q=O?gn(O):null;P.current=fr(Q,(O==null?void 0:O.querySelector(er))??null),m(U),U||S(!1),z({showFullContext:U,...U?{}:{hideRemovedLines:!1}})},[he,z,b]),Xt=c.useCallback(async()=>{const U=!y;if(U&&!await he())return;const O=T.current,Q=O?gn(O):null;P.current=fr(Q,(O==null?void 0:O.querySelector(er))??null),U&&m(!0),S(U),z({hideRemovedLines:U,...U?{showFullContext:!0}:{}})},[y,he,z]),Yt=c.useCallback(()=>{const U=!A;B(U),z({showMarkdownPreview:U})},[z,A]),Fn=c.useCallback(async()=>{const U=b?k??await he():s,O=U?ao(U.structuredPatch):null;if(O===null)throw new Error("Diff content is unavailable");return O},[s,k,he,b]);c.useEffect(()=>{b&&!k&&!g&&he()},[g,k,he,b]),c.useLayoutEffect(()=>{var O;const U=P.current;U&&(P.current=null,oi(U,((O=T.current)==null?void 0:O.querySelector(er))??null))},[b,y,k]);const de=b&&k?k:s,We=de.renderMode==="plain"||de.diffHtml.length>Rf,Je=We?"":de.diffHtml,Qt=c.useMemo(()=>de.previewSkipped?null:Of(de.structuredPatch),[de.previewSkipped,de.structuredPatch]),Ke=de.previewSkipped??Qt,[Te,jt]=c.useState({index:0,count:0}),dt=c.useRef(Te);c.useEffect(()=>{dt.current=Te},[Te]);const Ze=c.useCallback(()=>ue||Ke||!T.current?[]:Array.from(T.current.querySelectorAll(".line-hunk")),[Ke,ue]),ft=c.useCallback(()=>{const U=T.current,O=Ze();if(!U||O.length===0){jt(ve=>ve.count===0?ve:{index:0,count:0});return}const me=gn(U).getBoundingClientRect().top+52;let ge=0;for(let ve=0;ve<O.length;ve++){const Ee=O[ve];if(Ee&&Ee.getBoundingClientRect().top<=me)ge=ve;else break}jt(ve=>ve.index===ge&&ve.count===O.length?ve:{index:ge,count:O.length})},[Ze]),le=c.useCallback(U=>{const O=Ze();if(O.length===0)return!1;const me=((dt.current.count===O.length?dt.current.index:0)+U+O.length)%O.length,ge=O[me];return!ge||typeof ge.scrollIntoView!="function"?!1:(ge.scrollIntoView({block:"start",behavior:"smooth"}),jt({index:me,count:O.length}),!0)},[Ze]),ze=c.useCallback(()=>le(1),[le]),Oe=c.useCallback(()=>le(-1),[le]);c.useEffect(()=>{const U=T.current;if(!U)return;const O=gn(U);let Q=requestAnimationFrame(ft),me=!1;const ge=()=>{me||(me=!0,Q=requestAnimationFrame(()=>{me=!1,ft()}))};return O.addEventListener("scroll",ge,{passive:!0}),()=>{cancelAnimationFrame(Q),O.removeEventListener("scroll",ge)}},[ft]),c.useEffect(()=>(d==null||d({next:ze,previous:Oe}),()=>d==null?void 0:d(null)),[ze,Oe,d]),c.useLayoutEffect(()=>{const U=O=>{const Q=O.key.toLowerCase();if(Q!=="n"&&Q!=="p"||O.altKey||O.ctrlKey||O.metaKey||vi(O.target))return;(Q==="n"?ze():Oe())&&O.preventDefault()};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[ze,Oe]);const Jt=Te.count>0?i.jsxs("span",{className:"diff-hunk-navigation",children:[i.jsx("button",{type:"button",className:"diff-hunk-step",onClick:Oe,title:h("sourcePreviousHunkShortcut"),"aria-label":h("sourcePreviousHunkShortcut"),children:"‹"}),i.jsxs("span",{className:"diff-hunk-indicator",children:[Te.index+1,"/",Te.count]}),i.jsx("button",{type:"button",className:"diff-hunk-step",onClick:ze,title:h("sourceNextHunkShortcut"),"aria-label":h("sourceNextHunkShortcut"),children:"›"})]}):null,ht=i.jsxs(i.Fragment,{children:[Jt,w&&i.jsx("button",{type:"button",className:`diff-context-toggle diff-toolbar-icon-button ${p?"active":""}`,onClick:w,title:h(p?"gitStatusIgnoreWhitespaceActive":"gitStatusIgnoreWhitespace"),"aria-label":h(p?"gitStatusIgnoreWhitespaceActive":"gitStatusIgnoreWhitespace"),"aria-pressed":p,children:i.jsx("span",{className:"diff-whitespace-glyph","aria-hidden":"true",children:"_+"})}),ke&&i.jsx("button",{type:"button",className:`diff-context-toggle diff-toolbar-icon-button ${ue?"active":""}`,onClick:Yt,title:h(ue?"gitStatusDiff":"gitStatusPreview"),"aria-label":h(ue?"gitStatusDiff":"gitStatusPreview"),"aria-pressed":ue,children:i.jsx(Bf,{showDiff:ue})}),i.jsx("button",{type:"button",className:`diff-context-toggle diff-toolbar-icon-button ${b?"active":""}`,onClick:qe,disabled:g,title:h(g?"gitStatusLoading":b?"gitStatusDiffOnly":"gitStatusFullContext"),"aria-label":h(g?"gitStatusLoading":b?"gitStatusDiffOnly":"gitStatusFullContext"),"aria-pressed":b,children:i.jsx(Nf,{expanded:b})}),i.jsx("button",{type:"button",className:`diff-context-toggle diff-toolbar-icon-button ${y?"active":""}`,onClick:Xt,disabled:g,title:h(y?"gitStatusShowRemovedLines":"gitStatusHideRemovedLines"),"aria-label":h(y?"gitStatusShowRemovedLines":"gitStatusHideRemovedLines"),"aria-pressed":y,children:i.jsx($f,{hidden:y})}),i.jsx(Fu,{value:Fn,title:h("fileViewerCopyContent"),className:"diff-context-toggle diff-toolbar-icon-button",disabled:g||!!Ke||de.structuredPatch.length===0,icon:"content"}),!ue&&!We&&!y&&i.jsx("button",{type:"button",className:"diff-context-toggle diff-toolbar-icon-button",onClick:Z,title:`${h("diffViewModeTitle")}: ${h(uo(I))}`,"aria-label":`${h("diffViewModeTitle")}: ${h(uo(I))}`,children:i.jsx(Df,{mode:I})})]}),et=(U,O)=>de.structuredPatch.length===0?i.jsx("div",{className:"git-diff-empty-projection",children:h(p?"gitStatusWhitespaceChangesHidden":"gitStatusNoContentChanges")}):Je&&!y&&Ud(I,q)==="side-by-side"?i.jsx(yf,{diffHtml:Je,structuredPatch:de.structuredPatch,splitAfterLine:U,editor:O}):Je?i.jsx(co,{diffHtml:Je,structuredPatch:de.structuredPatch,hideRemovedLines:y,plain:We,splitAfterLine:U,editor:O}):i.jsx(co,{diffHtml:"",structuredPatch:de.structuredPatch,hideRemovedLines:y,plain:We,splitAfterLine:U,editor:O});return i.jsxs(i.Fragment,{children:[a?i.jsx(Hr,{title:a.title,path:a.path,actions:a.actions,revision:a.revision,children:ht}):i.jsxs("div",{className:"diff-context-controls source-diff-context-controls",children:[i.jsx("span",{className:"diff-context-path",children:e.path}),i.jsx("div",{className:"diff-context-buttons",children:ht})]}),E&&i.jsx("div",{className:"diff-context-error",children:E}),i.jsxs("div",{className:"diff-modal-content source-diff-pane diff-gutter-aligned",ref:$,children:[We&&!Ke&&!ue&&i.jsx("div",{className:jf.plainNotice,children:h("gitStatusDiffPlainMode")}),ue&&Pe?i.jsx(Fo,{html:Pe,sourcePath:e.path}):Ke?i.jsx(If,{file:e,previewSkipped:Ke,t:h}):M?i.jsx(mf,{projectId:n,filePath:e.path,structuredPatch:de.structuredPatch,revisions:fe,projections:f?de.reviewProjections:void 0,container:M,onOpenChange:u,renderSource:({openComment:U,editor:O})=>et(U==null?void 0:U.flatIndex,O),t:h}):et(void 0,null)]})]})}function Hr({title:e,path:t,actions:n,revision:r,children:s}){const o=t&&t!==e?t.endsWith(e)?t.slice(0,-e.length).replace(/\/$/,""):t:"";return i.jsxs("div",{className:`git-diff-pane-toolbar ${qn.header}`,children:[i.jsxs("div",{className:qn.identity,children:[i.jsxs("span",{className:"git-diff-file-identity",title:t||e,children:[o&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"git-diff-toolbar-path",children:o}),i.jsx("span",{className:"git-diff-toolbar-separator","aria-hidden":"true",children:"/"})]}),i.jsx("h3",{className:"git-diff-preview-title",children:e})]}),r]}),i.jsxs("div",{className:qn.actions,children:[s&&i.jsx("div",{className:"diff-context-buttons",children:s}),n&&i.jsx("div",{className:"git-diff-preview-header-actions",children:n})]})]})}function Nf({expanded:e}){return i.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:[i.jsx("path",{d:"M5 12h14"}),e?i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"m8 7 4-4 4 4"}),i.jsx("path",{d:"m8 17 4 4 4-4"})]}):i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"m8 3 4 4 4-4"}),i.jsx("path",{d:"m8 21 4-4 4 4"})]})]})}function $f({hidden:e}){return i.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:[i.jsx("path",{d:"M5 7h14M5 12h14M5 17h14"}),e&&i.jsx("path",{d:"M4 4l16 16"})]})}function Bf({showDiff:e}){return e?i.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"m8 9-4 3 4 3M16 9l4 3-4 3M14 5l-4 14"})}):i.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:[i.jsx("path",{d:"M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12Z"}),i.jsx("circle",{cx:"12",cy:"12",r:"2.5"})]})}function Df({mode:e}){return i.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:e==="side-by-side"?i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M3 7h7M14 7h7"}),i.jsx("path",{d:"M3 12h7M14 12h7"}),i.jsx("path",{d:"M3 17h7M14 17h7"})]}):i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M4 7h16M4 12h16M4 17h16"}),e==="auto"&&i.jsx("path",{d:"M5 4h4M5 4v3M19 20h-4M19 20v-3"})]})})}function uo(e){switch(e){case"unified":return"diffViewModeUnified";case"side-by-side":return"diffViewModeSideBySide";default:return"diffViewModeAuto"}}function If({file:e,previewSkipped:t,t:n}){return i.jsxs("div",{className:"git-diff-preview-skipped",children:[i.jsx("div",{className:"git-diff-preview-skipped-title",children:n("gitStatusDiffPreviewSkipped")}),i.jsx("div",{className:"git-diff-preview-skipped-message",children:Hf(t,n)}),i.jsxs("dl",{className:"git-diff-preview-skipped-details",children:[i.jsxs("div",{children:[i.jsx("dt",{children:n("gitStatusDiffPreviewSkippedPath")}),i.jsx("dd",{children:e.path})]}),t.totalBytes!==void 0&&i.jsxs("div",{children:[i.jsx("dt",{children:n("gitStatusDiffPreviewSkippedSize")}),i.jsx("dd",{children:Uf(t.totalBytes)})]}),t.totalChars!==void 0&&i.jsxs("div",{children:[i.jsx("dt",{children:n("gitStatusDiffPreviewSkippedCharacters")}),i.jsx("dd",{children:t.totalChars.toLocaleString()})]}),t.totalLines!==void 0&&i.jsxs("div",{children:[i.jsx("dt",{children:n("gitStatusDiffPreviewSkippedLines")}),i.jsx("dd",{children:t.totalLines.toLocaleString()})]}),t.maxLineChars!==void 0&&i.jsxs("div",{children:[i.jsx("dt",{children:n("gitStatusDiffPreviewSkippedLineLength")}),i.jsx("dd",{children:t.maxLineChars.toLocaleString()})]}),t.htmlChars!==void 0&&i.jsxs("div",{children:[i.jsx("dt",{children:n("gitStatusDiffPreviewSkippedHtmlSize")}),i.jsx("dd",{children:t.htmlChars.toLocaleString()})]})]})]})}function Of(e){let t=0,n=0;for(const r of e)for(const s of r.lines)for(const o of s){const l=o.codePointAt(0);if(l!==void 0){if(l===0||l===65533)return{reason:"binary"};t+=1,(l<32&&l!==8&&l!==9&&l!==10&&l!==12&&l!==13&&l!==27||l===127)&&(n+=1)}}return n/Math.max(t,1)>.01?{reason:"binary"}:null}function Hf(e,t){switch(e.reason){case"binary":return t("gitStatusDiffPreviewSkippedBinary");case"content-too-large":return t("gitStatusDiffPreviewSkippedContentTooLarge");case"line-too-long":return t("gitStatusDiffPreviewSkippedLineTooLong");case"html-too-large":return t("gitStatusDiffPreviewSkippedHtmlTooLarge")}}function Uf(e){return e<1024?`${e} B`:e<1024*1024?`${fo(e/1024)} KB`:`${fo(e/(1024*1024))} MB`}function fo(e){return e>=10?e.toFixed(0):e.toFixed(1)}function Ci(e){var u,f;const{sourceKey:t,transport:n}=Cr(),r=Sr(t),{principal:s,resolved:o}=Zl(),l=r==null?void 0:r.artifactViewer,a=(l==null?void 0:l.vhostPublicRoot)??(l!=null&&l.localOrigin?"localhost":void 0),d=lt(r,Wn.vhostFileSites.name)&&o&&(s.username===null||lt(r,Wn.vhostFileSiteReplacement.name)&&((u=s.grants)==null?void 0:u.allowPublicApps)===!0&&!!e&&bc(s.grants,e)==="new-session")&&!(l!=null&&l.locked);return c.useMemo(()=>{var p;return d&&a?{hostSuffix:a,canReplace:lt(r,Wn.vhostFileSiteReplacement.name),canUsePrivateLinks:((p=s.grants)==null?void 0:p.allowPrivateAppLinks)!==!1,list:async w=>(await n.fetch(`/artifacts/vhost-sites?${new URLSearchParams({path:w,...e?{projectId:e}:{}})}`)).sites,serve:w=>n.fetch("/artifacts/vhost-sites",{method:"POST",body:JSON.stringify({...w,...e?{projectId:e}:{}})}),stop:async w=>{await n.fetch(`/artifacts/vhost-sites/${encodeURIComponent(w)}`,{method:"DELETE"})}}:null},[d,a,n,e,r,(f=s.grants)==null?void 0:f.allowPrivateAppLinks])}const Vf="_section_49wo0_4",qf="_heading_49wo0_11",Wf="_description_49wo0_15",Kf="_error_49wo0_22",zf="_form_49wo0_28",Gf="_nameField_49wo0_35",Xf="_scheme_49wo0_63",Yf="_suffix_49wo0_64",Qf="_access_49wo0_76",Jf="_replace_49wo0_84",Zf="_sites_49wo0_116",eh="_site_49wo0_116",th="_url_49wo0_135",nh="_badge_49wo0_144",rh="_actions_49wo0_161",ae={section:Vf,heading:qf,description:Wf,error:Kf,form:zf,nameField:Gf,scheme:Xf,suffix:Yf,access:Qf,replace:Jf,sites:Zf,site:eh,url:th,badge:nh,public:"_public_49wo0_156",actions:rh};function sh(e){const t=e.split(/[\\/]/).at(-1)??"",r=(t.replace(/\.[^.]*$/,"")||t).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40).replace(/-+$/,"");return r==="index"?"":r}function oh({filePath:e,service:t}){const{t:n}=Ie(),r=c.useId(),[s,o]=c.useState(null),[l,a]=c.useState(()=>sh(e)),[d,u]=c.useState("public"),[f,p]=c.useState(""),[w,x]=c.useState(!1),[h,b]=c.useState(!1),[m,y]=c.useState(null),[S,_]=c.useState(null),C=c.useCallback(async()=>{y(null);try{o(await t.list(e))}catch(k){o([]),y(k instanceof Error?k.message:String(k))}},[e,t]);c.useEffect(()=>{C()},[C]);const j=async()=>{const k=l.trim().toLowerCase();if(k){b(!0),y(null),_(null);try{const g=await t.serve({name:k,path:e,public:d!=="link",...d==="password"?{password:f}:{},...w?{replace:!0}:{}});p(""),o(A=>[...(A??[]).filter(B=>B.name!==g.name),g]);const E=g.publicUrl??g.localUrl;E&&await we(E)&&_(n("fileVhostCopied"))}catch(g){y(g instanceof Error?g.message:String(g))}finally{b(!1)}}},v=async k=>{if(window.confirm(n("fileVhostStopConfirm",{name:k.name}))){b(!0),y(null),_(null);try{await t.stop(k.name),o(g=>(g??[]).filter(E=>E.name!==k.name)),_(n("fileVhostStopped"))}catch(g){y(g instanceof Error?g.message:String(g))}finally{b(!1)}}};return i.jsxs("section",{className:ae.section,"aria-labelledby":`${r}-heading`,children:[i.jsx("strong",{id:`${r}-heading`,className:ae.heading,children:n("fileVhostHeading")}),i.jsx("p",{className:ae.description,children:n("fileVhostDescription")}),s===null?i.jsx("p",{className:ae.description,children:n("fileVhostLoading")}):s.length>0?i.jsx("ul",{className:ae.sites,children:s.map(k=>{const g=k.publicUrl??k.localUrl;return i.jsxs("li",{className:ae.site,children:[g?i.jsx("a",{className:ae.url,href:g,target:"_blank",rel:"noopener noreferrer",children:ih(g)}):i.jsx("span",{className:ae.url,children:k.name}),i.jsx("span",{className:`${ae.badge} ${k.public&&!k.passwordProtected?ae.public:""}`,children:k.public?k.passwordProtected?n("fileVhostPasswordBadge"):n("fileVhostPublicBadge"):n("fileVhostPrivateBadge")}),i.jsxs("span",{className:ae.actions,children:[g&&i.jsx("button",{type:"button",className:"settings-button",disabled:h,onClick:async()=>_(await we(g)?n("fileVhostCopied"):n("viewerCopyLinkFailed")),children:n("fileVhostCopy")}),i.jsx("button",{type:"button",className:"settings-button",disabled:h,onClick:()=>void v(k),children:n("fileVhostStop")})]})]},k.name)})}):null,s!==null&&(s.length===0||t.canReplace)&&i.jsxs("form",{className:ae.form,onSubmit:k=>{k.preventDefault(),j()},children:[i.jsxs("label",{className:ae.nameField,htmlFor:`${r}-name`,children:[i.jsx("span",{className:ae.scheme,children:"https://"}),i.jsx("input",{id:`${r}-name`,"aria-label":n("fileVhostName"),value:l,onChange:k=>a(k.target.value),autoComplete:"off",spellCheck:!1,disabled:h,placeholder:n("fileVhostNamePlaceholder")}),i.jsxs("span",{className:ae.suffix,children:[".",t.hostSuffix,"/"]})]}),i.jsxs("label",{className:ae.access,children:[n("fileVhostAccess"),i.jsxs("select",{value:d,onChange:k=>u(k.target.value),disabled:h,children:[i.jsx("option",{value:"public",children:n("fileVhostAccessPublic")}),i.jsx("option",{value:"password",children:n("fileVhostAccessPassword")}),t.canUsePrivateLinks!==!1&&i.jsx("option",{value:"link",children:n("fileVhostAccessLink")})]})]}),d==="password"&&i.jsxs("label",{className:ae.access,children:[n("fileVhostPassword"),i.jsx("input",{type:"password",value:f,onChange:k=>p(k.target.value),autoComplete:"new-password",disabled:h})]}),t.canReplace&&i.jsxs("label",{className:ae.replace,children:[i.jsx("input",{type:"checkbox",checked:w,onChange:k=>x(k.target.checked),disabled:h}),n("fileVhostReplace")]}),i.jsx("button",{type:"submit",className:"settings-button settings-button-primary",disabled:h||!l.trim()||d==="password"&&!f,children:n(h?"fileVhostServing":"fileVhostServe")})]}),m&&i.jsx("p",{className:ae.error,role:"alert",children:m}),S&&i.jsx("p",{className:ae.description,role:"status",children:S})]})}function ih(e){const t=new URL(e);return`${t.host}${t.pathname==="/"?"":t.pathname}`}const lh="_modal_v6w6p_1",ch="_fileIdentity_v6w6p_10",ah="_liveBadge_v6w6p_39",uh="_description_v6w6p_52",dh="_warning_v6w6p_59",fh="_createButton_v6w6p_82",hh="_manualCopy_v6w6p_97",mh="_inventory_v6w6p_118",ph="_inventoryHeading_v6w6p_123",Se={modal:lh,fileIdentity:ch,liveBadge:ah,description:uh,warning:dh,createButton:fh,manualCopy:hh,inventory:mh,inventoryHeading:ph};function gh({anchorRect:e,filePath:t,projectId:n,title:r,playLinks:s=!1,onClose:o}){const{t:l}=Ie(),a=Ci(n),d=jc({projectId:n,path:t}),u=ec(),f=T=>s&&Al(T)||T,[p,w]=c.useState([]),[x,h]=c.useState(!0),[b,m]=c.useState(null),[y,S]=c.useState(null),[_,C]=c.useState(null),[j,v]=c.useState(null),k=c.useRef(null),g=c.useCallback(async()=>{if(!u){h(!1);return}h(!0),S(null);try{const T=await te.getPublicFileShares(n,t);w(T.items)}catch(T){S(T instanceof Error?T.message:l("publicFileShareLoadFailed"))}finally{h(!1)}},[t,n,l,u]);c.useEffect(()=>{g()},[g]),c.useEffect(()=>{var T,P;j&&((T=k.current)==null||T.focus(),(P=k.current)==null||P.select())},[j]);const E=async()=>{m("create"),S(null),C(null),v(null);const T=te.createPublicFileShare({projectId:n,path:t,...r?{title:r}:{}}),P=kt(T.then(M=>f(M.url)));try{const M=await T;await P?C(l("publicFileShareCopied")):(v(f(M.url)),C(l("publicFileShareManualCopy"))),await g()}catch(M){S(M instanceof Error?M.message:l("publicFileShareCreateFailed"))}finally{m(null)}},A=async T=>{S(null),C(null),v(null);const P=f(T.url);if(await kt(Promise.resolve(P))){C(l("publicFileShareCopied"));return}v(P),C(l("publicFileShareManualCopy"))},B=async T=>{if(window.confirm(l("publicShareManagementRevokeOneConfirm"))){m(`revoke:${T.shareId}`),S(null),C(null);try{await te.revokePublicFileShare(T.shareId),w(P=>P.filter(M=>M.shareId!==T.shareId)),C(l("publicFileShareRevoked"))}catch(P){S(P instanceof Error?P.message:l("publicFileShareRevokeFailed"))}finally{m(null)}}};return i.jsx(Lo,{anchorRect:e,title:l("publicFileShareTitle"),onClose:o,children:i.jsxs("div",{className:Se.modal,children:[i.jsxs("div",{className:Se.fileIdentity,title:t,children:[i.jsx(wh,{}),i.jsx("span",{children:t}),i.jsx("span",{className:Se.liveBadge,children:l("publicShareLiveBadge")})]}),i.jsx("p",{className:Se.description,children:l("publicFileShareDescription")}),d&&i.jsxs("section",{className:Se.inventory,children:[i.jsx("p",{className:Se.description,children:l("projectFileLinkAccess")}),i.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:new URL(d).host}),i.jsx("button",{type:"button",className:`settings-button settings-button-primary ${Se.createButton}`,onClick:()=>{kt(Promise.resolve(d)).then(T=>{C(l(T?"publicFileShareCopied":"publicFileShareManualCopy")),T||v(d)})},children:l("projectFileLinkCopy")})]}),s&&i.jsx("p",{className:Se.description,children:l("publicFileSharePlayLinks")}),i.jsxs("div",{className:Se.warning,role:"note",children:[i.jsx(vh,{}),i.jsx("span",{children:l("publicFileShareWarning")})]}),u&&i.jsxs("button",{type:"button",className:`settings-button settings-button-primary ${Se.createButton}`,disabled:b!==null,onClick:()=>void E(),children:[i.jsx(xh,{}),l(b==="create"?"publicFileShareCreating":"publicFileShareCreate")]}),j&&i.jsxs("label",{className:Se.manualCopy,children:[i.jsx("span",{children:l("publicFileShareUrlLabel")}),i.jsx("input",{ref:k,readOnly:!0,value:j})]}),y&&i.jsx(Ts,{tone:"error",children:y}),_&&i.jsx(Ts,{tone:"notice",children:_}),u&&i.jsxs("div",{className:Se.inventory,children:[i.jsx("div",{className:Se.inventoryHeading,children:i.jsx("strong",{children:l("publicFileShareExisting")})}),x?i.jsx(Fs,{loading:!0,children:l("publicFileShareLoading")}):p.length===0?i.jsx(Fs,{children:l("publicFileShareEmpty")}):i.jsx(Sc,{compact:!0,children:p.map(T=>{const P=b===`revoke:${T.shareId}`;return i.jsx(kc,{title:T.title||t.split("/").at(-1)||t,mode:"live",modeLabel:l("publicShareLiveBadge"),copyAction:{label:l("publicFileShareCopy"),disabled:b!==null,onClick:()=>void A(T)},revokeAction:{label:l("publicFileShareRevoke"),disabled:b!==null,working:P,onClick:()=>void B(T)},children:i.jsx(Cc,{children:new Date(T.createdAt).toLocaleString()})},T.shareId)})}),!x&&i.jsx(Lc,{children:l("publicFileShareCount",{count:p.length})})]}),a&&i.jsx(oh,{filePath:t,service:a})]})})}function wh(){return i.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor","aria-hidden":"true",children:i.jsx("path",{d:"M5 2.5h6l4 4v11H5zM11 2.5v4h4"})})}function vh(){return i.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor","aria-hidden":"true",children:i.jsx("path",{d:"M10 2.5 18 17H2zM10 7v4.5M10 14.5v.1"})})}function xh(){return i.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor","aria-hidden":"true",children:i.jsx("path",{d:"m8 12 4-4M6.5 14.5l-1 1a2.8 2.8 0 0 1-4-4l3-3a2.8 2.8 0 0 1 4 0M13.5 5.5l1-1a2.8 2.8 0 1 1 4 4l-3 3a2.8 2.8 0 0 1-4 0"})})}const yh="_viewer_1u0i8_1",bh="_header_1u0i8_6",Sh="_identityRow_1u0i8_11",kh="_context_1u0i8_18",Ch="_info_1u0i8_29",Lh="_path_1u0i8_34",_h="_measurement_1u0i8_46",Eh="_pathMeasure_1u0i8_53",jh="_actions_1u0i8_60",Rh="_body_1u0i8_69",Mh="_backButton_1u0i8_73",Ah="_htmlPreviewFrame_1u0i8_80",Ph="_diffBody_1u0i8_88",Th="_reloadStale_1u0i8_93",Fh="_rawToggle_1u0i8_97",Nh="_commentToggle_1u0i8_107",$h="_commentSend_1u0i8_117",Bh="_provenanceRow_1u0i8_130",Dh="_quoteReplySurface_1u0i8_140",Ih="_windowActions_1u0i8_146",Oh="_fullscreenButton_1u0i8_152",se={viewer:yh,header:bh,identityRow:Sh,context:kh,info:Ch,path:Lh,measurement:_h,pathMeasure:Eh,actions:jh,body:Rh,backButton:Mh,htmlPreviewFrame:Ah,diffBody:Ph,reloadStale:Th,rawToggle:Fh,commentToggle:Nh,commentSend:$h,provenanceRow:Bh,quoteReplySurface:Dh,windowActions:Ih,fullscreenButton:Oh};function Hh(e){return e instanceof Element&&e.closest("input, textarea, select, [contenteditable]:not([contenteditable='false'])")!==null}function Uh(e){if(!e.isConnected||e.closest('[aria-hidden="true"]'))return!1;const t=e.closest('[role="dialog"]')??e.closest(".file-viewer")??e,n=e.ownerDocument.activeElement;return!n||n===e.ownerDocument.body||t.contains(n)}function Vh(e){var d,u,f;const t=e==null?void 0:e.ownerDocument.getSelection();if(!e||!t)return!1;const n=e.ownerDocument.createRange(),r=((d=e.ownerDocument.defaultView)==null?void 0:d.NodeFilter)??NodeFilter,s=e.ownerDocument.createTreeWalker(e,r.SHOW_TEXT),o=s.nextNode();if(o){let p=o;for(let w=s.nextNode();w;w=s.nextNode())p=w;n.setStart(o,0),n.setEnd(p,((u=p.textContent)==null?void 0:u.length)??0)}else n.selectNodeContents(e);t.removeAllRanges(),t.addRange(n);const l=((f=e.ownerDocument.defaultView)==null?void 0:f.Event)??Event;return e.ownerDocument.dispatchEvent(new l("selectionchange")),!0}function qh({className:e,contentRef:t}){const{t:n}=Ie(),r=c.useCallback(()=>Vh(t.current),[t]);c.useEffect(()=>{var d;const l=((d=t.current)==null?void 0:d.ownerDocument)??document,a=u=>{const f=t.current;!f||u.defaultPrevented||u.isComposing||u.altKey||u.shiftKey||!(u.ctrlKey||u.metaKey)||u.key.toLowerCase()!=="a"||Hh(u.target)||!Uh(f)||(u.preventDefault(),u.stopPropagation(),r())};return l.addEventListener("keydown",a,!0),()=>l.removeEventListener("keydown",a,!0)},[t,r]);const s=n("viewerSelectAll"),o=n("viewerSelectAllTitle");return i.jsx("button",{type:"button",className:e,onMouseDown:l=>l.preventDefault(),onPointerDown:l=>l.preventDefault(),onClick:r,title:o,"aria-label":s,children:i.jsx(Wh,{})})}function Wh(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M6 2H2v4M10 2h4v4M14 10v4h-4M6 14H2v-4"}),i.jsx("rect",{x:"5",y:"5",width:"6",height:"6",rx:"1"})]})}const ho="p, ul, ol, blockquote, pre, h1, h2, h3, h4, h5, h6, table",Kh=200,zh=120;function Gh(e){const t=e.closest("[data-ya-code-block], pre"),n=t==null?void 0:t.querySelector(":scope > pre > code, :scope > code");return Array.from((n==null?void 0:n.classList)??[]).some(r=>r.toLowerCase()==="language-mermaid")}function Xh(e){const t=Array.from(e.querySelectorAll(ho)),n=t.filter(s=>!Gh(s));return{blocks:n.filter(s=>{var l;const o=(l=s.parentElement)==null?void 0:l.closest(ho);return!o||!e.contains(o)}),onlyMermaid:t.length>0&&n.length===0}}function Yh(e,t){return e.length===t.length&&e.every((n,r)=>{var s,o,l;return n.blockIndex===((s=t[r])==null?void 0:s.blockIndex)&&n.top===((o=t[r])==null?void 0:o.top)&&n.height===((l=t[r])==null?void 0:l.height)})}function Li(e,t){const n=e[t];if(!n)throw new Error(`Missing paragraph block ${t}`);return n}function Qh(e,t,n){const r=n.getBoundingClientRect();return Array.from(t).sort((s,o)=>s-o).map(s=>{const o=Li(e,s).getBoundingClientRect();return{blockIndex:s,top:o.top-r.top+n.scrollTop,height:o.height}})}function Jh({alwaysShowQuoteCircle:e,contentRef:t,layoutKey:n,onQuoteBlock:r,paragraphQuoteCirclesEnabled:s,sourceRef:o,surfaceRef:l}){const{t:a}=Ie(),d=c.useRef([]),[u,f]=c.useState([]),[p,w]=c.useState(!1);c.useEffect(()=>{const b=t.current,m=l.current;if(!b||!m){d.current.length>0&&(d.current=[],f([]));return}let y=[],S=new WeakMap;const _=new Set;let C=0,j=0,v=!1;const k=()=>{C=0;const M=Qh(y,_,m);d.current=M.map(F=>Li(y,F.blockIndex)),f(F=>Yh(F,M)?F:M)},g=()=>{C===0&&(C=requestAnimationFrame(k))},E=()=>{window.clearTimeout(j),j=window.setTimeout(g,zh)},A=!s||typeof IntersectionObserver>"u"?null:new IntersectionObserver(M=>{const F=M.find($=>$.target===m);if(F&&!F.isIntersecting){if(!v)return;v=!1,_.clear(),A==null||A.disconnect(),A==null||A.observe(m),g();return}if(F!=null&&F.isIntersecting&&!v){v=!0;for(const $ of y)A==null||A.observe($)}for(const $ of M){if(!($.target instanceof HTMLElement))continue;const I=S.get($.target);I!==void 0&&($.isIntersecting?_.add(I):_.delete(I))}g()},{rootMargin:`${Kh}px 0px`}),B=()=>{if(A)for(const F of y)A.unobserve(F);const M=Xh(b);if(w(M.onlyMermaid),!s){d.current=[],f(F=>F.length>0?[]:F);return}if(y=M.blocks,S=new WeakMap,y.forEach((F,$)=>{S.set(F,$)}),_.clear(),A&&v)for(const F of y)A.observe(F);else if(!A)for(let F=0;F<y.length;F+=1)_.add(F);g()};B(),A&&A.observe(m);const T=!s||typeof ResizeObserver>"u"?null:new ResizeObserver(E);T==null||T.observe(b);const P=new MutationObserver(B);return P.observe(b,{childList:!0,subtree:!0}),()=>{T==null||T.disconnect(),P.disconnect(),A==null||A.disconnect(),C!==0&&cancelAnimationFrame(C),window.clearTimeout(j)}},[t,n,s,l]);const x=c.useCallback(()=>{const b=o.current,m=t.current;if(!b)return;const y=tc(b);if(!y)return;const S=m&&m!==b?As(b,m):null;r(kn(S?{...y,range:S.range,selectedText:S.selectedText}:y))},[t,r,o]),h=c.useCallback(b=>{const m=o.current,y=d.current[b];if(!m||!y)return;const S=As(m,y);S&&r(kn(S))},[r,o]);return p?null:i.jsx("div",{className:"text-block-quote-rail",children:s&&u.length>0?u.map((b,m)=>i.jsx("button",{type:"button",className:`text-block-quote text-block-quote-paragraph ${e?"always-visible":""}`,style:{top:`${b.top+b.height}px`},onClick:()=>h(m),title:a("sessionQuoteBlock"),"aria-label":a("sessionQuoteBlock"),children:">"},b.blockIndex)):i.jsx("button",{type:"button",className:`text-block-quote text-block-quote-fallback ${e?"always-visible":""}`,onClick:x,title:a("sessionQuoteBlock"),"aria-label":a("sessionQuoteBlock"),children:">"})})}function Zh({availableWidth:e,contextWidth:t,headerGap:n,filenameWidth:r,provenanceWidth:s,windowWidth:o}){return o>0&&t+Math.max(r,s)+o+n*(t>0?2:1)<=e}const bt=`/api/pdfjs/${ga}`,wn=Lt(Ve.pdfjsRenderer,!1);let rr=null;function em(){return rr??(rr=ac(()=>import(`${bt}/build/pdf.min.mjs`),[]).then(e=>(e.GlobalWorkerOptions.workerSrc=`${bt}/build/pdf.worker.min.mjs`,e),e=>{throw rr=null,e})),rr}function tm(e){let t=null,n=!1;return{promise:em().then(s=>{if(n)throw new Error("PDF closed");return t=s.getDocument({url:e,withCredentials:!0,isEvalSupported:!1,verbosity:0,cMapUrl:`${bt}/cmaps/`,cMapPacked:!0,standardFontDataUrl:`${bt}/standard_fonts/`,wasmUrl:`${bt}/wasm/`,iccUrl:`${bt}/iccs/`}),t.promise}),destroy:()=>{n=!0,t==null||t.destroy()}}}function nm(){return{pdfjsRendererEnabled:c.useSyncExternalStore(wn.subscribe,wn.read,wn.read),setPdfjsRendererEnabled:wn.set}}const rm="_pdf_1rme7_1",sm="_openPdf_1rme7_13",om="_media_1rme7_19",im="_font_1rme7_36",lm="_glyphs_1rme7_47",St={pdf:rm,openPdf:sm,media:om,font:im,glyphs:lm},cm="_view_1n5sd_2",am="_scroller_1n5sd_12",um="_document_1n5sd_22",dm="_page_1n5sd_33",fm="_zoomControls_1n5sd_40",hm="_zoomLevel_1n5sd_73",xt={view:cm,scroller:am,document:um,page:dm,zoomControls:fm,zoomLevel:hm},_i=.5,Ei=5,Rn=1.25,mm=960,pm=12,gm=16777216,ji=e=>Math.min(Ei,Math.max(_i,e));function wm({url:e,fileName:t,loading:n,onError:r}){const{t:s}=Ie(),[o,l]=c.useState(null),a=c.useRef(null),d=c.useRef(null),[u,f]=c.useState(null),[p,w]=c.useState(1),x=c.useRef(p);x.current=p;const h=c.useRef(null);c.useEffect(()=>{let S=!1;l(null),w(1);const _=tm(e);return _.promise.then(async C=>{const j=[];for(let v=1;v<=C.numPages;v+=1)j.push((await C.getPage(v)).getViewport({scale:1}));S||l({document:C,sizes:j})}).catch(()=>{S||r()}),()=>{S=!0,_.destroy()}},[e,r]),c.useLayoutEffect(()=>{const S=a.current;if(!S)return;const _=()=>f(Math.max(1,Math.min(mm,S.clientWidth-2*pm)));_();const C=new ResizeObserver(_);return C.observe(S),()=>C.disconnect()},[o]);const b=c.useCallback((S,_,C)=>{const j=a.current,v=x.current,k=ji(v*S);if(!j||k===v){mo(d.current);return}const g=j.getBoundingClientRect(),E=_-g.left,A=C-g.top,B=k/v;h.current={left:(j.scrollLeft+E)*B-E,top:(j.scrollTop+A)*B-A},w(k)},[]);c.useLayoutEffect(()=>{mo(d.current);const S=a.current,_=h.current;h.current=null,S&&_&&(S.scrollLeft=_.left,S.scrollTop=_.top)},[p]),vm(a,d,x,b,o!==null);const m=S=>{var C;const _=(C=a.current)==null?void 0:C.getBoundingClientRect();_&&b(S,_.left+_.width/2,_.top+_.height/2)};if(!o)return i.jsx("div",{className:"file-viewer-loading",children:n});const y=u===null?null:u*p;return i.jsxs("div",{className:xt.view,children:[i.jsx("div",{ref:a,className:xt.scroller,children:i.jsx("div",{ref:d,className:xt.document,role:"document","aria-label":t,children:y!==null&&o.sizes.map((S,_)=>i.jsx(xm,{document:o.document,pageNumber:_+1,size:S,width:y,root:a,onError:r},_))})}),i.jsxs("div",{className:xt.zoomControls,children:[i.jsx("button",{type:"button",onClick:()=>m(1/Rn),disabled:p<=_i,"aria-label":s("pdfjsZoomOut"),children:"−"}),i.jsxs("button",{type:"button",className:xt.zoomLevel,onClick:()=>m(1/p),"aria-label":s("pdfjsZoomFit"),children:[Math.round(p*100),"%"]}),i.jsx("button",{type:"button",onClick:()=>m(Rn),disabled:p>=Ei,"aria-label":s("pdfjsZoomIn"),children:"+"})]})]})}function mo(e){e&&(e.style.transform="",e.style.transformOrigin="")}function vm(e,t,n,r,s){c.useEffect(()=>{const o=e.current;if(!s||!o)return;let l=null,a;const d=(h,b,m)=>{const y=t.current;if(!y)return h;const S=ji(n.current*h)/n.current,_=y.getBoundingClientRect();return y.style.transformOrigin=`${b-_.left}px ${m-_.top}px`,y.style.transform=`scale(${S})`,S},u=h=>Math.hypot(h[0].clientX-h[1].clientX,h[0].clientY-h[1].clientY),f=h=>{if(h.touches.length!==2)return;const[b,m]=[h.touches[0],h.touches[1]];l={scale:1,clientX:(b.clientX+m.clientX)/2,clientY:(b.clientY+m.clientY)/2,startDistance:u(h.touches)}},p=h=>{!l||h.touches.length!==2||(h.preventDefault(),l.scale=d(u(h.touches)/l.startDistance,l.clientX,l.clientY))},w=h=>{if(!l||h.touches.length>=2)return;const b=l;l=null,r(b.scale,b.clientX,b.clientY)},x=h=>{if(!h.ctrlKey)return;h.preventDefault(),l??(l={scale:1,clientX:h.clientX,clientY:h.clientY,startDistance:0});const m=h.deltaMode!==WheelEvent.DOM_DELTA_PIXEL||Math.abs(h.deltaY)>=50?h.deltaY<0?Rn:1/Rn:Math.exp(-h.deltaY/100);l.scale=d(l.scale*m,l.clientX,l.clientY),clearTimeout(a),a=setTimeout(()=>{const y=l;l=null,y&&r(y.scale,y.clientX,y.clientY)},150)};return o.addEventListener("touchstart",f,{passive:!0}),o.addEventListener("touchmove",p,{passive:!1}),o.addEventListener("touchend",w),o.addEventListener("touchcancel",w),o.addEventListener("wheel",x,{passive:!1}),()=>{clearTimeout(a),o.removeEventListener("touchstart",f),o.removeEventListener("touchmove",p),o.removeEventListener("touchend",w),o.removeEventListener("touchcancel",w),o.removeEventListener("wheel",x)}},[e,t,n,r,s])}function xm({document:e,pageNumber:t,size:n,width:r,root:s,onError:o}){const l=c.useRef(null);return c.useEffect(()=>{const a=l.current;if(!a)return;let d=null,u=!1,f=!1;const p=async()=>{u=!0;const h=await e.getPage(t),b=r*window.devicePixelRatio,m=b*n.height/n.width,y=Math.min(1,Math.sqrt(gm/(b*m))),S=h.getViewport({scale:b*y/n.width});if(f||!u)return;a.width=Math.round(S.width),a.height=Math.round(S.height);const _=h.render({canvas:a,viewport:S});d=_,await _.promise},w=()=>{u=!1,d==null||d.cancel(),d=null,a.width=0,a.height=0},x=new IntersectionObserver(h=>{const b=h.some(m=>m.isIntersecting);b&&!u?p().catch(m=>{!f&&u&&!ym(m)&&o()}):!b&&(u||a.width>0)&&w()},{root:s.current,rootMargin:"100% 50%"});return x.observe(a),()=>{f=!0,x.disconnect(),d==null||d.cancel()}},[e,t,n,r,s,o]),i.jsx("canvas",{ref:l,className:xt.page,style:{width:r,aspectRatio:`${n.width} / ${n.height}`}})}function ym(e){return e instanceof Error&&e.name==="RenderingCancelledException"}function po(e){return e==="application/pdf"?"pdf":e.startsWith("audio/")?"audio":e.startsWith("video/")?"video":e.startsWith("font/")?"font":null}function bm(e){var t;try{return((t=e.contentDocument)==null?void 0:t.contentType)==="application/pdf"}catch{return!1}}const Sm=["ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz","0123456789 !?&@#$%*()[]{}"],km=[14,20,32,48];function Cm({kind:e,url:t,fileName:n,sampleText:r,unsupported:s,pdfjsAvailable:o=!1}){const{t:l}=Ie(),{pdfjsRendererEnabled:a}=nm(),[d,u]=c.useState(null),[f,p]=c.useState(null),w=c.useCallback(()=>u(t),[t]),x=c.useCallback(()=>p(t),[t]);if(e==="pdf"&&o&&a&&f!==t)return i.jsx(wm,{url:t,fileName:n,loading:l("fileViewerLoading",{name:n}),onError:x});if(d===t)return e!=="pdf"?i.jsx(i.Fragment,{children:s}):i.jsxs(i.Fragment,{children:[s,i.jsx("p",{className:St.openPdf,children:i.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:l("fileViewerOpenNewTab")})})]});switch(e){case"pdf":return i.jsx("iframe",{className:St.pdf,src:t,title:n,onLoad:h=>{bm(h.currentTarget)||w()}});case"audio":return i.jsx("div",{className:St.media,children:i.jsx("audio",{controls:!0,preload:"metadata",src:t,onError:w})});case"video":return i.jsx("div",{className:St.media,children:i.jsx("video",{controls:!0,preload:"metadata",src:t,onError:w})});case"font":return i.jsx(Lm,{url:t,sampleText:r,onError:w,unsupported:s})}}let go=0;function Lm({url:e,sampleText:t,onError:n,unsupported:r}){const[s,o]=c.useState(null);return c.useEffect(()=>{if(typeof FontFace>"u")return;go+=1;const l=new FontFace(`ya-file-viewer-font-${go}`,`url("${e}")`);let a=!1;return o(null),l.load().then(d=>{a||(document.fonts.add(d),o(d.family))},()=>{a||n()}),()=>{a=!0,document.fonts.delete(l)}},[e,n]),typeof FontFace>"u"?i.jsx(i.Fragment,{children:r}):s?i.jsxs("div",{className:St.font,"data-font-specimen":!0,style:{fontFamily:`"${s}"`},children:[km.map(l=>i.jsx("p",{style:{fontSize:`${l}px`},children:t},l)),Sm.map(l=>i.jsx("p",{className:St.glyphs,children:l},l))]}):null}function wo(e){return e<1024?`${e} b`:e<1024*1024?`${Math.round(e/1024)} kb`:`${Math.round(e/(1024*1024)*10)/10} mb`}function _m(e){var r;const t=((r=e.split(".").pop())==null?void 0:r.toLowerCase())||"";return{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",swift:"swift",php:"php",sql:"sql",sh:"bash",bash:"bash",zsh:"bash",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",xml:"xml",html:"html",css:"css",scss:"scss",md:"markdown",markdown:"markdown"}[t]||"plaintext"}function vo(e){return e.startsWith("image/")}const xo=1e4;function vn(e,t){return/\.(?:html?|xhtml)$/i.test(e)||t==="text/html"||t==="application/xhtml+xml"}function Em(e){if(!jo(e))return null;try{return _o(Ro(e))}catch{return null}}function jm(e,t){return e===void 0?null:{end:Math.max(e,t??e),start:e}}function it(e){return(e==null?void 0:e.contentStartLine)??1}function Ri(e){if(e.contentEndLine!==void 0)return e.contentEndLine;if(e.content!==void 0)return it(e)+e.content.split(`
|
|
58
|
+
`).length-1}function yo(e){if(!e.contentTruncated)return null;const t=Ri(e),n=e.contentTotalLines?` of ${e.contentTotalLines}`:"";return`Showing lines ${it(e)}-${t}${n}`}function Mi(e,t,n){return t===void 0?e:`${e}:${t}${n&&n>t?`-${n}`:""}`}function Rm(e,t,n,r){const s=e.split(`
|
|
59
|
+
`),o=r-t;if(o<0||o>=s.length)return null;const l=Math.max(0,o-3),a=Math.min(s.length,o+4);return{location:Mi(n,r),quote:s.slice(l,a).join(`
|
|
60
|
+
`),afterLine:r}}function Mm(e,t){const n=Array.from(e.querySelectorAll(".markdown-rendered > :not([data-review-comment-inline-host])"));let r;for(let s=0;s<n.length;s+=1)try{t.intersectsNode(n[s])&&(r=s)}catch{}return r}function Am({afterBlock:e,children:t,editor:n,previewRef:r}){const[s,o]=c.useState(null);return c.useLayoutEffect(()=>{if(e===void 0){o(null);return}const l=r.current;if(!l){o(null);return}const a=l.ownerDocument.createElement("div");a.dataset.reviewCommentInlineHost="";const d=()=>{const p=l.querySelectorAll(".markdown-rendered > :not([data-review-comment-inline-host])").item(e);p&&p.nextElementSibling!==a&&p.after(a)};if(d(),!a.isConnected){o(null);return}const u=new MutationObserver(d);return u.observe(l,{childList:!0,subtree:!0}),o(a),()=>{u.disconnect(),a.remove()}},[e,r]),i.jsxs("div",{ref:r,children:[t,s?Ht.createPortal(i.jsx(xf,{editor:n}),s,"session-file-comment-editor"):null]})}function Pm({busy:e,cancelLabel:t,draft:n,error:r,onCancel:s,onChange:o,onPersist:l,onSend:a,placeholder:d,sendLabel:u}){const[f,p]=c.useState(n.text);return i.jsx(yi,{anchorLabel:n.location,snippet:n.quote,text:f,placeholder:d,autoFocus:!n.preserveSelection,error:r,onBlur:l,onChange:w=>{p(w),o(n.id,w)},onKeyDown:w=>{w.key!=="Enter"||w.shiftKey||w.nativeEvent.isComposing||(w.preventDefault(),w.stopPropagation(),a(n.id))},actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:()=>s(n.id),disabled:e,children:t}),i.jsx("button",{type:"button",className:se.commentSend,onClick:()=>a(n.id),disabled:!f.trim()||e,children:u})]})})}function Tm(e,t,n,r){if(!e)return e;const s=jm(n,r),o=(s==null?void 0:s.start)===(s==null?void 0:s.end);let l=0;return e.replace(/<span class="([^"]*)">/g,(a,d)=>{if(!d.split(/\s+/).includes("line"))return a;l+=1;const u=t+l-1,f=s!==null&&u>=s.start&&u<=s.end;return`<span class="${[d,o&&f?"highlighted-line":"",u===(s==null?void 0:s.start)?"highlighted-line-start":"",u===(s==null?void 0:s.end)?"highlighted-line-end":""].filter(Boolean).join(" ")}" data-line="${u}">`})}const sr={loadFile:(e,t,n,r,s,o)=>te.getFile(e,t,n,r,s,o),getRawFileUrl:(e,t,n)=>te.getFileRawUrl(e,t,n),statFile:(e,t)=>te.getFileMetadata(e,t),fetchRawFileBlob:(e,t,n)=>{const{rawUrl:r}=e;if(!r)throw new Error("Raw file URL unavailable");const s=n?`${r}${r.includes("?")?"&":"?"}download=true`:r;return js(s)},createMediaSource:e=>e?{fetchBlob:async(t,n)=>Ll(e,t)??js(n)}:void 0};function Fm(e,t){if(t.modifiedAt===void 0)return e;const n=e.includes("?")?"&":"?";return`${e}${n}v=${t.modifiedAt}-${t.size}`}function Nm(e,t){const n=e.getBoundingClientRect();return t.getBoundingClientRect().top-n.top+e.scrollTop}function Ai(e,t){if(e.scrollHeight<=e.clientHeight)return 0;const n=Nm(e,t),r=e.clientHeight*.1,s=Math.max(0,e.scrollHeight-e.clientHeight);return Math.max(0,Math.min(s,n-r))}function $m(e,t,n){var l;if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||!(e.target instanceof Element))return!1;const r=(l=e.target.closest("a[href]"))==null?void 0:l.getAttribute("href");if(!t||!(r!=null&&r.startsWith("#")))return!1;e.preventDefault();let s=r.slice(1);try{s=decodeURIComponent(s)}catch{}const o=Array.from(t.querySelectorAll("[id]")).find(a=>a.id===s);return o instanceof HTMLElement&&n&&(n.scrollTop=Ai(n,o)),!0}const Bm=c.memo(function({projectId:t,filePath:n,source:r=sr,openInNewTabUrl:s,onClose:o,onMinimize:l,parentViewerId:a,standalone:d=!1,lineNumber:u,lineEnd:f,viewMode:p="full",initialPresentation:w,diffMode:x,headerLeading:h,scrollMemory:b}){var Ss,ks,Cs;const{t:m}=Ie(),y=An(),S=Pl(),_=yr(),{quoteReplyButtonMode:C}=Go(),j=Cr(),v=j.transport,k=Mn(),g=`${t}\0${n}\0${x??"source"}`,[E,A]=c.useState(!1),[B,T]=c.useState(null),[P,M]=c.useState(null),F=c.useRef(null),[$,I]=c.useState(()=>({identity:g,view:x??"source"})),H=$.identity===g?$.view:x??"source",q=c.useCallback(R=>{R==="source"&&(F.current=g,A(!1),M(null)),I({identity:g,view:R})},[g]),D=H!=="source",W=D?void 0:u,Y=D?void 0:f,oe=D?"full":p,X=Ko(k===null?t:void 0,n),fe=H==="worktree"?X.worktreeFile:H==="cumulative"?X.cumulativeFile:null,Z=v.capabilities.sameOriginUrls,J=_t(),ee=k&&k.projectId!==null?Tl(J,{relayUsername:k.relayUsername,relayUrl:k.relayUrl,secret:k.secret,projectId:k.projectId,path:n}):null,[L,re]=c.useState(null),[ye,ke]=c.useState(!0),[ue,Pe]=c.useState(null),[z,he]=c.useState(!1),[qe,Xt]=c.useState(!1),[Yt,Fn]=c.useState(null),de=c.useRef(null),We=c.useRef(null),Je=c.useRef(null),[Qt,Ke]=c.useState(null),[Te,jt]=c.useState(!1),[dt,Ze]=c.useState(null),ft=c.useRef(null),[le,ze]=c.useState(!1),[Oe,Jt]=c.useState(null),[ht,et]=c.useState(null),[U,O]=c.useState(null),Q=Pc(),me=$s(Nc,Q.density),ge=$s(Fc,Q.density),ve=$c(me),Ee=c.useMemo(()=>Em(t),[t]),mt=c.useMemo(()=>lr(n)?Lr(n,Ee):Vt(n).replace(/^\.\/+/,""),[n,Ee]),tt=mt??n,Pi=c.useMemo(()=>({projectId:t,filePath:tt,contentStartLine:L?it(L):1}),[L,t,tt]),Ti=c.useMemo(()=>_&&S?lu({sourceKey:j.sourceKey,sessionId:_.sessionId,projectId:t,filePath:n}):null,[n,t,S,_,j.sourceKey]),ne=Lu({active:le,storageKey:Ti,sendComment:S}),Ce=c.useRef(null);c.useLayoutEffect(()=>{const R=Yt,N=de.current,V=We.current,K=Je.current,ie=Qt;if(!R||!N||!V||!K||!ie)return;const be=()=>{const Me=getComputedStyle(R),xe=Number.parseFloat(Me.paddingLeft)+Number.parseFloat(Me.paddingRight),Ue=Zh({availableWidth:R.clientWidth-xe,contextWidth:N.getBoundingClientRect().width,headerGap:Number.parseFloat(getComputedStyle(N.parentElement).columnGap)||0,filenameWidth:K.getBoundingClientRect().width,provenanceWidth:V.scrollWidth,windowWidth:ie.getBoundingClientRect().width});jt(Ye=>Ye===Ue?Ye:Ue)},G=typeof ResizeObserver>"u"?null:new ResizeObserver(be);for(const Me of[R,N,V,K,ie])G==null||G.observe(Me);return be(),()=>{G==null||G.disconnect()}},[Yt,Qt]),_c(Ce,D||L==null?void 0:L.content,Pi,E?"rendered":"literal");const Ur=Rc(),Fi=c.useCallback(R=>{Ur(t,R)},[t,Ur]),Rt=c.useRef(null),{modal:Zt,localFileModal:Nn,projectFileModal:pt,handleClick:$n,handleContextMenu:Bn,openResource:Vr,closeModal:Ni,closeLocalFileModal:$i,closeProjectFileModal:Bi,contextMenuElement:Di}=Fl({projectContext:{projectId:t,projectPath:Ee}}),qr=c.useRef($n),Wr=c.useRef(Bn);qr.current=$n,Wr.current=Bn;const Kr=c.useCallback(R=>{$m(R,Rt.current,Ce.current)||qr.current(R)},[]),zr=c.useRef(Vr);zr.current=Vr;const Ii=c.useCallback((R,N)=>{zr.current(R,N)},[]),Gr=c.useCallback(R=>Wr.current(R),[]),Dn=c.useCallback(R=>{var V,K;if(R.key!==" ")return;const N=(K=(V=R.target).closest)==null?void 0:K.call(V,"a[href]");N&&(R.preventDefault(),N.click())},[]),Oi=c.useCallback(R=>{R.button>0||R.target instanceof Element&&R.target.closest("button, input, textarea, select, a[href], [contenteditable='true']")||R.currentTarget.focus({preventScroll:!0})},[]),Hi=c.useCallback(R=>{if(R.button!==0||R.target instanceof Element&&R.target.closest("button, input, textarea, select, a[href], [contenteditable='true']"))return;const N=R.currentTarget.ownerDocument.getSelection();if(!N||N.isCollapsed||N.rangeCount===0)return;(N.anchorNode!==null&&R.currentTarget.contains(N.anchorNode)||N.focusNode!==null&&R.currentTarget.contains(N.focusNode))&&N.removeAllRanges()},[]),He=!!(S&&_&&o&&!d&&k===null&&!D&&(L!=null&&L.metadata.isText)&&L.content!==void 0&&!(E&&vn(n,L.metadata.mimeType)));c.useEffect(()=>{!le||He||(ne.flush(),ze(!1))},[le,He,ne.flush]);const Xr=c.useCallback(()=>{const R=Ce.current;if(!le||!He||!R)return;const N=Ut(R);if(N.length===0)return;const V=N.map(G=>G.sourceLocation).filter(G=>(G==null?void 0:G.filePath)===tt),K=V.length===N.length?Math.min(...V.map(G=>(G==null?void 0:G.lineStart)??1)):void 0,ie=V.length===N.length?Math.max(...V.map(G=>(G==null?void 0:G.lineEnd)??1)):void 0,be=E?Mm(Rt.current??R,N.at(-1).range):void 0;ne.open({location:Mi(tt,K,ie),quote:N.map(G=>G.markdown).join(`
|
|
61
|
+
|
|
62
|
+
`),preserveSelection:!0,...!E&&ie!==void 0?{afterLine:ie}:{},...be===void 0?{}:{afterBlock:be}})},[le,He,ne.open,E,tt]);c.useEffect(()=>{if(!le||!He)return;const R=Ce.current,N=R==null?void 0:R.ownerDocument;if(!R||!N)return;let V=!1,K=0;const ie=()=>{window.clearTimeout(K),K=window.setTimeout(Xr,0)},be=xe=>{xe.button===0&&xe.target instanceof Node&&R.contains(xe.target)&&!(xe.target instanceof Element&&xe.target.closest("button, input, textarea, select, a[href]"))&&(V=!0)},G=()=>{V&&(V=!1,ie())},Me=()=>{const xe=N.activeElement;xe instanceof Element&&xe.closest('[data-markdown-copy-ignore="true"]')||V||ie()};return N.addEventListener("pointerdown",be,!0),N.addEventListener("pointerup",G,!0),N.addEventListener("pointercancel",G,!0),N.addEventListener("selectionchange",Me),ie(),()=>{window.clearTimeout(K),N.removeEventListener("pointerdown",be,!0),N.removeEventListener("pointerup",G,!0),N.removeEventListener("pointercancel",G,!0),N.removeEventListener("selectionchange",Me)}},[le,He,Xr]);const Ui=c.useCallback(R=>{if(!le||!He||!(L!=null&&L.content)||R.target instanceof Element&&R.target.closest("button, input, textarea, select, a[href], [contenteditable='true']"))return;const N=R.currentTarget.ownerDocument.getSelection();if(N&&!N.isCollapsed)return;const V=R.target instanceof Element?R.target.closest("[data-line]"):null,K=Number(V==null?void 0:V.dataset.line);if(!Number.isInteger(K))return;const ie=Rm(L.content,it(L),tt,K);ie&&ne.open(ie)},[le,He,L,ne.open,tt]),Vi=c.useCallback(()=>{ze(R=>(R&&ne.flush(),!R))},[ne.flush]),qi=c.useCallback(R=>{if(!le)return;const N=R.relatedTarget;if(!(N instanceof Node)){ne.persist();return}(R.currentTarget.closest("dialog")??R.currentTarget).contains(N)||ne.flush()},[le,ne.flush,ne.persist]),Yr=c.useCallback(()=>{ne.flush(),o==null||o()},[o,ne.flush]),Wi=c.useCallback(()=>{ne.flush(),l==null||l()},[l,ne.flush]),Qr=c.useMemo(()=>{var R;return(R=r.createMediaSource)==null?void 0:R.call(r,L)},[L,r]),je=c.useMemo(()=>L!=null&&L.renderedMarkdownHtml?r.transformRenderedMarkdownHtml?r.transformRenderedMarkdownHtml(L.renderedMarkdownHtml,L):L.renderedMarkdownHtml:null,[L,r]),Ki=c.useMemo(()=>je?i.jsx(Fo,{html:je,sourcePath:n,density:ge,ariaLabel:m("fileViewerPreview"),onClick:Kr,onContextMenu:Gr,onKeyDown:Dn}):null,[n,Dn,Kr,Gr,ge,je,m]),Mt=c.useMemo(()=>L?Nl(n,L,je??void 0):null,[L,n,je]),en=c.useMemo(()=>Tm(L==null?void 0:L.highlightedHtml,it(L),W,Y),[Y,W,L]);$l(Rt,!D&&E?je:null,Qr);const In=!D&&E?je:D?null:en,On=`${t}\0${n}\0${u??""}\0${f??""}\0${p}`,[zi,Gi]=c.useState(0),[Hn,Xi]=c.useState(0),[Fe,Un]=c.useState(null),Jr=c.useCallback(()=>{const R=L==null?void 0:L.metadata.modifiedAt;!r.statFile||R===void 0||r.statFile(t,n).then(N=>{const V=N.metadata.modifiedAt;V!==void 0&&Un(V!==R||N.metadata.size!==(L==null?void 0:L.metadata.size)?{state:"stale",at:V}:{state:"fresh",loadedAt:R})}).catch(()=>Un(null))},[r,t,n,L]),Zr=c.useCallback(()=>{Un(null),Gi(R=>R+1),Xi(R=>R+1)},[]);c.useEffect(()=>{H==="source"||X.loading||(H==="worktree"&&!X.worktreeFile||H==="cumulative"&&!X.cumulativeFile)&&q("source")},[H,X,q]),c.useEffect(()=>{let R=!1;if(D){ke(!1),Pe(null),O(null);return}const N=ft.current,V=L!==null&&(N==null?void 0:N.identity)===On&&N.source===r;if(V&&N.reloadRequest===Hn){ke(!1),Pe(null);return}return V||(ke(!0),Pe(null),O(null)),r.loadFile(t,n,!0,W,Y,oe).then(K=>{if(!R){if(ft.current={identity:On,source:r,reloadRequest:Hn},re(K),V){ke(!1);return}const ie=ar(n)&&!!K.renderedMarkdownHtml,be=K.content!==void 0&&vn(n,K.metadata.mimeType);A(F.current===g?!1:w?w==="preview"&&(ie||be):ie||be),ke(!1)}}).catch(K=>{R||(Pe(K.message||m("fileViewerLoadFailed")),ke(!1))}),()=>{R=!0}},[t,D,Y,W,oe,n,w,Hn,r,On,m,g,L]),c.useEffect(()=>{const R=L==null?void 0:L.metadata.mimeType;if(!L||!R||!(vo(R)||po(R))){et(null);return}if(!r.fetchRawFileBlob||Z){et(null);return}let N=!1,V=null;return et(null),r.fetchRawFileBlob(L,n,!1).then(K=>{N||(V=URL.createObjectURL(K.type===R?K:new Blob([K],{type:R})),et(V))}).catch(K=>{N||Pe(K instanceof Error?K.message:String(K))}),()=>{N=!0,V&&URL.revokeObjectURL(V)}},[L,n,Z,r]),c.useEffect(()=>{if(!qe)return;const R=N=>{N.key==="Escape"&&Xt(!1)};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[qe]);const tn=c.useRef(b==null?void 0:b.initialTop),es=In??L;c.useEffect(()=>{const R=tn.current,N=Ce.current;if(R===void 0||!es||!N)return;const V=requestAnimationFrame(()=>{tn.current=void 0,N.scrollTop=R});return()=>cancelAnimationFrame(V)},[es]),c.useEffect(()=>{var V;if(W===void 0||!In||tn.current!==void 0)return;const R=U??((V=Ce.current)==null?void 0:V.querySelector(".highlighted-line-start, .markdown-preview-span-start")),N=Ce.current;R&&N&&requestAnimationFrame(()=>{N.scrollTop=Ai(N,R)})},[W,In,U]);const Yi=c.useCallback(async()=>{if((L==null?void 0:L.content)!==void 0)try{if(!await we(L.content))throw new Error("Clipboard write failed");he(!0),setTimeout(()=>he(!1),3e3)}catch(R){console.error("Failed to copy:",R)}},[L==null?void 0:L.content]),Qi=c.useCallback(()=>{kt(r.loadFile(t,n,!1).then(R=>R.content??""))},[n,t,r]),Ji=c.useCallback(()=>{Mt&&ko(Mt.html,Mt.text)},[Mt]),ts=c.useMemo(()=>_r(n,Ee),[n,Ee]),At=c.useMemo(()=>Eo(n,Ee),[n,Ee]),Pt=c.useMemo(()=>k?Wt(k,{filePath:n,lineEnd:f,lineNumber:u,viewMode:p}):null,[n,f,u,k,p]),ns=c.useMemo(()=>s||Pt||at(ut({basePath:J,filePath:n,lineEnd:f,lineNumber:u,projectId:t,viewMode:p})),[J,n,f,u,s,t,Pt,p]),Tt=c.useMemo(()=>H==="source"||Pt?ns:at(ut({basePath:J,diffMode:H,filePath:X.relativePath??n,projectId:t})),[H,J,n,X.relativePath,t,Pt,ns]),Re=qt(n),rs=_m(n),nn=L?vo(L.metadata.mimeType):!1,gt=c.useMemo(()=>L!=null&&L.content?L.content.split(`
|
|
63
|
+
`):[],[L==null?void 0:L.content]),Ge=L?((Ss=r.getRawFileUrl)==null?void 0:Ss.call(r,t,n,!1))??L.rawUrl:null,ss=Z&&Ge&&L?Fm(Ge,L.metadata):null,rn=nn?Z&&Ge?Ge:ht??(r.fetchRawFileBlob?null:Ge):null,os=m("fileViewerOpenImageNewTab"),is=Ao(t,n),Zi=To(t,At,mt,k!==null),ls=Mc(),cs=c.useCallback(()=>{var N;if(!L)return;const R=r.fetchRawFileBlob;ls({fileName:Re,directUrl:((N=r.getRawFileUrl)==null?void 0:N.call(r,t,n,!0))??void 0,loadBlob:R?()=>R(L,n,!0):()=>v.fetchBlob(ir(Sn(t,n,!0)))})},[L,Re,n,t,ls,r,v]),Vn=c.useMemo(()=>new URL(Tt,window.location.href).href,[Tt]),as=c.useCallback(()=>{if(rn){window.open(rn,"_blank","noopener");return}window.open(Tt,"_blank","noopener")},[rn,Tt]),el=c.useCallback(()=>L?r.fetchRawFileBlob?r.fetchRawFileBlob(L,n,!1):v.fetchBlob(ir(Sn(t,n))):Promise.reject(new Error("Image is not loaded")),[L,n,t,r,v]),us=Bl({fileName:Re,filePath:n,loadBlob:nn?el:void 0,onOpen:as,projectPath:Ee,viewerLink:Tt}),ds=c.useCallback(R=>{R.preventDefault(),R.stopPropagation(),Jt({x:R.clientX,y:R.clientY})},[]),tl=c.useCallback(()=>Jt(null),[]),[Xe,nl]=c.useState(null),[fs,rl]=c.useState(null),sl=c.useCallback(R=>{Ce.current=R,nl(R)},[]),hs=!D&&E&&(L==null?void 0:L.content)!==void 0&&L.metadata!==void 0&&vn(n,L.metadata.mimeType),ms=D||(L==null?void 0:L.content)!==void 0,ol=Dl(c.useMemo(()=>hs?fs:ms&&Xe?{kind:"element",element:Xe}:null,[hs,fs,ms,Xe]));if(c.useEffect(()=>{if(!b||!Xe)return;let R=0;const N=()=>{R||tn.current!==void 0||(R=requestAnimationFrame(()=>{R=0,b.save(Xe.scrollTop)}))};return Xe.addEventListener("scroll",N,{passive:!0}),()=>{Xe.removeEventListener("scroll",N),cancelAnimationFrame(R)}},[b,Xe]),ye||!D&&!L&&!ue||D&&X.loading&&!fe)return i.jsx("div",{className:"file-viewer",children:i.jsx("div",{className:"file-viewer-loading",children:m("fileViewerLoading",{name:Re})})});const ce=L==null?void 0:L.metadata,Ne=L==null?void 0:L.content,ps=nn,gs=!!(r.fetchRawFileBlob||Ge),sn=Ne!==void 0&&ar(n)&&!!je,nt=Ne!==void 0&&ce!==void 0&&vn(n,ce.mimeType),ws=sn||nt,Le=le?ne.activeDraft:null,il=Le?ne.sendingIds.has(Le.id):!1,$e=Le?i.jsx(Pm,{draft:Le,placeholder:m("fileViewerCommentPlaceholder"),error:ne.error?m("fileViewerCommentSendFailed"):null,busy:il,cancelLabel:m("cancel"),sendLabel:m("toolbarSend"),onCancel:ne.cancel,onChange:ne.update,onPersist:ne.persist,onSend:R=>void ne.sendOne(R)},Le.id):null,Ft=$e&&!E?Le==null?void 0:Le.afterLine:void 0,vs=$e&&E&&je&&(Le==null?void 0:Le.afterBlock)!==void 0?Le.afterBlock:void 0,xs=()=>{if(D)return fe?i.jsx("div",{className:se.diffBody,children:i.jsx(Or,{file:fe,fileKey:`file-viewer:${H}:${fe.path}`,projectId:t,source:{kind:"file-projection",mode:H},captureReviewProjections:!0,t:m})}):i.jsx("div",{className:"file-viewer-loading",children:m("fileViewerLoading",{name:Re})});if(ue||!L||!ce)return i.jsx("div",{className:"file-viewer-error",children:ue||m("fileViewerNotFound")});if(ps){const N=ss??(r.fetchRawFileBlob?ht:Ge),V=rn??N;return i.jsx("div",{className:"file-viewer-image",children:N&&V?i.jsx("a",{className:"file-viewer-image-link",href:V,target:"_blank",rel:"noopener noreferrer",title:os,"aria-label":os,onContextMenu:us.handleContextMenu,children:i.jsx("img",{src:N,alt:Re})}):i.jsx("div",{className:"file-viewer-loading",children:m("fileViewerLoading",{name:Re})})})}const R=po(ce.mimeType);if(R){const N=ss??(r.fetchRawFileBlob?ht:Ge);return N?i.jsx(Cm,{kind:R,url:N,fileName:Re,sampleText:m("fileViewerFontSample"),unsupported:ys,pdfjsAvailable:Z}):i.jsx("div",{className:"file-viewer-loading",children:m("fileViewerLoading",{name:Re})})}if(Ne!==void 0){if(E&&sn&&je)return i.jsx(Am,{afterBlock:$e?vs:void 0,editor:$e,previewRef:Rt,children:Ki});if(E&&nt)return i.jsx(ql,{html:Ne,path:n,projectId:t,className:se.htmlPreviewFrame,title:Re,autoStart:P===g,toolbarHost:B,reloadKey:zi,onFindSource:rl,documentPath:At,onLocalResourceLink:Ii},g);if(en){const Ue=yo(L),Ye=Ft!==void 0?Mu(ei(en,L.content),Ft):null,rt=(on,Nt)=>i.jsx(Tu,{html:on,source:Nt,onClick:$n,onContextMenu:Bn,onKeyDown:Dn});return i.jsxs("div",{className:"file-viewer-code file-viewer-code-highlighted","data-language":L.highlightedLanguage??rs,style:ve,children:[Ye&&$e?i.jsx(Ot,{before:rt(Ye.before),editor:$e,after:rt(Ye.after)}):rt(en,L.content),L.highlightedTruncated&&i.jsx("div",{className:"file-viewer-truncated",children:m("fileViewerHighlightTruncated")}),Ue&&i.jsx("div",{className:"file-viewer-truncated",children:Ue})]})}const N=gt.length>xo?gt.slice(0,xo):gt,V=it(L),K=W??0,ie=Math.max(K,Y??K),be=K===ie,G=yo(L),Me=(Ue,Ye)=>{const rt=N.slice(Ue,Ye);return rt.length>0?i.jsxs("div",{className:"code-highlighter-plain",children:[i.jsx("div",{className:"code-line-numbers",children:rt.map((on,Nt)=>{const Be=V+Ue+Nt;return i.jsx("div",{children:Be},`ln-${Be}`)})}),i.jsx("pre",{className:"code-content",children:i.jsx("code",{children:rt.map((on,Nt)=>{const Be=V+Ue+Nt,al=W!==void 0&&Be>=K&&Be<=ie,ul=[be&&al?"highlighted-line":"",Be===K?"highlighted-line-start":"",Be===ie?"highlighted-line-end":""].filter(Boolean).join(" ");return i.jsx("div",{ref:W!==void 0&&Be===K?dl=>O(dl):void 0,className:ul||void 0,"data-line":Be,children:on||" "},`line-${Be}`)})})})]}):null},xe=Ft===void 0?null:Math.min(N.length,Math.max(0,Ft-V+1));return i.jsxs("div",{className:"file-viewer-code","data-language":rs,style:ve,children:[xe!==null&&$e?i.jsx(Ot,{before:Me(0,xe),editor:$e,after:Me(xe,N.length)}):N.length>0?Me(0,N.length):i.jsx("div",{className:"file-viewer-empty-content",children:"No content read"}),N.length<gt.length&&i.jsx("div",{className:"file-viewer-truncated",children:m("fileViewerPlainTruncated",{count:N.length,total:gt.length})}),G&&i.jsx("div",{className:"file-viewer-truncated",children:G})]})}return ys},ys=i.jsxs("div",{className:"file-viewer-binary",children:[i.jsx("p",{children:m("fileViewerBinary")}),i.jsxs("p",{children:[i.jsx("strong",{children:m("fileViewerType")})," ",ce==null?void 0:ce.mimeType]}),i.jsxs("p",{children:[i.jsx("strong",{children:m("fileViewerSize")})," ",ce?wo(ce.size):""]}),gs&&i.jsx("button",{type:"button",className:"file-viewer-download-btn",onClick:cs,children:m("fileViewerDownloadFile")})]}),bs=i.jsx("div",{ref:Ke,className:se.windowActions,children:i.jsx(Ns,{url:Vn,copyLink:!1,moveOut:!d,onMinimize:l?Wi:void 0,onClose:o?Yr:void 0,minimizeLabel:m("fileViewerMinimize")})}),ll=i.jsxs("div",{ref:Fn,className:`file-viewer-header ${se.header}`,"data-window-actions-top":Te||void 0,children:[i.jsx("span",{className:se.measurement,"aria-hidden":"true",children:i.jsx("span",{ref:Je,className:`${se.path} ${se.pathMeasure}`,children:ts})}),i.jsxs("div",{className:se.identityRow,children:[i.jsxs("div",{ref:de,className:se.context,children:[h,o&&i.jsx("button",{type:"button",className:`file-viewer-action ${se.backButton}`,onClick:Yr,title:m("actionBack"),"aria-label":m("actionBack"),children:i.jsx(wa,{})})]}),i.jsxs("div",{className:`file-viewer-info ${se.info}`,children:[i.jsx("span",{className:`file-viewer-path ${se.path}`,title:n,onContextMenu:ds,children:ts}),i.jsxs("div",{ref:We,className:se.provenanceRow,children:[k===null&&X.relativePath&&i.jsx(Pr,{projectId:t,path:X.relativePath,origPath:(ks=X.worktreeFile)==null?void 0:ks.origPath,dirtyLabel:m("fileRevisionDirty"),uncommittedLabel:m("fileRevisionUncommitted")}),i.jsxs("span",{className:"file-viewer-meta",children:[ce?wo(ce.size):"",!D&&(ce==null?void 0:ce.isText)&&Ne!==void 0&&i.jsxs(i.Fragment,{children:[" • ",L!=null&&L.contentTruncated?`lines ${it(L)}-${Ri(L)}${L!=null&&L.contentTotalLines?` of ${L.contentTotalLines}`:""}`:m("fileViewerLines",{count:gt.length})]})]})]})]}),Te&&bs]}),i.jsxs("div",{className:`file-viewer-actions ${se.actions}`,children:[i.jsx(Il,{find:ol}),k===null&&i.jsx(ci,{activeView:H,availability:X,onSelect:q,projectId:t,variant:"header"}),(D||ws)&&i.jsx("button",{type:"button",className:`file-viewer-action ${se.rawToggle}`,"aria-label":m("fileViewerRawSource"),"aria-pressed":!D&&!E,title:m("fileViewerRawSource"),onClick:()=>{if(D){q("source");return}M(!E&&nt?g:null),A(R=>!R)},children:i.jsx(Om,{})}),He&&i.jsx("button",{type:"button",className:`file-viewer-action ${se.commentToggle}`,"aria-label":m("fileViewerCommentMode"),"aria-pressed":le,title:m("fileViewerCommentMode"),onClick:Vi,children:i.jsx(Km,{})}),k===null&&r===sr&&!D&&(ce==null?void 0:ce.isText)&&Ne!==void 0&&i.jsx(Ol,{source:{path:n,projectId:t},line:W,artifact:nt,onSaved:nt?void 0:Zr}),i.jsx("span",{ref:T}),!D&&(L||ue)&&i.jsx("button",{type:"button",className:`file-viewer-action${(Fe==null?void 0:Fe.state)==="stale"?` ${se.reloadStale}`:""}`,"aria-label":m("fileViewerReload"),title:(Fe==null?void 0:Fe.state)==="stale"?m("fileViewerReloadStale",{time:new Date(Fe.at).toLocaleTimeString()}):(Fe==null?void 0:Fe.state)==="fresh"?m("fileViewerReloadFresh"):m("fileViewerReload"),onMouseEnter:Jr,onFocus:Jr,onClick:Zr,children:i.jsx(Im,{})}),!D&&(ce==null?void 0:ce.isText)&&Ne!==void 0&&i.jsx(Tc,{canZoomIn:Q.canZoomIn,canZoomOut:Q.canZoomOut,onZoomIn:Q.zoomIn,onZoomOut:Q.zoomOut}),(D||!ps&&Ne!==void 0&&!(E&&nt))&&i.jsx(qh,{className:"file-viewer-action",contentRef:Ce}),!D&&Ne!==void 0&&i.jsx("button",{type:"button",className:`file-viewer-action ${z?"copied":""}`,onClick:Yi,title:m(z?"fileViewerCopied":"fileViewerCopyContent"),children:z?i.jsx(qm,{}):i.jsx(Hm,{})}),k===null&&r===sr&&!D&&i.jsx(Um,{projectId:t,onOpen:Ze}),k!==null&&k.projectId!==null&&!D&&nt&&Ne!==void 0&&i.jsx(Hl,{mode:"interactive",source:{},artifact:!0,href:ee,active:!1,label:m("publicSharePlay"),onToggle:()=>window.open(ee,"_blank","noopener")}),k===null&&i.jsx("button",{type:"button",className:"file-viewer-action file-viewer-new-session",onClick:is,title:m("fileViewerNewSession"),children:i.jsx(Wm,{})}),!D&&gs&&i.jsx("button",{type:"button",className:"file-viewer-action",onClick:cs,title:m("fileViewerDownload"),children:i.jsx(zm,{})}),i.jsx("button",{type:"button",className:`file-viewer-action file-viewer-fullscreen-toggle ${se.fullscreenButton}`,onClick:()=>Xt(!qe),title:m(qe?"fileViewerExitFullscreen":"fileViewerFullscreen"),children:qe?i.jsx(Xm,{}):i.jsx(Gm,{})}),i.jsx(Ns,{url:Vn,onCopyLinkContextMenu:ds,moveOut:!1}),!Te&&bs]})]}),cl=["file-viewer",se.viewer,d&&"file-viewer-standalone",qe&&"file-viewer-fullscreen",oe==="range"&&"file-viewer-compact"].filter(Boolean).join(" ");return i.jsxs("div",{className:cl,onBlurCapture:qi,children:[ll,dt&&i.jsx(gh,{anchorRect:dt,filePath:n,projectId:t,title:Re,playLinks:P===g,onClose:()=>Ze(null)}),Oe&&i.jsx(Po,{x:Oe.x,y:Oe.y,canStartNewSession:k===null,onClose:tl,onOpen:as,onOpenSource:cr(n)?()=>{M(null),A(!1)}:void 0,onOpenPreview:cr(n)&&ws?()=>{M(g),A(!0)}:void 0,onStartNewSession:is,localSource:Zi,fileTarget:k===null?{projectId:t,path:mt??n,origPath:(Cs=X.worktreeFile)==null?void 0:Cs.origPath}:void 0,onCopyProjectRelativePath:mt?()=>void we(mt):void 0,onCopyAbsolutePath:k===null&&At?()=>void we(At):void 0,onCopyFilePath:!mt&&!At?()=>void we(n):void 0,onCopyViewerLink:()=>void we(Vn),onCopyContents:Qi,onCopyRenderedContents:Mt?Ji:void 0}),Di,nn?us.contextMenuElement:null,i.jsxs("div",{className:`file-viewer-body ${se.body} ${y&&E&&sn?se.quoteReplySurface:""}`,ref:sl,tabIndex:-1,...le?{[Xo]:"true"}:{},onClick:Ui,onMouseDownCapture:Hi,onPointerDown:Oi,children:[$e&&Ft===void 0&&vs===void 0?i.jsx(Ot,{before:xs(),editor:$e}):xs(),!le&&y&&E&&sn?i.jsx(Jh,{alwaysShowQuoteCircle:C==="paragraph-always",contentRef:Rt,layoutKey:`${n}\0${je??""}`,onQuoteBlock:y,paragraphQuoteCirclesEnabled:C!=="block",sourceRef:Ce,surfaceRef:Ce}):null,d?i.jsx(Dm,{containerRef:Ce,onStartNewSessionFromSelection:k===null?Fi:void 0}):null]}),Zt?i.jsx(Ul,{path:Zt.path,mediaType:Zt.mediaType,mediaSource:Qr,dismissOnBack:!0,parentViewerId:Zt.mediaType==="image"?a:void 0,onClose:Ni}):null,Nn?i.jsx(Vl,{resource:Nn.resource,initialPresentation:Nn.initialPresentation,dismissOnBack:!0,onClose:$i}):null,pt?i.jsx(Et,{nestedViewer:!0,projectId:pt.projectId,filePath:pt.filePath,lineNumber:pt.lineNumber,lineEnd:pt.lineEnd,initialPresentation:pt.initialPresentation,onClose:Bi}):null]})});function Dm({containerRef:e,onStartNewSessionFromSelection:t}){const{floatingSelectionActions:n,selectionContextMenu:r}=Jo({containerRef:e,inert:!1,onStartNewSessionFromSelection:t,quoteClearSignal:0,isInteractiveTarget:s=>s instanceof Element&&s.closest("button, input, textarea, select, a[href], [contenteditable='true']")!==null});return i.jsxs(i.Fragment,{children:[n,r]})}function Im(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 1-1.6-3.9"}),i.jsx("path",{d:"M13.5 2.5v3.2h-3.2"})]})}function Om(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M5.5 4 2 8l3.5 4M10.5 4 14 8l-3.5 4M9.5 2.5l-3 11"})})}function Hm(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"5",y:"5",width:"9",height:"9",rx:"1.5"}),i.jsx("path",{d:"M11 5V3.5A1.5 1.5 0 0 0 9.5 2H3.5A1.5 1.5 0 0 0 2 3.5v6A1.5 1.5 0 0 0 3.5 11H5"})]})}function Um({onOpen:e,projectId:t}){const{t:n}=Ie(),{version:r}=nc(),{status:s}=dc();return!Ci(t)&&((s==null?void 0:s.canCreate)!==!0||!lt(r,uc))?null:i.jsx("button",{type:"button",className:"file-viewer-action",onClick:l=>e(l.currentTarget.getBoundingClientRect()),title:n("fileViewerSharePublicly"),"aria-label":n("fileViewerSharePublicly"),children:i.jsx(Vm,{})})}function Vm(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"m8 12 4-4M6.5 14.5l-1 1a2.8 2.8 0 0 1-4-4l3-3a2.8 2.8 0 0 1 4 0M13.5 5.5l1-1a2.8 2.8 0 1 1 4 4l-3 3a2.8 2.8 0 0 1-4 0"})})}function qm(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M3 8.5L6.5 12L13 4"})})}function Wm(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"8",cy:"8",r:"6"}),i.jsx("path",{d:"M8 5v6M5 8h6"})]})}function Km(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M3 3.5h10v7H7l-3.5 2.5v-2.5H3z"})})}function zm(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 2v9M4 8l4 4 4-4M2 14h12"})})}function Gm(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M2 5V2h3M11 2h3v3M14 11v3h-3M5 14H2v-3"})})}function Xm(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M5 2v3H2M14 5h-3V2M11 14v-3h3M2 11h3v3"})})}export{si as $,Rr as A,wa as B,Fu as C,oa as D,Ep as E,Bm as F,Pp as G,An as H,Dr as I,Tn as J,ui as K,ut as L,_n as M,xp as N,na as O,bp as P,Ua as Q,cf as R,ru as S,Sp as T,Cp as U,Vu as V,Jh as W,Et as X,ti as Y,jp as Z,yd as _,Go as a,td as a0,Rp as a1,qh as a2,wr as a3,Zu as a4,hd as a5,xd as a6,fr as a7,er as a8,oi as a9,co as aa,Ju as ab,Tu as ac,yp as ad,wp as ae,vp as af,wu as b,Io as c,Qn as d,Kd as e,zd as f,Pr as g,Ot as h,Ap as i,Mp as j,_p as k,va as l,ja as m,Tp as n,vi as o,ro as p,kp as q,_d as r,Do as s,Gd as t,nm as u,Xd as v,Na as w,qd as x,qo as y,Lp as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as n}from"./clientSummaryStore-
|
|
1
|
+
import{r as a,j as n}from"./clientSummaryStore-Dsgo1zWK.js";import{u as J,t as Q}from"./main-BX4yZXDF.js";const U="_container_1lns5_12",X="_button_1lns5_17",Z="_buttonLabel_1lns5_34",ee="_chevron_1lns5_41",te="_chip_1lns5_50",ne="_hasSelection_1lns5_48",se="_fullWidth_1lns5_74",oe="_optionIcon_1lns5_84",le="_overlay_1lns5_96",ce="_sheet_1lns5_106",re="_header_1lns5_127",ae="_title_1lns5_135",ie="_options_1lns5_141",de="_option_1lns5_84",ue="_selected_1lns5_170",he="_checkbox_1lns5_174",_e="_checked_1lns5_188",pe="_checkboxSpacer_1lns5_194",me="_singleSelect_1lns5_201",fe="_colorDot_1lns5_206",be="_labelWrapper_1lns5_213",xe="_meta_1lns5_221",ge="_label_1lns5_213",ve="_description_1lns5_231",we="_count_1lns5_237",je="_clear_1lns5_245",ke="_divider_1lns5_253",ye="_groupLabel_1lns5_259",Le="_dropdown_1lns5_268",Ne="_model_1lns5_279",Ee="_alignRight_1lns5_339",Se="_above_1lns5_345",t={container:U,button:X,buttonLabel:Z,chevron:ee,chip:te,hasSelection:ne,fullWidth:se,optionIcon:oe,overlay:le,sheet:ce,header:re,title:ae,options:ie,option:de,selected:ue,checkbox:he,checked:_e,checkboxSpacer:pe,singleSelect:me,colorDot:fe,labelWrapper:be,meta:xe,label:ge,description:ve,count:we,clear:je,divider:ke,groupLabel:ye,dropdown:Le,model:Ne,alignRight:Ee,above:Se},W=769,H=8,Ce=new Set(["auto","scroll","hidden","clip"]);function _(...c){return c.filter(Boolean).join(" ")}function Be(c){let i=0,o=window.innerHeight;for(let l=c.parentElement;l&&l!==document.body&&l!==document.documentElement;l=l.parentElement){if(!Ce.has(getComputedStyle(l).overflowY))continue;const p=l.getBoundingClientRect().top+l.clientTop;i=Math.max(i,p),o=Math.min(o,p+l.clientHeight)}return{top:i,bottom:o}}function Re(c,i){const o=c.getBoundingClientRect(),l=Be(c),u=getComputedStyle(i),p=Math.max(Number.parseFloat(u.marginTop)||0,Number.parseFloat(u.marginBottom)||0),f=Math.max(0,l.bottom-o.bottom-p-H),j=Math.max(0,o.top-l.top-p-H),k=i.scrollHeight+i.offsetHeight-i.clientHeight>f&&j>f;return{above:k,maxHeight:Math.floor(k?j:f)}}function Pe({label:c,options:i,selected:o,onChange:l,multiSelect:u=!0,placeholder:p,placeholderContent:f,triggerContent:j,triggerTitle:L,align:k="left",fullWidth:S=!1,triggerVariant:O="default",panelVariant:M="default",triggerClassName:F,className:C=""}){const{t:b}=J(),[r,y]=a.useState(!1),[x,B]=a.useState(null),[h,z]=a.useState(()=>window.innerWidth>=W),g=a.useRef(null),m=a.useRef(null),A=()=>{var e;(e=g.current)==null||e.blur(),y(s=>!s)},T=i.some(e=>e.clearSelection),G=e=>{if(e.disabled)return;if(e.clearSelection){l([]),y(!1);return}const{value:s}=e;u?o.includes(s)?l(o.filter(d=>d!==s)):l([...o,s]):(o.includes(s)?l([]):l([s]),y(!1))},K=()=>{l([])},v=a.useCallback(()=>{y(!1)},[]);a.useEffect(()=>{const e=()=>{z(window.innerWidth>=W)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),a.useEffect(()=>{if(!r)return;const e=s=>{s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),v())};return document.addEventListener("keydown",e,!0),()=>document.removeEventListener("keydown",e,!0)},[r,v]),a.useEffect(()=>{if(!r||!h)return;const e=s=>{m.current&&!m.current.contains(s.target)&&g.current&&!g.current.contains(s.target)&&v()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[r,h,v]),a.useEffect(()=>{if(r&&!h)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[r,h]),a.useEffect(()=>{var e;r&&((e=m.current)==null||e.focus({preventScroll:!0}))},[r]),a.useLayoutEffect(()=>{var D;if(!r||!h){B(null);return}const e=()=>{const I=g.current,P=m.current;if(!I||!P)return;const E=Re(I,P);B(w=>(w==null?void 0:w.above)===E.above&&w.maxHeight===E.maxHeight?w:E)};e(),window.addEventListener("resize",e);const s=(D=m.current)==null?void 0:D.firstElementChild,d=s&&typeof ResizeObserver<"u"?new ResizeObserver(e):null;return s&&(d==null||d.observe(s)),()=>{window.removeEventListener("resize",e),d==null||d.disconnect()}},[r,h]);const $=e=>{e.target===e.currentTarget&&(e.preventDefault(),e.stopPropagation(),v())},V=(()=>{if(o.length===0)return f??p??c;if(o.length===1){const e=i.find(s=>s.value===o[0]);return(e==null?void 0:e.label)||c}return`${c} (${o.length})`})(),N=M==="model",R=n.jsxs(n.Fragment,{children:[u&&o.length>0&&!T&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:_(t.option,t.clear),onClick:K,children:n.jsx("span",{className:t.label,children:b("filterClearAll")})}),n.jsx("div",{className:t.divider})]}),i.map(e=>{const s=e.clearSelection?o.length===0:o.includes(e.value),d=u&&!e.clearSelection;return n.jsxs(a.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:_(t.option,s&&t.selected,!u&&t.singleSelect,N&&t.model),onClick:()=>G(e),disabled:e.disabled,"aria-pressed":s,children:[d&&n.jsx("span",{className:_(t.checkbox,s&&t.checked),"aria-hidden":"true",children:s&&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:_(t.optionIcon,N&&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)})]}),Y=r&&!h?Q.createPortal(n.jsx("div",{className:t.overlay,onClick:$,onMouseDown:e=>e.stopPropagation(),children:n.jsxs("div",{ref:m,className:_(t.sheet,C),role:"dialog",tabIndex:-1,"aria-label":b("filterByLabel",{label:c}),children:[n.jsx("div",{className:t.header,children:n.jsx("span",{className:t.title,children:c})}),n.jsx("div",{className:t.options,children:R})]})}),document.body):null,q=r&&h?n.jsx("div",{ref:m,className:_(t.dropdown,k==="right"&&t.alignRight,(x==null?void 0:x.above)&&t.above,N&&t.model),style:x?{"--filter-dropdown-available-height":`${x.maxHeight}px`}:void 0,role:"dialog",tabIndex:-1,"aria-label":b("filterByLabel",{label:c}),children:n.jsx("div",{className:t.options,children:R})}):null;return n.jsxs("div",{className:_(t.container,S&&t.fullWidth,C),children:[n.jsxs("button",{ref:g,type:"button",className:_(t.button,o.length>0&&t.hasSelection,S&&t.fullWidth,O==="chip"&&t.chip,F),onClick:A,title:L??b("filterByLabel",{label:c}),"aria-label":L??b("filterByLabel",{label:c}),"aria-haspopup":"listbox","aria-expanded":r,children:[n.jsx("span",{className:t.buttonLabel,children:j??V}),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"})})]}),q,Y]})}export{Pe as F};
|