ryco-cli 0.1.28 → 0.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/README.md +37 -0
  2. package/dist/{AcpAdapter-CG1wRWcf.mjs → AcpAdapter-CKWzfB3Q.mjs} +4 -4
  3. package/dist/{AcpAdapter-8CSe4HK7.cjs → AcpAdapter-DjP0IHpH.cjs} +6 -6
  4. package/dist/{AcpNativeLogging-DbjnRnTf.cjs → AcpNativeLogging-5gTPK9Fq.cjs} +1 -1
  5. package/dist/{AcpNativeLogging-B6TtnnKL.mjs → AcpNativeLogging-Do0LktDb.mjs} +1 -1
  6. package/dist/{AcpRegistryDriver-16ZTxUs3.cjs → AcpRegistryDriver-BblCFfev.cjs} +3 -3
  7. package/dist/{AcpRegistryDriver-DZFasKaz.mjs → AcpRegistryDriver-BzohT-PC.mjs} +3 -3
  8. package/dist/{AzureDevOpsSourceControlProvider-DmJD1-WL.cjs → AzureDevOpsSourceControlProvider-CKSvfuDS.cjs} +1 -1
  9. package/dist/{AzureDevOpsSourceControlProvider-d5Ogsspk.mjs → AzureDevOpsSourceControlProvider-DRWSXTml.mjs} +1 -1
  10. package/dist/{BitbucketSourceControlProvider-B-ZwKj72.cjs → BitbucketSourceControlProvider-Bvl_q1o2.cjs} +1 -1
  11. package/dist/{BitbucketSourceControlProvider-DplKc8Wo.mjs → BitbucketSourceControlProvider-D5UVAc9z.mjs} +1 -1
  12. package/dist/{ClaudeDriver-0gGVop27.mjs → ClaudeDriver-BuQ_azDw.mjs} +7 -7
  13. package/dist/{ClaudeDriver-r0lJ9vmE.cjs → ClaudeDriver-DZkz0QPr.cjs} +8 -8
  14. package/dist/{CodexDriver-bJAbhSwY.cjs → CodexDriver-6Ph2cjAW.cjs} +5 -5
  15. package/dist/{CodexDriver-baT02xVb.mjs → CodexDriver-Bi49RIL4.mjs} +4 -4
  16. package/dist/{CodexTextGeneration-Dwp6X3dq.mjs → CodexTextGeneration-C5TIspJA.mjs} +4 -4
  17. package/dist/{CodexTextGeneration-DFZ5y4gj.cjs → CodexTextGeneration-sXPR9eld.cjs} +4 -4
  18. package/dist/{CopilotDriver-C0OhnSB1.mjs → CopilotDriver-Bcdpz6U_.mjs} +5 -5
  19. package/dist/{CopilotDriver-B_jEqfYQ.cjs → CopilotDriver-D6P0xgRX.cjs} +5 -5
  20. package/dist/{CursorDriver-DinXkGP9.mjs → CursorDriver-CRnDGwEv.mjs} +6 -6
  21. package/dist/{CursorDriver-BBFEW7ZI.cjs → CursorDriver-DMJ7sGSx.cjs} +7 -7
  22. package/dist/{ForgejoSourceControlProvider-iG9o7aZB.cjs → ForgejoSourceControlProvider-D4jGdaJX.cjs} +1 -1
  23. package/dist/{ForgejoSourceControlProvider-Dr0fxfud.mjs → ForgejoSourceControlProvider-Dl_Fk3RY.mjs} +1 -1
  24. package/dist/{GitHubSourceControlProvider-CnIu0n2Y.mjs → GitHubSourceControlProvider-DnwKf0ap.mjs} +1 -1
  25. package/dist/{GitHubSourceControlProvider-L1yFpep4.cjs → GitHubSourceControlProvider-QMe-zymI.cjs} +1 -1
  26. package/dist/{GitLabSourceControlProvider-BZdwXdJl.mjs → GitLabSourceControlProvider-Cj07OTBD.mjs} +1 -1
  27. package/dist/{GitLabSourceControlProvider-CrcBR6KQ.cjs → GitLabSourceControlProvider-CvvN5pHt.cjs} +1 -1
  28. package/dist/{GrokDriver-pX-N6HGS.mjs → GrokDriver-Bvq1jP3S.mjs} +7 -7
  29. package/dist/{GrokDriver-D_Ylzh5z.cjs → GrokDriver-jy8JIvYY.cjs} +10 -10
  30. package/dist/{Metrics-Bf96NJ4j.cjs → Metrics-C0LSU8s7.cjs} +979 -976
  31. package/dist/{Metrics-BjqGlIP4.mjs → Metrics-CnmjpbWk.mjs} +979 -976
  32. package/dist/{NodeSqliteClient-BGg70C7Q.cjs → NodeSqliteClient-D8bzGgPN.cjs} +1 -1
  33. package/dist/{OpenCodeDriver-BFEw5t09.cjs → OpenCodeDriver-Bu5D19tl.cjs} +6 -6
  34. package/dist/{OpenCodeDriver-Byu1pf_i.mjs → OpenCodeDriver-DhyVaBMT.mjs} +5 -5
  35. package/dist/{SideQuestionIsolation-81IoAuoi.mjs → SideQuestionIsolation-B-aE6aBz.mjs} +1 -1
  36. package/dist/{SideQuestionIsolation-CMPkCUP0.cjs → SideQuestionIsolation-CtJ4wX83.cjs} +1 -1
  37. package/dist/bin.cjs +8580 -305
  38. package/dist/bin.mjs +8560 -268
  39. package/dist/client/assets/{AccountSettings-DF6okodO.js → AccountSettings-v6-r6gYl.js} +1 -1
  40. package/dist/client/assets/{AiFocusSettings-BNNr6MW3.js → AiFocusSettings-BVdLON0q.js} +1 -1
  41. package/dist/client/assets/{AnimatedHeight-q2A-ikJ5.js → AnimatedHeight-UXn4-nUd.js} +1 -1
  42. package/dist/client/assets/{AppearanceSettings-BD0MZkm7.js → AppearanceSettings-DRChsQnN.js} +1 -1
  43. package/dist/client/assets/{BranchToolbar.logic-DN0He2gp.js → BranchToolbar.logic-YN3KjVr9.js} +1 -1
  44. package/dist/client/assets/{BrowserPanel-C_ddyv_7.js → BrowserPanel-Dxw3stFP.js} +1 -1
  45. package/dist/client/assets/{ChatRightPanel-B62ml3EW.js → ChatRightPanel-CygpcJiF.js} +5 -5
  46. package/dist/client/assets/{ChatThreadRouteView-BnvzR19h.js → ChatThreadRouteView-DYLZFHu0.js} +1 -1
  47. package/dist/client/assets/{CommandPaletteDialog-KtIlImWg.js → CommandPaletteDialog-BRvBzP1R.js} +1 -1
  48. package/dist/client/assets/{CompositeRoot-CTspN_gA.js → CompositeRoot-BeEGGWwn.js} +1 -1
  49. package/dist/client/assets/{ComputerUseSettings-B4KnZnFy.js → ComputerUseSettings-Cq8Pi0ZU.js} +1 -1
  50. package/dist/client/assets/{ConnectionsSettings-BW1hWm-b.js → ConnectionsSettings-RSYtexxd.js} +2 -2
  51. package/dist/client/assets/{ContextHandoffEndpointLabel-BCNMjnEV.js → ContextHandoffEndpointLabel-CeGDLNA4.js} +1 -1
  52. package/dist/client/assets/{DiagnosticsSettings-Biqth29E.js → DiagnosticsSettings-CDa6MVx4.js} +1 -1
  53. package/dist/client/assets/{DialogHandle-B1kG1DEu.js → DialogHandle-BE7egDQQ.js} +1 -1
  54. package/dist/client/assets/{DialogPopup-CZ-twaqA.js → DialogPopup-NfwDyR5c.js} +1 -1
  55. package/dist/client/assets/DialogRoot-C4mtzigX.js +1 -0
  56. package/dist/client/assets/{DialogTitle-D8Vib3Xi.js → DialogTitle-B_Q4DykI.js} +1 -1
  57. package/dist/client/assets/{DialogTrigger-C8WNfJfY.js → DialogTrigger-BSqd4Crj.js} +1 -1
  58. package/dist/client/assets/{DialogViewport-BzuRIust.js → DialogViewport-B6w_ROOE.js} +1 -1
  59. package/dist/client/assets/{DraftChatThreadRouteView-Bf196For.js → DraftChatThreadRouteView-JW_bXVrM.js} +1 -1
  60. package/dist/client/assets/{ExternalIdentityWeb.logic-DsTJQkg-.js → ExternalIdentityWeb.logic-BlKX8J9h.js} +1 -1
  61. package/dist/client/assets/{GlassSurface-R5jo7uZp.js → GlassSurface-DDG4eTlj.js} +1 -1
  62. package/dist/client/assets/{HostedConnectionControls-xi9LAlqs.js → HostedConnectionControls-CscV6hm1.js} +1 -1
  63. package/dist/client/assets/{HostedHubRoot-B5cJPL0b.js → HostedHubRoot-gp7-ClBP.js} +1 -1
  64. package/dist/client/assets/{HostedNativeAuthorizationRoute-BPxYI2S8.js → HostedNativeAuthorizationRoute-j7oSlakZ.js} +1 -1
  65. package/dist/client/assets/{HostedNodeRenameDialog-CZ6B6eOA.js → HostedNodeRenameDialog-D1DSiTpx.js} +1 -1
  66. package/dist/client/assets/{HostedRelayTrustNotice-Da0fanPZ.js → HostedRelayTrustNotice-B9jp4SRh.js} +1 -1
  67. package/dist/client/assets/{IntegrationsSettingsPanel-CVIFEYar.js → IntegrationsSettingsPanel-DH7SfWtV.js} +1 -1
  68. package/dist/client/assets/{KeybindingsSettings-FJVISTz3.js → KeybindingsSettings-DkgYYSHS.js} +1 -1
  69. package/dist/client/assets/{LazyBrowserPanel-ChCZntfd.js → LazyBrowserPanel-D4e76vc_.js} +1 -1
  70. package/dist/client/assets/{McpServersSettings-D5qSFad1.js → McpServersSettings-Dc1kPa-X.js} +1 -1
  71. package/dist/client/assets/{MobileSheet-BZwVUjae.js → MobileSheet-lT--mLEz.js} +1 -1
  72. package/dist/client/assets/{NodeSecuritySettings-C9eJS4Wt.js → NodeSecuritySettings-DcfSx4KT.js} +1 -1
  73. package/dist/client/assets/{NullStore-iCZTvdl5.js → NullStore-8d2s-Re3.js} +1 -1
  74. package/dist/client/assets/{OnboardingDialog-lWnlzsHQ.js → OnboardingDialog-CnLjwM6Z.js} +1 -1
  75. package/dist/client/assets/{OpinionatedPluginsSettings-DQ77FhYa.js → OpinionatedPluginsSettings-BTJyS3rN.js} +1 -1
  76. package/dist/client/assets/{PdfAttachmentPreview-CmCBedSk.js → PdfAttachmentPreview-C8-hT8KQ.js} +1 -1
  77. package/dist/client/assets/{PhoneGetAppInterstitial-DU7Pjbrv.js → PhoneGetAppInterstitial-Zh0zpBgT.js} +1 -1
  78. package/dist/client/assets/{PhoneHome-D91zzTlE.js → PhoneHome-CIMkuDJF.js} +1 -1
  79. package/dist/client/assets/{PhoneSettingsSurface-vyuCLVtH.js → PhoneSettingsSurface-CfZQxJNI.js} +1 -1
  80. package/dist/client/assets/{ProvidersSettingsPanel-QMtod_bc.js → ProvidersSettingsPanel-DAVSiwE1.js} +1 -1
  81. package/dist/client/assets/{QuitShortcutFeedback-Bti16E53.js → QuitShortcutFeedback-Qs9XsuZ4.js} +1 -1
  82. package/dist/client/assets/{RedactedSensitiveText-9r8QC1lJ.js → RedactedSensitiveText-BHGbQJwB.js} +1 -1
  83. package/dist/client/assets/{RootAppShell-CYT2IfYW.js → RootAppShell-T056pByH.js} +2 -2
  84. package/dist/client/assets/{Separator-ClXl-hQH.js → Separator-B6Esv57Y.js} +1 -1
  85. package/dist/client/assets/{SettingsDialog-BUcF48F9.js → SettingsDialog-BERU2Qg7.js} +1 -1
  86. package/dist/client/assets/{SettingsPanels-BydjDF1I.js → SettingsPanels-De_XZOQF.js} +1 -1
  87. package/dist/client/assets/{SettingsPanels.editor-zrq4ZT2j.js → SettingsPanels.editor-Dkva9gX_.js} +1 -1
  88. package/dist/client/assets/{SourceControlSettings-CqVmc4sB.js → SourceControlSettings-B4HS17cB.js} +1 -1
  89. package/dist/client/assets/{StatisticsPage-k-gimGKE.js → StatisticsPage-Bj2ftFdH.js} +1 -1
  90. package/dist/client/assets/{StatisticsPanel-CtShfsl4.js → StatisticsPanel-Dw7GBBmd.js} +1 -1
  91. package/dist/client/assets/{StatisticsSettingsLink-BapVo9aC.js → StatisticsSettingsLink-_XL3ABoI.js} +1 -1
  92. package/dist/client/assets/{ThreadTerminalDrawer-Bfs5NCNv.js → ThreadTerminalDrawer-CPPzQSXN.js} +1 -1
  93. package/dist/client/assets/{ThreadWorkspacePanel-L6uNQRNX.js → ThreadWorkspacePanel-DWKU7Omm.js} +1 -1
  94. package/dist/client/assets/{abnfDiagram-N423BO3Z-BzwwixLv.js → abnfDiagram-N423BO3Z-ByEe3mC0.js} +1 -1
  95. package/dist/client/assets/{activity-CPE_7Kqw.js → activity-CwTUF6lv.js} +1 -1
  96. package/dist/client/assets/{alert-DVbwtykC.js → alert-DQEkrtUJ.js} +1 -1
  97. package/dist/client/assets/{appChrome-B_VWWDFj.js → appChrome-TkWLAGxk.js} +1 -1
  98. package/dist/client/assets/architecture-7GRP2DOG-HS59zfrk.js +1 -0
  99. package/dist/client/assets/{architectureDiagram-T3A2C74G-DEiVciWZ.js → architectureDiagram-T3A2C74G-Bd-yxaTr.js} +1 -1
  100. package/dist/client/assets/{arrow-left-Ce-aUiy1.js → arrow-left-DUOpzEbP.js} +1 -1
  101. package/dist/client/assets/{arrow-right-BEwkAmxp.js → arrow-right-HOYJnPKw.js} +1 -1
  102. package/dist/client/assets/{arrow-up-right-CLCNhOeC.js → arrow-up-right-DHnMKuVA.js} +1 -1
  103. package/dist/client/assets/{authorization-BugIGt5e.js → authorization-D8dOcEYq.js} +1 -1
  104. package/dist/client/assets/{badge-DqZmJa1g.js → badge-2AZ3HfVS.js} +1 -1
  105. package/dist/client/assets/{blockDiagram-VBNYF7ZC-C-PBzm5g.js → blockDiagram-VBNYF7ZC-CPDBonMC.js} +1 -1
  106. package/dist/client/assets/{bot-k1yDQ5mQ.js → bot-DxjPA7Bw.js} +1 -1
  107. package/dist/client/assets/{c4Diagram-5PPSVZJV-DB6SIv2V.js → c4Diagram-5PPSVZJV-BM6pAiqT.js} +1 -1
  108. package/dist/client/assets/{capabilities-C9OPiefV.js → capabilities-CsHjxjab.js} +1 -1
  109. package/dist/client/assets/channel-Dn3_cOkm.js +1 -0
  110. package/dist/client/assets/{chart-column-CVU4MshQ.js → chart-column-Cg7d41tb.js} +1 -1
  111. package/dist/client/assets/chevron-right-Dsw16yGn.js +1 -0
  112. package/dist/client/assets/{chunk-2GRJ4B5K-CFM4Ac_N.js → chunk-2GRJ4B5K-DVKozJ41.js} +1 -1
  113. package/dist/client/assets/{chunk-4I5QYGJK-a9tLNjnj.js → chunk-4I5QYGJK-BRoMwPkW.js} +1 -1
  114. package/dist/client/assets/{chunk-5RXB4S5H-CbEb4Ht8.js → chunk-5RXB4S5H-DFMKyoqP.js} +1 -1
  115. package/dist/client/assets/{chunk-6Q2QTUOP-DPUmSmhc.js → chunk-6Q2QTUOP-Ba6UENe9.js} +1 -1
  116. package/dist/client/assets/{chunk-7Z6QIM7H-Ba8d__CQ.js → chunk-7Z6QIM7H-B87gYLWH.js} +1 -1
  117. package/dist/client/assets/{chunk-GF5L2VYU-BKOdlQ2f.js → chunk-GF5L2VYU-DZ840GRQ.js} +1 -1
  118. package/dist/client/assets/{chunk-I66GZJ75-DAfCveu2.js → chunk-I66GZJ75-BO6p4Aqg.js} +1 -1
  119. package/dist/client/assets/{chunk-JQJVKLGR-CPzgDuD8.js → chunk-JQJVKLGR-5dTfVinz.js} +1 -1
  120. package/dist/client/assets/{chunk-KBJHAD2P-X87J_pHD.js → chunk-KBJHAD2P-BeWfBZdP.js} +1 -1
  121. package/dist/client/assets/{chunk-NSK5VX7P-BgrjQWAz.js → chunk-NSK5VX7P-DuRkdn5k.js} +1 -1
  122. package/dist/client/assets/{chunk-QR6OTTB3-NTX__XXO.js → chunk-QR6OTTB3-Duz4Y_uE.js} +1 -1
  123. package/dist/client/assets/{chunk-UBXNYLIW-BVySE3ty.js → chunk-UBXNYLIW-D-z8URgN.js} +1 -1
  124. package/dist/client/assets/{chunk-W5SLKNZC-0-ctjkBJ.js → chunk-W5SLKNZC-AGjFjjoJ.js} +1 -1
  125. package/dist/client/assets/{chunk-WRU74C26-AGGo_1S7.js → chunk-WRU74C26-BgY3UiXB.js} +1 -1
  126. package/dist/client/assets/classDiagram-JCYQIIEL-ZQvrS8No.js +1 -0
  127. package/dist/client/assets/classDiagram-v2-OCEON4UE-ZQvrS8No.js +1 -0
  128. package/dist/client/assets/{clipboard-copy-C3icJCGA.js → clipboard-copy-BWf3JuTE.js} +1 -1
  129. package/dist/client/assets/{cynefin-OW5HDTMX-BR32cltb.js → cynefin-OW5HDTMX-BuOAGqlK.js} +1 -1
  130. package/dist/client/assets/{cynefinDiagram-MW4NZA55-B7S5bXUw.js → cynefinDiagram-MW4NZA55-DqV0Aokp.js} +1 -1
  131. package/dist/client/assets/{dagre-VZM6K2ZE-BZOfZvme.js → dagre-VZM6K2ZE-D_GFquDW.js} +1 -1
  132. package/dist/client/assets/{data-list-E_dNBqgV.js → data-list-BJCq3CVP.js} +1 -1
  133. package/dist/client/assets/{desktopWorkspace-DIoIhyml.js → desktopWorkspace-_iM6B9Kf.js} +1 -1
  134. package/dist/client/assets/{deviceName-BY2WK012.js → deviceName-C2N8ZRX3.js} +1 -1
  135. package/dist/client/assets/{diagram-7IWD3JNH-CypfFHxI.js → diagram-7IWD3JNH-B1wlsNg2.js} +1 -1
  136. package/dist/client/assets/{diagram-B4RE2ZJO-CaYsJtDz.js → diagram-B4RE2ZJO-D-CYoym7.js} +1 -1
  137. package/dist/client/assets/{diagram-LBJQPF4R-BdhZtcd2.js → diagram-LBJQPF4R-DqJ9NCqt.js} +1 -1
  138. package/dist/client/assets/{diagram-Q27KOJAE-CW1SMIBy.js → diagram-Q27KOJAE-3yp1D2u4.js} +1 -1
  139. package/dist/client/assets/{diagram-UB23O5K3-Cq8GGDkV.js → diagram-UB23O5K3-Byp25nGC.js} +1 -1
  140. package/dist/client/assets/{download-Fq1MsYfI.js → download-DsYNYJeu.js} +1 -1
  141. package/dist/client/assets/{ebnfDiagram-BXEA7PRR-CE78Op8p.js → ebnfDiagram-BXEA7PRR-B_IM1l6o.js} +1 -1
  142. package/dist/client/assets/{editorPreferences-DzxKMQJx.js → editorPreferences-D8q1ItMW.js} +1 -1
  143. package/dist/client/assets/{empty-DXTz-nBL.js → empty-BbJHvskr.js} +1 -1
  144. package/dist/client/assets/{erDiagram-JOGREHBK-Bn6BFae6.js → erDiagram-JOGREHBK--OtcrCRJ.js} +1 -1
  145. package/dist/client/assets/eventmodeling-NTZA5JFV-Dj71kuPV.js +1 -0
  146. package/dist/client/assets/flowDiagram-UKHOOZJN-BaAiwuvL.js +1 -0
  147. package/dist/client/assets/{ganttDiagram-PKOTCBZU-C8NbmUQP.js → ganttDiagram-PKOTCBZU-w0seBi3Q.js} +1 -1
  148. package/dist/client/assets/{gitGraph-4MIJSDKK-Dg7W2mOf.js → gitGraph-4MIJSDKK-BOJ0lcSW.js} +1 -1
  149. package/dist/client/assets/{gitGraphDiagram-DS77QQ5N-XEC1jydW.js → gitGraphDiagram-DS77QQ5N-BMfOCCYn.js} +1 -1
  150. package/dist/client/assets/{group-CcSMHbpZ.js → group-tVMKGp7Q.js} +1 -1
  151. package/dist/client/assets/{hostedConnectionCoordinator-BkxMXc2s.js → hostedConnectionCoordinator-BuRWCvUG.js} +1 -1
  152. package/dist/client/assets/hostedPairing-5n5srRC9.js +1 -0
  153. package/dist/client/assets/{hubRoutes-Ch__ge2L.js → hubRoutes-jcMPIFy3.js} +1 -1
  154. package/dist/client/assets/{index-3zoAo5bo.js → index-BqZvnGNr.js} +1 -1
  155. package/dist/client/assets/{info-A6RAGUB7-CPN5xH7s.js → info-A6RAGUB7-acjBTQ5o.js} +1 -1
  156. package/dist/client/assets/{infoDiagram-6WML65LV-DbXXnE3-.js → infoDiagram-6WML65LV-DB01Nc2m.js} +1 -1
  157. package/dist/client/assets/{input-zI-YDU9i.js → input-BDWSVClC.js} +1 -1
  158. package/dist/client/assets/{ishikawaDiagram-WSZJBQD7-DAjJrXWe.js → ishikawaDiagram-WSZJBQD7-KhZTvm-J.js} +1 -1
  159. package/dist/client/assets/{journeyDiagram-NVQOT4AX-CaGm-K-C.js → journeyDiagram-NVQOT4AX-C3JCYk-2.js} +1 -1
  160. package/dist/client/assets/{kanban-definition-27J2QSJJ-C2YRqY28.js → kanban-definition-27J2QSJJ-Dbo0C1s6.js} +1 -1
  161. package/dist/client/assets/{kbd-DlXUKjl1.js → kbd-Dxm5Elqj.js} +1 -1
  162. package/dist/client/assets/{key-round-DLUapaUr.js → key-round-CETZqe3h.js} +1 -1
  163. package/dist/client/assets/{layers-3D4z3mrk.js → layers-Dqez1Uq8.js} +1 -1
  164. package/dist/client/assets/{log-out-BxEBqpSs.js → log-out-D5-aSBAz.js} +1 -1
  165. package/dist/client/assets/{logging-C6tXZlGQ.js → logging-B_qXVrk6.js} +1 -1
  166. package/dist/client/assets/{main-DsnAjTqg.js → main-DAbEANjY.js} +2 -2
  167. package/dist/client/assets/{mermaid-parser.core-Dhd66igk.js → mermaid-parser.core-B6Q-3x_q.js} +2 -2
  168. package/dist/client/assets/{mermaidEngine-3NZnIFOn.js → mermaidEngine-DksLcesB.js} +3 -3
  169. package/dist/client/assets/{mindmap-definition-FAOFIHXS-SuO77jBW.js → mindmap-definition-FAOFIHXS-LaMzRxqw.js} +1 -1
  170. package/dist/client/assets/{motion-B4mmVewo.js → motion-BdscFixQ.js} +1 -1
  171. package/dist/client/assets/{packet-AYTQ26CC-BZwkWo3N.js → packet-AYTQ26CC-BHhg59Si.js} +1 -1
  172. package/dist/client/assets/{pairingUrl-rQM9kSGT.js → pairingUrl-Dn1e2CVw.js} +1 -1
  173. package/dist/client/assets/{palette-BXA2I3bI.js → palette-92ylWqeC.js} +1 -1
  174. package/dist/client/assets/{pegDiagram-VL7TDLO6-DgWypDaQ.js → pegDiagram-VL7TDLO6-s7l7UD9d.js} +1 -1
  175. package/dist/client/assets/{pie-WAS4IAKB-C1iJ73d9.js → pie-WAS4IAKB-DygX31Z9.js} +1 -1
  176. package/dist/client/assets/{pieDiagram-7S7Q4E2Y-DK1OTG7x.js → pieDiagram-7S7Q4E2Y-bb6I9TtZ.js} +1 -1
  177. package/dist/client/assets/{play-CJNYRuck.js → play-DUvOxTpL.js} +1 -1
  178. package/dist/client/assets/{primary-CQh_KHGG.js → primary-DZjgHvyf.js} +3 -3
  179. package/dist/client/assets/{providerDriverMeta-DJ9TrG26.js → providerDriverMeta-T2YbXzuS.js} +1 -1
  180. package/dist/client/assets/{qr-code-CBzdIN1G.js → qr-code-D4CtBq2F.js} +1 -1
  181. package/dist/client/assets/{qr-code-HMr6crTy.js → qr-code-dbkTo07n.js} +1 -1
  182. package/dist/client/assets/{quadrantDiagram-CIZ2JOQS-CIgZ3afX.js → quadrantDiagram-CIZ2JOQS-Cj1Y68ZF.js} +1 -1
  183. package/dist/client/assets/{radar-RG4KPBEZ-vq15KQ2S.js → radar-RG4KPBEZ-FHM3ftPp.js} +1 -1
  184. package/dist/client/assets/{radio-group-1yuMmVHi.js → radio-group-CRnHYWa8.js} +1 -1
  185. package/dist/client/assets/{railroad-74A4TZTK-DWMARNIs.js → railroad-74A4TZTK-CPMn18Cm.js} +1 -1
  186. package/dist/client/assets/railroad-abnf-HS5TGJTU-DxU7Mt1k.js +1 -0
  187. package/dist/client/assets/railroad-ebnf-LZEXJU2U-BYAPVjRd.js +1 -0
  188. package/dist/client/assets/railroad-peg-WCYAUIDC-BOqgR_X7.js +1 -0
  189. package/dist/client/assets/{railroadDiagram-AXF67PYL-rE9Jx5yK.js → railroadDiagram-AXF67PYL-DyV3SuDj.js} +1 -1
  190. package/dist/client/assets/{refresh-cw-DBJIPv7m.js → refresh-cw-CgDa2Ok_.js} +1 -1
  191. package/dist/client/assets/{requirementDiagram-LRYGKXZP-Dkz6KTug.js → requirementDiagram-LRYGKXZP-_xEAGWaH.js} +1 -1
  192. package/dist/client/assets/runtime-BwHA1GUS.js +18 -0
  193. package/dist/client/assets/{sankeyDiagram-W5VNT64P-qCyqmTya.js → sankeyDiagram-W5VNT64P-Clf6oTLi.js} +1 -1
  194. package/dist/client/assets/{save-BFsP9OG2.js → save-C8h0AMdl.js} +1 -1
  195. package/dist/client/assets/{scroll-area-CxjQJZM9.js → scroll-area-7n2X_RLQ.js} +1 -1
  196. package/dist/client/assets/{scrollEdges-CXvSHaVb.js → scrollEdges-BXYnwntN.js} +1 -1
  197. package/dist/client/assets/{separator-D3j91Nju.js → separator-CL1qjMqJ.js} +1 -1
  198. package/dist/client/assets/{sequenceDiagram-SI44F4Z6-GCGWxGKL.js → sequenceDiagram-SI44F4Z6-CcYtQLSe.js} +1 -1
  199. package/dist/client/assets/{settingsLayout-3SUkadS6.js → settingsLayout-DxsFwhF0.js} +1 -1
  200. package/dist/client/assets/{sheet-BOQ2T2gY.js → sheet-CGiaw8-i.js} +1 -1
  201. package/dist/client/assets/{shield-Colgxqw7.js → shield-DPC4oHTi.js} +1 -1
  202. package/dist/client/assets/{shield-alert-CWQ-fgqm.js → shield-alert-CwH36qZb.js} +1 -1
  203. package/dist/client/assets/{shield-check-Dgpx5EQs.js → shield-check-CGD7sEeF.js} +1 -1
  204. package/dist/client/assets/{sidebar-BIv8pHHx.js → sidebar-Cc6ANbOP.js} +1 -1
  205. package/dist/client/assets/{sidebarProjectFolders-BpKCw8IR.js → sidebarProjectFolders-DO2Uv84F.js} +1 -1
  206. package/dist/client/assets/{sidebarStatusText-DSeDlb-o.js → sidebarStatusText-B4AtFXZo.js} +1 -1
  207. package/dist/client/assets/{sidebarUndo-DzblmE6P.js → sidebarUndo-gdSrfa4O.js} +1 -1
  208. package/dist/client/assets/{skeleton-BdJ4w_TS.js → skeleton-rS3IgBob.js} +1 -1
  209. package/dist/client/assets/{smartphone-DhBEWfKK.js → smartphone-DgVJfbv3.js} +1 -1
  210. package/dist/client/assets/square-Cr9X8U6y.js +1 -0
  211. package/dist/client/assets/{src-DHNjfMxR.js → src-C3Y_imaX.js} +1 -1
  212. package/dist/client/assets/{star-BAzXRepp.js → star-Cqay-Cae.js} +1 -1
  213. package/dist/client/assets/{stateDiagram-OKZ733FA-D8fRUjov.js → stateDiagram-OKZ733FA-DEKURpRP.js} +1 -1
  214. package/dist/client/assets/stateDiagram-v2-UEYNNEHI-CWtHILqh.js +1 -0
  215. package/dist/client/assets/storeSelectors-CTDWheMy.js +1 -0
  216. package/dist/client/assets/{swimlanes-SLNWSIFB-BKy9AxWZ.js → swimlanes-SLNWSIFB-DrR6sbi6.js} +1 -1
  217. package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-DuaPce9O.js +8 -0
  218. package/dist/client/assets/{switch-DgLijJhN.js → switch-DnpJB2xv.js} +1 -1
  219. package/dist/client/assets/{timeline-definition-Z64GVDOM-DV53IwmP.js → timeline-definition-Z64GVDOM-bQJvmJx5.js} +1 -1
  220. package/dist/client/assets/{toggle-BgR-G8hl.js → toggle-D10FsFoE.js} +1 -1
  221. package/dist/client/assets/{toggle-group-DRIEnEQy.js → toggle-group-BhzbQPEQ.js} +1 -1
  222. package/dist/client/assets/{tokenModePresentation-Bh3mJ9H-.js → tokenModePresentation-BkS-mry_.js} +1 -1
  223. package/dist/client/assets/{tooltip-CsNk2GK1.js → tooltip-BlweKBxc.js} +1 -1
  224. package/dist/client/assets/{treeView-Q6P3EWNA-BgFMn3HH.js → treeView-Q6P3EWNA-D4Ex5QTp.js} +1 -1
  225. package/dist/client/assets/{treemap-WGGIJYW6-B45XVWgo.js → treemap-WGGIJYW6-C4B6Y6qM.js} +1 -1
  226. package/dist/client/assets/{unplug-0SZT8Az_.js → unplug-B1dczi-t.js} +1 -1
  227. package/dist/client/assets/{usage-DF8oQrsy.js → usage-BBwaxMif.js} +1 -1
  228. package/dist/client/assets/useAppSidebarCollapsed-CFy476E3.js +1 -0
  229. package/dist/client/assets/useBaseUiId-DKOjzmu3.js +1 -0
  230. package/dist/client/assets/{useLabelableId-CTlGVpp_.js → useLabelableId-DQbY2GG1.js} +1 -1
  231. package/dist/client/assets/{useNavigate-xewFGSmS.js → useNavigate-B8oXtF30.js} +1 -1
  232. package/dist/client/assets/{usePhoneThreadActions-CuSwvIb4.js → usePhoneThreadActions-6DCLiyJ5.js} +1 -1
  233. package/dist/client/assets/{usePopupViewport-CCXjC0oV.js → usePopupViewport-CNWcP7Od.js} +1 -1
  234. package/dist/client/assets/{useScrollLock-DkiskCYn.js → useScrollLock-BbKeKZdj.js} +1 -1
  235. package/dist/client/assets/{useStatistics-C5V0rg9r.js → useStatistics-B76_r68I.js} +1 -1
  236. package/dist/client/assets/{useTriggerFocusGuards-Cd4IS7Sl.js → useTriggerFocusGuards-BC4Wb3GI.js} +1 -1
  237. package/dist/client/assets/{useValueChanged-DUWoN5BG.js → useValueChanged-BkTbyZdO.js} +1 -1
  238. package/dist/client/assets/{user-round-BtyrzbBf.js → user-round-CLy1Qy1Y.js} +1 -1
  239. package/dist/client/assets/{vennDiagram-T6HMQDX7-DAr5h306.js → vennDiagram-T6HMQDX7-8iiroXim.js} +1 -1
  240. package/dist/client/assets/{vscode-icons-LDoILSKI.js → vscode-icons-CJBVQtq5.js} +1 -1
  241. package/dist/client/assets/{wardley-WFR3VGLG-6MSUlbTx.js → wardley-WFR3VGLG-DpyNUbTc.js} +1 -1
  242. package/dist/client/assets/{wardleyDiagram-T6FBY63Y-Bwv8xq6E.js → wardleyDiagram-T6FBY63Y-CI7is3QO.js} +1 -1
  243. package/dist/client/assets/{workspaceMetadataProjection-DzVpakWU.js → workspaceMetadataProjection-aqZEXDrQ.js} +1 -1
  244. package/dist/client/assets/{wrench-BDHgkqDa.js → wrench-7pbbxqrZ.js} +1 -1
  245. package/dist/client/assets/{xychartDiagram-ELKLHX3M-Be0CbWLp.js → xychartDiagram-ELKLHX3M-BTEX3m2y.js} +1 -1
  246. package/dist/client/index.html +1 -1
  247. package/dist/{deviceHostWorker-CYnrwfrv.cjs → deviceHostWorker-D4HauWIV.cjs} +1 -1
  248. package/dist/{git-BKwGfw8A.mjs → git-9xWsJYIH.mjs} +1 -1
  249. package/dist/{git-Dn5wrgFY.cjs → git-xIkXFy_l.cjs} +2 -2
  250. package/dist/{makeManagedServerProvider-B_lPFNpL.mjs → makeManagedServerProvider-B90UKjnv.mjs} +1 -1
  251. package/dist/{makeManagedServerProvider-CUwxc0Pn.cjs → makeManagedServerProvider-CF776SAO.cjs} +2 -2
  252. package/dist/resource-monitor/ryco-resource-monitor +0 -0
  253. package/dist/resource-monitor/ryco-resource-monitor.exe +0 -0
  254. package/dist/resource-monitor/win32-arm64/ryco-resource-monitor.exe +0 -0
  255. package/dist/resource-monitor/win32-x64/ryco-resource-monitor.exe +0 -0
  256. package/dist/{rolldown-runtime-LGfotAqq.cjs → rolldown-runtime-HbSU0i7K.cjs} +7 -0
  257. package/dist/{src-BzVJd3Me.cjs → src-CARHuYkT.cjs} +1059 -178
  258. package/dist/{src-7E1M4gTQ.mjs → src-CtsgPPhb.mjs} +198 -97
  259. package/package.json +1 -1
  260. package/dist/client/assets/DialogRoot-CEU7Xp57.js +0 -1
  261. package/dist/client/assets/architecture-7GRP2DOG-B6OTx_1D.js +0 -1
  262. package/dist/client/assets/channel-D_j9jK0M.js +0 -1
  263. package/dist/client/assets/chevron-right-D3dUAoht.js +0 -1
  264. package/dist/client/assets/classDiagram-JCYQIIEL-Ck79EbLj.js +0 -1
  265. package/dist/client/assets/classDiagram-v2-OCEON4UE-Ck79EbLj.js +0 -1
  266. package/dist/client/assets/eventmodeling-NTZA5JFV-COIUUd8Y.js +0 -1
  267. package/dist/client/assets/flowDiagram-UKHOOZJN-Cdhu8N9G.js +0 -1
  268. package/dist/client/assets/hostedPairing-CqhLPQqG.js +0 -1
  269. package/dist/client/assets/railroad-abnf-HS5TGJTU-DtRRa_PL.js +0 -1
  270. package/dist/client/assets/railroad-ebnf-LZEXJU2U-WQz4QHTw.js +0 -1
  271. package/dist/client/assets/railroad-peg-WCYAUIDC-1gkGEpqz.js +0 -1
  272. package/dist/client/assets/runtime-DpHhg0dl.js +0 -18
  273. package/dist/client/assets/square--aW0vCo4.js +0 -1
  274. package/dist/client/assets/stateDiagram-v2-UEYNNEHI-vKQeXqcV.js +0 -1
  275. package/dist/client/assets/storeSelectors-BFVEGU0F.js +0 -1
  276. package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-qtmvcwUS.js +0 -8
  277. package/dist/client/assets/useAppSidebarCollapsed-CvO9sEQ7.js +0 -1
  278. package/dist/client/assets/useBaseUiId-B5nK6G4h.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{lt as t,n}from"./primary-CQh_KHGG.js";import{t as r}from"./src-DHNjfMxR.js";import{$l as i,Qr as a,do as o,ei as s,ho as c,oo as l,u,y as d}from"./runtime-DpHhg0dl.js";import{t as f}from"./react-CwJFpaho.js";import{t as p}from"./compiler-runtime-C4g8XhC5.js";import{a as m,c as h,n as g,o as _,s as v,t as y}from"./badge-DqZmJa1g.js";import{t as b}from"./activity-CPE_7Kqw.js";import{A as x,C as S,D as C,E as w,F as T,N as E,O as D,P as O,R as k,S as A,_ as ee,a as j,b as M,c as N,g as P,h as F,i as I,j as L,k as te,l as R,m as ne,o as z,p as B,s as re,t as V,u as H,v as ie,w as U,y as W}from"./useStatistics-C5V0rg9r.js";import{t as G}from"./chart-column-CVU4MshQ.js";import{a as K,i as q,n as ae,r as oe,t as se}from"./capabilities-C9OPiefV.js";import{n as ce,t as le}from"./layers-3D4z3mrk.js";import{t as ue}from"./refresh-cw-DBJIPv7m.js";import{t as de}from"./shield-alert-CWQ-fgqm.js";import{t as fe}from"./wrench-BDHgkqDa.js";import{t as pe}from"./scroll-area-CxjQJZM9.js";import{o as me}from"./sidebar-BIv8pHHx.js";import{n as he,t as ge}from"./appChrome-B_VWWDFj.js";import{t as _e}from"./useAppSidebarCollapsed-CvO9sEQ7.js";import{a as ve,i as ye,r as be}from"./usage-DF8oQrsy.js";import{n as xe,r as Se,t as J}from"./providers-BEK_ibg5.js";var Ce={name:`brain-circuit`,size:24,node:[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]};Ce.node;var we=c(Ce),Te={name:`circle-dollar-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]};Te.node;var Ee=c(Te),De={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};De.node;var Oe=c(De);function ke(e,t){if(t===void 0||t.length===0)return e.buckets;let n=new Set(t);return e.buckets.filter(e=>n.has(e.provider))}function Ae(e,t){let n=0,r=0,i=0,a=0,o=0,s=0,c=0,l=0,u=0,d=!1,f=!1,p=0,m=0;for(let e of t)n+=e.tokens.totalTokens,r+=e.tokens.uncachedInputTokens,i+=e.tokens.cachedInputTokens,a+=e.tokens.cacheCreationInputTokens,o+=e.tokens.outputTokens,s=s===null||e.tokens.reasoningTokens===void 0?null:s+e.tokens.reasoningTokens,c+=e.responseCount,p+=e.pricedTokenCount,m+=e.unpricedTokenCount,e.estimatedCostUsd!==void 0&&(l+=e.estimatedCostUsd,d=!0),e.estimatedCacheSavingsUsd!==void 0&&(u+=e.estimatedCacheSavingsUsd,f=!0);let h=new Set(t.map(e=>e.provider)),g=new Set(t.flatMap(e=>e.exportSessionIds??[])).size+e.sources.filter(e=>e.included&&h.has(e.provider)&&(e.provider!==`cursor`||e.deduplicationKind!==`declared`)&&e.status!==`not-found`&&e.status!==`failed`).reduce((e,t)=>e+t.distinctSessionCount,0);return{totalTokens:n,uncachedInputTokens:r,cachedInputTokens:i,cacheCreationInputTokens:a,outputTokens:o,reasoningTokens:s,responseCount:c,distinctSessionCount:g,estimatedCostUsd:d?l:null,estimatedCacheSavingsUsd:f?u:null,pricedTokenCount:p,unpricedTokenCount:m}}function je(e,t){return new Date(Date.parse(`${e}T12:00:00.000Z`)+t*864e5).toISOString().slice(0,10)}function Me(e,t){let n=new Map,r=e=>({date:e,claudeCost:null,codexCost:null,cursorCost:null,opencodeCost:null,claudeTokens:null,codexTokens:null,cursorTokens:null,opencodeTokens:null});for(let e of t){let t=n.get(e.date)??r(e.date),i=e.provider,a=`${i}Cost`,o=`${i}Tokens`;n.set(e.date,{...t,[a]:e.estimatedCostUsd===void 0?t[a]:(t[a]??0)+e.estimatedCostUsd,[o]:(t[o]??0)+e.tokens.totalTokens})}let i=e.startDate??[...n.keys()].toSorted()[0];if(i===void 0)return[];let a=new Set(t.map(e=>e.provider)),o=new Set(J.filter(t=>{let n=e.sources.filter(e=>e.included&&e.provider===t);return a.has(t)&&n.length>0&&n.every(e=>e.status===`complete`)})),s=[];for(let t=i;t<=e.endDate&&s.length<36600;t=je(t,1)){let e=n.get(t)??r(t),i={...e};for(let t of J)o.has(t)&&(i[`${t}Tokens`]??=0,e[`${t}Tokens`]===null&&(i[`${t}Cost`]??=0));s.push(i)}return s}function Ne(e,t){let n=new Map;for(let r of e){let e=t===`model`?`${r.provider}\0${r.model}`:r.date,i=n.get(e)??{key:e,label:t===`model`?r.model:r.date,...t===`model`?{provider:r.provider}:{},tokens:0,costUsd:null,unpricedTokens:0,responses:0};n.set(e,{...i,tokens:i.tokens+r.tokens.totalTokens,costUsd:r.estimatedCostUsd===void 0?i.costUsd:(i.costUsd??0)+r.estimatedCostUsd,unpricedTokens:i.unpricedTokens+r.unpricedTokenCount,responses:i.responses+r.responseCount})}let r=[...n.values()].some(e=>e.costUsd!==null);return[...n.values()].toSorted((e,t)=>r&&(t.costUsd??-1)-(e.costUsd??-1)||t.tokens-e.tokens)}function Pe(e,t){return t===void 0||t.length===0||t.includes(`cursor`)?e.imports??[]:[]}function Fe(e){let t=null,n=new Map;for(let r of e)r.metric===`requests`?t=(t??0)+r.value:r.currency&&n.set(r.currency,(n.get(r.currency)??0)+r.value);return{requests:t,costs:[...n].map(([e,t])=>({currency:e,value:t}))}}var Y=p(),X=i();function Ie(e){let t=(0,Y.c)(56),{search:r,onSearchChange:i}=e,{snapshot:o,loading:s,error:c,refresh:u,refreshing:d}=V(),f=r.projectId??null,p=r.model??null,m=r.modelProvider??null,h;t[0]!==r.range||t[1]!==f||t[2]!==p||t[3]!==m?(h={range:r.range,projectId:f,model:p,provider:m},t[0]=r.range,t[1]=f,t[2]=p,t[3]=m,t[4]=h):h=t[4];let g=h,_;bb0:{if(!o){_=null;break bb0}let e,n,r,i;if(t[5]!==g||t[6]!==o){let a=T(o,g),s=k(a);e=a,n=s,r=O(o,a,g.range),i=L(a,E(o)),t[5]=g,t[6]=o,t[7]=e,t[8]=n,t[9]=r,t[10]=i}else e=t[7],n=t[8],r=t[9],i=t[10];let a;t[11]!==e||t[12]!==n||t[13]!==r||t[14]!==i?(a={buckets:e,totals:n,days:r,projects:i},t[11]=e,t[12]=n,t[13]=r,t[14]=i,t[15]=a):a=t[15],_=a}let v=_;if(s&&!o){let e;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(re,{}),t[16]=e):e=t[16],e}if(c&&!o){let e;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(ue,{}),t[17]=e):e=t[17];let n;t[18]===u?n=t[19]:(n=(0,X.jsxs)(a,{size:`sm`,variant:`outline`,onClick:u,children:[e,` Try again`]}),t[18]=u,t[19]=n);let r;return t[20]!==c||t[21]!==n?(r=(0,X.jsx)(N,{icon:l,title:`Couldn’t load Ryco activity`,description:c,action:n}),t[20]=c,t[21]=n,t[22]=r):r=t[22],r}if(!o||!v)return null;let{totals:y,days:x,projects:S}=v,C=n()?.label??`Current environment`,w;if(t[23]!==x||t[24]!==g||t[25]!==i||t[26]!==S||t[27]!==u||t[28]!==d||t[29]!==r||t[30]!==o.dailyBuckets.length||t[31]!==o.models||t[32]!==o.projects||t[33]!==o.recentPullRequests||t[34]!==o.worktrees||t[35]!==y){let e=Re(x,r.activityMetric),n;t[37]!==i||t[38]!==r?(n=e=>i({...r,range:e.range,projectId:e.projectId??void 0,model:e.model??void 0,modelProvider:e.provider??void 0}),t[37]=i,t[38]=r,t[39]=n):n=t[39];let s;t[40]!==g||t[41]!==o.models||t[42]!==o.projects||t[43]!==n?(s=(0,X.jsx)(I,{filter:g,projects:o.projects,models:o.models,onChange:n}),t[40]=g,t[41]=o.models,t[42]=o.projects,t[43]=n,t[44]=s):s=t[44];let c=d?`animate-spin`:void 0,l;t[45]===c?l=t[46]:(l=(0,X.jsx)(ue,{className:c}),t[45]=c,t[46]=l);let f=d?`Refreshing`:`Refresh`,p;t[47]!==u||t[48]!==d||t[49]!==l||t[50]!==f?(p=(0,X.jsxs)(a,{size:`sm`,variant:`outline`,onClick:u,disabled:d,children:[l,f]}),t[47]=u,t[48]=d,t[49]=l,t[50]=f,t[51]=p):p=t[51];let m;t[52]!==p||t[53]!==s?(m=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[s,p]}),t[52]=p,t[53]=s,t[54]=m):m=t[54];let h;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,X.jsxs)(`p`,{className:`max-w-4xl text-sm leading-relaxed text-muted-foreground`,children:[`Activity includes work observed by Ryco on`,` `,(0,X.jsx)(`span`,{className:`font-medium text-foreground`,children:C}),`. Usage from other CLI sessions appears in the Usage tab and is not assigned to projects.`]}),t[55]=h):h=t[55],w=(0,X.jsxs)(`div`,{className:`space-y-8`,children:[m,h,o.dailyBuckets.length===0?(0,X.jsx)(N,{icon:b,title:`No Ryco activity yet`,description:`Project and agent activity will appear here after your first completed turns.`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-3 xl:grid-cols-5`,children:[(0,X.jsx)(z,{label:`Active time`,icon:K,value:F(y.activeMs),sub:`${M(y.totalTokens)} observed tokens`}),(0,X.jsx)(z,{label:`Turns`,icon:b,value:P(y.turns),sub:`Completed agent turns`}),(0,X.jsx)(z,{label:`Chats`,icon:oe,value:P(y.threadsCreated),sub:`Conversations started`}),(0,X.jsx)(z,{label:`Tool uses`,icon:fe,value:P(y.toolUses),sub:`Observed invocations`}),(0,X.jsx)(z,{label:`Files changed`,icon:ce,value:P(y.filesChanged),sub:`+${P(y.additions)} / −${P(y.deletions)} lines`})]}),(0,X.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[1.2fr_0.8fr]`,children:[(0,X.jsxs)(j,{title:`Activity rhythm`,icon:b,bodyClassName:`p-5`,action:(0,X.jsx)(ze,{search:r,onSearchChange:i}),children:[(0,X.jsx)(B,{points:x,metric:r.activityMetric}),(0,X.jsxs)(`div`,{className:`mt-5 grid grid-cols-3 gap-3 border-t border-border/60 pt-4`,children:[(0,X.jsx)(Q,{label:`Active days`,value:P(e.activeDays)}),(0,X.jsx)(Q,{label:`Current streak`,value:`${P(e.currentStreak)}d`}),(0,X.jsx)(Q,{label:`Busiest UTC day`,value:e.busiestLabel})]})]}),(0,X.jsx)(j,{title:`Projects`,icon:b,bodyClassName:`p-4`,children:(0,X.jsx)(H,{data:S,metric:r.activityMetric})})]}),(0,X.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,X.jsxs)(j,{title:`Code changes`,icon:ce,bodyClassName:`p-4`,children:[(0,X.jsxs)(`div`,{className:`mb-4 flex gap-6 text-sm`,children:[(0,X.jsx)(Q,{label:`Files`,value:P(y.filesChanged)}),(0,X.jsx)(Q,{label:`Added`,value:`+${P(y.additions)}`,tone:`positive`}),(0,X.jsx)(Q,{label:`Removed`,value:`−${P(y.deletions)}`,tone:`negative`})]}),(0,X.jsx)(R,{data:x})]}),(0,X.jsxs)(j,{title:`Source control · all time`,icon:q,bodyClassName:`overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-4 gap-3 border-b border-border/60 px-4 py-4`,children:[(0,X.jsx)(Q,{label:`Active`,value:P(o.worktrees.active)}),(0,X.jsx)(Q,{label:`Created`,value:P(o.worktrees.created)}),(0,X.jsx)(Q,{label:`Archived`,value:P(o.worktrees.archived)}),(0,X.jsx)(Q,{label:`Open PRs`,value:P(o.worktrees.openPrs)})]}),o.recentPullRequests.length===0?(0,X.jsx)(`div`,{className:`flex h-[260px] items-center justify-center px-6 text-center text-xs text-muted-foreground`,children:`No projected pull requests yet.`}):(0,X.jsx)(`div`,{className:`divide-y divide-border/60`,children:o.recentPullRequests.slice(0,6).map(Le)})]})]})]})]}),t[23]=x,t[24]=g,t[25]=i,t[26]=S,t[27]=u,t[28]=d,t[29]=r,t[30]=o.dailyBuckets.length,t[31]=o.models,t[32]=o.projects,t[33]=o.recentPullRequests,t[34]=o.worktrees,t[35]=y,t[36]=w}else w=t[36];return w}function Le(e){return(0,X.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3.5`,children:[(0,X.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,X.jsx)(q,{className:`size-4`})}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.prTitle||e.worktreeTitle||e.branch}),(0,X.jsxs)(`p`,{className:`mt-0.5 truncate text-[11px] text-muted-foreground`,children:[e.projectTitle,` · #`,e.prNumber,` ·`,` `,W(e.updatedAt)]})]}),(0,X.jsx)(y,{variant:e.prState===`merged`?`success`:e.active?`info`:`secondary`,children:e.prIsDraft?`Draft`:e.prState??(e.active?`Open`:`Archived`)})]},e.worktreeId)}function Z(e,t){return t===`turns`?e.turns:t===`activeMs`?e.activeMs:e.filesChanged}function Re(e,t){let n=0,r=0,i=null;for(let r of e){let e=Z(r,t);e>0&&(n+=1),(i===null||e>Z(i,t))&&(i=r)}for(let n=e.length-1;n>=0;--n){let i=e[n];if(i===void 0||Z(i,t)<=0)break;r+=1}if(i===null||Z(i,t)<=0)return{activeDays:n,currentStreak:r,busiestLabel:`—`};let a=Z(i,t),o=t===`activeMs`?F(a):P(a);return{activeDays:n,currentStreak:r,busiestLabel:`${i.date.slice(5)} · ${o}`}}function ze(e){let t=(0,Y.c)(4),{search:n,onSearchChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`turns`,`activeMs`,`files`],t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,X.jsx)(`div`,{className:`inline-flex rounded-md bg-muted p-0.5`,children:i.map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>r({...n,activityMetric:e}),className:s(`h-6 rounded-sm px-2 text-[11px]`,n.activityMetric===e?`bg-background text-foreground shadow-xs`:`text-muted-foreground`),children:e===`activeMs`?`Time`:e===`files`?`Files`:`Turns`},e))}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function Q(e){let t=(0,Y.c)(10),{label:n,value:r,tone:i}=e,a;t[0]===n?a=t[1]:(a=(0,X.jsx)(`p`,{className:`text-[10px] tracking-[0.08em] text-muted-foreground uppercase`,children:n}),t[0]=n,t[1]=a);let o=i===`positive`?`text-success-foreground`:i===`negative`?`text-destructive`:`text-foreground`,c;t[2]===o?c=t[3]:(c=s(`mt-1 font-semibold tabular-nums`,o),t[2]=o,t[3]=c);let l;t[4]!==c||t[5]!==r?(l=(0,X.jsx)(`p`,{className:c,children:r}),t[4]=c,t[5]=r,t[6]=l):l=t[6];let u;return t[7]!==a||t[8]!==l?(u=(0,X.jsxs)(`div`,{children:[a,l]}),t[7]=a,t[8]=l,t[9]=u):u=t[9],u}var $=e(f(),1);function Be(){let e=(0,Y.c)(3),[t,n]=(0,$.useState)(0),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>d(()=>n(Ve)),i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,$.useEffect)(r,i);let a;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=u(),e[2]=a):a=e[2],a}function Ve(e){return e+1}function He(e){let n=Be(),r=(0,$.useMemo)(()=>n.map(e=>({environmentId:e.environmentId,label:e.knownEnvironment.label})).toSorted((e,t)=>e.label.localeCompare(t.label)),[n]),i=(0,$.useMemo)(()=>{if(e.environmentIds===void 0||e.environmentIds.length===0)return n;let t=new Set(e.environmentIds);return n.filter(e=>t.has(e.environmentId))},[n,e.environmentIds]),a=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,[o,s]=(0,$.useState)(0),[c,l]=(0,$.useState)(null),[u,d]=(0,$.useState)([]),[f,p]=(0,$.useState)(!0),m=(0,$.useRef)(new ye),h=i.map(e=>e.environmentId).toSorted().join(`\0`);(0,$.useEffect)(()=>{let n=m.current.next(),r=be(e.range,a);p(!0),Promise.all(i.map(async e=>{try{let t=await e.client.server.getUsageSummary(r);if(t.contractVersion!==2)return{environmentId:e.environmentId,label:e.knownEnvironment.label,status:`stale-contract`,message:`This environment uses an incompatible usage contract.`};let n=t.sources.some(e=>e.status===`partial`||e.status===`failed`);return{environmentId:e.environmentId,label:e.knownEnvironment.label,status:n?`partial`:`complete`,summary:t}}catch(n){return{environmentId:e.environmentId,label:e.knownEnvironment.label,status:t(n)?`stale-contract`:`failed`,message:n instanceof Error?n.message:String(n)}}})).then(e=>{m.current.isCurrent(n)&&(d(e),l(ve(e)),p(!1))})},[e.range,o,i,h,a]);let g=(0,$.useCallback)(()=>s(e=>e+1),[]);return{merged:c,environments:u,availableEnvironments:r,loading:f,refreshing:f&&c!==null,refresh:g}}var Ue=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2});function We(e){return e===null?`Unavailable`:Ue.format(e)}function Ge(e){let t=(0,Y.c)(107),{search:n,onSearchChange:r}=e,i;t[0]!==n.environmentIds||t[1]!==n.range?(i={range:n.range,environmentIds:n.environmentIds},t[0]=n.environmentIds,t[1]=n.range,t[2]=i):i=t[2];let s=He(i),{merged:c}=s,l;bb0:{if(!c){l=null;break bb0}let e,r,i,a,o;if(t[3]!==c||t[4]!==n.providers||t[5]!==n.usageBreakdown){let s=ke(c,n.providers);e=s,t[11]!==c||t[12]!==n.providers?(r=Pe(c,n.providers),t[11]=c,t[12]=n.providers,t[13]=r):r=t[13],i=Ae(c,s),a=Me(c,s),o=Ne(s,n.usageBreakdown),t[3]=c,t[4]=n.providers,t[5]=n.usageBreakdown,t[6]=e,t[7]=r,t[8]=i,t[9]=a,t[10]=o}else e=t[6],r=t[7],i=t[8],a=t[9],o=t[10];let s;t[14]!==e||t[15]!==r||t[16]!==i||t[17]!==a||t[18]!==o?(s={buckets:e,imports:r,totals:i,days:a,breakdown:o},t[14]=e,t[15]=r,t[16]=i,t[17]=a,t[18]=o,t[19]=s):s=t[19],l=s}let u=l;if(s.loading&&!c){let e;return t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(re,{}),t[20]=e):e=t[20],e}if(!c||!u){let e,n,r,i;if(t[21]!==s.environments){let a=s.environments.filter(Xe);e=N,n=a.length>0?o:Oe,r=a.length>0?`Couldn’t load usage`:`No usage environments are connected`,i=a.length>0?`Usage failed for ${a.map(Ye).join(`, `)}. ${a[0]?.message??`Retry after checking the environment connection.`}`:`Connect an environment with supported provider histories, then refresh this view.`,t[21]=s.environments,t[22]=e,t[23]=n,t[24]=r,t[25]=i}else e=t[22],n=t[23],r=t[24],i=t[25];let c;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(ue,{}),t[26]=c):c=t[26];let l;t[27]===s.refresh?l=t[28]:(l=(0,X.jsxs)(a,{size:`sm`,variant:`outline`,onClick:s.refresh,children:[c,` Refresh`]}),t[27]=s.refresh,t[28]=l);let u;return t[29]!==e||t[30]!==n||t[31]!==r||t[32]!==i||t[33]!==l?(u=(0,X.jsx)(e,{icon:n,title:r,description:i,action:l}),t[29]=e,t[30]=n,t[31]=r,t[32]=i,t[33]=l,t[34]=u):u=t[34],u}let{totals:d,days:f,breakdown:p}=u,y=d.pricedTokenCount+d.unpricedTokenCount>0?d.pricedTokenCount/(d.pricedTokenCount+d.unpricedTokenCount):0,b=d.uncachedInputTokens+d.cachedInputTokens+d.cacheCreationInputTokens>0?d.cachedInputTokens/(d.uncachedInputTokens+d.cachedInputTokens+d.cacheCreationInputTokens):0,x=n.environmentIds===void 0||n.environmentIds?.length!==1?`all`:n.environmentIds[0],S;t[35]===c.sources?S=t[36]:(S=c.sources.some(Je),t[35]=c.sources,t[36]=S);let C=S,w;t[37]!==r||t[38]!==n?(w=(0,X.jsx)(Ze,{search:n,onSearchChange:r}),t[37]=r,t[38]=n,t[39]=w):w=t[39];let T;t[40]!==r||t[41]!==n?(T=e=>r({...n,...e===null||e===`all`?{environmentIds:void 0}:{environmentIds:[e]}}),t[40]=r,t[41]=n,t[42]=T):T=t[42];let E;t[43]!==s.availableEnvironments||t[44]!==x?(E=x===`all`?`All environments (${s.availableEnvironments.length})`:s.availableEnvironments.find(e=>e.environmentId===x)?.label??`Environment`,t[43]=s.availableEnvironments,t[44]=x,t[45]=E):E=t[45];let D;t[46]===E?D=t[47]:(D=(0,X.jsx)(v,{size:`sm`,className:`w-48`,"aria-label":`Usage environment`,children:(0,X.jsx)(h,{children:E})}),t[46]=E,t[47]=D);let O;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,X.jsx)(m,{value:`all`,children:`All environments`}),t[48]=O):O=t[48];let k;t[49]===s.availableEnvironments?k=t[50]:(k=s.availableEnvironments.map(qe),t[49]=s.availableEnvironments,t[50]=k);let A;t[51]===k?A=t[52]:(A=(0,X.jsxs)(_,{alignItemWithTrigger:!1,children:[O,k]}),t[51]=k,t[52]=A);let F;t[53]!==x||t[54]!==A||t[55]!==T||t[56]!==D?(F=(0,X.jsxs)(g,{value:x,onValueChange:T,children:[D,A]}),t[53]=x,t[54]=A,t[55]=T,t[56]=D,t[57]=F):F=t[57];let I;t[58]!==r||t[59]!==n?(I=(0,X.jsx)(Qe,{search:n,onSearchChange:r}),t[58]=r,t[59]=n,t[60]=I):I=t[60];let L;t[61]!==F||t[62]!==I||t[63]!==w?(L=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[w,F,I]}),t[61]=F,t[62]=I,t[63]=w,t[64]=L):L=t[64];let te=s.refreshing?`animate-spin`:void 0,R;t[65]===te?R=t[66]:(R=(0,X.jsx)(ue,{className:te}),t[65]=te,t[66]=R);let z=s.refreshing?`Refreshing`:`Refresh`,B;t[67]!==s.refresh||t[68]!==s.refreshing||t[69]!==R||t[70]!==z?(B=(0,X.jsxs)(a,{size:`sm`,variant:`outline`,onClick:s.refresh,disabled:s.refreshing,children:[R,z]}),t[67]=s.refresh,t[68]=s.refreshing,t[69]=R,t[70]=z,t[71]=B):B=t[71];let V;t[72]!==L||t[73]!==B?(V=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[L,B]}),t[72]=L,t[73]=B,t[74]=V):V=t[74];let H;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,X.jsx)(`p`,{className:`max-w-3xl text-sm leading-relaxed text-muted-foreground`,children:`Provider-recorded usage from supported local histories on the selected machines. This includes sessions run outside Ryco and is intentionally not attributed to projects.`}),t[75]=H):H=t[75];let U;t[76]===u.imports?U=t[77]:(U=u.imports.length>0?(0,X.jsx)(St,{rows:u.imports}):null,t[76]=u.imports,t[77]=U);let W;t[78]!==p||t[79]!==b||t[80]!==f||t[81]!==u.buckets.length||t[82]!==C||t[83]!==c.timeZone||t[84]!==r||t[85]!==y||t[86]!==n||t[87]!==d.distinctSessionCount||t[88]!==d.estimatedCacheSavingsUsd||t[89]!==d.estimatedCostUsd||t[90]!==d.reasoningTokens||t[91]!==d.responseCount||t[92]!==d.totalTokens?(W=u.buckets.length===0?(0,X.jsx)(N,{icon:le,title:C?`No usage in this range`:`No transcript sources found`,description:C?`The transcript sources were found, but no provider-recorded usage matched these filters.`:`No supported provider history was found on the selected environments. See source coverage below.`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`section`,{className:`grid overflow-hidden rounded-2xl border border-border/75 bg-card shadow-sm/5 lg:grid-cols-[minmax(18rem,0.72fr)_minmax(0,1.55fr)]`,children:[(0,X.jsxs)(`div`,{className:`flex min-h-80 flex-col justify-between border-b border-border/70 p-6 lg:border-r lg:border-b-0 lg:p-8`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold tracking-[0.12em] text-muted-foreground uppercase`,children:[(0,X.jsx)(Ee,{className:`size-3.5`}),` Raw API-equivalent cost`]}),(0,X.jsx)(`div`,{className:`mt-5 text-4xl font-semibold tracking-[-0.045em] tabular-nums sm:text-5xl`,children:We(d.estimatedCostUsd)}),(0,X.jsx)(`p`,{className:`mt-3 max-w-sm text-xs leading-relaxed text-muted-foreground`,children:`Estimate based on base API rates. Subscription, credits, batch, negotiated, and provider billing may differ.`})]}),(0,X.jsxs)(`div`,{className:`space-y-4 border-t border-border/65 pt-5`,children:[(0,X.jsx)(it,{label:`Priced coverage`,value:`${Math.round(y*100)}% of tokens`}),(0,X.jsx)(it,{label:`Estimated cache savings`,value:We(d.estimatedCacheSavingsUsd)}),(0,X.jsx)(it,{label:`Provider-recorded tokens`,value:P(d.totalTokens)})]})]}),(0,X.jsxs)(`div`,{className:`min-w-0 p-4 sm:p-6`,children:[(0,X.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3 px-1`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Usage over time`}),(0,X.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Daily values in `,c.timeZone]})]}),(0,X.jsx)($e,{search:n,onSearchChange:r})]}),(0,X.jsx)(tt,{data:f,metric:n.usageMetric}),(0,X.jsx)(`div`,{className:`flex items-center justify-end gap-4 px-2 text-[11px] text-muted-foreground`,children:J.map(Ke)})]})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 border-y border-border/65 md:grid-cols-5`,children:[(0,X.jsx)(at,{label:`Total tokens`,value:M(d.totalTokens)}),(0,X.jsx)(at,{label:`Sessions`,value:P(d.distinctSessionCount)}),(0,X.jsx)(at,{label:`Responses`,value:P(d.responseCount)}),(0,X.jsx)(at,{label:`Cache read`,value:`${Math.round(b*100)}%`}),(0,X.jsx)(at,{label:`Reasoning`,value:d.reasoningTokens===null?`Unavailable`:M(d.reasoningTokens),detail:`included in output`})]}),(0,X.jsx)(j,{title:`Breakdown`,icon:le,action:(0,X.jsx)(et,{search:n,onSearchChange:r}),bodyClassName:`overflow-hidden`,children:(0,X.jsx)(`div`,{className:`divide-y divide-border/60`,children:p.slice(0,20).map(e=>(0,X.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-5 px-4 py-3.5 sm:px-5`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`truncate text-sm font-medium`,children:n.usageBreakdown===`model`?ee(e.label):ne(e.label)}),(0,X.jsx)(`p`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:e.provider?ie(e.provider):`${e.responses} responses`})]}),(0,X.jsxs)(`div`,{className:`text-right`,children:[(0,X.jsx)(`p`,{className:`text-sm font-medium tabular-nums`,children:M(e.tokens)}),(0,X.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`tokens`})]}),(0,X.jsxs)(`div`,{className:`w-24 text-right`,children:[(0,X.jsx)(`p`,{className:`text-sm font-medium tabular-nums`,children:We(e.costUsd)}),(0,X.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.unpricedTokens>0?`${M(e.unpricedTokens)} unpriced`:`estimated`})]})]},e.key))})})]}),t[78]=p,t[79]=b,t[80]=f,t[81]=u.buckets.length,t[82]=C,t[83]=c.timeZone,t[84]=r,t[85]=y,t[86]=n,t[87]=d.distinctSessionCount,t[88]=d.estimatedCacheSavingsUsd,t[89]=d.estimatedCostUsd,t[90]=d.reasoningTokens,t[91]=d.responseCount,t[92]=d.totalTokens,t[93]=W):W=t[93];let G;if(t[94]!==c.sources||t[95]!==n.providers){let e;t[97]===n.providers?e=t[98]:(e=e=>n.providers===void 0||n.providers.includes(e.provider),t[97]=n.providers,t[98]=e),G=c.sources.filter(e),t[94]=c.sources,t[95]=n.providers,t[96]=G}else G=t[96];let K;t[99]!==c||t[100]!==G?(K=(0,X.jsx)(st,{summary:{...c,sources:G}}),t[99]=c,t[100]=G,t[101]=K):K=t[101];let q;return t[102]!==V||t[103]!==U||t[104]!==W||t[105]!==K?(q=(0,X.jsxs)(`div`,{className:`space-y-8`,children:[V,H,U,W,K]}),t[102]=V,t[103]=U,t[104]=W,t[105]=K,t[106]=q):q=t[106],q}function Ke(e){return(0,X.jsx)(ot,{color:xe[e],label:Se[e]},e)}function qe(e){return(0,X.jsx)(m,{value:e.environmentId,children:e.label},e.environmentId)}function Je(e){return e.included&&(e.status===`complete`||e.status===`partial`)}function Ye(e){return e.label}function Xe(e){return e.status===`failed`||e.status===`unavailable`||e.status===`stale-contract`}function Ze(e){let t=(0,Y.c)(3),{search:n,onSearchChange:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,X.jsx)(`div`,{className:`inline-flex rounded-lg border bg-card p-0.5`,children:[`7d`,`30d`,`90d`,`all`].map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>r({...n,range:e}),className:s(`h-7 rounded-md px-2.5 text-xs font-medium transition-colors`,n.range===e?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground`),children:e===`all`?`All`:e.toUpperCase()},e))}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Qe(e){let t=(0,Y.c)(8),{search:n,onSearchChange:r}=e,i=n.providers??J,a,o;if(t[0]!==r||t[1]!==n||t[2]!==i){let e=new Set(i);a=`inline-flex rounded-lg border bg-card p-0.5`,o=J.map(t=>(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":e.has(t),onClick:()=>{let i=new Set(e);i.has(t)&&i.size>1?i.delete(t):i.add(t);let a=[...i].toSorted();r({...n,...a.length===J.length?{providers:void 0}:{providers:a}})},className:s(`inline-flex h-7 items-center rounded-md px-2.5 text-xs font-medium capitalize transition-colors`,e.has(t)?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground`),children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`mr-1.5 inline-block size-1.5 rounded-full`,style:{backgroundColor:xe[t]}}),Se[t]]},t)),t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o}else a=t[3],o=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,X.jsx)(`div`,{className:a,children:o}),t[5]=a,t[6]=o,t[7]=c):c=t[7],c}function $e(e){let t=(0,Y.c)(4),{search:n,onSearchChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`cost`,`tokens`],t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,X.jsx)(`div`,{className:`inline-flex rounded-md bg-muted p-0.5`,children:i.map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>r({...n,usageMetric:e}),className:s(`h-6 rounded-sm px-2 text-[11px] font-medium capitalize`,n.usageMetric===e?`bg-background text-foreground shadow-xs`:`text-muted-foreground`),children:e},e))}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function et(e){let t=(0,Y.c)(4),{search:n,onSearchChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`model`,`day`],t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,X.jsx)(`div`,{className:`inline-flex items-center gap-1 text-[11px]`,children:i.map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>r({...n,usageBreakdown:e}),className:s(`rounded-md px-2 py-1 capitalize`,n.usageBreakdown===e?`bg-accent text-foreground`:`text-muted-foreground`),children:e},e))}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function tt(e){let t=(0,Y.c)(16),{data:n,metric:r}=e,i=r===`cost`?`Cost`:`Tokens`,a;t[0]===n?a=t[1]:(a=[...n],t[0]=n,t[1]=a);let o,s,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o={left:4,right:10,top:18,bottom:0},s=(0,X.jsx)(x,{vertical:!1,strokeDasharray:`3 5`}),c=(0,X.jsx)(D,{dataKey:`date`,tickLine:!1,axisLine:!1,minTickGap:30,tickFormatter:rt}),t[2]=o,t[3]=s,t[4]=c):(o=t[2],s=t[3],c=t[4]);let l;t[5]===r?l=t[6]:(l=(0,X.jsx)(C,{tickLine:!1,axisLine:!1,width:44,tickFormatter:e=>r===`cost`?`$${Number(e).toFixed(+(Number(e)<10))}`:M(Number(e))}),t[5]=r,t[6]=l);let u;t[7]===r?u=t[8]:(u=(0,X.jsx)(S,{content:(0,X.jsx)(U,{labelFormatter:nt,formatter:e=>r===`cost`?Ue.format(Number(e)||0):P(Number(e)||0)})}),t[7]=r,t[8]=u);let d;t[9]===i?d=t[10]:(d=J.map(e=>(0,X.jsx)(te,{dataKey:`${e}${i}`,name:ie(e),type:`monotone`,stroke:xe[e],fill:xe[e],fillOpacity:.08,strokeWidth:1.75,connectNulls:!1},e)),t[9]=i,t[10]=d);let f;return t[11]!==a||t[12]!==l||t[13]!==u||t[14]!==d?(f=(0,X.jsx)(A,{className:`h-[300px]`,children:(0,X.jsxs)(w,{data:a,margin:o,children:[s,c,l,u,d]})}),t[11]=a,t[12]=l,t[13]=u,t[14]=d,t[15]=f):f=t[15],f}function nt(e){return ne(String(e))}function rt(e){return ne(String(e))}function it(e){let t=(0,Y.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,X.jsx)(`span`,{className:`font-medium tabular-nums`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-4 text-xs`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function at(e){let t=(0,Y.c)(10),{label:n,value:r,detail:i}=e,a;t[0]===n?a=t[1]:(a=(0,X.jsx)(`p`,{className:`text-[10px] font-semibold tracking-[0.1em] text-muted-foreground uppercase`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,X.jsx)(`p`,{className:`mt-2 text-xl font-semibold tracking-tight tabular-nums`,children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=i?(0,X.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:i}):null,t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,X.jsxs)(`div`,{className:`border-r border-border/60 px-4 py-5 last:border-r-0`,children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function ot(e){let t=(0,Y.c)(5),{color:n,label:r}=e,i;t[0]===n?i=t[1]:(i=(0,X.jsx)(`span`,{className:`size-2 rounded-sm`,style:{backgroundColor:n}}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[i,r]}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function st(e){let t=(0,Y.c)(14),{summary:n}=e,r;if(t[0]!==n.duplicateSourceCount||t[1]!==n.environmentOnlyDeduplicationWarning||t[2]!==n.environments||t[3]!==n.sources){let e=n.sources.filter(bt),i=e.filter(yt),a=n.environments.filter(vt),s=n.environments.flatMap(_t),c=s.length===0?`Unavailable`:s.every(gt)?`Live`:s.every(ht)?`Cached`:s.every(mt)?`Unavailable`:`Mixed`,l=n.environments.flatMap(pt).toSorted().at(-1),u=e.map(ft).toSorted().at(-1),d=`${e.length} included`,f=n.duplicateSourceCount>0?`${n.duplicateSourceCount} duplicate source excluded`:`No physical duplicates detected`,p;t[5]!==d||t[6]!==f?(p=(0,X.jsx)(xt,{icon:Oe,label:`Transcript sources`,value:d,detail:f}),t[5]=d,t[6]=f,t[7]=p):p=t[7];let m=l?`Rates fetched ${W(l)}`:`Token totals remain available without rates`,h;t[8]!==c||t[9]!==m?(h=(0,X.jsx)(xt,{icon:Ee,label:`Pricing`,value:c,detail:m}),t[8]=c,t[9]=m,t[10]=h):h=t[10];let g=i.length===0?`Complete`:`${i.length} source notice${i.length===1?``:`s`}`,_=n.environmentOnlyDeduplicationWarning?`Some sources could only be scoped per environment`:`${e.reduce(lt,0)} malformed lines skipped`,v;t[11]!==g||t[12]!==_?(v=(0,X.jsx)(xt,{icon:o,label:`Coverage state`,value:g,detail:_}),t[11]=g,t[12]=_,t[13]=v):v=t[13],r=(0,X.jsxs)(j,{title:`Coverage & estimates`,icon:we,bodyClassName:`p-5`,children:[a.length>0?(0,X.jsxs)(`div`,{className:`mb-5 flex gap-2 rounded-lg border border-warning/30 bg-warning/8 px-3 py-2.5 text-xs text-muted-foreground`,children:[(0,X.jsx)(o,{className:`mt-0.5 size-3.5 shrink-0 text-warning`}),(0,X.jsxs)(`span`,{children:[`No usage was included from`,` `,a.map(dt).join(`, `),`.`]})]}):null,(0,X.jsxs)(`div`,{className:`grid gap-5 md:grid-cols-2 xl:grid-cols-4`,children:[p,(0,X.jsx)(xt,{icon:ae,label:`Last scan`,value:u?W(u):`Not scanned`,detail:`${e.reduce(ut,0)} cached files reused`}),h,v]}),i.map(ct)]}),t[0]=n.duplicateSourceCount,t[1]=n.environmentOnlyDeduplicationWarning,t[2]=n.environments,t[3]=n.sources,t[4]=r}else r=t[4];return r}function ct(e){return(0,X.jsxs)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:[ie(e.provider),` · `,e.environmentLabel,`:`,` `,e.message??e.diagnosticCode??e.status]},`${e.environmentId}:${e.sourceId}`)}function lt(e,t){return e+t.malformedLineCount}function ut(e,t){return e+t.reusedCacheFileCount}function dt(e){return e.label}function ft(e){return e.scanFinishedAt}function pt(e){let t=e.summary?.pricing.fetchedAt;return t===void 0?[]:[t]}function mt(e){return e===`unavailable`}function ht(e){return e===`cached`}function gt(e){return e===`live`}function _t(e){return e.summary===void 0?[]:[e.summary.pricing.state]}function vt(e){return e.status===`failed`||e.status===`unavailable`||e.status===`stale-contract`}function yt(e){return e.status!==`complete`}function bt(e){return e.included}function xt(e){let t=(0,Y.c)(15),{icon:n,label:r,value:i,detail:a}=e,o;t[0]===n?o=t[1]:(o=(0,X.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,X.jsx)(n,{className:`size-4`})}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r}),t[2]=r,t[3]=s);let c;t[4]===i?c=t[5]:(c=(0,X.jsx)(`p`,{className:`mt-1 text-sm font-medium`,children:i}),t[4]=i,t[5]=c);let l;t[6]===a?l=t[7]:(l=(0,X.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-muted-foreground`,children:a}),t[6]=a,t[7]=l);let u;t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,X.jsxs)(`div`,{children:[s,c,l]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;return t[12]!==o||t[13]!==u?(d=(0,X.jsxs)(`div`,{className:`flex gap-3`,children:[o,u]}),t[12]=o,t[13]=u,t[14]=d):d=t[14],d}function St(e){let t=(0,Y.c)(27),{rows:n}=e,[r,i]=(0,$.useState)(0),o,s,c,l,u,d,f,p;if(t[0]!==r||t[1]!==n){let e=Fe(n);c=Math.ceil(n.length/20),s=Math.min(r,c-1);let i=[...n].toSorted(Tt);o=j,d=`Cursor exported events and billed cost`,t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Saved Cursor Admin API exports. Billed costs include Cursor fees and remain separate from model cost. Exported events without token fields do not contribute token totals.`}),t[10]=f):f=t[10];let a=e.requests===null?`Requests unavailable`:`${P(e.requests)} exported events`,m=e.costs.map(wt).join(``);t[11]!==a||t[12]!==m?(p=(0,X.jsxs)(`p`,{className:`mt-3 text-sm`,children:[a,m]}),t[11]=a,t[12]=m,t[13]=p):p=t[13],l=`mt-4 divide-y`,u=i.slice(s*20,(s+1)*20).map(Ct),t[0]=r,t[1]=n,t[2]=o,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p}else o=t[2],s=t[3],c=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=t[9];let m;t[14]!==l||t[15]!==u?(m=(0,X.jsx)(`div`,{className:l,children:u}),t[14]=l,t[15]=u,t[16]=m):m=t[16];let h;t[17]!==s||t[18]!==c?(h=c>1?(0,X.jsxs)(`div`,{className:`mt-3 flex items-center gap-3`,children:[(0,X.jsx)(a,{size:`sm`,disabled:s===0,onClick:()=>i(s-1),children:`Previous`}),(0,X.jsxs)(`span`,{className:`text-xs`,children:[s+1,` / `,c]}),(0,X.jsx)(a,{size:`sm`,disabled:s>=c-1,onClick:()=>i(s+1),children:`Next`})]}):null,t[17]=s,t[18]=c,t[19]=h):h=t[19];let g;return t[20]!==o||t[21]!==d||t[22]!==f||t[23]!==p||t[24]!==m||t[25]!==h?(g=(0,X.jsxs)(o,{title:d,children:[f,p,m,h]}),t[20]=o,t[21]=d,t[22]=f,t[23]=p,t[24]=m,t[25]=h,t[26]=g):g=t[26],g}function Ct(e){return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 py-2 text-xs`,children:[(0,X.jsxs)(`span`,{children:[ne(e.date),e.model?` · ${ee(e.model)}`:``]}),(0,X.jsx)(`span`,{children:e.metric===`requests`?`${P(e.value)} events`:`${e.value.toLocaleString()} ${e.currency}`})]},e.recordId)}function wt(e){return` · ${e.value.toLocaleString()} ${e.currency} billed cost`}function Tt(e,t){return t.date.localeCompare(e.date)||e.metric.localeCompare(t.metric)}function Et(e){let t=(0,Y.c)(28),{search:n,onSearchChange:i}=e,a=_e(),o=n.view===`usage`?r.serverGetUsageSummary:r.serverGetStatistics,c=se(o),l=a?he:`pl-5 sm:pl-7`,u;t[0]===l?u=t[1]:(u=s(`flex min-h-14 shrink-0 flex-wrap items-center gap-x-5 gap-y-2 border-b border-border/75 bg-background/90 py-2 pr-5 backdrop-blur-sm sm:pr-7`,ge,l),t[0]=l,t[1]=u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`h1`,{className:`truncate text-sm font-semibold tracking-tight`,children:`Statistics`}),(0,X.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Usage and work signals`})]}),t[2]=d):d=t[2];let f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=[`usage`,`activity`],t[3]=f):f=t[3];let p;t[4]!==i||t[5]!==n?(p=(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-x-5 gap-y-2`,children:[d,(0,X.jsx)(`div`,{className:`inline-flex shrink-0 rounded-lg bg-muted/75 p-0.5`,children:f.map(e=>{let t=e===`usage`?G:b;return(0,X.jsxs)(`button`,{type:`button`,onClick:()=>i({...n,view:e}),className:s(`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium capitalize transition-colors`,n.view===e?`bg-background text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),children:[(0,X.jsx)(t,{className:`size-3.5`}),` `,e]},e)})})]}),t[4]=i,t[5]=n,t[6]=p):p=t[6];let m;t[7]===n.range?m=t[8]:(m=n.range===`all`?`All available history`:`Last ${n.range.slice(0,-1)} days`,t[7]=n.range,t[8]=m);let h;t[9]===m?h=t[10]:(h=(0,X.jsx)(`p`,{className:`text-xs font-medium`,children:m}),t[9]=m,t[10]=h);let g=n.view===`usage`?`Local calendar window`:`UTC activity window`,_;t[11]===g?_=t[12]:(_=(0,X.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:g}),t[11]=g,t[12]=_);let v;t[13]!==h||t[14]!==_?(v=(0,X.jsxs)(`div`,{className:`hidden text-right sm:block`,children:[h,_]}),t[13]=h,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==v||t[17]!==u||t[18]!==p?(y=(0,X.jsxs)(`header`,{className:u,children:[p,v]}),t[16]=v,t[17]=u,t[18]=p,t[19]=y):y=t[19];let x;t[20]!==c.allowed||t[21]!==c.reason||t[22]!==i||t[23]!==n?(x=(0,X.jsx)(pe,{className:`min-h-0 flex-1`,children:(0,X.jsx)(`div`,{className:`mx-auto w-full max-w-[1480px] px-5 py-7 sm:px-8 sm:py-9 lg:px-10`,children:c.allowed?n.view===`usage`?(0,X.jsx)(Ge,{search:n,onSearchChange:i}):(0,X.jsx)(Ie,{search:n,onSearchChange:i}):(0,X.jsx)(N,{icon:de,title:`Statistics aren’t available for this session`,description:c.reason??`Owner access is required.`})})}),t[20]=c.allowed,t[21]=c.reason,t[22]=i,t[23]=n,t[24]=x):x=t[24];let S;return t[25]!==y||t[26]!==x?(S=(0,X.jsx)(me,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground`,children:(0,X.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[y,x]})}),t[25]=y,t[26]=x,t[27]=S):S=t[27],S}export{Et as StatisticsPage};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{lt as t,n}from"./primary-DZjgHvyf.js";import{t as r}from"./src-C3Y_imaX.js";import{$l as i,Qr as a,do as o,ei as s,ho as c,oo as l,u,y as d}from"./runtime-BwHA1GUS.js";import{t as f}from"./react-CwJFpaho.js";import{t as p}from"./compiler-runtime-C4g8XhC5.js";import{a as m,c as h,n as g,o as _,s as v,t as y}from"./badge-2AZ3HfVS.js";import{t as b}from"./activity-CwTUF6lv.js";import{A as x,C as S,D as C,E as w,F as T,N as E,O as D,P as O,R as k,S as A,_ as ee,a as j,b as M,c as N,g as P,h as F,i as I,j as L,k as te,l as R,m as ne,o as z,p as B,s as re,t as V,u as H,v as ie,w as U,y as W}from"./useStatistics-B76_r68I.js";import{t as G}from"./chart-column-Cg7d41tb.js";import{a as K,i as q,n as ae,r as oe,t as se}from"./capabilities-CsHjxjab.js";import{n as ce,t as le}from"./layers-Dqez1Uq8.js";import{t as ue}from"./refresh-cw-CgDa2Ok_.js";import{t as de}from"./shield-alert-CwH36qZb.js";import{t as fe}from"./wrench-7pbbxqrZ.js";import{t as pe}from"./scroll-area-7n2X_RLQ.js";import{o as me}from"./sidebar-Cc6ANbOP.js";import{n as he,t as ge}from"./appChrome-TkWLAGxk.js";import{t as _e}from"./useAppSidebarCollapsed-CFy476E3.js";import{a as ve,i as ye,r as be}from"./usage-BBwaxMif.js";import{n as xe,r as Se,t as J}from"./providers-BEK_ibg5.js";var Ce={name:`brain-circuit`,size:24,node:[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]};Ce.node;var we=c(Ce),Te={name:`circle-dollar-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]};Te.node;var Ee=c(Te),De={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};De.node;var Oe=c(De);function ke(e,t){if(t===void 0||t.length===0)return e.buckets;let n=new Set(t);return e.buckets.filter(e=>n.has(e.provider))}function Ae(e,t){let n=0,r=0,i=0,a=0,o=0,s=0,c=0,l=0,u=0,d=!1,f=!1,p=0,m=0;for(let e of t)n+=e.tokens.totalTokens,r+=e.tokens.uncachedInputTokens,i+=e.tokens.cachedInputTokens,a+=e.tokens.cacheCreationInputTokens,o+=e.tokens.outputTokens,s=s===null||e.tokens.reasoningTokens===void 0?null:s+e.tokens.reasoningTokens,c+=e.responseCount,p+=e.pricedTokenCount,m+=e.unpricedTokenCount,e.estimatedCostUsd!==void 0&&(l+=e.estimatedCostUsd,d=!0),e.estimatedCacheSavingsUsd!==void 0&&(u+=e.estimatedCacheSavingsUsd,f=!0);let h=new Set(t.map(e=>e.provider)),g=new Set(t.flatMap(e=>e.exportSessionIds??[])).size+e.sources.filter(e=>e.included&&h.has(e.provider)&&(e.provider!==`cursor`||e.deduplicationKind!==`declared`)&&e.status!==`not-found`&&e.status!==`failed`).reduce((e,t)=>e+t.distinctSessionCount,0);return{totalTokens:n,uncachedInputTokens:r,cachedInputTokens:i,cacheCreationInputTokens:a,outputTokens:o,reasoningTokens:s,responseCount:c,distinctSessionCount:g,estimatedCostUsd:d?l:null,estimatedCacheSavingsUsd:f?u:null,pricedTokenCount:p,unpricedTokenCount:m}}function je(e,t){return new Date(Date.parse(`${e}T12:00:00.000Z`)+t*864e5).toISOString().slice(0,10)}function Me(e,t){let n=new Map,r=e=>({date:e,claudeCost:null,codexCost:null,cursorCost:null,opencodeCost:null,claudeTokens:null,codexTokens:null,cursorTokens:null,opencodeTokens:null});for(let e of t){let t=n.get(e.date)??r(e.date),i=e.provider,a=`${i}Cost`,o=`${i}Tokens`;n.set(e.date,{...t,[a]:e.estimatedCostUsd===void 0?t[a]:(t[a]??0)+e.estimatedCostUsd,[o]:(t[o]??0)+e.tokens.totalTokens})}let i=e.startDate??[...n.keys()].toSorted()[0];if(i===void 0)return[];let a=new Set(t.map(e=>e.provider)),o=new Set(J.filter(t=>{let n=e.sources.filter(e=>e.included&&e.provider===t);return a.has(t)&&n.length>0&&n.every(e=>e.status===`complete`)})),s=[];for(let t=i;t<=e.endDate&&s.length<36600;t=je(t,1)){let e=n.get(t)??r(t),i={...e};for(let t of J)o.has(t)&&(i[`${t}Tokens`]??=0,e[`${t}Tokens`]===null&&(i[`${t}Cost`]??=0));s.push(i)}return s}function Ne(e,t){let n=new Map;for(let r of e){let e=t===`model`?`${r.provider}\0${r.model}`:r.date,i=n.get(e)??{key:e,label:t===`model`?r.model:r.date,...t===`model`?{provider:r.provider}:{},tokens:0,costUsd:null,unpricedTokens:0,responses:0};n.set(e,{...i,tokens:i.tokens+r.tokens.totalTokens,costUsd:r.estimatedCostUsd===void 0?i.costUsd:(i.costUsd??0)+r.estimatedCostUsd,unpricedTokens:i.unpricedTokens+r.unpricedTokenCount,responses:i.responses+r.responseCount})}let r=[...n.values()].some(e=>e.costUsd!==null);return[...n.values()].toSorted((e,t)=>r&&(t.costUsd??-1)-(e.costUsd??-1)||t.tokens-e.tokens)}function Pe(e,t){return t===void 0||t.length===0||t.includes(`cursor`)?e.imports??[]:[]}function Fe(e){let t=null,n=new Map;for(let r of e)r.metric===`requests`?t=(t??0)+r.value:r.currency&&n.set(r.currency,(n.get(r.currency)??0)+r.value);return{requests:t,costs:[...n].map(([e,t])=>({currency:e,value:t}))}}var Y=p(),X=i();function Ie(e){let t=(0,Y.c)(56),{search:r,onSearchChange:i}=e,{snapshot:o,loading:s,error:c,refresh:u,refreshing:d}=V(),f=r.projectId??null,p=r.model??null,m=r.modelProvider??null,h;t[0]!==r.range||t[1]!==f||t[2]!==p||t[3]!==m?(h={range:r.range,projectId:f,model:p,provider:m},t[0]=r.range,t[1]=f,t[2]=p,t[3]=m,t[4]=h):h=t[4];let g=h,_;bb0:{if(!o){_=null;break bb0}let e,n,r,i;if(t[5]!==g||t[6]!==o){let a=T(o,g),s=k(a);e=a,n=s,r=O(o,a,g.range),i=L(a,E(o)),t[5]=g,t[6]=o,t[7]=e,t[8]=n,t[9]=r,t[10]=i}else e=t[7],n=t[8],r=t[9],i=t[10];let a;t[11]!==e||t[12]!==n||t[13]!==r||t[14]!==i?(a={buckets:e,totals:n,days:r,projects:i},t[11]=e,t[12]=n,t[13]=r,t[14]=i,t[15]=a):a=t[15],_=a}let v=_;if(s&&!o){let e;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(re,{}),t[16]=e):e=t[16],e}if(c&&!o){let e;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(ue,{}),t[17]=e):e=t[17];let n;t[18]===u?n=t[19]:(n=(0,X.jsxs)(a,{size:`sm`,variant:`outline`,onClick:u,children:[e,` Try again`]}),t[18]=u,t[19]=n);let r;return t[20]!==c||t[21]!==n?(r=(0,X.jsx)(N,{icon:l,title:`Couldn’t load Ryco activity`,description:c,action:n}),t[20]=c,t[21]=n,t[22]=r):r=t[22],r}if(!o||!v)return null;let{totals:y,days:x,projects:S}=v,C=n()?.label??`Current environment`,w;if(t[23]!==x||t[24]!==g||t[25]!==i||t[26]!==S||t[27]!==u||t[28]!==d||t[29]!==r||t[30]!==o.dailyBuckets.length||t[31]!==o.models||t[32]!==o.projects||t[33]!==o.recentPullRequests||t[34]!==o.worktrees||t[35]!==y){let e=Re(x,r.activityMetric),n;t[37]!==i||t[38]!==r?(n=e=>i({...r,range:e.range,projectId:e.projectId??void 0,model:e.model??void 0,modelProvider:e.provider??void 0}),t[37]=i,t[38]=r,t[39]=n):n=t[39];let s;t[40]!==g||t[41]!==o.models||t[42]!==o.projects||t[43]!==n?(s=(0,X.jsx)(I,{filter:g,projects:o.projects,models:o.models,onChange:n}),t[40]=g,t[41]=o.models,t[42]=o.projects,t[43]=n,t[44]=s):s=t[44];let c=d?`animate-spin`:void 0,l;t[45]===c?l=t[46]:(l=(0,X.jsx)(ue,{className:c}),t[45]=c,t[46]=l);let f=d?`Refreshing`:`Refresh`,p;t[47]!==u||t[48]!==d||t[49]!==l||t[50]!==f?(p=(0,X.jsxs)(a,{size:`sm`,variant:`outline`,onClick:u,disabled:d,children:[l,f]}),t[47]=u,t[48]=d,t[49]=l,t[50]=f,t[51]=p):p=t[51];let m;t[52]!==p||t[53]!==s?(m=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[s,p]}),t[52]=p,t[53]=s,t[54]=m):m=t[54];let h;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,X.jsxs)(`p`,{className:`max-w-4xl text-sm leading-relaxed text-muted-foreground`,children:[`Activity includes work observed by Ryco on`,` `,(0,X.jsx)(`span`,{className:`font-medium text-foreground`,children:C}),`. Usage from other CLI sessions appears in the Usage tab and is not assigned to projects.`]}),t[55]=h):h=t[55],w=(0,X.jsxs)(`div`,{className:`space-y-8`,children:[m,h,o.dailyBuckets.length===0?(0,X.jsx)(N,{icon:b,title:`No Ryco activity yet`,description:`Project and agent activity will appear here after your first completed turns.`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-3 xl:grid-cols-5`,children:[(0,X.jsx)(z,{label:`Active time`,icon:K,value:F(y.activeMs),sub:`${M(y.totalTokens)} observed tokens`}),(0,X.jsx)(z,{label:`Turns`,icon:b,value:P(y.turns),sub:`Completed agent turns`}),(0,X.jsx)(z,{label:`Chats`,icon:oe,value:P(y.threadsCreated),sub:`Conversations started`}),(0,X.jsx)(z,{label:`Tool uses`,icon:fe,value:P(y.toolUses),sub:`Observed invocations`}),(0,X.jsx)(z,{label:`Files changed`,icon:ce,value:P(y.filesChanged),sub:`+${P(y.additions)} / −${P(y.deletions)} lines`})]}),(0,X.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[1.2fr_0.8fr]`,children:[(0,X.jsxs)(j,{title:`Activity rhythm`,icon:b,bodyClassName:`p-5`,action:(0,X.jsx)(ze,{search:r,onSearchChange:i}),children:[(0,X.jsx)(B,{points:x,metric:r.activityMetric}),(0,X.jsxs)(`div`,{className:`mt-5 grid grid-cols-3 gap-3 border-t border-border/60 pt-4`,children:[(0,X.jsx)(Q,{label:`Active days`,value:P(e.activeDays)}),(0,X.jsx)(Q,{label:`Current streak`,value:`${P(e.currentStreak)}d`}),(0,X.jsx)(Q,{label:`Busiest UTC day`,value:e.busiestLabel})]})]}),(0,X.jsx)(j,{title:`Projects`,icon:b,bodyClassName:`p-4`,children:(0,X.jsx)(H,{data:S,metric:r.activityMetric})})]}),(0,X.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,X.jsxs)(j,{title:`Code changes`,icon:ce,bodyClassName:`p-4`,children:[(0,X.jsxs)(`div`,{className:`mb-4 flex gap-6 text-sm`,children:[(0,X.jsx)(Q,{label:`Files`,value:P(y.filesChanged)}),(0,X.jsx)(Q,{label:`Added`,value:`+${P(y.additions)}`,tone:`positive`}),(0,X.jsx)(Q,{label:`Removed`,value:`−${P(y.deletions)}`,tone:`negative`})]}),(0,X.jsx)(R,{data:x})]}),(0,X.jsxs)(j,{title:`Source control · all time`,icon:q,bodyClassName:`overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-4 gap-3 border-b border-border/60 px-4 py-4`,children:[(0,X.jsx)(Q,{label:`Active`,value:P(o.worktrees.active)}),(0,X.jsx)(Q,{label:`Created`,value:P(o.worktrees.created)}),(0,X.jsx)(Q,{label:`Archived`,value:P(o.worktrees.archived)}),(0,X.jsx)(Q,{label:`Open PRs`,value:P(o.worktrees.openPrs)})]}),o.recentPullRequests.length===0?(0,X.jsx)(`div`,{className:`flex h-[260px] items-center justify-center px-6 text-center text-xs text-muted-foreground`,children:`No projected pull requests yet.`}):(0,X.jsx)(`div`,{className:`divide-y divide-border/60`,children:o.recentPullRequests.slice(0,6).map(Le)})]})]})]})]}),t[23]=x,t[24]=g,t[25]=i,t[26]=S,t[27]=u,t[28]=d,t[29]=r,t[30]=o.dailyBuckets.length,t[31]=o.models,t[32]=o.projects,t[33]=o.recentPullRequests,t[34]=o.worktrees,t[35]=y,t[36]=w}else w=t[36];return w}function Le(e){return(0,X.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3.5`,children:[(0,X.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,X.jsx)(q,{className:`size-4`})}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.prTitle||e.worktreeTitle||e.branch}),(0,X.jsxs)(`p`,{className:`mt-0.5 truncate text-[11px] text-muted-foreground`,children:[e.projectTitle,` · #`,e.prNumber,` ·`,` `,W(e.updatedAt)]})]}),(0,X.jsx)(y,{variant:e.prState===`merged`?`success`:e.active?`info`:`secondary`,children:e.prIsDraft?`Draft`:e.prState??(e.active?`Open`:`Archived`)})]},e.worktreeId)}function Z(e,t){return t===`turns`?e.turns:t===`activeMs`?e.activeMs:e.filesChanged}function Re(e,t){let n=0,r=0,i=null;for(let r of e){let e=Z(r,t);e>0&&(n+=1),(i===null||e>Z(i,t))&&(i=r)}for(let n=e.length-1;n>=0;--n){let i=e[n];if(i===void 0||Z(i,t)<=0)break;r+=1}if(i===null||Z(i,t)<=0)return{activeDays:n,currentStreak:r,busiestLabel:`—`};let a=Z(i,t),o=t===`activeMs`?F(a):P(a);return{activeDays:n,currentStreak:r,busiestLabel:`${i.date.slice(5)} · ${o}`}}function ze(e){let t=(0,Y.c)(4),{search:n,onSearchChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`turns`,`activeMs`,`files`],t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,X.jsx)(`div`,{className:`inline-flex rounded-md bg-muted p-0.5`,children:i.map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>r({...n,activityMetric:e}),className:s(`h-6 rounded-sm px-2 text-[11px]`,n.activityMetric===e?`bg-background text-foreground shadow-xs`:`text-muted-foreground`),children:e===`activeMs`?`Time`:e===`files`?`Files`:`Turns`},e))}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function Q(e){let t=(0,Y.c)(10),{label:n,value:r,tone:i}=e,a;t[0]===n?a=t[1]:(a=(0,X.jsx)(`p`,{className:`text-[10px] tracking-[0.08em] text-muted-foreground uppercase`,children:n}),t[0]=n,t[1]=a);let o=i===`positive`?`text-success-foreground`:i===`negative`?`text-destructive`:`text-foreground`,c;t[2]===o?c=t[3]:(c=s(`mt-1 font-semibold tabular-nums`,o),t[2]=o,t[3]=c);let l;t[4]!==c||t[5]!==r?(l=(0,X.jsx)(`p`,{className:c,children:r}),t[4]=c,t[5]=r,t[6]=l):l=t[6];let u;return t[7]!==a||t[8]!==l?(u=(0,X.jsxs)(`div`,{children:[a,l]}),t[7]=a,t[8]=l,t[9]=u):u=t[9],u}var $=e(f(),1);function Be(){let e=(0,Y.c)(3),[t,n]=(0,$.useState)(0),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>d(()=>n(Ve)),i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,$.useEffect)(r,i);let a;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=u(),e[2]=a):a=e[2],a}function Ve(e){return e+1}function He(e){let n=Be(),r=(0,$.useMemo)(()=>n.map(e=>({environmentId:e.environmentId,label:e.knownEnvironment.label})).toSorted((e,t)=>e.label.localeCompare(t.label)),[n]),i=(0,$.useMemo)(()=>{if(e.environmentIds===void 0||e.environmentIds.length===0)return n;let t=new Set(e.environmentIds);return n.filter(e=>t.has(e.environmentId))},[n,e.environmentIds]),a=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,[o,s]=(0,$.useState)(0),[c,l]=(0,$.useState)(null),[u,d]=(0,$.useState)([]),[f,p]=(0,$.useState)(!0),m=(0,$.useRef)(new ye),h=i.map(e=>e.environmentId).toSorted().join(`\0`);(0,$.useEffect)(()=>{let n=m.current.next(),r=be(e.range,a);p(!0),Promise.all(i.map(async e=>{try{let t=await e.client.server.getUsageSummary(r);if(t.contractVersion!==2)return{environmentId:e.environmentId,label:e.knownEnvironment.label,status:`stale-contract`,message:`This environment uses an incompatible usage contract.`};let n=t.sources.some(e=>e.status===`partial`||e.status===`failed`);return{environmentId:e.environmentId,label:e.knownEnvironment.label,status:n?`partial`:`complete`,summary:t}}catch(n){return{environmentId:e.environmentId,label:e.knownEnvironment.label,status:t(n)?`stale-contract`:`failed`,message:n instanceof Error?n.message:String(n)}}})).then(e=>{m.current.isCurrent(n)&&(d(e),l(ve(e)),p(!1))})},[e.range,o,i,h,a]);let g=(0,$.useCallback)(()=>s(e=>e+1),[]);return{merged:c,environments:u,availableEnvironments:r,loading:f,refreshing:f&&c!==null,refresh:g}}var Ue=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2});function We(e){return e===null?`Unavailable`:Ue.format(e)}function Ge(e){let t=(0,Y.c)(107),{search:n,onSearchChange:r}=e,i;t[0]!==n.environmentIds||t[1]!==n.range?(i={range:n.range,environmentIds:n.environmentIds},t[0]=n.environmentIds,t[1]=n.range,t[2]=i):i=t[2];let s=He(i),{merged:c}=s,l;bb0:{if(!c){l=null;break bb0}let e,r,i,a,o;if(t[3]!==c||t[4]!==n.providers||t[5]!==n.usageBreakdown){let s=ke(c,n.providers);e=s,t[11]!==c||t[12]!==n.providers?(r=Pe(c,n.providers),t[11]=c,t[12]=n.providers,t[13]=r):r=t[13],i=Ae(c,s),a=Me(c,s),o=Ne(s,n.usageBreakdown),t[3]=c,t[4]=n.providers,t[5]=n.usageBreakdown,t[6]=e,t[7]=r,t[8]=i,t[9]=a,t[10]=o}else e=t[6],r=t[7],i=t[8],a=t[9],o=t[10];let s;t[14]!==e||t[15]!==r||t[16]!==i||t[17]!==a||t[18]!==o?(s={buckets:e,imports:r,totals:i,days:a,breakdown:o},t[14]=e,t[15]=r,t[16]=i,t[17]=a,t[18]=o,t[19]=s):s=t[19],l=s}let u=l;if(s.loading&&!c){let e;return t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(re,{}),t[20]=e):e=t[20],e}if(!c||!u){let e,n,r,i;if(t[21]!==s.environments){let a=s.environments.filter(Xe);e=N,n=a.length>0?o:Oe,r=a.length>0?`Couldn’t load usage`:`No usage environments are connected`,i=a.length>0?`Usage failed for ${a.map(Ye).join(`, `)}. ${a[0]?.message??`Retry after checking the environment connection.`}`:`Connect an environment with supported provider histories, then refresh this view.`,t[21]=s.environments,t[22]=e,t[23]=n,t[24]=r,t[25]=i}else e=t[22],n=t[23],r=t[24],i=t[25];let c;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(ue,{}),t[26]=c):c=t[26];let l;t[27]===s.refresh?l=t[28]:(l=(0,X.jsxs)(a,{size:`sm`,variant:`outline`,onClick:s.refresh,children:[c,` Refresh`]}),t[27]=s.refresh,t[28]=l);let u;return t[29]!==e||t[30]!==n||t[31]!==r||t[32]!==i||t[33]!==l?(u=(0,X.jsx)(e,{icon:n,title:r,description:i,action:l}),t[29]=e,t[30]=n,t[31]=r,t[32]=i,t[33]=l,t[34]=u):u=t[34],u}let{totals:d,days:f,breakdown:p}=u,y=d.pricedTokenCount+d.unpricedTokenCount>0?d.pricedTokenCount/(d.pricedTokenCount+d.unpricedTokenCount):0,b=d.uncachedInputTokens+d.cachedInputTokens+d.cacheCreationInputTokens>0?d.cachedInputTokens/(d.uncachedInputTokens+d.cachedInputTokens+d.cacheCreationInputTokens):0,x=n.environmentIds===void 0||n.environmentIds?.length!==1?`all`:n.environmentIds[0],S;t[35]===c.sources?S=t[36]:(S=c.sources.some(Je),t[35]=c.sources,t[36]=S);let C=S,w;t[37]!==r||t[38]!==n?(w=(0,X.jsx)(Ze,{search:n,onSearchChange:r}),t[37]=r,t[38]=n,t[39]=w):w=t[39];let T;t[40]!==r||t[41]!==n?(T=e=>r({...n,...e===null||e===`all`?{environmentIds:void 0}:{environmentIds:[e]}}),t[40]=r,t[41]=n,t[42]=T):T=t[42];let E;t[43]!==s.availableEnvironments||t[44]!==x?(E=x===`all`?`All environments (${s.availableEnvironments.length})`:s.availableEnvironments.find(e=>e.environmentId===x)?.label??`Environment`,t[43]=s.availableEnvironments,t[44]=x,t[45]=E):E=t[45];let D;t[46]===E?D=t[47]:(D=(0,X.jsx)(v,{size:`sm`,className:`w-48`,"aria-label":`Usage environment`,children:(0,X.jsx)(h,{children:E})}),t[46]=E,t[47]=D);let O;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,X.jsx)(m,{value:`all`,children:`All environments`}),t[48]=O):O=t[48];let k;t[49]===s.availableEnvironments?k=t[50]:(k=s.availableEnvironments.map(qe),t[49]=s.availableEnvironments,t[50]=k);let A;t[51]===k?A=t[52]:(A=(0,X.jsxs)(_,{alignItemWithTrigger:!1,children:[O,k]}),t[51]=k,t[52]=A);let F;t[53]!==x||t[54]!==A||t[55]!==T||t[56]!==D?(F=(0,X.jsxs)(g,{value:x,onValueChange:T,children:[D,A]}),t[53]=x,t[54]=A,t[55]=T,t[56]=D,t[57]=F):F=t[57];let I;t[58]!==r||t[59]!==n?(I=(0,X.jsx)(Qe,{search:n,onSearchChange:r}),t[58]=r,t[59]=n,t[60]=I):I=t[60];let L;t[61]!==F||t[62]!==I||t[63]!==w?(L=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[w,F,I]}),t[61]=F,t[62]=I,t[63]=w,t[64]=L):L=t[64];let te=s.refreshing?`animate-spin`:void 0,R;t[65]===te?R=t[66]:(R=(0,X.jsx)(ue,{className:te}),t[65]=te,t[66]=R);let z=s.refreshing?`Refreshing`:`Refresh`,B;t[67]!==s.refresh||t[68]!==s.refreshing||t[69]!==R||t[70]!==z?(B=(0,X.jsxs)(a,{size:`sm`,variant:`outline`,onClick:s.refresh,disabled:s.refreshing,children:[R,z]}),t[67]=s.refresh,t[68]=s.refreshing,t[69]=R,t[70]=z,t[71]=B):B=t[71];let V;t[72]!==L||t[73]!==B?(V=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[L,B]}),t[72]=L,t[73]=B,t[74]=V):V=t[74];let H;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,X.jsx)(`p`,{className:`max-w-3xl text-sm leading-relaxed text-muted-foreground`,children:`Provider-recorded usage from supported local histories on the selected machines. This includes sessions run outside Ryco and is intentionally not attributed to projects.`}),t[75]=H):H=t[75];let U;t[76]===u.imports?U=t[77]:(U=u.imports.length>0?(0,X.jsx)(St,{rows:u.imports}):null,t[76]=u.imports,t[77]=U);let W;t[78]!==p||t[79]!==b||t[80]!==f||t[81]!==u.buckets.length||t[82]!==C||t[83]!==c.timeZone||t[84]!==r||t[85]!==y||t[86]!==n||t[87]!==d.distinctSessionCount||t[88]!==d.estimatedCacheSavingsUsd||t[89]!==d.estimatedCostUsd||t[90]!==d.reasoningTokens||t[91]!==d.responseCount||t[92]!==d.totalTokens?(W=u.buckets.length===0?(0,X.jsx)(N,{icon:le,title:C?`No usage in this range`:`No transcript sources found`,description:C?`The transcript sources were found, but no provider-recorded usage matched these filters.`:`No supported provider history was found on the selected environments. See source coverage below.`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`section`,{className:`grid overflow-hidden rounded-2xl border border-border/75 bg-card shadow-sm/5 lg:grid-cols-[minmax(18rem,0.72fr)_minmax(0,1.55fr)]`,children:[(0,X.jsxs)(`div`,{className:`flex min-h-80 flex-col justify-between border-b border-border/70 p-6 lg:border-r lg:border-b-0 lg:p-8`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold tracking-[0.12em] text-muted-foreground uppercase`,children:[(0,X.jsx)(Ee,{className:`size-3.5`}),` Raw API-equivalent cost`]}),(0,X.jsx)(`div`,{className:`mt-5 text-4xl font-semibold tracking-[-0.045em] tabular-nums sm:text-5xl`,children:We(d.estimatedCostUsd)}),(0,X.jsx)(`p`,{className:`mt-3 max-w-sm text-xs leading-relaxed text-muted-foreground`,children:`Estimate based on base API rates. Subscription, credits, batch, negotiated, and provider billing may differ.`})]}),(0,X.jsxs)(`div`,{className:`space-y-4 border-t border-border/65 pt-5`,children:[(0,X.jsx)(it,{label:`Priced coverage`,value:`${Math.round(y*100)}% of tokens`}),(0,X.jsx)(it,{label:`Estimated cache savings`,value:We(d.estimatedCacheSavingsUsd)}),(0,X.jsx)(it,{label:`Provider-recorded tokens`,value:P(d.totalTokens)})]})]}),(0,X.jsxs)(`div`,{className:`min-w-0 p-4 sm:p-6`,children:[(0,X.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3 px-1`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Usage over time`}),(0,X.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Daily values in `,c.timeZone]})]}),(0,X.jsx)($e,{search:n,onSearchChange:r})]}),(0,X.jsx)(tt,{data:f,metric:n.usageMetric}),(0,X.jsx)(`div`,{className:`flex items-center justify-end gap-4 px-2 text-[11px] text-muted-foreground`,children:J.map(Ke)})]})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 border-y border-border/65 md:grid-cols-5`,children:[(0,X.jsx)(at,{label:`Total tokens`,value:M(d.totalTokens)}),(0,X.jsx)(at,{label:`Sessions`,value:P(d.distinctSessionCount)}),(0,X.jsx)(at,{label:`Responses`,value:P(d.responseCount)}),(0,X.jsx)(at,{label:`Cache read`,value:`${Math.round(b*100)}%`}),(0,X.jsx)(at,{label:`Reasoning`,value:d.reasoningTokens===null?`Unavailable`:M(d.reasoningTokens),detail:`included in output`})]}),(0,X.jsx)(j,{title:`Breakdown`,icon:le,action:(0,X.jsx)(et,{search:n,onSearchChange:r}),bodyClassName:`overflow-hidden`,children:(0,X.jsx)(`div`,{className:`divide-y divide-border/60`,children:p.slice(0,20).map(e=>(0,X.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-5 px-4 py-3.5 sm:px-5`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`truncate text-sm font-medium`,children:n.usageBreakdown===`model`?ee(e.label):ne(e.label)}),(0,X.jsx)(`p`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:e.provider?ie(e.provider):`${e.responses} responses`})]}),(0,X.jsxs)(`div`,{className:`text-right`,children:[(0,X.jsx)(`p`,{className:`text-sm font-medium tabular-nums`,children:M(e.tokens)}),(0,X.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`tokens`})]}),(0,X.jsxs)(`div`,{className:`w-24 text-right`,children:[(0,X.jsx)(`p`,{className:`text-sm font-medium tabular-nums`,children:We(e.costUsd)}),(0,X.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.unpricedTokens>0?`${M(e.unpricedTokens)} unpriced`:`estimated`})]})]},e.key))})})]}),t[78]=p,t[79]=b,t[80]=f,t[81]=u.buckets.length,t[82]=C,t[83]=c.timeZone,t[84]=r,t[85]=y,t[86]=n,t[87]=d.distinctSessionCount,t[88]=d.estimatedCacheSavingsUsd,t[89]=d.estimatedCostUsd,t[90]=d.reasoningTokens,t[91]=d.responseCount,t[92]=d.totalTokens,t[93]=W):W=t[93];let G;if(t[94]!==c.sources||t[95]!==n.providers){let e;t[97]===n.providers?e=t[98]:(e=e=>n.providers===void 0||n.providers.includes(e.provider),t[97]=n.providers,t[98]=e),G=c.sources.filter(e),t[94]=c.sources,t[95]=n.providers,t[96]=G}else G=t[96];let K;t[99]!==c||t[100]!==G?(K=(0,X.jsx)(st,{summary:{...c,sources:G}}),t[99]=c,t[100]=G,t[101]=K):K=t[101];let q;return t[102]!==V||t[103]!==U||t[104]!==W||t[105]!==K?(q=(0,X.jsxs)(`div`,{className:`space-y-8`,children:[V,H,U,W,K]}),t[102]=V,t[103]=U,t[104]=W,t[105]=K,t[106]=q):q=t[106],q}function Ke(e){return(0,X.jsx)(ot,{color:xe[e],label:Se[e]},e)}function qe(e){return(0,X.jsx)(m,{value:e.environmentId,children:e.label},e.environmentId)}function Je(e){return e.included&&(e.status===`complete`||e.status===`partial`)}function Ye(e){return e.label}function Xe(e){return e.status===`failed`||e.status===`unavailable`||e.status===`stale-contract`}function Ze(e){let t=(0,Y.c)(3),{search:n,onSearchChange:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,X.jsx)(`div`,{className:`inline-flex rounded-lg border bg-card p-0.5`,children:[`7d`,`30d`,`90d`,`all`].map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>r({...n,range:e}),className:s(`h-7 rounded-md px-2.5 text-xs font-medium transition-colors`,n.range===e?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground`),children:e===`all`?`All`:e.toUpperCase()},e))}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Qe(e){let t=(0,Y.c)(8),{search:n,onSearchChange:r}=e,i=n.providers??J,a,o;if(t[0]!==r||t[1]!==n||t[2]!==i){let e=new Set(i);a=`inline-flex rounded-lg border bg-card p-0.5`,o=J.map(t=>(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":e.has(t),onClick:()=>{let i=new Set(e);i.has(t)&&i.size>1?i.delete(t):i.add(t);let a=[...i].toSorted();r({...n,...a.length===J.length?{providers:void 0}:{providers:a}})},className:s(`inline-flex h-7 items-center rounded-md px-2.5 text-xs font-medium capitalize transition-colors`,e.has(t)?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground`),children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`mr-1.5 inline-block size-1.5 rounded-full`,style:{backgroundColor:xe[t]}}),Se[t]]},t)),t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o}else a=t[3],o=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,X.jsx)(`div`,{className:a,children:o}),t[5]=a,t[6]=o,t[7]=c):c=t[7],c}function $e(e){let t=(0,Y.c)(4),{search:n,onSearchChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`cost`,`tokens`],t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,X.jsx)(`div`,{className:`inline-flex rounded-md bg-muted p-0.5`,children:i.map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>r({...n,usageMetric:e}),className:s(`h-6 rounded-sm px-2 text-[11px] font-medium capitalize`,n.usageMetric===e?`bg-background text-foreground shadow-xs`:`text-muted-foreground`),children:e},e))}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function et(e){let t=(0,Y.c)(4),{search:n,onSearchChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`model`,`day`],t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,X.jsx)(`div`,{className:`inline-flex items-center gap-1 text-[11px]`,children:i.map(e=>(0,X.jsx)(`button`,{type:`button`,onClick:()=>r({...n,usageBreakdown:e}),className:s(`rounded-md px-2 py-1 capitalize`,n.usageBreakdown===e?`bg-accent text-foreground`:`text-muted-foreground`),children:e},e))}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function tt(e){let t=(0,Y.c)(16),{data:n,metric:r}=e,i=r===`cost`?`Cost`:`Tokens`,a;t[0]===n?a=t[1]:(a=[...n],t[0]=n,t[1]=a);let o,s,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o={left:4,right:10,top:18,bottom:0},s=(0,X.jsx)(x,{vertical:!1,strokeDasharray:`3 5`}),c=(0,X.jsx)(D,{dataKey:`date`,tickLine:!1,axisLine:!1,minTickGap:30,tickFormatter:rt}),t[2]=o,t[3]=s,t[4]=c):(o=t[2],s=t[3],c=t[4]);let l;t[5]===r?l=t[6]:(l=(0,X.jsx)(C,{tickLine:!1,axisLine:!1,width:44,tickFormatter:e=>r===`cost`?`$${Number(e).toFixed(+(Number(e)<10))}`:M(Number(e))}),t[5]=r,t[6]=l);let u;t[7]===r?u=t[8]:(u=(0,X.jsx)(S,{content:(0,X.jsx)(U,{labelFormatter:nt,formatter:e=>r===`cost`?Ue.format(Number(e)||0):P(Number(e)||0)})}),t[7]=r,t[8]=u);let d;t[9]===i?d=t[10]:(d=J.map(e=>(0,X.jsx)(te,{dataKey:`${e}${i}`,name:ie(e),type:`monotone`,stroke:xe[e],fill:xe[e],fillOpacity:.08,strokeWidth:1.75,connectNulls:!1},e)),t[9]=i,t[10]=d);let f;return t[11]!==a||t[12]!==l||t[13]!==u||t[14]!==d?(f=(0,X.jsx)(A,{className:`h-[300px]`,children:(0,X.jsxs)(w,{data:a,margin:o,children:[s,c,l,u,d]})}),t[11]=a,t[12]=l,t[13]=u,t[14]=d,t[15]=f):f=t[15],f}function nt(e){return ne(String(e))}function rt(e){return ne(String(e))}function it(e){let t=(0,Y.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,X.jsx)(`span`,{className:`font-medium tabular-nums`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-4 text-xs`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function at(e){let t=(0,Y.c)(10),{label:n,value:r,detail:i}=e,a;t[0]===n?a=t[1]:(a=(0,X.jsx)(`p`,{className:`text-[10px] font-semibold tracking-[0.1em] text-muted-foreground uppercase`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,X.jsx)(`p`,{className:`mt-2 text-xl font-semibold tracking-tight tabular-nums`,children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=i?(0,X.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:i}):null,t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,X.jsxs)(`div`,{className:`border-r border-border/60 px-4 py-5 last:border-r-0`,children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function ot(e){let t=(0,Y.c)(5),{color:n,label:r}=e,i;t[0]===n?i=t[1]:(i=(0,X.jsx)(`span`,{className:`size-2 rounded-sm`,style:{backgroundColor:n}}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[i,r]}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function st(e){let t=(0,Y.c)(14),{summary:n}=e,r;if(t[0]!==n.duplicateSourceCount||t[1]!==n.environmentOnlyDeduplicationWarning||t[2]!==n.environments||t[3]!==n.sources){let e=n.sources.filter(bt),i=e.filter(yt),a=n.environments.filter(vt),s=n.environments.flatMap(_t),c=s.length===0?`Unavailable`:s.every(gt)?`Live`:s.every(ht)?`Cached`:s.every(mt)?`Unavailable`:`Mixed`,l=n.environments.flatMap(pt).toSorted().at(-1),u=e.map(ft).toSorted().at(-1),d=`${e.length} included`,f=n.duplicateSourceCount>0?`${n.duplicateSourceCount} duplicate source excluded`:`No physical duplicates detected`,p;t[5]!==d||t[6]!==f?(p=(0,X.jsx)(xt,{icon:Oe,label:`Transcript sources`,value:d,detail:f}),t[5]=d,t[6]=f,t[7]=p):p=t[7];let m=l?`Rates fetched ${W(l)}`:`Token totals remain available without rates`,h;t[8]!==c||t[9]!==m?(h=(0,X.jsx)(xt,{icon:Ee,label:`Pricing`,value:c,detail:m}),t[8]=c,t[9]=m,t[10]=h):h=t[10];let g=i.length===0?`Complete`:`${i.length} source notice${i.length===1?``:`s`}`,_=n.environmentOnlyDeduplicationWarning?`Some sources could only be scoped per environment`:`${e.reduce(lt,0)} malformed lines skipped`,v;t[11]!==g||t[12]!==_?(v=(0,X.jsx)(xt,{icon:o,label:`Coverage state`,value:g,detail:_}),t[11]=g,t[12]=_,t[13]=v):v=t[13],r=(0,X.jsxs)(j,{title:`Coverage & estimates`,icon:we,bodyClassName:`p-5`,children:[a.length>0?(0,X.jsxs)(`div`,{className:`mb-5 flex gap-2 rounded-lg border border-warning/30 bg-warning/8 px-3 py-2.5 text-xs text-muted-foreground`,children:[(0,X.jsx)(o,{className:`mt-0.5 size-3.5 shrink-0 text-warning`}),(0,X.jsxs)(`span`,{children:[`No usage was included from`,` `,a.map(dt).join(`, `),`.`]})]}):null,(0,X.jsxs)(`div`,{className:`grid gap-5 md:grid-cols-2 xl:grid-cols-4`,children:[p,(0,X.jsx)(xt,{icon:ae,label:`Last scan`,value:u?W(u):`Not scanned`,detail:`${e.reduce(ut,0)} cached files reused`}),h,v]}),i.map(ct)]}),t[0]=n.duplicateSourceCount,t[1]=n.environmentOnlyDeduplicationWarning,t[2]=n.environments,t[3]=n.sources,t[4]=r}else r=t[4];return r}function ct(e){return(0,X.jsxs)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:[ie(e.provider),` · `,e.environmentLabel,`:`,` `,e.message??e.diagnosticCode??e.status]},`${e.environmentId}:${e.sourceId}`)}function lt(e,t){return e+t.malformedLineCount}function ut(e,t){return e+t.reusedCacheFileCount}function dt(e){return e.label}function ft(e){return e.scanFinishedAt}function pt(e){let t=e.summary?.pricing.fetchedAt;return t===void 0?[]:[t]}function mt(e){return e===`unavailable`}function ht(e){return e===`cached`}function gt(e){return e===`live`}function _t(e){return e.summary===void 0?[]:[e.summary.pricing.state]}function vt(e){return e.status===`failed`||e.status===`unavailable`||e.status===`stale-contract`}function yt(e){return e.status!==`complete`}function bt(e){return e.included}function xt(e){let t=(0,Y.c)(15),{icon:n,label:r,value:i,detail:a}=e,o;t[0]===n?o=t[1]:(o=(0,X.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,X.jsx)(n,{className:`size-4`})}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r}),t[2]=r,t[3]=s);let c;t[4]===i?c=t[5]:(c=(0,X.jsx)(`p`,{className:`mt-1 text-sm font-medium`,children:i}),t[4]=i,t[5]=c);let l;t[6]===a?l=t[7]:(l=(0,X.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-muted-foreground`,children:a}),t[6]=a,t[7]=l);let u;t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,X.jsxs)(`div`,{children:[s,c,l]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;return t[12]!==o||t[13]!==u?(d=(0,X.jsxs)(`div`,{className:`flex gap-3`,children:[o,u]}),t[12]=o,t[13]=u,t[14]=d):d=t[14],d}function St(e){let t=(0,Y.c)(27),{rows:n}=e,[r,i]=(0,$.useState)(0),o,s,c,l,u,d,f,p;if(t[0]!==r||t[1]!==n){let e=Fe(n);c=Math.ceil(n.length/20),s=Math.min(r,c-1);let i=[...n].toSorted(Tt);o=j,d=`Cursor exported events and billed cost`,t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Saved Cursor Admin API exports. Billed costs include Cursor fees and remain separate from model cost. Exported events without token fields do not contribute token totals.`}),t[10]=f):f=t[10];let a=e.requests===null?`Requests unavailable`:`${P(e.requests)} exported events`,m=e.costs.map(wt).join(``);t[11]!==a||t[12]!==m?(p=(0,X.jsxs)(`p`,{className:`mt-3 text-sm`,children:[a,m]}),t[11]=a,t[12]=m,t[13]=p):p=t[13],l=`mt-4 divide-y`,u=i.slice(s*20,(s+1)*20).map(Ct),t[0]=r,t[1]=n,t[2]=o,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p}else o=t[2],s=t[3],c=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=t[9];let m;t[14]!==l||t[15]!==u?(m=(0,X.jsx)(`div`,{className:l,children:u}),t[14]=l,t[15]=u,t[16]=m):m=t[16];let h;t[17]!==s||t[18]!==c?(h=c>1?(0,X.jsxs)(`div`,{className:`mt-3 flex items-center gap-3`,children:[(0,X.jsx)(a,{size:`sm`,disabled:s===0,onClick:()=>i(s-1),children:`Previous`}),(0,X.jsxs)(`span`,{className:`text-xs`,children:[s+1,` / `,c]}),(0,X.jsx)(a,{size:`sm`,disabled:s>=c-1,onClick:()=>i(s+1),children:`Next`})]}):null,t[17]=s,t[18]=c,t[19]=h):h=t[19];let g;return t[20]!==o||t[21]!==d||t[22]!==f||t[23]!==p||t[24]!==m||t[25]!==h?(g=(0,X.jsxs)(o,{title:d,children:[f,p,m,h]}),t[20]=o,t[21]=d,t[22]=f,t[23]=p,t[24]=m,t[25]=h,t[26]=g):g=t[26],g}function Ct(e){return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 py-2 text-xs`,children:[(0,X.jsxs)(`span`,{children:[ne(e.date),e.model?` · ${ee(e.model)}`:``]}),(0,X.jsx)(`span`,{children:e.metric===`requests`?`${P(e.value)} events`:`${e.value.toLocaleString()} ${e.currency}`})]},e.recordId)}function wt(e){return` · ${e.value.toLocaleString()} ${e.currency} billed cost`}function Tt(e,t){return t.date.localeCompare(e.date)||e.metric.localeCompare(t.metric)}function Et(e){let t=(0,Y.c)(28),{search:n,onSearchChange:i}=e,a=_e(),o=n.view===`usage`?r.serverGetUsageSummary:r.serverGetStatistics,c=se(o),l=a?he:`pl-5 sm:pl-7`,u;t[0]===l?u=t[1]:(u=s(`flex min-h-14 shrink-0 flex-wrap items-center gap-x-5 gap-y-2 border-b border-border/75 bg-background/90 py-2 pr-5 backdrop-blur-sm sm:pr-7`,ge,l),t[0]=l,t[1]=u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`h1`,{className:`truncate text-sm font-semibold tracking-tight`,children:`Statistics`}),(0,X.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Usage and work signals`})]}),t[2]=d):d=t[2];let f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=[`usage`,`activity`],t[3]=f):f=t[3];let p;t[4]!==i||t[5]!==n?(p=(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-x-5 gap-y-2`,children:[d,(0,X.jsx)(`div`,{className:`inline-flex shrink-0 rounded-lg bg-muted/75 p-0.5`,children:f.map(e=>{let t=e===`usage`?G:b;return(0,X.jsxs)(`button`,{type:`button`,onClick:()=>i({...n,view:e}),className:s(`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium capitalize transition-colors`,n.view===e?`bg-background text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),children:[(0,X.jsx)(t,{className:`size-3.5`}),` `,e]},e)})})]}),t[4]=i,t[5]=n,t[6]=p):p=t[6];let m;t[7]===n.range?m=t[8]:(m=n.range===`all`?`All available history`:`Last ${n.range.slice(0,-1)} days`,t[7]=n.range,t[8]=m);let h;t[9]===m?h=t[10]:(h=(0,X.jsx)(`p`,{className:`text-xs font-medium`,children:m}),t[9]=m,t[10]=h);let g=n.view===`usage`?`Local calendar window`:`UTC activity window`,_;t[11]===g?_=t[12]:(_=(0,X.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:g}),t[11]=g,t[12]=_);let v;t[13]!==h||t[14]!==_?(v=(0,X.jsxs)(`div`,{className:`hidden text-right sm:block`,children:[h,_]}),t[13]=h,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==v||t[17]!==u||t[18]!==p?(y=(0,X.jsxs)(`header`,{className:u,children:[p,v]}),t[16]=v,t[17]=u,t[18]=p,t[19]=y):y=t[19];let x;t[20]!==c.allowed||t[21]!==c.reason||t[22]!==i||t[23]!==n?(x=(0,X.jsx)(pe,{className:`min-h-0 flex-1`,children:(0,X.jsx)(`div`,{className:`mx-auto w-full max-w-[1480px] px-5 py-7 sm:px-8 sm:py-9 lg:px-10`,children:c.allowed?n.view===`usage`?(0,X.jsx)(Ge,{search:n,onSearchChange:i}):(0,X.jsx)(Ie,{search:n,onSearchChange:i}):(0,X.jsx)(N,{icon:de,title:`Statistics aren’t available for this session`,description:c.reason??`Owner access is required.`})})}),t[20]=c.allowed,t[21]=c.reason,t[22]=i,t[23]=n,t[24]=x):x=t[24];let S;return t[25]!==y||t[26]!==x?(S=(0,X.jsx)(me,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground`,children:(0,X.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[y,x]})}),t[25]=y,t[26]=x,t[27]=S):S=t[27],S}export{Et as StatisticsPage};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$l as t,Qr as n,ho as r,oo as i}from"./runtime-DpHhg0dl.js";import{t as a}from"./react-CwJFpaho.js";import{Cr as o}from"./switch-DgLijJhN.js";import{t as s}from"./compiler-runtime-C4g8XhC5.js";import{t as c}from"./activity-CPE_7Kqw.js";import{F as ee,I as l,L as te,M as ne,N as re,P as ie,R as ae,T as u,_ as d,a as f,b as p,c as oe,d as se,f as ce,g as m,h as le,i as ue,j as de,l as fe,n as pe,o as h,p as me,r as he,s as ge,t as _e,u as ve,v as ye,x as be,y as xe}from"./useStatistics-C5V0rg9r.js";import{t as g}from"./chart-column-CVU4MshQ.js";import{$ as Se}from"./ContextHandoffEndpointLabel-BCNMjnEV.js";import{r as Ce}from"./capabilities-C9OPiefV.js";import{n as we,t as Te}from"./layers-3D4z3mrk.js";import{t as Ee}from"./refresh-cw-DBJIPv7m.js";import{n as De}from"./settingsLayout-3SUkadS6.js";var _={name:`chart-pie`,size:24,node:[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]],aliases:[`pie-chart`]};_.node;var Oe=r(_),v={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};v.node;var ke=r(v),y={name:`dollar-sign`,size:24,node:[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]};y.node;var Ae=r(y),je=e(a(),1),b=s(),x=t();function Me(e){let t=(0,b.c)(10),{models:n}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.jsx)(`div`,{className:`px-4 py-8 text-center text-muted-foreground text-xs`,children:`No model usage yet.`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=n.reduce(S,0)||1,t[1]=n,t[2]=r);let i=r,a;if(t[3]!==i||t[4]!==n){let e;t[6]===i?e=t[7]:(e=(e,t)=>{let n=u(t),r=Math.max(2,e.totalTokens/i*100);return(0,x.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,x.jsx)(`span`,{className:`w-4 text-center font-medium text-[11px] text-muted-foreground tabular-nums`,children:t+1}),(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,x.jsx)(`span`,{className:`truncate font-medium text-[13px] text-foreground`,children:d(e.model)}),(0,x.jsx)(`span`,{className:`shrink-0 font-medium text-foreground text-xs tabular-nums`,children:p(e.totalTokens)})]}),(0,x.jsx)(`div`,{className:`mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,x.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-500`,style:{width:`${r}%`,backgroundColor:n}})}),(0,x.jsxs)(`div`,{className:`mt-1 flex items-center justify-between text-[11px] text-muted-foreground`,children:[(0,x.jsx)(`span`,{className:`truncate`,children:ye(e.provider)}),(0,x.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:e.costUsd===null?`—`:`~${be(e.costUsd)}`})]})]})]},`${e.provider??`unknown`}:${e.model}`)},t[6]=i,t[7]=e),a=n.map(e),t[3]=i,t[4]=n,t[5]=a}else a=t[5];let o;return t[8]===a?o=t[9]:(o=(0,x.jsx)(`ol`,{className:`divide-y divide-border/50`,children:a}),t[8]=a,t[9]=o),o}function S(e,t){return Math.max(e,t.totalTokens)}function C(){let e=(0,b.c)(92),{snapshot:t,loading:r,error:a,refresh:s,refreshing:u}=_e(),_;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(_={range:`30d`,projectId:null,model:null,provider:null},e[0]=_):_=e[0];let[v,y]=(0,je.useState)(_),S;bb0:{if(!t){S=null;break bb0}let n,r,i,a,o,s,c,l;if(e[1]!==v||e[2]!==t){let u=ee(t,v),d=re(t),f=pe(u),p=f.reduce(Ie,0);n=ae(u),r=te(t,v),i=f,a=p,o=ne(u),s=de(u,d),c=ie(t,u,v.range),l=he(f),e[1]=v,e[2]=t,e[3]=n,e[4]=r,e[5]=i,e[6]=a,e[7]=o,e[8]=s,e[9]=c,e[10]=l}else n=e[3],r=e[4],i=e[5],a=e[6],o=e[7],s=e[8],c=e[9],l=e[10];let u;e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==a||e[15]!==o||e[16]!==s||e[17]!==c||e[18]!==l?(u={totals:n,previous:r,models:i,totalsAllModels:a,providers:o,projects:s,series:c,cost:l},e[11]=n,e[12]=r,e[13]=i,e[14]=a,e[15]=o,e[16]=s,e[17]=c,e[18]=l,e[19]=u):u=e[19],S=u}let C=S;if(r&&!t){let t;return e[20]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(De,{children:(0,x.jsx)(ge,{})}),e[20]=t):t=e[20],t}if(a&&!t){let t;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(Ee,{}),e[21]=t):t=e[21];let r;e[22]===s?r=e[23]:(r=(0,x.jsxs)(n,{size:`sm`,variant:`outline`,onClick:s,children:[t,` Try again`]}),e[22]=s,e[23]=r);let o;return e[24]!==a||e[25]!==r?(o=(0,x.jsx)(De,{children:(0,x.jsx)(oe,{icon:i,title:`Couldn’t load statistics`,description:a,action:r})}),e[24]=a,e[25]=r,e[26]=o):o=e[26],o}if(!t||!C)return null;let E=t.dailyBuckets.length>0,{totals:D,previous:O,models:k,totalsAllModels:A,providers:j,projects:M,series:N,cost:P}=C,F=k[0],I;e[27]!==F||e[28]!==A?(I=F&&A>0?Math.round(F.totalTokens/A*100):0,e[27]=F,e[28]=A,e[29]=I):I=e[29];let L=I,R;e[30]===N?R=e[31]:(R=N.map(Fe),e[30]=N,e[31]=R);let Le=R,z;e[32]===N?z=e[33]:(z=N.map(Pe),e[32]=N,e[33]=z);let Re=z,B=Math.max(0,D.totalTokens-D.inputTokens-D.outputTokens),V;e[34]!==D.inputTokens||e[35]!==D.outputTokens||e[36]!==B?(V=B>0?`${p(D.inputTokens)} in · ${p(D.outputTokens)} out · ${p(B)} other`:`${p(D.inputTokens)} in · ${p(D.outputTokens)} out`,e[34]=D.inputTokens,e[35]=D.outputTokens,e[36]=B,e[37]=V):V=e[37];let ze=V,H;e[38]===N?H=e[39]:(H=N.some(Ne),e[38]=N,e[39]=H);let Be=H,Ve=t.tokenAttribution===`thread-cumulative`?`Token figures use cumulative thread snapshots when providers or older sessions do not expose per-turn deltas.`:t.tokenAttribution===`mixed`?`Token figures combine exact per-turn deltas where available with cumulative snapshots for older or provider-limited sessions.`:`Token figures use exact per-turn deltas where providers report them.`,U;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,x.jsx)(`h1`,{className:`font-semibold text-foreground text-lg`,children:`Statistics`}),e[40]=U):U=e[40];let W;e[41]===t.generatedAt?W=e[42]:(W=xe(t.generatedAt),e[41]=t.generatedAt,e[42]=W);let G;e[43]===W?G=e[44]:(G=(0,x.jsxs)(`div`,{className:`space-y-0.5`,children:[U,(0,x.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Usage across your projects · as of `,W]})]}),e[43]=W,e[44]=G);let K=u?`animate-spin`:void 0,q;e[45]===K?q=e[46]:(q=(0,x.jsx)(Ee,{className:K}),e[45]=K,e[46]=q);let J;e[47]!==s||e[48]!==u||e[49]!==q?(J=(0,x.jsxs)(n,{size:`xs`,variant:`outline`,onClick:s,disabled:u,"aria-label":`Refresh statistics`,children:[q,`Refresh`]}),e[47]=s,e[48]=u,e[49]=q,e[50]=J):J=e[50];let Y;e[51]!==J||e[52]!==G?(Y=(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[G,J]}),e[51]=J,e[52]=G,e[53]=Y):Y=e[53];let X;e[54]!==v||e[55]!==t.models||e[56]!==t.projects?(X=(0,x.jsx)(ue,{filter:v,onChange:y,projects:t.projects,models:t.models}),e[54]=v,e[55]=t.models,e[56]=t.projects,e[57]=X):X=e[57];let Z;e[58]!==Y||e[59]!==X?(Z=(0,x.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Y,X]}),e[58]=Y,e[59]=X,e[60]=Z):Z=e[60];let Q;e[61]!==Re||e[62]!==Ve||e[63]!==P||e[64]!==E||e[65]!==Be||e[66]!==k||e[67]!==O?.activeMs||e[68]!==O?.threadsCreated||e[69]!==O?.totalTokens||e[70]!==M||e[71]!==j||e[72]!==N||e[73]!==t.worktrees||e[74]!==Le||e[75]!==ze||e[76]!==F||e[77]!==L||e[78]!==D.activeMs||e[79]!==D.additions||e[80]!==D.commits||e[81]!==D.deletions||e[82]!==D.filesChanged||e[83]!==D.pushes||e[84]!==D.threadsCreated||e[85]!==D.toolUses||e[86]!==D.totalTokens||e[87]!==D.turns?(Q=E?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-5`,children:[(0,x.jsx)(h,{label:`Total tokens`,icon:ke,value:p(D.totalTokens),sub:ze,delta:l(D.totalTokens,O?.totalTokens),sparkline:Le}),(0,x.jsx)(h,{label:`Est. cost`,icon:Ae,value:`~${be(P.usd)}`,sub:P.hasUnpriced?`excludes unpriced models`:`estimated spend`}),(0,x.jsx)(h,{label:`Most used model`,icon:Te,value:(0,x.jsx)(`span`,{className:`block max-w-full truncate text-lg`,title:F?d(F.model):void 0,children:F?d(F.model):`—`}),sub:F?`${ye(F.provider)} · ${L}% of tokens`:`no usage in range`}),(0,x.jsx)(h,{label:`Chats`,icon:Ce,value:m(D.threadsCreated),sub:`threads started`,delta:l(D.threadsCreated,O?.threadsCreated)}),(0,x.jsx)(h,{label:`Active time`,icon:Se,value:le(D.activeMs),sub:`${m(D.turns)} turns`,delta:l(D.activeMs,O?.activeMs),sparkline:Re})]}),(0,x.jsxs)(f,{title:`Token usage over time`,icon:g,bodyClassName:`p-4`,children:[(0,x.jsx)(ce,{data:N}),(0,x.jsxs)(`div`,{className:`mt-2 flex items-center gap-4 px-1 text-[11px] text-muted-foreground`,children:[(0,x.jsx)(w,{colorIndex:0,label:`Input`}),(0,x.jsx)(w,{colorIndex:1,label:`Output`}),Be?(0,x.jsx)(w,{colorIndex:2,label:`Other`}):null]})]}),(0,x.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,x.jsx)(f,{title:`Models`,icon:Te,bodyClassName:`overflow-hidden`,action:(0,x.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[k.length,` total`]}),children:(0,x.jsx)(Me,{models:k})}),(0,x.jsx)(f,{title:`Tokens by provider`,icon:Oe,bodyClassName:`p-4`,children:(0,x.jsx)(se,{data:j})})]}),(0,x.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,x.jsx)(f,{title:`Tokens by project`,icon:g,bodyClassName:`p-4`,children:(0,x.jsx)(ve,{data:M})}),(0,x.jsxs)(f,{title:`Activity`,icon:c,bodyClassName:`p-4`,children:[(0,x.jsx)(me,{points:N,metric:`turns`}),(0,x.jsx)(`p`,{className:`mt-3 text-[11px] text-muted-foreground`,children:`Turns per day`})]})]}),(0,x.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,x.jsxs)(f,{title:`Code changes`,icon:we,bodyClassName:`p-4`,children:[(0,x.jsxs)(`div`,{className:`mb-3 flex items-center gap-4 text-sm`,children:[(0,x.jsx)(T,{label:`Files`,value:m(D.filesChanged)}),(0,x.jsx)(T,{label:`Added`,value:`+${m(D.additions)}`,tone:`success`}),(0,x.jsx)(T,{label:`Removed`,value:`−${m(D.deletions)}`,tone:`destructive`})]}),(0,x.jsx)(fe,{data:N})]}),(0,x.jsxs)(f,{title:`Source control`,icon:o,bodyClassName:`p-4`,children:[(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,x.jsx)(T,{label:`Worktrees`,value:m(t.worktrees.created)}),(0,x.jsx)(T,{label:`Active`,value:m(t.worktrees.active)}),(0,x.jsx)(T,{label:`Open PRs`,value:m(t.worktrees.openPrs)}),(0,x.jsx)(T,{label:`Tool uses`,value:m(D.toolUses)})]}),D.commits+D.pushes>0?(0,x.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3 border-border/60 border-t pt-3`,children:[(0,x.jsx)(T,{label:`Commits`,value:m(D.commits)}),(0,x.jsx)(T,{label:`Pushes`,value:m(D.pushes)})]}):(0,x.jsx)(`p`,{className:`mt-3 border-border/60 border-t pt-3 text-[11px] text-muted-foreground`,children:`Commit & push counts aren’t recorded yet.`})]})]}),(0,x.jsxs)(`p`,{className:`px-1 text-[11px] text-muted-foreground/80`,children:[Ve,` Costs are rough estimates from a built-in price table and exclude subscription-billed or breakdown-less usage.`]})]}):(0,x.jsx)(oe,{icon:g,title:`No activity yet`,description:`Once you start chatting with agents, your token usage, models, and code changes will show up here.`}),e[61]=Re,e[62]=Ve,e[63]=P,e[64]=E,e[65]=Be,e[66]=k,e[67]=O?.activeMs,e[68]=O?.threadsCreated,e[69]=O?.totalTokens,e[70]=M,e[71]=j,e[72]=N,e[73]=t.worktrees,e[74]=Le,e[75]=ze,e[76]=F,e[77]=L,e[78]=D.activeMs,e[79]=D.additions,e[80]=D.commits,e[81]=D.deletions,e[82]=D.filesChanged,e[83]=D.pushes,e[84]=D.threadsCreated,e[85]=D.toolUses,e[86]=D.totalTokens,e[87]=D.turns,e[88]=Q):Q=e[88];let $;return e[89]!==Z||e[90]!==Q?($=(0,x.jsxs)(De,{children:[Z,Q]}),e[89]=Z,e[90]=Q,e[91]=$):$=e[91],$}function Ne(e){return e.uncategorizedTokens>0}function Pe(e){return e.activeMs}function Fe(e){return e.totalTokens}function Ie(e,t){return e+t.totalTokens}function w(e){let t=(0,b.c)(7),{colorIndex:n,label:r}=e,i;t[0]===n?i=t[1]:(i=u(n),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a=(0,x.jsx)(`span`,{className:`size-2.5 rounded-[3px]`,style:{backgroundColor:i}}),t[2]=i,t[3]=a);let o;return t[4]!==r||t[5]!==a?(o=(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[a,r]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function T(e){let t=(0,b.c)(8),{label:n,value:r,tone:i}=e,a;t[0]===n?a=t[1]:(a=(0,x.jsx)(`span`,{className:`text-[11px] text-muted-foreground uppercase tracking-[0.06em]`,children:n}),t[0]=n,t[1]=a);let o=i===`success`?`font-semibold text-base text-success-foreground tabular-nums`:i===`destructive`?`font-semibold text-base text-destructive tabular-nums`:`font-semibold text-base text-foreground tabular-nums`,s;t[2]!==o||t[3]!==r?(s=(0,x.jsx)(`span`,{className:o,children:r}),t[2]=o,t[3]=r,t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==s?(c=(0,x.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[a,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}export{C as StatisticsPanel};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$l as t,Qr as n,ho as r,oo as i}from"./runtime-BwHA1GUS.js";import{t as a}from"./react-CwJFpaho.js";import{Cr as o}from"./switch-DnpJB2xv.js";import{t as s}from"./compiler-runtime-C4g8XhC5.js";import{t as c}from"./activity-CwTUF6lv.js";import{F as ee,I as l,L as te,M as ne,N as re,P as ie,R as ae,T as u,_ as d,a as f,b as p,c as oe,d as se,f as ce,g as m,h as le,i as ue,j as de,l as fe,n as pe,o as h,p as me,r as he,s as ge,t as _e,u as ve,v as ye,x as be,y as xe}from"./useStatistics-B76_r68I.js";import{t as g}from"./chart-column-Cg7d41tb.js";import{$ as Se}from"./ContextHandoffEndpointLabel-CeGDLNA4.js";import{r as Ce}from"./capabilities-CsHjxjab.js";import{n as we,t as Te}from"./layers-Dqez1Uq8.js";import{t as Ee}from"./refresh-cw-CgDa2Ok_.js";import{n as De}from"./settingsLayout-DxsFwhF0.js";var _={name:`chart-pie`,size:24,node:[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]],aliases:[`pie-chart`]};_.node;var Oe=r(_),v={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};v.node;var ke=r(v),y={name:`dollar-sign`,size:24,node:[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]};y.node;var Ae=r(y),je=e(a(),1),b=s(),x=t();function Me(e){let t=(0,b.c)(10),{models:n}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.jsx)(`div`,{className:`px-4 py-8 text-center text-muted-foreground text-xs`,children:`No model usage yet.`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=n.reduce(S,0)||1,t[1]=n,t[2]=r);let i=r,a;if(t[3]!==i||t[4]!==n){let e;t[6]===i?e=t[7]:(e=(e,t)=>{let n=u(t),r=Math.max(2,e.totalTokens/i*100);return(0,x.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,x.jsx)(`span`,{className:`w-4 text-center font-medium text-[11px] text-muted-foreground tabular-nums`,children:t+1}),(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,x.jsx)(`span`,{className:`truncate font-medium text-[13px] text-foreground`,children:d(e.model)}),(0,x.jsx)(`span`,{className:`shrink-0 font-medium text-foreground text-xs tabular-nums`,children:p(e.totalTokens)})]}),(0,x.jsx)(`div`,{className:`mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,x.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-500`,style:{width:`${r}%`,backgroundColor:n}})}),(0,x.jsxs)(`div`,{className:`mt-1 flex items-center justify-between text-[11px] text-muted-foreground`,children:[(0,x.jsx)(`span`,{className:`truncate`,children:ye(e.provider)}),(0,x.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:e.costUsd===null?`—`:`~${be(e.costUsd)}`})]})]})]},`${e.provider??`unknown`}:${e.model}`)},t[6]=i,t[7]=e),a=n.map(e),t[3]=i,t[4]=n,t[5]=a}else a=t[5];let o;return t[8]===a?o=t[9]:(o=(0,x.jsx)(`ol`,{className:`divide-y divide-border/50`,children:a}),t[8]=a,t[9]=o),o}function S(e,t){return Math.max(e,t.totalTokens)}function C(){let e=(0,b.c)(92),{snapshot:t,loading:r,error:a,refresh:s,refreshing:u}=_e(),_;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(_={range:`30d`,projectId:null,model:null,provider:null},e[0]=_):_=e[0];let[v,y]=(0,je.useState)(_),S;bb0:{if(!t){S=null;break bb0}let n,r,i,a,o,s,c,l;if(e[1]!==v||e[2]!==t){let u=ee(t,v),d=re(t),f=pe(u),p=f.reduce(Ie,0);n=ae(u),r=te(t,v),i=f,a=p,o=ne(u),s=de(u,d),c=ie(t,u,v.range),l=he(f),e[1]=v,e[2]=t,e[3]=n,e[4]=r,e[5]=i,e[6]=a,e[7]=o,e[8]=s,e[9]=c,e[10]=l}else n=e[3],r=e[4],i=e[5],a=e[6],o=e[7],s=e[8],c=e[9],l=e[10];let u;e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==a||e[15]!==o||e[16]!==s||e[17]!==c||e[18]!==l?(u={totals:n,previous:r,models:i,totalsAllModels:a,providers:o,projects:s,series:c,cost:l},e[11]=n,e[12]=r,e[13]=i,e[14]=a,e[15]=o,e[16]=s,e[17]=c,e[18]=l,e[19]=u):u=e[19],S=u}let C=S;if(r&&!t){let t;return e[20]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(De,{children:(0,x.jsx)(ge,{})}),e[20]=t):t=e[20],t}if(a&&!t){let t;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(Ee,{}),e[21]=t):t=e[21];let r;e[22]===s?r=e[23]:(r=(0,x.jsxs)(n,{size:`sm`,variant:`outline`,onClick:s,children:[t,` Try again`]}),e[22]=s,e[23]=r);let o;return e[24]!==a||e[25]!==r?(o=(0,x.jsx)(De,{children:(0,x.jsx)(oe,{icon:i,title:`Couldn’t load statistics`,description:a,action:r})}),e[24]=a,e[25]=r,e[26]=o):o=e[26],o}if(!t||!C)return null;let E=t.dailyBuckets.length>0,{totals:D,previous:O,models:k,totalsAllModels:A,providers:j,projects:M,series:N,cost:P}=C,F=k[0],I;e[27]!==F||e[28]!==A?(I=F&&A>0?Math.round(F.totalTokens/A*100):0,e[27]=F,e[28]=A,e[29]=I):I=e[29];let L=I,R;e[30]===N?R=e[31]:(R=N.map(Fe),e[30]=N,e[31]=R);let Le=R,z;e[32]===N?z=e[33]:(z=N.map(Pe),e[32]=N,e[33]=z);let Re=z,B=Math.max(0,D.totalTokens-D.inputTokens-D.outputTokens),V;e[34]!==D.inputTokens||e[35]!==D.outputTokens||e[36]!==B?(V=B>0?`${p(D.inputTokens)} in · ${p(D.outputTokens)} out · ${p(B)} other`:`${p(D.inputTokens)} in · ${p(D.outputTokens)} out`,e[34]=D.inputTokens,e[35]=D.outputTokens,e[36]=B,e[37]=V):V=e[37];let ze=V,H;e[38]===N?H=e[39]:(H=N.some(Ne),e[38]=N,e[39]=H);let Be=H,Ve=t.tokenAttribution===`thread-cumulative`?`Token figures use cumulative thread snapshots when providers or older sessions do not expose per-turn deltas.`:t.tokenAttribution===`mixed`?`Token figures combine exact per-turn deltas where available with cumulative snapshots for older or provider-limited sessions.`:`Token figures use exact per-turn deltas where providers report them.`,U;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,x.jsx)(`h1`,{className:`font-semibold text-foreground text-lg`,children:`Statistics`}),e[40]=U):U=e[40];let W;e[41]===t.generatedAt?W=e[42]:(W=xe(t.generatedAt),e[41]=t.generatedAt,e[42]=W);let G;e[43]===W?G=e[44]:(G=(0,x.jsxs)(`div`,{className:`space-y-0.5`,children:[U,(0,x.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Usage across your projects · as of `,W]})]}),e[43]=W,e[44]=G);let K=u?`animate-spin`:void 0,q;e[45]===K?q=e[46]:(q=(0,x.jsx)(Ee,{className:K}),e[45]=K,e[46]=q);let J;e[47]!==s||e[48]!==u||e[49]!==q?(J=(0,x.jsxs)(n,{size:`xs`,variant:`outline`,onClick:s,disabled:u,"aria-label":`Refresh statistics`,children:[q,`Refresh`]}),e[47]=s,e[48]=u,e[49]=q,e[50]=J):J=e[50];let Y;e[51]!==J||e[52]!==G?(Y=(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[G,J]}),e[51]=J,e[52]=G,e[53]=Y):Y=e[53];let X;e[54]!==v||e[55]!==t.models||e[56]!==t.projects?(X=(0,x.jsx)(ue,{filter:v,onChange:y,projects:t.projects,models:t.models}),e[54]=v,e[55]=t.models,e[56]=t.projects,e[57]=X):X=e[57];let Z;e[58]!==Y||e[59]!==X?(Z=(0,x.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Y,X]}),e[58]=Y,e[59]=X,e[60]=Z):Z=e[60];let Q;e[61]!==Re||e[62]!==Ve||e[63]!==P||e[64]!==E||e[65]!==Be||e[66]!==k||e[67]!==O?.activeMs||e[68]!==O?.threadsCreated||e[69]!==O?.totalTokens||e[70]!==M||e[71]!==j||e[72]!==N||e[73]!==t.worktrees||e[74]!==Le||e[75]!==ze||e[76]!==F||e[77]!==L||e[78]!==D.activeMs||e[79]!==D.additions||e[80]!==D.commits||e[81]!==D.deletions||e[82]!==D.filesChanged||e[83]!==D.pushes||e[84]!==D.threadsCreated||e[85]!==D.toolUses||e[86]!==D.totalTokens||e[87]!==D.turns?(Q=E?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-5`,children:[(0,x.jsx)(h,{label:`Total tokens`,icon:ke,value:p(D.totalTokens),sub:ze,delta:l(D.totalTokens,O?.totalTokens),sparkline:Le}),(0,x.jsx)(h,{label:`Est. cost`,icon:Ae,value:`~${be(P.usd)}`,sub:P.hasUnpriced?`excludes unpriced models`:`estimated spend`}),(0,x.jsx)(h,{label:`Most used model`,icon:Te,value:(0,x.jsx)(`span`,{className:`block max-w-full truncate text-lg`,title:F?d(F.model):void 0,children:F?d(F.model):`—`}),sub:F?`${ye(F.provider)} · ${L}% of tokens`:`no usage in range`}),(0,x.jsx)(h,{label:`Chats`,icon:Ce,value:m(D.threadsCreated),sub:`threads started`,delta:l(D.threadsCreated,O?.threadsCreated)}),(0,x.jsx)(h,{label:`Active time`,icon:Se,value:le(D.activeMs),sub:`${m(D.turns)} turns`,delta:l(D.activeMs,O?.activeMs),sparkline:Re})]}),(0,x.jsxs)(f,{title:`Token usage over time`,icon:g,bodyClassName:`p-4`,children:[(0,x.jsx)(ce,{data:N}),(0,x.jsxs)(`div`,{className:`mt-2 flex items-center gap-4 px-1 text-[11px] text-muted-foreground`,children:[(0,x.jsx)(w,{colorIndex:0,label:`Input`}),(0,x.jsx)(w,{colorIndex:1,label:`Output`}),Be?(0,x.jsx)(w,{colorIndex:2,label:`Other`}):null]})]}),(0,x.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,x.jsx)(f,{title:`Models`,icon:Te,bodyClassName:`overflow-hidden`,action:(0,x.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[k.length,` total`]}),children:(0,x.jsx)(Me,{models:k})}),(0,x.jsx)(f,{title:`Tokens by provider`,icon:Oe,bodyClassName:`p-4`,children:(0,x.jsx)(se,{data:j})})]}),(0,x.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,x.jsx)(f,{title:`Tokens by project`,icon:g,bodyClassName:`p-4`,children:(0,x.jsx)(ve,{data:M})}),(0,x.jsxs)(f,{title:`Activity`,icon:c,bodyClassName:`p-4`,children:[(0,x.jsx)(me,{points:N,metric:`turns`}),(0,x.jsx)(`p`,{className:`mt-3 text-[11px] text-muted-foreground`,children:`Turns per day`})]})]}),(0,x.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,x.jsxs)(f,{title:`Code changes`,icon:we,bodyClassName:`p-4`,children:[(0,x.jsxs)(`div`,{className:`mb-3 flex items-center gap-4 text-sm`,children:[(0,x.jsx)(T,{label:`Files`,value:m(D.filesChanged)}),(0,x.jsx)(T,{label:`Added`,value:`+${m(D.additions)}`,tone:`success`}),(0,x.jsx)(T,{label:`Removed`,value:`−${m(D.deletions)}`,tone:`destructive`})]}),(0,x.jsx)(fe,{data:N})]}),(0,x.jsxs)(f,{title:`Source control`,icon:o,bodyClassName:`p-4`,children:[(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,x.jsx)(T,{label:`Worktrees`,value:m(t.worktrees.created)}),(0,x.jsx)(T,{label:`Active`,value:m(t.worktrees.active)}),(0,x.jsx)(T,{label:`Open PRs`,value:m(t.worktrees.openPrs)}),(0,x.jsx)(T,{label:`Tool uses`,value:m(D.toolUses)})]}),D.commits+D.pushes>0?(0,x.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3 border-border/60 border-t pt-3`,children:[(0,x.jsx)(T,{label:`Commits`,value:m(D.commits)}),(0,x.jsx)(T,{label:`Pushes`,value:m(D.pushes)})]}):(0,x.jsx)(`p`,{className:`mt-3 border-border/60 border-t pt-3 text-[11px] text-muted-foreground`,children:`Commit & push counts aren’t recorded yet.`})]})]}),(0,x.jsxs)(`p`,{className:`px-1 text-[11px] text-muted-foreground/80`,children:[Ve,` Costs are rough estimates from a built-in price table and exclude subscription-billed or breakdown-less usage.`]})]}):(0,x.jsx)(oe,{icon:g,title:`No activity yet`,description:`Once you start chatting with agents, your token usage, models, and code changes will show up here.`}),e[61]=Re,e[62]=Ve,e[63]=P,e[64]=E,e[65]=Be,e[66]=k,e[67]=O?.activeMs,e[68]=O?.threadsCreated,e[69]=O?.totalTokens,e[70]=M,e[71]=j,e[72]=N,e[73]=t.worktrees,e[74]=Le,e[75]=ze,e[76]=F,e[77]=L,e[78]=D.activeMs,e[79]=D.additions,e[80]=D.commits,e[81]=D.deletions,e[82]=D.filesChanged,e[83]=D.pushes,e[84]=D.threadsCreated,e[85]=D.toolUses,e[86]=D.totalTokens,e[87]=D.turns,e[88]=Q):Q=e[88];let $;return e[89]!==Z||e[90]!==Q?($=(0,x.jsxs)(De,{children:[Z,Q]}),e[89]=Z,e[90]=Q,e[91]=$):$=e[91],$}function Ne(e){return e.uncategorizedTokens>0}function Pe(e){return e.activeMs}function Fe(e){return e.totalTokens}function Ie(e,t){return e+t.totalTokens}function w(e){let t=(0,b.c)(7),{colorIndex:n,label:r}=e,i;t[0]===n?i=t[1]:(i=u(n),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a=(0,x.jsx)(`span`,{className:`size-2.5 rounded-[3px]`,style:{backgroundColor:i}}),t[2]=i,t[3]=a);let o;return t[4]!==r||t[5]!==a?(o=(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[a,r]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function T(e){let t=(0,b.c)(8),{label:n,value:r,tone:i}=e,a;t[0]===n?a=t[1]:(a=(0,x.jsx)(`span`,{className:`text-[11px] text-muted-foreground uppercase tracking-[0.06em]`,children:n}),t[0]=n,t[1]=a);let o=i===`success`?`font-semibold text-base text-success-foreground tabular-nums`:i===`destructive`?`font-semibold text-base text-destructive tabular-nums`:`font-semibold text-base text-foreground tabular-nums`,s;t[2]!==o||t[3]!==r?(s=(0,x.jsx)(`span`,{className:o,children:r}),t[2]=o,t[3]=r,t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==s?(c=(0,x.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[a,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}export{C as StatisticsPanel};
@@ -1 +1 @@
1
- import{$l as e,K as t,Ql as n,Qr as r}from"./runtime-DpHhg0dl.js";import{t as i}from"./compiler-runtime-C4g8XhC5.js";import{t as a}from"./useNavigate-xewFGSmS.js";import{t as o}from"./arrow-up-right-CLCNhOeC.js";import{t as s}from"./chart-column-CVU4MshQ.js";import{n as c}from"./settingsLayout-3SUkadS6.js";import{r as l}from"./main-DsnAjTqg.js";var u=i(),d=e();function f(){let e=(0,u.c)(10),i=a(),f=n(),m=t(p),h,g,_;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,d.jsx)(`div`,{className:`mx-auto flex size-10 items-center justify-center rounded-xl bg-primary/10 text-primary`,children:(0,d.jsx)(s,{className:`size-5`})}),g=(0,d.jsx)(`h1`,{className:`mt-4 text-lg font-semibold tracking-tight`,children:`Statistics has more room now`}),_=(0,d.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:`Explore provider-recorded Usage and Ryco-observed Activity in the standalone dashboard.`}),e[0]=h,e[1]=g,e[2]=_):(h=e[0],g=e[1],_=e[2]);let v;e[3]!==m||e[4]!==i||e[5]!==f?(v=()=>{m(),i({to:`/statistics`,search:l(f?{environmentIds:[f.environmentId]}:{})})},e[3]=m,e[4]=i,e[5]=f,e[6]=v):v=e[6];let y;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,d.jsx)(o,{}),e[7]=y):y=e[7];let b;return e[8]===v?b=e[9]:(b=(0,d.jsx)(c,{children:(0,d.jsx)(`div`,{className:`flex min-h-72 items-center justify-center`,children:(0,d.jsxs)(`div`,{className:`max-w-lg rounded-2xl border border-border/75 bg-card p-7 text-center shadow-sm/5`,children:[h,g,_,(0,d.jsxs)(r,{className:`mt-5`,onClick:v,children:[`Open Statistics `,y]})]})})}),e[8]=v,e[9]=b),b}function p(e){return e.closeSettings}export{f as StatisticsSettingsLink};
1
+ import{$l as e,K as t,Ql as n,Qr as r}from"./runtime-BwHA1GUS.js";import{t as i}from"./compiler-runtime-C4g8XhC5.js";import{t as a}from"./useNavigate-B8oXtF30.js";import{t as o}from"./arrow-up-right-DHnMKuVA.js";import{t as s}from"./chart-column-Cg7d41tb.js";import{n as c}from"./settingsLayout-DxsFwhF0.js";import{r as l}from"./main-DAbEANjY.js";var u=i(),d=e();function f(){let e=(0,u.c)(10),i=a(),f=n(),m=t(p),h,g,_;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,d.jsx)(`div`,{className:`mx-auto flex size-10 items-center justify-center rounded-xl bg-primary/10 text-primary`,children:(0,d.jsx)(s,{className:`size-5`})}),g=(0,d.jsx)(`h1`,{className:`mt-4 text-lg font-semibold tracking-tight`,children:`Statistics has more room now`}),_=(0,d.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:`Explore provider-recorded Usage and Ryco-observed Activity in the standalone dashboard.`}),e[0]=h,e[1]=g,e[2]=_):(h=e[0],g=e[1],_=e[2]);let v;e[3]!==m||e[4]!==i||e[5]!==f?(v=()=>{m(),i({to:`/statistics`,search:l(f?{environmentIds:[f.environmentId]}:{})})},e[3]=m,e[4]=i,e[5]=f,e[6]=v):v=e[6];let y;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,d.jsx)(o,{}),e[7]=y):y=e[7];let b;return e[8]===v?b=e[9]:(b=(0,d.jsx)(c,{children:(0,d.jsx)(`div`,{className:`flex min-h-72 items-center justify-center`,children:(0,d.jsxs)(`div`,{className:`max-w-lg rounded-2xl border border-border/75 bg-card p-7 text-center shadow-sm/5`,children:[h,g,_,(0,d.jsxs)(r,{className:`mt-5`,onClick:v,children:[`Open Statistics `,y]})]})})}),e[8]=v,e[9]=b),b}function p(e){return e.closeSettings}export{f as StatisticsSettingsLink};
@@ -1,4 +1,4 @@
1
- import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{$l as n,Bt as r,Gt as i,Kt as a,Qa as o,Rt as s,Ut as c,ao as l,gr as u,ho as d,sr as f}from"./runtime-DpHhg0dl.js";import{t as p}from"./react-CwJFpaho.js";import{Dt as m,Et as h,Tt as g}from"./switch-DgLijJhN.js";import{t as _}from"./compiler-runtime-C4g8XhC5.js";import{dn as ee,fn as te,gn as v,hn as ne,ln as re,mn as ie,pn as ae,un as oe}from"./ChatRightPanel-B62ml3EW.js";import{J as se}from"./ContextHandoffEndpointLabel-BCNMjnEV.js";import{_ as y}from"./SettingsPanels.editor-zrq4ZT2j.js";import{n as ce}from"./editorPreferences-DzxKMQJx.js";import{i as b,n as le,o as x,r as ue}from"./perfInstrumentation-BT27w4tn.js";import{t as S}from"./usePresentationTier-hxB7Yv_Q.js";import{t as de}from"./appearancePreferences-nFx4MHoI.js";import{t as C}from"./useLongPress-CUmLovQ7.js";import{G as fe,J as pe,K as me,V as he,Y as ge,it as _e,q as ve,rt as ye,ut as be}from"./main-DsnAjTqg.js";var xe={name:`square-split-horizontal`,size:24,node:[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3`,key:`saxlbk`}],[`path`,{d:`M8 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3`,key:`m1vog4`}]],aliases:[`split-square-horizontal`]};xe.node;var Se=d(xe),Ce=_(),we=2,Te=1,Ee=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(we,Math.floor(u/e.css.cell.width)),rows:Math.max(Te,Math.floor(l/e.css.cell.height))}}},De=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,w=(e,t)=>{for(var n in t)De(e,n,{get:t[n],enumerable:!0})},T=(e,t,n,r)=>{for(var i=r>1?void 0:r?Oe(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&De(t,n,i),i},E=(e,t)=>(n,r)=>t(n,r,e),ke=`Terminal input`,Ae={get:()=>ke,set:e=>ke=e},je=`Too much output to announce, navigate to rows manually to read`,Me={get:()=>je,set:e=>je=e};function Ne(e){return e.replace(/\r?\n/g,`\r`)}function D(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function Pe(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function Fe(e,t,n,r){e.stopPropagation(),e.clipboardData&&Ie(e.clipboardData.getData(`text/plain`),t,n,r)}function Ie(e,t,n,r){e=Ne(e),e=D(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function Le(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function Re(e,t,n,r,i){Le(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function ze(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Be(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var Ve=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},He=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},Ue=``,We=` `,Ge=class e{constructor(){this.fg=0,this.bg=0,this.extended=new Ke}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Ke=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},O=class e extends Ge{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ke,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?ze(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},qe=`di$target`,Je=`di$dependencies`,Ye=new Map;function Xe(e){return e[Je]||[]}function k(e){if(Ye.has(e))return Ye.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);Ze(t,e,r)};return t._id=e,Ye.set(e,t),t}function Ze(e,t,n){t[qe]===t?t[Je].push({id:e,index:n}):(t[Je]=[{id:e,index:n}],t[qe]=t)}var A=k(`BufferService`),Qe=k(`CoreMouseService`),$e=k(`CoreService`),et=k(`CharsetService`),tt=k(`InstantiationService`),nt=k(`LogService`),j=k(`OptionsService`),rt=k(`OscLinkService`),it=k(`UnicodeService`),at=k(`DecorationService`),ot=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new O,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(c!==-1||n.hasContent(t)){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):st(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};ot=T([E(0,A),E(1,j),E(2,rt)],ot);function st(e,t){if(confirm(`Do you want to navigate to ${t}?
1
+ import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{$l as n,Bt as r,Gt as i,Kt as a,Qa as o,Rt as s,Ut as c,ao as l,gr as u,ho as d,sr as f}from"./runtime-BwHA1GUS.js";import{t as p}from"./react-CwJFpaho.js";import{Dt as m,Et as h,Tt as g}from"./switch-DnpJB2xv.js";import{t as _}from"./compiler-runtime-C4g8XhC5.js";import{dn as ee,fn as te,gn as v,hn as ne,ln as re,mn as ie,pn as ae,un as oe}from"./ChatRightPanel-CygpcJiF.js";import{J as se}from"./ContextHandoffEndpointLabel-CeGDLNA4.js";import{_ as y}from"./SettingsPanels.editor-Dkva9gX_.js";import{n as ce}from"./editorPreferences-D8q1ItMW.js";import{i as b,n as le,o as x,r as ue}from"./perfInstrumentation-BT27w4tn.js";import{t as S}from"./usePresentationTier-hxB7Yv_Q.js";import{t as de}from"./appearancePreferences-nFx4MHoI.js";import{t as C}from"./useLongPress-CUmLovQ7.js";import{G as fe,J as pe,K as me,V as he,Y as ge,it as _e,q as ve,rt as ye,ut as be}from"./main-DAbEANjY.js";var xe={name:`square-split-horizontal`,size:24,node:[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3`,key:`saxlbk`}],[`path`,{d:`M8 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3`,key:`m1vog4`}]],aliases:[`split-square-horizontal`]};xe.node;var Se=d(xe),Ce=_(),we=2,Te=1,Ee=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(we,Math.floor(u/e.css.cell.width)),rows:Math.max(Te,Math.floor(l/e.css.cell.height))}}},De=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,w=(e,t)=>{for(var n in t)De(e,n,{get:t[n],enumerable:!0})},T=(e,t,n,r)=>{for(var i=r>1?void 0:r?Oe(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&De(t,n,i),i},E=(e,t)=>(n,r)=>t(n,r,e),ke=`Terminal input`,Ae={get:()=>ke,set:e=>ke=e},je=`Too much output to announce, navigate to rows manually to read`,Me={get:()=>je,set:e=>je=e};function Ne(e){return e.replace(/\r?\n/g,`\r`)}function D(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function Pe(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function Fe(e,t,n,r){e.stopPropagation(),e.clipboardData&&Ie(e.clipboardData.getData(`text/plain`),t,n,r)}function Ie(e,t,n,r){e=Ne(e),e=D(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function Le(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function Re(e,t,n,r,i){Le(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function ze(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Be(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var Ve=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},He=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},Ue=``,We=` `,Ge=class e{constructor(){this.fg=0,this.bg=0,this.extended=new Ke}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Ke=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},O=class e extends Ge{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ke,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?ze(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},qe=`di$target`,Je=`di$dependencies`,Ye=new Map;function Xe(e){return e[Je]||[]}function k(e){if(Ye.has(e))return Ye.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);Ze(t,e,r)};return t._id=e,Ye.set(e,t),t}function Ze(e,t,n){t[qe]===t?t[Je].push({id:e,index:n}):(t[Je]=[{id:e,index:n}],t[qe]=t)}var A=k(`BufferService`),Qe=k(`CoreMouseService`),$e=k(`CoreService`),et=k(`CharsetService`),tt=k(`InstantiationService`),nt=k(`LogService`),j=k(`OptionsService`),rt=k(`OscLinkService`),it=k(`UnicodeService`),at=k(`DecorationService`),ot=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new O,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(c!==-1||n.hasContent(t)){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):st(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};ot=T([E(0,A),E(1,j),E(2,rt)],ot);function st(e,t){if(confirm(`Do you want to navigate to ${t}?
2
2
 
3
3
  WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var ct=k(`CharSizeService`),lt=k(`CoreBrowserService`),ut=k(`MouseService`),dt=k(`RenderService`),ft=k(`SelectionService`),pt=k(`CharacterJoinerService`),mt=k(`ThemeService`),ht=k(`LinkProviderService`),gt=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?St.isErrorNoTelemetry(e)?new St(e.message+`
4
4
 
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{K as t,Kt as n,Ut as r,Yt as i,an as a,on as o,qt as s}from"./primary-CQh_KHGG.js";import{Aa as c,Il as l,Ll as u,_ as d,b as f,la as p,v as m,y as h}from"./src-DHNjfMxR.js";import{$l as g,Ar as _,Bn as v,En as y,Gn as b,Jn as x,Jr as S,Kn as C,Kr as w,Lr as T,Qr as E,Qt as D,Rt as O,Ul as k,Un as A,Vr as j,Wn as M,Wt as N,Yr as P,_a as F,ao as ee,bi as te,bn as ne,ci as re,dn as ie,do as I,ei as L,fn as ae,fo as oe,go as se,gr as ce,hn as le,ho as R,hu as z,jr as B,ln as ue,mn as de,mo as V,mt as H,oo as fe,or as pe,p as me,pn as he,po as ge,qn as _e,so as ve,sr as ye,ui as be,ut as xe,vn as Se,y as U,yi as Ce}from"./runtime-DpHhg0dl.js";import{t as we}from"./react-CwJFpaho.js";import{Dr as Te,Gt as Ee,J as De,K as Oe,Lr as W,Q as G,Qt as K,X as ke,Y as Ae,Z as je,Zt as Me,br as Ne,cr as Pe,dr as Fe,mr as Ie,qt as Le,ur as Re,wr as ze}from"./switch-DgLijJhN.js";import{t as Be}from"./compiler-runtime-C4g8XhC5.js";import{i as Ve,n as He,t as Ue}from"./tooltip-CsNk2GK1.js";import{t as We}from"./badge-DqZmJa1g.js";import{c as Ge}from"./hostedConnectionCoordinator-BkxMXc2s.js";import{t as Ke}from"./useNavigate-xewFGSmS.js";import{$ as qe,$t as Je,At as Ye,B as Xe,Bt as Ze,C as Qe,Ct as q,D as $e,Dt as et,E as tt,Et as nt,F as rt,Ft as it,G as at,Gt as ot,H as st,Ht as ct,I as lt,It as ut,J as dt,Jt as ft,K as pt,Kt as mt,L as ht,Lt as gt,M as _t,Mt as vt,N as yt,Nt as bt,O as xt,Ot as St,P as Ct,Pt as wt,Q as Tt,Qt as Et,R as Dt,Rt as Ot,S as kt,St as At,T as jt,Tt as Mt,U as Nt,Ut as Pt,V as Ft,Vt as It,W as Lt,Wt as Rt,X as zt,Xt as Bt,Y as Vt,Yt as Ht,Z as Ut,Zt as Wt,_n as Gt,_t as Kt,an as qt,at as Jt,b as Yt,bt as Xt,cn as Zt,ct as Qt,dt as $t,en,et as tn,fn as nn,ft as rn,gt as an,hn as on,ht as sn,in as cn,it as ln,j as un,jt as dn,k as fn,kt as pn,lt as mn,mt as hn,nn as gn,nt as _n,on as vn,ot as yn,pt as bn,q as xn,qt as Sn,rn as Cn,rt as wn,sn as Tn,st as En,tn as Dn,tt as On,ut as kn,v as An,vn as jn,vt as Mn,w as Nn,wt as Pn,x as Fn,xt as In,y as Ln,yn as Rn,yt as zn,z as Bn,zt as Vn}from"./ChatRightPanel-B62ml3EW.js";import{t as Hn}from"./arrow-left-Ce-aUiy1.js";import{t as Un}from"./bot-k1yDQ5mQ.js";import{A as Wn,D as Gn,N as Kn,et as qn,j as Jn}from"./ContextHandoffEndpointLabel-BCNMjnEV.js";import{t as Yn}from"./chevron-right-D3dUAoht.js";import{r as Xn}from"./tokenModePresentation-Bh3mJ9H-.js";import{a as Zn,t as Qn}from"./capabilities-C9OPiefV.js";import{x as $n}from"./SettingsPanels.editor-zrq4ZT2j.js";import{n as er,t as tr}from"./LazyBrowserPanel-ChCZntfd.js";import{t as nr}from"./refresh-cw-DBJIPv7m.js";import{t as rr}from"./save-BFsP9OG2.js";import{t as ir}from"./smartphone-DhBEWfKK.js";import{t as ar}from"./ThreadTerminalDrawer-Bfs5NCNv.js";import{n as or}from"./editorPreferences-DzxKMQJx.js";import{t as sr}from"./unplug-0SZT8Az_.js";import{t as cr}from"./wrench-BDHgkqDa.js";import"./storeSelectors-BFVEGU0F.js";import{t as lr}from"./scroll-area-CxjQJZM9.js";import{i as ur,r as dr,t as fr}from"./alert-DVbwtykC.js";import{n as pr,t as mr}from"./sidebarStatusText-DSeDlb-o.js";import{n as hr}from"./appChrome-B_VWWDFj.js";import{t as gr}from"./useTheme-B441xg4F.js";import{n as _r,r as vr,t as yr}from"./toggle-group-DRIEnEQy.js";import{t as br}from"./toggle-BgR-G8hl.js";import{A as xr,C as Sr,D as Cr,E as wr,M as Tr,N as Er,O as Dr,S as Or,T as kr,_ as Ar,d as jr,et as Mr,g as Nr,h as Pr,j as Fr,k as Ir,m as Lr,mt as Rr,p as zr,ut as Br,v as Vr,w as Hr,x as Ur,y as Wr}from"./main-DsnAjTqg.js";var Gr={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};Gr.node;var Kr=R(Gr),qr={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};qr.node;var Jr=R(qr),Yr={name:`circle-stop`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]],aliases:[`stop-circle`]};Yr.node;var Xr=R(Yr),Zr={name:`columns-2`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]],aliases:[`columns`]};Zr.node;var Qr=R(Zr),$r={name:`disc-3`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M6 12c0-1.7.7-3.2 1.8-4.2`,key:`oqkarx`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M18 12c0 1.7-.7 3.2-1.8 4.2`,key:`1eah9h`}]]};$r.node;var ei=R($r),ti={name:`git-compare`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]};ti.node;var ni=R(ti),ri={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};ri.node;var ii=R(ri),ai={name:`message-square-text`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]};ai.node;var oi=R(ai),si={name:`monitor-off`,size:24,node:[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M17 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 1.184-1.826`,key:`cv7jms`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`path`,{d:`M8.656 3H20a2 2 0 0 1 2 2v10a2 2 0 0 1-.293 1.042`,key:`z8ni2w`}]]};si.node;var ci=R(si),li={name:`panel-right-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]};li.node;var ui=R(li),di={name:`panel-right-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]};di.node;var fi=R(di),pi={name:`panels-top-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]],aliases:[`layout`]};pi.node;var mi=R(pi),hi={name:`pilcrow`,size:24,node:[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]};hi.node;var gi=R(hi),_i={name:`power`,size:24,node:[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]};_i.node;var vi=R(_i),yi={name:`rows-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]],aliases:[`panels-top-bottom`]};yi.node;var bi=R(yi),xi={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};xi.node;var Si=R(xi),Ci={name:`volume-1`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}]]};Ci.node;var wi=R(Ci),Ti={name:`volume-2`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]};Ti.node;var Ei=R(Ti);function Di(e){let t=[...e.messages.map(e=>({kind:`message`,id:`message:${e.id}`,at:e.createdAt,...e.sequence===void 0?{}:{sequence:e.sequence},message:e})),...e.entries.map(e=>({kind:`tool`,id:`tool:${e.id}`,at:e.startedAt??e.createdAt,...e.sequence===void 0?{}:{sequence:e.sequence},tool:e}))],n=t.every(e=>e.sequence!==void 0);return t.toSorted((e,t)=>n&&e.sequence!==void 0&&t.sequence!==void 0&&e.sequence!==t.sequence?e.sequence-t.sequence:e.at.localeCompare(t.at)||e.id.localeCompare(t.id))}var Oi=new Set,ki=null;function Ai(e){Oi.add(e),ki??=requestAnimationFrame(Mi)}function ji(e){Oi.delete(e)&&Oi.size===0&&ki!=null&&(cancelAnimationFrame(ki),ki=null)}function Mi(e){let t=new Set(Oi);Oi.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}ki=Oi.size>0?requestAnimationFrame(Mi):null}function Ni(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function Pi(e,t){let n=e?.theme??Ze,r=t?.theme??Ze,i=Fi(e),a=Fi(t);return nt(n,r)&&Ni(e,t,[`theme`,`parseDiffOptions`])&&Ni(i,a)}function Fi(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}function Ii(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Li({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:a}){let o=n+a*2,s=r?n+i*2:o;if(t=Math.max(t,s),o>=t||r){let n=Math.max(e-i,0),r=Math.min(e+s,t);return{top:n,bottom:Math.max(r,n)}}let c=e+n/2-o/2,l=c+o;return c<0&&(c=0),l>t&&(l=t),c=Math.floor(Math.max(c,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t),c))}}function Ri(){return q({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[Pn({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function zi(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Bi(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}var Vi=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),ji(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||Ii(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;(this.isSelectionDirty()||n||i)&&(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;(this.isSelectionDirty()||r||i)&&(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&Bi(e.composedPath())||(sa(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;(t!==`disabled`||o||n!=null||r!=null||i!=null||a!=null)&&(sa(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(sa(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){sa(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();sa(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);sa(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=Ki(i)&&this.hoveredLine?.lineElement===i.lineElement;Gi(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),Gi(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Ki(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(Ji(i)&&p!=null){p(i);break}if(qi(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!Ki(i))break;Gi(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,sa(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),sa(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),sa(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();Bi(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(zi(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=dn(Ri());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);Wi(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(Zi(t));if(Wi(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(Wi(n)&&(!t||n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(Wi(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&Bi(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=Zi(e);if(t&&Bi(n))return;let r=Qi(e);return r==null?this.pathFromAnnotationSlot(e):Zi(r)}pathFromAnnotationSlot(e){let t=$i(e)?.previousElementSibling;if(t instanceof HTMLElement&&(t.hasAttribute(`data-line`)||t.hasAttribute(`data-column-number`)))return Zi(t);let n=ta(ea(e));if(n==null)return;let r=this.targetForSelectionPoint(n);return r==null?void 0:Zi(r.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=na(t)?t:na(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}Ii(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,Ai(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{ji(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!ia(this.renderedSelectedLinesState,n),i=!ia(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);Yi(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=oa(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=oa(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:Xi(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:Xi(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:aa(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:aa(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Hi({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:Ui({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function Ui({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function Wi(e){return e!=null&&`kind`in e&&e.kind===`line`}function Gi(e){return e!=null&&`kind`in e&&e.kind===`token`}function Ki(e){return Wi(e)||Gi(e)}function qi(e){return`type`in e&&e.type===`line-info`}function Ji(e){return`kind`in e&&e.kind===`merge-conflict-action`}function Yi(e){return e===`current`||e===`incoming`||e===`both`}function Xi(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Zi(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function Qi(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function $i(e){let t=e.closest(`[slot^="annotation-"]`),n=(t instanceof HTMLElement&&t.assignedSlot!=null?t.assignedSlot:e.tagName===`SLOT`?e:void 0)?.closest(`[data-line-annotation]`);return n instanceof HTMLElement?n:void 0}function ea(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function ta(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function na(e){return e!=null&&typeof e.elementFromPoint==`function`}function ra(e,t){return e===t||Ii(e??void 0,t??void 0)}function ia(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&ra(e?.range??null,t.range)}function aa(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function oa(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function sa(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var ca=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),da(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?ma(t):ha(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:la(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:ua(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;(i||a)&&(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&fa(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function la(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function ua(e){return Math.max(Math.ceil(e),0)}function da(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?fa(e,{codeWidthChanged:!0,numberWidthChanged:!0}):pa(e))}function fa(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function pa(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function ma(e){e.codeElement.isConnected&&pa(e)}function ha(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}function ga(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function _a(e){return q({tagName:`div`,children:[q({tagName:`div`,children:e.annotations?.map(e=>q({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function va(e){switch(e){case`file`:return`diffs-icon-file-code`;case`change`:return`diffs-icon-symbol-modified`;case`new`:return`diffs-icon-symbol-added`;case`deleted`:return`diffs-icon-symbol-deleted`;case`rename-pure`:case`rename-changed`:return`diffs-icon-symbol-moved`}}function ya({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return q({tagName:`div`,children:[t===`custom`?q({tagName:`slot`,properties:{name:gt}}):ba({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[xa(r)]],properties:i})}function ba({name:e,prevName:t,iconType:n}){let r=[q({tagName:`slot`,properties:{name:Et}}),Pn({name:va(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(q({tagName:`div`,children:[q({tagName:`bdi`,children:[Mt(t)]})],properties:{"data-prev-name":``}})),r.push(Pn({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(q({tagName:`div`,children:[q({tagName:`bdi`,children:[Mt(e)]})],properties:{"data-title":``}})),r.push(q({tagName:`slot`,properties:{name:Bt}})),q({tagName:`div`,children:r,properties:{"data-header-content":``}})}function xa(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(q({tagName:`span`,children:[Mt(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(q({tagName:`span`,children:[Mt(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(q({tagName:`slot`,properties:{name:Wt}})),q({tagName:`div`,children:t,properties:{"data-metadata":``}})}function Sa(e){return q({tagName:`pre`,properties:Ca(e)})}function Ca({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}function wa(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:Ye(t),preferredHighlighter:n}}function Ta(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function Ea(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}var Da={compositeOverBg:Qt,contrastRatio:mn,deriveMutedFg:kn,hoverWouldEraseText:$t,isDarkSurface:rn,isFullyTransparent:bn,pickReadableForeground:hn,relativeLuminance:sn,surfacesMatch:an};function Oa(e,t){return e?.cacheKey!=null||t?.cacheKey!=null?e?.cacheKey===t?.cacheKey:e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}var ka=`-1,-1`;function Aa(e){return e?.some(e=>e.lineNumber===0)??!1}function ja(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function Ma(e){return e.startingLine===0&&e.totalLines>0}function Na(e,t){return e.endsWith(`\r
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{K as t,Kt as n,Ut as r,Yt as i,an as a,on as o,qt as s}from"./primary-DZjgHvyf.js";import{Aa as c,Il as l,Ll as u,_ as d,b as f,la as p,v as m,y as h}from"./src-C3Y_imaX.js";import{$l as g,Ar as _,Bn as v,En as y,Gn as b,Jn as x,Jr as S,Kn as C,Kr as w,Lr as T,Qr as E,Qt as D,Rt as O,Ul as k,Un as A,Vr as j,Wn as M,Wt as N,Yr as P,_a as F,ao as ee,bi as te,bn as ne,ci as re,dn as ie,do as I,ei as L,fn as ae,fo as oe,go as se,gr as ce,hn as le,ho as R,hu as z,jr as B,ln as ue,mn as de,mo as V,mt as H,oo as fe,or as pe,p as me,pn as he,po as ge,qn as _e,so as ve,sr as ye,ui as be,ut as xe,vn as Se,y as U,yi as Ce}from"./runtime-BwHA1GUS.js";import{t as we}from"./react-CwJFpaho.js";import{Dr as Te,Gt as Ee,J as De,K as Oe,Lr as W,Q as G,Qt as K,X as ke,Y as Ae,Z as je,Zt as Me,br as Ne,cr as Pe,dr as Fe,mr as Ie,qt as Le,ur as Re,wr as ze}from"./switch-DnpJB2xv.js";import{t as Be}from"./compiler-runtime-C4g8XhC5.js";import{i as Ve,n as He,t as Ue}from"./tooltip-BlweKBxc.js";import{t as We}from"./badge-2AZ3HfVS.js";import{c as Ge}from"./hostedConnectionCoordinator-BuRWCvUG.js";import{t as Ke}from"./useNavigate-B8oXtF30.js";import{$ as qe,$t as Je,At as Ye,B as Xe,Bt as Ze,C as Qe,Ct as q,D as $e,Dt as et,E as tt,Et as nt,F as rt,Ft as it,G as at,Gt as ot,H as st,Ht as ct,I as lt,It as ut,J as dt,Jt as ft,K as pt,Kt as mt,L as ht,Lt as gt,M as _t,Mt as vt,N as yt,Nt as bt,O as xt,Ot as St,P as Ct,Pt as wt,Q as Tt,Qt as Et,R as Dt,Rt as Ot,S as kt,St as At,T as jt,Tt as Mt,U as Nt,Ut as Pt,V as Ft,Vt as It,W as Lt,Wt as Rt,X as zt,Xt as Bt,Y as Vt,Yt as Ht,Z as Ut,Zt as Wt,_n as Gt,_t as Kt,an as qt,at as Jt,b as Yt,bt as Xt,cn as Zt,ct as Qt,dt as $t,en,et as tn,fn as nn,ft as rn,gt as an,hn as on,ht as sn,in as cn,it as ln,j as un,jt as dn,k as fn,kt as pn,lt as mn,mt as hn,nn as gn,nt as _n,on as vn,ot as yn,pt as bn,q as xn,qt as Sn,rn as Cn,rt as wn,sn as Tn,st as En,tn as Dn,tt as On,ut as kn,v as An,vn as jn,vt as Mn,w as Nn,wt as Pn,x as Fn,xt as In,y as Ln,yn as Rn,yt as zn,z as Bn,zt as Vn}from"./ChatRightPanel-CygpcJiF.js";import{t as Hn}from"./arrow-left-DUOpzEbP.js";import{t as Un}from"./bot-DxjPA7Bw.js";import{A as Wn,D as Gn,N as Kn,et as qn,j as Jn}from"./ContextHandoffEndpointLabel-CeGDLNA4.js";import{t as Yn}from"./chevron-right-Dsw16yGn.js";import{r as Xn}from"./tokenModePresentation-BkS-mry_.js";import{a as Zn,t as Qn}from"./capabilities-CsHjxjab.js";import{x as $n}from"./SettingsPanels.editor-Dkva9gX_.js";import{n as er,t as tr}from"./LazyBrowserPanel-D4e76vc_.js";import{t as nr}from"./refresh-cw-CgDa2Ok_.js";import{t as rr}from"./save-C8h0AMdl.js";import{t as ir}from"./smartphone-DgVJfbv3.js";import{t as ar}from"./ThreadTerminalDrawer-CPPzQSXN.js";import{n as or}from"./editorPreferences-D8q1ItMW.js";import{t as sr}from"./unplug-B1dczi-t.js";import{t as cr}from"./wrench-7pbbxqrZ.js";import"./storeSelectors-CTDWheMy.js";import{t as lr}from"./scroll-area-7n2X_RLQ.js";import{i as ur,r as dr,t as fr}from"./alert-DQEkrtUJ.js";import{n as pr,t as mr}from"./sidebarStatusText-B4AtFXZo.js";import{n as hr}from"./appChrome-TkWLAGxk.js";import{t as gr}from"./useTheme-B441xg4F.js";import{n as _r,r as vr,t as yr}from"./toggle-group-BhzbQPEQ.js";import{t as br}from"./toggle-D10FsFoE.js";import{A as xr,C as Sr,D as Cr,E as wr,M as Tr,N as Er,O as Dr,S as Or,T as kr,_ as Ar,d as jr,et as Mr,g as Nr,h as Pr,j as Fr,k as Ir,m as Lr,mt as Rr,p as zr,ut as Br,v as Vr,w as Hr,x as Ur,y as Wr}from"./main-DAbEANjY.js";var Gr={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};Gr.node;var Kr=R(Gr),qr={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};qr.node;var Jr=R(qr),Yr={name:`circle-stop`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]],aliases:[`stop-circle`]};Yr.node;var Xr=R(Yr),Zr={name:`columns-2`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]],aliases:[`columns`]};Zr.node;var Qr=R(Zr),$r={name:`disc-3`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M6 12c0-1.7.7-3.2 1.8-4.2`,key:`oqkarx`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M18 12c0 1.7-.7 3.2-1.8 4.2`,key:`1eah9h`}]]};$r.node;var ei=R($r),ti={name:`git-compare`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]};ti.node;var ni=R(ti),ri={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};ri.node;var ii=R(ri),ai={name:`message-square-text`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]};ai.node;var oi=R(ai),si={name:`monitor-off`,size:24,node:[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M17 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 1.184-1.826`,key:`cv7jms`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`path`,{d:`M8.656 3H20a2 2 0 0 1 2 2v10a2 2 0 0 1-.293 1.042`,key:`z8ni2w`}]]};si.node;var ci=R(si),li={name:`panel-right-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]};li.node;var ui=R(li),di={name:`panel-right-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]};di.node;var fi=R(di),pi={name:`panels-top-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]],aliases:[`layout`]};pi.node;var mi=R(pi),hi={name:`pilcrow`,size:24,node:[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]};hi.node;var gi=R(hi),_i={name:`power`,size:24,node:[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]};_i.node;var vi=R(_i),yi={name:`rows-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]],aliases:[`panels-top-bottom`]};yi.node;var bi=R(yi),xi={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};xi.node;var Si=R(xi),Ci={name:`volume-1`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}]]};Ci.node;var wi=R(Ci),Ti={name:`volume-2`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]};Ti.node;var Ei=R(Ti);function Di(e){let t=[...e.messages.map(e=>({kind:`message`,id:`message:${e.id}`,at:e.createdAt,...e.sequence===void 0?{}:{sequence:e.sequence},message:e})),...e.entries.map(e=>({kind:`tool`,id:`tool:${e.id}`,at:e.startedAt??e.createdAt,...e.sequence===void 0?{}:{sequence:e.sequence},tool:e}))],n=t.every(e=>e.sequence!==void 0);return t.toSorted((e,t)=>n&&e.sequence!==void 0&&t.sequence!==void 0&&e.sequence!==t.sequence?e.sequence-t.sequence:e.at.localeCompare(t.at)||e.id.localeCompare(t.id))}var Oi=new Set,ki=null;function Ai(e){Oi.add(e),ki??=requestAnimationFrame(Mi)}function ji(e){Oi.delete(e)&&Oi.size===0&&ki!=null&&(cancelAnimationFrame(ki),ki=null)}function Mi(e){let t=new Set(Oi);Oi.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}ki=Oi.size>0?requestAnimationFrame(Mi):null}function Ni(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function Pi(e,t){let n=e?.theme??Ze,r=t?.theme??Ze,i=Fi(e),a=Fi(t);return nt(n,r)&&Ni(e,t,[`theme`,`parseDiffOptions`])&&Ni(i,a)}function Fi(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}function Ii(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Li({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:a}){let o=n+a*2,s=r?n+i*2:o;if(t=Math.max(t,s),o>=t||r){let n=Math.max(e-i,0),r=Math.min(e+s,t);return{top:n,bottom:Math.max(r,n)}}let c=e+n/2-o/2,l=c+o;return c<0&&(c=0),l>t&&(l=t),c=Math.floor(Math.max(c,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t),c))}}function Ri(){return q({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[Pn({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function zi(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Bi(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}var Vi=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),ji(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||Ii(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;(this.isSelectionDirty()||n||i)&&(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;(this.isSelectionDirty()||r||i)&&(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&Bi(e.composedPath())||(sa(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;(t!==`disabled`||o||n!=null||r!=null||i!=null||a!=null)&&(sa(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(sa(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){sa(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();sa(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);sa(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=Ki(i)&&this.hoveredLine?.lineElement===i.lineElement;Gi(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),Gi(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Ki(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(Ji(i)&&p!=null){p(i);break}if(qi(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!Ki(i))break;Gi(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,sa(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),sa(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),sa(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();Bi(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(zi(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=dn(Ri());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);Wi(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(Zi(t));if(Wi(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(Wi(n)&&(!t||n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(Wi(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&Bi(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=Zi(e);if(t&&Bi(n))return;let r=Qi(e);return r==null?this.pathFromAnnotationSlot(e):Zi(r)}pathFromAnnotationSlot(e){let t=$i(e)?.previousElementSibling;if(t instanceof HTMLElement&&(t.hasAttribute(`data-line`)||t.hasAttribute(`data-column-number`)))return Zi(t);let n=ta(ea(e));if(n==null)return;let r=this.targetForSelectionPoint(n);return r==null?void 0:Zi(r.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=na(t)?t:na(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}Ii(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,Ai(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{ji(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!ia(this.renderedSelectedLinesState,n),i=!ia(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);Yi(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=oa(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=oa(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:Xi(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:Xi(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:aa(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:aa(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Hi({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:Ui({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function Ui({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function Wi(e){return e!=null&&`kind`in e&&e.kind===`line`}function Gi(e){return e!=null&&`kind`in e&&e.kind===`token`}function Ki(e){return Wi(e)||Gi(e)}function qi(e){return`type`in e&&e.type===`line-info`}function Ji(e){return`kind`in e&&e.kind===`merge-conflict-action`}function Yi(e){return e===`current`||e===`incoming`||e===`both`}function Xi(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Zi(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function Qi(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function $i(e){let t=e.closest(`[slot^="annotation-"]`),n=(t instanceof HTMLElement&&t.assignedSlot!=null?t.assignedSlot:e.tagName===`SLOT`?e:void 0)?.closest(`[data-line-annotation]`);return n instanceof HTMLElement?n:void 0}function ea(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function ta(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function na(e){return e!=null&&typeof e.elementFromPoint==`function`}function ra(e,t){return e===t||Ii(e??void 0,t??void 0)}function ia(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&ra(e?.range??null,t.range)}function aa(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function oa(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function sa(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var ca=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),da(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?ma(t):ha(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:la(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:ua(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;(i||a)&&(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&fa(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function la(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function ua(e){return Math.max(Math.ceil(e),0)}function da(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?fa(e,{codeWidthChanged:!0,numberWidthChanged:!0}):pa(e))}function fa(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function pa(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function ma(e){e.codeElement.isConnected&&pa(e)}function ha(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}function ga(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function _a(e){return q({tagName:`div`,children:[q({tagName:`div`,children:e.annotations?.map(e=>q({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function va(e){switch(e){case`file`:return`diffs-icon-file-code`;case`change`:return`diffs-icon-symbol-modified`;case`new`:return`diffs-icon-symbol-added`;case`deleted`:return`diffs-icon-symbol-deleted`;case`rename-pure`:case`rename-changed`:return`diffs-icon-symbol-moved`}}function ya({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return q({tagName:`div`,children:[t===`custom`?q({tagName:`slot`,properties:{name:gt}}):ba({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[xa(r)]],properties:i})}function ba({name:e,prevName:t,iconType:n}){let r=[q({tagName:`slot`,properties:{name:Et}}),Pn({name:va(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(q({tagName:`div`,children:[q({tagName:`bdi`,children:[Mt(t)]})],properties:{"data-prev-name":``}})),r.push(Pn({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(q({tagName:`div`,children:[q({tagName:`bdi`,children:[Mt(e)]})],properties:{"data-title":``}})),r.push(q({tagName:`slot`,properties:{name:Bt}})),q({tagName:`div`,children:r,properties:{"data-header-content":``}})}function xa(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(q({tagName:`span`,children:[Mt(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(q({tagName:`span`,children:[Mt(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(q({tagName:`slot`,properties:{name:Wt}})),q({tagName:`div`,children:t,properties:{"data-metadata":``}})}function Sa(e){return q({tagName:`pre`,properties:Ca(e)})}function Ca({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}function wa(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:Ye(t),preferredHighlighter:n}}function Ta(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function Ea(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}var Da={compositeOverBg:Qt,contrastRatio:mn,deriveMutedFg:kn,hoverWouldEraseText:$t,isDarkSurface:rn,isFullyTransparent:bn,pickReadableForeground:hn,relativeLuminance:sn,surfacesMatch:an};function Oa(e,t){return e?.cacheKey!=null||t?.cacheKey!=null?e?.cacheKey===t?.cacheKey:e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}var ka=`-1,-1`;function Aa(e){return e?.some(e=>e.lineNumber===0)??!1}function ja(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function Ma(e){return e.startingLine===0&&e.totalLines>0}function Na(e,t){return e.endsWith(`\r
2
2
  `)?t+`\r
3
3
  `:e.endsWith(`\r`)?t+`\r`:e.endsWith(`
4
4
  `)?t+`