@p4code/cli 0.8.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (425) hide show
  1. package/dist/{AcpMcpStdioBridge-CfALMbjp.mjs → AcpMcpStdioBridge-DBONIB-w.mjs} +120 -19
  2. package/dist/AcpMcpStdioBridge-D_JnxPWS.mjs +4 -0
  3. package/dist/{Effect-zfMCY1g4.mjs → Effect-BahT0mOQ.mjs} +2 -2
  4. package/dist/bin.mjs +2 -2
  5. package/dist/{binCli-C3s3kGWK.mjs → binCli-C1tFongj.mjs} +7162 -5814
  6. package/dist/claude-history-worker.mjs +1 -1
  7. package/dist/{claudeHistoryWorker-CMjiofbZ.mjs → claudeHistoryWorker-v_0uyLGp.mjs} +2 -2
  8. package/dist/client/.vite/manifest.json +2154 -2122
  9. package/dist/client/assets/{AnimatedHeight-BwS0L5jd.js → AnimatedHeight-PJxVEp27.js} +2 -2
  10. package/dist/client/assets/{AuthSurfaceShell-B5dTwcVl.js → AuthSurfaceShell-BrPHaco9.js} +2 -2
  11. package/dist/client/assets/{CSPContext-B1m61J9R.js → CSPContext-C7uwFl6f.js} +2 -2
  12. package/dist/client/assets/ChatGptUsageButton-7IZqWaQq.js +2 -0
  13. package/dist/client/assets/ChatMarkdown-D3ITm4U-.js +65 -0
  14. package/dist/client/assets/CodexSetupSection.logic-DyTuN6tg.js +2 -0
  15. package/dist/client/assets/{ComboboxClear-CSnbXRcJ.js → ComboboxClear-BXGqqvsR.js} +2 -2
  16. package/dist/client/assets/{CommandBlock-DcgLBXYD.js → CommandBlock-JrUX9e8E.js} +2 -2
  17. package/dist/client/assets/{ComposerPromptEditor-oniaSNnQ.js → ComposerPromptEditor-Ba1dvqDN.js} +56 -56
  18. package/dist/client/assets/{CompositeRoot-ykxKqF8U.js → CompositeRoot-CW06ANMY.js} +2 -2
  19. package/dist/client/assets/{ConnectionStatusDot-BvfbN2Tp.js → ConnectionStatusDot-Cjh57o6i.js} +2 -2
  20. package/dist/client/assets/DevicePanel-zG3feCFw.js +2 -0
  21. package/dist/client/assets/{DeviceSetup-kaQqI-00.js → DeviceSetup-DccRVnjb.js} +2 -2
  22. package/dist/client/assets/{DialogTitle-Cwi7QOum.js → DialogTitle-7tvQYVxE.js} +2 -2
  23. package/dist/client/assets/{DiffCommentAnnotation-CnCPh4ot.js → DiffCommentAnnotation-DDBZcMFv.js} +3 -3
  24. package/dist/client/assets/DiffFileTree-BhSPT6m_.js +2 -0
  25. package/dist/client/assets/DiffPanel-D7QMWq_A.js +2 -0
  26. package/dist/client/assets/{DiffWorkerPoolProvider-C8TyWhmO.js → DiffWorkerPoolProvider-RcplgHGv.js} +3 -3
  27. package/dist/client/assets/{EnvironmentMachineIcon-CBS8TSmT.js → EnvironmentMachineIcon-DMZGa766.js} +2 -2
  28. package/dist/client/assets/{ExpandableText-CWbIeyDn.js → ExpandableText-DfY-qqRW.js} +3 -3
  29. package/dist/client/assets/{FieldControl-CWR3fEt0.js → FieldControl-C9UnFGZn.js} +2 -2
  30. package/dist/client/assets/{FileDiff-BiIVs0i-.js → FileDiff-BXlBWSxx.js} +2 -2
  31. package/dist/client/assets/{FilePreviewPanel-CXgaN8cb.js → FilePreviewPanel-CSKeM-xZ.js} +5 -5
  32. package/dist/client/assets/{FoldedSettingsSection-BimbnaOl.js → FoldedSettingsSection-BJm8ZaTy.js} +2 -2
  33. package/dist/client/assets/{FormContext-DyOeI4sU.js → FormContext-haYZgWIK.js} +2 -2
  34. package/dist/client/assets/{Icons-BlUgSxml.js → Icons-C12feMOO.js} +2 -2
  35. package/dist/client/assets/{KeybindingsSettings.logic-Dfld_XQx.js → KeybindingsSettings.logic-DhXMdk5O.js} +2 -2
  36. package/dist/client/assets/{NoProjectsHero-ZE4gAFj0.js → NoProjectsHero-CDoSxJVV.js} +2 -2
  37. package/dist/client/assets/{PanelLayoutControls-x5a58Pdn.js → PanelLayoutControls-CCKUTh1H.js} +10 -10
  38. package/dist/client/assets/{PierreEntryIcon-DeBbijxO.js → PierreEntryIcon-7x50Pz_C.js} +2 -2
  39. package/dist/client/assets/{PreviewPanel-2vuw0skj.js → PreviewPanel-BEWZuH6o.js} +2 -2
  40. package/dist/client/assets/ProjectDefaultsSettings-BRRQlvgR.js +2 -0
  41. package/dist/client/assets/{ProjectFavicon-BhJj4G_1.js → ProjectFavicon-ExMHrN16.js} +3 -3
  42. package/dist/client/assets/ProjectIconPickerDialog-DXSyEGg8.js +2 -0
  43. package/dist/client/assets/{ProjectMonogram-BgobvHld.js → ProjectMonogram-um8sYqIi.js} +2 -2
  44. package/dist/client/assets/{ProviderAuthTerminal-CJSJcjB9.js → ProviderAuthTerminal-Tw3kH5vc.js} +2 -2
  45. package/dist/client/assets/ProviderModelPicker-CpgHpUCG.js +2 -0
  46. package/dist/client/assets/{ProviderSettingsForm-Dh_vspcE.js → ProviderSettingsForm-CaNO8FYK.js} +2 -2
  47. package/dist/client/assets/{PullRequestCodeTab-Do36z71f.js → PullRequestCodeTab-DwqL4aAJ.js} +3 -3
  48. package/dist/client/assets/{ReadOnlySourcePreview-BfLIaC5x.js → ReadOnlySourcePreview-Cw6lfMjA.js} +2 -2
  49. package/dist/client/assets/{RedactedSensitiveText-D5aX1wQs.js → RedactedSensitiveText-citJBx4E.js} +2 -2
  50. package/dist/client/assets/{RenderErrorBoundary-DTEG6arv.js → RenderErrorBoundary-D21mPr47.js} +2 -2
  51. package/dist/client/assets/ScheduledTasksSettings-BXOG7dPV.js +4 -0
  52. package/dist/client/assets/ScopedSwitch-2MBm4Srn.js +2 -0
  53. package/dist/client/assets/{SettingsPanels-Betza2Al.js → SettingsPanels-DjzXV7Dm.js} +7 -7
  54. package/dist/client/assets/{SettingsPanels.logic-Dn2Jcxyy.js → SettingsPanels.logic-DpdMN_lX.js} +2 -2
  55. package/dist/client/assets/{SettingsScopeNotice-CAaNSKvu.js → SettingsScopeNotice-CdNfxmW3.js} +2 -2
  56. package/dist/client/assets/{T3ConnectAccountPages-DEqOE3hy.js → T3ConnectAccountPages-C6qHq26m.js} +2 -2
  57. package/dist/client/assets/{T3ConnectSidebarSignIn-C4jpzdPh.js → T3ConnectSidebarSignIn-DewmE1PI.js} +2 -2
  58. package/dist/client/assets/ThemeEditorPanel-aEsLfkYx.js +5 -0
  59. package/dist/client/assets/{ThreadTerminalDrawer-Z7ArIuq0.js → ThreadTerminalDrawer-C1NDkTSs.js} +4 -4
  60. package/dist/client/assets/{UsageLimits-7-_nKQT_.js → UsageLimits-BUS51Bjr.js} +2 -2
  61. package/dist/client/assets/{Virtualizer-EvXC5PAR.js → Virtualizer-B2BG0GB9.js} +2 -2
  62. package/dist/client/assets/WorkspaceBreadcrumb-DX3xH6tC.js +2 -0
  63. package/dist/client/assets/WorkspacePageContainer-BFo6qTGJ.js +2 -0
  64. package/dist/client/assets/{WorkspacePageHeader-DB9Z9OtR.js → WorkspacePageHeader-BCZXPSxj.js} +2 -2
  65. package/dist/client/assets/_chat-B3j3XTUJ.js +58 -0
  66. package/dist/client/assets/{_chat.index-CTfxLY4F.js → _chat.index-7o1_qjfU.js} +2 -2
  67. package/dist/client/assets/{_chat.new-B_FNmP8f.js → _chat.new-W2E0MZ4y.js} +3 -3
  68. package/dist/client/assets/_chat.pull-requests-DnQ-MKRG.js +2 -0
  69. package/dist/client/assets/{abnfDiagram-VCTEODGH-Du15a8Yu.js → abnfDiagram-VCTEODGH-DJY5x2uS.js} +2 -2
  70. package/dist/client/assets/{alert-DUQHh6vz.js → alert-yllEf0yh.js} +2 -2
  71. package/dist/client/assets/app-window-D2LBv8RE.js +2 -0
  72. package/dist/client/assets/architecture-7GRP2DOG-nO5xG-8k.js +1 -0
  73. package/dist/client/assets/{architectureDiagram-5GKGNRK7-DhXH9Bsf.js → architectureDiagram-5GKGNRK7-6YiKazHv.js} +2 -2
  74. package/dist/client/assets/arrow-left-yEW5WFYj.js +1 -0
  75. package/dist/client/assets/arrow-right-BzVZfSb7.js +1 -0
  76. package/dist/client/assets/arrow-up-down-DjL7trCL.js +1 -0
  77. package/dist/client/assets/assets-BxSVuao2.js +2 -0
  78. package/dist/client/assets/bell-ue7A6JFg.js +1 -0
  79. package/dist/client/assets/{blockDiagram-I7D4REHJ-CZ4PIO64.js → blockDiagram-I7D4REHJ-D_EURhbV.js} +2 -2
  80. package/dist/client/assets/blocks-De0WwZYY.js +1 -0
  81. package/dist/client/assets/bot-_T9E-nkd.js +1 -0
  82. package/dist/client/assets/brain-CQYem3Oz.js +2 -0
  83. package/dist/client/assets/{browserHistoryStore-D6A_83JY.js → browserHistoryStore-B-t3Vc_Z.js} +2 -2
  84. package/dist/client/assets/{browserLinkTarget-BuFHp5RQ.js → browserLinkTarget-CiQS1wUg.js} +2 -2
  85. package/dist/client/assets/{c4Diagram-7LVT6UL2-tMXW_Jy8.js → c4Diagram-7LVT6UL2-CmfPrrIj.js} +2 -2
  86. package/dist/client/assets/calendar-clock-DXFNSdXM.js +1 -0
  87. package/dist/client/assets/channel-BE0ymtNV.js +2 -0
  88. package/dist/client/assets/chart-no-axes-column-Dx_cyfN9.js +1 -0
  89. package/dist/client/assets/checkbox-CIeee0-J.js +2 -0
  90. package/dist/client/assets/chromium-BusoCgri.js +2 -0
  91. package/dist/client/assets/{chunk-4HAMMTFA-gISFFADw.js → chunk-4HAMMTFA-BdvKUuii.js} +2 -2
  92. package/dist/client/assets/{chunk-75Z2AOVW-iWd1WVXJ.js → chunk-75Z2AOVW-DXz8BlJz.js} +2 -2
  93. package/dist/client/assets/{chunk-DU6HZSFF-hD69jU_T.js → chunk-DU6HZSFF-ebFBoLTT.js} +2 -2
  94. package/dist/client/assets/{chunk-F27PBJKO-DnDFIjHp.js → chunk-F27PBJKO-B1MlVcaX.js} +2 -2
  95. package/dist/client/assets/{chunk-GMAD6QVW-Chr0sR5B.js → chunk-GMAD6QVW-CEXqem_-.js} +2 -2
  96. package/dist/client/assets/{chunk-GVQU2GXP-D84Xc6Vy.js → chunk-GVQU2GXP-wsgr7T0u.js} +2 -2
  97. package/dist/client/assets/{chunk-IMKFNOWR-DOdemMNR.js → chunk-IMKFNOWR-Daxc_3WP.js} +2 -2
  98. package/dist/client/assets/{chunk-L3NEJ4N5-CILnb7VE.js → chunk-L3NEJ4N5-C4NnipZ0.js} +2 -2
  99. package/dist/client/assets/{chunk-OSK3NFVY-Bxpu9Oo4.js → chunk-OSK3NFVY-DDd2Ay5_.js} +2 -2
  100. package/dist/client/assets/{chunk-P2QGCYS3-75l6wJUu.js → chunk-P2QGCYS3-I9iEYMEJ.js} +2 -2
  101. package/dist/client/assets/{chunk-POPQ4Y6H-jYZ1RdM0.js → chunk-POPQ4Y6H-Cgwl0wkZ.js} +2 -2
  102. package/dist/client/assets/{chunk-PWAF6VOD-DtONZJrC.js → chunk-PWAF6VOD-kBB0Jquc.js} +2 -2
  103. package/dist/client/assets/{chunk-SHT3W25Y-NY6-WqgC.js → chunk-SHT3W25Y-gtUoMWd0.js} +2 -2
  104. package/dist/client/assets/{chunk-SVP7TREG-CGG6Z85U.js → chunk-SVP7TREG-CbL5vJ0z.js} +2 -2
  105. package/dist/client/assets/{chunk-TICWLB2K-DzB7PtXF.js → chunk-TICWLB2K-CMgrptzc.js} +2 -2
  106. package/dist/client/assets/classDiagram-ZZMXUADV-YRduSbl9.js +2 -0
  107. package/dist/client/assets/classDiagram-v2-VYDZK3BY-YRduSbl9.js +2 -0
  108. package/dist/client/assets/{collapsible-CLujF6F7.js → collapsible-C3qenpEI.js} +2 -2
  109. package/dist/client/assets/{color-picker-BG3Rpy98.js → color-picker-Cj2frYnP.js} +2 -2
  110. package/dist/client/assets/{combobox-Cx4FP7Bk.js → combobox-DixSlhgy.js} +2 -2
  111. package/dist/client/assets/{command-CVKxjYiJ.js → command-B45LRbFT.js} +2 -2
  112. package/dist/client/assets/{connect-DeTNO4tO.js → connect-CYM5DIkv.js} +2 -2
  113. package/dist/client/assets/{connect-agent-CTLxG7lp.js → connect-agent-nn3QLMb4.js} +2 -2
  114. package/dist/client/assets/corner-left-up-DohBMTTI.js +1 -0
  115. package/dist/client/assets/{cynefin-OW5HDTMX-C3y7gjYM.js → cynefin-OW5HDTMX-CmLjrFzm.js} +1 -1
  116. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-DEFegOUv.js → cynefinDiagram-5FMLGOSQ-xQBevUIj.js} +2 -2
  117. package/dist/client/assets/{dagre-GXQ25YYZ-C3YHw-ZL.js → dagre-GXQ25YYZ-Ck8BwJaT.js} +2 -2
  118. package/dist/client/assets/device-BRhRKysY.js +2 -0
  119. package/dist/client/assets/{diagram-S7CK7UJ4-B04fDyJ1.js → diagram-S7CK7UJ4-Bl0e661x.js} +2 -2
  120. package/dist/client/assets/{diagram-UQ7AKVKN-DJ5yQdqn.js → diagram-UQ7AKVKN-TO9a3uQI.js} +2 -2
  121. package/dist/client/assets/{diagram-VSXAHHWV-DwQn4LJH.js → diagram-VSXAHHWV-BZ7xQ8wz.js} +2 -2
  122. package/dist/client/assets/{diagram-VX7I27RA-BFeEJB2L.js → diagram-VX7I27RA-C4cA30qa.js} +2 -2
  123. package/dist/client/assets/{diagram-Z3DM3KII-DjNPPgna.js → diagram-Z3DM3KII-Hl3MmqeP.js} +2 -2
  124. package/dist/client/assets/{dialog-BBidAZq_.js → dialog-DhJeevKt.js} +2 -2
  125. package/dist/client/assets/{diffRendering-BcgWZBc6.js → diffRendering-QVeYVRDU.js} +2 -2
  126. package/dist/client/assets/{discovery-list-BOhsy2yk.js → discovery-list-VoilmsP7.js} +2 -2
  127. package/dist/client/assets/{dist-D-bAcBTo.js → dist-CxgL3edJ.js} +3 -3
  128. package/dist/client/assets/download-B587khDU.js +1 -0
  129. package/dist/client/assets/{draft-input-Dk-JXf0v.js → draft-input-BrEXLyuj.js} +2 -2
  130. package/dist/client/assets/{duoViewer-DELDCd_3.js → duoViewer-D-_bD3-L.js} +2 -2
  131. package/dist/client/assets/dynamic-R3OtJZHK.js +3 -0
  132. package/dist/client/assets/earth-26IFbzWm.js +1 -0
  133. package/dist/client/assets/{ebnfDiagram-PWID7BFC-R_zFp3Q4.js → ebnfDiagram-PWID7BFC-Bo_ALmgV.js} +2 -2
  134. package/dist/client/assets/ellipsis-BScTTB_n.js +1 -0
  135. package/dist/client/assets/{embeddedScripts-S6heIv6s.js → embeddedScripts-DKKE5k7D.js} +2 -2
  136. package/dist/client/assets/{empty-B3wHlMsI.js → empty-uoiaKPHo.js} +2 -2
  137. package/dist/client/assets/entities-DNKDCsf2.js +2 -0
  138. package/dist/client/assets/{erDiagram-RLTQ6QDP-DgSVOlTI.js → erDiagram-RLTQ6QDP-B38FLl2U.js} +2 -2
  139. package/dist/client/assets/eventmodeling-NTZA5JFV-6XFarcvj.js +1 -0
  140. package/dist/client/assets/eye-DTlv8Vet.js +1 -0
  141. package/dist/client/assets/file-search-gFHOfI6S.js +1 -0
  142. package/dist/client/assets/{fileLinks-M_i1pQMr.js → fileLinks-VfyxNu8P.js} +2 -2
  143. package/dist/client/assets/{fileTreeExpansion-BoH-LpwD.js → fileTreeExpansion-BfMZMaRV.js} +2 -2
  144. package/dist/client/assets/flowDiagram-HODETNUW-DQXavjl4.js +1 -0
  145. package/dist/client/assets/fold-vertical-BNQMJ6gu.js +1 -0
  146. package/dist/client/assets/folder-git-2-6ON-nxul.js +1 -0
  147. package/dist/client/assets/folder-open-Rja0vZjv.js +1 -0
  148. package/dist/client/assets/folder-plus-CfJ5c8wa.js +1 -0
  149. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-CsDp8eOV.js → ganttDiagram-EL5Y4UJY-Cj0Kstgh.js} +2 -2
  150. package/dist/client/assets/{getDiffFileInput-y6l8uCrc.js → getDiffFileInput-XUe1xsym.js} +2 -2
  151. package/dist/client/assets/git-branch-BuWXMpmq.js +1 -0
  152. package/dist/client/assets/{gitGraph-4MIJSDKK-ByZ8Ddcu.js → gitGraph-4MIJSDKK-C84uaaYZ.js} +1 -1
  153. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-QkPoZOxP.js → gitGraphDiagram-WWUBYQGX-CvyimLfZ.js} +2 -2
  154. package/dist/client/assets/grip-vertical-qjSy6wXX.js +1 -0
  155. package/dist/client/assets/{guideRunStore-Ca6LGvkb.js → guideRunStore-DwmmS8D0.js} +2 -2
  156. package/dist/client/assets/hard-drive-DAxFba08.js +1 -0
  157. package/dist/client/assets/history-CrY611k2.js +1 -0
  158. package/dist/client/assets/house-CKS51Vx8.js +1 -0
  159. package/dist/client/assets/{htmlRender-Bs_dTcPz.js → htmlRender-DRfZ8nFp.js} +2 -2
  160. package/dist/client/assets/index-G0rP4C-v.js +3 -0
  161. package/dist/client/assets/{info-A6RAGUB7-DWgAQmsU.js → info-A6RAGUB7-AXJa674d.js} +1 -1
  162. package/dist/client/assets/{infoDiagram-27XIBGKW-DqBsTg-0.js → infoDiagram-27XIBGKW-CgaIIar7.js} +2 -2
  163. package/dist/client/assets/{input-group-13zF6rZl.js → input-group-DIOgVvbV.js} +2 -2
  164. package/dist/client/assets/{input-BOT1WFGI.js → input-u5qjnfMr.js} +2 -2
  165. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DhvmZSIn.js → ishikawaDiagram-5VMMS53U-DSDzMD_t.js} +2 -2
  166. package/dist/client/assets/{journeyDiagram-3NMN7TZE-sBAsW8ZW.js → journeyDiagram-3NMN7TZE-Be6o5a7O.js} +2 -2
  167. package/dist/client/assets/{kanban-definition-UXKFOSKX-7pB8050L.js → kanban-definition-UXKFOSKX-Fpr0ne16.js} +2 -2
  168. package/dist/client/assets/kbd-D4mDfHPa.js +2 -0
  169. package/dist/client/assets/{keybindings-B4uuYLfE.js → keybindings-CzL-fWkh.js} +2 -2
  170. package/dist/client/assets/keyboard-Y7zJXIRo.js +1 -0
  171. package/dist/client/assets/{lazyRouteComponent-C2UuNVTE.js → lazyRouteComponent-dLOOuQ-r.js} +2 -2
  172. package/dist/client/assets/{line-CYcVbD9r.js → line-BXhbrPh0.js} +2 -2
  173. package/dist/client/assets/link-CbhoiCa8.js +1 -0
  174. package/dist/client/assets/{link-DnyZixWB.js → link-YLDgrmSN.js} +2 -2
  175. package/dist/client/assets/{linkedPrompt-Cjzkkr18.js → linkedPrompt-E32o3H76.js} +2 -2
  176. package/dist/client/assets/list-Cq4wtMwR.js +1 -0
  177. package/dist/client/assets/main-D9nJEeym.css +2 -0
  178. package/dist/client/assets/main-D9z9rMK1.js +27 -0
  179. package/dist/client/assets/{mediaReference-DCRMHOD7.js → mediaReference-C-grVzJf.js} +2 -2
  180. package/dist/client/assets/{mediaSource-C-YyAgza.js → mediaSource-CxVHZYDj.js} +2 -2
  181. package/dist/client/assets/{mermaid-parser.core-CUhkd3Km.js → mermaid-parser.core-BFPy42Wg.js} +4 -4
  182. package/dist/client/assets/{mermaid.core-7L34oYGP.js → mermaid.core-zK2u82e-.js} +5 -5
  183. package/dist/client/assets/message-circle-question-mark-BwzHSg4C.js +1 -0
  184. package/dist/client/assets/message-square-DcSgYDZ6.js +1 -0
  185. package/dist/client/assets/message-square-dashed-Cu56tC0F.js +1 -0
  186. package/dist/client/assets/{mindmap-definition-YA3MSWOX-CpfzOIsM.js → mindmap-definition-YA3MSWOX-RzkTvFrT.js} +2 -2
  187. package/dist/client/assets/mouse-pointer-2-DxhF1Woc.js +1 -0
  188. package/dist/client/assets/number-field-BLz8W5SU.js +2 -0
  189. package/dist/client/assets/{observeResize-CK9qVTLF.js → observeResize-WQaFQjbx.js} +2 -2
  190. package/dist/client/assets/{onboarding-DWVdcMTo.js → onboarding-DNafmm6s.js} +2 -2
  191. package/dist/client/assets/{openFileInPreview-DsWLDsnf.js → openFileInPreview-l6IXWIxV.js} +2 -2
  192. package/dist/client/assets/{p4ProjectFile-DVeZFEli.js → p4ProjectFile-BzCYJ8I-.js} +2 -2
  193. package/dist/client/assets/{packet-AYTQ26CC-TJIgXg7Z.js → packet-AYTQ26CC-rDYSbNWh.js} +1 -1
  194. package/dist/client/assets/{pair-Ds7MhGzA.js → pair-nG9A6oxp.js} +2 -2
  195. package/dist/client/assets/palette-B79srcx1.js +1 -0
  196. package/dist/client/assets/panel-left-Bp59PK2R.js +1 -0
  197. package/dist/client/assets/{panel-tab-close-button-CeVf2Cp1.js → panel-tab-close-button-B2GW1bDy.js} +2 -2
  198. package/dist/client/assets/panels-top-left-CC3HCiIs.js +1 -0
  199. package/dist/client/assets/{pegDiagram-XKGWAZYB-BWjyJv0r.js → pegDiagram-XKGWAZYB-8wodyYDi.js} +2 -2
  200. package/dist/client/assets/{phoneViewer-4yzlTfRU.js → phoneViewer-Bei8FsYJ.js} +2 -2
  201. package/dist/client/assets/{pie-WAS4IAKB-DI1xrBNC.js → pie-WAS4IAKB-Ce0_zpeP.js} +1 -1
  202. package/dist/client/assets/{pieDiagram-E7YTZNPT-D5BJ4dMD.js → pieDiagram-E7YTZNPT-C3QJYWCY.js} +2 -2
  203. package/dist/client/assets/{pierre-icons-C4_Is1e6.js → pierre-icons-CsjmRq9p.js} +2 -2
  204. package/dist/client/assets/popover-6BYEGLLK.js +2 -0
  205. package/dist/client/assets/{preview-BXSjnvc2.js → preview-BpTu6A2K.js} +2 -2
  206. package/dist/client/assets/{preview-ChiUlq6M.js → preview-DFDpDpup.js} +2 -2
  207. package/dist/client/assets/{previewMiniPlayerStore-BWBB4WZZ.js → previewMiniPlayerStore-BfMwexwO.js} +2 -2
  208. package/dist/client/assets/primary-Cc8Am8Ju.js +2 -0
  209. package/dist/client/assets/primaryCloudLinkState-N7pLty-_.js +2 -0
  210. package/dist/client/assets/{projectFilesQueryState-DLmHVuBp.js → projectFilesQueryState-CrGsc81w.js} +2 -2
  211. package/dist/client/assets/projectScriptEditor-RR3KkKhh.js +2 -0
  212. package/dist/client/assets/{pullRequestDetail.logic-CiIqeGLs.js → pullRequestDetail.logic-CE7fVOsp.js} +4 -4
  213. package/dist/client/assets/{pullRequestReviewStore-Ckm9o--D.js → pullRequestReviewStore-BHEIYvsP.js} +2 -2
  214. package/dist/client/assets/pullRequests-KhjrMCa0.js +2 -0
  215. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-USH3mFeD.js → quadrantDiagram-AXDQQJYC-Cqx4Dcqi.js} +2 -2
  216. package/dist/client/assets/queries-Cn1FJB1_.js +2 -0
  217. package/dist/client/assets/{query-DG-FU00d.js → query-CK8MOmXr.js} +2 -2
  218. package/dist/client/assets/{radar-RG4KPBEZ-BgwqseQY.js → radar-RG4KPBEZ-DsccxBWq.js} +1 -1
  219. package/dist/client/assets/radio-group-CM6Ra-QS.js +2 -0
  220. package/dist/client/assets/{railroad-74A4TZTK-lU1hozFq.js → railroad-74A4TZTK-B-UN2mSQ.js} +1 -1
  221. package/dist/client/assets/railroad-abnf-HS5TGJTU-CIxA0Vp4.js +1 -0
  222. package/dist/client/assets/railroad-ebnf-LZEXJU2U-Czs81Kdn.js +1 -0
  223. package/dist/client/assets/railroad-peg-WCYAUIDC-B7O8OPsa.js +1 -0
  224. package/dist/client/assets/{railroadDiagram-O6MQD6OU-BX2DBjFX.js → railroadDiagram-O6MQD6OU-B_PdDy5r.js} +2 -2
  225. package/dist/client/assets/{renderScheduler-e5LS9_r8.js → renderScheduler-D1ml_j--.js} +2 -2
  226. package/dist/client/assets/{requirementDiagram-BXWQKSXE-Bp2BwkCA.js → requirementDiagram-BXWQKSXE-CKZ6HpQu.js} +2 -2
  227. package/dist/client/assets/{rightPanelStore-Dnc28mSJ.js → rightPanelStore-6LLb3GY0.js} +2 -2
  228. package/dist/client/assets/rotate-ccw-dcahmZQ2.js +1 -0
  229. package/dist/client/assets/rotate-cw-CIep6yNT.js +1 -0
  230. package/dist/client/assets/runtime-BVgeNXTV.js +2 -0
  231. package/dist/client/assets/runtime-CCr9UADV.js +6 -0
  232. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-BklNNjEB.js → sankeyDiagram-P5KCCOFB-BLF-VPcj.js} +2 -2
  233. package/dist/client/assets/scheduledTasksSettings.logic-ozIaTRfT.js +3 -0
  234. package/dist/client/assets/{scroll-area-Cj3OF_L_.js → scroll-area-CsrtHuL8.js} +2 -2
  235. package/dist/client/assets/{select-BDMo6Fqt.js → select-BiARKKgd.js} +2 -2
  236. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-ufTHSg4p.js → sequenceDiagram-WJ2MYXX4-BpJGkNAx.js} +2 -2
  237. package/dist/client/assets/{server-DNo9AqHW.js → server-B26doYv6.js} +2 -2
  238. package/dist/client/assets/session-CQXL-cTI.js +2 -0
  239. package/dist/client/assets/session-logic-C0mrkZ0j.js +13 -0
  240. package/dist/client/assets/settings-2-C2dIdVBr.js +1 -0
  241. package/dist/client/assets/{settings-DxGY3RT5.js → settings-B5Dj0jhP.js} +2 -2
  242. package/dist/client/assets/settings-DiBtchmK.js +1 -0
  243. package/dist/client/assets/settings.appearance-Di8HZa2Q.js +2 -0
  244. package/dist/client/assets/settings.archived-By34XjbG.js +2 -0
  245. package/dist/client/assets/settings.computer-use-DuW-mXPO.js +2 -0
  246. package/dist/client/assets/settings.connections-BJuKrJhl.js +2 -0
  247. package/dist/client/assets/settings.decisions-BO8hfyYm.js +2 -0
  248. package/dist/client/assets/{settings.diagnostics-ByUhN_HC.js → settings.diagnostics-DSw1QN-I.js} +2 -2
  249. package/dist/client/assets/settings.general-RyWWgxqp.js +2 -0
  250. package/dist/client/assets/settings.integrations--N8SMmw7.js +2 -0
  251. package/dist/client/assets/{settings.keybindings-CITYXalz.js → settings.keybindings-BeQmUtKv.js} +2 -2
  252. package/dist/client/assets/{settings.open-source-licenses-CTznEYnQ.js → settings.open-source-licenses-BmgFSigO.js} +2 -2
  253. package/dist/client/assets/settings.projects--jLA2A5b.js +4 -0
  254. package/dist/client/assets/settings.providers-Cvt1-bmr.js +3 -0
  255. package/dist/client/assets/settings.scheduled-tasks-D5IG4nj_.js +2 -0
  256. package/dist/client/assets/settings.snap-shot-CUZNOX9M.js +2 -0
  257. package/dist/client/assets/{settings.source-control-BlHoYUC0.js → settings.source-control-R63Z9kEM.js} +2 -2
  258. package/dist/client/assets/{settings.storage-C4lRhJsq.js → settings.storage-J1kthey9.js} +2 -2
  259. package/dist/client/assets/settingsLayout-BzyY4qHt.js +3 -0
  260. package/dist/client/assets/shield-question-mark-l31p7uuJ.js +1 -0
  261. package/dist/client/assets/{sidebar-Bulbb3cX.js → sidebar-Dj0htG-5.js} +2 -2
  262. package/dist/client/assets/{sidebarProjectGrouping-DEvzxecx.js → sidebarProjectGrouping-DxzT7QCQ.js} +2 -2
  263. package/dist/client/assets/{skeleton-BFPHmDcq.js → skeleton-CtSxs1y1.js} +2 -2
  264. package/dist/client/assets/{sortable.esm-CHiRbsvI.js → sortable.esm-n8ce5zjO.js} +2 -2
  265. package/dist/client/assets/{sourceControl-DfhPxa0l.js → sourceControl-C3RSledt.js} +2 -2
  266. package/dist/client/assets/{spinner-rP6J82Of.js → spinner-BXr4m38K.js} +2 -2
  267. package/dist/client/assets/square-pen-CxvvUOOt.js +1 -0
  268. package/dist/client/assets/{standalone-page-BkHTM3MP.js → standalone-page-DSQDdNcR.js} +2 -2
  269. package/dist/client/assets/{stateDiagram-D77RDMKH-UnviM1_a.js → stateDiagram-D77RDMKH-DFGb4Fx3.js} +2 -2
  270. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-BFcRJjAO.js +2 -0
  271. package/dist/client/assets/{swimlanes-42K2YHIH-CpD6LDbC.js → swimlanes-42K2YHIH-D0z9osG6.js} +2 -2
  272. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-B7z2b1Qv.js +9 -0
  273. package/dist/client/assets/{terminalSessions-C9u_KQdo.js → terminalSessions-3aynRXX1.js} +2 -2
  274. package/dist/client/assets/text-search-DsadxNJw.js +1 -0
  275. package/dist/client/assets/{textarea-D7qN_9_U.js → textarea-DZLyhzuZ.js} +2 -2
  276. package/dist/client/assets/{themePalette-au2ZXbqB.js → themePalette-BZeqG2Hu.js} +3 -3
  277. package/dist/client/assets/threadSort-BvhI6zOp.js +2 -0
  278. package/dist/client/assets/{timeline-definition-24CTP7MA-CNy-4Mtq.js → timeline-definition-24CTP7MA-oHM5IS4i.js} +2 -2
  279. package/dist/client/assets/toast-Bm36EaG6.js +2 -0
  280. package/dist/client/assets/{toggle-4i71sOFB.js → toggle-BzIEPTf7.js} +2 -2
  281. package/dist/client/assets/{toggle-group-BtpeJU3C.js → toggle-group-_C7nJPTT.js} +2 -2
  282. package/dist/client/assets/tooltip-Df-4YKs5.js +2 -0
  283. package/dist/client/assets/{treeView-Q6P3EWNA-fz73DkUg.js → treeView-Q6P3EWNA-ONHv8oqx.js} +1 -1
  284. package/dist/client/assets/{treemap-WGGIJYW6-CHp0lk61.js → treemap-WGGIJYW6-Go2hwkyn.js} +1 -1
  285. package/dist/client/assets/unfold-vertical--twzQtvn.js +1 -0
  286. package/dist/client/assets/{usage-BoYlRHNx.js → usage-B26GT0RK.js} +2 -2
  287. package/dist/client/assets/{usageAccess-BmfDNhp2.js → usageAccess-BNLOTFbF.js} +2 -2
  288. package/dist/client/assets/{usageFormat-DdjdHqj5.js → usageFormat-DKCO_wk0.js} +2 -2
  289. package/dist/client/assets/{usageShortcuts-RpypNfqZ.js → usageShortcuts-DxLRXv0W.js} +2 -2
  290. package/dist/client/assets/{use-atom-command-Bc7LgQy1.js → use-atom-command-CiEeUGsC.js} +2 -2
  291. package/dist/client/assets/{useAriaLabelledBy-B_3SmrJo.js → useAriaLabelledBy-CJjXf8Fd.js} +2 -2
  292. package/dist/client/assets/useHandleNewThread-DTz3ztCG.js +2 -0
  293. package/dist/client/assets/{useLocation-DaTcl6iI.js → useLocation-9axGTsrg.js} +2 -2
  294. package/dist/client/assets/useNavigate-BK_XZ1It.js +2 -0
  295. package/dist/client/assets/{useNavigateBack-C43_t49N.js → useNavigateBack-AIHPN0Oo.js} +2 -2
  296. package/dist/client/assets/{useParams-s9hrFQQQ.js → useParams-CCV3vN4E.js} +2 -2
  297. package/dist/client/assets/{usePermissionStatus-CCpQkKk1.js → usePermissionStatus-BnBF7CdE.js} +2 -2
  298. package/dist/client/assets/usePullRequestActions-aKrHzIiJ.js +3 -0
  299. package/dist/client/assets/{useRegisterFieldControl-BVraoamc.js → useRegisterFieldControl-Daf1iBkI.js} +2 -2
  300. package/dist/client/assets/useScopedModelAvailability-IKTxpeQL.js +2 -0
  301. package/dist/client/assets/useSettings-CckatJFa.js +3 -0
  302. package/dist/client/assets/{useT3ConnectAuthPrompt-D3ARnr92.js → useT3ConnectAuthPrompt-CK8il-7e.js} +2 -2
  303. package/dist/client/assets/utils-DmS758az.js +37 -0
  304. package/dist/client/assets/vcsRefInvalidation-lkYjTxah.js +2 -0
  305. package/dist/client/assets/{vennDiagram-4TSXK5OY-BBpGz6rf.js → vennDiagram-4TSXK5OY-BwVRZPOj.js} +2 -2
  306. package/dist/client/assets/{wardley-WFR3VGLG-M4Al1qCV.js → wardley-WFR3VGLG-CYl4h3U-.js} +1 -1
  307. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-V-_mOkU8.js → wardleyDiagram-VM6X3IG4-yHMYVGhg.js} +2 -2
  308. package/dist/client/assets/{welcome-Bok5fRqT.js → welcome-CGBWwWzE.js} +2 -2
  309. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-CZOR99Bj.js → xychartDiagram-S5SC5T6Z-Td7MQ_xN.js} +2 -2
  310. package/dist/client/index.html +1 -1
  311. package/package.json +1 -1
  312. package/dist/AcpMcpStdioBridge-Ch5bMyss.mjs +0 -4
  313. package/dist/client/assets/ChatGptUsageButton-GxPReM3u.js +0 -2
  314. package/dist/client/assets/ChatMarkdown-DOdrk8tK.js +0 -65
  315. package/dist/client/assets/CodexSetupSection.logic-BpefaM8S.js +0 -2
  316. package/dist/client/assets/DevicePanel-wE6eEt9P.js +0 -2
  317. package/dist/client/assets/DiffFileTree-D3P47wbG.js +0 -2
  318. package/dist/client/assets/DiffPanel-cvlTVhB4.js +0 -2
  319. package/dist/client/assets/ProjectDefaultsSettings-Cu80XFdb.js +0 -2
  320. package/dist/client/assets/ProjectIconPickerDialog-Dwmv78OH.js +0 -2
  321. package/dist/client/assets/ProviderModelPicker-riIGf-PI.js +0 -2
  322. package/dist/client/assets/ScheduledTasksSettings-Cp8h_lNS.js +0 -4
  323. package/dist/client/assets/ScopedSwitch-CLAFXjj6.js +0 -2
  324. package/dist/client/assets/ThemeEditorPanel-BBkly3jP.js +0 -5
  325. package/dist/client/assets/WorkspaceBreadcrumb-fx0ZD7ay.js +0 -2
  326. package/dist/client/assets/WorkspacePageContainer-DFsaHi02.js +0 -2
  327. package/dist/client/assets/_chat-BerxDjpp.js +0 -58
  328. package/dist/client/assets/_chat.pull-requests-BwpBKnt3.js +0 -2
  329. package/dist/client/assets/app-window-CVIo0C1R.js +0 -2
  330. package/dist/client/assets/architecture-7GRP2DOG-CT4QCEL3.js +0 -1
  331. package/dist/client/assets/arrow-left-BiKrB-pT.js +0 -1
  332. package/dist/client/assets/arrow-right-DWAwZU0q.js +0 -1
  333. package/dist/client/assets/arrow-up-down-CfYH5v22.js +0 -1
  334. package/dist/client/assets/assets-DwywdbuJ.js +0 -2
  335. package/dist/client/assets/bell-C3RUvq1T.js +0 -1
  336. package/dist/client/assets/blocks-CoLUV11Q.js +0 -1
  337. package/dist/client/assets/bot-CjcO3F5G.js +0 -1
  338. package/dist/client/assets/brain-B_3rxsLd.js +0 -2
  339. package/dist/client/assets/calendar-clock-CJyS1C-x.js +0 -1
  340. package/dist/client/assets/channel-kQEwHVv9.js +0 -2
  341. package/dist/client/assets/chart-no-axes-column-B3ZqbY05.js +0 -1
  342. package/dist/client/assets/checkbox-Cw_SXlJ5.js +0 -2
  343. package/dist/client/assets/chromium-CvI58Z0o.js +0 -2
  344. package/dist/client/assets/classDiagram-ZZMXUADV-BO_GIPO1.js +0 -2
  345. package/dist/client/assets/classDiagram-v2-VYDZK3BY-BO_GIPO1.js +0 -2
  346. package/dist/client/assets/corner-left-up-D653FjvK.js +0 -1
  347. package/dist/client/assets/device-DrIICsXu.js +0 -2
  348. package/dist/client/assets/download-CNXPbBhc.js +0 -1
  349. package/dist/client/assets/dynamic-BRlOHH6g.js +0 -3
  350. package/dist/client/assets/earth-C1f0Qxwi.js +0 -1
  351. package/dist/client/assets/ellipsis-0J7zX441.js +0 -1
  352. package/dist/client/assets/entities-yblphBg3.js +0 -2
  353. package/dist/client/assets/eventmodeling-NTZA5JFV-bjJqzJYE.js +0 -1
  354. package/dist/client/assets/eye-CmsLgU-5.js +0 -1
  355. package/dist/client/assets/file-search-ClaIV60V.js +0 -1
  356. package/dist/client/assets/flowDiagram-HODETNUW-CsPXFMK4.js +0 -1
  357. package/dist/client/assets/fold-vertical-BMLbHh0a.js +0 -2
  358. package/dist/client/assets/folder-git-2-BxqGR5ht.js +0 -2
  359. package/dist/client/assets/folder-open-gQZmKQ4n.js +0 -1
  360. package/dist/client/assets/folder-plus-BVmedEeH.js +0 -1
  361. package/dist/client/assets/git-branch-Ba9jLbPu.js +0 -1
  362. package/dist/client/assets/grip-vertical-BmIJSASv.js +0 -1
  363. package/dist/client/assets/hard-drive-hWUfbbG9.js +0 -1
  364. package/dist/client/assets/history-jvN7Bdkc.js +0 -1
  365. package/dist/client/assets/house-ozmwce4p.js +0 -1
  366. package/dist/client/assets/index-FZqrCEhr.js +0 -3
  367. package/dist/client/assets/kbd-BR8-VeaN.js +0 -2
  368. package/dist/client/assets/keyboard-_YjrW4PX.js +0 -1
  369. package/dist/client/assets/link-BcMcYjHb.js +0 -1
  370. package/dist/client/assets/list-DEjg_Q5H.js +0 -1
  371. package/dist/client/assets/main-BQLZB-ZD.css +0 -2
  372. package/dist/client/assets/main-Ch0n0whg.js +0 -26
  373. package/dist/client/assets/message-circle-question-mark-DzWFFMDp.js +0 -1
  374. package/dist/client/assets/message-square-BqGKFtP8.js +0 -1
  375. package/dist/client/assets/message-square-dashed-FPkUUYSB.js +0 -1
  376. package/dist/client/assets/mouse-pointer-2-DbBU41il.js +0 -2
  377. package/dist/client/assets/number-field-DsVu9T6C.js +0 -2
  378. package/dist/client/assets/palette-JCVMAFVd.js +0 -1
  379. package/dist/client/assets/panel-left-STqObAvQ.js +0 -1
  380. package/dist/client/assets/panels-top-left-B90U_rdS.js +0 -1
  381. package/dist/client/assets/popover-UOfX8iZ4.js +0 -2
  382. package/dist/client/assets/primary-BubJSDIO.js +0 -2
  383. package/dist/client/assets/primaryCloudLinkState-CFnZkCiA.js +0 -2
  384. package/dist/client/assets/projectScriptEditor-_TwHfcHY.js +0 -2
  385. package/dist/client/assets/pullRequests-C0Gr2876.js +0 -2
  386. package/dist/client/assets/queries-DbiotSzd.js +0 -2
  387. package/dist/client/assets/radio-group-DhxCP5q0.js +0 -2
  388. package/dist/client/assets/railroad-abnf-HS5TGJTU-DRzBu_EH.js +0 -1
  389. package/dist/client/assets/railroad-ebnf-LZEXJU2U-BuQh-rCG.js +0 -1
  390. package/dist/client/assets/railroad-peg-WCYAUIDC-DH1f3-__.js +0 -1
  391. package/dist/client/assets/rotate-ccw-98iN1bsB.js +0 -1
  392. package/dist/client/assets/rotate-cw-DdW3sRx4.js +0 -1
  393. package/dist/client/assets/runtime-BUB2ex14.js +0 -2
  394. package/dist/client/assets/runtime-BoEmkhOe.js +0 -6
  395. package/dist/client/assets/scheduledTasksSettings.logic-Bk1lq8Ri.js +0 -3
  396. package/dist/client/assets/session-CyPECDtf.js +0 -2
  397. package/dist/client/assets/session-logic-BBZj8pNB.js +0 -13
  398. package/dist/client/assets/settings-2-C-KVP40_.js +0 -1
  399. package/dist/client/assets/settings-D62zpRkD.js +0 -1
  400. package/dist/client/assets/settings.appearance-C-MzWdtB.js +0 -2
  401. package/dist/client/assets/settings.archived-BZ0wU-2j.js +0 -2
  402. package/dist/client/assets/settings.connections-B-h_wi7q.js +0 -2
  403. package/dist/client/assets/settings.general-DodDmaXX.js +0 -2
  404. package/dist/client/assets/settings.integrations-Dq9yt9c-.js +0 -2
  405. package/dist/client/assets/settings.projects-Bj9oI9dE.js +0 -4
  406. package/dist/client/assets/settings.providers-BPb4TbH8.js +0 -3
  407. package/dist/client/assets/settings.scheduled-tasks-TxnTVd7r.js +0 -2
  408. package/dist/client/assets/settings.snap-shot-DZaxUAEE.js +0 -2
  409. package/dist/client/assets/settingsLayout-De_r3pyr.js +0 -3
  410. package/dist/client/assets/shield-question-mark-B5w7j5aC.js +0 -1
  411. package/dist/client/assets/square-pen-DYBPSam-.js +0 -1
  412. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CJW4DyfF.js +0 -2
  413. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-Buz7ig8b.js +0 -9
  414. package/dist/client/assets/text-search-DrO_MCzY.js +0 -1
  415. package/dist/client/assets/threadSort-R2JvSO3D.js +0 -2
  416. package/dist/client/assets/toast-CIGvRti2.js +0 -2
  417. package/dist/client/assets/tooltip-Ciaezkl4.js +0 -2
  418. package/dist/client/assets/unfold-vertical-BLnEY4R7.js +0 -2
  419. package/dist/client/assets/useHandleNewThread-Csguf2GC.js +0 -2
  420. package/dist/client/assets/useNavigate-CnhAAl0Z.js +0 -2
  421. package/dist/client/assets/usePullRequestActions-CiF7znkV.js +0 -3
  422. package/dist/client/assets/useScopedModelAvailability-kFNRNx2C.js +0 -2
  423. package/dist/client/assets/useSettings-CNd8OM7A.js +0 -3
  424. package/dist/client/assets/utils-geC9CGP4.js +0 -37
  425. package/dist/client/assets/vcsRefInvalidation-DMpp-BNA.js +0 -2
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,Gn as r,Go as i,Ic as a,If as o,Jn as s,Lo as c,Nm as l,Sx as u,Uo as d,Vm as f,Vo as p,Wb as m,Wn as h,Xn as g,Zm as _,_h as v,_s as y,ar as b,er as x,hs as S,lm as C,ma as w,ms as T,or as E,sr as D,t as O,wh as k}from"./utils-geC9CGP4.js";import{t as A}from"./chevron-down-DHV04o66.js";import{t as j}from"./circle-alert-B83jEPoh.js";import{t as M}from"./info-BHB-83EA.js";import{t as N}from"./plus-Cr075-cy.js";import{t as P}from"./sliders-horizontal-lg5XUMZM.js";import{t as F}from"./x-CSwbgjBe.js";import{I,K as L,U as R,z}from"./runtime-BoEmkhOe.js";import{a as ee,n as B,t as V}from"./tooltip-Ciaezkl4.js";import{a as te,c as ne,o as re,s as ie,t as ae}from"./select-BDMo6Fqt.js";import{t as oe}from"./useNavigateBack-C43_t49N.js";import{rt as se}from"./useSettings-CNd8OM7A.js";import{f as H,s as ce}from"./server-DNo9AqHW.js";import{n as le,t as U}from"./session-CyPECDtf.js";import{t as ue}from"./use-atom-command-Bc7LgQy1.js";import{a as de,c as fe,d as W,f as G,i as pe,l as K,n as me,o as he,r as q,s as J,t as Y,u as ge}from"./usageFormat-DdjdHqj5.js";import{t as _e}from"./env-wK1YYxA8.js";import{t as X}from"./skeleton-BFPHmDcq.js";import{n as ve,t as ye}from"./toggle-group-BtpeJU3C.js";import{t as be}from"./input-BOT1WFGI.js";import{t as xe}from"./scroll-area-Cj3OF_L_.js";import{a as Se,c as Ce,i as we,o as Te,r as Ee,s as De,t as Oe}from"./dialog-BBidAZq_.js";import{o as ke}from"./sidebar-Bulbb3cX.js";import{t as Ae}from"./observeResize-CK9qVTLF.js";import{v as je}from"./keybindings-B4uuYLfE.js";import{i as Me,o as Ne,t as Pe}from"./popover-UOfX8iZ4.js";import{t as Fe}from"./WorkspacePageContainer-DFsaHi02.js";import{n as Ie,r as Le,t as Re}from"./usageShortcuts-RpypNfqZ.js";import{b as ze,t as Be,y as Ve}from"./ChatGptUsageButton-GxPReM3u.js";import{Pa as He,Pi as Ue,Ur as We,ln as Ge,qa as Ke}from"./main-Ch0n0whg.js";import{t as qe}from"./WorkspacePageHeader-DB9Z9OtR.js";import{i as Je,n as Ye,r as Xe,t as Ze}from"./WorkspaceBreadcrumb-fx0ZD7ay.js";import{a as Qe,i as $e,o as et,r as tt}from"./UsageLimits-7-_nKQT_.js";import{t as nt}from"./usageAccess-BmfDNhp2.js";var Z=e(t(),1),Q=u(),rt=v(L);function it(e,t){return e?.sources.some(e=>e.action===`enableCursorKeychain`)===!0&&t?.some(e=>e.driver===`cursor`&&e.status===`ready`)===!0}function at(e){return e.some(e=>e.summary?.sources.some(e=>e.fingerprint.provider===`cursor`&&e.fingerprint.hostId===`cursor.com`))?[]:e.filter(e=>e.needsCursorKeychainAccess)}var ot=new Map,st=new Map;async function ct(e,t,n=!1,r=!1){let i=st.get(e);if(i!==void 0){if(r){try{await i}catch{}return ct(e,t,!1,!0)}return n?void 0:await i}let a=ot.get(e)??0;if(n&&Date.now()<a)return;let o=Promise.resolve().then(t).finally(()=>{st.delete(e),ot.set(e,Date.now()+3e5)});return st.set(e,o),await o}async function lt({registry:e,server:t,presentations:n,environmentIds:r,input:i}){await Promise.all(r.map(async r=>{let a=t.usageSummary({environmentId:r,input:i}),o=n.presentationAtom(r),s=new AbortController,c=()=>{e.get(o)?.connection.phase!==`connected`&&s.abort()},l=e.subscribe(o,c);c();try{let n=await z(e,t.refreshUsageRates,{environmentId:r,input:{}},{reportFailure:!1}),i=n._tag===`Failure`&&rt(R(n));if(e.refresh(a),i||s.signal.aborted)return;await I(e,a,{reportFailure:!1,signal:s.signal})}finally{l()}}))}function ut(e,t=!1){let{summary:n}=e;if(!e.isConnected||e.error!==null)return{phase:`inactive`};if(n===null)return{phase:`loading`};if(t)return{phase:`stale`};if(!e.isPending)return{phase:`ready`};let r=[...new Set(n.sources.flatMap(e=>e.refreshing?[e.fingerprint.provider]:[]))];return r.length>0?{phase:`partway`,providers:r}:{phase:`stale`}}function dt(e,t){return e.length===1?`Updating ${t(e[0])}…`:`Updating ${e.length} providers…`}function ft(e,t=!1){let n=new Set,r=!1;for(let i of e){let e=ut(i,t);if((e.phase===`loading`||e.phase===`stale`)&&(r=!0),e.phase===`partway`)for(let t of e.providers)n.add(t)}return{partial:r||n.size>0,everyProvider:r,providers:n}}function pt(e){return e.records>0&&e.unpricedRecords>=e.records}function mt(e){return[e.hostId,e.provider,e.resolvedHomePath,e.volumeId].join(` `)}function ht(e,t){let n=e.sources.filter(e=>e.fingerprint.provider===t.fingerprint.provider);return e.buckets.filter(e=>e.provider===t.fingerprint.provider&&(e.sourcePath===t.fingerprint.resolvedHomePath||e.sourcePath===void 0&&n.length===1))}function gt(e){return JSON.stringify([e.day,e.hourStart??null,e.provider,e.model])}function _t(e){let t=new Map,n=new Map,r=new Map,i=new Map,a=new Map,o=[],s=[...e].sort((e,t)=>(Date.parse(t.summary.readAt)||0)-(Date.parse(e.summary.readAt)||0)||e.environmentId.localeCompare(t.environmentId));for(let e of[`ok`,`partial`,`failed`])for(let r of s)for(let i of r.summary.sources){if(i.status!==e)continue;let s=mt(i.fingerprint);if(t.has(s)){o.push(`${r.label}: ${i.fingerprint.resolvedHomePath}`);continue}t.set(s,r.environmentId),n.set(s,{environment:r,source:i}),a.set(s,i.distinctSessions)}for(let e of s)for(let t of e.summary.sources){if(t.status!==`partial`)continue;let o=mt(t.fingerprint),s=n.get(o);if(s?.source.status!==`ok`||Date.parse(e.summary.readAt)<=Date.parse(s.environment.summary.readAt))continue;let c=r.get(o);c===void 0&&(c=new Set(ht(s.environment.summary,s.source).map(gt)),r.set(o,c));let l=i.get(e.environmentId)??new Set,u=!1;for(let n of ht(e.summary,t)){let e=gt(n);c.has(e)||(c.add(e),l.add(n),u=!0)}u&&(i.set(e.environmentId,l),a.set(o,Math.max(a.get(o)??0,t.distinctSessions)))}return{ownerByFingerprint:t,supplementalBucketsByEnvironment:i,sessionsByFingerprint:a,duplicates:o}}function vt(e,t,n,r){let i=new Set,a=new Set,o=new Map;for(let n of e.summary.sources){if(n.status===`missing`)continue;let s=mt(n.fingerprint);if(t.get(s)===e.environmentId){let e=n.fingerprint.provider;i.add(e),a.add(`${e}\u0000${n.fingerprint.resolvedHomePath}`),o.set(e,(o.get(e)??0)+(r.get(s)??n.distinctSessions))}}return{buckets:e.summary.buckets.filter(e=>n.has(e)||(e.sourcePath===void 0?i.has(e.provider):a.has(`${e.provider}\u0000${e.sourcePath}`))),sessionsByProvider:o}}function yt(e){return e.totals.uncachedInputTokens+e.totals.cachedInputTokens+e.totals.cacheCreationTokens+e.totals.outputTokens}function bt(e,t){return e>=4&&e<=t}var xt={costUsd:0,uncachedInputTokens:0,cachedInputTokens:0,cacheCreationTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,records:0,sessions:0,providers:[],models:[],daily:[],hourly:[],costQuality:{providerReportedShare:0,modelPricedShare:0,unpricedShare:0,cacheSavingsUsd:0},categoryCost:{input:0,cacheRead:0,cacheWrite:0,output:0,unsplit:0},speedCost:{standard:0,fast:0,ultrafast:0,premium:0},duplicateSources:[],contributingEnvironments:[],contractMismatches:[]};function St(e,t){if(e.length===0)return xt;let n=[],r=[];for(let i of e)bt(i.summary.contractVersion,t)?n.push(i):r.push({environmentId:i.environmentId,direction:i.summary.contractVersion<t?`serverBehind`:`clientBehind`,contractVersion:i.summary.contractVersion});let{ownerByFingerprint:i,supplementalBucketsByEnvironment:a,sessionsByFingerprint:o,duplicates:s}=_t(n),c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y={input:0,cacheRead:0,cacheWrite:0,output:0},b={fast:0,ultrafast:0,premium:0},x=new Map,S=new Map,C=new Map,w=new Map,T=[];for(let e of n){let{buckets:t,sessionsByProvider:n}=vt(e,i,a.get(e.environmentId)??new Set,o);t.length>0&&T.push(e.environmentId);for(let[e,t]of n){if(h+=t,t===0)continue;let n=x.get(e)??{costUsd:0,totalTokens:0,records:0,sessions:0};n.sessions+=t,x.set(e,n)}for(let e of t){let t=yt(e);c+=e.costUsd,g+=e.cacheSavingsUsd,l+=e.totals.uncachedInputTokens,u+=e.totals.cachedInputTokens,d+=e.totals.cacheCreationTokens,f+=e.totals.outputTokens,p+=e.totals.reasoningTokens,m+=e.records,v+=e.unpricedRecords,e.costSource===`providerReported`&&(_+=e.records),e.categoryCostUsd!==void 0&&(y.input+=e.categoryCostUsd.input,y.cacheRead+=e.categoryCostUsd.cacheRead,y.cacheWrite+=e.categoryCostUsd.cacheWrite,y.output+=e.categoryCostUsd.output),b.fast+=e.fastCostUsd??0,b.ultrafast+=e.ultrafastCostUsd??0,b.premium+=e.speedPremiumUsd??0;let n=x.get(e.provider)??{costUsd:0,totalTokens:0,records:0,sessions:0};n.costUsd+=e.costUsd,n.totalTokens+=t,n.records+=e.records,x.set(e.provider,n);let r=`${e.provider} ${e.model}`,i=S.get(r)??{provider:e.provider,costUsd:0,totalTokens:0,tokens:{uncachedInputTokens:0,cachedInputTokens:0,cacheCreationTokens:0,outputTokens:0,reasoningTokens:0},records:0,unpricedRecords:0,unpricedTokens:0};i.costUsd+=e.costUsd,i.totalTokens+=t,i.tokens={uncachedInputTokens:i.tokens.uncachedInputTokens+e.totals.uncachedInputTokens,cachedInputTokens:i.tokens.cachedInputTokens+e.totals.cachedInputTokens,cacheCreationTokens:i.tokens.cacheCreationTokens+e.totals.cacheCreationTokens,outputTokens:i.tokens.outputTokens+e.totals.outputTokens,reasoningTokens:i.tokens.reasoningTokens+e.totals.reasoningTokens},i.records+=e.records,i.unpricedRecords+=e.unpricedRecords,e.records>0&&(i.unpricedTokens+=t*e.unpricedRecords/e.records),S.set(r,i);let a=C.get(e.day)??{costUsd:0,totalTokens:0,byProvider:new Map};a.costUsd+=e.costUsd,a.totalTokens+=t;let o=a.byProvider.get(e.provider)??{costUsd:0,totalTokens:0};if(o.costUsd+=e.costUsd,o.totalTokens+=t,a.byProvider.set(e.provider,o),C.set(e.day,a),e.hourStart!==void 0){let n=w.get(e.hourStart)??{day:e.day,hourStart:e.hourStart,costUsd:0,totalTokens:0,byProvider:new Map};n.costUsd+=e.costUsd,n.totalTokens+=t;let r=n.byProvider.get(e.provider)??{costUsd:0,totalTokens:0};r.costUsd+=e.costUsd,r.totalTokens+=t,n.byProvider.set(e.provider,r),w.set(e.hourStart,n)}}}let E=l+u+d+f,D=[...x.entries()].map(([e,t])=>({provider:e,costUsd:t.costUsd,totalTokens:t.totalTokens,records:t.records,sessions:t.sessions,costShare:c===0?0:t.costUsd/c,tokenShare:E===0?0:t.totalTokens/E})).sort((e,t)=>t.costUsd-e.costUsd),O=[...S.entries()].map(([e,t])=>({model:e.slice(e.indexOf(` `)+1),provider:t.provider,costUsd:t.costUsd,totalTokens:t.totalTokens,tokens:t.tokens,records:t.records,unpricedRecords:t.unpricedRecords,unpricedTokens:t.unpricedTokens,costShare:c===0?0:t.costUsd/c,tokenShare:E===0?0:t.totalTokens/E})).sort((e,t)=>t.costUsd-e.costUsd||t.totalTokens-e.totalTokens),k=[...C.entries()].map(([e,t])=>({day:e,costUsd:t.costUsd,totalTokens:t.totalTokens,byProvider:t.byProvider})).sort((e,t)=>e.day.localeCompare(t.day)),A=[...w.values()].sort((e,t)=>e.hourStart.localeCompare(t.hourStart));return{costUsd:c,uncachedInputTokens:l,cachedInputTokens:u,cacheCreationTokens:d,outputTokens:f,reasoningTokens:p,totalTokens:E,records:m,sessions:h,providers:D,models:O,daily:k,hourly:A,costQuality:{providerReportedShare:m===0?0:_/m,unpricedShare:m===0?0:v/m,modelPricedShare:m===0?0:(m-_-v)/m,cacheSavingsUsd:g},categoryCost:{...y,unsplit:Math.max(0,c-y.input-y.cacheRead-y.cacheWrite-y.output)},speedCost:{...b,standard:Math.max(0,c-b.fast-b.ultrafast)},duplicateSources:s,contributingEnvironments:T,contractMismatches:r}}var Ct=d(e=>i(t=>{let n=JSON.parse(e),r=t(se.presentationsAtom),i=[];for(let[e,a]of r){let r=a.connection.phase===`connected`,o=t(U.sessionStateAtom(e)),s=nt({connectionPhase:a.connection.phase,session:m(T(o)),hasSessionError:o._tag===`Failure`});if(!s.canReadDiagnostics){i.push({environmentId:e,label:a.entry.target.label,isConnected:r,...s,summary:null,needsCursorKeychainAccess:!1});continue}let c=t(H.usageSummary({environmentId:e,input:n})),l=m(T(c));i.push({environmentId:e,label:a.entry.target.label,isPending:c.waiting,canReadDiagnostics:!0,isConnected:r,error:c._tag===`Failure`?`This environment could not report usage.`:null,summary:l,needsCursorKeychainAccess:it(l,t(H.providersValueAtom(e)))})}return i}).pipe(n(`web-usage:window:${e}`)));function wt(e,t){return St(e.flatMap(({environmentId:e,label:n,summary:r})=>r===null?[]:[{environmentId:e,label:n,summary:t===void 0?r:{...r,buckets:r.buckets.filter(t)}}]),6)}var Tt=new Set;function Et(e,t){return t.size===0?e:e.map(e=>e.summary===null?e:{...e,summary:{...e.summary,buckets:e.summary.buckets.filter(e=>!t.has(e.provider)),sources:e.summary.sources.filter(e=>!t.has(e.fingerprint.provider))}})}function Dt(e,t,n){let r=(0,Q.c)(36),i=t===void 0?null:t,a=n===void 0?Tt:n,o;r[0]!==e.resolution||r[1]!==e.sinceDay||r[2]!==e.sinceTime||r[3]!==e.timeZone||r[4]!==e.untilDay||r[5]!==e.untilTime?(o=JSON.stringify({sinceDay:e.sinceDay,untilDay:e.untilDay,timeZone:e.timeZone,resolution:e.resolution,sinceTime:e.sinceTime,untilTime:e.untilTime}),r[0]=e.resolution,r[1]=e.sinceDay,r[2]=e.sinceTime,r[3]=e.timeZone,r[4]=e.untilDay,r[5]=e.untilTime,r[6]=o):o=r[6];let s=o,l;r[7]===s?l=r[8]:(l=Ct(s),r[7]=s,r[8]=l);let u=p(l),d;r[9]!==u||r[10]!==i?(d=i===null?u:u.filter(e=>i.has(e.environmentId)),r[9]=u,r[10]=i,r[11]=d):d=r[11];let f=d,m;r[12]!==f||r[13]!==s?(m=e=>lt({registry:c,server:H,presentations:se,environmentIds:f.filter(jt).map(At),input:e??JSON.parse(s)}),r[12]=f,r[13]=s,r[14]=m):m=r[14];let h=m,g;r[15]!==a||r[16]!==f?(g=wt(Et(f,a)),r[15]=a,r[16]=f,r[17]=g):g=r[17];let _=g,v;r[18]===f?v=r[19]:(v=f.filter(kt),r[18]=f,r[19]=v);let y=v.length,b;r[20]===f?b=r[21]:(b=f.filter(Ot),r[20]=f,r[21]=b);let x=b.length,S=y===0&&x>0,[C,w]=(0,Z.useState)(null);y>0&&(C?.merged!==_||C.window!==e||C.selection!==i||C.hidden!==a)&&w({window:e,merged:_,selection:i,hidden:a});let T=C?.selection===i&&C.hidden===a?C:null,E;r[22]!==y||r[23]!==e||r[24]!==S||r[25]!==T||r[26]!==_?(E=y>0?{window:e,merged:_}:T??(S?null:{window:e,merged:_}),r[22]=y,r[23]=e,r[24]=S,r[25]=T,r[26]=_,r[27]=E):E=r[27];let D=E,O=y>0&&x>0,k;return r[28]!==u||r[29]!==S||r[30]!==_||r[31]!==h||r[32]!==f||r[33]!==D||r[34]!==O?(k={merged:_,environments:u,selectedEnvironments:f,isPending:S,shown:D,isPartial:O,refresh:h},r[28]=u,r[29]=S,r[30]=_,r[31]=h,r[32]=f,r[33]=D,r[34]=O,r[35]=k):k=r[35],k}function Ot(e){return e.summary===null&&e.error===null}function kt(e){return e.summary!==null}function At(e){let{environmentId:t}=e;return t}function jt(e){return e.canReadDiagnostics&&le(e.environmentId,`diagnostics:read`)}var $=e(w(),1);function Mt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=O(`w-full caption-bottom text-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,$.jsx)(`table`,{"data-slot":`table`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Nt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=O(`[&_tr]:border-b`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`thead`,{"data-slot":`table-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Pt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=O(`[&_tr:last-child]:border-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`tbody`,{"data-slot":`table-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ft(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=O(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`tr`,{"data-slot":`table-row`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function It(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=O(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`th`,{"data-slot":`table-head`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Lt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=O(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`td`,{"data-slot":`table-cell`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Rt=[{key:`inputCostPerMillionTokens`,label:`Input`,optional:!1},{key:`outputCostPerMillionTokens`,label:`Output`,optional:!1},{key:`cacheReadCostPerMillionTokens`,label:`Cache read`,optional:!0},{key:`cacheWriteCostPerMillionTokens`,label:`Cache write`,optional:!0}];function zt(e=``,t){return{model:e,inputCostPerMillionTokens:t?.inputCostPerMillionTokens.toString()??``,outputCostPerMillionTokens:t?.outputCostPerMillionTokens.toString()??``,cacheReadCostPerMillionTokens:t?.cacheReadCostPerMillionTokens?.toString()??``,cacheWriteCostPerMillionTokens:t?.cacheWriteCostPerMillionTokens?.toString()??``}}function Bt(e){let t=e.model.trim();if(t.length===0)return null;let n={};for(let t of Rt){let r=e[t.key].trim();if(r===``){if(t.optional)continue;return null}if(!/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(r))return null;let i=Number(r);if(!Number.isFinite(i)||i<0)return null;n[t.key]=i}return n.inputCostPerMillionTokens===void 0||n.outputCostPerMillionTokens===void 0?null:{model:t,price:{inputCostPerMillionTokens:n.inputCostPerMillionTokens,outputCostPerMillionTokens:n.outputCostPerMillionTokens,...n.cacheReadCostPerMillionTokens===void 0?{}:{cacheReadCostPerMillionTokens:n.cacheReadCostPerMillionTokens},...n.cacheWriteCostPerMillionTokens===void 0?{}:{cacheWriteCostPerMillionTokens:n.cacheWriteCostPerMillionTokens}}}}function Vt(e){return e.isNew&&e.model.trim()===``&&(e.alias??``).trim()===``&&Object.values(e.values).every(e=>e.trim()===``)}function Ht(e,t){return e.prices&&Object.hasOwn(e.prices,t)?e.prices[t]:void 0}function Ut(e,t){return e.aliases&&Object.hasOwn(e.aliases,t)?e.aliases[t]:void 0}function Wt(e,t){if(e.some(e=>e.aliases===null))return{value:``,placeholder:`Unavailable`};let n=e.map(e=>Ut(e,t)??``);return n.some(e=>e!==n[0])?{value:``,placeholder:`Mixed`}:{value:n[0]??``,placeholder:`None`}}function Gt(e,t,n){let r=Rt.find(e=>e.key===n).optional,i=e.map(e=>Ht(e,t)?zt(t,Ht(e,t))[n]:null);return e.some(e=>e.prices===null)?{value:``,placeholder:`Unavailable`}:i.some(e=>e!==i[0])?{value:``,placeholder:`Mixed`}:{value:i[0]??``,placeholder:i[0]===null?`Automatic`:r?`Input rate`:`0.00`}}function Kt(e,t){let n=[],r=new Map;for(let i of t){if(Vt(i))continue;let t=i.model.trim(),a=Ut(e,t);if(i.removed){Ht(e,t)&&n.push({model:t,price:null}),a!==void 0&&n.push({model:t,alias:null});continue}let o=(i.alias??a??``).trim();if(o!==``){t===``?r.set(i.id,`Enter a model ID.`):o===t?r.set(i.id,`Map to a different model.`):(o!==a&&n.push({model:t,alias:o}),Ht(e,t)&&n.push({model:t,price:null}));continue}if(a!==void 0&&(n.push({model:t,alias:null}),!Ht(e,t)&&Object.values(i.values).every(e=>e.trim()===``)))continue;let s=zt(t,Ht(e,t)),c={...s,...i.values},l=Bt(c);if(l===null){let n=Rt.find(e=>!e.optional&&c[e.key].trim()===``);r.set(i.id,t===``?`Enter a model ID.`:n?`${n.label} is required on ${e.label}.`:`Use non-negative numbers for prices.`);continue}let u=zt(t,l.price);Rt.some(e=>s[e.key]!==u[e.key])&&n.push(l)}return{changes:n,errors:r}}function qt(e,t){return new Map(e.filter(e=>e.unavailable===null&&e.prices!==null).flatMap(e=>[...Kt(e,t).errors]))}async function Jt(e){await Promise.all(e.targets.map(async t=>{let n,r=e.changes.get(t.environmentId)??[],i=r.flatMap(e=>`price`in e?[[e.model,e.price]]:[]),a=r.flatMap(e=>`alias`in e?[[e.model,e.alias]]:[]);if(t.unavailable!==null)n={status:`failed`,error:t.unavailable};else if(a.length>0&&t.aliases===null)n={status:`failed`,error:`Update server to map models`};else try{n=(r.length===0?{_tag:`Success`}:await e.write({environmentId:t.environmentId,input:{patch:{...i.length>0?{usagePriceOverrides:Object.fromEntries(i)}:{},...a.length>0?{usageModelAliases:Object.fromEntries(a)}:{}}}}))._tag===`Success`?{status:`saved`}:{status:`failed`,error:`Could not save. Try again.`}}catch{n={status:`failed`,error:`Could not save. Try again.`}}e.onResult(t.environmentId,n)}))}var Yt=i(e=>[...e(se.presentationsAtom)].map(([t,n])=>{let r=e(H.settingsValueAtom(t)),i=e(U.sessionStateAtom(t)),a=m(T(i)),s=i._tag===`Failure`?`denied`:a===null?i.waiting?`pending`:`denied`:o(a,`settings:write`)?`granted`:`denied`;return{environmentId:t,label:n.entry.target.label,prices:r?.usagePriceOverrides??null,aliases:n.serverConfig?.environment.capabilities.usageModelAliases===!0?r?.usageModelAliases??null:null,unavailable:n.connection.phase===`connected`?r===null?`Prices not loaded`:n.serverConfig?.environment.capabilities.usagePriceOverrides===!0?s===`pending`?`Checking permissions…`:s===`denied`?`Read-only access`:null:`Update server to edit prices`:`Offline`}}));function Xt(e){let t=(0,Q.c)(119),{usage:n,initialSelectedEnvironmentIds:i,initialModel:a,onOpenChange:o}=e,s=p(Yt),[c,l]=(0,Z.useState)(i),u;if(t[0]!==s||t[1]!==c){let e;t[3]===c?e=t[4]:(e=e=>c===null||c.has(e.environmentId),t[3]=c,t[4]=e),u=s.filter(e),t[0]=s,t[1]=c,t[2]=u}else u=t[2];let d=u,f;t[5]!==a||t[6]!==d?(f=()=>a===void 0||d.some(e=>Object.hasOwn(e.prices??{},a)||Object.hasOwn(e.aliases??{},a))?[]:[{id:`new:initial`,model:a,isNew:!0,values:{}}],t[5]=a,t[6]=d,t[7]=f):f=t[7];let[m,_]=(0,Z.useState)(f),[v,y]=(0,Z.useState)(!1),[S,C]=(0,Z.useState)(null),w=(0,Z.useRef)(null),T=(0,Z.useRef)(0),D;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(D={reportFailure:!1},t[8]=D):D=t[8];let k=ue(H.updateSettings,D),j,M,P,I,L,R,z,te,ne,re,ie,ae,oe,se,ce;if(t[9]!==S||t[10]!==m||t[11]!==s||t[12]!==o||t[13]!==v||t[14]!==d||t[15]!==c||t[16]!==k||t[17]!==n){let e=[...new Set(d.flatMap(mn))].sort(),i;t[33]===d?i=t[34]:(i=e=>d.some(t=>t.environmentId===e.environmentId),t[33]=d,t[34]=i);let a=[...new Set([...e,...n.filter(i).flatMap(fn)])].sort(),u;t[35]===m?u=t[36]:(u=new Set(m.filter(dn).map(un)),t[35]=m,t[36]=u);let f=u,p;t[37]!==S||t[38]!==f?(p=e=>S===null||!f.has(e),t[37]=S,t[38]=f,t[39]=p):p=t[39];let D=[...e.filter(p).map(e=>m.find(t=>t.id===`model:${e}`)??{id:`model:${e}`,model:e,isNew:!1,values:{}}),...m.filter(ln)],H=m.filter(cn);R=qt(d,H);for(let t of H)t.isNew&&(t.model.trim()===``?R.set(t.id,`Enter a model ID.`):S===null&&(e.includes(t.model.trim())||m.some(e=>e.id!==t.id&&e.model.trim()===t.model.trim()))&&R.set(t.id,`This model already has a row. Edit its prices there.`));z=S?.destinations.filter(e=>S.results.get(e.environmentId)?.status===`failed`)??[];let U=v||z.length>0;te=H.length>0,I=d.length===1?d[0].label:`${d.length} environments`;let ue=c===null?`All environments`:I,de;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(de=()=>{_([]),C(null)},t[40]=de):de=t[40],L=de;let fe;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(fe=e=>{l(e),C(null)},t[41]=fe):fe=t[41];let W=fe,G;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>{_(t=>t.some(t=>t.id===e.id)?t.map(t=>t.id===e.id?e:t):[...t,e]),C(null)},t[42]=G):G=t[42];let pe=G,K=sn,me;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>{!e.isNew&&Object.keys(e.values).length===0&&e.alias===void 0?_(t=>t.filter(t=>t.id!==e.id)):pe(e)},t[43]=me):me=t[43];let he=me,q;t[44]===d?q=t[45]:(q=(e,t,n)=>{let r={...e.values,[t]:n},i=Gt(d,e.model,t);K(e,i,n)&&delete r[t],he({...e,values:r})},t[44]=d,t[45]=q);let J=q,Y;t[46]===d?Y=t[47]:(Y=(e,t)=>{let{alias:n,...r}=e,i=Wt(d,e.model);he(K(e,i,t)?r:{...r,alias:t})},t[46]=d,t[47]=Y);let ge=Y;ne=async e=>{let t=e!==void 0&&e;if(v)return;let n=t?z:d,r=t&&S?S.drafts:H;if(n.length===0||r.length===0)return;let i=n.map(e=>s.find(t=>t.environmentId===e.environmentId)??{...e,prices:null,aliases:null,unavailable:`Environment removed`}),a=new Map(i.map(e=>[e.environmentId,Kt(e,r)]));y(!0),C(e=>({drafts:r,destinations:t&&e?e.destinations:i,results:new Map([...t&&e?e.results:[],...i.map(on)])}));let o=!1;await Jt({targets:i.map(e=>({...e,unavailable:e.unavailable??[...a.get(e.environmentId).errors.values()][0]??null})),changes:new Map([...a].map(an)),write:async e=>le(e.environmentId,`settings:write`)?k(e):{_tag:`Failure`},onResult:(e,t)=>{t.status===`failed`&&(o=!0),C(n=>n===null?null:{...n,results:new Map(n.results).set(e,t)})}}),y(!1),o||_([])},P=Oe,se=!0,t[48]!==o||t[49]!==v?(ce=e=>{v||o(e)},t[48]=o,t[49]=v,t[50]=ce):ce=t[50],M=De,ae=`max-w-4xl`,t[51]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsxs)(Se,{children:[(0,$.jsx)(Ce,{children:`Custom model prices`}),(0,$.jsx)(Ee,{children:`Prices and mappings apply to all past and future usage on the environments you select.`})]}),t[51]=oe):oe=t[51],j=Te;let _e;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(Ge,{id:`usage-prices-apply-label`,className:`shrink-0`,children:`Apply to`}),t[52]=_e):_e=t[52];let X;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(E,{variant:`outline`,size:`sm`,className:`min-w-0`}),t[53]=X):X=t[53];let ve=v||te,ye;t[54]===ue?ye=t[55]:(ye=(0,$.jsx)(`span`,{id:`usage-prices-selection`,className:`truncate`,children:ue}),t[54]=ue,t[55]=ye);let xe;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,$.jsx)(A,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[56]=xe):xe=t[56];let we;t[57]!==ve||t[58]!==ye?(we=(0,$.jsxs)(b,{render:X,"aria-labelledby":`usage-prices-apply-label usage-prices-selection`,disabled:ve,children:[ye,xe]}),t[57]=ve,t[58]=ye,t[59]=we):we=t[59];let ke=c===null,Ae;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=e=>W(e?null:new Set),t[60]=Ae):Ae=t[60];let je;t[61]===ke?je=t[62]:(je=(0,$.jsx)(r,{checked:ke,closeOnClick:!1,onCheckedChange:Ae,children:`All environments`}),t[61]=ke,t[62]=je);let Me;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(Me=(0,$.jsx)(x,{}),t[63]=Me):Me=t[63];let Ne;if(t[64]!==s||t[65]!==d||t[66]!==c){let e;t[68]!==s.length||t[69]!==d||t[70]!==c?(e=e=>(0,$.jsx)(r,{checked:c===null||c.has(e.environmentId),closeOnClick:!1,onCheckedChange:t=>{let n=new Set(d.map(rn));t?n.add(e.environmentId):n.delete(e.environmentId),W(n.size===s.length?null:n)},children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.unavailable?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.unavailable}):null]})},e.environmentId),t[68]=s.length,t[69]=d,t[70]=c,t[71]=e):e=t[71],Ne=s.map(e),t[64]=s,t[65]=d,t[66]=c,t[67]=Ne}else Ne=t[67];let Pe;t[72]!==je||t[73]!==Ne?(Pe=(0,$.jsxs)(g,{align:`start`,children:[je,Me,Ne]}),t[72]=je,t[73]=Ne,t[74]=Pe):Pe=t[74];let Fe;t[75]!==we||t[76]!==Pe?(Fe=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[_e,(0,$.jsxs)(h,{children:[we,Pe]})]}),t[75]=we,t[76]=Pe,t[77]=Fe):Fe=t[77];let Ie;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`USD / million tokens`}),t[78]=Ie):Ie=t[78],t[79]===Fe?re=t[80]:(re=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[Fe,Ie]}),t[79]=Fe,t[80]=re),ie=d.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:s.length===0?`Connect an environment to set model prices.`:`Select an environment to see and change its model prices.`}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`min-w-0 overflow-hidden rounded-lg border border-border`,children:(0,$.jsxs)(Mt,{className:`min-w-180 table-fixed`,"aria-label":`Custom model prices`,children:[(0,$.jsxs)(`colgroup`,{children:[(0,$.jsx)(`col`,{className:`w-[22%]`}),(0,$.jsx)(`col`,{className:`w-[18%]`}),Rt.map(nn),(0,$.jsx)(`col`,{className:`w-10`})]}),(0,$.jsx)(Nt,{children:(0,$.jsxs)(Ft,{children:[(0,$.jsx)(It,{children:`Model ID`}),(0,$.jsx)(It,{children:`Map to`}),Rt.map(tn),(0,$.jsx)(It,{children:(0,$.jsx)(E,{size:`icon-xs`,variant:`ghost`,"aria-label":`Add model price`,disabled:U,onClick:()=>{T.current+=1;let e=`new:${T.current}`;w.current=e,pe({id:e,model:``,isNew:!0,values:{}})},children:(0,$.jsx)(N,{"aria-hidden":!0})})})]})}),(0,$.jsx)(Pt,{children:D.length===0?(0,$.jsx)(Ft,{children:(0,$.jsx)(Lt,{colSpan:7,className:`text-center whitespace-normal`,children:(0,$.jsx)(`p`,{className:`py-6 text-muted-foreground`,children:d.some(en)?`Some environment prices are unavailable.`:`No custom prices or mappings. Add a row to set one.`})})}):D.map(e=>{let t=Wt(d,e.model),n=(e.alias??t.value).trim();return(0,$.jsxs)(Ft,{"data-row-id":e.id,children:[(0,$.jsxs)(Lt,{className:`whitespace-normal`,children:[e.isNew?(0,$.jsx)(be,{size:`compact`,value:e.model,ref:t=>{t&&w.current===e.id&&(t.focus(),w.current=null)},"aria-label":`New model ID`,"aria-invalid":e.model.trim()!==``&&R.has(e.id)||void 0,list:`usage-price-models`,placeholder:`Model ID`,autoComplete:`off`,spellCheck:!1,disabled:U,onChange:t=>pe({...e,model:t.target.value})}):(0,$.jsx)(`span`,{className:O(`block break-all`,e.removed&&`text-muted-foreground line-through`),children:e.model}),R.has(e.id)&&(e.model.trim()!==``||Object.values(e.values).some($t))?(0,$.jsx)(`p`,{role:`alert`,className:`mt-1 text-xs text-destructive`,children:R.get(e.id)}):null]}),e.removed?(0,$.jsx)(Lt,{colSpan:5,children:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Automatic pricing after saving`})}):(0,$.jsx)(Lt,{children:(0,$.jsx)(be,{size:`compact`,value:e.alias??t.value,"aria-label":`Map ${e.model||`new model`} to model`,list:`usage-alias-models`,placeholder:e.isNew?`Optional`:t.placeholder,autoComplete:`off`,spellCheck:!1,disabled:U,onChange:t=>ge(e,t.target.value)})}),e.removed?null:n===``?Rt.map(t=>{let n=Gt(d,e.model,t.key);return(0,$.jsx)(Lt,{children:(0,$.jsx)(be,{size:`compact`,inputMode:`decimal`,"aria-label":`${t.label} price for ${e.model||`new model`}`,value:e.values[t.key]??(e.isNew?``:n.value),placeholder:e.isNew?t.optional?`Input rate`:`0.00`:n.placeholder,autoComplete:`off`,disabled:U,font:`mono`,onChange:n=>J(e,t.key,n.target.value)})},t.key)}):(0,$.jsx)(Lt,{colSpan:4,className:`whitespace-normal`,children:(0,$.jsxs)(`span`,{className:`break-all text-muted-foreground`,children:[`Counted as `,n]})}),(0,$.jsx)(Lt,{children:(0,$.jsxs)(V,{children:[(0,$.jsx)(ee,{render:(0,$.jsx)(E,{size:`icon-xs`,variant:`ghost`}),disabled:U,"aria-label":e.removed?`Undo reset for ${e.model}`:e.isNew?`Remove new model`:`Reset price for ${e.model} to automatic`,onClick:()=>{e.isNew?_(t=>t.filter(t=>t.id!==e.id)):e.removed?he({...e,removed:!1}):pe({...e,removed:!0})},children:e.isNew?(0,$.jsx)(F,{"aria-hidden":!0}):(0,$.jsx)(Ke,{"aria-hidden":!0})}),(0,$.jsx)(B,{children:e.removed?`Undo reset`:e.isNew?`Remove row`:`Reset to automatic`})]})})]},e.id)})})]})}),(0,$.jsx)(`datalist`,{id:`usage-price-models`,children:a.filter(t=>!e.includes(t)).map(Qt)}),(0,$.jsx)(`datalist`,{id:`usage-alias-models`,children:a.filter(e=>d.every(t=>!Object.hasOwn(t.aliases??{},e))).map(Zt)}),(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Blank cache rates use the input price. Enter 0 for free tokens. A mapped model’s usage counts as the model it maps to.`,d.length>1?` Mixed cells keep each environment’s rate until you edit them.`:``]})]}),t[9]=S,t[10]=m,t[11]=s,t[12]=o,t[13]=v,t[14]=d,t[15]=c,t[16]=k,t[17]=n,t[18]=j,t[19]=M,t[20]=P,t[21]=I,t[22]=L,t[23]=R,t[24]=z,t[25]=te,t[26]=ne,t[27]=re,t[28]=ie,t[29]=ae,t[30]=oe,t[31]=se,t[32]=ce}else j=t[18],M=t[19],P=t[20],I=t[21],L=t[22],R=t[23],z=t[24],te=t[25],ne=t[26],re=t[27],ie=t[28],ae=t[29],oe=t[30],se=t[31],ce=t[32];let U;t[81]===S?U=t[82]:(U=S?(0,$.jsx)(`div`,{role:`status`,className:`grid gap-1 text-xs`,children:S.destinations.map(e=>{let t=S.results.get(e.environmentId);return(0,$.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:t?.status===`failed`?`text-right text-destructive`:`text-muted-foreground`,children:t?.status===`failed`?`Not saved · ${t.error}`:t?.status===`saved`?`Saved`:`Saving…`})]},e.environmentId)})}):null,t[81]=S,t[82]=U);let de;t[83]!==j||t[84]!==U||t[85]!==re||t[86]!==ie?(de=(0,$.jsxs)(j,{children:[re,ie,U]}),t[83]=j,t[84]=U,t[85]=re,t[86]=ie,t[87]=de):de=t[87];let fe=te?`Changes apply to ${I}`:``,W;t[88]===fe?W=t[89]:(W=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:fe}),t[88]=fe,t[89]=W);let G;t[90]!==L||t[91]!==z.length||t[92]!==te||t[93]!==v?(G=te?(0,$.jsx)(E,{variant:`ghost`,disabled:v,onClick:L,children:z.length>0?`Discard pending changes`:`Discard changes`}):null,t[90]=L,t[91]=z.length,t[92]=te,t[93]=v,t[94]=G):G=t[94];let pe=v||!te&&z.length===0||z.length===0&&(R.size>0||d.length===0),K;t[95]!==z.length||t[96]!==ne?(K=()=>void ne(z.length>0),t[95]=z.length,t[96]=ne,t[97]=K):K=t[97];let me=v?`Saving…`:z.length>0?`Retry failed saves`:`Save changes`,he;t[98]!==pe||t[99]!==K||t[100]!==me?(he=(0,$.jsx)(E,{disabled:pe,onClick:K,children:me}),t[98]=pe,t[99]=K,t[100]=me,t[101]=he):he=t[101];let q;t[102]!==G||t[103]!==he?(q=(0,$.jsxs)(`div`,{className:`flex w-full flex-wrap justify-end gap-2 sm:w-auto`,children:[G,he]}),t[102]=G,t[103]=he,t[104]=q):q=t[104];let J;t[105]!==W||t[106]!==q?(J=(0,$.jsxs)(we,{variant:`bare`,className:`items-center sm:justify-between`,children:[W,q]}),t[105]=W,t[106]=q,t[107]=J):J=t[107];let Y;t[108]!==M||t[109]!==de||t[110]!==J||t[111]!==ae||t[112]!==oe?(Y=(0,$.jsxs)(M,{className:ae,children:[oe,de,J]}),t[108]=M,t[109]=de,t[110]=J,t[111]=ae,t[112]=oe,t[113]=Y):Y=t[113];let ge;return t[114]!==P||t[115]!==Y||t[116]!==se||t[117]!==ce?(ge=(0,$.jsx)(P,{open:se,onOpenChange:ce,children:Y}),t[114]=P,t[115]=Y,t[116]=se,t[117]=ce,t[118]=ge):ge=t[118],ge}function Zt(e){return(0,$.jsx)(`option`,{value:e},e)}function Qt(e){return(0,$.jsx)(`option`,{value:e},e)}function $t(e){return e!==``}function en(e){return e.prices===null}function tn(e){return(0,$.jsx)(It,{children:e.label},e.key)}function nn(e){return(0,$.jsx)(`col`,{},e.key)}function rn(e){return e.environmentId}function an(e){let[t,n]=e;return[t,n.changes]}function on(e){return[e.environmentId,{status:`saving`}]}function sn(e,t,n){return!e.isNew&&t.placeholder!==`Mixed`&&t.placeholder!==`Unavailable`&&n===t.value}function cn(e){return!Vt(e)}function ln(e){return e.isNew}function un(e){return e.model.trim()}function dn(e){return e.isNew}function fn(e){return e.summary?.buckets.map(pn)??[]}function pn(e){return e.model}function mn(e){return[...Object.keys(e.prices??{}),...Object.keys(e.aliases??{})]}var hn=960,gn=260,_n=4,vn=8,yn=new Set;function bn(e,t,n){let r=e?.byProvider.get(t);return r===void 0?0:n===`tokens`?r.totalTokens:r.costUsd}function xn(e,t,n){return e.map(e=>{let r=t.get(e),i=$e.map(e=>({provider:e,value:bn(r,e,n)}));return{bands:i,total:i.reduce((e,t)=>e+t.value,0)}})}function Sn(e){let t=e.length;if(t<2)return[0];let n=[];for(let r=0;r<t-1;r+=1){let t=(e[r+1]?.x??0)-(e[r]?.x??0),i=(e[r+1]?.y??0)-(e[r]?.y??0);n.push(t===0?0:i/t)}let r=Array.from({length:t},()=>0);r[0]=n[0]??0,r[t-1]=n[t-2]??0;for(let e=1;e<t-1;e+=1){let t=n[e-1]??0,i=n[e]??0;r[e]=t*i<=0?0:(t+i)/2}for(let e=0;e<t-1;e+=1){let t=n[e]??0;if(t===0){r[e]=0,r[e+1]=0;continue}let i=(r[e]??0)/t,a=(r[e+1]??0)/t,o=i*i+a*a;if(o>9){let n=3/Math.sqrt(o);r[e]=n*i*t,r[e+1]=n*a*t}}return r}function Cn(e){if(e.length<2)return[];let t=Sn(e),n=[];for(let r=0;r<e.length-1;r+=1){let i=e[r],a=e[r+1];if(i===void 0||a===void 0)continue;let o=a.x-i.x;n.push({from:i,c1:{x:i.x+o/3,y:i.y+(t[r]??0)*o/3},c2:{x:a.x-o/3,y:a.y-(t[r+1]??0)*o/3},to:a})}return n}function wn(e){let t=e[0];if(t===void 0)return``;let n=`M${t.from.x.toFixed(2)},${t.from.y.toFixed(2)}`;for(let t of e)n+=` C${t.c1.x.toFixed(2)},${t.c1.y.toFixed(2)} ${t.c2.x.toFixed(2)},${t.c2.y.toFixed(2)} ${t.to.x.toFixed(2)},${t.to.y.toFixed(2)}`;return n}function Tn(e){return e===``?``:`${e} L${hn},${gn} L0,${gn} Z`}function En(e,t){if(e<=0)return{max:0,ticks:[0]};let n=e/t,r=10**Math.floor(Math.log10(n)),i=n/r,a=(i>5?10:i>2?5:i>1?2:1)*r,o=Math.ceil(e/a)*a,s=[];for(let e=0;e<=o+a*1e-6;e+=a)s.push(e);return{max:o,ticks:s}}var Dn=Array.from({length:5},(e,t)=>t);function On(e,t){let n=e.reduce((e,t)=>t.bands.reduce((e,t)=>Math.max(e,t.value),e),0);return n===0&&t.size>0?{max:_n,ticks:Dn,labeled:!1}:{...En(n,_n),labeled:!0}}function kn(e,t){return t===0?gn:gn-e/t*252}function An(e,t,n,r,i){let a=xn(e,t,n),o=On(a,i),s=e.length<2?0:hn/(e.length-1);return{columns:a,scale:o,stepX:s,paths:r.map(e=>{let t=$e.indexOf(e),n=wn(Cn(a.map((e,n)=>({x:n*s,y:kn(e.bands[t]?.value??0,o.max)}))));return{provider:e,loading:i.has(e),total:a.reduce((e,n)=>e+(n.bands[t]?.value??0),0),line:n,area:Tn(n)}}).toSorted((e,t)=>t.total-e.total)}}function jn(e){let t=(0,Q.c)(97),{providers:n,loadingProviders:r,days:i,daily:a,hours:o,hourly:s,metric:c,referenceTime:l,resolution:u,timeZone:d}=e,f=r===void 0?yn:r,p=u===`hour`?o:i,m;t[0]!==a||t[1]!==s||t[2]!==u?(m=u===`hour`?new Map(s.map(Pn)):new Map(a.map(Nn)),t[0]=a,t[1]=s,t[2]=u,t[3]=m):m=t[3];let h=m,[g,_]=(0,Z.useState)(null),v=(0,Z.useRef)(null),y=(0,Z.useRef)(null),b=(0,Z.useRef)(null),x;t[4]!==h||t[5]!==f||t[6]!==c||t[7]!==p||t[8]!==n?(x=An(p,h,c,n,f),t[4]=h,t[5]=f,t[6]=c,t[7]=p,t[8]=n,t[9]=x):x=t[9];let{columns:S,scale:C,paths:w,stepX:T}=x,E;t[10]===C.max?E=t[11]:(E=e=>kn(e,C.max),t[10]=C.max,t[11]=E);let D=E,k=Mn,A=c===`tokens`?K:W,j;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>{let e=v.current,t=y.current,n=b.current;if(e===null||t===null||n===null)return;let r=t.offsetWidth,i=t.offsetHeight,a=e.clientWidth,o=e.clientHeight,s=n.x+12+r<=a?n.x+12:n.x-12-r,c=n.y+12+i<=o?n.y+12:n.y-12-i,l=Math.min(Math.max(0,s),Math.max(0,a-r)),u=Math.min(Math.max(0,c),Math.max(0,o-i));e.style.setProperty(`--usage-tooltip-left`,`${l}px`),e.style.setProperty(`--usage-tooltip-top`,`${u}px`)},t[12]=j):j=t[12];let M=j,N,P;t[13]===g?(N=t[14],P=t[15]):(N=()=>{if(g===null)return;M();let e=v.current,t=y.current;if(e!==null&&t!==null)return Ae([e,t],M)},P=[g,M],t[13]=g,t[14]=N,t[15]=P),(0,Z.useLayoutEffect)(N,P);let F;t[16]===p.length?F=t[17]:(F=e=>{let t=v.current;if(t===null||p.length===0)return;let n=t.getBoundingClientRect();if(n.width===0)return;let r=Math.min(n.width,Math.max(0,e.clientX-n.left)),i=Math.min(n.height,Math.max(0,e.clientY-n.top)),a=r/n.width,o=Math.round(a*(p.length-1));b.current={x:r,y:i},M(),_(Math.min(p.length-1,Math.max(0,o)))},t[16]=p.length,t[17]=F);let I=F,L=g===null?void 0:p[g],R=g===null?void 0:S[g],z;if(t[18]!==f||t[19]!==n){let e;t[21]===f?e=t[22]:(e=e=>f.has(e),t[21]=f,t[22]=e),z=n.some(e),t[18]=f,t[19]=n,t[20]=z}else z=t[20];let ee=z,B;t[23]!==u||t[24]!==d?(B=e=>u===`hour`?he(e,d):de(e),t[23]=u,t[24]=d,t[25]=B):B=t[25];let V=B,te;t[26]!==V||t[27]!==l||t[28]!==u||t[29]!==d?(te=e=>u===`hour`&&l!==void 0?fe(e,l,d):V(e),t[26]=V,t[27]=l,t[28]=u,t[29]=d,t[30]=te):te=t[30];let ne=te,re;t[31]!==A||t[32]!==C.labeled||t[33]!==C.ticks||t[34]!==D?(re=C.labeled?C.ticks.map(e=>(0,$.jsx)(`span`,{className:`absolute right-0 -translate-y-1/2 text-3xs text-muted-foreground tabular-nums`,style:{top:`${D(e)/gn*100}%`},children:e===0?`0`:A(e)},e)):null,t[31]=A,t[32]=C.labeled,t[33]=C.ticks,t[34]=D,t[35]=re):re=t[35];let ie;t[36]===re?ie=t[37]:(ie=(0,$.jsx)(`div`,{className:`relative h-56 w-14 shrink-0`,children:re}),t[36]=re,t[37]=ie);let ae;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(ae=()=>{b.current=null,_(null)},t[38]=ae):ae=t[38];let oe=`${u===`hour`?`Hourly`:`Daily`} ${c===`tokens`?`processed tokens`:`cost`} by provider`,se;if(t[39]!==C.ticks||t[40]!==D){let e;t[42]===D?e=t[43]:(e=e=>{let t=D(e);return(0,$.jsx)(`line`,{x1:0,x2:hn,y1:t,y2:t,stroke:`currentColor`,strokeWidth:1,className:`text-border`,vectorEffect:`non-scaling-stroke`},e)},t[42]=D,t[43]=e),se=C.ticks.map(e),t[39]=C.ticks,t[40]=D,t[41]=se}else se=t[41];let H;if(t[44]!==w){let e;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>{let{provider:t,loading:n,area:r}=e;return(0,$.jsx)(`path`,{d:r,className:k(n),fill:Qe[t].color,fillOpacity:.12},t)},t[46]=e):e=t[46],H=w.map(e),t[44]=w,t[45]=H}else H=t[45];let ce;if(t[47]!==w){let e;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>{let{provider:t,loading:n,line:r}=e;return(0,$.jsx)(`path`,{d:r,className:k(n),fill:`none`,stroke:Qe[t].color,strokeWidth:2,vectorEffect:`non-scaling-stroke`},t)},t[49]=e):e=t[49],ce=w.map(e),t[47]=w,t[48]=ce}else ce=t[48];let le;t[50]!==g||t[51]!==T?(le=g===null?null:(0,$.jsx)(`line`,{x1:g*T,x2:g*T,y1:vn,y2:gn,stroke:`currentColor`,strokeWidth:1,className:`text-muted-foreground`,vectorEffect:`non-scaling-stroke`}),t[50]=g,t[51]=T,t[52]=le):le=t[52];let U;t[53]!==oe||t[54]!==se||t[55]!==H||t[56]!==ce||t[57]!==le?(U=(0,$.jsxs)(`svg`,{className:`h-full w-full`,viewBox:`0 0 ${hn} ${gn}`,preserveAspectRatio:`none`,role:`img`,"aria-label":oe,children:[se,H,ce,le]}),t[53]=oe,t[54]=se,t[55]=H,t[56]=ce,t[57]=le,t[58]=U):U=t[58];let ue;t[59]!==A||t[60]!==ne||t[61]!==R?.bands||t[62]!==R?.total||t[63]!==L||t[64]!==f||t[65]!==ee||t[66]!==n?(ue=L===void 0?null:(0,$.jsxs)(`div`,{ref:y,className:`surface-glass pointer-events-none absolute z-10 min-w-36 max-w-full rounded-xl border border-border/50 px-2.5 py-2 text-xs shadow-lg`,style:{left:`var(--usage-tooltip-left, 0px)`,top:`var(--usage-tooltip-top, 0px)`},children:[(0,$.jsx)(`div`,{className:`mb-1 text-muted-foreground`,children:ne(L)}),n.map(e=>{let{label:t,driverKind:n}=Qe[e];return(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,$.jsx)(ze,{driverKind:n,displayName:t,iconClassName:`size-3`}),t]}),(0,$.jsx)(`span`,{className:O(`tabular-nums`,f.has(e)?`text-muted-foreground`:`text-foreground`),children:A(R?.bands.find(t=>t.provider===e)?.value??0)})]},e)}),(0,$.jsxs)(`div`,{className:`mt-1 flex items-center justify-between gap-3 border-t border-border pt-1`,children:[(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Total`}),(0,$.jsx)(`span`,{className:O(`tabular-nums`,ee?`text-muted-foreground`:`text-foreground`),children:A(R?.total??0)})]})]}),t[59]=A,t[60]=ne,t[61]=R?.bands,t[62]=R?.total,t[63]=L,t[64]=f,t[65]=ee,t[66]=n,t[67]=ue):ue=t[67];let G;t[68]!==I||t[69]!==U||t[70]!==ue?(G=(0,$.jsxs)(`div`,{ref:v,className:`relative h-56 flex-1`,onMouseMove:I,onMouseLeave:ae,children:[U,ue]}),t[68]=I,t[69]=U,t[70]=ue,t[71]=G):G=t[71];let pe;t[72]!==ie||t[73]!==G?(pe=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[ie,G]}),t[72]=ie,t[73]=G,t[74]=pe):pe=t[74];let me;t[75]!==V||t[76]!==p[0]?(me=p[0]===void 0?``:V(p[0]),t[75]=V,t[76]=p[0],t[77]=me):me=t[77];let q;t[78]===me?q=t[79]:(q=(0,$.jsx)(`span`,{children:me}),t[78]=me,t[79]=q);let J;t[80]!==V||t[81]!==p?(J=p[Math.floor(p.length/2)]===void 0?``:V(p[Math.floor(p.length/2)]??``),t[80]=V,t[81]=p,t[82]=J):J=t[82];let Y;t[83]===J?Y=t[84]:(Y=(0,$.jsx)(`span`,{children:J}),t[83]=J,t[84]=Y);let ge;t[85]!==V||t[86]!==p?(ge=p[p.length-1]===void 0?``:V(p[p.length-1]??``),t[85]=V,t[86]=p,t[87]=ge):ge=t[87];let _e;t[88]===ge?_e=t[89]:(_e=(0,$.jsx)(`span`,{children:ge}),t[88]=ge,t[89]=_e);let X;t[90]!==q||t[91]!==Y||t[92]!==_e?(X=(0,$.jsxs)(`div`,{className:`flex justify-between pl-16 text-3xs text-muted-foreground uppercase`,children:[q,Y,_e]}),t[90]=q,t[91]=Y,t[92]=_e,t[93]=X):X=t[93];let ve;return t[94]!==pe||t[95]!==X?(ve=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[pe,X]}),t[94]=pe,t[95]=X,t[96]=ve):ve=t[96],ve}function Mn(e){return O(`transition-opacity`,e&&`opacity-40 delay-150`)}function Nn(e){return[e.day,e]}function Pn(e){return[e.hourStart,e]}function Fn(e){let t=(0,Q.c)(30),{label:n,segments:r,format:i,aside:a}=e,o,s,c,l,u,d;if(t[0]!==a||t[1]!==i||t[2]!==n||t[3]!==r){d=Symbol.for(`react.early_return_sentinel`);bb0:{let e=r.filter(Ln),f=e.reduce(In,0);if(f<=0){d=null;break bb0}c=`flex min-w-0 flex-col gap-2.5`;let p;t[10]===n?p=t[11]:(p=(0,$.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:n}),t[10]=n,t[11]=p),t[12]!==a||t[13]!==p?(l=(0,$.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[p,a]}),t[12]=a,t[13]=p,t[14]=l):l=t[14];let m;t[15]===i?m=t[16]:(m=e=>`${e.label} ${i(e.value)}`,t[15]=i,t[16]=m);let h;t[17]!==i||t[18]!==f?(h=e=>(0,$.jsxs)(V,{children:[(0,$.jsx)(ee,{render:(0,$.jsx)(`div`,{className:`h-full min-w-1 rounded-xs first:rounded-l-full last:rounded-r-full`,style:{flex:`${e.value} 1 0`,backgroundColor:e.color}})}),(0,$.jsxs)(B,{children:[e.label,` · `,i(e.value),` · `,J(e.value/f)]})]},e.label),t[17]=i,t[18]=f,t[19]=h):h=t[19],u=(0,$.jsx)(`div`,{role:`img`,"aria-label":`${n}: ${e.map(m).join(`, `)}`,className:`flex h-2 gap-0.5`,children:e.map(h)}),o=`flex flex-wrap gap-x-4 gap-y-1 text-xs`;let g;t[20]===i?g=t[21]:(g=e=>(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-2 rounded-xs`,style:{backgroundColor:e.color}}),(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`text-foreground tabular-nums`,children:i(e.value)})]},e.label),t[20]=i,t[21]=g),s=e.map(g)}t[0]=a,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d}else o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9];if(d!==Symbol.for(`react.early_return_sentinel`))return d;let f;t[22]!==o||t[23]!==s?(f=(0,$.jsx)(`div`,{className:o,children:s}),t[22]=o,t[23]=s,t[24]=f):f=t[24];let p;return t[25]!==c||t[26]!==l||t[27]!==u||t[28]!==f?(p=(0,$.jsxs)(`div`,{className:c,children:[l,u,f]}),t[25]=c,t[26]=l,t[27]=u,t[28]=f,t[29]=p):p=t[29],p}function In(e,t){return e+t.value}function Ln(e){return e.value>0}function Rn(e){return e.toSorted((e,t)=>t.totalTokens-e.totalTokens||t.costUsd-e.costUsd)}function zn(e,t){return t===`tokens`?e.tokenShare:pt(e)?null:e.costShare}function Bn({tokens:e}){let t=e.uncachedInputTokens+e.cachedInputTokens+e.cacheCreationTokens;return t===0?null:e.cachedInputTokens/t}function Vn(e){let t=e.totalTokens-e.unpricedTokens;return t<=0||pt(e)?null:e.costUsd/t*1e6}var Hn=e=>`color-mix(in oklab, var(--foreground) ${e}%, var(--background))`,Un={input:Hn(60),cacheRead:Hn(30),cacheWrite:Hn(72),output:Hn(100),other:Hn(44)};function Wn(e){return[{label:`Input`,value:e.input,color:Un.input},{label:`Cache read`,value:e.cacheRead,color:Un.cacheRead},{label:`Cache write`,value:e.cacheWrite,color:Un.cacheWrite},{label:`Output`,value:e.output,color:Un.output},{label:`Other`,value:e.unsplit>=.005?e.unsplit:0,color:Un.other}]}function Gn(e){return[{label:`Input`,value:e.uncachedInputTokens,color:Un.input},{label:`Cache read`,value:e.cachedInputTokens,color:Un.cacheRead},{label:`Cache write`,value:e.cacheCreationTokens,color:Un.cacheWrite},{label:`Output`,value:e.outputTokens,color:Un.output}]}function Kn(e){return[{label:`Standard`,value:e.standard,color:Hn(34)},{label:`Fast`,value:e.fast,color:Hn(66)},{label:`Ultrafast`,value:e.ultrafast,color:Hn(100)}]}function qn(e){let t=(0,Q.c)(80),{model:n,environments:r,metric:i,chartWindow:a,onSetPrice:o,onClose:s}=e,c;t[0]!==n.model||t[1]!==n.provider?(c=e=>e.provider===n.provider&&e.model===n.model,t[0]=n.model,t[1]=n.provider,t[2]=c):c=t[2];let l;t[3]!==r||t[4]!==c?(l=wt(r,c),t[3]=r,t[4]=c,t[5]=l):l=t[5];let u=l,d;t[6]===n.provider?d=t[7]:(d=[n.provider],t[6]=n.provider,t[7]=d);let f=d,p=Qe[n.provider],m;t[8]===n?m=t[9]:(m=pt(n),t[8]=n,t[9]=m);let h=m,g;if(t[10]!==h||t[11]!==n){let e=Bn(n),r=Vn(n),i;t[13]!==h||t[14]!==n.costUsd?(i=h?`Unpriced`:W(n.costUsd),t[13]=h,t[14]=n.costUsd,t[15]=i):i=t[15];let a;t[16]===i?a=t[17]:(a={label:`Cost`,value:i},t[16]=i,t[17]=a);let o;t[18]===n.totalTokens?o=t[19]:(o=K(n.totalTokens),t[18]=n.totalTokens,t[19]=o);let s;t[20]===o?s=t[21]:(s={label:`Tokens`,value:o},t[20]=o,t[21]=s),g=[a,s,r===null?null:{label:`Per 1M tokens`,value:W(r)},e===null?null:{label:`Cache hit`,value:J(e)}].filter(Yn),t[10]=h,t[11]=n,t[12]=g}else g=t[12];let _=g,v;t[22]===s?v=t[23]:(v=e=>{e||s()},t[22]=s,t[23]=v);let y;t[24]!==p.driverKind||t[25]!==p.label?(y=(0,$.jsx)(ze,{driverKind:p.driverKind,displayName:p.label,iconClassName:`size-5`}),t[24]=p.driverKind,t[25]=p.label,t[26]=y):y=t[26];let b;t[27]===n.model?b=t[28]:(b=(0,$.jsx)(Ce,{children:n.model}),t[27]=n.model,t[28]=b);let x;t[29]!==y||t[30]!==b?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y,b]}),t[29]=y,t[30]=b,t[31]=x):x=t[31];let S;t[32]!==h||t[33]!==n.costShare?(S=h?``:` · ${J(n.costShare)} of cost`,t[32]=h,t[33]=n.costShare,t[34]=S):S=t[34];let C;t[35]!==p.label||t[36]!==S?(C=(0,$.jsxs)(Ee,{children:[p.label,S]}),t[35]=p.label,t[36]=S,t[37]=C):C=t[37];let w;t[38]!==C||t[39]!==x?(w=(0,$.jsxs)(Se,{children:[x,C]}),t[38]=C,t[39]=x,t[40]=w):w=t[40];let T;t[41]===_?T=t[42]:(T=(0,$.jsx)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-4`,children:_.map(Jn)}),t[41]=_,t[42]=T);let D=h?`tokens`:i,O;t[43]!==a.days||t[44]!==a.hours||t[45]!==a.referenceTime||t[46]!==a.resolution||t[47]!==a.timeZone||t[48]!==f||t[49]!==D||t[50]!==u.daily||t[51]!==u.hourly?(O=(0,$.jsx)(jn,{providers:f,days:a.days,daily:u.daily,hours:a.hours,hourly:u.hourly,metric:D,referenceTime:a.referenceTime,resolution:a.resolution,timeZone:a.timeZone}),t[43]=a.days,t[44]=a.hours,t[45]=a.referenceTime,t[46]=a.resolution,t[47]=a.timeZone,t[48]=f,t[49]=D,t[50]=u.daily,t[51]=u.hourly,t[52]=O):O=t[52];let k;t[53]!==h||t[54]!==u.categoryCost?(k=h?null:(0,$.jsx)(Fn,{label:`Cost by type`,segments:Wn(u.categoryCost),format:W}),t[53]=h,t[54]=u.categoryCost,t[55]=k):k=t[55];let A;t[56]===n.tokens?A=t[57]:(A=Gn(n.tokens),t[56]=n.tokens,t[57]=A);let j;t[58]===A?j=t[59]:(j=(0,$.jsx)(Fn,{label:`Tokens by type`,segments:A,format:K}),t[58]=A,t[59]=j);let M;t[60]===u.speedCost?M=t[61]:(M=u.speedCost.fast+u.speedCost.ultrafast>0?(0,$.jsx)(Fn,{label:`Cost by speed`,segments:Kn(u.speedCost),format:W,aside:(0,$.jsx)(Xn,{premiumUsd:u.speedCost.premium})}):null,t[60]=u.speedCost,t[61]=M);let N;t[62]!==k||t[63]!==j||t[64]!==M?(N=(0,$.jsxs)(`div`,{className:`grid gap-x-10 gap-y-8 sm:grid-cols-2`,children:[k,j,M]}),t[62]=k,t[63]=j,t[64]=M,t[65]=N):N=t[65];let P;t[66]!==T||t[67]!==O||t[68]!==N?(P=(0,$.jsx)(Te,{children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[T,O,N]})}),t[66]=T,t[67]=O,t[68]=N,t[69]=P):P=t[69];let F;t[70]!==n.unpricedTokens||t[71]!==o?(F=n.unpricedTokens>0?(0,$.jsxs)(we,{variant:`bare`,className:`items-center sm:justify-between`,children:[(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[K(n.unpricedTokens),` tokens have no known price`]}),(0,$.jsx)(E,{onClick:o,children:`Set price`})]}):null,t[70]=n.unpricedTokens,t[71]=o,t[72]=F):F=t[72];let I;t[73]!==w||t[74]!==P||t[75]!==F?(I=(0,$.jsxs)(De,{className:`max-w-3xl`,children:[w,P,F]}),t[73]=w,t[74]=P,t[75]=F,t[76]=I):I=t[76];let L;return t[77]!==I||t[78]!==v?(L=(0,$.jsx)(Oe,{open:!0,onOpenChange:v,children:I}),t[77]=I,t[78]=v,t[79]=L):L=t[79],L}function Jn(e){return(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`text-2xl font-semibold text-foreground`,children:e.value})]},e.label)}function Yn(e){return e!==null}function Xn(e){let t=(0,Q.c)(4),{premiumUsd:n}=e,r;t[0]===n?r=t[1]:(r=W(n),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Premium `,(0,$.jsx)(`span`,{className:`text-foreground tabular-nums`,children:r})]}),t[2]=r,t[3]=i),i}var Zn=`t3code:usage-page-preferences:v1`,Qn=_({metric:f([`cost`,`tokens`,`limits`]),windowDays:f([1,7,30,90]),hiddenProviders:k(l(a))}),$n={metric:`limits`,windowDays:30};function er(){try{return S(Zn,Qn)??$n}catch(e){return console.error(`Could not read Usage page preferences.`,e),$n}}function tr(e){try{y(Zn,e,Qn)}catch(e){console.error(`Could not save Usage page preferences.`,e)}}function nr(e){return Re.some(t=>t.value===e)}function rr(e){return Ie.some(t=>t.days===e)}var ir=e=>Qe[e].label;function ar(){let[e,t]=(0,Z.useState)(er);oe();let n=p(ce),r=e=>{let t=je(n,e.command,{context:{usagePageOpen:!0}});return t?`${e.label} (${t})`:e.label},[i,a]=(0,Z.useState)(()=>({days:e.windowDays,window:G(e.windowDays,void 0,e.windowDays===1?`hour`:`day`)})),o=e.metric,s=o===`limits`,[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(()=>Date.now()),f=(0,Z.useRef)(!1),[m,h]=(0,Z.useState)(`model`),[g,_]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(null),S=(0,Z.useMemo)(()=>new Set(e.hiddenProviders),[e.hiddenProviders]),{days:C,window:w}=i,T=C===1,{merged:k,environments:A,selectedEnvironments:j,shown:N,isPartial:P,refresh:F}=Dt(w,b,S),I=N?.merged??k,L=N?.window??w,R=L.resolution===`hour`,z=c&&!s,ee=N!==null&&N.window!==w,B=(0,Z.useMemo)(()=>{if(ee)return{partial:!0,everyProvider:!0,providers:new Set};let e=ft(j,z),t=new Set([...e.providers].filter(e=>!S.has(e)));return{partial:e.everyProvider||t.size>0,everyProvider:e.everyProvider,providers:t}},[ee,z,j,S]),V=e=>B.everyProvider||B.providers.has(e),le=p(se.presentationsAtom),U=S.has(`cursor`)?[]:at(j),fe=[...new Set(j.flatMap(e=>e.summary?.sources.flatMap(e=>e.message&&!e.action&&!S.has(e.fingerprint.provider)&&(e.status===`partial`||e.status===`failed`||e.fingerprint.provider===`cursor`)?[e.message]:[])??[]))],ge=ue(H.refreshProviders,{reportFailure:!1}),X=j.some(e=>e.canReadDiagnostics),be=(0,Z.useMemo)(()=>Y(L.sinceDay,L.untilDay),[L.sinceDay,L.untilDay]),Se=(0,Z.useMemo)(()=>L.sinceTime===void 0||L.untilTime===void 0?[]:me(L.sinceTime,L.untilTime),[L.sinceTime,L.untilTime]),Ce=(0,Z.useMemo)(()=>(R?I.hourly:I.daily).toReversed(),[R,I.daily,I.hourly]),we=(0,Z.useMemo)(()=>m===`model`&&o===`tokens`?Rn(I.models):I.models,[m,I.models,o]),Te=(0,Z.useMemo)(()=>et(I.providers),[I.providers]),Ee=(0,Z.useMemo)(()=>$e.filter(e=>Te.includes(e)||B.providers.has(e)),[B.providers,Te]),De=(0,Z.useMemo)(()=>new Set(Ee.filter(e=>B.everyProvider||B.providers.has(e))),[Ee,B.everyProvider,B.providers]),Oe=v===null?void 0:I.models.find(e=>`${e.provider}:${e.model}`===v),Ae=we.reduce((e,t)=>Math.max(e,o===`tokens`?t.totalTokens:t.costUsd),0),ze=Ee.map(e=>({kind:`usage`,provider:e})),Ge=Math.max(Ee.indexOf(`codex`),Ee.indexOf(`claude`))+1;ze.splice(Ge,0,...U.map(e=>({kind:`enable`,environment:e})));let Ke=`${60/(Ee.length+2)}%`,Je=n=>{let r={...e,...n};t(r),tr(r)},nt=e=>{rr(e)&&(Je({windowDays:e}),a({days:e,window:G(e,void 0,e===1?`hour`:`day`)}))},Q=e=>{e===`limits`&&d(Date.now()),Je({metric:e})},rt=async(e=!1,t=!1)=>{try{await Promise.all(Array.from(le,([n,r])=>{if((b===null||b.has(n))&&r.connection.phase===`connected`&&r.serverConfig!==null)return ct(n,()=>ge({environmentId:n,input:{}}),e,t)}))}finally{d(Date.now())}},it=(0,Z.useEffectEvent)(e=>{if(e.defaultPrevented||e.repeat||e.isComposing||We()||Ue())return;let t=Le(e,n),r=Re.find(e=>e.command===t),i=Ie.find(e=>e.command===t);(r||i)&&(e.preventDefault(),e.stopPropagation(),r&&Q(r.value),i&&!s&&nt(i.days))});(0,Z.useEffect)(()=>(globalThis.window.addEventListener(`keydown`,it,!0),()=>globalThis.window.removeEventListener(`keydown`,it,!0)),[]);let ot=()=>{if(f.current)return;if(s){f.current=!0,l(!0),rt().finally(()=>{f.current=!1,l(!1)});return}let e=G(C,void 0,T?`hour`:`day`);(e.sinceDay!==w.sinceDay||e.untilDay!==w.untilDay||e.sinceTime!==w.sinceTime||e.untilTime!==w.untilTime)&&a({days:C,window:e}),f.current=!0,l(!0),F(e).finally(()=>{f.current=!1,l(!1)})},st=[...le].filter(([e,t])=>t.connection.phase===`connected`&&t.serverConfig!==null&&(b===null||b.has(e))).map(([e])=>e).sort().join(`,`),lt=(0,Z.useEffectEvent)(()=>{rt(!0)});(0,Z.useEffect)(()=>{s&&st&&lt()},[s,st]);let ut=R&&L.sinceTime!==void 0&&L.untilTime!==void 0?`${pe(L.sinceTime,L.timeZone)} to ${pe(L.untilTime,L.timeZone)}`:`${de(L.sinceDay)} to ${de(L.untilDay)}`,dt=(0,$.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 py-2 xl:flex`,children:[(0,$.jsxs)(Ze,{ariaLabel:`Usage breadcrumb`,className:`min-w-0`,children:[(0,$.jsx)(Ye,{children:(0,$.jsx)(`h1`,{children:`Usage`})}),(0,$.jsx)(Xe,{}),(0,$.jsx)(Ye,{className:`min-w-10 shrink`,children:(0,$.jsx)(vr,{environments:A,selectedEnvironments:j,selectedEnvironmentIds:b,onSelectionChange:x,showUsageStatus:!s,refreshing:z,isPartial:P,duplicateSources:I.duplicateSources,contractMismatches:I.contractMismatches,onOpenModelPrices:()=>_({})})}),(0,$.jsx)(Xe,{}),(0,$.jsx)(Ye,{current:!0,className:`min-w-10`,children:(0,$.jsx)(xr,{hiddenProviders:S,onChange:e=>Je({hiddenProviders:e})})})]}),s?null:(0,$.jsx)(`span`,{className:`hidden min-w-0 truncate text-xs text-muted-foreground 2xl:block`,children:ut}),(0,$.jsxs)(`div`,{className:`ms-auto hidden min-w-0 items-center justify-end gap-2 xl:flex`,children:[(0,$.jsx)(ve,{"aria-label":`Usage metric`,variant:`segmented`,value:[o],onValueChange:e=>{let t=e[0];nr(t)&&Q(t)},children:Re.map(e=>(0,$.jsx)(ye,{value:e.value,title:r(e),children:e.label},e.value))}),(0,$.jsx)(ve,{"aria-label":`Usage period`,variant:`segmented`,value:[String(C)],disabled:s,onValueChange:e=>{let t=e[0];t&&nt(Number(t))},children:Ie.map(e=>(0,$.jsx)(ye,{value:String(e.days),title:r(e),children:e.label},e.days))}),(0,$.jsx)(E,{onClick:ot,"aria-label":s?`Refresh limits`:`Refresh usage`,"aria-busy":c,disabled:c||!s&&!X,size:`icon-sm`,variant:`ghost`,children:(0,$.jsx)(He,{size:`sm`,refreshing:c})})]}),(0,$.jsxs)(`div`,{className:`ms-auto flex min-w-0 items-center justify-end gap-1 xl:hidden`,children:[(0,$.jsxs)(ae,{value:o,onValueChange:e=>{nr(e)&&Q(e)},children:[(0,$.jsx)(ie,{"aria-label":`Usage metric`,size:`compact`,variant:`ghost`,className:`w-auto min-w-0`,children:(0,$.jsx)(ne,{children:Re.find(e=>e.value===o)?.label})}),(0,$.jsx)(re,{align:`end`,alignItemWithTrigger:!1,children:Re.map(e=>(0,$.jsx)(te,{value:e.value,title:r(e),children:e.label},e.value))})]}),(0,$.jsxs)(ae,{value:String(C),disabled:s,onValueChange:e=>nt(Number(e)),children:[(0,$.jsx)(ie,{"aria-label":`Usage period`,size:`compact`,variant:`ghost`,className:`w-auto min-w-0`,children:(0,$.jsx)(ne,{children:Ie.find(e=>e.days===C)?.label})}),(0,$.jsx)(re,{align:`end`,alignItemWithTrigger:!1,children:Ie.map(e=>(0,$.jsx)(te,{value:String(e.days),title:r(e),children:e.label},e.days))})]}),(0,$.jsx)(E,{onClick:ot,"aria-label":s?`Refresh limits`:`Refresh usage`,"aria-busy":c,disabled:c||!s&&!X,size:`icon-sm`,variant:`ghost`,children:(0,$.jsx)(He,{size:`sm`,refreshing:c})})]})]});return(0,$.jsxs)(ke,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none isolate`,children:[(0,$.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground`,children:[(0,$.jsx)(qe,{electron:_e,children:dt}),(0,$.jsx)(xe,{className:`min-h-0 flex-1`,children:(0,$.jsx)(Fe,{width:`wide`,children:j.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:A.length===0?`Connect an environment to see ${s?`limits`:`usage`}.`:`Select an environment to see ${s?`limits`:`usage`}.`}):s?(0,$.jsx)(tt,{selectedEnvironmentIds:b,hiddenProviders:S,now:u,cursorPrompt:U.length>0?(0,$.jsx)(lr,{environments:U,onEnabled:()=>{F(),rt(!1,!0)}}):null}):N===null?(0,$.jsx)(Sr,{}):X?(0,$.jsxs)(`div`,{"aria-busy":B.partial,className:`flex flex-col gap-6`,children:[fe.map(e=>(0,$.jsx)(`p`,{className:`mb-4 text-sm text-muted-foreground`,children:e},e)),(0,$.jsxs)(`section`,{className:`grid gap-6 lg:grid-cols-[minmax(0,18rem)_minmax(0,1fr)]`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`span`,{className:O(`text-4xl font-semibold text-foreground tabular-nums`,dr(B.partial)),children:o===`cost`?W(I.costUsd):K(I.totalTokens)}),(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{children:[(0,$.jsxs)(`span`,{className:dr(B.partial),children:[q(I.sessions),` sessions`]}),o===`cost`&&` · API estimate`]}),o===`cost`&&I.costQuality.unpricedShare>0&&(0,$.jsxs)(Pe,{children:[(0,$.jsx)(Ne,{openOnHover:!0,render:(0,$.jsx)(D,{tone:`muted`}),"aria-label":`Unpriced usage details`,children:(0,$.jsx)(M,{className:`size-3`,"aria-hidden":!0})}),(0,$.jsxs)(Me,{side:`top`,tooltipStyle:!0,children:[`API estimate excludes`,` `,J(I.costQuality.unpricedShare),` unpriced records.`]})]})]})]}),!S.has(`codex`)&&[...le].some(([e,t])=>(b===null||b.has(e))&&t.serverConfig?.providers.some(Ve))?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(`span`,{children:`ChatGPT shared usage`}),(0,$.jsx)(Be,{size:`xs`})]}):null,ze.map(e=>{if(e.kind===`enable`)return(0,$.jsx)(cr,{environmentId:e.environment.environmentId,label:e.environment.label,showEnvironment:j.length>1,onEnabled:()=>{F(),rt(!1,!0)}},`enable:${e.environment.environmentId}`);let t=e.provider,n=I.providers.find(e=>e.provider===t),r=o===`cost`?n?.costShare??0:n?.tokenShare??0,i=n?.sessions??0,a=`${q(i)} ${i===1?`session`:`sessions`}`,s=V(t),c=s&&!Te.includes(t);return(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm text-foreground`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-2 shrink-0 rounded-full`,style:{backgroundColor:Qe[t].color}}),(0,$.jsx)(ur,{provider:t,className:`size-4`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,$.jsx)(`span`,{className:`truncate`,children:Qe[t].label}),(0,$.jsx)(`span`,{className:O(`shrink-0 whitespace-nowrap text-2xs text-muted-foreground tabular-nums`,dr(s),c&&`invisible`),children:a})]})]}),(0,$.jsx)(`span`,{className:O(`shrink-0 text-sm font-medium text-foreground tabular-nums`,dr(s)),children:c?`—`:o===`cost`?W(n?.costUsd??0):K(n?.totalTokens??0)})]}),(0,$.jsx)(`span`,{className:O(`text-xs text-muted-foreground`,dr(s),c&&`invisible`),children:o===`cost`?`${J(r)} of cost · ${K(n?.totalTokens??0)} tokens`:`${J(r)} of tokens · ${W(n?.costUsd??0)}`})]},t)})]}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,$.jsxs)(`h2`,{className:`text-sm font-medium text-foreground`,children:[R?`Hourly`:`Daily`,` `,o===`tokens`?`processed tokens`:`cost`]}),(0,$.jsx)(jn,{providers:Ee,loadingProviders:De,days:be,daily:I.daily,hours:Se,hourly:I.hourly,metric:o,referenceTime:L.untilTime,resolution:R?`hour`:`day`,timeZone:L.timeZone})]})]}),(0,$.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Totals`}),(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-4 py-1 md:grid-cols-5`,children:[(0,$.jsx)(fr,{loading:B.partial,label:`Processed tokens`,value:K(I.totalTokens)}),(0,$.jsx)(fr,{loading:B.partial,label:`Cached input`,value:K(I.cachedInputTokens)}),(0,$.jsx)(fr,{loading:B.partial,label:`Uncached input`,value:K(I.uncachedInputTokens)}),(0,$.jsx)(fr,{loading:B.partial,label:`Output`,value:K(I.outputTokens)}),(0,$.jsx)(fr,{loading:B.partial,label:`Cache savings`,value:W(I.costQuality.cacheSavingsUsd)})]})]}),I.totalTokens>0?(0,$.jsx)(`section`,{className:O(`grid gap-x-12 gap-y-8 lg:grid-cols-2`,dr(B.partial)),children:o===`tokens`?(0,$.jsx)(Fn,{label:`Tokens by type`,segments:Gn(I),format:K}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Fn,{label:`Cost by type`,segments:Wn(I.categoryCost),format:W}),I.speedCost.fast+I.speedCost.ultrafast>0?(0,$.jsx)(Fn,{label:`Cost by speed`,segments:Kn(I.speedCost),format:W,aside:(0,$.jsx)(Xn,{premiumUsd:I.speedCost.premium})}):null]})}):null,(0,$.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Breakdown`}),(0,$.jsx)(ve,{"aria-label":`Usage breakdown`,variant:`segmented`,value:[m],onValueChange:e=>{let t=e[0];(t===`model`||t===`time`)&&h(t)},children:[{value:`model`,label:`Model`},{value:`time`,label:R?`Hour`:`Day`}].map(e=>(0,$.jsx)(ye,{value:e.value,children:e.label},e.value))})]}),m===`model`?(0,$.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{className:`border-b border-border text-right text-xs text-muted-foreground`,children:[(0,$.jsx)(`th`,{className:`py-2 pr-3 text-left font-normal`,children:`#`}),(0,$.jsx)(`th`,{className:`w-full py-2 text-left font-normal`,children:`Model`}),(0,$.jsx)(`th`,{className:`py-2 pl-6 font-normal`,children:`Cost`}),(0,$.jsx)(`th`,{className:`hidden py-2 pl-6 font-normal sm:table-cell`,children:`Share`}),(0,$.jsx)(`th`,{className:`py-2 pl-6 font-normal`,children:`Tokens`})]})}),(0,$.jsx)(`tbody`,{children:we.length===0?(0,$.jsx)(`tr`,{children:(0,$.jsx)(`td`,{colSpan:5,className:`py-6 text-center text-muted-foreground`,children:`No activity in this window.`})}):we.map((e,t)=>{let n=`${e.provider}:${e.model}`,r=o===`tokens`?e.totalTokens:e.costUsd,i=zn(e,o===`tokens`?`tokens`:`cost`),a=dr(V(e.provider));return(0,$.jsxs)(`tr`,{className:`relative border-b border-border/50 text-right whitespace-nowrap text-muted-foreground tabular-nums transition-colors hover:bg-muted/50 has-focus-visible:bg-muted/50`,children:[(0,$.jsx)(`td`,{className:`py-2.5 pr-3 text-left text-xs`,children:t+1}),(0,$.jsxs)(`td`,{className:`py-2.5 text-left whitespace-normal`,children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>y(n),className:`flex items-center gap-2 text-left text-foreground outline-none after:absolute after:inset-0`,children:[(0,$.jsx)(ur,{provider:e.provider,className:`size-3.5`}),e.model]}),(0,$.jsx)(`div`,{"aria-hidden":!0,className:O(`mt-1.5 h-0.5 max-w-48`,a),children:(0,$.jsx)(`div`,{className:`h-full rounded-full`,style:{width:r>0&&Ae>0?`max(0.5rem, ${r/Ae*100}%)`:0,backgroundColor:Qe[e.provider].color}})})]}),(0,$.jsx)(`td`,{className:O(`py-2.5 pl-6 text-foreground`,a),children:pt(e)?(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Unpriced`}):W(e.costUsd)}),(0,$.jsx)(`td`,{className:O(`hidden py-2.5 pl-6 sm:table-cell`,a),children:i===null?``:J(i)}),(0,$.jsx)(`td`,{className:O(`py-2.5 pl-6`,a),children:K(e.totalTokens)})]},n)})})]}):(0,$.jsxs)(`table`,{className:`w-full table-fixed text-sm`,children:[(0,$.jsxs)(`colgroup`,{children:[(0,$.jsx)(`col`,{className:`w-2/5`}),Ee.map(e=>(0,$.jsx)(`col`,{style:{width:Ke}},e)),(0,$.jsx)(`col`,{style:{width:Ke}}),(0,$.jsx)(`col`,{style:{width:Ke}})]}),(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{className:`border-b border-border text-left text-xs text-muted-foreground`,children:[(0,$.jsx)(`th`,{className:`py-2 font-normal`,children:R?`Hour`:`Day`}),Ee.map(e=>(0,$.jsx)(`th`,{className:`py-2 text-right font-normal`,children:Qe[e].label},e)),(0,$.jsx)(`th`,{className:`py-2 text-right font-normal`,children:`Total`}),(0,$.jsx)(`th`,{className:`py-2 text-right font-normal`,children:`Tokens`})]})}),(0,$.jsx)(`tbody`,{children:Ce.length===0?(0,$.jsx)(`tr`,{children:(0,$.jsx)(`td`,{colSpan:Ee.length+3,className:`py-6 text-center text-muted-foreground`,children:`No activity in this window.`})}):Ce.map(e=>(0,$.jsxs)(`tr`,{className:`border-b border-border/50 transition-colors hover:bg-muted/50`,children:[(0,$.jsx)(`td`,{className:`py-2 text-foreground`,children:`hourStart`in e?he(e.hourStart,L.timeZone):de(e.day)}),Ee.map(t=>(0,$.jsx)(`td`,{className:O(`py-2 text-right text-muted-foreground tabular-nums`,dr(V(t))),children:W(e.byProvider.get(t)?.costUsd??0)},t)),(0,$.jsx)(`td`,{className:O(`py-2 text-right text-foreground tabular-nums`,dr(B.partial)),children:W(e.costUsd)}),(0,$.jsx)(`td`,{className:O(`py-2 text-right text-muted-foreground tabular-nums`,dr(B.partial)),children:K(e.totalTokens)})]},`hourStart`in e?e.hourStart:e.day))})]})]})]}):(0,$.jsx)(`div`,{className:`space-y-2 py-12 text-center text-sm text-muted-foreground`,children:j.map(e=>(0,$.jsxs)(`p`,{children:[j.length>1?`${e.label}: `:null,e.error]},e.environmentId))})})})]}),Oe!==void 0&&!s?(0,$.jsx)(qn,{model:Oe,environments:j,metric:o===`tokens`?`tokens`:`cost`,chartWindow:{days:be,hours:Se,resolution:R?`hour`:`day`,timeZone:L.timeZone,referenceTime:L.untilTime},onSetPrice:()=>{y(null),_({model:Oe.model})},onClose:()=>y(null)}):null,g?(0,$.jsx)(Xt,{usage:A,initialSelectedEnvironmentIds:b,initialModel:g.model,onOpenChange:e=>{e||_(null)}}):null]})}var or=`Requires access to your Cursor login in macOS Keychain.`;function sr({environmentId:e,label:t,onEnabled:n,tooltip:r,buttonText:i=`Enable`}){let a=ue(H.updateSettings,{label:`enable Cursor account usage`}),[o,s]=(0,Z.useState)(!1),c=async()=>{s(!0);try{(await a({environmentId:e,input:{patch:{cursorKeychainUsageEnabled:!0}}}))._tag===`Success`&&n()}finally{s(!1)}},l=r?(0,$.jsx)(D,{disabled:o,"aria-busy":o,"aria-label":`Enable Cursor usage from ${t}`,onClick:()=>void c(),children:i}):(0,$.jsx)(E,{size:`sm`,variant:`outline`,disabled:o,"aria-busy":o,"aria-label":`Enable Cursor usage from ${t}`,onClick:()=>void c(),children:i});return r?(0,$.jsxs)(V,{children:[(0,$.jsx)(ee,{render:l}),(0,$.jsx)(B,{children:or})]}):l}function cr(e){let t=(0,Q.c)(11),{environmentId:n,label:r,showEnvironment:i,onEnabled:a}=e,o,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-2 shrink-0 rounded-full`,style:{backgroundColor:Qe.cursor.color}}),s=(0,$.jsx)(ur,{provider:`cursor`,className:`size-4`}),t[0]=o,t[1]=s):(o=t[0],s=t[1]);let c=i?` · ${r}`:``,l;t[2]===c?l=t[3]:(l=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm text-foreground`,children:[o,s,(0,$.jsxs)(`span`,{className:`truncate`,children:[`Cursor`,c]})]}),t[2]=c,t[3]=l);let u;t[4]!==n||t[5]!==r||t[6]!==a?(u=(0,$.jsx)(sr,{environmentId:n,label:r,onEnabled:a,tooltip:!0}),t[4]=n,t[5]=r,t[6]=a,t[7]=u):u=t[7];let d;return t[8]!==l||t[9]!==u?(d=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-baseline justify-between gap-4 text-sm`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10],d}function lr(e){let t=(0,Q.c)(10),{environments:n,onEnabled:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,$.jsx)(ze,{driverKind:C.make(`cursor`),displayName:`Cursor`,indicatorBackground:`var(--background)`,className:`size-5`,iconClassName:`size-4 text-foreground/80`}),`Cursor`]}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:or}),t[1]=a):a=t[1];let o;if(t[2]!==n||t[3]!==r){let e;t[5]!==n.length||t[6]!==r?(e=e=>(0,$.jsx)(sr,{environmentId:e.environmentId,label:e.label,buttonText:n.length>1?`Enable on ${e.label}`:`Enable`,onEnabled:r,tooltip:!1},e.environmentId),t[5]=n.length,t[6]=r,t[7]=e):e=t[7],o=n.map(e),t[2]=n,t[3]=r,t[4]=o}else o=t[4];let s;return t[8]===o?s=t[9]:(s=(0,$.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[i,(0,$.jsxs)(`div`,{className:`flex flex-col items-start gap-3 rounded-lg border border-border/60 p-4`,children:[a,(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:o})]})]}),t[8]=o,t[9]=s),s}function ur(e){let t=(0,Q.c)(4),{provider:n,className:r}=e,i=Qe[n],a;return t[0]!==r||t[1]!==i.driverKind||t[2]!==i.label?(a=(0,$.jsx)(ze,{driverKind:i.driverKind,displayName:i.label,iconClassName:r}),t[0]=r,t[1]=i.driverKind,t[2]=i.label,t[3]=a):a=t[3],a}function dr(e){return O(`transition-opacity`,e&&`opacity-40 delay-150`)}function fr(e){let t=(0,Q.c)(10),{label:n,value:r,loading:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=O(`text-base font-medium text-foreground tabular-nums`,dr(i)),t[2]=i,t[3]=o);let s;t[4]!==o||t[5]!==r?(s=(0,$.jsx)(`span`,{className:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==s?(c=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function pr(e){let t=(0,Q.c)(14),{environments:n,duplicateSources:r,contractMismatches:i}=e,a,o,s,c;if(t[0]!==i||t[1]!==r||t[2]!==n){c=Symbol.for(`react.early_return_sentinel`);bb0:{let e=n.filter(_r),t=new Map(i.map(gr)),l=n.flatMap(e=>{let n=t.get(e.environmentId);return n===void 0?[]:[{environment:e,mismatch:n}]});if(e.length===0&&l.length===0&&r.length===0){c=null;break bb0}a=`flex flex-col gap-1 border-t border-border px-2 py-2 text-xs text-muted-foreground`,o=e.map(hr),s=l.map(mr)}t[0]=i,t[1]=r,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c}else a=t[3],o=t[4],s=t[5],c=t[6];if(c!==Symbol.for(`react.early_return_sentinel`))return c;let l;t[7]===r?l=t[8]:(l=r.length>0?(0,$.jsxs)(`span`,{children:[`Counted once across environments sharing a transcript directory:`,` `,r.join(`, `)]}):null,t[7]=r,t[8]=l);let u;return t[9]!==a||t[10]!==o||t[11]!==s||t[12]!==l?(u=(0,$.jsxs)(`div`,{className:a,children:[o,s,l]}),t[9]=a,t[10]=o,t[11]=s,t[12]=l,t[13]=u):u=t[13],u}function mr(e){let{environment:t,mismatch:n}=e;return(0,$.jsx)(`span`,{children:ge(t.label,n)},t.environmentId)}function hr(e){return(0,$.jsxs)(`span`,{children:[e.label,`: `,e.error]},e.label)}function gr(e){return[e.environmentId,e]}function _r(e){return e.error!==null}function vr(e){let t=(0,Q.c)(56),{environments:n,selectedEnvironments:i,selectedEnvironmentIds:a,onSelectionChange:o,showUsageStatus:c,refreshing:l,isPartial:u,duplicateSources:d,contractMismatches:f,onOpenModelPrices:p}=e,m=a===null,_=m?`All environments`:i.length===1?i[0].label:`${i.length} environments`,v;t[0]!==f||t[1]!==i?(v=i.some(br)||f.length>0,t[0]=f,t[1]=i,t[2]=v):v=t[2];let y=v,S;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(D,{}),t[3]=S):S=t[3];let C;t[4]===_?C=t[5]:(C=(0,$.jsx)(Je,{children:_}),t[4]=_,t[5]=C);let w;t[6]!==y||t[7]!==c?(w=(0,$.jsx)(`span`,{className:`flex size-3.5 shrink-0 items-center justify-center text-muted-foreground`,children:c&&y?(0,$.jsx)(j,{className:`size-3.5 text-warning-foreground`,"aria-label":`Some environments could not report usage`}):(0,$.jsx)(A,{className:`size-3.5 opacity-0 transition-opacity group-hover/usage-environment:opacity-100 group-focus-visible/usage-environment:opacity-100 group-data-popup-open/usage-environment:opacity-100`,"aria-hidden":!0})}),t[6]=y,t[7]=c,t[8]=w):w=t[8];let T;t[9]!==C||t[10]!==w?(T=(0,$.jsxs)(b,{render:S,className:`group/usage-environment min-w-0 max-w-full`,children:[C,w]}),t[9]=C,t[10]=w,t[11]=T):T=t[11];let E;t[12]===o?E=t[13]:(E=e=>o(e?null:new Set),t[12]=o,t[13]=E);let k;t[14]!==m||t[15]!==E?(k=(0,$.jsx)(r,{checked:m,closeOnClick:!1,onCheckedChange:E,children:`All environments`}),t[14]=m,t[15]=E,t[16]=k):k=t[16];let M;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(x,{}),t[17]=M):M=t[17];let N;if(t[18]!==n||t[19]!==o||t[20]!==l||t[21]!==a||t[22]!==i||t[23]!==c){let e;t[25]!==n.length||t[26]!==o||t[27]!==l||t[28]!==a||t[29]!==i||t[30]!==c?(e=e=>{let t=a===null||a.has(e.environmentId),s=ut(e,l),u=e.error===null?e.summary!==null&&!bt(e.summary.contractVersion,6)?`Update required`:e.isConnected?s.phase===`loading`?`Scanning…`:s.phase===`stale`?`Refreshing…`:s.phase===`partway`?dt(s.providers,ir):`Ready`:`Connecting…`:`Unavailable`;return(0,$.jsx)(r,{checked:t,closeOnClick:!1,onCheckedChange:t=>{let r=new Set(i.map(yr));t?r.add(e.environmentId):r.delete(e.environmentId),o(r.size===n.length?null:r)},children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),c?(0,$.jsx)(`span`,{className:O(`shrink-0 text-xs text-muted-foreground`,e.error!==null&&`text-destructive`),children:u}):null]})},e.environmentId)},t[25]=n.length,t[26]=o,t[27]=l,t[28]=a,t[29]=i,t[30]=c,t[31]=e):e=t[31],N=n.map(e),t[18]=n,t[19]=o,t[20]=l,t[21]=a,t[22]=i,t[23]=c,t[24]=N}else N=t[24];let F;t[32]===n.length?F=t[33]:(F=n.length===0?(0,$.jsx)(`p`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`No environments connected.`}):null,t[32]=n.length,t[33]=F);let I;t[34]!==u||t[35]!==c?(I=c&&u?(0,$.jsx)(`p`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`Totals are partial while selected environments scan.`}):null,t[34]=u,t[35]=c,t[36]=I):I=t[36];let L;t[37]!==f||t[38]!==d||t[39]!==i||t[40]!==c?(L=c?(0,$.jsx)(pr,{environments:i,duplicateSources:d,contractMismatches:f}):null,t[37]=f,t[38]=d,t[39]=i,t[40]=c,t[41]=L):L=t[41];let R;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(x,{}),t[42]=R):R=t[42];let z;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(P,{"aria-hidden":!0}),t[43]=z):z=t[43];let ee;t[44]===p?ee=t[45]:(ee=(0,$.jsxs)(s,{onClick:p,children:[z,`Model prices`]}),t[44]=p,t[45]=ee);let B;t[46]!==F||t[47]!==I||t[48]!==L||t[49]!==ee||t[50]!==k||t[51]!==N?(B=(0,$.jsxs)(g,{align:`start`,children:[k,M,N,F,I,L,R,ee]}),t[46]=F,t[47]=I,t[48]=L,t[49]=ee,t[50]=k,t[51]=N,t[52]=B):B=t[52];let V;return t[53]!==B||t[54]!==T?(V=(0,$.jsxs)(h,{children:[T,B]}),t[53]=B,t[54]=T,t[55]=V):V=t[55],V}function yr(e){return e.environmentId}function br(e){return e.error!==null}function xr(e){let t=(0,Q.c)(23),{hiddenProviders:n,onChange:i}=e,a;t[0]===n?a=t[1]:(a=$e.filter(e=>!n.has(e)),t[0]=n,t[1]=a);let o=a,s=o.length===$e.length?`All providers`:o.length===0?`No providers`:o.length===1?Qe[o[0]].label:`${o.length} providers`,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(D,{}),t[2]=c):c=t[2];let l;t[3]===s?l=t[4]:(l=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),t[3]=s,t[4]=l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(A,{className:`size-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/usage-provider:opacity-100 group-focus-visible/usage-provider:opacity-100 group-data-popup-open/usage-provider:opacity-100`,"aria-hidden":!0}),t[5]=u):u=t[5];let d;t[6]===l?d=t[7]:(d=(0,$.jsxs)(b,{render:c,className:`group/usage-provider min-w-0 max-w-full`,children:[l,u]}),t[6]=l,t[7]=d);let f=n.size===0,p;t[8]===i?p=t[9]:(p=e=>i(e?[]:$e),t[8]=i,t[9]=p);let m;t[10]!==f||t[11]!==p?(m=(0,$.jsx)(r,{checked:f,closeOnClick:!1,onCheckedChange:p,children:`All providers`}),t[10]=f,t[11]=p,t[12]=m):m=t[12];let _;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(x,{}),t[13]=_):_=t[13];let v;t[14]!==n||t[15]!==i?(v=$e.map(e=>(0,$.jsx)(r,{checked:!n.has(e),closeOnClick:!1,onCheckedChange:t=>i($e.filter(r=>r===e?!t:n.has(r))),children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(ur,{provider:e,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`truncate`,children:Qe[e].label})]})},e)),t[14]=n,t[15]=i,t[16]=v):v=t[16];let y;t[17]!==v||t[18]!==m?(y=(0,$.jsxs)(g,{align:`start`,children:[m,_,v]}),t[17]=v,t[18]=m,t[19]=y):y=t[19];let S;return t[20]!==y||t[21]!==d?(S=(0,$.jsxs)(h,{children:[d,y]}),t[20]=y,t[21]=d,t[22]=S):S=t[22],S}function Sr(){let e=(0,Q.c)(7),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(X,{className:`h-10 w-36`}),(0,$.jsx)(X,{className:`h-4 w-32`})]}),$e.map(Cr)]}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(X,{className:`h-5 w-24`}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`section`,{className:`grid gap-6 lg:grid-cols-[minmax(0,18rem)_minmax(0,1fr)]`,children:[t,(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[n,(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(X,{className:`ml-16 h-56`}),(0,$.jsx)(X,{className:`ml-16 h-4`})]})]})]}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Totals`}),e[3]=i):i=e[3];let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[i,(0,$.jsx)(wr,{labels:[`Processed tokens`,`Cached input`,`Uncached input`,`Output`,`Cache savings`]})]}),e[4]=a):a=e[4];let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(`section`,{className:`grid gap-x-12 gap-y-8 lg:grid-cols-2`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,$.jsx)(X,{className:`h-5 w-28`}),(0,$.jsx)(X,{className:`h-2`}),(0,$.jsx)(X,{className:`h-4 w-72`})]})}),e[5]=o):o=e[5];let s;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsxs)($.Fragment,{children:[r,a,o,(0,$.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Breakdown`}),(0,$.jsx)(X,{shape:`card`,className:`h-7 w-28`})]}),(0,$.jsx)(X,{className:`h-44`})]})]}),e[6]=s):s=e[6],s}function Cr(e){return(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsxs)(`div`,{className:`flex min-h-5 items-center justify-between gap-4`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(X,{shape:`pill`,className:`size-2 shrink-0`}),(0,$.jsx)(X,{shape:`pill`,className:`size-4 shrink-0`}),(0,$.jsx)(X,{className:`h-3.5 w-20`})]}),(0,$.jsx)(X,{className:`h-3.5 w-14`})]}),(0,$.jsx)(X,{className:`h-4 w-36`})]},e)}function wr(e){let t=(0,Q.c)(4),{labels:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Tr),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-4 py-1 md:grid-cols-5`,children:r}),t[2]=r,t[3]=i),i}function Tr(e){return(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,$.jsx)(X,{className:`h-6 w-16`})]},e)}var Er=ar;export{Er as component};
2
- //# sourceMappingURL=usage-BoYlRHNx.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$m as n,$o as r,Eh as i,Fm as a,Gn as o,Go as s,Ic as c,Jn as l,Kb as u,Lo as d,Rf as f,Um as p,Uo as m,Vo as h,Wn as g,Xn as _,_s as v,ar as y,dm as b,er as x,hs as S,ma as C,ms as w,or as T,sr as E,t as D,wx as O,yh as k}from"./utils-DmS758az.js";import{t as A}from"./chevron-down-DHV04o66.js";import{t as j}from"./circle-alert-B83jEPoh.js";import{t as M}from"./info-BHB-83EA.js";import{t as N}from"./plus-Cr075-cy.js";import{t as P}from"./sliders-horizontal-lg5XUMZM.js";import{t as F}from"./x-CSwbgjBe.js";import{I,K as L,U as R,z}from"./runtime-CCr9UADV.js";import{a as ee,n as B,t as V}from"./tooltip-Df-4YKs5.js";import{a as te,c as ne,o as re,s as ie,t as ae}from"./select-BiARKKgd.js";import{t as oe}from"./useNavigateBack-AIHPN0Oo.js";import{rt as se}from"./useSettings-CckatJFa.js";import{f as H,s as ce}from"./server-B26doYv6.js";import{n as le,t as U}from"./session-CQXL-cTI.js";import{t as ue}from"./use-atom-command-CiEeUGsC.js";import{a as de,c as fe,d as W,f as G,i as pe,l as K,n as me,o as he,r as q,s as J,t as Y,u as ge}from"./usageFormat-DKCO_wk0.js";import{t as _e}from"./env-wK1YYxA8.js";import{t as X}from"./skeleton-CtSxs1y1.js";import{n as ve,t as ye}from"./toggle-group-_C7nJPTT.js";import{t as be}from"./input-u5qjnfMr.js";import{t as xe}from"./scroll-area-CsrtHuL8.js";import{a as Se,c as Ce,i as we,o as Te,r as Ee,s as De,t as Oe}from"./dialog-DhJeevKt.js";import{o as ke}from"./sidebar-Dj0htG-5.js";import{t as Ae}from"./observeResize-WQaFQjbx.js";import{v as je}from"./keybindings-CzL-fWkh.js";import{i as Me,o as Ne,t as Pe}from"./popover-6BYEGLLK.js";import{t as Fe}from"./WorkspacePageContainer-BFo6qTGJ.js";import{n as Ie,r as Le,t as Re}from"./usageShortcuts-DxLRXv0W.js";import{b as ze,t as Be,y as Ve}from"./ChatGptUsageButton-7IZqWaQq.js";import{Ia as He,Ii as Ue,Ti as We,Za as Ge,zr as Ke}from"./main-D9z9rMK1.js";import{t as qe}from"./WorkspacePageHeader-BCZXPSxj.js";import{i as Je,n as Ye,r as Xe,t as Ze}from"./WorkspaceBreadcrumb-DX3xH6tC.js";import{a as Qe,i as $e,o as et,r as tt}from"./UsageLimits-BUS51Bjr.js";import{t as nt}from"./usageAccess-BNLOTFbF.js";var Z=e(t(),1),Q=O(),rt=k(L);function it(e,t){return e?.sources.some(e=>e.action===`enableCursorKeychain`)===!0&&t?.some(e=>e.driver===`cursor`&&e.status===`ready`)===!0}function at(e){return e.some(e=>e.summary?.sources.some(e=>e.fingerprint.provider===`cursor`&&e.fingerprint.hostId===`cursor.com`))?[]:e.filter(e=>e.needsCursorKeychainAccess)}var ot=new Map,st=new Map;async function ct(e,t,n=!1,r=!1){let i=st.get(e);if(i!==void 0){if(r){try{await i}catch{}return ct(e,t,!1,!0)}return n?void 0:await i}let a=ot.get(e)??0;if(n&&Date.now()<a)return;let o=Promise.resolve().then(t).finally(()=>{st.delete(e),ot.set(e,Date.now()+3e5)});return st.set(e,o),await o}async function lt({registry:e,server:t,presentations:n,environmentIds:r,input:i}){await Promise.all(r.map(async r=>{let a=t.usageSummary({environmentId:r,input:i}),o=n.presentationAtom(r),s=new AbortController,c=()=>{e.get(o)?.connection.phase!==`connected`&&s.abort()},l=e.subscribe(o,c);c();try{let n=await z(e,t.refreshUsageRates,{environmentId:r,input:{}},{reportFailure:!1}),i=n._tag===`Failure`&&rt(R(n));if(e.refresh(a),i||s.signal.aborted)return;await I(e,a,{reportFailure:!1,signal:s.signal})}finally{l()}}))}function ut(e,t=!1){let{summary:n}=e;if(!e.isConnected||e.error!==null)return{phase:`inactive`};if(n===null)return{phase:`loading`};if(t)return{phase:`stale`};if(!e.isPending)return{phase:`ready`};let r=[...new Set(n.sources.flatMap(e=>e.refreshing?[e.fingerprint.provider]:[]))];return r.length>0?{phase:`partway`,providers:r}:{phase:`stale`}}function dt(e,t){return e.length===1?`Updating ${t(e[0])}…`:`Updating ${e.length} providers…`}function ft(e,t=!1){let n=new Set,r=!1;for(let i of e){let e=ut(i,t);if((e.phase===`loading`||e.phase===`stale`)&&(r=!0),e.phase===`partway`)for(let t of e.providers)n.add(t)}return{partial:r||n.size>0,everyProvider:r,providers:n}}function pt(e){return e.records>0&&e.unpricedRecords>=e.records}function mt(e){return[e.hostId,e.provider,e.resolvedHomePath,e.volumeId].join(` `)}function ht(e,t){let n=e.sources.filter(e=>e.fingerprint.provider===t.fingerprint.provider);return e.buckets.filter(e=>e.provider===t.fingerprint.provider&&(e.sourcePath===t.fingerprint.resolvedHomePath||e.sourcePath===void 0&&n.length===1))}function gt(e){return JSON.stringify([e.day,e.hourStart??null,e.provider,e.model])}function _t(e){let t=new Map,n=new Map,r=new Map,i=new Map,a=new Map,o=[],s=[...e].sort((e,t)=>(Date.parse(t.summary.readAt)||0)-(Date.parse(e.summary.readAt)||0)||e.environmentId.localeCompare(t.environmentId));for(let e of[`ok`,`partial`,`failed`])for(let r of s)for(let i of r.summary.sources){if(i.status!==e)continue;let s=mt(i.fingerprint);if(t.has(s)){o.push(`${r.label}: ${i.fingerprint.resolvedHomePath}`);continue}t.set(s,r.environmentId),n.set(s,{environment:r,source:i}),a.set(s,i.distinctSessions)}for(let e of s)for(let t of e.summary.sources){if(t.status!==`partial`)continue;let o=mt(t.fingerprint),s=n.get(o);if(s?.source.status!==`ok`||Date.parse(e.summary.readAt)<=Date.parse(s.environment.summary.readAt))continue;let c=r.get(o);c===void 0&&(c=new Set(ht(s.environment.summary,s.source).map(gt)),r.set(o,c));let l=i.get(e.environmentId)??new Set,u=!1;for(let n of ht(e.summary,t)){let e=gt(n);c.has(e)||(c.add(e),l.add(n),u=!0)}u&&(i.set(e.environmentId,l),a.set(o,Math.max(a.get(o)??0,t.distinctSessions)))}return{ownerByFingerprint:t,supplementalBucketsByEnvironment:i,sessionsByFingerprint:a,duplicates:o}}function vt(e,t,n,r){let i=new Set,a=new Set,o=new Map;for(let n of e.summary.sources){if(n.status===`missing`)continue;let s=mt(n.fingerprint);if(t.get(s)===e.environmentId){let e=n.fingerprint.provider;i.add(e),a.add(`${e}\u0000${n.fingerprint.resolvedHomePath}`),o.set(e,(o.get(e)??0)+(r.get(s)??n.distinctSessions))}}return{buckets:e.summary.buckets.filter(e=>n.has(e)||(e.sourcePath===void 0?i.has(e.provider):a.has(`${e.provider}\u0000${e.sourcePath}`))),sessionsByProvider:o}}function yt(e){return e.totals.uncachedInputTokens+e.totals.cachedInputTokens+e.totals.cacheCreationTokens+e.totals.outputTokens}function bt(e,t){return e>=4&&e<=t}var xt={costUsd:0,uncachedInputTokens:0,cachedInputTokens:0,cacheCreationTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,records:0,sessions:0,providers:[],models:[],daily:[],hourly:[],costQuality:{providerReportedShare:0,modelPricedShare:0,unpricedShare:0,cacheSavingsUsd:0},categoryCost:{input:0,cacheRead:0,cacheWrite:0,output:0,unsplit:0},speedCost:{standard:0,fast:0,ultrafast:0,premium:0},duplicateSources:[],contributingEnvironments:[],contractMismatches:[]};function St(e,t){if(e.length===0)return xt;let n=[],r=[];for(let i of e)bt(i.summary.contractVersion,t)?n.push(i):r.push({environmentId:i.environmentId,direction:i.summary.contractVersion<t?`serverBehind`:`clientBehind`,contractVersion:i.summary.contractVersion});let{ownerByFingerprint:i,supplementalBucketsByEnvironment:a,sessionsByFingerprint:o,duplicates:s}=_t(n),c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y={input:0,cacheRead:0,cacheWrite:0,output:0},b={fast:0,ultrafast:0,premium:0},x=new Map,S=new Map,C=new Map,w=new Map,T=[];for(let e of n){let{buckets:t,sessionsByProvider:n}=vt(e,i,a.get(e.environmentId)??new Set,o);t.length>0&&T.push(e.environmentId);for(let[e,t]of n){if(h+=t,t===0)continue;let n=x.get(e)??{costUsd:0,totalTokens:0,records:0,sessions:0};n.sessions+=t,x.set(e,n)}for(let e of t){let t=yt(e);c+=e.costUsd,g+=e.cacheSavingsUsd,l+=e.totals.uncachedInputTokens,u+=e.totals.cachedInputTokens,d+=e.totals.cacheCreationTokens,f+=e.totals.outputTokens,p+=e.totals.reasoningTokens,m+=e.records,v+=e.unpricedRecords,e.costSource===`providerReported`&&(_+=e.records),e.categoryCostUsd!==void 0&&(y.input+=e.categoryCostUsd.input,y.cacheRead+=e.categoryCostUsd.cacheRead,y.cacheWrite+=e.categoryCostUsd.cacheWrite,y.output+=e.categoryCostUsd.output),b.fast+=e.fastCostUsd??0,b.ultrafast+=e.ultrafastCostUsd??0,b.premium+=e.speedPremiumUsd??0;let n=x.get(e.provider)??{costUsd:0,totalTokens:0,records:0,sessions:0};n.costUsd+=e.costUsd,n.totalTokens+=t,n.records+=e.records,x.set(e.provider,n);let r=`${e.provider} ${e.model}`,i=S.get(r)??{provider:e.provider,costUsd:0,totalTokens:0,tokens:{uncachedInputTokens:0,cachedInputTokens:0,cacheCreationTokens:0,outputTokens:0,reasoningTokens:0},records:0,unpricedRecords:0,unpricedTokens:0};i.costUsd+=e.costUsd,i.totalTokens+=t,i.tokens={uncachedInputTokens:i.tokens.uncachedInputTokens+e.totals.uncachedInputTokens,cachedInputTokens:i.tokens.cachedInputTokens+e.totals.cachedInputTokens,cacheCreationTokens:i.tokens.cacheCreationTokens+e.totals.cacheCreationTokens,outputTokens:i.tokens.outputTokens+e.totals.outputTokens,reasoningTokens:i.tokens.reasoningTokens+e.totals.reasoningTokens},i.records+=e.records,i.unpricedRecords+=e.unpricedRecords,e.records>0&&(i.unpricedTokens+=t*e.unpricedRecords/e.records),S.set(r,i);let a=C.get(e.day)??{costUsd:0,totalTokens:0,byProvider:new Map};a.costUsd+=e.costUsd,a.totalTokens+=t;let o=a.byProvider.get(e.provider)??{costUsd:0,totalTokens:0};if(o.costUsd+=e.costUsd,o.totalTokens+=t,a.byProvider.set(e.provider,o),C.set(e.day,a),e.hourStart!==void 0){let n=w.get(e.hourStart)??{day:e.day,hourStart:e.hourStart,costUsd:0,totalTokens:0,byProvider:new Map};n.costUsd+=e.costUsd,n.totalTokens+=t;let r=n.byProvider.get(e.provider)??{costUsd:0,totalTokens:0};r.costUsd+=e.costUsd,r.totalTokens+=t,n.byProvider.set(e.provider,r),w.set(e.hourStart,n)}}}let E=l+u+d+f,D=[...x.entries()].map(([e,t])=>({provider:e,costUsd:t.costUsd,totalTokens:t.totalTokens,records:t.records,sessions:t.sessions,costShare:c===0?0:t.costUsd/c,tokenShare:E===0?0:t.totalTokens/E})).sort((e,t)=>t.costUsd-e.costUsd),O=[...S.entries()].map(([e,t])=>({model:e.slice(e.indexOf(` `)+1),provider:t.provider,costUsd:t.costUsd,totalTokens:t.totalTokens,tokens:t.tokens,records:t.records,unpricedRecords:t.unpricedRecords,unpricedTokens:t.unpricedTokens,costShare:c===0?0:t.costUsd/c,tokenShare:E===0?0:t.totalTokens/E})).sort((e,t)=>t.costUsd-e.costUsd||t.totalTokens-e.totalTokens),k=[...C.entries()].map(([e,t])=>({day:e,costUsd:t.costUsd,totalTokens:t.totalTokens,byProvider:t.byProvider})).sort((e,t)=>e.day.localeCompare(t.day)),A=[...w.values()].sort((e,t)=>e.hourStart.localeCompare(t.hourStart));return{costUsd:c,uncachedInputTokens:l,cachedInputTokens:u,cacheCreationTokens:d,outputTokens:f,reasoningTokens:p,totalTokens:E,records:m,sessions:h,providers:D,models:O,daily:k,hourly:A,costQuality:{providerReportedShare:m===0?0:_/m,unpricedShare:m===0?0:v/m,modelPricedShare:m===0?0:(m-_-v)/m,cacheSavingsUsd:g},categoryCost:{...y,unsplit:Math.max(0,c-y.input-y.cacheRead-y.cacheWrite-y.output)},speedCost:{...b,standard:Math.max(0,c-b.fast-b.ultrafast)},duplicateSources:s,contributingEnvironments:T,contractMismatches:r}}var Ct=m(e=>s(t=>{let n=JSON.parse(e),r=t(se.presentationsAtom),i=[];for(let[e,a]of r){let r=a.connection.phase===`connected`,o=t(U.sessionStateAtom(e)),s=nt({connectionPhase:a.connection.phase,session:u(w(o)),hasSessionError:o._tag===`Failure`});if(!s.canReadDiagnostics){i.push({environmentId:e,label:a.entry.target.label,isConnected:r,...s,summary:null,needsCursorKeychainAccess:!1});continue}let c=t(H.usageSummary({environmentId:e,input:n})),l=u(w(c));i.push({environmentId:e,label:a.entry.target.label,isPending:c.waiting,canReadDiagnostics:!0,isConnected:r,error:c._tag===`Failure`?`This environment could not report usage.`:null,summary:l,needsCursorKeychainAccess:it(l,t(H.providersValueAtom(e)))})}return i}).pipe(r(`web-usage:window:${e}`)));function wt(e,t){return St(e.flatMap(({environmentId:e,label:n,summary:r})=>r===null?[]:[{environmentId:e,label:n,summary:t===void 0?r:{...r,buckets:r.buckets.filter(t)}}]),6)}var Tt=new Set;function Et(e,t){return t.size===0?e:e.map(e=>e.summary===null?e:{...e,summary:{...e.summary,buckets:e.summary.buckets.filter(e=>!t.has(e.provider)),sources:e.summary.sources.filter(e=>!t.has(e.fingerprint.provider))}})}function Dt(e,t,n){let r=(0,Q.c)(36),i=t===void 0?null:t,a=n===void 0?Tt:n,o;r[0]!==e.resolution||r[1]!==e.sinceDay||r[2]!==e.sinceTime||r[3]!==e.timeZone||r[4]!==e.untilDay||r[5]!==e.untilTime?(o=JSON.stringify({sinceDay:e.sinceDay,untilDay:e.untilDay,timeZone:e.timeZone,resolution:e.resolution,sinceTime:e.sinceTime,untilTime:e.untilTime}),r[0]=e.resolution,r[1]=e.sinceDay,r[2]=e.sinceTime,r[3]=e.timeZone,r[4]=e.untilDay,r[5]=e.untilTime,r[6]=o):o=r[6];let s=o,c;r[7]===s?c=r[8]:(c=Ct(s),r[7]=s,r[8]=c);let l=h(c),u;r[9]!==l||r[10]!==i?(u=i===null?l:l.filter(e=>i.has(e.environmentId)),r[9]=l,r[10]=i,r[11]=u):u=r[11];let f=u,p;r[12]!==f||r[13]!==s?(p=e=>lt({registry:d,server:H,presentations:se,environmentIds:f.filter(jt).map(At),input:e??JSON.parse(s)}),r[12]=f,r[13]=s,r[14]=p):p=r[14];let m=p,g;r[15]!==a||r[16]!==f?(g=wt(Et(f,a)),r[15]=a,r[16]=f,r[17]=g):g=r[17];let _=g,v;r[18]===f?v=r[19]:(v=f.filter(kt),r[18]=f,r[19]=v);let y=v.length,b;r[20]===f?b=r[21]:(b=f.filter(Ot),r[20]=f,r[21]=b);let x=b.length,S=y===0&&x>0,[C,w]=(0,Z.useState)(null);y>0&&(C?.merged!==_||C.window!==e||C.selection!==i||C.hidden!==a)&&w({window:e,merged:_,selection:i,hidden:a});let T=C?.selection===i&&C.hidden===a?C:null,E;r[22]!==y||r[23]!==e||r[24]!==S||r[25]!==T||r[26]!==_?(E=y>0?{window:e,merged:_}:T??(S?null:{window:e,merged:_}),r[22]=y,r[23]=e,r[24]=S,r[25]=T,r[26]=_,r[27]=E):E=r[27];let D=E,O=y>0&&x>0,k;return r[28]!==l||r[29]!==S||r[30]!==_||r[31]!==m||r[32]!==f||r[33]!==D||r[34]!==O?(k={merged:_,environments:l,selectedEnvironments:f,isPending:S,shown:D,isPartial:O,refresh:m},r[28]=l,r[29]=S,r[30]=_,r[31]=m,r[32]=f,r[33]=D,r[34]=O,r[35]=k):k=r[35],k}function Ot(e){return e.summary===null&&e.error===null}function kt(e){return e.summary!==null}function At(e){let{environmentId:t}=e;return t}function jt(e){return e.canReadDiagnostics&&le(e.environmentId,`diagnostics:read`)}var $=e(C(),1);function Mt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=D(`w-full caption-bottom text-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,$.jsx)(`table`,{"data-slot":`table`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Nt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=D(`[&_tr]:border-b`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`thead`,{"data-slot":`table-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Pt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=D(`[&_tr:last-child]:border-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`tbody`,{"data-slot":`table-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ft(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=D(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`tr`,{"data-slot":`table-row`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function It(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=D(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`th`,{"data-slot":`table-head`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Lt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=D(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`td`,{"data-slot":`table-cell`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Rt=[{key:`inputCostPerMillionTokens`,label:`Input`,optional:!1},{key:`outputCostPerMillionTokens`,label:`Output`,optional:!1},{key:`cacheReadCostPerMillionTokens`,label:`Cache read`,optional:!0},{key:`cacheWriteCostPerMillionTokens`,label:`Cache write`,optional:!0}];function zt(e=``,t){return{model:e,inputCostPerMillionTokens:t?.inputCostPerMillionTokens.toString()??``,outputCostPerMillionTokens:t?.outputCostPerMillionTokens.toString()??``,cacheReadCostPerMillionTokens:t?.cacheReadCostPerMillionTokens?.toString()??``,cacheWriteCostPerMillionTokens:t?.cacheWriteCostPerMillionTokens?.toString()??``}}function Bt(e){let t=e.model.trim();if(t.length===0)return null;let n={};for(let t of Rt){let r=e[t.key].trim();if(r===``){if(t.optional)continue;return null}if(!/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(r))return null;let i=Number(r);if(!Number.isFinite(i)||i<0)return null;n[t.key]=i}return n.inputCostPerMillionTokens===void 0||n.outputCostPerMillionTokens===void 0?null:{model:t,price:{inputCostPerMillionTokens:n.inputCostPerMillionTokens,outputCostPerMillionTokens:n.outputCostPerMillionTokens,...n.cacheReadCostPerMillionTokens===void 0?{}:{cacheReadCostPerMillionTokens:n.cacheReadCostPerMillionTokens},...n.cacheWriteCostPerMillionTokens===void 0?{}:{cacheWriteCostPerMillionTokens:n.cacheWriteCostPerMillionTokens}}}}function Vt(e){return e.isNew&&e.model.trim()===``&&(e.alias??``).trim()===``&&Object.values(e.values).every(e=>e.trim()===``)}function Ht(e,t){return e.prices&&Object.hasOwn(e.prices,t)?e.prices[t]:void 0}function Ut(e,t){return e.aliases&&Object.hasOwn(e.aliases,t)?e.aliases[t]:void 0}function Wt(e,t){if(e.some(e=>e.aliases===null))return{value:``,placeholder:`Unavailable`};let n=e.map(e=>Ut(e,t)??``);return n.some(e=>e!==n[0])?{value:``,placeholder:`Mixed`}:{value:n[0]??``,placeholder:`None`}}function Gt(e,t,n){let r=Rt.find(e=>e.key===n).optional,i=e.map(e=>Ht(e,t)?zt(t,Ht(e,t))[n]:null);return e.some(e=>e.prices===null)?{value:``,placeholder:`Unavailable`}:i.some(e=>e!==i[0])?{value:``,placeholder:`Mixed`}:{value:i[0]??``,placeholder:i[0]===null?`Automatic`:r?`Input rate`:`0.00`}}function Kt(e,t){let n=[],r=new Map;for(let i of t){if(Vt(i))continue;let t=i.model.trim(),a=Ut(e,t);if(i.removed){Ht(e,t)&&n.push({model:t,price:null}),a!==void 0&&n.push({model:t,alias:null});continue}let o=(i.alias??a??``).trim();if(o!==``){t===``?r.set(i.id,`Enter a model ID.`):o===t?r.set(i.id,`Map to a different model.`):(o!==a&&n.push({model:t,alias:o}),Ht(e,t)&&n.push({model:t,price:null}));continue}if(a!==void 0&&(n.push({model:t,alias:null}),!Ht(e,t)&&Object.values(i.values).every(e=>e.trim()===``)))continue;let s=zt(t,Ht(e,t)),c={...s,...i.values},l=Bt(c);if(l===null){let n=Rt.find(e=>!e.optional&&c[e.key].trim()===``);r.set(i.id,t===``?`Enter a model ID.`:n?`${n.label} is required on ${e.label}.`:`Use non-negative numbers for prices.`);continue}let u=zt(t,l.price);Rt.some(e=>s[e.key]!==u[e.key])&&n.push(l)}return{changes:n,errors:r}}function qt(e,t){return new Map(e.filter(e=>e.unavailable===null&&e.prices!==null).flatMap(e=>[...Kt(e,t).errors]))}async function Jt(e){await Promise.all(e.targets.map(async t=>{let n,r=e.changes.get(t.environmentId)??[],i=r.flatMap(e=>`price`in e?[[e.model,e.price]]:[]),a=r.flatMap(e=>`alias`in e?[[e.model,e.alias]]:[]);if(t.unavailable!==null)n={status:`failed`,error:t.unavailable};else if(a.length>0&&t.aliases===null)n={status:`failed`,error:`Update server to map models`};else try{n=(r.length===0?{_tag:`Success`}:await e.write({environmentId:t.environmentId,input:{patch:{...i.length>0?{usagePriceOverrides:Object.fromEntries(i)}:{},...a.length>0?{usageModelAliases:Object.fromEntries(a)}:{}}}}))._tag===`Success`?{status:`saved`}:{status:`failed`,error:`Could not save. Try again.`}}catch{n={status:`failed`,error:`Could not save. Try again.`}}e.onResult(t.environmentId,n)}))}var Yt=s(e=>[...e(se.presentationsAtom)].map(([t,n])=>{let r=e(H.settingsValueAtom(t)),i=e(U.sessionStateAtom(t)),a=u(w(i)),o=i._tag===`Failure`?`denied`:a===null?i.waiting?`pending`:`denied`:f(a,`settings:write`)?`granted`:`denied`;return{environmentId:t,label:n.entry.target.label,prices:r?.usagePriceOverrides??null,aliases:n.serverConfig?.environment.capabilities.usageModelAliases===!0?r?.usageModelAliases??null:null,unavailable:n.connection.phase===`connected`?r===null?`Prices not loaded`:n.serverConfig?.environment.capabilities.usagePriceOverrides===!0?o===`pending`?`Checking permissions…`:o===`denied`?`Read-only access`:null:`Update server to edit prices`:`Offline`}}));function Xt(e){let t=(0,Q.c)(119),{usage:n,initialSelectedEnvironmentIds:r,initialModel:i,onOpenChange:a}=e,s=h(Yt),[c,l]=(0,Z.useState)(r),u;if(t[0]!==s||t[1]!==c){let e;t[3]===c?e=t[4]:(e=e=>c===null||c.has(e.environmentId),t[3]=c,t[4]=e),u=s.filter(e),t[0]=s,t[1]=c,t[2]=u}else u=t[2];let d=u,f;t[5]!==i||t[6]!==d?(f=()=>i===void 0||d.some(e=>Object.hasOwn(e.prices??{},i)||Object.hasOwn(e.aliases??{},i))?[]:[{id:`new:initial`,model:i,isNew:!0,values:{}}],t[5]=i,t[6]=d,t[7]=f):f=t[7];let[p,m]=(0,Z.useState)(f),[v,b]=(0,Z.useState)(!1),[S,C]=(0,Z.useState)(null),w=(0,Z.useRef)(null),E=(0,Z.useRef)(0),O;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(O={reportFailure:!1},t[8]=O):O=t[8];let k=ue(H.updateSettings,O),j,M,P,I,L,R,z,te,ne,re,ie,ae,oe,se,ce;if(t[9]!==S||t[10]!==p||t[11]!==s||t[12]!==a||t[13]!==v||t[14]!==d||t[15]!==c||t[16]!==k||t[17]!==n){let e=[...new Set(d.flatMap(mn))].sort(),r;t[33]===d?r=t[34]:(r=e=>d.some(t=>t.environmentId===e.environmentId),t[33]=d,t[34]=r);let i=[...new Set([...e,...n.filter(r).flatMap(fn)])].sort(),u;t[35]===p?u=t[36]:(u=new Set(p.filter(dn).map(un)),t[35]=p,t[36]=u);let f=u,h;t[37]!==S||t[38]!==f?(h=e=>S===null||!f.has(e),t[37]=S,t[38]=f,t[39]=h):h=t[39];let O=[...e.filter(h).map(e=>p.find(t=>t.id===`model:${e}`)??{id:`model:${e}`,model:e,isNew:!1,values:{}}),...p.filter(ln)],H=p.filter(cn);R=qt(d,H);for(let t of H)t.isNew&&(t.model.trim()===``?R.set(t.id,`Enter a model ID.`):S===null&&(e.includes(t.model.trim())||p.some(e=>e.id!==t.id&&e.model.trim()===t.model.trim()))&&R.set(t.id,`This model already has a row. Edit its prices there.`));z=S?.destinations.filter(e=>S.results.get(e.environmentId)?.status===`failed`)??[];let U=v||z.length>0;te=H.length>0,I=d.length===1?d[0].label:`${d.length} environments`;let ue=c===null?`All environments`:I,de;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(de=()=>{m([]),C(null)},t[40]=de):de=t[40],L=de;let fe;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(fe=e=>{l(e),C(null)},t[41]=fe):fe=t[41];let W=fe,G;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>{m(t=>t.some(t=>t.id===e.id)?t.map(t=>t.id===e.id?e:t):[...t,e]),C(null)},t[42]=G):G=t[42];let pe=G,K=sn,me;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>{!e.isNew&&Object.keys(e.values).length===0&&e.alias===void 0?m(t=>t.filter(t=>t.id!==e.id)):pe(e)},t[43]=me):me=t[43];let he=me,q;t[44]===d?q=t[45]:(q=(e,t,n)=>{let r={...e.values,[t]:n},i=Gt(d,e.model,t);K(e,i,n)&&delete r[t],he({...e,values:r})},t[44]=d,t[45]=q);let J=q,Y;t[46]===d?Y=t[47]:(Y=(e,t)=>{let{alias:n,...r}=e,i=Wt(d,e.model);he(K(e,i,t)?r:{...r,alias:t})},t[46]=d,t[47]=Y);let ge=Y;ne=async e=>{let t=e!==void 0&&e;if(v)return;let n=t?z:d,r=t&&S?S.drafts:H;if(n.length===0||r.length===0)return;let i=n.map(e=>s.find(t=>t.environmentId===e.environmentId)??{...e,prices:null,aliases:null,unavailable:`Environment removed`}),a=new Map(i.map(e=>[e.environmentId,Kt(e,r)]));b(!0),C(e=>({drafts:r,destinations:t&&e?e.destinations:i,results:new Map([...t&&e?e.results:[],...i.map(on)])}));let o=!1;await Jt({targets:i.map(e=>({...e,unavailable:e.unavailable??[...a.get(e.environmentId).errors.values()][0]??null})),changes:new Map([...a].map(an)),write:async e=>le(e.environmentId,`settings:write`)?k(e):{_tag:`Failure`},onResult:(e,t)=>{t.status===`failed`&&(o=!0),C(n=>n===null?null:{...n,results:new Map(n.results).set(e,t)})}}),b(!1),o||m([])},P=Oe,se=!0,t[48]!==a||t[49]!==v?(ce=e=>{v||a(e)},t[48]=a,t[49]=v,t[50]=ce):ce=t[50],M=De,ae=`max-w-4xl`,t[51]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsxs)(Se,{children:[(0,$.jsx)(Ce,{children:`Custom model prices`}),(0,$.jsx)(Ee,{children:`Prices and mappings apply to all past and future usage on the environments you select.`})]}),t[51]=oe):oe=t[51],j=Te;let _e;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(We,{id:`usage-prices-apply-label`,className:`shrink-0`,children:`Apply to`}),t[52]=_e):_e=t[52];let X;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(T,{variant:`outline`,size:`sm`,className:`min-w-0`}),t[53]=X):X=t[53];let ve=v||te,ye;t[54]===ue?ye=t[55]:(ye=(0,$.jsx)(`span`,{id:`usage-prices-selection`,className:`truncate`,children:ue}),t[54]=ue,t[55]=ye);let xe;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,$.jsx)(A,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[56]=xe):xe=t[56];let we;t[57]!==ve||t[58]!==ye?(we=(0,$.jsxs)(y,{render:X,"aria-labelledby":`usage-prices-apply-label usage-prices-selection`,disabled:ve,children:[ye,xe]}),t[57]=ve,t[58]=ye,t[59]=we):we=t[59];let ke=c===null,Ae;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=e=>W(e?null:new Set),t[60]=Ae):Ae=t[60];let je;t[61]===ke?je=t[62]:(je=(0,$.jsx)(o,{checked:ke,closeOnClick:!1,onCheckedChange:Ae,children:`All environments`}),t[61]=ke,t[62]=je);let Me;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(Me=(0,$.jsx)(x,{}),t[63]=Me):Me=t[63];let Ne;if(t[64]!==s||t[65]!==d||t[66]!==c){let e;t[68]!==s.length||t[69]!==d||t[70]!==c?(e=e=>(0,$.jsx)(o,{checked:c===null||c.has(e.environmentId),closeOnClick:!1,onCheckedChange:t=>{let n=new Set(d.map(rn));t?n.add(e.environmentId):n.delete(e.environmentId),W(n.size===s.length?null:n)},children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.unavailable?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.unavailable}):null]})},e.environmentId),t[68]=s.length,t[69]=d,t[70]=c,t[71]=e):e=t[71],Ne=s.map(e),t[64]=s,t[65]=d,t[66]=c,t[67]=Ne}else Ne=t[67];let Pe;t[72]!==je||t[73]!==Ne?(Pe=(0,$.jsxs)(_,{align:`start`,children:[je,Me,Ne]}),t[72]=je,t[73]=Ne,t[74]=Pe):Pe=t[74];let Fe;t[75]!==we||t[76]!==Pe?(Fe=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[_e,(0,$.jsxs)(g,{children:[we,Pe]})]}),t[75]=we,t[76]=Pe,t[77]=Fe):Fe=t[77];let Ie;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`USD / million tokens`}),t[78]=Ie):Ie=t[78],t[79]===Fe?re=t[80]:(re=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[Fe,Ie]}),t[79]=Fe,t[80]=re),ie=d.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:s.length===0?`Connect an environment to set model prices.`:`Select an environment to see and change its model prices.`}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`min-w-0 overflow-hidden rounded-lg border border-border`,children:(0,$.jsxs)(Mt,{className:`min-w-180 table-fixed`,"aria-label":`Custom model prices`,children:[(0,$.jsxs)(`colgroup`,{children:[(0,$.jsx)(`col`,{className:`w-[22%]`}),(0,$.jsx)(`col`,{className:`w-[18%]`}),Rt.map(nn),(0,$.jsx)(`col`,{className:`w-10`})]}),(0,$.jsx)(Nt,{children:(0,$.jsxs)(Ft,{children:[(0,$.jsx)(It,{children:`Model ID`}),(0,$.jsx)(It,{children:`Map to`}),Rt.map(tn),(0,$.jsx)(It,{children:(0,$.jsx)(T,{size:`icon-xs`,variant:`ghost`,"aria-label":`Add model price`,disabled:U,onClick:()=>{E.current+=1;let e=`new:${E.current}`;w.current=e,pe({id:e,model:``,isNew:!0,values:{}})},children:(0,$.jsx)(N,{"aria-hidden":!0})})})]})}),(0,$.jsx)(Pt,{children:O.length===0?(0,$.jsx)(Ft,{children:(0,$.jsx)(Lt,{colSpan:7,className:`text-center whitespace-normal`,children:(0,$.jsx)(`p`,{className:`py-6 text-muted-foreground`,children:d.some(en)?`Some environment prices are unavailable.`:`No custom prices or mappings. Add a row to set one.`})})}):O.map(e=>{let t=Wt(d,e.model),n=(e.alias??t.value).trim();return(0,$.jsxs)(Ft,{"data-row-id":e.id,children:[(0,$.jsxs)(Lt,{className:`whitespace-normal`,children:[e.isNew?(0,$.jsx)(be,{size:`compact`,value:e.model,ref:t=>{t&&w.current===e.id&&(t.focus(),w.current=null)},"aria-label":`New model ID`,"aria-invalid":e.model.trim()!==``&&R.has(e.id)||void 0,list:`usage-price-models`,placeholder:`Model ID`,autoComplete:`off`,spellCheck:!1,disabled:U,onChange:t=>pe({...e,model:t.target.value})}):(0,$.jsx)(`span`,{className:D(`block break-all`,e.removed&&`text-muted-foreground line-through`),children:e.model}),R.has(e.id)&&(e.model.trim()!==``||Object.values(e.values).some($t))?(0,$.jsx)(`p`,{role:`alert`,className:`mt-1 text-xs text-destructive`,children:R.get(e.id)}):null]}),e.removed?(0,$.jsx)(Lt,{colSpan:5,children:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Automatic pricing after saving`})}):(0,$.jsx)(Lt,{children:(0,$.jsx)(be,{size:`compact`,value:e.alias??t.value,"aria-label":`Map ${e.model||`new model`} to model`,list:`usage-alias-models`,placeholder:e.isNew?`Optional`:t.placeholder,autoComplete:`off`,spellCheck:!1,disabled:U,onChange:t=>ge(e,t.target.value)})}),e.removed?null:n===``?Rt.map(t=>{let n=Gt(d,e.model,t.key);return(0,$.jsx)(Lt,{children:(0,$.jsx)(be,{size:`compact`,inputMode:`decimal`,"aria-label":`${t.label} price for ${e.model||`new model`}`,value:e.values[t.key]??(e.isNew?``:n.value),placeholder:e.isNew?t.optional?`Input rate`:`0.00`:n.placeholder,autoComplete:`off`,disabled:U,font:`mono`,onChange:n=>J(e,t.key,n.target.value)})},t.key)}):(0,$.jsx)(Lt,{colSpan:4,className:`whitespace-normal`,children:(0,$.jsxs)(`span`,{className:`break-all text-muted-foreground`,children:[`Counted as `,n]})}),(0,$.jsx)(Lt,{children:(0,$.jsxs)(V,{children:[(0,$.jsx)(ee,{render:(0,$.jsx)(T,{size:`icon-xs`,variant:`ghost`}),disabled:U,"aria-label":e.removed?`Undo reset for ${e.model}`:e.isNew?`Remove new model`:`Reset price for ${e.model} to automatic`,onClick:()=>{e.isNew?m(t=>t.filter(t=>t.id!==e.id)):e.removed?he({...e,removed:!1}):pe({...e,removed:!0})},children:e.isNew?(0,$.jsx)(F,{"aria-hidden":!0}):(0,$.jsx)(Ge,{"aria-hidden":!0})}),(0,$.jsx)(B,{children:e.removed?`Undo reset`:e.isNew?`Remove row`:`Reset to automatic`})]})})]},e.id)})})]})}),(0,$.jsx)(`datalist`,{id:`usage-price-models`,children:i.filter(t=>!e.includes(t)).map(Qt)}),(0,$.jsx)(`datalist`,{id:`usage-alias-models`,children:i.filter(e=>d.every(t=>!Object.hasOwn(t.aliases??{},e))).map(Zt)}),(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Blank cache rates use the input price. Enter 0 for free tokens. A mapped model’s usage counts as the model it maps to.`,d.length>1?` Mixed cells keep each environment’s rate until you edit them.`:``]})]}),t[9]=S,t[10]=p,t[11]=s,t[12]=a,t[13]=v,t[14]=d,t[15]=c,t[16]=k,t[17]=n,t[18]=j,t[19]=M,t[20]=P,t[21]=I,t[22]=L,t[23]=R,t[24]=z,t[25]=te,t[26]=ne,t[27]=re,t[28]=ie,t[29]=ae,t[30]=oe,t[31]=se,t[32]=ce}else j=t[18],M=t[19],P=t[20],I=t[21],L=t[22],R=t[23],z=t[24],te=t[25],ne=t[26],re=t[27],ie=t[28],ae=t[29],oe=t[30],se=t[31],ce=t[32];let U;t[81]===S?U=t[82]:(U=S?(0,$.jsx)(`div`,{role:`status`,className:`grid gap-1 text-xs`,children:S.destinations.map(e=>{let t=S.results.get(e.environmentId);return(0,$.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:t?.status===`failed`?`text-right text-destructive`:`text-muted-foreground`,children:t?.status===`failed`?`Not saved · ${t.error}`:t?.status===`saved`?`Saved`:`Saving…`})]},e.environmentId)})}):null,t[81]=S,t[82]=U);let de;t[83]!==j||t[84]!==U||t[85]!==re||t[86]!==ie?(de=(0,$.jsxs)(j,{children:[re,ie,U]}),t[83]=j,t[84]=U,t[85]=re,t[86]=ie,t[87]=de):de=t[87];let fe=te?`Changes apply to ${I}`:``,W;t[88]===fe?W=t[89]:(W=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:fe}),t[88]=fe,t[89]=W);let G;t[90]!==L||t[91]!==z.length||t[92]!==te||t[93]!==v?(G=te?(0,$.jsx)(T,{variant:`ghost`,disabled:v,onClick:L,children:z.length>0?`Discard pending changes`:`Discard changes`}):null,t[90]=L,t[91]=z.length,t[92]=te,t[93]=v,t[94]=G):G=t[94];let pe=v||!te&&z.length===0||z.length===0&&(R.size>0||d.length===0),K;t[95]!==z.length||t[96]!==ne?(K=()=>void ne(z.length>0),t[95]=z.length,t[96]=ne,t[97]=K):K=t[97];let me=v?`Saving…`:z.length>0?`Retry failed saves`:`Save changes`,he;t[98]!==pe||t[99]!==K||t[100]!==me?(he=(0,$.jsx)(T,{disabled:pe,onClick:K,children:me}),t[98]=pe,t[99]=K,t[100]=me,t[101]=he):he=t[101];let q;t[102]!==G||t[103]!==he?(q=(0,$.jsxs)(`div`,{className:`flex w-full flex-wrap justify-end gap-2 sm:w-auto`,children:[G,he]}),t[102]=G,t[103]=he,t[104]=q):q=t[104];let J;t[105]!==W||t[106]!==q?(J=(0,$.jsxs)(we,{variant:`bare`,className:`items-center sm:justify-between`,children:[W,q]}),t[105]=W,t[106]=q,t[107]=J):J=t[107];let Y;t[108]!==M||t[109]!==de||t[110]!==J||t[111]!==ae||t[112]!==oe?(Y=(0,$.jsxs)(M,{className:ae,children:[oe,de,J]}),t[108]=M,t[109]=de,t[110]=J,t[111]=ae,t[112]=oe,t[113]=Y):Y=t[113];let ge;return t[114]!==P||t[115]!==Y||t[116]!==se||t[117]!==ce?(ge=(0,$.jsx)(P,{open:se,onOpenChange:ce,children:Y}),t[114]=P,t[115]=Y,t[116]=se,t[117]=ce,t[118]=ge):ge=t[118],ge}function Zt(e){return(0,$.jsx)(`option`,{value:e},e)}function Qt(e){return(0,$.jsx)(`option`,{value:e},e)}function $t(e){return e!==``}function en(e){return e.prices===null}function tn(e){return(0,$.jsx)(It,{children:e.label},e.key)}function nn(e){return(0,$.jsx)(`col`,{},e.key)}function rn(e){return e.environmentId}function an(e){let[t,n]=e;return[t,n.changes]}function on(e){return[e.environmentId,{status:`saving`}]}function sn(e,t,n){return!e.isNew&&t.placeholder!==`Mixed`&&t.placeholder!==`Unavailable`&&n===t.value}function cn(e){return!Vt(e)}function ln(e){return e.isNew}function un(e){return e.model.trim()}function dn(e){return e.isNew}function fn(e){return e.summary?.buckets.map(pn)??[]}function pn(e){return e.model}function mn(e){return[...Object.keys(e.prices??{}),...Object.keys(e.aliases??{})]}var hn=960,gn=260,_n=4,vn=8,yn=new Set;function bn(e,t,n){let r=e?.byProvider.get(t);return r===void 0?0:n===`tokens`?r.totalTokens:r.costUsd}function xn(e,t,n){return e.map(e=>{let r=t.get(e),i=$e.map(e=>({provider:e,value:bn(r,e,n)}));return{bands:i,total:i.reduce((e,t)=>e+t.value,0)}})}function Sn(e){let t=e.length;if(t<2)return[0];let n=[];for(let r=0;r<t-1;r+=1){let t=(e[r+1]?.x??0)-(e[r]?.x??0),i=(e[r+1]?.y??0)-(e[r]?.y??0);n.push(t===0?0:i/t)}let r=Array.from({length:t},()=>0);r[0]=n[0]??0,r[t-1]=n[t-2]??0;for(let e=1;e<t-1;e+=1){let t=n[e-1]??0,i=n[e]??0;r[e]=t*i<=0?0:(t+i)/2}for(let e=0;e<t-1;e+=1){let t=n[e]??0;if(t===0){r[e]=0,r[e+1]=0;continue}let i=(r[e]??0)/t,a=(r[e+1]??0)/t,o=i*i+a*a;if(o>9){let n=3/Math.sqrt(o);r[e]=n*i*t,r[e+1]=n*a*t}}return r}function Cn(e){if(e.length<2)return[];let t=Sn(e),n=[];for(let r=0;r<e.length-1;r+=1){let i=e[r],a=e[r+1];if(i===void 0||a===void 0)continue;let o=a.x-i.x;n.push({from:i,c1:{x:i.x+o/3,y:i.y+(t[r]??0)*o/3},c2:{x:a.x-o/3,y:a.y-(t[r+1]??0)*o/3},to:a})}return n}function wn(e){let t=e[0];if(t===void 0)return``;let n=`M${t.from.x.toFixed(2)},${t.from.y.toFixed(2)}`;for(let t of e)n+=` C${t.c1.x.toFixed(2)},${t.c1.y.toFixed(2)} ${t.c2.x.toFixed(2)},${t.c2.y.toFixed(2)} ${t.to.x.toFixed(2)},${t.to.y.toFixed(2)}`;return n}function Tn(e){return e===``?``:`${e} L${hn},${gn} L0,${gn} Z`}function En(e,t){if(e<=0)return{max:0,ticks:[0]};let n=e/t,r=10**Math.floor(Math.log10(n)),i=n/r,a=(i>5?10:i>2?5:i>1?2:1)*r,o=Math.ceil(e/a)*a,s=[];for(let e=0;e<=o+a*1e-6;e+=a)s.push(e);return{max:o,ticks:s}}var Dn=Array.from({length:5},(e,t)=>t);function On(e,t){let n=e.reduce((e,t)=>t.bands.reduce((e,t)=>Math.max(e,t.value),e),0);return n===0&&t.size>0?{max:_n,ticks:Dn,labeled:!1}:{...En(n,_n),labeled:!0}}function kn(e,t){return t===0?gn:gn-e/t*252}function An(e,t,n,r,i){let a=xn(e,t,n),o=On(a,i),s=e.length<2?0:hn/(e.length-1);return{columns:a,scale:o,stepX:s,paths:r.map(e=>{let t=$e.indexOf(e),n=wn(Cn(a.map((e,n)=>({x:n*s,y:kn(e.bands[t]?.value??0,o.max)}))));return{provider:e,loading:i.has(e),total:a.reduce((e,n)=>e+(n.bands[t]?.value??0),0),line:n,area:Tn(n)}}).toSorted((e,t)=>t.total-e.total)}}function jn(e){let t=(0,Q.c)(97),{providers:n,loadingProviders:r,days:i,daily:a,hours:o,hourly:s,metric:c,referenceTime:l,resolution:u,timeZone:d}=e,f=r===void 0?yn:r,p=u===`hour`?o:i,m;t[0]!==a||t[1]!==s||t[2]!==u?(m=u===`hour`?new Map(s.map(Pn)):new Map(a.map(Nn)),t[0]=a,t[1]=s,t[2]=u,t[3]=m):m=t[3];let h=m,[g,_]=(0,Z.useState)(null),v=(0,Z.useRef)(null),y=(0,Z.useRef)(null),b=(0,Z.useRef)(null),x;t[4]!==h||t[5]!==f||t[6]!==c||t[7]!==p||t[8]!==n?(x=An(p,h,c,n,f),t[4]=h,t[5]=f,t[6]=c,t[7]=p,t[8]=n,t[9]=x):x=t[9];let{columns:S,scale:C,paths:w,stepX:T}=x,E;t[10]===C.max?E=t[11]:(E=e=>kn(e,C.max),t[10]=C.max,t[11]=E);let O=E,k=Mn,A=c===`tokens`?K:W,j;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>{let e=v.current,t=y.current,n=b.current;if(e===null||t===null||n===null)return;let r=t.offsetWidth,i=t.offsetHeight,a=e.clientWidth,o=e.clientHeight,s=n.x+12+r<=a?n.x+12:n.x-12-r,c=n.y+12+i<=o?n.y+12:n.y-12-i,l=Math.min(Math.max(0,s),Math.max(0,a-r)),u=Math.min(Math.max(0,c),Math.max(0,o-i));e.style.setProperty(`--usage-tooltip-left`,`${l}px`),e.style.setProperty(`--usage-tooltip-top`,`${u}px`)},t[12]=j):j=t[12];let M=j,N,P;t[13]===g?(N=t[14],P=t[15]):(N=()=>{if(g===null)return;M();let e=v.current,t=y.current;if(e!==null&&t!==null)return Ae([e,t],M)},P=[g,M],t[13]=g,t[14]=N,t[15]=P),(0,Z.useLayoutEffect)(N,P);let F;t[16]===p.length?F=t[17]:(F=e=>{let t=v.current;if(t===null||p.length===0)return;let n=t.getBoundingClientRect();if(n.width===0)return;let r=Math.min(n.width,Math.max(0,e.clientX-n.left)),i=Math.min(n.height,Math.max(0,e.clientY-n.top)),a=r/n.width,o=Math.round(a*(p.length-1));b.current={x:r,y:i},M(),_(Math.min(p.length-1,Math.max(0,o)))},t[16]=p.length,t[17]=F);let I=F,L=g===null?void 0:p[g],R=g===null?void 0:S[g],z;if(t[18]!==f||t[19]!==n){let e;t[21]===f?e=t[22]:(e=e=>f.has(e),t[21]=f,t[22]=e),z=n.some(e),t[18]=f,t[19]=n,t[20]=z}else z=t[20];let ee=z,B;t[23]!==u||t[24]!==d?(B=e=>u===`hour`?he(e,d):de(e),t[23]=u,t[24]=d,t[25]=B):B=t[25];let V=B,te;t[26]!==V||t[27]!==l||t[28]!==u||t[29]!==d?(te=e=>u===`hour`&&l!==void 0?fe(e,l,d):V(e),t[26]=V,t[27]=l,t[28]=u,t[29]=d,t[30]=te):te=t[30];let ne=te,re;t[31]!==A||t[32]!==C.labeled||t[33]!==C.ticks||t[34]!==O?(re=C.labeled?C.ticks.map(e=>(0,$.jsx)(`span`,{className:`absolute right-0 -translate-y-1/2 text-3xs text-muted-foreground tabular-nums`,style:{top:`${O(e)/gn*100}%`},children:e===0?`0`:A(e)},e)):null,t[31]=A,t[32]=C.labeled,t[33]=C.ticks,t[34]=O,t[35]=re):re=t[35];let ie;t[36]===re?ie=t[37]:(ie=(0,$.jsx)(`div`,{className:`relative h-56 w-14 shrink-0`,children:re}),t[36]=re,t[37]=ie);let ae;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(ae=()=>{b.current=null,_(null)},t[38]=ae):ae=t[38];let oe=`${u===`hour`?`Hourly`:`Daily`} ${c===`tokens`?`processed tokens`:`cost`} by provider`,se;if(t[39]!==C.ticks||t[40]!==O){let e;t[42]===O?e=t[43]:(e=e=>{let t=O(e);return(0,$.jsx)(`line`,{x1:0,x2:hn,y1:t,y2:t,stroke:`currentColor`,strokeWidth:1,className:`text-border`,vectorEffect:`non-scaling-stroke`},e)},t[42]=O,t[43]=e),se=C.ticks.map(e),t[39]=C.ticks,t[40]=O,t[41]=se}else se=t[41];let H;if(t[44]!==w){let e;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>{let{provider:t,loading:n,area:r}=e;return(0,$.jsx)(`path`,{d:r,className:k(n),fill:Qe[t].color,fillOpacity:.12},t)},t[46]=e):e=t[46],H=w.map(e),t[44]=w,t[45]=H}else H=t[45];let ce;if(t[47]!==w){let e;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>{let{provider:t,loading:n,line:r}=e;return(0,$.jsx)(`path`,{d:r,className:k(n),fill:`none`,stroke:Qe[t].color,strokeWidth:2,vectorEffect:`non-scaling-stroke`},t)},t[49]=e):e=t[49],ce=w.map(e),t[47]=w,t[48]=ce}else ce=t[48];let le;t[50]!==g||t[51]!==T?(le=g===null?null:(0,$.jsx)(`line`,{x1:g*T,x2:g*T,y1:vn,y2:gn,stroke:`currentColor`,strokeWidth:1,className:`text-muted-foreground`,vectorEffect:`non-scaling-stroke`}),t[50]=g,t[51]=T,t[52]=le):le=t[52];let U;t[53]!==oe||t[54]!==se||t[55]!==H||t[56]!==ce||t[57]!==le?(U=(0,$.jsxs)(`svg`,{className:`h-full w-full`,viewBox:`0 0 ${hn} ${gn}`,preserveAspectRatio:`none`,role:`img`,"aria-label":oe,children:[se,H,ce,le]}),t[53]=oe,t[54]=se,t[55]=H,t[56]=ce,t[57]=le,t[58]=U):U=t[58];let ue;t[59]!==A||t[60]!==ne||t[61]!==R?.bands||t[62]!==R?.total||t[63]!==L||t[64]!==f||t[65]!==ee||t[66]!==n?(ue=L===void 0?null:(0,$.jsxs)(`div`,{ref:y,className:`surface-glass pointer-events-none absolute z-10 min-w-36 max-w-full rounded-xl border border-border/50 px-2.5 py-2 text-xs shadow-lg`,style:{left:`var(--usage-tooltip-left, 0px)`,top:`var(--usage-tooltip-top, 0px)`},children:[(0,$.jsx)(`div`,{className:`mb-1 text-muted-foreground`,children:ne(L)}),n.map(e=>{let{label:t,driverKind:n}=Qe[e];return(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,$.jsx)(ze,{driverKind:n,displayName:t,iconClassName:`size-3`}),t]}),(0,$.jsx)(`span`,{className:D(`tabular-nums`,f.has(e)?`text-muted-foreground`:`text-foreground`),children:A(R?.bands.find(t=>t.provider===e)?.value??0)})]},e)}),(0,$.jsxs)(`div`,{className:`mt-1 flex items-center justify-between gap-3 border-t border-border pt-1`,children:[(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Total`}),(0,$.jsx)(`span`,{className:D(`tabular-nums`,ee?`text-muted-foreground`:`text-foreground`),children:A(R?.total??0)})]})]}),t[59]=A,t[60]=ne,t[61]=R?.bands,t[62]=R?.total,t[63]=L,t[64]=f,t[65]=ee,t[66]=n,t[67]=ue):ue=t[67];let G;t[68]!==I||t[69]!==U||t[70]!==ue?(G=(0,$.jsxs)(`div`,{ref:v,className:`relative h-56 flex-1`,onMouseMove:I,onMouseLeave:ae,children:[U,ue]}),t[68]=I,t[69]=U,t[70]=ue,t[71]=G):G=t[71];let pe;t[72]!==ie||t[73]!==G?(pe=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[ie,G]}),t[72]=ie,t[73]=G,t[74]=pe):pe=t[74];let me;t[75]!==V||t[76]!==p[0]?(me=p[0]===void 0?``:V(p[0]),t[75]=V,t[76]=p[0],t[77]=me):me=t[77];let q;t[78]===me?q=t[79]:(q=(0,$.jsx)(`span`,{children:me}),t[78]=me,t[79]=q);let J;t[80]!==V||t[81]!==p?(J=p[Math.floor(p.length/2)]===void 0?``:V(p[Math.floor(p.length/2)]??``),t[80]=V,t[81]=p,t[82]=J):J=t[82];let Y;t[83]===J?Y=t[84]:(Y=(0,$.jsx)(`span`,{children:J}),t[83]=J,t[84]=Y);let ge;t[85]!==V||t[86]!==p?(ge=p[p.length-1]===void 0?``:V(p[p.length-1]??``),t[85]=V,t[86]=p,t[87]=ge):ge=t[87];let _e;t[88]===ge?_e=t[89]:(_e=(0,$.jsx)(`span`,{children:ge}),t[88]=ge,t[89]=_e);let X;t[90]!==q||t[91]!==Y||t[92]!==_e?(X=(0,$.jsxs)(`div`,{className:`flex justify-between pl-16 text-3xs text-muted-foreground uppercase`,children:[q,Y,_e]}),t[90]=q,t[91]=Y,t[92]=_e,t[93]=X):X=t[93];let ve;return t[94]!==pe||t[95]!==X?(ve=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[pe,X]}),t[94]=pe,t[95]=X,t[96]=ve):ve=t[96],ve}function Mn(e){return D(`transition-opacity`,e&&`opacity-40 delay-150`)}function Nn(e){return[e.day,e]}function Pn(e){return[e.hourStart,e]}function Fn(e){let t=(0,Q.c)(30),{label:n,segments:r,format:i,aside:a}=e,o,s,c,l,u,d;if(t[0]!==a||t[1]!==i||t[2]!==n||t[3]!==r){d=Symbol.for(`react.early_return_sentinel`);bb0:{let e=r.filter(Ln),f=e.reduce(In,0);if(f<=0){d=null;break bb0}c=`flex min-w-0 flex-col gap-2.5`;let p;t[10]===n?p=t[11]:(p=(0,$.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:n}),t[10]=n,t[11]=p),t[12]!==a||t[13]!==p?(l=(0,$.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[p,a]}),t[12]=a,t[13]=p,t[14]=l):l=t[14];let m;t[15]===i?m=t[16]:(m=e=>`${e.label} ${i(e.value)}`,t[15]=i,t[16]=m);let h;t[17]!==i||t[18]!==f?(h=e=>(0,$.jsxs)(V,{children:[(0,$.jsx)(ee,{render:(0,$.jsx)(`div`,{className:`h-full min-w-1 rounded-xs first:rounded-l-full last:rounded-r-full`,style:{flex:`${e.value} 1 0`,backgroundColor:e.color}})}),(0,$.jsxs)(B,{children:[e.label,` · `,i(e.value),` · `,J(e.value/f)]})]},e.label),t[17]=i,t[18]=f,t[19]=h):h=t[19],u=(0,$.jsx)(`div`,{role:`img`,"aria-label":`${n}: ${e.map(m).join(`, `)}`,className:`flex h-2 gap-0.5`,children:e.map(h)}),o=`flex flex-wrap gap-x-4 gap-y-1 text-xs`;let g;t[20]===i?g=t[21]:(g=e=>(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-2 rounded-xs`,style:{backgroundColor:e.color}}),(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`text-foreground tabular-nums`,children:i(e.value)})]},e.label),t[20]=i,t[21]=g),s=e.map(g)}t[0]=a,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d}else o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9];if(d!==Symbol.for(`react.early_return_sentinel`))return d;let f;t[22]!==o||t[23]!==s?(f=(0,$.jsx)(`div`,{className:o,children:s}),t[22]=o,t[23]=s,t[24]=f):f=t[24];let p;return t[25]!==c||t[26]!==l||t[27]!==u||t[28]!==f?(p=(0,$.jsxs)(`div`,{className:c,children:[l,u,f]}),t[25]=c,t[26]=l,t[27]=u,t[28]=f,t[29]=p):p=t[29],p}function In(e,t){return e+t.value}function Ln(e){return e.value>0}function Rn(e){return e.toSorted((e,t)=>t.totalTokens-e.totalTokens||t.costUsd-e.costUsd)}function zn(e,t){return t===`tokens`?e.tokenShare:pt(e)?null:e.costShare}function Bn({tokens:e}){let t=e.uncachedInputTokens+e.cachedInputTokens+e.cacheCreationTokens;return t===0?null:e.cachedInputTokens/t}function Vn(e){let t=e.totalTokens-e.unpricedTokens;return t<=0||pt(e)?null:e.costUsd/t*1e6}var Hn=e=>`color-mix(in oklab, var(--foreground) ${e}%, var(--background))`,Un={input:Hn(60),cacheRead:Hn(30),cacheWrite:Hn(72),output:Hn(100),other:Hn(44)};function Wn(e){return[{label:`Input`,value:e.input,color:Un.input},{label:`Cache read`,value:e.cacheRead,color:Un.cacheRead},{label:`Cache write`,value:e.cacheWrite,color:Un.cacheWrite},{label:`Output`,value:e.output,color:Un.output},{label:`Other`,value:e.unsplit>=.005?e.unsplit:0,color:Un.other}]}function Gn(e){return[{label:`Input`,value:e.uncachedInputTokens,color:Un.input},{label:`Cache read`,value:e.cachedInputTokens,color:Un.cacheRead},{label:`Cache write`,value:e.cacheCreationTokens,color:Un.cacheWrite},{label:`Output`,value:e.outputTokens,color:Un.output}]}function Kn(e){return[{label:`Standard`,value:e.standard,color:Hn(34)},{label:`Fast`,value:e.fast,color:Hn(66)},{label:`Ultrafast`,value:e.ultrafast,color:Hn(100)}]}function qn(e){let t=(0,Q.c)(80),{model:n,environments:r,metric:i,chartWindow:a,onSetPrice:o,onClose:s}=e,c;t[0]!==n.model||t[1]!==n.provider?(c=e=>e.provider===n.provider&&e.model===n.model,t[0]=n.model,t[1]=n.provider,t[2]=c):c=t[2];let l;t[3]!==r||t[4]!==c?(l=wt(r,c),t[3]=r,t[4]=c,t[5]=l):l=t[5];let u=l,d;t[6]===n.provider?d=t[7]:(d=[n.provider],t[6]=n.provider,t[7]=d);let f=d,p=Qe[n.provider],m;t[8]===n?m=t[9]:(m=pt(n),t[8]=n,t[9]=m);let h=m,g;if(t[10]!==h||t[11]!==n){let e=Bn(n),r=Vn(n),i;t[13]!==h||t[14]!==n.costUsd?(i=h?`Unpriced`:W(n.costUsd),t[13]=h,t[14]=n.costUsd,t[15]=i):i=t[15];let a;t[16]===i?a=t[17]:(a={label:`Cost`,value:i},t[16]=i,t[17]=a);let o;t[18]===n.totalTokens?o=t[19]:(o=K(n.totalTokens),t[18]=n.totalTokens,t[19]=o);let s;t[20]===o?s=t[21]:(s={label:`Tokens`,value:o},t[20]=o,t[21]=s),g=[a,s,r===null?null:{label:`Per 1M tokens`,value:W(r)},e===null?null:{label:`Cache hit`,value:J(e)}].filter(Yn),t[10]=h,t[11]=n,t[12]=g}else g=t[12];let _=g,v;t[22]===s?v=t[23]:(v=e=>{e||s()},t[22]=s,t[23]=v);let y;t[24]!==p.driverKind||t[25]!==p.label?(y=(0,$.jsx)(ze,{driverKind:p.driverKind,displayName:p.label,iconClassName:`size-5`}),t[24]=p.driverKind,t[25]=p.label,t[26]=y):y=t[26];let b;t[27]===n.model?b=t[28]:(b=(0,$.jsx)(Ce,{children:n.model}),t[27]=n.model,t[28]=b);let x;t[29]!==y||t[30]!==b?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y,b]}),t[29]=y,t[30]=b,t[31]=x):x=t[31];let S;t[32]!==h||t[33]!==n.costShare?(S=h?``:` · ${J(n.costShare)} of cost`,t[32]=h,t[33]=n.costShare,t[34]=S):S=t[34];let C;t[35]!==p.label||t[36]!==S?(C=(0,$.jsxs)(Ee,{children:[p.label,S]}),t[35]=p.label,t[36]=S,t[37]=C):C=t[37];let w;t[38]!==C||t[39]!==x?(w=(0,$.jsxs)(Se,{children:[x,C]}),t[38]=C,t[39]=x,t[40]=w):w=t[40];let E;t[41]===_?E=t[42]:(E=(0,$.jsx)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-4`,children:_.map(Jn)}),t[41]=_,t[42]=E);let D=h?`tokens`:i,O;t[43]!==a.days||t[44]!==a.hours||t[45]!==a.referenceTime||t[46]!==a.resolution||t[47]!==a.timeZone||t[48]!==f||t[49]!==D||t[50]!==u.daily||t[51]!==u.hourly?(O=(0,$.jsx)(jn,{providers:f,days:a.days,daily:u.daily,hours:a.hours,hourly:u.hourly,metric:D,referenceTime:a.referenceTime,resolution:a.resolution,timeZone:a.timeZone}),t[43]=a.days,t[44]=a.hours,t[45]=a.referenceTime,t[46]=a.resolution,t[47]=a.timeZone,t[48]=f,t[49]=D,t[50]=u.daily,t[51]=u.hourly,t[52]=O):O=t[52];let k;t[53]!==h||t[54]!==u.categoryCost?(k=h?null:(0,$.jsx)(Fn,{label:`Cost by type`,segments:Wn(u.categoryCost),format:W}),t[53]=h,t[54]=u.categoryCost,t[55]=k):k=t[55];let A;t[56]===n.tokens?A=t[57]:(A=Gn(n.tokens),t[56]=n.tokens,t[57]=A);let j;t[58]===A?j=t[59]:(j=(0,$.jsx)(Fn,{label:`Tokens by type`,segments:A,format:K}),t[58]=A,t[59]=j);let M;t[60]===u.speedCost?M=t[61]:(M=u.speedCost.fast+u.speedCost.ultrafast>0?(0,$.jsx)(Fn,{label:`Cost by speed`,segments:Kn(u.speedCost),format:W,aside:(0,$.jsx)(Xn,{premiumUsd:u.speedCost.premium})}):null,t[60]=u.speedCost,t[61]=M);let N;t[62]!==k||t[63]!==j||t[64]!==M?(N=(0,$.jsxs)(`div`,{className:`grid gap-x-10 gap-y-8 sm:grid-cols-2`,children:[k,j,M]}),t[62]=k,t[63]=j,t[64]=M,t[65]=N):N=t[65];let P;t[66]!==E||t[67]!==O||t[68]!==N?(P=(0,$.jsx)(Te,{children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[E,O,N]})}),t[66]=E,t[67]=O,t[68]=N,t[69]=P):P=t[69];let F;t[70]!==n.unpricedTokens||t[71]!==o?(F=n.unpricedTokens>0?(0,$.jsxs)(we,{variant:`bare`,className:`items-center sm:justify-between`,children:[(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[K(n.unpricedTokens),` tokens have no known price`]}),(0,$.jsx)(T,{onClick:o,children:`Set price`})]}):null,t[70]=n.unpricedTokens,t[71]=o,t[72]=F):F=t[72];let I;t[73]!==w||t[74]!==P||t[75]!==F?(I=(0,$.jsxs)(De,{className:`max-w-3xl`,children:[w,P,F]}),t[73]=w,t[74]=P,t[75]=F,t[76]=I):I=t[76];let L;return t[77]!==I||t[78]!==v?(L=(0,$.jsx)(Oe,{open:!0,onOpenChange:v,children:I}),t[77]=I,t[78]=v,t[79]=L):L=t[79],L}function Jn(e){return(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`text-2xl font-semibold text-foreground`,children:e.value})]},e.label)}function Yn(e){return e!==null}function Xn(e){let t=(0,Q.c)(4),{premiumUsd:n}=e,r;t[0]===n?r=t[1]:(r=W(n),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Premium `,(0,$.jsx)(`span`,{className:`text-foreground tabular-nums`,children:r})]}),t[2]=r,t[3]=i),i}var Zn=`t3code:usage-page-preferences:v1`,Qn=n({metric:p([`cost`,`tokens`,`limits`]),windowDays:p([1,7,30,90]),hiddenProviders:i(a(c))}),$n={metric:`limits`,windowDays:30};function er(){try{return S(Zn,Qn)??$n}catch(e){return console.error(`Could not read Usage page preferences.`,e),$n}}function tr(e){try{v(Zn,e,Qn)}catch(e){console.error(`Could not save Usage page preferences.`,e)}}function nr(e){return Re.some(t=>t.value===e)}function rr(e){return Ie.some(t=>t.days===e)}var ir=e=>Qe[e].label;function ar(){let[e,t]=(0,Z.useState)(er);oe();let n=h(ce),r=e=>{let t=je(n,e.command,{context:{usagePageOpen:!0}});return t?`${e.label} (${t})`:e.label},[i,a]=(0,Z.useState)(()=>({days:e.windowDays,window:G(e.windowDays,void 0,e.windowDays===1?`hour`:`day`)})),o=e.metric,s=o===`limits`,[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(()=>Date.now()),f=(0,Z.useRef)(!1),[p,m]=(0,Z.useState)(`model`),[g,_]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(null),S=(0,Z.useMemo)(()=>new Set(e.hiddenProviders),[e.hiddenProviders]),{days:C,window:w}=i,O=C===1,{merged:k,environments:A,selectedEnvironments:j,shown:N,isPartial:P,refresh:F}=Dt(w,b,S),I=N?.merged??k,L=N?.window??w,R=L.resolution===`hour`,z=c&&!s,ee=N!==null&&N.window!==w,B=(0,Z.useMemo)(()=>{if(ee)return{partial:!0,everyProvider:!0,providers:new Set};let e=ft(j,z),t=new Set([...e.providers].filter(e=>!S.has(e)));return{partial:e.everyProvider||t.size>0,everyProvider:e.everyProvider,providers:t}},[ee,z,j,S]),V=e=>B.everyProvider||B.providers.has(e),le=h(se.presentationsAtom),U=S.has(`cursor`)?[]:at(j),fe=[...new Set(j.flatMap(e=>e.summary?.sources.flatMap(e=>e.message&&!e.action&&!S.has(e.fingerprint.provider)&&(e.status===`partial`||e.status===`failed`||e.fingerprint.provider===`cursor`)?[e.message]:[])??[]))],ge=ue(H.refreshProviders,{reportFailure:!1}),X=j.some(e=>e.canReadDiagnostics),be=(0,Z.useMemo)(()=>Y(L.sinceDay,L.untilDay),[L.sinceDay,L.untilDay]),Se=(0,Z.useMemo)(()=>L.sinceTime===void 0||L.untilTime===void 0?[]:me(L.sinceTime,L.untilTime),[L.sinceTime,L.untilTime]),Ce=(0,Z.useMemo)(()=>(R?I.hourly:I.daily).toReversed(),[R,I.daily,I.hourly]),we=(0,Z.useMemo)(()=>p===`model`&&o===`tokens`?Rn(I.models):I.models,[p,I.models,o]),Te=(0,Z.useMemo)(()=>et(I.providers),[I.providers]),Ee=(0,Z.useMemo)(()=>$e.filter(e=>Te.includes(e)||B.providers.has(e)),[B.providers,Te]),De=(0,Z.useMemo)(()=>new Set(Ee.filter(e=>B.everyProvider||B.providers.has(e))),[Ee,B.everyProvider,B.providers]),Oe=v===null?void 0:I.models.find(e=>`${e.provider}:${e.model}`===v),Ae=we.reduce((e,t)=>Math.max(e,o===`tokens`?t.totalTokens:t.costUsd),0),ze=Ee.map(e=>({kind:`usage`,provider:e})),We=Math.max(Ee.indexOf(`codex`),Ee.indexOf(`claude`))+1;ze.splice(We,0,...U.map(e=>({kind:`enable`,environment:e})));let Ge=`${60/(Ee.length+2)}%`,Je=n=>{let r={...e,...n};t(r),tr(r)},nt=e=>{rr(e)&&(Je({windowDays:e}),a({days:e,window:G(e,void 0,e===1?`hour`:`day`)}))},Q=e=>{e===`limits`&&d(Date.now()),Je({metric:e})},rt=async(e=!1,t=!1)=>{try{await Promise.all(Array.from(le,([n,r])=>{if((b===null||b.has(n))&&r.connection.phase===`connected`&&r.serverConfig!==null)return ct(n,()=>ge({environmentId:n,input:{}}),e,t)}))}finally{d(Date.now())}},it=(0,Z.useEffectEvent)(e=>{if(e.defaultPrevented||e.repeat||e.isComposing||Ke()||Ue())return;let t=Le(e,n),r=Re.find(e=>e.command===t),i=Ie.find(e=>e.command===t);(r||i)&&(e.preventDefault(),e.stopPropagation(),r&&Q(r.value),i&&!s&&nt(i.days))});(0,Z.useEffect)(()=>(globalThis.window.addEventListener(`keydown`,it,!0),()=>globalThis.window.removeEventListener(`keydown`,it,!0)),[]);let ot=()=>{if(f.current)return;if(s){f.current=!0,l(!0),rt().finally(()=>{f.current=!1,l(!1)});return}let e=G(C,void 0,O?`hour`:`day`);(e.sinceDay!==w.sinceDay||e.untilDay!==w.untilDay||e.sinceTime!==w.sinceTime||e.untilTime!==w.untilTime)&&a({days:C,window:e}),f.current=!0,l(!0),F(e).finally(()=>{f.current=!1,l(!1)})},st=[...le].filter(([e,t])=>t.connection.phase===`connected`&&t.serverConfig!==null&&(b===null||b.has(e))).map(([e])=>e).sort().join(`,`),lt=(0,Z.useEffectEvent)(()=>{rt(!0)});(0,Z.useEffect)(()=>{s&&st&&lt()},[s,st]);let ut=R&&L.sinceTime!==void 0&&L.untilTime!==void 0?`${pe(L.sinceTime,L.timeZone)} to ${pe(L.untilTime,L.timeZone)}`:`${de(L.sinceDay)} to ${de(L.untilDay)}`,dt=(0,$.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 py-2 xl:flex`,children:[(0,$.jsxs)(Ze,{ariaLabel:`Usage breadcrumb`,className:`min-w-0`,children:[(0,$.jsx)(Ye,{children:(0,$.jsx)(`h1`,{children:`Usage`})}),(0,$.jsx)(Xe,{}),(0,$.jsx)(Ye,{className:`min-w-10 shrink`,children:(0,$.jsx)(vr,{environments:A,selectedEnvironments:j,selectedEnvironmentIds:b,onSelectionChange:x,showUsageStatus:!s,refreshing:z,isPartial:P,duplicateSources:I.duplicateSources,contractMismatches:I.contractMismatches,onOpenModelPrices:()=>_({})})}),(0,$.jsx)(Xe,{}),(0,$.jsx)(Ye,{current:!0,className:`min-w-10`,children:(0,$.jsx)(xr,{hiddenProviders:S,onChange:e=>Je({hiddenProviders:e})})})]}),s?null:(0,$.jsx)(`span`,{className:`hidden min-w-0 truncate text-xs text-muted-foreground 2xl:block`,children:ut}),(0,$.jsxs)(`div`,{className:`ms-auto hidden min-w-0 items-center justify-end gap-2 xl:flex`,children:[(0,$.jsx)(ve,{"aria-label":`Usage metric`,variant:`segmented`,value:[o],onValueChange:e=>{let t=e[0];nr(t)&&Q(t)},children:Re.map(e=>(0,$.jsx)(ye,{value:e.value,title:r(e),children:e.label},e.value))}),(0,$.jsx)(ve,{"aria-label":`Usage period`,variant:`segmented`,value:[String(C)],disabled:s,onValueChange:e=>{let t=e[0];t&&nt(Number(t))},children:Ie.map(e=>(0,$.jsx)(ye,{value:String(e.days),title:r(e),children:e.label},e.days))}),(0,$.jsx)(T,{onClick:ot,"aria-label":s?`Refresh limits`:`Refresh usage`,"aria-busy":c,disabled:c||!s&&!X,size:`icon-sm`,variant:`ghost`,children:(0,$.jsx)(He,{size:`sm`,refreshing:c})})]}),(0,$.jsxs)(`div`,{className:`ms-auto flex min-w-0 items-center justify-end gap-1 xl:hidden`,children:[(0,$.jsxs)(ae,{value:o,onValueChange:e=>{nr(e)&&Q(e)},children:[(0,$.jsx)(ie,{"aria-label":`Usage metric`,size:`compact`,variant:`ghost`,className:`w-auto min-w-0`,children:(0,$.jsx)(ne,{children:Re.find(e=>e.value===o)?.label})}),(0,$.jsx)(re,{align:`end`,alignItemWithTrigger:!1,children:Re.map(e=>(0,$.jsx)(te,{value:e.value,title:r(e),children:e.label},e.value))})]}),(0,$.jsxs)(ae,{value:String(C),disabled:s,onValueChange:e=>nt(Number(e)),children:[(0,$.jsx)(ie,{"aria-label":`Usage period`,size:`compact`,variant:`ghost`,className:`w-auto min-w-0`,children:(0,$.jsx)(ne,{children:Ie.find(e=>e.days===C)?.label})}),(0,$.jsx)(re,{align:`end`,alignItemWithTrigger:!1,children:Ie.map(e=>(0,$.jsx)(te,{value:String(e.days),title:r(e),children:e.label},e.days))})]}),(0,$.jsx)(T,{onClick:ot,"aria-label":s?`Refresh limits`:`Refresh usage`,"aria-busy":c,disabled:c||!s&&!X,size:`icon-sm`,variant:`ghost`,children:(0,$.jsx)(He,{size:`sm`,refreshing:c})})]})]});return(0,$.jsxs)(ke,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none isolate`,children:[(0,$.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground`,children:[(0,$.jsx)(qe,{electron:_e,children:dt}),(0,$.jsx)(xe,{className:`min-h-0 flex-1`,children:(0,$.jsx)(Fe,{width:`wide`,children:j.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:A.length===0?`Connect an environment to see ${s?`limits`:`usage`}.`:`Select an environment to see ${s?`limits`:`usage`}.`}):s?(0,$.jsx)(tt,{selectedEnvironmentIds:b,hiddenProviders:S,now:u,cursorPrompt:U.length>0?(0,$.jsx)(lr,{environments:U,onEnabled:()=>{F(),rt(!1,!0)}}):null}):N===null?(0,$.jsx)(Sr,{}):X?(0,$.jsxs)(`div`,{"aria-busy":B.partial,className:`flex flex-col gap-6`,children:[fe.map(e=>(0,$.jsx)(`p`,{className:`mb-4 text-sm text-muted-foreground`,children:e},e)),(0,$.jsxs)(`section`,{className:`grid gap-6 lg:grid-cols-[minmax(0,18rem)_minmax(0,1fr)]`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`span`,{className:D(`text-4xl font-semibold text-foreground tabular-nums`,dr(B.partial)),children:o===`cost`?W(I.costUsd):K(I.totalTokens)}),(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{children:[(0,$.jsxs)(`span`,{className:dr(B.partial),children:[q(I.sessions),` sessions`]}),o===`cost`&&` · API estimate`]}),o===`cost`&&I.costQuality.unpricedShare>0&&(0,$.jsxs)(Pe,{children:[(0,$.jsx)(Ne,{openOnHover:!0,render:(0,$.jsx)(E,{tone:`muted`}),"aria-label":`Unpriced usage details`,children:(0,$.jsx)(M,{className:`size-3`,"aria-hidden":!0})}),(0,$.jsxs)(Me,{side:`top`,tooltipStyle:!0,children:[`API estimate excludes`,` `,J(I.costQuality.unpricedShare),` unpriced records.`]})]})]})]}),!S.has(`codex`)&&[...le].some(([e,t])=>(b===null||b.has(e))&&t.serverConfig?.providers.some(Ve))?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(`span`,{children:`ChatGPT shared usage`}),(0,$.jsx)(Be,{size:`xs`})]}):null,ze.map(e=>{if(e.kind===`enable`)return(0,$.jsx)(cr,{environmentId:e.environment.environmentId,label:e.environment.label,showEnvironment:j.length>1,onEnabled:()=>{F(),rt(!1,!0)}},`enable:${e.environment.environmentId}`);let t=e.provider,n=I.providers.find(e=>e.provider===t),r=o===`cost`?n?.costShare??0:n?.tokenShare??0,i=n?.sessions??0,a=`${q(i)} ${i===1?`session`:`sessions`}`,s=V(t),c=s&&!Te.includes(t);return(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm text-foreground`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-2 shrink-0 rounded-full`,style:{backgroundColor:Qe[t].color}}),(0,$.jsx)(ur,{provider:t,className:`size-4`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,$.jsx)(`span`,{className:`truncate`,children:Qe[t].label}),(0,$.jsx)(`span`,{className:D(`shrink-0 whitespace-nowrap text-2xs text-muted-foreground tabular-nums`,dr(s),c&&`invisible`),children:a})]})]}),(0,$.jsx)(`span`,{className:D(`shrink-0 text-sm font-medium text-foreground tabular-nums`,dr(s)),children:c?`—`:o===`cost`?W(n?.costUsd??0):K(n?.totalTokens??0)})]}),(0,$.jsx)(`span`,{className:D(`text-xs text-muted-foreground`,dr(s),c&&`invisible`),children:o===`cost`?`${J(r)} of cost · ${K(n?.totalTokens??0)} tokens`:`${J(r)} of tokens · ${W(n?.costUsd??0)}`})]},t)})]}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,$.jsxs)(`h2`,{className:`text-sm font-medium text-foreground`,children:[R?`Hourly`:`Daily`,` `,o===`tokens`?`processed tokens`:`cost`]}),(0,$.jsx)(jn,{providers:Ee,loadingProviders:De,days:be,daily:I.daily,hours:Se,hourly:I.hourly,metric:o,referenceTime:L.untilTime,resolution:R?`hour`:`day`,timeZone:L.timeZone})]})]}),(0,$.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Totals`}),(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-4 py-1 md:grid-cols-5`,children:[(0,$.jsx)(fr,{loading:B.partial,label:`Processed tokens`,value:K(I.totalTokens)}),(0,$.jsx)(fr,{loading:B.partial,label:`Cached input`,value:K(I.cachedInputTokens)}),(0,$.jsx)(fr,{loading:B.partial,label:`Uncached input`,value:K(I.uncachedInputTokens)}),(0,$.jsx)(fr,{loading:B.partial,label:`Output`,value:K(I.outputTokens)}),(0,$.jsx)(fr,{loading:B.partial,label:`Cache savings`,value:W(I.costQuality.cacheSavingsUsd)})]})]}),I.totalTokens>0?(0,$.jsx)(`section`,{className:D(`grid gap-x-12 gap-y-8 lg:grid-cols-2`,dr(B.partial)),children:o===`tokens`?(0,$.jsx)(Fn,{label:`Tokens by type`,segments:Gn(I),format:K}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Fn,{label:`Cost by type`,segments:Wn(I.categoryCost),format:W}),I.speedCost.fast+I.speedCost.ultrafast>0?(0,$.jsx)(Fn,{label:`Cost by speed`,segments:Kn(I.speedCost),format:W,aside:(0,$.jsx)(Xn,{premiumUsd:I.speedCost.premium})}):null]})}):null,(0,$.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Breakdown`}),(0,$.jsx)(ve,{"aria-label":`Usage breakdown`,variant:`segmented`,value:[p],onValueChange:e=>{let t=e[0];(t===`model`||t===`time`)&&m(t)},children:[{value:`model`,label:`Model`},{value:`time`,label:R?`Hour`:`Day`}].map(e=>(0,$.jsx)(ye,{value:e.value,children:e.label},e.value))})]}),p===`model`?(0,$.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{className:`border-b border-border text-right text-xs text-muted-foreground`,children:[(0,$.jsx)(`th`,{className:`py-2 pr-3 text-left font-normal`,children:`#`}),(0,$.jsx)(`th`,{className:`w-full py-2 text-left font-normal`,children:`Model`}),(0,$.jsx)(`th`,{className:`py-2 pl-6 font-normal`,children:`Cost`}),(0,$.jsx)(`th`,{className:`hidden py-2 pl-6 font-normal sm:table-cell`,children:`Share`}),(0,$.jsx)(`th`,{className:`py-2 pl-6 font-normal`,children:`Tokens`})]})}),(0,$.jsx)(`tbody`,{children:we.length===0?(0,$.jsx)(`tr`,{children:(0,$.jsx)(`td`,{colSpan:5,className:`py-6 text-center text-muted-foreground`,children:`No activity in this window.`})}):we.map((e,t)=>{let n=`${e.provider}:${e.model}`,r=o===`tokens`?e.totalTokens:e.costUsd,i=zn(e,o===`tokens`?`tokens`:`cost`),a=dr(V(e.provider));return(0,$.jsxs)(`tr`,{className:`relative border-b border-border/50 text-right whitespace-nowrap text-muted-foreground tabular-nums transition-colors hover:bg-muted/50 has-focus-visible:bg-muted/50`,children:[(0,$.jsx)(`td`,{className:`py-2.5 pr-3 text-left text-xs`,children:t+1}),(0,$.jsxs)(`td`,{className:`py-2.5 text-left whitespace-normal`,children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>y(n),className:`flex items-center gap-2 text-left text-foreground outline-none after:absolute after:inset-0`,children:[(0,$.jsx)(ur,{provider:e.provider,className:`size-3.5`}),e.model]}),(0,$.jsx)(`div`,{"aria-hidden":!0,className:D(`mt-1.5 h-0.5 max-w-48`,a),children:(0,$.jsx)(`div`,{className:`h-full rounded-full`,style:{width:r>0&&Ae>0?`max(0.5rem, ${r/Ae*100}%)`:0,backgroundColor:Qe[e.provider].color}})})]}),(0,$.jsx)(`td`,{className:D(`py-2.5 pl-6 text-foreground`,a),children:pt(e)?(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Unpriced`}):W(e.costUsd)}),(0,$.jsx)(`td`,{className:D(`hidden py-2.5 pl-6 sm:table-cell`,a),children:i===null?``:J(i)}),(0,$.jsx)(`td`,{className:D(`py-2.5 pl-6`,a),children:K(e.totalTokens)})]},n)})})]}):(0,$.jsxs)(`table`,{className:`w-full table-fixed text-sm`,children:[(0,$.jsxs)(`colgroup`,{children:[(0,$.jsx)(`col`,{className:`w-2/5`}),Ee.map(e=>(0,$.jsx)(`col`,{style:{width:Ge}},e)),(0,$.jsx)(`col`,{style:{width:Ge}}),(0,$.jsx)(`col`,{style:{width:Ge}})]}),(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{className:`border-b border-border text-left text-xs text-muted-foreground`,children:[(0,$.jsx)(`th`,{className:`py-2 font-normal`,children:R?`Hour`:`Day`}),Ee.map(e=>(0,$.jsx)(`th`,{className:`py-2 text-right font-normal`,children:Qe[e].label},e)),(0,$.jsx)(`th`,{className:`py-2 text-right font-normal`,children:`Total`}),(0,$.jsx)(`th`,{className:`py-2 text-right font-normal`,children:`Tokens`})]})}),(0,$.jsx)(`tbody`,{children:Ce.length===0?(0,$.jsx)(`tr`,{children:(0,$.jsx)(`td`,{colSpan:Ee.length+3,className:`py-6 text-center text-muted-foreground`,children:`No activity in this window.`})}):Ce.map(e=>(0,$.jsxs)(`tr`,{className:`border-b border-border/50 transition-colors hover:bg-muted/50`,children:[(0,$.jsx)(`td`,{className:`py-2 text-foreground`,children:`hourStart`in e?he(e.hourStart,L.timeZone):de(e.day)}),Ee.map(t=>(0,$.jsx)(`td`,{className:D(`py-2 text-right text-muted-foreground tabular-nums`,dr(V(t))),children:W(e.byProvider.get(t)?.costUsd??0)},t)),(0,$.jsx)(`td`,{className:D(`py-2 text-right text-foreground tabular-nums`,dr(B.partial)),children:W(e.costUsd)}),(0,$.jsx)(`td`,{className:D(`py-2 text-right text-muted-foreground tabular-nums`,dr(B.partial)),children:K(e.totalTokens)})]},`hourStart`in e?e.hourStart:e.day))})]})]})]}):(0,$.jsx)(`div`,{className:`space-y-2 py-12 text-center text-sm text-muted-foreground`,children:j.map(e=>(0,$.jsxs)(`p`,{children:[j.length>1?`${e.label}: `:null,e.error]},e.environmentId))})})})]}),Oe!==void 0&&!s?(0,$.jsx)(qn,{model:Oe,environments:j,metric:o===`tokens`?`tokens`:`cost`,chartWindow:{days:be,hours:Se,resolution:R?`hour`:`day`,timeZone:L.timeZone,referenceTime:L.untilTime},onSetPrice:()=>{y(null),_({model:Oe.model})},onClose:()=>y(null)}):null,g?(0,$.jsx)(Xt,{usage:A,initialSelectedEnvironmentIds:b,initialModel:g.model,onOpenChange:e=>{e||_(null)}}):null]})}var or=`Requires access to your Cursor login in macOS Keychain.`;function sr({environmentId:e,label:t,onEnabled:n,tooltip:r,buttonText:i=`Enable`}){let a=ue(H.updateSettings,{label:`enable Cursor account usage`}),[o,s]=(0,Z.useState)(!1),c=async()=>{s(!0);try{(await a({environmentId:e,input:{patch:{cursorKeychainUsageEnabled:!0}}}))._tag===`Success`&&n()}finally{s(!1)}},l=r?(0,$.jsx)(E,{disabled:o,"aria-busy":o,"aria-label":`Enable Cursor usage from ${t}`,onClick:()=>void c(),children:i}):(0,$.jsx)(T,{size:`sm`,variant:`outline`,disabled:o,"aria-busy":o,"aria-label":`Enable Cursor usage from ${t}`,onClick:()=>void c(),children:i});return r?(0,$.jsxs)(V,{children:[(0,$.jsx)(ee,{render:l}),(0,$.jsx)(B,{children:or})]}):l}function cr(e){let t=(0,Q.c)(11),{environmentId:n,label:r,showEnvironment:i,onEnabled:a}=e,o,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-2 shrink-0 rounded-full`,style:{backgroundColor:Qe.cursor.color}}),s=(0,$.jsx)(ur,{provider:`cursor`,className:`size-4`}),t[0]=o,t[1]=s):(o=t[0],s=t[1]);let c=i?` · ${r}`:``,l;t[2]===c?l=t[3]:(l=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm text-foreground`,children:[o,s,(0,$.jsxs)(`span`,{className:`truncate`,children:[`Cursor`,c]})]}),t[2]=c,t[3]=l);let u;t[4]!==n||t[5]!==r||t[6]!==a?(u=(0,$.jsx)(sr,{environmentId:n,label:r,onEnabled:a,tooltip:!0}),t[4]=n,t[5]=r,t[6]=a,t[7]=u):u=t[7];let d;return t[8]!==l||t[9]!==u?(d=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-baseline justify-between gap-4 text-sm`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10],d}function lr(e){let t=(0,Q.c)(10),{environments:n,onEnabled:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,$.jsx)(ze,{driverKind:b.make(`cursor`),displayName:`Cursor`,indicatorBackground:`var(--background)`,className:`size-5`,iconClassName:`size-4 text-foreground/80`}),`Cursor`]}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:or}),t[1]=a):a=t[1];let o;if(t[2]!==n||t[3]!==r){let e;t[5]!==n.length||t[6]!==r?(e=e=>(0,$.jsx)(sr,{environmentId:e.environmentId,label:e.label,buttonText:n.length>1?`Enable on ${e.label}`:`Enable`,onEnabled:r,tooltip:!1},e.environmentId),t[5]=n.length,t[6]=r,t[7]=e):e=t[7],o=n.map(e),t[2]=n,t[3]=r,t[4]=o}else o=t[4];let s;return t[8]===o?s=t[9]:(s=(0,$.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[i,(0,$.jsxs)(`div`,{className:`flex flex-col items-start gap-3 rounded-lg border border-border/60 p-4`,children:[a,(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:o})]})]}),t[8]=o,t[9]=s),s}function ur(e){let t=(0,Q.c)(4),{provider:n,className:r}=e,i=Qe[n],a;return t[0]!==r||t[1]!==i.driverKind||t[2]!==i.label?(a=(0,$.jsx)(ze,{driverKind:i.driverKind,displayName:i.label,iconClassName:r}),t[0]=r,t[1]=i.driverKind,t[2]=i.label,t[3]=a):a=t[3],a}function dr(e){return D(`transition-opacity`,e&&`opacity-40 delay-150`)}function fr(e){let t=(0,Q.c)(10),{label:n,value:r,loading:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=D(`text-base font-medium text-foreground tabular-nums`,dr(i)),t[2]=i,t[3]=o);let s;t[4]!==o||t[5]!==r?(s=(0,$.jsx)(`span`,{className:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==s?(c=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function pr(e){let t=(0,Q.c)(14),{environments:n,duplicateSources:r,contractMismatches:i}=e,a,o,s,c;if(t[0]!==i||t[1]!==r||t[2]!==n){c=Symbol.for(`react.early_return_sentinel`);bb0:{let e=n.filter(_r),t=new Map(i.map(gr)),l=n.flatMap(e=>{let n=t.get(e.environmentId);return n===void 0?[]:[{environment:e,mismatch:n}]});if(e.length===0&&l.length===0&&r.length===0){c=null;break bb0}a=`flex flex-col gap-1 border-t border-border px-2 py-2 text-xs text-muted-foreground`,o=e.map(hr),s=l.map(mr)}t[0]=i,t[1]=r,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c}else a=t[3],o=t[4],s=t[5],c=t[6];if(c!==Symbol.for(`react.early_return_sentinel`))return c;let l;t[7]===r?l=t[8]:(l=r.length>0?(0,$.jsxs)(`span`,{children:[`Counted once across environments sharing a transcript directory:`,` `,r.join(`, `)]}):null,t[7]=r,t[8]=l);let u;return t[9]!==a||t[10]!==o||t[11]!==s||t[12]!==l?(u=(0,$.jsxs)(`div`,{className:a,children:[o,s,l]}),t[9]=a,t[10]=o,t[11]=s,t[12]=l,t[13]=u):u=t[13],u}function mr(e){let{environment:t,mismatch:n}=e;return(0,$.jsx)(`span`,{children:ge(t.label,n)},t.environmentId)}function hr(e){return(0,$.jsxs)(`span`,{children:[e.label,`: `,e.error]},e.label)}function gr(e){return[e.environmentId,e]}function _r(e){return e.error!==null}function vr(e){let t=(0,Q.c)(56),{environments:n,selectedEnvironments:r,selectedEnvironmentIds:i,onSelectionChange:a,showUsageStatus:s,refreshing:c,isPartial:u,duplicateSources:d,contractMismatches:f,onOpenModelPrices:p}=e,m=i===null,h=m?`All environments`:r.length===1?r[0].label:`${r.length} environments`,v;t[0]!==f||t[1]!==r?(v=r.some(br)||f.length>0,t[0]=f,t[1]=r,t[2]=v):v=t[2];let b=v,S;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(E,{}),t[3]=S):S=t[3];let C;t[4]===h?C=t[5]:(C=(0,$.jsx)(Je,{children:h}),t[4]=h,t[5]=C);let w;t[6]!==b||t[7]!==s?(w=(0,$.jsx)(`span`,{className:`flex size-3.5 shrink-0 items-center justify-center text-muted-foreground`,children:s&&b?(0,$.jsx)(j,{className:`size-3.5 text-warning-foreground`,"aria-label":`Some environments could not report usage`}):(0,$.jsx)(A,{className:`size-3.5 opacity-0 transition-opacity group-hover/usage-environment:opacity-100 group-focus-visible/usage-environment:opacity-100 group-data-popup-open/usage-environment:opacity-100`,"aria-hidden":!0})}),t[6]=b,t[7]=s,t[8]=w):w=t[8];let T;t[9]!==C||t[10]!==w?(T=(0,$.jsxs)(y,{render:S,className:`group/usage-environment min-w-0 max-w-full`,children:[C,w]}),t[9]=C,t[10]=w,t[11]=T):T=t[11];let O;t[12]===a?O=t[13]:(O=e=>a(e?null:new Set),t[12]=a,t[13]=O);let k;t[14]!==m||t[15]!==O?(k=(0,$.jsx)(o,{checked:m,closeOnClick:!1,onCheckedChange:O,children:`All environments`}),t[14]=m,t[15]=O,t[16]=k):k=t[16];let M;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(x,{}),t[17]=M):M=t[17];let N;if(t[18]!==n||t[19]!==a||t[20]!==c||t[21]!==i||t[22]!==r||t[23]!==s){let e;t[25]!==n.length||t[26]!==a||t[27]!==c||t[28]!==i||t[29]!==r||t[30]!==s?(e=e=>{let t=i===null||i.has(e.environmentId),l=ut(e,c),u=e.error===null?e.summary!==null&&!bt(e.summary.contractVersion,6)?`Update required`:e.isConnected?l.phase===`loading`?`Scanning…`:l.phase===`stale`?`Refreshing…`:l.phase===`partway`?dt(l.providers,ir):`Ready`:`Connecting…`:`Unavailable`;return(0,$.jsx)(o,{checked:t,closeOnClick:!1,onCheckedChange:t=>{let i=new Set(r.map(yr));t?i.add(e.environmentId):i.delete(e.environmentId),a(i.size===n.length?null:i)},children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),s?(0,$.jsx)(`span`,{className:D(`shrink-0 text-xs text-muted-foreground`,e.error!==null&&`text-destructive`),children:u}):null]})},e.environmentId)},t[25]=n.length,t[26]=a,t[27]=c,t[28]=i,t[29]=r,t[30]=s,t[31]=e):e=t[31],N=n.map(e),t[18]=n,t[19]=a,t[20]=c,t[21]=i,t[22]=r,t[23]=s,t[24]=N}else N=t[24];let F;t[32]===n.length?F=t[33]:(F=n.length===0?(0,$.jsx)(`p`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`No environments connected.`}):null,t[32]=n.length,t[33]=F);let I;t[34]!==u||t[35]!==s?(I=s&&u?(0,$.jsx)(`p`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`Totals are partial while selected environments scan.`}):null,t[34]=u,t[35]=s,t[36]=I):I=t[36];let L;t[37]!==f||t[38]!==d||t[39]!==r||t[40]!==s?(L=s?(0,$.jsx)(pr,{environments:r,duplicateSources:d,contractMismatches:f}):null,t[37]=f,t[38]=d,t[39]=r,t[40]=s,t[41]=L):L=t[41];let R;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(x,{}),t[42]=R):R=t[42];let z;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(P,{"aria-hidden":!0}),t[43]=z):z=t[43];let ee;t[44]===p?ee=t[45]:(ee=(0,$.jsxs)(l,{onClick:p,children:[z,`Model prices`]}),t[44]=p,t[45]=ee);let B;t[46]!==F||t[47]!==I||t[48]!==L||t[49]!==ee||t[50]!==k||t[51]!==N?(B=(0,$.jsxs)(_,{align:`start`,children:[k,M,N,F,I,L,R,ee]}),t[46]=F,t[47]=I,t[48]=L,t[49]=ee,t[50]=k,t[51]=N,t[52]=B):B=t[52];let V;return t[53]!==B||t[54]!==T?(V=(0,$.jsxs)(g,{children:[T,B]}),t[53]=B,t[54]=T,t[55]=V):V=t[55],V}function yr(e){return e.environmentId}function br(e){return e.error!==null}function xr(e){let t=(0,Q.c)(23),{hiddenProviders:n,onChange:r}=e,i;t[0]===n?i=t[1]:(i=$e.filter(e=>!n.has(e)),t[0]=n,t[1]=i);let a=i,s=a.length===$e.length?`All providers`:a.length===0?`No providers`:a.length===1?Qe[a[0]].label:`${a.length} providers`,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(E,{}),t[2]=c):c=t[2];let l;t[3]===s?l=t[4]:(l=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),t[3]=s,t[4]=l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(A,{className:`size-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/usage-provider:opacity-100 group-focus-visible/usage-provider:opacity-100 group-data-popup-open/usage-provider:opacity-100`,"aria-hidden":!0}),t[5]=u):u=t[5];let d;t[6]===l?d=t[7]:(d=(0,$.jsxs)(y,{render:c,className:`group/usage-provider min-w-0 max-w-full`,children:[l,u]}),t[6]=l,t[7]=d);let f=n.size===0,p;t[8]===r?p=t[9]:(p=e=>r(e?[]:$e),t[8]=r,t[9]=p);let m;t[10]!==f||t[11]!==p?(m=(0,$.jsx)(o,{checked:f,closeOnClick:!1,onCheckedChange:p,children:`All providers`}),t[10]=f,t[11]=p,t[12]=m):m=t[12];let h;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(x,{}),t[13]=h):h=t[13];let v;t[14]!==n||t[15]!==r?(v=$e.map(e=>(0,$.jsx)(o,{checked:!n.has(e),closeOnClick:!1,onCheckedChange:t=>r($e.filter(r=>r===e?!t:n.has(r))),children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(ur,{provider:e,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`truncate`,children:Qe[e].label})]})},e)),t[14]=n,t[15]=r,t[16]=v):v=t[16];let b;t[17]!==v||t[18]!==m?(b=(0,$.jsxs)(_,{align:`start`,children:[m,h,v]}),t[17]=v,t[18]=m,t[19]=b):b=t[19];let S;return t[20]!==b||t[21]!==d?(S=(0,$.jsxs)(g,{children:[d,b]}),t[20]=b,t[21]=d,t[22]=S):S=t[22],S}function Sr(){let e=(0,Q.c)(7),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(X,{className:`h-10 w-36`}),(0,$.jsx)(X,{className:`h-4 w-32`})]}),$e.map(Cr)]}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(X,{className:`h-5 w-24`}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`section`,{className:`grid gap-6 lg:grid-cols-[minmax(0,18rem)_minmax(0,1fr)]`,children:[t,(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[n,(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(X,{className:`ml-16 h-56`}),(0,$.jsx)(X,{className:`ml-16 h-4`})]})]})]}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Totals`}),e[3]=i):i=e[3];let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[i,(0,$.jsx)(wr,{labels:[`Processed tokens`,`Cached input`,`Uncached input`,`Output`,`Cache savings`]})]}),e[4]=a):a=e[4];let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(`section`,{className:`grid gap-x-12 gap-y-8 lg:grid-cols-2`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,$.jsx)(X,{className:`h-5 w-28`}),(0,$.jsx)(X,{className:`h-2`}),(0,$.jsx)(X,{className:`h-4 w-72`})]})}),e[5]=o):o=e[5];let s;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsxs)($.Fragment,{children:[r,a,o,(0,$.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Breakdown`}),(0,$.jsx)(X,{shape:`card`,className:`h-7 w-28`})]}),(0,$.jsx)(X,{className:`h-44`})]})]}),e[6]=s):s=e[6],s}function Cr(e){return(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsxs)(`div`,{className:`flex min-h-5 items-center justify-between gap-4`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(X,{shape:`pill`,className:`size-2 shrink-0`}),(0,$.jsx)(X,{shape:`pill`,className:`size-4 shrink-0`}),(0,$.jsx)(X,{className:`h-3.5 w-20`})]}),(0,$.jsx)(X,{className:`h-3.5 w-14`})]}),(0,$.jsx)(X,{className:`h-4 w-36`})]},e)}function wr(e){let t=(0,Q.c)(4),{labels:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Tr),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-4 py-1 md:grid-cols-5`,children:r}),t[2]=r,t[3]=i),i}function Tr(e){return(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,$.jsx)(X,{className:`h-6 w-16`})]},e)}var Er=ar;export{Er as component};
2
+ //# sourceMappingURL=usage-B26GT0RK.js.map
@@ -1,2 +1,2 @@
1
- import{If as e,hf as t}from"./utils-geC9CGP4.js";function n(n){if(n.hasSessionError)return{canReadDiagnostics:!1,isPending:!1,error:`Could not check this connection's access to diagnostics and usage.`};if(n.session===null){let e=n.connectionPhase===`connected`||n.connectionPhase===`connecting`||n.connectionPhase===`reconnecting`;return{canReadDiagnostics:!1,isPending:e,error:e?null:`This environment is not connected.`}}let r=e(n.session,t);return{canReadDiagnostics:r,isPending:!1,error:r?null:`This connection does not have access to diagnostics and usage.`}}export{n as t};
2
- //# sourceMappingURL=usageAccess-BmfDNhp2.js.map
1
+ import{Rf as e,_f as t}from"./utils-DmS758az.js";function n(n){if(n.hasSessionError)return{canReadDiagnostics:!1,isPending:!1,error:`Could not check this connection's access to diagnostics and usage.`};if(n.session===null){let e=n.connectionPhase===`connected`||n.connectionPhase===`connecting`||n.connectionPhase===`reconnecting`;return{canReadDiagnostics:!1,isPending:e,error:e?null:`This environment is not connected.`}}let r=e(n.session,t);return{canReadDiagnostics:r,isPending:!1,error:r?null:`This connection does not have access to diagnostics and usage.`}}export{n as t};
2
+ //# sourceMappingURL=usageAccess-BNLOTFbF.js.map
@@ -1,2 +1,2 @@
1
- import{Fc as e}from"./utils-geC9CGP4.js";var t=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2}),n=new Intl.NumberFormat(`en-US`);function r(e){return t.format(e)}function i(e){return n.format(Math.round(e))}function a(e){let t=Math.abs(e);return t>=0xe8d4a51000?`${o(e/0xe8d4a51000)}T`:t>=1e9?`${o(e/1e9)}B`:t>=1e6?`${o(e/1e6)}M`:t>=1e3?`${o(e/1e3)}K`:n.format(Math.round(e))}function o(e){let t=Math.abs(e),n=t>=100?0:t>=10?1:2;return e.toFixed(n).replace(/\.0+$/,``)}function s(e,t=1){let n=e*100,r=10**-t;return n>0&&n<r?`<${r.toFixed(t)}%`:`${n.toFixed(t)}%`}function c(e,t){return t.direction===`serverBehind`?`${e} runs an older server version and is excluded from totals.`:`This client is older than the server on ${e}; its usage is excluded from totals.`}function l(e){let[t,n,r]=e.split(`-`).map(e=>Number(e));return t===void 0||n===void 0||r===void 0?e:`${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][n-1]??``} ${r}`}function u(e,t){let n=[],r=Date.parse(`${e}T00:00:00Z`),i=Date.parse(`${t}T00:00:00Z`);if(Number.isNaN(r)||Number.isNaN(i)||i<r)return n;for(let e=r;e<=i;e+=864e5)n.push(new Date(e).toISOString().slice(0,10));return n}var d=36e5,f=new Map;function p(e,t){if(t.timeZone===void 0)return new Intl.DateTimeFormat(e,t);let n=JSON.stringify([e,t]),r=f.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),f.size>=16&&f.clear(),f.set(n,r)),r}function m(e,t){let n=[],r=Date.parse(e),i=Date.parse(t);if(Number.isNaN(r)||Number.isNaN(i)||i<=r)return n;for(let e=r;e<i;e+=d)n.push(new Date(e).toISOString());return n}function h(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return e;let r=t===void 0?{}:{timeZone:t},i=p(`en-US`,{...r,hour:`numeric`}),a=p(`en-CA`,{...r,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,hourCycle:`h23`}),o=a.format(n);return[-36e5,d].some(e=>a.format(new Date(n.getTime()+e))===o)?p(`en-US`,{...t===void 0?{}:{timeZone:t},hour:`numeric`,timeZoneName:`short`}).format(n):i.format(n)}function g(e,t){let n=new Date(e);return Number.isNaN(n.getTime())?e:p(`en-US`,{...t===void 0?{}:{timeZone:t},month:`short`,day:`numeric`,hour:`numeric`}).format(n)}function _(e,t,n){let r=new Date(e),i=new Date(t);if(Number.isNaN(r.getTime())||Number.isNaN(i.getTime()))return g(e,n);let a=p(`en-CA`,{...n===void 0?{}:{timeZone:n},year:`numeric`,month:`2-digit`,day:`2-digit`}),o=Date.parse(`${a.format(r)}T00:00:00Z`),s=Date.parse(`${a.format(i)}T00:00:00Z`),c=Math.round((s-o)/(24*d)),l=h(e,n);return c===0?`${l} today`:c===1?`${l} yesterday`:g(e,n)}function v(t,n=new Date,r=`day`){let i=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,a;try{a=new Intl.DateTimeFormat(`en-CA`,{timeZone:i,year:`numeric`,month:`2-digit`,day:`2-digit`})}catch{i=`UTC`,a=new Intl.DateTimeFormat(`en-CA`,{timeZone:`UTC`,year:`numeric`,month:`2-digit`,day:`2-digit`})}let o=a.format(n);if(r===`hour`){let t=Math.floor(n.getTime()/6e4)*6e4,o=t-24*d,s=new Date(o),c=new Date(t);return{sinceDay:e.make(a.format(s)),untilDay:e.make(a.format(c)),timeZone:i,resolution:r,sinceTime:s.toISOString(),untilTime:c.toISOString()}}let[s=0,c=1,l=1]=o.split(`-`).map(e=>Number.parseInt(e,10)),u=new Date(Date.UTC(s,c-1,l-(t-1)));return{sinceDay:e.make(u.toISOString().slice(0,10)),untilDay:e.make(o),timeZone:i,resolution:r}}export{l as a,_ as c,r as d,v as f,g as i,a as l,m as n,h as o,i as r,s,u as t,c as u};
2
- //# sourceMappingURL=usageFormat-DdjdHqj5.js.map
1
+ import{Fc as e}from"./utils-DmS758az.js";var t=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2}),n=new Intl.NumberFormat(`en-US`);function r(e){return t.format(e)}function i(e){return n.format(Math.round(e))}function a(e){let t=Math.abs(e);return t>=0xe8d4a51000?`${o(e/0xe8d4a51000)}T`:t>=1e9?`${o(e/1e9)}B`:t>=1e6?`${o(e/1e6)}M`:t>=1e3?`${o(e/1e3)}K`:n.format(Math.round(e))}function o(e){let t=Math.abs(e),n=t>=100?0:t>=10?1:2;return e.toFixed(n).replace(/\.0+$/,``)}function s(e,t=1){let n=e*100,r=10**-t;return n>0&&n<r?`<${r.toFixed(t)}%`:`${n.toFixed(t)}%`}function c(e,t){return t.direction===`serverBehind`?`${e} runs an older server version and is excluded from totals.`:`This client is older than the server on ${e}; its usage is excluded from totals.`}function l(e){let[t,n,r]=e.split(`-`).map(e=>Number(e));return t===void 0||n===void 0||r===void 0?e:`${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][n-1]??``} ${r}`}function u(e,t){let n=[],r=Date.parse(`${e}T00:00:00Z`),i=Date.parse(`${t}T00:00:00Z`);if(Number.isNaN(r)||Number.isNaN(i)||i<r)return n;for(let e=r;e<=i;e+=864e5)n.push(new Date(e).toISOString().slice(0,10));return n}var d=36e5,f=new Map;function p(e,t){if(t.timeZone===void 0)return new Intl.DateTimeFormat(e,t);let n=JSON.stringify([e,t]),r=f.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),f.size>=16&&f.clear(),f.set(n,r)),r}function m(e,t){let n=[],r=Date.parse(e),i=Date.parse(t);if(Number.isNaN(r)||Number.isNaN(i)||i<=r)return n;for(let e=r;e<i;e+=d)n.push(new Date(e).toISOString());return n}function h(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return e;let r=t===void 0?{}:{timeZone:t},i=p(`en-US`,{...r,hour:`numeric`}),a=p(`en-CA`,{...r,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,hourCycle:`h23`}),o=a.format(n);return[-36e5,d].some(e=>a.format(new Date(n.getTime()+e))===o)?p(`en-US`,{...t===void 0?{}:{timeZone:t},hour:`numeric`,timeZoneName:`short`}).format(n):i.format(n)}function g(e,t){let n=new Date(e);return Number.isNaN(n.getTime())?e:p(`en-US`,{...t===void 0?{}:{timeZone:t},month:`short`,day:`numeric`,hour:`numeric`}).format(n)}function _(e,t,n){let r=new Date(e),i=new Date(t);if(Number.isNaN(r.getTime())||Number.isNaN(i.getTime()))return g(e,n);let a=p(`en-CA`,{...n===void 0?{}:{timeZone:n},year:`numeric`,month:`2-digit`,day:`2-digit`}),o=Date.parse(`${a.format(r)}T00:00:00Z`),s=Date.parse(`${a.format(i)}T00:00:00Z`),c=Math.round((s-o)/(24*d)),l=h(e,n);return c===0?`${l} today`:c===1?`${l} yesterday`:g(e,n)}function v(t,n=new Date,r=`day`){let i=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,a;try{a=new Intl.DateTimeFormat(`en-CA`,{timeZone:i,year:`numeric`,month:`2-digit`,day:`2-digit`})}catch{i=`UTC`,a=new Intl.DateTimeFormat(`en-CA`,{timeZone:`UTC`,year:`numeric`,month:`2-digit`,day:`2-digit`})}let o=a.format(n);if(r===`hour`){let t=Math.floor(n.getTime()/6e4)*6e4,o=t-24*d,s=new Date(o),c=new Date(t);return{sinceDay:e.make(a.format(s)),untilDay:e.make(a.format(c)),timeZone:i,resolution:r,sinceTime:s.toISOString(),untilTime:c.toISOString()}}let[s=0,c=1,l=1]=o.split(`-`).map(e=>Number.parseInt(e,10)),u=new Date(Date.UTC(s,c-1,l-(t-1)));return{sinceDay:e.make(u.toISOString().slice(0,10)),untilDay:e.make(o),timeZone:i,resolution:r}}export{l as a,_ as c,r as d,v as f,g as i,a as l,m as n,h as o,i as r,s,u as t,c as u};
2
+ //# sourceMappingURL=usageFormat-DKCO_wk0.js.map
@@ -1,2 +1,2 @@
1
- import{g as e}from"./keybindings-B4uuYLfE.js";var t=[{value:`cost`,label:`Cost`,command:`usage.cost`},{value:`tokens`,label:`Tokens`,command:`usage.tokens`},{value:`limits`,label:`Limits`,command:`usage.limits`}],n=[{days:1,label:`Past 24h`,command:`usage.period.day`},{days:7,label:`7 days`,command:`usage.period.week`},{days:30,label:`30 days`,command:`usage.period.month`},{days:90,label:`90 days`,command:`usage.period.quarter`}];function r(t,n){let r=t.target;return r instanceof HTMLElement&&(r.tagName===`INPUT`||r.tagName===`TEXTAREA`||r.tagName===`SELECT`||r.isContentEditable||r.closest(`[role="dialog"], [aria-modal="true"], [data-slot$="popup"]`))?null:e(t,n,{context:{usagePageOpen:!0}})}export{n,r,t};
2
- //# sourceMappingURL=usageShortcuts-RpypNfqZ.js.map
1
+ import{g as e}from"./keybindings-CzL-fWkh.js";var t=[{value:`cost`,label:`Cost`,command:`usage.cost`},{value:`tokens`,label:`Tokens`,command:`usage.tokens`},{value:`limits`,label:`Limits`,command:`usage.limits`}],n=[{days:1,label:`Past 24h`,command:`usage.period.day`},{days:7,label:`7 days`,command:`usage.period.week`},{days:30,label:`30 days`,command:`usage.period.month`},{days:90,label:`90 days`,command:`usage.period.quarter`}];function r(t,n){let r=t.target;return r instanceof HTMLElement&&(r.tagName===`INPUT`||r.tagName===`TEXTAREA`||r.tagName===`SELECT`||r.isContentEditable||r.closest(`[role="dialog"], [aria-modal="true"], [data-slot$="popup"]`))?null:e(t,n,{context:{usagePageOpen:!0}})}export{n,r,t};
2
+ //# sourceMappingURL=usageShortcuts-DxLRXv0W.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ho as n,Sx as r}from"./utils-geC9CGP4.js";import{z as i}from"./runtime-BoEmkhOe.js";var a=r(),o=e(t(),1);function s(e,t){let r=(0,a.c)(6),s=(0,o.useContext)(n),c=typeof t==`string`?t:t?.label??e.label,l=typeof t==`string`?!0:t?.reportFailure??!0,u=typeof t==`string`?!0:t?.reportDefect??!0,d;return r[0]!==e||r[1]!==c||r[2]!==s||r[3]!==u||r[4]!==l?(d=t=>i(s,e,t,{label:c,reportFailure:l,reportDefect:u}),r[0]=e,r[1]=c,r[2]=s,r[3]=u,r[4]=l,r[5]=d):d=r[5],d}export{s as t};
2
- //# sourceMappingURL=use-atom-command-Bc7LgQy1.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ho as n,wx as r}from"./utils-DmS758az.js";import{z as i}from"./runtime-CCr9UADV.js";var a=r(),o=e(t(),1);function s(e,t){let r=(0,a.c)(6),s=(0,o.useContext)(n),c=typeof t==`string`?t:t?.label??e.label,l=typeof t==`string`?!0:t?.reportFailure??!0,u=typeof t==`string`?!0:t?.reportDefect??!0,d;return r[0]!==e||r[1]!==c||r[2]!==s||r[3]!==u||r[4]!==l?(d=t=>i(s,e,t,{label:c,reportFailure:l,reportDefect:u}),r[0]=e,r[1]=c,r[2]=s,r[3]=u,r[4]=l,r[5]=d):d=r[5],d}export{s as t};
2
+ //# sourceMappingURL=use-atom-command-CiEeUGsC.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Da as n,_a as r}from"./utils-geC9CGP4.js";var i=e(t());function a(e,t,a,s=!0,c){let[l,u]=i.useState(),d=r(c?`${c}-label`:void 0),f=e??t??l;return n(()=>{let n=e||t||!s?void 0:o(a.current,d);l!==n&&u(n)}),f}function o(e,t){let n=s(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function s(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}export{a as t};
2
- //# sourceMappingURL=useAriaLabelledBy-B_3SmrJo.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Da as n,_a as r}from"./utils-DmS758az.js";var i=e(t());function a(e,t,a,s=!0,c){let[l,u]=i.useState(),d=r(c?`${c}-label`:void 0),f=e??t??l;return n(()=>{let n=e||t||!s?void 0:o(a.current,d);l!==n&&u(n)}),f}function o(e,t){let n=s(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function s(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}export{a as t};
2
+ //# sourceMappingURL=useAriaLabelledBy-CJjXf8Fd.js.map
@@ -0,0 +1,2 @@
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{C as n,E as r,Hc as i,Lo as a,Ls as o,Rs as s,Vo as c,c as l,g as u,i as d,kl as f,s as p,wx as m,zs as h}from"./utils-DmS758az.js";import{I as g,L as _}from"./runtime-CCr9UADV.js";import{C as v,O as ee,d as te,f as ne,m as re,p as y}from"./entities-DNKDCsf2.js";import{Xt as b,an as x}from"./runtime-BVgeNXTV.js";import{a as S,t as C}from"./useParams-CCV3vN4E.js";import{d as w}from"./toast-Bm36EaG6.js";import{s as ie}from"./useSettings-CckatJFa.js";import{n as T}from"./server-B26doYv6.js";import"./queries-Cn1FJB1_.js";import{p as E}from"./session-logic-C0mrkZ0j.js";import{a as D,i as O,n as k}from"./threadSort-BvhI6zOp.js";import{r as ae,s as A}from"./projectFilesQueryState-CrGsc81w.js";import{b as j,v as M}from"./sortable.esm-n8ce5zjO.js";import{d as N,f as oe,i as se,r as ce,s as le,t as P}from"./p4ProjectFile-BzCYJ8I-.js";var F=e(t(),1),I=m(),L=`[data-thread-item], [data-thread-selection-safe]`,R=3,z=160;function B(e){let t=(0,I.c)(6),[n,r]=F.useState(null),[i,a]=F.useState(e),o,s;t[0]!==e||t[1]!==n?(o=()=>{if(e){a(!0);return}if(n===null)return;if(typeof IntersectionObserver>`u`){a(!0);return}let t=n.closest(`[data-slot="scroll-area-viewport"]`),r=new IntersectionObserver(e=>{let[t]=e;return a(t?.isIntersecting===!0)},{root:t,rootMargin:`${z}px 0px`});return r.observe(n),()=>r.disconnect()},s=[e,n],t[0]=e,t[1]=n,t[2]=o,t[3]=s):(o=t[2],s=t[3]),F.useEffect(o,s);let c=e||i,l;return t[4]===c?l=t[5]:(l={leaseLiveStatus:c,rowRef:r},t[4]=c,t[5]=l),l}function V(e,t){let n=F.useRef(null);return e!==null&&t!==null&&(n.current={key:e,value:t}),t===null?e!==null&&n.current?.key===e?n.current.value:null:t}function H(e,t,n,r){let i=e.indexOf(t),a=e.indexOf(n);return i===-1||a===-1?[]:e.slice(Math.min(i,a),Math.max(i,a)+1).filter(r)}async function U(e){let t=new Set,n=null;for(let r of e.entries){let i=await e.delete(r,t);if(i!==null){if(i._tag===`Failure`){if(_(i))break;n??=i;continue}t.add(r.threadKey)}}return{deletedThreadKeys:t,firstFailure:n}}async function W(e){let t=[],n=[];for(let r of e.entries){let i=!1,a=await e.archive(r,()=>{i=!0});if((i||a._tag===`Success`)&&t.push(r.threadKey),a._tag===`Success`)continue;let o=a;if(i){n.push(o);continue}return{archivedThreadKeys:t,mutationFailure:o,followupFailures:n}}return{archivedThreadKeys:t,mutationFailure:null,followupFailures:n}}function G(e){return[{id:`mark-unread`,label:`Mark unread (${e.count})`},{id:`archive`,label:`Archive (${e.count})`,disabled:e.hasRunningThread},{id:`delete`,label:`Delete (${e.count})`,destructive:!0}]}function K(e){return e.lineage.relationshipToParent===`subagent`}function q(e,t){return e.filter(e=>e.archivedAt===null&&!K(e)&&(t===null||t.has(`${e.environmentId}:${e.projectId}`)))}var J={"Pending Approval":5,"Awaiting Input":4,Working:3,Connecting:3,Waiting:2.5,"Plan Ready":2,Completed:1};function ue(e){let t=e.setTimeoutFn??globalThis.setTimeout,n=e.clearTimeoutFn??globalThis.clearTimeout,r=!1,i=null,a=()=>{i!==null&&(n(i),i=null)};return{sync:n=>{if(!n){a(),r&&(r=!1,e.onVisibilityChange(!1));return}r||i!==null||(i=t(()=>{i=null,r=!0,e.onVisibilityChange(!0)},e.delayMs))},dispose:()=>{a()}}}function de(){let e=(0,I.c)(5),[t,n]=F.useState(!1),r=F.useRef(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=ue({delayMs:200,onVisibilityChange:e=>{n(e)},setTimeoutFn:window.setTimeout.bind(window),clearTimeoutFn:window.clearTimeout.bind(window)});return r.current=e,()=>{e.dispose(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),F.useEffect(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{r.current?.sync(e)},e[2]=o):o=e[2];let s=o,c;return e[3]===t?c=e[4]:(c={showThreadJumpHints:t,updateThreadJumpHintsVisibility:s},e[3]=t,e[4]=c),c}function fe(e,t){return e===void 0?t:e??void 0}function pe(e){if(!e.latestRun?.completedAt)return!1;let t=Date.parse(e.latestRun.completedAt);if(Number.isNaN(t)||!e.lastVisitedAt)return!1;let n=Date.parse(e.lastVisitedAt);return Number.isNaN(n)?!0:t>n}function me(e){return e===null||!e.closest(L)}function he(e){return e>1}function ge(e,t){return e===null||!(`closest`in e)||typeof e.closest!=`function`?null:e.closest(t)}function _e(e){return typeof e!=`object`||!e?!1:ge(e,`a[href]`)!==null||ge(`parentElement`in e&&e.parentElement!==null&&typeof e.parentElement==`object`?e.parentElement:null,`a[href]`)!==null}function ve(e){let{getId:t,getPreferenceIds:n,items:r,preferredIds:i}=e;if(i.length===0)return[...r];let a=new Map;for(let[e,i]of r.entries()){let r=n?.(i)??[t(i)];for(let t of new Set(r)){let n=a.get(t);n?n.push(e):a.set(t,[e])}}let o=new Set,s=i.flatMap(e=>{let t=a.get(e)?.find(e=>!o.has(e));return t===void 0?[]:(o.add(t),[r[t]])}),c=r.filter((e,t)=>!o.has(t));return[...s,...c]}function ye(e,t=R){return e.slice(0,Math.max(0,t))}function be(e){let{currentThreadId:t,direction:n,threadIds:r}=e;if(r.length===0)return null;if(t===null)return n===`previous`?r.at(-1)??null:r[0]??null;let i=r.indexOf(t);return i===-1?null:n===`previous`?i>0?r[i-1]??null:null:i<r.length-1?r[i+1]??null:null}function xe(e){return e.button===2||e.isMac&&e.button===0&&e.ctrlKey}function Se(e){return e.hasPendingApprovals||e.pendingSubagentRequest===`approval`?`approval`:e.hasPendingUserInput||e.pendingSubagentRequest===`user_input`?`input`:e.runtime!==null&&[`preparing`,`queued`,`starting`,`running`,`waiting`].includes(e.runtime.status)?`working`:e.runtime?.status===`idle`?`waiting`:e.runtime?.status===`failed`?e.runtime.lastErrorClass===`usage_limit`?`limited`:`failed`:`ready`}function Ce(e,t){let n=l(t);if(n.length===0)return!1;let r=l(x(e).join(` `));return n.split(` `).every(e=>r.includes(e))}function we(e){let{thread:t}=e;return t.hasPendingApprovals||t.pendingSubagentRequest===`approval`?{label:`Pending Approval`,colorClass:`text-amber-600 dark:text-amber-300/90`,dotClass:`bg-amber-500 dark:bg-amber-300/90`,pulse:!1}:t.hasPendingUserInput||t.pendingSubagentRequest===`user_input`?{label:`Awaiting Input`,colorClass:`text-indigo-600 dark:text-indigo-300/90`,dotClass:`bg-indigo-500 dark:bg-indigo-300/90`,pulse:!1}:t.runtime?.status===`running`||t.runtime?.status===`waiting`?{label:`Working`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:t.runtime?.status===`preparing`||t.runtime?.status===`starting`||t.runtime?.status===`queued`?{label:`Connecting`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:b(t.pendingBackgroundTasks??[])?{label:`Waiting`,colorClass:`text-sidebar-muted-foreground`,dotClass:`bg-sidebar-muted-foreground`,pulse:!1}:!t.hasPendingUserInput&&t.interactionMode===`plan`&&E(t.latestRun,t.runtime)&&t.hasActionableProposedPlan?{label:`Plan Ready`,colorClass:`text-violet-600 dark:text-violet-300/90`,dotClass:`bg-violet-500 dark:bg-violet-300/90`,pulse:!1}:pe(t)?{label:`Completed`,colorClass:`text-emerald-600 dark:text-emerald-300/90`,dotClass:`bg-emerald-500 dark:bg-emerald-300/90`,pulse:!1}:null}function Te(e){let t=null;for(let n of e)n!==null&&(t===null||J[n.label]>J[t.label])&&(t=n);return t}function Ee(e,t){return t.projectExpanded?t.isThreadListExpanded||e.length<=t.previewCount?e:e.slice(0,t.previewCount):[]}function De(e){let{deletedThreadId:t,deletedThreadIds:n,sortOrder:r,threads:i}=e,a=i.find(e=>e.id===t);return a?O(i.filter(e=>e.projectId===a.projectId&&e.id!==t&&!n?.has(e.id)),r)[0]?.id??null:null}function Oe(e,t,n){return t.length>0?t.reduce((e,t)=>Math.max(e,k(t,n)),-1/0):n===`created_at`?D(e.createdAt)??-1/0:D(e.updatedAt??e.createdAt)??-1/0}function Y(e,t,n,r){return t===`manual`?[...e]:e.map(e=>({project:e,timestamp:Oe(e,n(e),t)})).sort((e,t)=>(t.timestamp===e.timestamp?0:t.timestamp>e.timestamp?1:-1)||r(e.project,t.project)).map(({project:e})=>e)}function ke(e,t,n){let r=new Map;for(let e of t){let t=r.get(e.projectId)??[];t.push(e),r.set(e.projectId,t)}return Y(e,n,e=>r.get(e.id)??[],(e,t)=>e.title.localeCompare(t.title)||e.id.localeCompare(t.id))}function Ae(e,t,n){let r=new Map(e.flatMap(e=>e.memberProjectRefs.map(t=>[`${t.environmentId}\0${t.projectId}`,e.projectKey]))),i=new Map;for(let e of t){if(e.archivedAt!==null)continue;let t=r.get(`${e.environmentId}\0${e.projectId}`);if(!t)continue;let n=i.get(t);n?n.push(e):i.set(t,[e])}return Y(e,n,e=>i.get(e.projectKey)??[],(e,t)=>e.title.localeCompare(t.title)||e.projectKey.localeCompare(t.projectKey))}function je(e,t,n){return Ae(e,q(t,null),n)}function Me(e,t,n){let r=(e,t)=>`${e}\u0000${t}`,i=new Map;for(let e of t){if(e.archivedAt!==null)continue;let t=r(e.environmentId,e.projectId),n=i.get(t)??[];n.push(e),i.set(t,n)}return Y(e,n,e=>i.get(r(e.environmentId,e.id))??[],(e,t)=>e.title.localeCompare(t.title)||e.environmentId.localeCompare(t.environmentId)||e.id.localeCompare(t.id))}function X(e){return e.envMode===`worktree`&&e.newWorktreesStartFromOrigin}function Ne(e){return e.projectDefaultSelection??(e.carrySourceDraftId===e.destinationDraftId?null:e.carrySelection)}function Pe(e){let t=e?.activeProvider;return e?.modelSelectionExplicit===!0&&t!=null&&e.modelSelectionByProvider[t]!==void 0}function Z(e){return e.activeThread?o(e.activeThread.environmentId,e.activeThread.projectId):e.activeDraftThread?o(e.activeDraftThread.environmentId,e.activeDraftThread.projectId):e.defaultProjectRef}async function Fe(e){let t=Z(e);return t?(await e.handleNewThread(t),!0):!1}async function Ie(e,t){let n=await g(a,ae(e,t,i),{reportDefect:!1,reportFailure:!1}),r=A(e,t,i,A(e,t,n._tag===`Success`?n.value.relativePath:i,n._tag===`Success`?n.value:null));return r===null||r.truncated?null:P(r.contents)}function Q(e){return{...e?.branch===void 0?{}:{branch:e.branch},...e?.worktreePath===void 0?{}:{worktreePath:e.worktreePath},...e?.envMode===void 0?{}:{envMode:e.envMode},...e?.startFromOrigin===void 0?{}:{startFromOrigin:e.startFromOrigin}}}function $(){let e=(0,I.c)(7),t=c(T),i=ie(oe),a=S(),o;e[0]===a.state.matches?o=e[1]:(o=()=>{let e=a.state.matches[a.state.matches.length-1]?.params??{};return w(e)},e[0]=a.state.matches,e[1]=o);let l=o,m;return e[2]!==t||e[3]!==l||e[4]!==i||e[5]!==a?(m=(e,o)=>{let c=ne(),m=t.get(e.environmentId)?.settings??f,{getComposerDraft:g,getDraftSessionByLogicalProjectKey:_,getDraftSession:v,getDraftThread:ee,applyStickyState:b,setDraftThreadContext:x,setLogicalProjectDraftThreadId:S,setModelSelection:C}=r.getState(),w=a.state.location.href,ie=()=>a.state.location.href!==w,T=l(),E=T?.kind===`server`?y(T.threadRef):null,D=T?.kind===`draft`?v(T.draftId):null,O=T?g(T.kind===`server`?T.threadRef:T.draftId):null,k=O?.activeProvider??null,ae=(k?O?.modelSelectionByProvider[k]??null:null)??E?.modelSelection??null,A=O?.interactionMode??E?.interactionMode??D?.interactionMode??null,j=c.find(t=>t.id===e.projectId&&t.environmentId===e.environmentId),M=()=>ie()||j!==void 0&&te(e)===null,N=se(m,j?.id??null,j),oe=N.settings.defaultModelSelection,P=N.settings.defaultRuntimeMode,F=e=>Ne({projectDefaultSelection:oe??null,carrySelection:ae,carrySourceDraftId:T?.kind===`draft`?T.draftId:null,destinationDraftId:e}),I=async()=>{let n=j!==void 0&&N.settings.defaultThreadEnvMode===null?await Ie(j.environmentId,j.workspaceRoot):null;return ce({projectSettings:se(m,j?.id??null,j,n),workspaceRoot:j?.workspaceRoot??null,newProjectsRoot:t.get(e.environmentId)?.newProjectsRoot,projectHasThreads:re().some(t=>t.environmentId===e.environmentId&&t.projectId===e.projectId)})},L=j?le(j,i):h(e),R=o?.branch!==void 0,z=o?.worktreePath!==void 0,B=o?.envMode!==void 0,V=o?.startFromOrigin!==void 0,H=_(L),U=H?s(H.environmentId,H.threadId):null,W=H!==null&&H.promotedTo==null&&U!==null&&y(U)===null?H:null;U&&W===null&&n(U);let G=W&&!u(g(W.draftId))?W:null,K=T?T.kind===`server`?ee(T.threadRef):v(T.draftId):null;if(G)return(async()=>{let t=T?.kind===`draft`&&T.draftId===G.draftId,n=R||z||B||V,r=null;if(n)r=Q(o);else if(!t){let e=await I();if(M())return null;let t=l(),n=t?.kind===`draft`&&t.draftId===G.draftId,i=U!==null&&y(U)!==null,a=_(L)?.draftId!==G.draftId,o=u(g(G.draftId));if(n||i||a||o)return null;r={branch:null,worktreePath:null,envMode:e,startFromOrigin:X({envMode:e,newWorktreesStartFromOrigin:N.settings.newWorktreesStartFromOrigin})}}if(r&&x(G.draftId,{...r,...t?{}:{runtimeMode:P},...A?{interactionMode:A}:{}}),!Pe(g(G.draftId))){b(G.draftId);let e=F(G.draftId);e&&C(G.draftId,e,{replaceOptions:!0})}S(L,e,G.draftId,{threadId:G.threadId,...r,...t?{}:{runtimeMode:P},...A?{interactionMode:A}:{}});let i={draftId:G.draftId,threadId:G.threadId},s=l();return s?.kind===`draft`&&s.draftId===G.draftId||await a.navigate({to:`/draft/$draftId`,params:{draftId:G.draftId},replace:o?.replace??!1}),i})();if(K&&T?.kind===`draft`&&K.logicalProjectKey===L&&K.promotedTo==null&&!u(g(T.draftId)))return(R||z||B||V)&&x(T.draftId,Q(o)),S(L,e,T.draftId,{threadId:K.threadId,createdAt:K.createdAt,runtimeMode:K.runtimeMode,interactionMode:K.interactionMode,...Q(o)}),Promise.resolve({draftId:T.draftId,threadId:K.threadId});let q=d(),J=p(),ue=new Date().toISOString();return(async()=>{let t=o?.envMode??await I();if(M())return null;let n=_(L);if(n&&n.draftId!==H?.draftId&&y(s(n.environmentId,n.threadId))===null)return S(L,e,n.draftId,{threadId:n.threadId,createdAt:n.createdAt,runtimeMode:n.runtimeMode,interactionMode:n.interactionMode,...Q(o)}),await a.navigate({to:`/draft/$draftId`,params:{draftId:n.draftId},replace:o?.replace??!1}),{draftId:n.draftId,threadId:n.threadId};S(L,e,q,{threadId:J,createdAt:ue,branch:o?.branch??null,worktreePath:o?.worktreePath??null,envMode:t,startFromOrigin:o?.startFromOrigin??X({envMode:t,newWorktreesStartFromOrigin:N.settings.newWorktreesStartFromOrigin}),runtimeMode:P,...A?{interactionMode:A}:{}}),b(q);let r=F(q);return r&&C(q,r,{replaceOptions:!0}),await a.navigate({to:`/draft/$draftId`,params:{draftId:q},replace:o?.replace??!1}),{draftId:q,threadId:J}})()},e[2]=t,e[3]=l,e[4]=i,e[5]=a,e[6]=m):m=e[6],m}function Le(){let e=(0,I.c)(16),t=j(Ve),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={strict:!1,select:Be},e[0]=n):n=e[0];let i=C(n),a=i?.kind===`server`?i.threadRef:null,s=i?.kind===`draft`?i.draftId:null,c=ee(a),l=r(ze),u;e[1]!==l||e[2]!==i?(u=()=>i?i.kind===`server`?l(i.threadRef):r.getState().getDraftSession(i.draftId):null,e[1]=l,e[2]=i,e[3]=u):u=e[3];let d=r(u),f=v(),p;e[4]!==t||e[5]!==f?(p=ve({items:f,preferredIds:t,getId:N,getPreferenceIds:Re}),e[4]=t,e[5]=f,e[6]=p):p=e[6];let m=p,h=$(),g;e[7]===m[0]?g=e[8]:(g=m[0]?o(m[0].environmentId,m[0].id):null,e[7]=m[0],e[8]=g);let _;return e[9]!==d||e[10]!==c||e[11]!==h||e[12]!==s||e[13]!==a||e[14]!==g?(_={activeDraftThread:d,activeThread:c,defaultProjectRef:g,handleNewThread:h,routeDraftId:s,routeThreadRef:a},e[9]=d,e[10]=c,e[11]=h,e[12]=s,e[13]=a,e[14]=g,e[15]=_):_=e[15],_}function Re(e){return[N(e),M(e.workspaceRoot)]}function ze(e){return e.getDraftThread}function Be(e){return w(e)}function Ve(e){return e.projectOrder}export{B as A,we as C,Me as D,ke as E,je as O,fe as S,Ae as T,be as _,Z as a,H as b,G as c,ye as d,xe as f,Ce as g,ve as h,X as i,de as j,V as k,U as l,he as m,$ as n,Fe as o,_e as p,Pe as r,W as s,Le as t,De as u,Te as v,me as w,Se as x,Ee as y};
2
+ //# sourceMappingURL=useHandleNewThread-DTz3ztCG.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{a as n,r,x as i}from"./useParams-s9hrFQQQ.js";var a=e(t(),1);function o(e){let t=n(),o=(0,a.useRef)(void 0);return r(t.stores.location,n=>{let r=e?.select?e.select(n):n;if(e?.structuralSharing??t.options.defaultStructuralSharing){let e=i(o.current,r);return o.current=e,e}return r})}export{o as t};
2
- //# sourceMappingURL=useLocation-DaTcl6iI.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{a as n,r,x as i}from"./useParams-CCV3vN4E.js";var a=e(t(),1);function o(e){let t=n(),o=(0,a.useRef)(void 0);return r(t.stores.location,n=>{let r=e?.select?e.select(n):n;if(e?.structuralSharing??t.options.defaultStructuralSharing){let e=i(o.current,r);return o.current=e,e}return r})}export{o as t};
2
+ //# sourceMappingURL=useLocation-9axGTsrg.js.map
@@ -0,0 +1,2 @@
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{a as n}from"./useParams-CCV3vN4E.js";var r=e(t(),1);function i(e){let t=n();return r.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}export{i as t};
2
+ //# sourceMappingURL=useNavigate-BK_XZ1It.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Sx as n}from"./utils-geC9CGP4.js";import{a as r,r as i}from"./useParams-s9hrFQQQ.js";import{t as a}from"./useNavigate-CnhAAl0Z.js";function o(){let e=r();return i(e.stores.location,e=>e.state.__TSR_index!==0)}var s=n(),c=e(t(),1);function l(){let e=(0,s.c)(3),t=a(),n=o(),r;return e[0]!==n||e[1]!==t?(r=()=>{if(n){window.history.back();return}t({to:`/`})},e[0]=n,e[1]=t,e[2]=r):r=e[2],r}function u(e){let t=(0,s.c)(3),n=l(),r=e??n,i,a;t[0]===r?(i=t[1],a=t[2]):(i=()=>{let e=e=>{if(e.defaultPrevented||e.repeat||e.isComposing||e.key!==`Escape`)return;e.preventDefault();let t=document.activeElement;t instanceof HTMLElement&&t.blur(),r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},a=[r],t[0]=r,t[1]=i,t[2]=a),(0,c.useEffect)(i,a)}export{u as t};
2
- //# sourceMappingURL=useNavigateBack-C43_t49N.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{wx as n}from"./utils-DmS758az.js";import{a as r,r as i}from"./useParams-CCV3vN4E.js";import{t as a}from"./useNavigate-BK_XZ1It.js";function o(){let e=r();return i(e.stores.location,e=>e.state.__TSR_index!==0)}var s=n(),c=e(t(),1);function l(){let e=(0,s.c)(3),t=a(),n=o(),r;return e[0]!==n||e[1]!==t?(r=()=>{if(n){window.history.back();return}t({to:`/`})},e[0]=n,e[1]=t,e[2]=r):r=e[2],r}function u(e){let t=(0,s.c)(3),n=l(),r=e??n,i,a;t[0]===r?(i=t[1],a=t[2]):(i=()=>{let e=e=>{if(e.defaultPrevented||e.repeat||e.isComposing||e.key!==`Escape`)return;e.preventDefault();let t=document.activeElement;t instanceof HTMLElement&&t.blur(),r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},a=[r],t[0]=r,t[1]=i,t[2]=a),(0,c.useEffect)(i,a)}export{u as t};
2
+ //# sourceMappingURL=useNavigateBack-AIHPN0Oo.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{hi as n}from"./utils-geC9CGP4.js";function r(e){return e[e.length-1]}function i(e){return typeof e==`function`}function a(e,t){return i(e)?e(t):e}var o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;function c(e){for(let t in e)if(o.call(e,t))return!0;return!1}var l=()=>Object.create(null),u=(e,t)=>d(e,t,l);function d(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=h(e)&&h(i);if(!a&&!(p(e)&&p(i)))return i;let s=a?e:f(e);if(!s)return i;let c=a?i:f(i);if(!c)return i;let l=s.length,u=c.length,m=a?Array(u):n(),g=0;for(let t=0;t<u;t++){let s=a?t:c[t],u=e[s],f=i[s];if(u===f){m[s]=u,(a?t<l:o.call(e,s))&&g++;continue}if(u===null||f===null||typeof u!=`object`||typeof f!=`object`){m[s]=f;continue}let p=d(u,f,n,r+1);m[s]=p,p===u&&g++}return l===u&&g===l?e:m}function f(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!s.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!s.call(e,t))return!1;r.push(t)}return r}function p(e){if(!m(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!m(n)||!n.hasOwnProperty(`isPrototypeOf`))}function m(e){return Object.prototype.toString.call(e)===`[object Object]`}function h(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function g(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!g(e[r],t[r],n))return!1;return!0}if(p(e)&&p(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!g(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!g(e[o],t[o],n)))return!1;return i===a}return!1}function _(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function v(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function y(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function b(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function x(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return b(t)}var S=[`http:`,`https:`,`mailto:`,`tel:`];function C(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function w(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=x(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=x(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function T(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function E(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function D(){throw Error(`Invariant failed`)}var O=n(),k=e(t(),1),A=k.createContext(null);function j(e){return k.useContext(A)}var M=k.createContext(void 0),N=k.createContext(void 0);function P(e,t){return e===t}function F(e,t,n=P){let r=(0,k.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,k.useCallback)(()=>e?.get(),[e]);return(0,O.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var I={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function L(e){let t=j(),n=k.useContext(e.from?N:M),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=k.useRef(void 0);return F(i??I,n=>{if((e.shouldThrow??!0)&&!n&&D(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=d(a.current,r);return a.current=e,e}return r})}function R(e){return L({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}export{v as _,j as a,u as b,S as c,w as d,g as f,C as g,c as h,M as i,E as l,a as m,L as n,A as o,T as p,F as r,D as s,R as t,_ as u,y as v,d as x,r as y};
2
- //# sourceMappingURL=useParams-s9hrFQQQ.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{hi as n}from"./utils-DmS758az.js";function r(e){return e[e.length-1]}function i(e){return typeof e==`function`}function a(e,t){return i(e)?e(t):e}var o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;function c(e){for(let t in e)if(o.call(e,t))return!0;return!1}var l=()=>Object.create(null),u=(e,t)=>d(e,t,l);function d(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=h(e)&&h(i);if(!a&&!(p(e)&&p(i)))return i;let s=a?e:f(e);if(!s)return i;let c=a?i:f(i);if(!c)return i;let l=s.length,u=c.length,m=a?Array(u):n(),g=0;for(let t=0;t<u;t++){let s=a?t:c[t],u=e[s],f=i[s];if(u===f){m[s]=u,(a?t<l:o.call(e,s))&&g++;continue}if(u===null||f===null||typeof u!=`object`||typeof f!=`object`){m[s]=f;continue}let p=d(u,f,n,r+1);m[s]=p,p===u&&g++}return l===u&&g===l?e:m}function f(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!s.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!s.call(e,t))return!1;r.push(t)}return r}function p(e){if(!m(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!m(n)||!n.hasOwnProperty(`isPrototypeOf`))}function m(e){return Object.prototype.toString.call(e)===`[object Object]`}function h(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function g(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!g(e[r],t[r],n))return!1;return!0}if(p(e)&&p(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!g(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!g(e[o],t[o],n)))return!1;return i===a}return!1}function _(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function v(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function y(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function b(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function x(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return b(t)}var S=[`http:`,`https:`,`mailto:`,`tel:`];function C(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function w(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=x(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=x(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function T(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function E(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function D(){throw Error(`Invariant failed`)}var O=n(),k=e(t(),1),A=k.createContext(null);function j(e){return k.useContext(A)}var M=k.createContext(void 0),N=k.createContext(void 0);function P(e,t){return e===t}function F(e,t,n=P){let r=(0,k.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,k.useCallback)(()=>e?.get(),[e]);return(0,O.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var I={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function L(e){let t=j(),n=k.useContext(e.from?N:M),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=k.useRef(void 0);return F(i??I,n=>{if((e.shouldThrow??!0)&&!n&&D(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=d(a.current,r);return a.current=e,e}return r})}function R(e){return L({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}export{v as _,j as a,u as b,S as c,w as d,g as f,C as g,c as h,M as i,E as l,a as m,L as n,A as o,T as p,F as r,D as s,R as t,_ as u,y as v,d as x,r as y};
2
+ //# sourceMappingURL=useParams-CCV3vN4E.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Sx as n,ma as r,or as i}from"./utils-geC9CGP4.js";import{t as a}from"./circle-check-Y1T60J9X.js";var o=n(),s=e(r(),1);function c(e){let t=(0,o.c)(7),{permissions:n,busy:r}=e,c=r!==void 0&&r,l;if(t[0]!==c||t[1]!==n){let e;t[3]===c?e=t[4]:(e=e=>(0,s.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border px-3 py-2`,children:[e.icon,(0,s.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,s.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,s.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description})]}),e.granted?(0,s.jsxs)(`span`,{role:`status`,className:`flex items-center gap-1 text-xs text-success`,children:[(0,s.jsx)(a,{className:`size-4`,"aria-hidden":`true`}),`Allowed`]}):(0,s.jsx)(i,{size:`xs`,variant:`outline`,disabled:c,onClick:e.onAllow,children:`Allow`})]},e.id),t[3]=c,t[4]=e),l=n.map(e),t[0]=c,t[1]=n,t[2]=l}else l=t[2];let u;return t[5]===l?u=t[6]:(u=(0,s.jsx)(`div`,{className:`space-y-2`,children:l}),t[5]=l,t[6]=u),u}function l(e){let t=(0,o.c)(9),n,r,a,c;t[0]===e?(n=t[1],r=t[2],a=t[3],c=t[4]):({ready:r,busy:a,children:c,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=c);let l=a!==void 0&&a,u=c===void 0?`Continue`:c,d=!r||l,f;return t[5]!==u||t[6]!==n||t[7]!==d?(f=(0,s.jsx)(i,{...n,disabled:d,children:u}),t[5]=u,t[6]=n,t[7]=d,t[8]=f):f=t[8],f}var u=e(t(),1);function d(e,t,n){let r=(0,o.c)(12),i=n===void 0||n,[a,s]=(0,u.useState)(t),[c,l]=(0,u.useState)(null),d=(0,u.useEffectEvent)(e),f;r[0]!==d||r[1]!==i?(f=()=>{if(!i)return;let e=!1,t=!1,n=async()=>{if(!(e||t||document.visibilityState===`hidden`)){t=!0;try{let t=await d();e||(s(t),l(null))}catch{e||l(`Could not check permissions. We'll try again automatically.`)}t=!1}};n();let r=window.setInterval(()=>void n(),1500);return window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,n),()=>{e=!0,window.clearInterval(r),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,n)}},r[0]=d,r[1]=i,r[2]=f):f=r[2];let p;r[3]===i?p=r[4]:(p=[i],r[3]=i,r[4]=p),(0,u.useEffect)(f,p);let m;r[5]!==c||r[6]!==a?(m=e=>c===null&&e.every(e=>a[e]),r[5]=c,r[6]=a,r[7]=m):m=r[7];let h;return r[8]!==c||r[9]!==a||r[10]!==m?(h={status:a,error:c,isReady:m},r[8]=c,r[9]=a,r[10]=m,r[11]=h):h=r[11],h}export{c as n,l as r,d as t};
2
- //# sourceMappingURL=usePermissionStatus-CCpQkKk1.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{ma as n,or as r,wx as i}from"./utils-DmS758az.js";import{t as a}from"./circle-check-Y1T60J9X.js";var o=i(),s=e(n(),1);function c(e){let t=(0,o.c)(7),{permissions:n,busy:i}=e,c=i!==void 0&&i,l;if(t[0]!==c||t[1]!==n){let e;t[3]===c?e=t[4]:(e=e=>(0,s.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border px-3 py-2`,children:[e.icon,(0,s.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,s.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,s.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description})]}),e.granted?(0,s.jsxs)(`span`,{role:`status`,className:`flex items-center gap-1 text-xs text-success`,children:[(0,s.jsx)(a,{className:`size-4`,"aria-hidden":`true`}),`Allowed`]}):(0,s.jsx)(r,{size:`xs`,variant:`outline`,disabled:c,onClick:e.onAllow,children:`Allow`})]},e.id),t[3]=c,t[4]=e),l=n.map(e),t[0]=c,t[1]=n,t[2]=l}else l=t[2];let u;return t[5]===l?u=t[6]:(u=(0,s.jsx)(`div`,{className:`space-y-2`,children:l}),t[5]=l,t[6]=u),u}function l(e){let t=(0,o.c)(9),n,i,a,c;t[0]===e?(n=t[1],i=t[2],a=t[3],c=t[4]):({ready:i,busy:a,children:c,...n}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a,t[4]=c);let l=a!==void 0&&a,u=c===void 0?`Continue`:c,d=!i||l,f;return t[5]!==u||t[6]!==n||t[7]!==d?(f=(0,s.jsx)(r,{...n,disabled:d,children:u}),t[5]=u,t[6]=n,t[7]=d,t[8]=f):f=t[8],f}var u=e(t(),1);function d(e,t,n){let r=(0,o.c)(12),i=n===void 0||n,[a,s]=(0,u.useState)(t),[c,l]=(0,u.useState)(null),d=(0,u.useEffectEvent)(e),f;r[0]!==d||r[1]!==i?(f=()=>{if(!i)return;let e=!1,t=!1,n=async()=>{if(!(e||t||document.visibilityState===`hidden`)){t=!0;try{let t=await d();e||(s(t),l(null))}catch{e||l(`Could not check permissions. We'll try again automatically.`)}t=!1}};n();let r=window.setInterval(()=>void n(),1500);return window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,n),()=>{e=!0,window.clearInterval(r),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,n)}},r[0]=d,r[1]=i,r[2]=f):f=r[2];let p;r[3]===i?p=r[4]:(p=[i],r[3]=i,r[4]=p),(0,u.useEffect)(f,p);let m;r[5]!==c||r[6]!==a?(m=e=>c===null&&e.every(e=>a[e]),r[5]=c,r[6]=a,r[7]=m):m=r[7];let h;return r[8]!==c||r[9]!==a||r[10]!==m?(h={status:a,error:c,isReady:m},r[8]=c,r[9]=a,r[10]=m,r[11]=h):h=r[11],h}export{c as n,l as r,d as t};
2
+ //# sourceMappingURL=usePermissionStatus-BnBF7CdE.js.map