@vellumai/web 0.10.12-staging.2 → 0.10.12

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 (409) hide show
  1. package/dist/assets/{AnimatePresence-DwfFixKx.js → AnimatePresence-3WpfAWHe.js} +1 -1
  2. package/dist/assets/{BundleConfirmPage-gQyAQ1Np.js → BundleConfirmPage-CDklssHh.js} +1 -1
  3. package/dist/assets/{a2a-invite-h0ZA9fjr.js → a2a-invite-DUYZLVQb.js} +1 -1
  4. package/dist/assets/{about-page-o4HW3X7x.js → about-page-CT70Pgvf.js} +1 -1
  5. package/dist/assets/access-D3fUSyFH.js +1 -0
  6. package/dist/assets/{account-page-CCGELSOs.js → account-page-D5cJIu1-.js} +1 -1
  7. package/dist/assets/{account-shell-AfPNPQvp.js → account-shell-C_IH8r44.js} +1 -1
  8. package/dist/assets/{acp-run-actions-Ct6s3jTx.js → acp-run-actions-CAjb0Wcm.js} +1 -1
  9. package/dist/assets/{acp-run-detail-panel-6KF1gTs7.js → acp-run-detail-panel-DqzZdPiN.js} +1 -1
  10. package/dist/assets/{acp-run-store-DvHGcG6-.js → acp-run-store-C6n-XeY_.js} +1 -1
  11. package/dist/assets/{activity-steps-panel-BixdRLE2.js → activity-steps-panel-BzHQOJsQ.js} +1 -1
  12. package/dist/assets/{add-credits-modal-IV5EP5Uo.js → add-credits-modal-CCEMf2_U.js} +1 -1
  13. package/dist/assets/ai-page-BznkOakE.js +1 -0
  14. package/dist/assets/{animated-avatar-B7_KzM7V.js → animated-avatar-DzfEDnTh.js} +1 -1
  15. package/dist/assets/{api-DL5vlAJ0.js → api-CJFoPWHm.js} +1 -1
  16. package/dist/assets/{api-BafF_-rc.js → api-XwdNiVE9.js} +1 -1
  17. package/dist/assets/{api-key-screen-Dh7AJqr3.js → api-key-screen-BXn2F-lQ.js} +1 -1
  18. package/dist/assets/{app-card-BV9XWgfV.js → app-card-Uowaj1kh.js} +1 -1
  19. package/dist/assets/{app-info-Bus9qaJo.js → app-info-qQex8Ndg.js} +1 -1
  20. package/dist/assets/{archive-redirect-page-Cyh8EfTp.js → archive-redirect-page-CpKvFqvX.js} +1 -1
  21. package/dist/assets/{assistant-feature-flag-store-DrFDLNVv.js → assistant-feature-flag-store-CLqMw4mK.js} +1 -1
  22. package/dist/assets/assistant-identity-store-DIyVo8LV.js +1 -0
  23. package/dist/assets/{assistant-status-panel-DODbammu.js → assistant-status-panel-DKnWIr7_.js} +1 -1
  24. package/dist/assets/{auth-store-CK95leo_.js → auth-store-D9BqFncz.js} +2 -2
  25. package/dist/assets/{avatar-renderer-DAklEC5T.js → avatar-renderer-DK54o2kQ.js} +1 -1
  26. package/dist/assets/avatar-svg-compositor-FtVPqzlC.js +1 -0
  27. package/dist/assets/{background-task-actions-BfAGLLHN.js → background-task-actions-CmYMPa2o.js} +1 -1
  28. package/dist/assets/{background-task-detail-panel-DOWj29Ko.js → background-task-detail-panel-KDqjs7i2.js} +1 -1
  29. package/dist/assets/{background-task-store-CN04oS2z.js → background-task-store-DFS8MP5D.js} +1 -1
  30. package/dist/assets/billing-page-Cc5fHBn2.js +3 -0
  31. package/dist/assets/{billing-redirect-page-BsV6cEpx.js → billing-redirect-page-BRcj5q0u.js} +1 -1
  32. package/dist/assets/{bookmarks-page-CPmWAOGH.js → bookmarks-page-fFnFzh4F.js} +1 -1
  33. package/dist/assets/{browser-DtFBB5v5.js → browser-CNL8hh8H.js} +2 -2
  34. package/dist/assets/{build-state-DoiXhrgx.js → build-state-WR9nlRgM.js} +1 -1
  35. package/dist/assets/{capture-error-CqtAGHQu.js → capture-error-Bj8_eutd.js} +1 -1
  36. package/dist/assets/{channels-page-route-BBwlgesO.js → channels-page-route-wxREzs6W.js} +1 -1
  37. package/dist/assets/{chat-avatar-C7xsXP27.js → chat-avatar-DIDq1Jt5.js} +1 -1
  38. package/dist/assets/{chat-layout-slots-store-C325hn1X.js → chat-layout-slots-store-C2IFeZFr.js} +1 -1
  39. package/dist/assets/{chat-markdown-message-C2uQyAXa.js → chat-markdown-message-ERK48E1Z.js} +2 -2
  40. package/dist/assets/{checkbox-BZTUJtxM.js → checkbox-BY0BDJjm.js} +1 -1
  41. package/dist/assets/{client-feature-flag-store-DR6pLmyc.js → client-feature-flag-store-oTfL8Oiz.js} +1 -1
  42. package/dist/assets/{client-identity-ChGFRQsv.js → client-identity-BS5mQsaQ.js} +1 -1
  43. package/dist/assets/{command-palette-CYwgr9BF.js → command-palette-CsRPcIM-.js} +1 -1
  44. package/dist/assets/{command-palette-window-page-ByOPmEAV.js → command-palette-window-page-BzQ_oDaq.js} +1 -1
  45. package/dist/assets/{community-page-D7FDDkdu.js → community-page-mlhk4LsN.js} +1 -1
  46. package/dist/assets/{confirm-dialog-DZX6LhLy.js → confirm-dialog-UYFm4osC.js} +1 -1
  47. package/dist/assets/{connect-page-BXelaj8V.js → connect-page-PuRyFup0.js} +1 -1
  48. package/dist/assets/consent-DbD2Hcbf.js +1 -0
  49. package/dist/assets/{consent-controls-DoUmeaFm.js → consent-controls-BOFoWAYO.js} +1 -1
  50. package/dist/assets/{contacts-gateway-BI9Ok4O5.js → contacts-gateway-C5OljhCC.js} +1 -1
  51. package/dist/assets/{contacts-page-route-C2cmfHU4.js → contacts-page-route-VBlklzVL.js} +1 -1
  52. package/dist/assets/{conversation-cache-irOw8vtk.js → conversation-cache-CqCkWHT6.js} +1 -1
  53. package/dist/assets/{conversation-list-fetchers-CeiuJYcE.js → conversation-list-fetchers-D84gJs6f.js} +1 -1
  54. package/dist/assets/{conversation-navigation-DUNqTEXk.js → conversation-navigation-Wm7_pLFs.js} +1 -1
  55. package/dist/assets/{conversation-queries-Bo-ZW6ul.js → conversation-queries-Ba_1sW5M.js} +1 -1
  56. package/dist/assets/{conversation-store-C0tvFESx.js → conversation-store-bshB7nDP.js} +1 -1
  57. package/dist/assets/{credential-entry-page-Dt_0bNAT.js → credential-entry-page-Bfrl1sD_.js} +1 -1
  58. package/dist/assets/{credentials-page-BDfP4yY4.js → credentials-page-B-AJyMvk.js} +1 -1
  59. package/dist/assets/{danger-zone-redirect-page-CpEYg1lA.js → danger-zone-redirect-page-DKfrmf_o.js} +1 -1
  60. package/dist/assets/{debug-page-Bh4VqdzS.js → debug-page-DWEIExMH.js} +2 -2
  61. package/dist/assets/{deploy-dialogs-D_AQFfc0.js → deploy-dialogs-BNMcZzII.js} +1 -1
  62. package/dist/assets/{deploy-store-Co5K25DO.js → deploy-store-CxnShfQj.js} +1 -1
  63. package/dist/assets/{detail-card-BKbhBGhy.js → detail-card-CwtjhGfi.js} +1 -1
  64. package/dist/assets/{detail-panel-stop-button-C-Y-hevf.js → detail-panel-stop-button-C1rystDS.js} +1 -1
  65. package/dist/assets/{detail-shell-BW-7Q0R6.js → detail-shell-DcNnOqM_.js} +1 -1
  66. package/dist/assets/{developer-page-tydL_eOW.js → developer-page-Bu7HBiPJ.js} +1 -1
  67. package/dist/assets/{devices-redirect-page-7yfm7RVK.js → devices-redirect-page-Cvt_H5ig.js} +1 -1
  68. package/dist/assets/{diagnostics-C1vLQi8c.js → diagnostics-Dva51gYK.js} +1 -1
  69. package/dist/assets/{dictation-overlay-page-BM_PPlmh.js → dictation-overlay-page-zpoNqudq.js} +1 -1
  70. package/dist/assets/{dictation-overlay-w1YHEfFR.js → dictation-overlay-pePw7mLd.js} +1 -1
  71. package/dist/assets/{dist-BswnB-bR.js → dist-DC9QooLF.js} +1 -1
  72. package/dist/assets/{dist-CQN0ZAOZ.js → dist-oCfq2a_n.js} +1 -1
  73. package/dist/assets/{document-viewer-container-Do8yUakJ.js → document-viewer-container-Cl4jDmfx.js} +2 -2
  74. package/dist/assets/{document-viewer-page-BzM3ABt9.js → document-viewer-page-kV6TCXu0.js} +1 -1
  75. package/dist/assets/{edge-swipe-arbiter-store-D9XJTxJJ.js → edge-swipe-arbiter-store-DyemvsR-.js} +1 -1
  76. package/dist/assets/effective-timezone-qiooajmO.js +1 -0
  77. package/dist/assets/{emails-page-Cn56Zrp2.js → emails-page-D9E3uXkG.js} +1 -1
  78. package/dist/assets/{environment-store-BXSWXdjm.js → environment-store-BFVmN-OW.js} +1 -1
  79. package/dist/assets/esm-BQjZqfJZ.js +2 -0
  80. package/dist/assets/esm-BTyZM-kf.js +2 -0
  81. package/dist/assets/esm-BWFeAIOX.js +2 -0
  82. package/dist/assets/{esm-DCA3xHJS.js → esm-C6-ZMSya.js} +2 -2
  83. package/dist/assets/esm-CDPcGg-B.js +2 -0
  84. package/dist/assets/esm-DEY-lP80.js +1 -0
  85. package/dist/assets/esm-DKdDWqsF.js +2 -0
  86. package/dist/assets/{eye-bbox-vHbpD-XX.js → eye-bbox-DXmmg9ML.js} +1 -1
  87. package/dist/assets/{file-editor-AqFGpEiG.js → file-editor-DpNdd7HZ.js} +1 -1
  88. package/dist/assets/{file-markdown-Dz0E8JCw.js → file-markdown-CLmQTpqL.js} +1 -1
  89. package/dist/assets/{first-run-scope-vr9PkCPF.js → first-run-scope-BoT9LMYw.js} +1 -1
  90. package/dist/assets/{funnel-events-wLEIhAS6.js → funnel-events-CK938pi2.js} +1 -1
  91. package/dist/assets/general-page-DpKVqj5t.js +1 -0
  92. package/dist/assets/{get-memory-stats-B9qL5lJg.js → get-memory-stats-ERcqnC0Q.js} +1 -1
  93. package/dist/assets/{haptics-BOyIPZDm.js → haptics-D9eNTUq-.js} +2 -2
  94. package/dist/assets/{hatching-screen-DKqcfIqT.js → hatching-screen-d3SWqFKY.js} +1 -1
  95. package/dist/assets/{home-page-route-4LoUJVyf.js → home-page-route-BOCisuYY.js} +1 -1
  96. package/dist/assets/{hosting-screen-ChxMs5SE.js → hosting-screen-6xIW6q02.js} +1 -1
  97. package/dist/assets/{identity-page-route-BZv_8gEN.js → identity-page-route-qWwRSRld.js} +1 -1
  98. package/dist/assets/index-B0l9Wjpj.css +2 -0
  99. package/dist/assets/{index-4G2A642F.js → index-BOC87TAq.js} +3 -3
  100. package/dist/assets/{ingest-JAa1OGej.js → ingest-DGkxw0Go.js} +1 -1
  101. package/dist/assets/{inspect-page-D6BmfgaE.js → inspect-page-CRBfQ5WU.js} +3 -3
  102. package/dist/assets/{installed-plugins-query-BARnE4gA.js → installed-plugins-query-C29LGAEV.js} +1 -1
  103. package/dist/assets/{integration-icon-B5V_-Cwm.js → integration-icon-Dvjn3ytY.js} +1 -1
  104. package/dist/assets/{integrations-page-CiKJbgld.js → integrations-page-D5KWY6v-.js} +1 -1
  105. package/dist/assets/{intelligence-layout-iZMnS_UR.js → intelligence-layout-DP9zklR6.js} +1 -1
  106. package/dist/assets/{invalidate-plugin-queries-QIHve9na.js → invalidate-plugin-queries-DamxiwYv.js} +1 -1
  107. package/dist/assets/{keyboard-shortcuts-redirect-page-Bj55BTMo.js → keyboard-shortcuts-redirect-page--bCvhp62.js} +1 -1
  108. package/dist/assets/{latest-assistant-text-BjCANctw.js → latest-assistant-text-D5WR-o6J.js} +1 -1
  109. package/dist/assets/{library-detail-page-rAKEZjAC.js → library-detail-page-pviljaQw.js} +1 -1
  110. package/dist/assets/{library-page-DLXws76z.js → library-page-CYYuLywk.js} +1 -1
  111. package/dist/assets/{list-row-MeHwwyA6.js → list-row-B1wPb2Au.js} +1 -1
  112. package/dist/assets/{local-mode-CTrmCbAp.js → local-mode-Ckii2tmN.js} +1 -1
  113. package/dist/assets/{local-runtime-upgrade-DhywiNJj.js → local-runtime-upgrade-BggVMXfW.js} +1 -1
  114. package/dist/assets/{login-flow-GvzsqmPU.js → login-flow-BCNBNLzu.js} +1 -1
  115. package/dist/assets/{login-page-BpyN5i3N.js → login-page-DdHXGGAt.js} +1 -1
  116. package/dist/assets/{logout-page-BYTvA7jR.js → logout-page-DjihP6Qk.js} +1 -1
  117. package/dist/assets/{logs-layout-CAsT7PSA.js → logs-layout-C84-h0Hn.js} +1 -1
  118. package/dist/assets/{memory-page-route-Ct0vQuTQ.js → memory-page-route-dGWTWCWF.js} +1 -1
  119. package/dist/assets/{memory-router-playground-page-Dw5KRcud.js → memory-router-playground-page-CjUiz_bH.js} +1 -1
  120. package/dist/assets/{menu-CKZtG-s_.js → menu-BvjhxZo7.js} +1 -1
  121. package/dist/assets/{messages-DR9NaU6I.js → messages-Dl5_cjD9.js} +1 -1
  122. package/dist/assets/{metric-card-BGMRvm8T.js → metric-card-CkAD9RpC.js} +1 -1
  123. package/dist/assets/{mobile-sidebar-drawer-Dwe3U09O.js → mobile-sidebar-drawer-CbJ5JfXT.js} +1 -1
  124. package/dist/assets/{modal-DwsThLGg.js → modal-BR4CUFBd.js} +1 -1
  125. package/dist/assets/mutation-error-CwYvaYnb.js +1 -0
  126. package/dist/assets/native-anchor-CVNubOIm.js +1 -0
  127. package/dist/assets/{native-biometric-BBZbTKi0.js → native-biometric-CntdlaL-.js} +1 -1
  128. package/dist/assets/{native-file-fkzAxQg0.js → native-file-B6_oAU2Q.js} +2 -2
  129. package/dist/assets/{not-found-BAcyD9Pu.js → not-found-DV3iLBwm.js} +1 -1
  130. package/dist/assets/{notice-DCp7WO3L.js → notice-BMK7xqUw.js} +1 -1
  131. package/dist/assets/{notifications-page-DzAAMGmB.js → notifications-page-B9vnqyB1.js} +1 -1
  132. package/dist/assets/{oauth-complete-page-pSE2ePnC.js → oauth-complete-page-BSxiDbQm.js} +1 -1
  133. package/dist/assets/{oauth-connection-utils-U3iVzpfJ.js → oauth-connection-utils-DbcihBL8.js} +1 -1
  134. package/dist/assets/{oauth-popup-complete-page-D4Uc4M6G.js → oauth-popup-complete-page-CyYbqLoK.js} +1 -1
  135. package/dist/assets/{onboarding-layout-1lVX8db0.js → onboarding-layout-Dd5fPfE7.js} +1 -1
  136. package/dist/assets/{onboarding-store-hpvNtD3A.js → onboarding-store-DutUn1E3.js} +1 -1
  137. package/dist/assets/open-workspace-file-CpveqBim.js +2 -0
  138. package/dist/assets/{page-empty-state-BOJLN0oo.js → page-empty-state-BA3_YQN2.js} +1 -1
  139. package/dist/assets/{page-shell-CdgW9nzA.js → page-shell-_QxBKTK3.js} +1 -1
  140. package/dist/assets/{pairing-page-KqVmsFUh.js → pairing-page-DPfIgf3F.js} +1 -1
  141. package/dist/assets/{panel-item-ldBYDDDs.js → panel-item-CrtoJCrd.js} +1 -1
  142. package/dist/assets/{password-reset-page-CMaCRCUO.js → password-reset-page-D55bGMVy.js} +1 -1
  143. package/dist/assets/{personality-page-Dt5aGp-e.js → personality-page-fJJd-i4s.js} +1 -1
  144. package/dist/assets/plans-page-C-JyEPT_.js +1 -0
  145. package/dist/assets/{platform-detection-DOh3jMAT.js → platform-detection-CMiRPRCq.js} +1 -1
  146. package/dist/assets/{platform-login-notice-LOYoqOMf.js → platform-login-notice-BG9TFAJa.js} +1 -1
  147. package/dist/assets/{platform-loopback-page-BscTnDN8.js → platform-loopback-page-DunGLusR.js} +1 -1
  148. package/dist/assets/{plugin-detail-page-rtP8WprQ.js → plugin-detail-page-BngHrN8T.js} +1 -1
  149. package/dist/assets/{plugins-page-BlLCo_51.js → plugins-page-DD0t1_pE.js} +1 -1
  150. package/dist/assets/plugins-surface-D4i2vqBz.js +1 -0
  151. package/dist/assets/{popover-BFL-uOLh.js → popover-BRpYVASI.js} +1 -1
  152. package/dist/assets/{prefs-B2UAscQt.js → prefs-BZnS5vR_.js} +1 -1
  153. package/dist/assets/{privacy-page-DIfDx43s.js → privacy-page-nZvfh3dh.js} +1 -1
  154. package/dist/assets/{privacy-screen-CT2vDIPL.js → privacy-screen-D2aDT6E6.js} +1 -1
  155. package/dist/assets/{provider-callback-page-CBhBrIAp.js → provider-callback-page-BwANEd-K.js} +1 -1
  156. package/dist/assets/{provider-key-BoyxWMGQ.js → provider-key-B3R8SlMJ.js} +1 -1
  157. package/dist/assets/{provider-signup-page-MRdEILUW.js → provider-signup-page-Cz2DP-jP.js} +1 -1
  158. package/dist/assets/{quick-input-page-ZAHDIH7x.js → quick-input-page-CF2MJnCE.js} +1 -1
  159. package/dist/assets/{react-query.gen-oEdI--ip.js → react-query.gen-Mwd5l-vZ.js} +1 -1
  160. package/dist/assets/{react-query.gen-CbsPBjd9.js → react-query.gen-r3I6j8-1.js} +1 -1
  161. package/dist/assets/{remote-gateway-session-DAfJAELv.js → remote-gateway-session-BHjZ9gQ6.js} +1 -1
  162. package/dist/assets/{research-facts-e-0TmtJP.js → research-facts-UIXXE8D6.js} +1 -1
  163. package/dist/assets/{research-mock-page-DTTf0zfR.js → research-mock-page-DnbQpZcp.js} +1 -1
  164. package/dist/assets/{research-onboarding-persistence-BN6g1lF7.js → research-onboarding-persistence-CceFfAqE.js} +1 -1
  165. package/dist/assets/{research-onboarding-route-xdBEvVjC.js → research-onboarding-route-yg2iKw6i.js} +1 -1
  166. package/dist/assets/{research-results-view-DhHY5ZPj.js → research-results-view-CxhTn2J7.js} +1 -1
  167. package/dist/assets/{resolved-assistants-store-PdwcxGwN.js → resolved-assistants-store-C-PdxK8f.js} +1 -1
  168. package/dist/assets/{retire-confirm-dialog-BF8nORxR.js → retire-confirm-dialog--eF_pXhA.js} +1 -1
  169. package/dist/assets/{review-terms-screen-DWW0H6gs.js → review-terms-screen-Dpk-gyJE.js} +1 -1
  170. package/dist/assets/{risk-DXfbjxrL.js → risk-C_bbPQPd.js} +1 -1
  171. package/dist/assets/{routes-C3xPjNWF.js → routes-BBFM42ft.js} +11 -11
  172. package/dist/assets/{routes-bwxCYLJj.js → routes-vE-2hncW.js} +1 -1
  173. package/dist/assets/{runtime-upgrade-banner-Dlp0eQiE.js → runtime-upgrade-banner-DQI-l3Yc.js} +2 -2
  174. package/dist/assets/{schedules-o0jcCr54.js → schedules-DF5cTXBf.js} +1 -1
  175. package/dist/assets/{schedules-page-BCofuXAr.js → schedules-page-Dgu-znOf.js} +1 -1
  176. package/dist/assets/{sdk.gen-C6q_cviY.js → sdk.gen-BIu1DgTs.js} +1 -1
  177. package/dist/assets/{security-redirect-page-B_ci75cb.js → security-redirect-page-BEohiPDW.js} +1 -1
  178. package/dist/assets/{select-assistant-screen-g68FASxq.js → select-assistant-screen-C2q8wO2f.js} +1 -1
  179. package/dist/assets/{setting-row-CxQBrD8s.js → setting-row-0LXvW7Kh.js} +1 -1
  180. package/dist/assets/{settings-divider-ORJowxpl.js → settings-divider-CXIrJieH.js} +1 -1
  181. package/dist/assets/{settings-layout-DvMiWCPp.js → settings-layout-b7iBWIT-.js} +1 -1
  182. package/dist/assets/settings-navigation-BGdjm0Ki.js +1 -0
  183. package/dist/assets/{share-feedback-modal-BlqdxyC5.js → share-feedback-modal-B05-nKgu.js} +1 -1
  184. package/dist/assets/{sidebar-tree-DtsphGOt.js → sidebar-tree-ByF78JHW.js} +1 -1
  185. package/dist/assets/{signup-page-B-9iClzh.js → signup-page-CGauGszD.js} +1 -1
  186. package/dist/assets/{signup-shell-CS8qe8J1.js → signup-shell-Bw6r9tWP.js} +1 -1
  187. package/dist/assets/{site-favicon-BwdB2A7_.js → site-favicon-CCyX9r-Z.js} +1 -1
  188. package/dist/assets/{skill-detail-page-RlOqtrxz.js → skill-detail-page-GlV5JRzQ.js} +1 -1
  189. package/dist/assets/{skill-detail-panel-72NTcSvY.js → skill-detail-panel-crqCBZbU.js} +1 -1
  190. package/dist/assets/{skills-CS48H_5g.js → skills-C1CAcW7T.js} +1 -1
  191. package/dist/assets/{skills-page-B5c4S__U.js → skills-page-BikP-AR7.js} +1 -1
  192. package/dist/assets/{slack-setup-wizard-DyLOaNeb.js → slack-setup-wizard-DKj1_XdA.js} +1 -1
  193. package/dist/assets/{cpu-eUAdrpWb.js → sliders-horizontal-slneqAyY.js} +1 -1
  194. package/dist/assets/{sound-manager-BkU9w22u.js → sound-manager-xEbUgFv-.js} +1 -1
  195. package/dist/assets/{sounds-page-B_VfIF_f.js → sounds-page-9_otQ97S.js} +1 -1
  196. package/dist/assets/{src-B9F84D64.js → src-D89CNeuT.js} +1 -1
  197. package/dist/assets/{start-screen-BzchtmN4.js → start-screen-DSF3melT.js} +1 -1
  198. package/dist/assets/{stream-watchdog-LwK1DR5Q.js → stream-watchdog-BafbDdX9.js} +1 -1
  199. package/dist/assets/{subagent-detail-panel-CnkzZsGz.js → subagent-detail-panel-q0g4JWAX.js} +1 -1
  200. package/dist/assets/{subagent-store-CM0X7ol2.js → subagent-store-D-GPthdC.js} +1 -1
  201. package/dist/assets/{superpowers-page-D0T5rLBb.js → superpowers-page-UgdWFWsF.js} +1 -1
  202. package/dist/assets/{system-events-page-9lCNzX-7.js → system-events-page-Bw94HLwx.js} +1 -1
  203. package/dist/assets/{system-events-redirect-page-AHa_MARa.js → system-events-redirect-page-BGZQC8-K.js} +1 -1
  204. package/dist/assets/{tag-D8NAGb0r.js → tag-NXcyiTkK.js} +1 -1
  205. package/dist/assets/{theme-stage-page-CntGqJIW.js → theme-stage-page-bEZxHTyN.js} +1 -1
  206. package/dist/assets/{threshold-presets-ti1ttrv3.js → threshold-presets-BO8En2q0.js} +1 -1
  207. package/dist/assets/{tiptap-document-editor-BOuerIA1.js → tiptap-document-editor-CyY1HRzV.js} +1 -1
  208. package/dist/assets/{toast-DR7D7Uma.js → toast-LgLp4obE.js} +1 -1
  209. package/dist/assets/{tool-detail-panel-B6-P-pe0.js → tool-detail-panel-DFMOphDJ.js} +1 -1
  210. package/dist/assets/{transcript-message-body-shared-CQwPiuDN.js → transcript-message-body-shared-nWAkSzar.js} +1 -1
  211. package/dist/assets/{trust-rules-api-lD2Ni46I.js → trust-rules-api-C0-hkXT2.js} +1 -1
  212. package/dist/assets/{upgrade-cancel-page-D0hw2jKj.js → upgrade-cancel-page-DwxI6NLL.js} +1 -1
  213. package/dist/assets/{upgrade-success-page-CmEZ39Sn.js → upgrade-success-page-SO92J-Rf.js} +1 -1
  214. package/dist/assets/{usage-redirect-page-Cq2M7ii4.js → usage-redirect-page-BJBkecYr.js} +1 -1
  215. package/dist/assets/{use-active-assistant-id-BcM35kFN.js → use-active-assistant-id-Cjbsk2Q3.js} +1 -1
  216. package/dist/assets/{use-app-theme-DVqzJFH6.js → use-app-theme-Q42fO5Nz.js} +1 -1
  217. package/dist/assets/{use-assistant-avatar-DpMH3A_7.js → use-assistant-avatar-DSu2_Mzi.js} +1 -1
  218. package/dist/assets/{use-assistant-capability-DkGxxxTG.js → use-assistant-capability-gxe56K48.js} +1 -1
  219. package/dist/assets/{use-assistant-identity-details-CN_tizo0.js → use-assistant-identity-details-CpHkzjrI.js} +1 -1
  220. package/dist/assets/{use-avatar-accent-var-C4DSU-BO.js → use-avatar-accent-var-PV9tsBJj.js} +1 -1
  221. package/dist/assets/{use-bookmarks-DzswOt-6.js → use-bookmarks-BbJtKyHe.js} +1 -1
  222. package/dist/assets/{use-bundled-avatar-components-IQw2k8-g.js → use-bundled-avatar-components-Gp_YaD6o.js} +2 -2
  223. package/dist/assets/{use-bus-subscription-DIENjckU.js → use-bus-subscription-Cu4Y9DQi.js} +1 -1
  224. package/dist/assets/use-checkout-dismiss-refresh-kdxxDNpF.js +1 -0
  225. package/dist/assets/{use-command-palette-sections-BFYwWTT8.js → use-command-palette-sections-BWjxkwKB.js} +1 -1
  226. package/dist/assets/{use-discord-nudge-CRU-lEHV.js → use-discord-nudge-C_QdHIeX.js} +1 -1
  227. package/dist/assets/{use-edge-swipe-6PtOzG4E.js → use-edge-swipe-DVeTYbmY.js} +1 -1
  228. package/dist/assets/{use-edge-swipe-back-Y66_jaFR.js → use-edge-swipe-back-DDq-N20h.js} +1 -1
  229. package/dist/assets/{use-edit-app-B3lr2KkA.js → use-edit-app-DfFIonqZ.js} +1 -1
  230. package/dist/assets/{use-effective-timezone-Da7pvXSm.js → use-effective-timezone-LqzBqHBy.js} +1 -1
  231. package/dist/assets/{use-invite-link-dialog-4cPtNBj0.js → use-invite-link-dialog-DX58-LWY.js} +1 -1
  232. package/dist/assets/use-ios-app-nudge-BO8jWfr0.js +1 -0
  233. package/dist/assets/use-is-org-ready-X_98Cnx9.js +1 -0
  234. package/dist/assets/{use-onboarding-login-DWweCRJ-.js → use-onboarding-login-B8rpbSEh.js} +1 -1
  235. package/dist/assets/{use-platform-gate-DcS6snds.js → use-platform-gate-Dry0Nv4f.js} +1 -1
  236. package/dist/assets/{use-reduced-motion-Bv27WKCk.js → use-reduced-motion-Se97jRQ-.js} +1 -1
  237. package/dist/assets/{use-save-twilio-credentials-BDbv1FdS.js → use-save-twilio-credentials-CUQ6gdIj.js} +1 -1
  238. package/dist/assets/{use-skill-actions-C34mG6kK.js → use-skill-actions-DgK7Nmt1.js} +1 -1
  239. package/dist/assets/{use-skill-detail-files-M-YjNd2c.js → use-skill-detail-files-_v4zUF6S.js} +1 -1
  240. package/dist/assets/use-sticky-profiles-B0zVD3uk.js +1 -0
  241. package/dist/assets/{use-subagent-card-data-CmbaKWII.js → use-subagent-card-data-YbAN73Fw.js} +1 -1
  242. package/dist/assets/{use-supports-bookmarks-CJC-T2ro.js → use-supports-bookmarks-C3J7FtDn.js} +1 -1
  243. package/dist/assets/{use-swipe-engine-RAFE-Hrf.js → use-swipe-engine-DRvffOuu.js} +1 -1
  244. package/dist/assets/{utils-DW4oHJu6.js → utils-BtC1KiH4.js} +1 -1
  245. package/dist/assets/{utils-CrvvcikL.js → utils-CnB60ZJN.js} +1 -1
  246. package/dist/assets/{viewer-store-CLSpfTlZ.js → viewer-store-BDpZVbcr.js} +1 -1
  247. package/dist/assets/{voice-list-woCTax9H.js → voice-list-DJeZeHuA.js} +1 -1
  248. package/dist/assets/{voice-page-BDjuMuY8.js → voice-page-DQcyxaPl.js} +1 -1
  249. package/dist/assets/{voice-picker-modal-BiCmmLJz.js → voice-picker-modal-BXMvQihh.js} +1 -1
  250. package/dist/assets/{weather-forecast-display-D5OkfHyL.js → weather-forecast-display-D2sn4QD4.js} +1 -1
  251. package/dist/assets/{web-BMLENaxE.js → web-7I6Bn0iP.js} +1 -1
  252. package/dist/assets/{web-BK2xLXXm.js → web-BE7l06mM.js} +1 -1
  253. package/dist/assets/{web-BLJkVZnq.js → web-BEpNr5_U.js} +1 -1
  254. package/dist/assets/{web-Cc4zhBG7.js → web-BPyURh2Z.js} +1 -1
  255. package/dist/assets/{web-D6tBOv21.js → web-Bj8XUknF.js} +1 -1
  256. package/dist/assets/{web-Cimwq57E.js → web-CBluPLFP.js} +1 -1
  257. package/dist/assets/{web-C4ApmvCw.js → web-Cmg3AbZk.js} +1 -1
  258. package/dist/assets/{web-BQLS3-Jp.js → web-DHVjLzid.js} +1 -1
  259. package/dist/assets/{welcome-screen-BTmdDQ8q.js → welcome-screen-n-cGiojh.js} +1 -1
  260. package/dist/assets/{workflow-detail-panel-BigYPr9m.js → workflow-detail-panel-Cq3AwWXE.js} +1 -1
  261. package/dist/assets/{workflow-store-B-5tSUVD.js → workflow-store-QV5aMjTt.js} +1 -1
  262. package/dist/assets/{workspace-page-D1Ds9_ey.js → workspace-page-CL9z2Jrs.js} +1 -1
  263. package/dist/index.html +228 -229
  264. package/package.json +1 -1
  265. package/dist/assets/access-DFmdmMm5.js +0 -1
  266. package/dist/assets/ai-page-_F_gn-vY.js +0 -1
  267. package/dist/assets/assistant-identity-store-RThYdwnA.js +0 -1
  268. package/dist/assets/avatar-svg-compositor-CgyK5D40.js +0 -1
  269. package/dist/assets/billing-page-D1vuR7wJ.js +0 -3
  270. package/dist/assets/consent-Bkslj0yQ.js +0 -1
  271. package/dist/assets/crown-DTdTkF6n.js +0 -1
  272. package/dist/assets/effective-timezone-CnKC3vj0.js +0 -1
  273. package/dist/assets/esm-CBsKAtYP.js +0 -2
  274. package/dist/assets/esm-CkAk1b7M.js +0 -1
  275. package/dist/assets/esm-DVuEArjY.js +0 -2
  276. package/dist/assets/esm-LrelsjXA.js +0 -2
  277. package/dist/assets/esm-NJgNz35U.js +0 -2
  278. package/dist/assets/esm-PbRZjFG7.js +0 -2
  279. package/dist/assets/general-page-CVLpYzRN.js +0 -1
  280. package/dist/assets/index-_3FdgMgw.css +0 -2
  281. package/dist/assets/mutation-error--1w2EbUT.js +0 -1
  282. package/dist/assets/native-anchor-DtMEHD4d.js +0 -1
  283. package/dist/assets/open-workspace-file-C0ZDhKxD.js +0 -2
  284. package/dist/assets/plans-page-B0jfFMS-.js +0 -1
  285. package/dist/assets/plugins-surface-C6q5ZBC0.js +0 -1
  286. package/dist/assets/settings-navigation-DCqMil0c.js +0 -1
  287. package/dist/assets/sliders-horizontal-D5dtNWk8.js +0 -1
  288. package/dist/assets/use-checkout-dismiss-refresh-DRknWbR3.js +0 -1
  289. package/dist/assets/use-ios-app-nudge-BV5eX4Fv.js +0 -1
  290. package/dist/assets/use-is-org-ready-DryM43xt.js +0 -1
  291. package/dist/assets/use-sticky-profiles-CostDY59.js +0 -1
  292. /package/dist/assets/{Combination-C7TWRLS7.js → Combination-CkAMwkbS.js} +0 -0
  293. /package/dist/assets/{api-errors-BRGPPSWw.js → api-errors-CFiCT7Ap.js} +0 -0
  294. /package/dist/assets/{app-types-DSkgEmV3.js → app-types-CBg2__YH.js} +0 -0
  295. /package/dist/assets/{apple-logo-BaqMf8q6.js → apple-logo-poQac1tY.js} +0 -0
  296. /package/dist/assets/{avatar-bundled-components-CTd294ra.js → avatar-bundled-components-CecbESCk.js} +0 -0
  297. /package/dist/assets/{avatar-subagent-BpXST4nO.js → avatar-subagent-C9WTTUjI.js} +0 -0
  298. /package/dist/assets/{avatar-tone-4L7foPzW.js → avatar-tone-CMoWR2JX.js} +0 -0
  299. /package/dist/assets/{browser-timezone-DGz-HvxU.js → browser-timezone-C_0jBUid.js} +0 -0
  300. /package/dist/assets/{build.umd-DlzJAHJ4.js → build.umd-59c0EvgO.js} +0 -0
  301. /package/dist/assets/{by-tool-use-id-index-DcsiqOhc.js → by-tool-use-id-index-aoRP6d51.js} +0 -0
  302. /package/dist/assets/{chat-BIJEFb5u.js → chat-BrL0k2UY.js} +0 -0
  303. /package/dist/assets/{client.gen-Dq2brHDV.js → client.gen-CV05d-kw.js} +0 -0
  304. /package/dist/assets/{conversation-selection-Cx6Axfzb.js → conversation-selection-3EKkKt0G.js} +0 -0
  305. /package/dist/assets/{create-selectors-B-P03-8K.js → create-selectors-Qo7kcikX.js} +0 -0
  306. /package/dist/assets/{definitions-MzBHgkRs.js → definitions-OhJf_HMS.js} +0 -0
  307. /package/dist/assets/{definitions-quuEj_td.js → definitions-PikNVFdS.js} +0 -0
  308. /package/dist/assets/{dices-FpUbVcWW.js → dices-DcuIF52A.js} +0 -0
  309. /package/dist/assets/{dist-BJSu8g5P.js → dist-BwAT3VYQ.js} +0 -0
  310. /package/dist/assets/{dist-CKLJHt4Z.js → dist-CaYJ736y.js} +0 -0
  311. /package/dist/assets/{dist-BKxs5XmY.js → dist-jXSU-ejH.js} +0 -0
  312. /package/dist/assets/{domains-BwT1h2fD.js → domains-DWRzNRJy.js} +0 -0
  313. /package/dist/assets/{download-BBg2iaa4.js → download-CywcQLB2.js} +0 -0
  314. /package/dist/assets/{dropdown-Dt0Iof85.js → dropdown-BCfnSdIZ.js} +0 -0
  315. /package/dist/assets/{edit-chat-session-BVmK2sam.js → edit-chat-session-yPtopwB6.js} +0 -0
  316. /package/dist/assets/{ellipsis-BRJI5_P1.js → ellipsis-DnoqTkj4.js} +0 -0
  317. /package/dist/assets/{emoji-catalog-data-BCc1YNMR.js → emoji-catalog-data-COLzb2Wj.js} +0 -0
  318. /package/dist/assets/{event-bus-D2jlU6rm.js → event-bus-DSxmBYhD.js} +0 -0
  319. /package/dist/assets/{external-link-CAce-RVu.js → external-link-CS0aVYGt.js} +0 -0
  320. /package/dist/assets/{external-urls-HAW1JmbX.js → external-urls-BYwuIdYk.js} +0 -0
  321. /package/dist/assets/{eye-DTyDWiqu.js → eye-BMVGQXHT.js} +0 -0
  322. /package/dist/assets/{eye-off-fuOP4Lij.js → eye-off-Jdx8qkOK.js} +0 -0
  323. /package/dist/assets/{feature-flag-catalog-C45bOtg3.js → feature-flag-catalog-BAyJlRMY.js} +0 -0
  324. /package/dist/assets/{file-CNougInA.js → file-Ddp9Dqgl.js} +0 -0
  325. /package/dist/assets/{file-code-DD3K2kve.js → file-code-BDHws4Dk.js} +0 -0
  326. /package/dist/assets/{file-plus-Dq2xo7Ic.js → file-plus-C3SBA8ll.js} +0 -0
  327. /package/dist/assets/{file-text-BCsUYVEF.js → file-text-Br730Q4B.js} +0 -0
  328. /package/dist/assets/{folder-Dgxb-gKb.js → folder-DF8nFp7N.js} +0 -0
  329. /package/dist/assets/{folder-open-CAb0DLYq.js → folder-open-Nlg0OphT.js} +0 -0
  330. /package/dist/assets/{format-date-C5pKGCAG.js → format-date-RZ9mCDCy.js} +0 -0
  331. /package/dist/assets/{format-file-size-Btq3aJL3.js → format-file-size-CQaPE33p.js} +0 -0
  332. /package/dist/assets/{globe-CEgs-yoc.js → globe-CMtjL_s_.js} +0 -0
  333. /package/dist/assets/{hard-drive-dYuXAWBE.js → hard-drive-DWFPKcXI.js} +0 -0
  334. /package/dist/assets/{hard-navigate-V2EFapkk.js → hard-navigate-DZlpL1No.js} +0 -0
  335. /package/dist/assets/{heart-BqO0KKAc.js → heart-789ajxtB.js} +0 -0
  336. /package/dist/assets/{impersonate-version-flag-QIrc9g5I.js → impersonate-version-flag-4Ki_3iKD.js} +0 -0
  337. /package/dist/assets/{inbox-DXYIwUrn.js → inbox-B6TknLsk.js} +0 -0
  338. /package/dist/assets/{info-CYiVdnQV.js → info-vgPTIsGI.js} +0 -0
  339. /package/dist/assets/{input-C-GkeWCw.js → input-hw3el2GJ.js} +0 -0
  340. /package/dist/assets/{is-electron-7N7iyz1y.js → is-electron-m5eeGBnd.js} +0 -0
  341. /package/dist/assets/{key-round-CSc3w5ka.js → key-round-0Zop_GsZ.js} +0 -0
  342. /package/dist/assets/{laptop-ByoaxLxg.js → laptop-DSZhU52i.js} +0 -0
  343. /package/dist/assets/{layout-grid-PPpVK0nJ.js → layout-grid-DA_CfD6d.js} +0 -0
  344. /package/dist/assets/{link-2-BMNZFfWH.js → link-2-BKL8QWRX.js} +0 -0
  345. /package/dist/assets/{link-CowyzCIZ.js → link-BfUb7cwC.js} +0 -0
  346. /package/dist/assets/{link-click-DLYgWZdo.js → link-click-BoSQACXo.js} +0 -0
  347. /package/dist/assets/{list-CDyb1CGV.js → list-DNbTcxAh.js} +0 -0
  348. /package/dist/assets/{loader-circle-BzJ2kz3F.js → loader-circle-XREx3i4W.js} +0 -0
  349. /package/dist/assets/{log-in-Bhye1kwc.js → log-in-CqVJRYe-.js} +0 -0
  350. /package/dist/assets/{log-out-BLE632qu.js → log-out-B4hsBWnk.js} +0 -0
  351. /package/dist/assets/{machine-sizes-Cu2Qa0bd.js → machine-sizes-DAflIPTM.js} +0 -0
  352. /package/dist/assets/{mail-DABv3_Ue.js → mail-CMdPNysl.js} +0 -0
  353. /package/dist/assets/{message-circle-gk_DFUIg.js → message-circle-BsH7vHtN.js} +0 -0
  354. /package/dist/assets/{message-square-zCNXaHYX.js → message-square-CQGiY4zk.js} +0 -0
  355. /package/dist/assets/{message-square-text-asdoy3SW.js → message-square-text-D0Q7W58R.js} +0 -0
  356. /package/dist/assets/{mic-DZrWtAAu.js → mic-xmDFUbCL.js} +0 -0
  357. /package/dist/assets/{minimize-2-BR0ed4mI.js → minimize-2-CaXsUqSp.js} +0 -0
  358. /package/dist/assets/{misc-CAQM4FGM.js → misc-DckBb5zz.js} +0 -0
  359. /package/dist/assets/{monitor-B5vtTCxm.js → monitor-B1y28fS1.js} +0 -0
  360. /package/dist/assets/{moon-DSdti3GO.js → moon-BJzODLTY.js} +0 -0
  361. /package/dist/assets/{native-deep-link-D4jZANvf.js → native-deep-link-PvbVHiPM.js} +0 -0
  362. /package/dist/assets/{oauth-popup-Bru0o3W0.js → oauth-popup-DZEqljdC.js} +0 -0
  363. /package/dist/assets/{onboarding-step-layout-D9rghAjS.js → onboarding-step-layout-CURfuoh4.js} +0 -0
  364. /package/dist/assets/{optimistic-lifecycle-50vNA6dY.js → optimistic-lifecycle-C2a6IJ7E.js} +0 -0
  365. /package/dist/assets/{paperclip-DVE0scjU.js → paperclip-c8Xlrnx4.js} +0 -0
  366. /package/dist/assets/{pdf-DFUISXhq.js → pdf-IQXtc7_x.js} +0 -0
  367. /package/dist/assets/{plugin-attribution-CItr0rSf.js → plugin-attribution-DCFEMRUF.js} +0 -0
  368. /package/dist/assets/{pointer-QlIwQKYH.js → pointer-RLpjGG7A.js} +0 -0
  369. /package/dist/assets/{prechat-EVefdGcO.js → prechat-DIuViPZk.js} +0 -0
  370. /package/dist/assets/{profile-metadata-D2IzF-q3.js → profile-metadata-h4CTeMKT.js} +0 -0
  371. /package/dist/assets/{progress-bar-CJxkStgF.js → progress-bar-C_T5_pf2.js} +0 -0
  372. /package/dist/assets/{proxy-Ca4nD_gM.js → proxy-RtD8704m.js} +0 -0
  373. /package/dist/assets/{public-asset-CoSMBS62.js → public-asset-CbDDcomC.js} +0 -0
  374. /package/dist/assets/{rotate-ccw-Da_2DvhY.js → rotate-ccw-BjzeX7qz.js} +0 -0
  375. /package/dist/assets/{sandbox-bridge-BhR-nW2z.js → sandbox-bridge-DgDrAWv3.js} +0 -0
  376. /package/dist/assets/{sdk.gen-CsFDyJ6U.js → sdk.gen-BVAVE6A_.js} +0 -0
  377. /package/dist/assets/{sdk.gen-DEFA-6EJ.js → sdk.gen-DPKrJeho.js} +0 -0
  378. /package/dist/assets/{search-DA3TmTuR.js → search-BVW-n8to.js} +0 -0
  379. /package/dist/assets/{semver-Bfq1LtyW.js → semver-BpijV4FQ.js} +0 -0
  380. /package/dist/assets/{send-DHWUIK7G.js → send-Q71Exj3z.js} +0 -0
  381. /package/dist/assets/{shield-check-C7I-REGg.js → shield-check-22NwY9JM.js} +0 -0
  382. /package/dist/assets/{shield-B69p45Kq.js → shield-fzs_emVe.js} +0 -0
  383. /package/dist/assets/{smartphone-BbK6bGuE.js → smartphone-mDNwm_ss.js} +0 -0
  384. /package/dist/assets/{sparkles-DC8kqYjt.js → sparkles-Ccrj7hxd.js} +0 -0
  385. /package/dist/assets/{square-Bn3X6ZlO.js → square-D_e8nR-F.js} +0 -0
  386. /package/dist/assets/{status-badge-pill-wJPMXQk1.js → status-badge-pill-z1OKPW3B.js} +0 -0
  387. /package/dist/assets/{sun-BKEPYS7Q.js → sun-Dw0t1n1O.js} +0 -0
  388. /package/dist/assets/{terminal-Cs_TREv-.js → terminal-CdCI6wMV.js} +0 -0
  389. /package/dist/assets/{theme-preferences-LQuLaIA6.js → theme-preferences-ln8xC5zH.js} +0 -0
  390. /package/dist/assets/{three-dot-indicator-CfjkCgEH.js → three-dot-indicator-SJcKW5cG.js} +0 -0
  391. /package/dist/assets/{toggle-D776PTw-.js → toggle-lfnhEAcN.js} +0 -0
  392. /package/dist/assets/{trash-2-De6X8YiM.js → trash-2-L5LNgw9o.js} +0 -0
  393. /package/dist/assets/{triangle-alert--e3n47gm.js → triangle-alert-CQfiAg_t.js} +0 -0
  394. /package/dist/assets/{typed-storage-zmOSvIeO.js → typed-storage-9Sn8tkE7.js} +0 -0
  395. /package/dist/assets/{use-copy-to-clipboard-O2AZwhGa.js → use-copy-to-clipboard-DBVpNZOl.js} +0 -0
  396. /package/dist/assets/{use-is-mobile-Cx2xnNUx.js → use-is-mobile-Bz2l7wPL.js} +0 -0
  397. /package/dist/assets/{user-Dq9DUxnU.js → user-_zNqL48O.js} +0 -0
  398. /package/dist/assets/{user-plus-CXMJ1x_5.js → user-plus-oiIr9ey8.js} +0 -0
  399. /package/dist/assets/{users-DWDkv8ju.js → users-iLvfYFOP.js} +0 -0
  400. /package/dist/assets/{video-CZnrM0pw.js → video-BcgduiJ6.js} +0 -0
  401. /package/dist/assets/{volume-2-Bj3y3ZBJ.js → volume-2-CvT-JEIl.js} +0 -0
  402. /package/dist/assets/{workflow-DbPANJpf.js → workflow-cWWiPi3K.js} +0 -0
  403. /package/dist/assets/{workflow-status-CgrMMiJT.js → workflow-status-DXdUkbSd.js} +0 -0
  404. /package/dist/assets/{workspace-theme-tokens-bLqHFK0a.js → workspace-theme-tokens-J8dqkK9n.js} +0 -0
  405. /package/dist/assets/{wrench-tjOqvzJ2.js → wrench-0WW0zkkG.js} +0 -0
  406. /package/dist/assets/{x-DuBvjmAE.js → x-JBAsSOmg.js} +0 -0
  407. /package/dist/assets/{xterm-DZ5GcyM-.js → xterm-CdT0HObJ.js} +0 -0
  408. /package/dist/assets/{xterm-addon-fit-SiMU5kXG.js → xterm-addon-fit-CPcVj1i5.js} +0 -0
  409. /package/dist/assets/{zoom-in-BBlu4Gwn.js → zoom-in-CaLYwni-.js} +0 -0
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./createLucideIcon-CAM1RhH8.js";import{ht as r}from"./risk-DXfbjxrL.js";import{n as i}from"./resolved-assistants-store-PdwcxGwN.js";import{h as a}from"./sdk.gen-CsFDyJ6U.js";import{t as o}from"./background-task-store-CN04oS2z.js";var s=n(`file-terminal`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m8 16 2-2-2-2`,key:`10vzyd`}],[`path`,{d:`M12 18h4`,key:`1wd2n7`}]]),c=e(t(),1);function l(e){return e===`host_bash`?s:r}function u({toolName:e,className:t}){return(0,c.createElement)(l(e),{className:t,"aria-hidden":!0})}function d(){let e=i.getState().activeAssistantId;if(!e)throw Error(`No active assistant`);return e}async function f(e){let t=d(),n=o.getState(),r=n.byId[e]?.status;n.cancelTask(e);try{let{data:n,response:r}=await a({path:{assistant_id:t},body:{id:e},throwOnError:!1});if(!r?.ok||n?.cancelled===!1)throw Error(`Failed to stop background task: ${r?.status} (cancelled=${n?.cancelled})`)}catch(t){throw r!==void 0&&o.getState().restoreTaskStatus(e,r),t}}export{u as n,l as r,f as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./createLucideIcon-CAM1RhH8.js";import{ht as r}from"./risk-C_bbPQPd.js";import{n as i}from"./resolved-assistants-store-C-PdxK8f.js";import{h as a}from"./sdk.gen-BVAVE6A_.js";import{t as o}from"./background-task-store-DFS8MP5D.js";var s=n(`file-terminal`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m8 16 2-2-2-2`,key:`10vzyd`}],[`path`,{d:`M12 18h4`,key:`1wd2n7`}]]),c=e(t(),1);function l(e){return e===`host_bash`?s:r}function u({toolName:e,className:t}){return(0,c.createElement)(l(e),{className:t,"aria-hidden":!0})}function d(){let e=i.getState().activeAssistantId;if(!e)throw Error(`No active assistant`);return e}async function f(e){let t=d(),n=o.getState(),r=n.byId[e]?.status;n.cancelTask(e);try{let{data:n,response:r}=await a({path:{assistant_id:t},body:{id:e},throwOnError:!1});if(!r?.ok||n?.cancelled===!1)throw Error(`Failed to stop background task: ${r?.status} (cancelled=${n?.cancelled})`)}catch(t){throw r!==void 0&&o.getState().restoreTaskStatus(e,r),t}}export{u as n,l as r,f as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CqtAGHQu.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{t as i}from"./typography-DEI9Ra9z.js";import{r as a,t as o}from"./background-task-actions-BfAGLLHN.js";import"./src-B9F84D64.js";import{a as s,i as c,n as l,r as u}from"./background-task-store-CN04oS2z.js";import{t as d}from"./detail-shell-BW-7Q0R6.js";import{t as f}from"./status-badge-pill-wJPMXQk1.js";import{CodeBlock as p,SectionLabel as m}from"./tool-detail-panel-B6-P-pe0.js";import{t as h}from"./detail-panel-stop-button-C-Y-hevf.js";var g=e(n(),1),_=r();function v({status:e}){return(0,_.jsx)(f,{color:l(e),label:u(e)})}function y({entry:e,onClose:n}){let r=s(e.status),l=!r,u=l&&e.output!==void 0&&e.output!==``,f=l&&e.exitCode!=null,[y,b]=(0,g.useState)(!1),x=(0,g.useCallback)(()=>{b(!0),o(e.id).catch(e=>{b(!1),t(e,{context:`BackgroundTaskDetailPanel.stop`})})},[e.id]);return(0,_.jsxs)(d,{Glyph:a(e.toolName),title:c(e.status),headerTrailing:(0,_.jsx)(v,{status:e.status}),headerActions:r?(0,_.jsx)(h,{onStop:x,ariaLabel:`Stop command`,disabled:y}):void 0,closeVariant:`outlined`,closeLabel:`Close task detail`,onClose:n,children:[(0,_.jsxs)(`div`,{children:[(0,_.jsx)(m,{children:`Command`}),(0,_.jsx)(p,{text:e.command})]}),u&&(0,_.jsxs)(`div`,{className:`mt-5`,children:[(0,_.jsx)(m,{children:`Output`}),(0,_.jsx)(p,{text:e.output})]}),f&&(0,_.jsxs)(i,{variant:`body-small-default`,as:`p`,className:`mt-2 text-[var(--content-tertiary)]`,children:[`Exit code: `,e.exitCode]})]})}export{y as BackgroundTaskDetailPanel};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Bj8_eutd.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{t as i}from"./typography-DEI9Ra9z.js";import{r as a,t as o}from"./background-task-actions-CmYMPa2o.js";import"./src-D89CNeuT.js";import{a as s,i as c,n as l,r as u}from"./background-task-store-DFS8MP5D.js";import{t as d}from"./detail-shell-DcNnOqM_.js";import{t as f}from"./status-badge-pill-z1OKPW3B.js";import{CodeBlock as p,SectionLabel as m}from"./tool-detail-panel-DFMOphDJ.js";import{t as h}from"./detail-panel-stop-button-C1rystDS.js";var g=e(n(),1),_=r();function v({status:e}){return(0,_.jsx)(f,{color:l(e),label:u(e)})}function y({entry:e,onClose:n}){let r=s(e.status),l=!r,u=l&&e.output!==void 0&&e.output!==``,f=l&&e.exitCode!=null,[y,b]=(0,g.useState)(!1),x=(0,g.useCallback)(()=>{b(!0),o(e.id).catch(e=>{b(!1),t(e,{context:`BackgroundTaskDetailPanel.stop`})})},[e.id]);return(0,_.jsxs)(d,{Glyph:a(e.toolName),title:c(e.status),headerTrailing:(0,_.jsx)(v,{status:e.status}),headerActions:r?(0,_.jsx)(h,{onStop:x,ariaLabel:`Stop command`,disabled:y}):void 0,closeVariant:`outlined`,closeLabel:`Close task detail`,onClose:n,children:[(0,_.jsxs)(`div`,{children:[(0,_.jsx)(m,{children:`Command`}),(0,_.jsx)(p,{text:e.command})]}),u&&(0,_.jsxs)(`div`,{className:`mt-5`,children:[(0,_.jsx)(m,{children:`Output`}),(0,_.jsx)(p,{text:e.output})]}),f&&(0,_.jsxs)(i,{variant:`body-small-default`,as:`p`,className:`mt-2 text-[var(--content-tertiary)]`,children:[`Exit code: `,e.exitCode]})]})}export{y as BackgroundTaskDetailPanel};
@@ -1 +1 @@
1
- import{n as e,t}from"./create-selectors-B-P03-8K.js";import{a as n,i as r,n as i,r as a,t as o}from"./optimistic-lifecycle-50vNA6dY.js";function s(e){return e===`running`}function c(e){switch(e){case`completed`:return`var(--system-positive-strong)`;case`failed`:case`cancelled`:return`var(--system-negative-strong)`;default:return`var(--primary-base)`}}function l(e){switch(e){case`running`:return`Running command`;case`completed`:return`Command finished`;case`cancelled`:return`Command cancelled`;case`failed`:return`Command failed`;default:return`Command`}}function u(e){switch(e){case`running`:return`Running`;case`completed`:return`Completed`;case`failed`:return`Failed`;case`cancelled`:return`Cancelled`;default:return`Unknown`}}var d={byId:{},orderedIds:[]};function f(e,t){let n=r(e.status,t.status,s);return{...e,status:n,exitCode:t.exitCode??e.exitCode,output:t.output??e.output,completedAt:t.completedAt??e.completedAt}}var p={getStatus:e=>e.status,isActive:s,cancelledStatus:`cancelled`,applyCancel:e=>({...e,status:`cancelled`}),applyRestore:(e,t)=>({...e,status:t,completedAt:void 0}),applyRetire:e=>({...e,status:`cancelled`}),isSettled:e=>e.completedAt!=null},m=t(e()((e,t)=>({...d,startTask:n=>{let{byId:r,orderedIds:i}=t();if(r[n.id])return;let a={id:n.id,toolName:n.toolName,conversationId:n.conversationId,command:n.command,startedAt:n.startedAt,status:`running`};e({byId:{...r,[n.id]:a},orderedIds:[...i,n.id]})},completeTask:n=>{let{byId:r}=t(),i=r[n.id];if(!i)return;let a=i.status===`cancelled`&&n.status===`failed`?`cancelled`:n.status;e({byId:{...r,[n.id]:{...i,status:a,exitCode:n.exitCode,output:n.output,completedAt:n.completedAt}}})},cancelTask:n=>{let{byId:r}=t(),i=o(r[n],p);i&&e({byId:{...r,[n]:i}})},restoreTaskStatus:(n,r)=>{let{byId:a}=t(),o=i(a[n],r,p);o&&e({byId:{...a,[n]:o}})},retireMissing:(n,r)=>{let{byId:i}=t(),o=new Set(n),s=new Set(r),c=!1,l={...i};for(let e of Object.values(i)){if(!s.has(e.id)||o.has(e.id))continue;let t=a(e,p);t&&(l[e.id]=t,c=!0)}c&&e({byId:l})},seedFromHistory:r=>{let{byId:i,orderedIds:a}=t();e(n({entries:r,byId:i,orderedIds:a,idOf:e=>e.id,merge:f}))},reset:()=>e({byId:{},orderedIds:[]})})));export{s as a,l as i,c as n,u as r,m as t};
1
+ import{n as e,t}from"./create-selectors-Qo7kcikX.js";import{a as n,i as r,n as i,r as a,t as o}from"./optimistic-lifecycle-C2a6IJ7E.js";function s(e){return e===`running`}function c(e){switch(e){case`completed`:return`var(--system-positive-strong)`;case`failed`:case`cancelled`:return`var(--system-negative-strong)`;default:return`var(--primary-base)`}}function l(e){switch(e){case`running`:return`Running command`;case`completed`:return`Command finished`;case`cancelled`:return`Command cancelled`;case`failed`:return`Command failed`;default:return`Command`}}function u(e){switch(e){case`running`:return`Running`;case`completed`:return`Completed`;case`failed`:return`Failed`;case`cancelled`:return`Cancelled`;default:return`Unknown`}}var d={byId:{},orderedIds:[]};function f(e,t){let n=r(e.status,t.status,s);return{...e,status:n,exitCode:t.exitCode??e.exitCode,output:t.output??e.output,completedAt:t.completedAt??e.completedAt}}var p={getStatus:e=>e.status,isActive:s,cancelledStatus:`cancelled`,applyCancel:e=>({...e,status:`cancelled`}),applyRestore:(e,t)=>({...e,status:t,completedAt:void 0}),applyRetire:e=>({...e,status:`cancelled`}),isSettled:e=>e.completedAt!=null},m=t(e()((e,t)=>({...d,startTask:n=>{let{byId:r,orderedIds:i}=t();if(r[n.id])return;let a={id:n.id,toolName:n.toolName,conversationId:n.conversationId,command:n.command,startedAt:n.startedAt,status:`running`};e({byId:{...r,[n.id]:a},orderedIds:[...i,n.id]})},completeTask:n=>{let{byId:r}=t(),i=r[n.id];if(!i)return;let a=i.status===`cancelled`&&n.status===`failed`?`cancelled`:n.status;e({byId:{...r,[n.id]:{...i,status:a,exitCode:n.exitCode,output:n.output,completedAt:n.completedAt}}})},cancelTask:n=>{let{byId:r}=t(),i=o(r[n],p);i&&e({byId:{...r,[n]:i}})},restoreTaskStatus:(n,r)=>{let{byId:a}=t(),o=i(a[n],r,p);o&&e({byId:{...a,[n]:o}})},retireMissing:(n,r)=>{let{byId:i}=t(),o=new Set(n),s=new Set(r),c=!1,l={...i};for(let e of Object.values(i)){if(!s.has(e.id)||o.has(e.id))continue;let t=a(e,p);t&&(l[e.id]=t,c=!0)}c&&e({byId:l})},seedFromHistory:r=>{let{byId:i,orderedIds:a}=t();e(n({entries:r,byId:i,orderedIds:a,idOf:e=>e.id,merge:f}))},reset:()=>e({byId:{},orderedIds:[]})})));export{s as a,l as i,c as n,u as r,m as t};
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-file-B6_oAU2Q.js","assets/chunk-jRWAZmH_.js","assets/preload-helper-Cv2QeVDK.js","assets/is-electron-m5eeGBnd.js","assets/dist-BwAT3VYQ.js"])))=>i.map(i=>d[i]);
2
+ import{o as e,t}from"./chunk-jRWAZmH_.js";import{t as n}from"./capture-error-Bj8_eutd.js";import{t as r}from"./react-BFJW0bSv.js";import{t as i}from"./button-Dy5001j6.js";import{t as a}from"./preload-helper-Cv2QeVDK.js";import{m as o,t as s,u as c}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as l}from"./QueryClientProvider-CMu7CkQU.js";import{t as u}from"./useQuery-Bz-fbQ-m.js";import{t as d}from"./useMutation-CXGTrp4W.js";import{t as f}from"./jsx-runtime-D3ZM-ToX.js";import{t as p}from"./typography-DEI9Ra9z.js";import{t as m}from"./card-DRIctGVs.js";import{t as h}from"./createLucideIcon-CAM1RhH8.js";import{t as g}from"./arrow-left-C2ylPLHq.js";import{t as _}from"./check-sC49_hjU.js";import{t as v}from"./chevron-down-B5A-0g8A.js";import{t as y}from"./chevron-up-2Qqarz0p.js";import{t as b}from"./circle-check-CjGnAahM.js";import{t as x}from"./coins-Hrmb9tmj.js";import{A as S,C,D as w,E as T,I as E,L as D,M as O,O as k,P as A,S as j,T as M,_ as N,a as P,b as F,c as I,d as L,f as ee,g as te,h as ne,i as R,j as z,l as re,m as ie,o as ae,p as oe,t as se,u as ce,v as B,w as le,x as V,y as ue}from"./use-checkout-dismiss-refresh-kdxxDNpF.js";import{n as de,o as fe}from"./list-row-B1wPb2Au.js";import{t as pe}from"./credit-card-C1RL73Rt.js";import{t as me}from"./download-CywcQLB2.js";import{t as he}from"./external-link-CS0aVYGt.js";import{t as ge}from"./info-vgPTIsGI.js";import{t as H}from"./loader-circle-XREx3i4W.js";import{t as _e}from"./sparkles-Ccrj7hxd.js";import{t as ve}from"./triangle-alert-CQfiAg_t.js";import{t as ye}from"./users-iLvfYFOP.js";import{t as be}from"./x-JBAsSOmg.js";import{t as U}from"./notice-BMK7xqUw.js";import{j as xe,r as Se}from"./src-D89CNeuT.js";import{t as Ce}from"./tag-NXcyiTkK.js";import{t as we}from"./input-hw3el2GJ.js";import{t as Te}from"./toggle-lfnhEAcN.js";import{t as W}from"./modal-BR4CUFBd.js";import{n as G}from"./toast-LgLp4obE.js";import{t as Ee}from"./confirm-dialog-UYFm4osC.js";import{t as De}from"./dropdown-BCfnSdIZ.js";import{Or as Oe}from"./sdk.gen-BVAVE6A_.js";import{It as ke,Lt as Ae,Rt as je,c as Me,d as Ne,ht as Pe,zt as Fe}from"./react-query.gen-r3I6j8-1.js";import{t as Ie}from"./api-errors-CFiCT7Ap.js";import{o as Le}from"./auth-store-D9BqFncz.js";import{lt as Re,ut as ze}from"./sdk.gen-BIu1DgTs.js";import{u as Be}from"./routes-vE-2hncW.js";import{i as Ve,r as He,t as Ue}from"./use-platform-gate-Dry0Nv4f.js";import{t as We}from"./use-is-org-ready-X_98Cnx9.js";import{n as Ge,r as Ke}from"./browser-CNL8hh8H.js";import{n as qe,t as Je}from"./conversation-navigation-Wm7_pLFs.js";import{n as Ye}from"./use-is-mobile-Bz2l7wPL.js";import{t as Xe}from"./effective-timezone-qiooajmO.js";import{$ as Ze,B as Qe,G as $e,H as et,J as tt,K as nt,L as rt,Mt as it,Q as at,R as ot,U as st,V as ct,W as lt,X as ut,Y as dt,Z as ft,ct as pt,dt as mt,et as ht,ft as gt,gt as _t,ht as vt,it as yt,lt as bt,nt as xt,pt as St,q as Ct,st as wt,tt as Tt,ut as Et,wt as Dt,z as Ot}from"./react-query.gen-Mwd5l-vZ.js";import{t as kt}from"./use-effective-timezone-LqzBqHBy.js";import{t as At}from"./misc-DckBb5zz.js";import{t as jt}from"./platform-login-notice-BG9TFAJa.js";import{t as Mt}from"./format-date-RZ9mCDCy.js";import{t as Nt}from"./use-active-assistant-id-Cjbsk2Q3.js";import{t as Pt}from"./add-credits-modal-CCEMf2_U.js";import{t as Ft}from"./link-click-BoSQACXo.js";import{t as It}from"./schedules-DF5cTXBf.js";import{i as Lt,n as Rt,r as zt,t as Bt}from"./profile-metadata-h4CTeMKT.js";var Vt=h(`crown`,[[`path`,{d:`M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z`,key:`1vdc57`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),Ht=h(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Ut=h(`tree-palm`,[[`path`,{d:`M13 8c0-2.76-2.46-5-5.5-5S2 5.24 2 8h2l1-1 1 1h4`,key:`foxbe7`}],[`path`,{d:`M13 7.14A5.82 5.82 0 0 1 16.5 6c3.04 0 5.5 2.24 5.5 5h-3l-1-1-1 1h-3`,key:`18arnh`}],[`path`,{d:`M5.89 9.71c-2.15 2.15-2.3 5.47-.35 7.43l4.24-4.25.7-.7.71-.71 2.12-2.12c-1.95-1.96-5.27-1.8-7.42.35`,key:`ywahnh`}],[`path`,{d:`M11 15.5c.5 2.5-.17 4.5-1 6.5h4c2-5.5-.5-12-1-14`,key:`ft0feo`}]]),K=e(r(),1);function Wt(e){return e.get(`tab`)===`billing`||e.has(`adjust_plan`)||e.has(`pro_onboarding`)||e.has(`billing_status`)||e.has(`session_id`)}function Gt(e,t){return e===`full`?!0:e===`disabled`?Wt(t):!1}function Kt(e){if(!e)return{};let t={};for(let n of e.callSites)!n.id||!n.displayName||(t[n.id]={id:n.id,displayName:n.displayName,description:n.description,domain:n.domain});return t}function q(e){return Number.isFinite(e)?Math.round(e).toLocaleString():`0`}function qt(e){return!Number.isFinite(e)||e===0?`$0.00`:`$${e.toFixed(2)}`}var Jt=`model`,Yt={model:`Model`,task:`Action`,profile:`Profile`},Xt=[{value:`model`,label:Yt.model},{value:`task`,label:Yt.task},{value:`profile`,label:Yt.profile}];function Zt(e){return e===`model`||e===`task`||e===`profile`}function Qt(e){switch(e){case`model`:return`model`;case`task`:return`call_site`;case`profile`:return`inference_profile`}}function $t(e){switch(e){case`model`:return`model`;case`task`:return`llm_call_site`;case`profile`:return`inference_profile`}}function en(e,t,n){if(e===`task`){let e=t.groupKey;return e?n.callSites?.[e]?.displayName??t.group:t.group}if(e===`profile`){let e=t.groupKey;return e?n.profiles?.[e]?.displayName??t.group:t.group||`Default / Unset`}return t.group}function tn(e,t,n){return!e||e.length===0?[]:e.map(e=>{let r=en(t,e,n);return r===e.group?e:{...e,group:r}})}var nn=6,rn=`value:`,an=`null:`;function on(e,t=`schedule`){return e===null?`${an}${Zt(t)?Qt(t):t}`:`${rn}${e}`}function sn(e){return[...e].sort((e,t)=>{if(e.date!==t.date)return e.date<t.date?-1:1;let n=fn(e.bucketId),r=fn(t.bucketId);return n===r?e.bucketId===t.bucketId?0:e.bucketId<t.bucketId?-1:1:n-r})}function cn(e){return e.map(e=>({bucketId:e.bucketId,date:e.date,displayLabel:e.displayLabel,totalInputTokens:e.totalInputTokens,totalOutputTokens:e.totalOutputTokens,totalEstimatedCostUsd:e.totalEstimatedCostUsd,eventCount:e.eventCount,groups:{}}))}function ln(e,t,n){return t!==`task`&&t!==`profile`?[...e]:e.map(e=>{let r=!1,i={};for(let[a,o]of Object.entries(e.groups)){let e=en(t,dn(o),n);e===o.group?i[a]=o:(r=!0,i[a]={...o,group:e})}return r?{...e,groups:i}:e})}function un(e){let t=new Map;for(let n of e)for(let[e,r]of Object.entries(n.groups)){let n=t.get(e);t.set(e,{label:n?.label??r.group,totalEstimatedCostUsd:(n?.totalEstimatedCostUsd??0)+r.totalEstimatedCostUsd})}let n=Array.from(t.entries()).sort(([e,t],[n,r])=>t.totalEstimatedCostUsd===r.totalEstimatedCostUsd?t.label===r.label?e===n?0:e<n?-1:1:t.label<r.label?-1:1:r.totalEstimatedCostUsd-t.totalEstimatedCostUsd).map(([e,t],n)=>({seriesKey:e,label:t.label,totalEstimatedCostUsd:t.totalEstimatedCostUsd,colorIndex:n}));return{items:n,visibleItems:n.slice(0,nn)}}function dn(e){return{group:e.group,groupId:e.groupKey,groupKey:e.groupKey,totalInputTokens:e.totalInputTokens,totalOutputTokens:e.totalOutputTokens,totalCacheCreationTokens:0,totalCacheReadTokens:0,totalEstimatedCostUsd:e.totalEstimatedCostUsd,eventCount:e.eventCount,turnCount:null}}function fn(e){let t=e.lastIndexOf(`|`);if(t<0)return 0;let n=Number(e.slice(t+1));return Number.isFinite(n)?n:0}var J=f(),pn=140,mn=40,hn=28,gn=2,_n=2,vn=1e-6,yn=12,bn=220,xn=56,Sn=[40,80,60,100,50,70,30],Cn=[18,24,28,35,42,50,64,78,92,106,118,96,84,74,68,80,88,72,56,48,40,34,26,20],wn=[`var(--usage-trend-stack-positive, var(--system-positive-strong, #10b981))`,`var(--usage-trend-stack-info, var(--system-info-strong, #3b82f6))`,`var(--usage-trend-stack-mid, var(--system-mid-strong, #f59e0b))`,`var(--usage-trend-stack-secondary, var(--content-secondary, #6b7280))`,`var(--usage-trend-stack-negative, var(--system-negative-strong, #f87171))`,`var(--usage-trend-stack-tertiary, var(--content-tertiary, #9ca3af))`];function Tn(e){return wn[e%wn.length]}function En(e){return e.displayLabel?e.displayLabel:e.date}function Dn(e,t){let n=e+yn,r=t+yn;return n+bn>window.innerWidth&&(n=e-bn-yn),r+xn>window.innerHeight&&(r=t-xn-yn),{x:n,y:r}}function On({buckets:e,isHourly:t,legendItems:n}){let[r,i]=(0,K.useState)(null),a=(0,K.useMemo)(()=>sn(e),[e]),o=(0,K.useMemo)(()=>un(e),[e]),s=n??o.items,c=n??o.visibleItems,l=(0,K.useMemo)(()=>a.reduce((e,t)=>Math.max(e,t.totalEstimatedCostUsd),0),[a]),u=(0,K.useCallback)((e,t)=>{let n=Dn(e.clientX,e.clientY);i({...t,x:n.x,y:n.y})},[]),d=(0,K.useCallback)(()=>i(null),[]);if(a.length===0){let e=(0,J.jsx)(Nn,{title:t?`No hourly data`:`No daily data`,subtitle:`No usage recorded in this time range`});return c.length===0?e:(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e,(0,J.jsx)(Mn,{items:c})]})}let f=t?hn:mn;return(0,J.jsxs)(`div`,{className:`overflow-x-auto`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`div`,{className:`flex items-end gap-2`,style:{height:`${pn}px`},"aria-hidden":`true`,children:a.map(e=>{let t=l>0?e.totalEstimatedCostUsd/l:0,r=Math.max(gn,pn*t);return(0,J.jsx)(`div`,{className:`flex items-end`,style:{width:`${f}px`,minWidth:`${f}px`,height:`${r}px`,opacity:e.totalEstimatedCostUsd>0?1:.3},title:`${En(e)}: ${qt(e.totalEstimatedCostUsd)}`,"data-usage-series-bar":e.bucketId,children:(0,J.jsx)(An,{bucket:e,height:r,legendItems:s,hasLegendOverride:n!=null,onSegmentHover:u,onSegmentLeave:d})},e.bucketId)})}),(0,J.jsx)(`div`,{className:`flex items-start gap-2`,children:a.map(e=>(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-0.5`,style:{width:`${f}px`,minWidth:`${f}px`},children:[(0,J.jsx)(`span`,{className:`truncate text-[10px]`,style:{color:`var(--content-secondary)`},children:qt(e.totalEstimatedCostUsd)}),(0,J.jsx)(`span`,{className:`truncate text-[10px]`,style:{color:`var(--content-tertiary)`},children:En(e)})]},e.bucketId))}),c.length>0?(0,J.jsx)(Mn,{items:c}):null]}),r?(0,J.jsx)(jn,{tooltip:r}):null]})}function kn({isHourly:e}){let t=e?Cn:Sn,n=e?hn:mn;return(0,J.jsx)(`div`,{className:`flex items-end gap-2`,style:{height:`${pn}px`},"aria-hidden":`true`,children:t.map((e,t)=>(0,J.jsx)(`div`,{className:`rounded-sm`,style:{width:`${n}px`,height:`${e}px`,background:`color-mix(in srgb, var(--border-base) 40%, transparent)`}},t))})}function An({bucket:e,height:t,legendItems:n,hasLegendOverride:r,onSegmentHover:i,onSegmentLeave:a}){let o=Object.keys(e.groups).length>0,s=n.filter(e=>(e.state??`active`)===`active`).flatMap(t=>{let n=e.groups[t.seriesKey];return!n||n.totalEstimatedCostUsd<=0?[]:[{item:t,value:n}]});if(s.length===0&&!o&&!r){let n={label:`Total`,bucketLabel:En(e),cost:qt(e.totalEstimatedCostUsd)};return(0,J.jsx)(`div`,{className:`w-full rounded-sm`,title:`${n.label}: ${n.cost}`,onMouseEnter:e=>i(e,n),onMouseMove:e=>i(e,n),onMouseLeave:a,style:{height:`${t}px`,background:Tn(0)},"data-usage-series-segment-label":n.label,"data-usage-fallback-segment":`true`})}return s.length===0?null:(0,J.jsx)(`div`,{className:`flex w-full flex-col-reverse overflow-hidden rounded-sm`,style:{height:`${t}px`},"data-usage-series-stack":e.bucketId,children:s.map(({item:n,value:r})=>{let o={label:n.label,bucketLabel:En(e),cost:qt(r.totalEstimatedCostUsd)};return(0,J.jsx)(`div`,{title:`${o.label}: ${o.cost}`,onMouseEnter:e=>i(e,o),onMouseMove:e=>i(e,o),onMouseLeave:a,style:{height:`${Math.max(_n,t*r.totalEstimatedCostUsd/Math.max(e.totalEstimatedCostUsd,vn))}px`,background:Tn(n.colorIndex)},"data-usage-series-segment":n.seriesKey,"data-usage-series-segment-label":n.label,"data-usage-series-color-index":n.colorIndex},n.seriesKey)})})}function jn({tooltip:e}){return(0,J.jsxs)(`div`,{className:`pointer-events-none fixed z-50 max-w-[220px] rounded-md border px-2 py-1 shadow-xl`,style:{left:`${e.x}px`,top:`${e.y}px`,background:`var(--surface-overlay, var(--surface-lift))`,borderColor:`var(--border-base)`},"aria-hidden":`true`,children:[(0,J.jsx)(`div`,{className:`truncate text-body-small-default`,style:{color:`var(--content-default)`},children:e.label}),(0,J.jsxs)(`div`,{className:`truncate text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[e.bucketLabel,` · `,e.cost]})]})}function Mn({items:e}){return(0,J.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 pt-1`,children:e.map(e=>{let t=e.state??`active`,n=t===`inactive`;return(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,"data-usage-legend-state":t,children:[(0,J.jsx)(`span`,{className:`h-[7px] w-[7px] shrink-0 rounded-full`,style:{background:n?`var(--content-tertiary)`:Tn(e.colorIndex),opacity:n?.45:1},"aria-hidden":`true`,"data-usage-series-color-index":e.colorIndex}),(0,J.jsx)(`span`,{className:n?`truncate text-[10px] line-through`:`truncate text-[10px]`,style:{color:`var(--content-tertiary)`,opacity:n?.65:1},children:e.label})]},e.seriesKey)})})}function Nn({title:e,subtitle:t}){return(0,J.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-md py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,J.jsx)(`p`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),(0,J.jsx)(`p`,{className:`mt-1 text-body-small-default`,children:t})]})}function Pn(e){return Zt(e)?Qt(e):e}function Fn(e){return zn({from:e.from,to:e.to},e.scheduleId)}function In(e){return zn({from:e.from,to:e.to,...e.granularity?{granularity:e.granularity}:{},...e.tz?{tz:e.tz}:{}},e.scheduleId)}function Ln(e){return zn({from:e.from,to:e.to,groupBy:Pn(e.groupBy)},e.scheduleId)}function Rn(e){return zn({from:e.from,to:e.to,granularity:e.granularity,groupBy:Pn(e.groupBy),...e.tz?{tz:e.tz}:{}},e.scheduleId)}function zn(e,t){return t?{...e,scheduleId:t}:e}function Bn(e){return[`${q(e.totalInputTokens)} direct`,`${q(e.totalCacheCreationTokens)} cache created`,`${q(e.totalCacheReadTokens)} cache read`,`${q(e.totalOutputTokens)} out`].join(` / `)}function Vn(e){return!Number.isFinite(e)||e===0?`0`:e>=1e6||e>=999950&&e<1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function Hn(e){return`${Vn(e.totalInputTokens+e.totalCacheCreationTokens+e.totalCacheReadTokens)} in / ${Vn(e.totalOutputTokens)} out`}var Un=`task`,Wn=`model`,Gn=new Set([400,404,422]),Kn=3,qn=new Set([`today`,`yesterday`,`7d`,`30d`,`90d`,`all`]),Jn=new Set([`actor`,`provider`,`model`,`conversation`,`task`,`profile`,`schedule`]),Yn={task:Yt.task,profile:Yt.profile,model:Yt.model,provider:`Provider`,actor:`Actor`,conversation:`Conversation`,schedule:`Schedule`},Xn=[{value:`task`,label:Yn.task},{value:`profile`,label:Yn.profile},{value:`model`,label:Yn.model},{value:`provider`,label:Yn.provider},{value:`schedule`,label:Yn.schedule},{value:`conversation`,label:Yn.conversation}];function Zn(e){let t=e.get(`range`),n=e.get(`groupBy`),r=tr(n)?n:Un;return{range:er(t)?t:`7d`,groupBy:r,scheduleId:r===`schedule`?Qn(e):void 0}}function Qn(e){let t=e.get(`scheduleId`);if(!(!t||t.trim().length===0))return t}function $n(e,t){let n=new URLSearchParams(e);return t.range!==void 0&&n.set(`range`,t.range),t.groupBy!==void 0&&n.set(`groupBy`,t.groupBy),t.scheduleId!==void 0&&(t.scheduleId===null||t.scheduleId.trim().length===0?n.delete(`scheduleId`):n.set(`scheduleId`,t.scheduleId)),n.get(`groupBy`)!==`schedule`&&n.delete(`scheduleId`),n}function er(e){return e!=null&&qn.has(e)}function tr(e){return e!=null&&Jn.has(e)}function nr(e){return e!==`conversation`}function rr(e,t){return e!==`task`&&e!==`profile`?!1:ar(t)}function ir(e,t){return!ar(t)&&e<Kn}function ar(e){return e instanceof Ie&&Gn.has(e.status)}function or(e,t){let n=e===`hourly`?`Hourly Trend`:`Daily Trend`;return!t||t===`conversation`?n:`${n} by ${Yn[t]}`}function sr({requestedGranularity:e,isLoading:t,buckets:n}){return e===`hourly`&&(t||!n||n.length===0||n.some(cr))?`hourly`:`daily`}function cr(e){return e.bucketId.includes(`|`)||lr(e.date)}function lr(e){return/^\d{4}-\d{2}-\d{2} ([01]\d|2[0-3]):00$/.test(e)}function ur(e,t,n=Date.now()){return zt(e,t,n)}function dr(e){return e===`today`||e===`yesterday`?`hourly`:`daily`}function fr({prompt:e,children:t,variant:n=`outlined`,size:r=`regular`,className:a}){let o=c(),s=(0,K.useCallback)(()=>{qe(o,{prompt:e})},[o,e]);return(0,J.jsx)(i,{variant:n,size:r,leftIcon:(0,J.jsx)(_e,{}),onClick:s,className:a,children:t})}var pr=[{value:`today`,label:`Today`},{value:`yesterday`,label:`Yesterday`},{value:`7d`,label:`Last 7 days`},{value:`30d`,label:`Last 30 days`},{value:`90d`,label:`Last 90 days`},{value:`all`,label:`All time`}],mr=300*1e3,hr=[`Please load the llm-cost-optimizer skill.`,`Analyze my recent LLM usage and explain the biggest cost contributors by call site, model, and profile.`,`Check my current llm.default, llm.callSites, and llm.profiles.`,`Give me a concise summary of what is driving cost and what you would optimize first.`,`Do not change config yet.`].join(` `),gr=[`Please load the llm-cost-optimizer skill.`,`Analyze my recent LLM usage and current LLM config, then recommend the safest cost-optimization changes.`,`If changes are clearly safe, show me the exact config commands you would run and ask for confirmation before applying them.`].join(` `);function _r({assistantId:e}){let[t,n]=o(),{range:r,groupBy:i,scheduleId:a}=(0,K.useMemo)(()=>Zn(t),[t]),s=kt(),c=(0,K.useCallback)(e=>{n(t=>$n(t,e),{replace:!0})},[n]),l=(0,K.useMemo)(()=>ur(r,s),[r,s]),d=(0,K.useMemo)(()=>dr(r),[r]),f=u({queryKey:Pe({path:{assistant_id:e}}),queryFn:()=>It(e),staleTime:1e4}),p=(0,K.useCallback)(e=>{c({range:e})},[c]),m=u({...Fe({path:{assistant_id:e},query:Fn({from:l.from,to:l.to,scheduleId:a})})}),h=u({queryKey:ke({path:{assistant_id:e},query:Ln({from:l.from,to:l.to,groupBy:i,scheduleId:a})}),queryFn:async({signal:t})=>{try{let{data:n}=await Oe({path:{assistant_id:e},query:Ln({from:l.from,to:l.to,groupBy:i,scheduleId:a}),signal:t,throwOnError:!0});return{groupBy:i,response:n}}catch(n){if(!rr(i,n))throw n;let{data:r}=await Oe({path:{assistant_id:e},query:Ln({from:l.from,to:l.to,groupBy:Wn,scheduleId:a}),signal:t,throwOnError:!0});return{groupBy:Wn,response:r}}},retry:ir}),g=h.data?.groupBy??i,_=nr(g)?g:void 0,v=u({...je({path:{assistant_id:e},query:Rn({from:l.from,to:l.to,granularity:d,groupBy:_??`actor`,tz:s,scheduleId:a})}),enabled:!!_,retry:ir}),y=u({...Ae({path:{assistant_id:e},query:In({from:l.from,to:l.to,granularity:d,tz:s,scheduleId:a})}),enabled:!_||v.isError}),b=u({...Ne({path:{assistant_id:e}}),enabled:g===`task`,staleTime:1/0}),x=u({...Me({path:{assistant_id:e}}),select:Bt,enabled:g===`profile`,staleTime:mr}),S=(0,K.useMemo)(()=>({callSites:Kt(b.data),profiles:x.data??{}}),[b.data,x.data]),C=(0,K.useMemo)(()=>{let e=h.data;if(e)return tn(e.response.breakdown,e.groupBy,S)},[h.data,S]),w=(0,K.useMemo)(()=>{if(!(!_||!v.data))return ln(v.data.buckets,_,S)},[v.data,_,S]),T=(0,K.useMemo)(()=>{if(y.data)return cn(y.data.buckets)},[y.data]),E=(0,K.useMemo)(()=>_?v.error?T?{isLoading:!1,error:null,data:T,refetch:y.refetch}:{isLoading:y.isLoading||!T&&!y.error,error:y.error??v.error,data:void 0,refetch:y.error?y.refetch:v.refetch}:{isLoading:v.isLoading,error:v.error,data:w,refetch:v.refetch}:{isLoading:y.isLoading,error:y.error,data:T,refetch:y.refetch},[T,y.error,y.isLoading,y.refetch,w,_,v.error,v.isLoading,v.refetch]),D=sr({requestedGranularity:d,isLoading:E.isLoading,buckets:E.data}),O=D===`hourly`,k=_&&v.error?void 0:g,A=(0,K.useMemo)(()=>{if(!(g!==`schedule`||!a))return vr(f.data,a)},[g,a,f.data]);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,J.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Usage`}),(0,J.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:(0,J.jsx)(xr,{range:r,onChange:p})})]}),(0,J.jsx)(`section`,{"aria-label":`Totals`,children:(0,J.jsx)(Cr,{query:m,skeleton:(0,J.jsx)(Er,{}),render:e=>(0,J.jsx)(wr,{totals:e})})}),(0,J.jsx)(Sr,{title:`Inference Usage`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,J.jsx)(`h4`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:or(D,k)}),(0,J.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:(0,J.jsx)(Dr,{value:g,onChange:e=>{e===i&&g!==i&&(h.refetch(),v.refetch()),c({groupBy:e,scheduleId:e===`schedule`?void 0:null})}})})]}),(0,J.jsx)(Cr,{query:E,skeleton:(0,J.jsx)(kn,{isHourly:O}),render:e=>(0,J.jsx)(On,{buckets:e,isHourly:O,legendItems:A})})]})}),(0,J.jsx)(Or,{query:h,groups:C}),(0,J.jsx)(br,{})]})}function vr(e,t){let n=e??[];return[...n.some(e=>e.id===t)?[]:[{id:t,label:yr(t)}],...n.map(e=>({id:e.id,label:e.name||e.id}))].map((e,n)=>({seriesKey:on(e.id,`schedule`),label:e.label,colorIndex:n,state:e.id===t?`active`:`inactive`}))}function yr(e){return`Unknown schedule (${e})`}function br(){return(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,J.jsx)(`div`,{className:`h-px w-full`,style:{background:`linear-gradient(to right, transparent, var(--border-base), transparent)`}}),(0,J.jsx)(Sr,{title:`Cost assistant`,subtitle:`Review recent spend and tune model profile choices.`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md px-3 py-3 sm:flex-row sm:items-center`,children:[(0,J.jsx)(fr,{prompt:hr,children:`Analyze costs with assistant`}),(0,J.jsx)(fr,{prompt:gr,variant:`ghost`,children:`Optimize settings`})]})})]})}function xr({range:e,onChange:t}){return(0,J.jsx)(`div`,{className:`flex items-center`,children:(0,J.jsx)(De,{value:e,onChange:t,options:pr.map(e=>({value:e.value,label:e.label}))})})}function Sr({title:e,subtitle:t,children:n}){return(0,J.jsxs)(`section`,{className:`flex flex-col gap-3 rounded-md border px-4 py-4`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`},children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`h3`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),t?(0,J.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:t}):null]}),n]})}function Cr({query:e,skeleton:t,render:n}){return e.isLoading?(0,J.jsx)(J.Fragment,{children:t}):e.error?(0,J.jsx)(Nr,{message:e.error instanceof Error?e.error.message:`Failed to load usage.`,onRetry:()=>e.refetch()}):e.data?(0,J.jsx)(J.Fragment,{children:n(e.data)}):(0,J.jsx)(J.Fragment,{children:t})}function wr({totals:e}){return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{style:{fontSize:`30px`,fontWeight:600,lineHeight:1,color:`var(--content-default)`},children:qt(e.totalEstimatedCostUsd)}),(0,J.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-secondary)`},children:`Cost`})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:q(e.eventCount)}),(0,J.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-secondary)`},children:`LLM Calls`})]})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[(0,J.jsx)(Tr,{label:`Direct Input Tokens`,value:q(e.totalInputTokens)}),(0,J.jsx)(Tr,{label:`Output Tokens`,value:q(e.totalOutputTokens)}),(0,J.jsx)(Tr,{label:`Cache Created`,value:q(e.totalCacheCreationTokens)}),(0,J.jsx)(Tr,{label:`Cache Read`,value:q(e.totalCacheReadTokens)})]})]})}function Tr({label:e,value:t}){return(0,J.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md px-3 py-2`,style:{background:`color-mix(in srgb, var(--border-base) 15%, transparent)`},children:[(0,J.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-default)`},children:t}),(0,J.jsx)(`span`,{className:`text-label-medium-default`,style:{color:`var(--content-tertiary)`},children:e})]})}function Er(){return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,"aria-hidden":`true`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(Y,{width:140,height:30}),(0,J.jsx)(Y,{width:90,height:12})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(Y,{width:60,height:16}),(0,J.jsx)(Y,{width:60,height:12})]})]}),(0,J.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:Array.from({length:4}).map((e,t)=>(0,J.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md px-3 py-2`,style:{background:`color-mix(in srgb, var(--border-base) 15%, transparent)`},children:[(0,J.jsx)(Y,{width:`50%`,height:12}),(0,J.jsx)(Y,{width:`70%`,height:11})]},t))})]})}function Dr({value:e,onChange:t}){return(0,J.jsx)(`div`,{className:`flex items-center`,children:(0,J.jsx)(De,{value:e,onChange:t,menuAlign:`end`,menuMinWidth:196,options:Xn.map(e=>({value:e.value,label:e.label}))})})}function Or({query:e,groups:t}){let[n,r]=(0,K.useState)(new Set),i=e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,J.jsx)(Sr,{title:`Breakdown`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(kr,{label:`% of total`,active:n.has(`pct`),onClick:()=>i(`pct`)}),(0,J.jsx)(kr,{label:`Tokens`,active:n.has(`tokens`),onClick:()=>i(`tokens`)}),(0,J.jsx)(kr,{label:`Turns`,active:n.has(`turns`),onClick:()=>i(`turns`)})]}),(0,J.jsx)(Cr,{query:e,skeleton:(0,J.jsx)(jr,{}),render:e=>(0,J.jsx)(Ar,{groups:t??e.response.breakdown,groupBy:e.groupBy,showPct:n.has(`pct`),showTokens:n.has(`tokens`),showTurns:n.has(`turns`)})})]})})}function kr({label:e,active:t,onClick:n}){return(0,J.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-full border px-2.5 py-1 text-label-medium-default`,style:{borderColor:t?`var(--content-secondary)`:`var(--border-base)`,background:t?`color-mix(in srgb, var(--content-secondary) 15%, transparent)`:`transparent`,color:t?`var(--content-default)`:`var(--content-tertiary)`},children:e})}function Ar({groups:e,groupBy:t,showPct:n,showTokens:r,showTurns:i}){let a=c();if(e.length===0)return(0,J.jsx)(Mr,{title:`No breakdown data`,subtitle:`No usage recorded for this grouping`});let o=e.reduce((e,t)=>e+t.totalEstimatedCostUsd,0);return(0,J.jsx)(`div`,{className:`overflow-hidden rounded-md`,children:(0,J.jsxs)(`table`,{className:`w-full table-fixed`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{style:{borderBottom:`1px solid var(--border-base)`},children:[(0,J.jsx)(`th`,{className:`px-3 py-2.5 text-left text-label-medium-default`,style:{color:`var(--content-tertiary)`},children:`Group`}),r?(0,J.jsx)(`th`,{className:`px-3 py-2.5 text-left text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`35%`},children:`Tokens`}):null,i?(0,J.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`72px`},children:`Turns`}):null,n?(0,J.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`64px`},children:`%`}):null,(0,J.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`100px`},children:`Cost`})]})}),(0,J.jsx)(`tbody`,{children:e.map((e,c)=>{let l=Bn(e),u=Hn(e),d=t===`conversation`?e.groupId:null,f=o>0?Math.round(e.totalEstimatedCostUsd/o*100):0;return(0,J.jsxs)(`tr`,{className:d?`cursor-pointer hover:bg-[var(--surface-hover)]`:void 0,onClick:d?e=>{e.target.closest(`a`)||Je(a,d)}:void 0,style:{borderTop:c===0?`none`:`1px solid var(--border-base)`},children:[(0,J.jsx)(`td`,{className:`min-w-0 px-3 py-2`,style:{color:`var(--content-default)`},children:d?(0,J.jsx)(s,{to:Be.conversation(d),className:`block truncate text-body-medium-lighter`,title:e.group,onClick:e=>{Ft(e)||(e.preventDefault(),Je(a,d))},children:e.group}):(0,J.jsx)(`span`,{className:`block truncate text-body-medium-lighter`,title:e.group,children:e.group})}),r?(0,J.jsx)(`td`,{className:`min-w-0 px-3 py-2`,style:{color:`var(--content-secondary)`},children:(0,J.jsx)(`span`,{className:`block truncate text-body-small-default`,title:l,children:u})}):null,i?(0,J.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,J.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.turnCount==null?`—`:e.turnCount.toLocaleString()})}):null,n?(0,J.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,J.jsxs)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[f,`%`]})}):null,(0,J.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,J.jsx)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-default)`},children:qt(e.totalEstimatedCostUsd)})})]},e.groupKey??e.groupId??`${e.group}-${c}`)})})]})})}function jr(){return(0,J.jsx)(`div`,{className:`flex flex-col gap-2`,"aria-hidden":`true`,children:Array.from({length:4}).map((e,t)=>(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,J.jsx)(Y,{width:100,height:14}),(0,J.jsx)(Y,{width:`60%`,height:12}),(0,J.jsx)(Y,{width:50,height:14})]},t))})}function Y({width:e,height:t}){return(0,J.jsx)(`div`,{className:`rounded-sm`,style:{width:typeof e==`number`?`${e}px`:e,height:`${t}px`,background:`color-mix(in srgb, var(--border-base) 40%, transparent)`}})}function Mr({title:e,subtitle:t}){return(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-1 py-8 text-center`,children:[(0,J.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),(0,J.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:t})]})}function Nr({message:e,onRetry:t}){return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 py-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,J.jsx)(ve,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-negative-strong, #f87171)`}}),(0,J.jsx)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-default)`},children:e})]}),t?(0,J.jsx)(`button`,{type:`button`,onClick:t,className:`self-start rounded-md border px-3 py-1 text-body-small-default`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`,color:`var(--content-default)`},children:`Retry`}):null]})}function Pr({open:e,onCancel:t,onConfirm:n,confirming:r,lostFeatures:a}){return(0,J.jsx)(W.Root,{open:e,onOpenChange:e=>{!e&&!r&&t()},children:(0,J.jsxs)(W.Content,{size:`md`,hideCloseButton:!0,children:[(0,J.jsx)(W.Header,{children:(0,J.jsx)(W.Title,{icon:ve,children:`Downgrade to Base?`})}),(0,J.jsxs)(W.Body,{children:[(0,J.jsx)(p,{as:`p`,variant:`body-medium-default`,className:`text-(--content-secondary)`,children:`Downgrading removes the following Pro features:`}),(0,J.jsx)(`ul`,{className:`mt-4 list-disc space-y-2 pl-5`,children:a.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsx)(p,{as:`span`,variant:`body-medium-default`,children:e})},e))})]}),(0,J.jsxs)(W.Footer,{children:[(0,J.jsx)(i,{variant:`outlined`,onClick:t,disabled:r,children:`Keep Pro`}),(0,J.jsx)(i,{variant:`danger`,onClick:n,disabled:r,"data-testid":`confirm-downgrade-button`,children:`Confirm Downgrade`})]})]})})}var Fr=`__none__`;function Ir(e){return`${e.label} — ${V(e.price_cents)}`}function Lr({creditTiers:e,selectedCreditTier:t,onCreditTierChange:n,disabled:r=!1}){let i=(0,K.useMemo)(()=>[{value:Fr,label:`No credit bundle — ${V(0)}`},...e.map(e=>({value:e.tier,label:Ir(e)}))],[e]);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(p,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:`Credit bundle`}),(0,J.jsx)(`span`,{title:`A monthly allotment of credits added to your Pro Plan subscription`,children:(0,J.jsx)(ge,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,J.jsx)(De,{"aria-label":`Credit bundle`,placeholder:`Select a credit bundle`,disabled:r,value:t??Fr,onChange:e=>n(e===Fr?null:e),options:i})]})}function Rr({features:e,variant:t,header:n,maxInline:r=3}){return t===`inline`?(0,J.jsx)(J.Fragment,{children:e.slice(0,r).join(`, `)}):(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[n&&(0,J.jsx)(p,{as:`p`,variant:`body-small-default`,className:`text-[var(--content-secondary)]`,children:n}),(0,J.jsx)(`ul`,{className:`flex flex-col gap-2`,children:e.map(e=>(0,J.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,J.jsx)(b,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,J.jsx)(p,{as:`span`,variant:`body-medium-default`,children:e})]},e))})]})}function zr({plan:e,isCurrent:t,onPro:n,cancelAtPeriodEnd:r,isCanceled:a,cancelDate:o,formatGraceDate:s,proTierChangeMode:c,creditTiersEnabled:l,creditTiers:u,displayCreditTier:d,onCreditTierChange:f,selectedMachineTier:h,selectedStorageTier:g,onMachineTierChange:_,onStorageTierChange:v,machineTiersForPicker:y,storageTiersForPicker:b,currentMachinePrice:x,currentStoragePrice:S,currentCreditPriceUnknown:C,proCurrentTotalCents:w,proLiveTotalCents:T,proTotalDelta:E,onboardingLoading:D,tierChangePending:O,machineChanged:k,storageChanged:A,creditChanged:j,tierChangeError:M,upgradePending:N,portalPending:P,onUpgrade:I,onApplyTierChange:L,onDowngradeClick:ee,onKeepPlan:te}){let R=e.id===`pro`,z=e.id===`base`,re=R&&n&&r&&!a,ie=R&&(!t||t&&c),ae=R&&t&&c;return(0,J.jsx)(m.Root,{className:`flex flex-col bg-[var(--surface-base)]`,children:(0,J.jsxs)(m.Body,{padding:`lg`,className:`max-sm:p-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsx)(`span`,{"aria-hidden":!0,className:`flex h-9 w-9 items-center justify-center rounded-lg border border-[var(--border-base)] bg-[var(--surface-lift)]`,children:R?(0,J.jsx)(Vt,{className:`h-5 w-5 text-[var(--content-default)]`}):(0,J.jsx)(Ut,{className:`h-5 w-5 text-[var(--content-default)]`})}),(0,J.jsxs)(`div`,{className:`flex min-h-6 items-center gap-2`,children:[(0,J.jsx)(p,{as:`h3`,variant:`title-small`,children:e.name}),t&&(0,J.jsx)(Ce,{tone:`positive`,children:`Current`})]}),(0,J.jsx)(p,{as:`p`,variant:`body-small-default`,className:`-mt-2 text-[var(--content-tertiary)]`,children:z?`All you need for a capable assistant`:`More features, more compute, more storage`}),re&&o&&(0,J.jsxs)(p,{as:`p`,variant:`body-small-default`,className:`text-[var(--system-mid-strong)]`,"data-testid":`modal-cancels-on`,children:[`Your plan ends on `,s(o)]}),(0,J.jsx)(`hr`,{className:`border-t border-[var(--border-base)]`}),(0,J.jsx)(`div`,{className:`flex flex-col gap-1`,children:z?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(p,{as:`p`,variant:`title-medium`,children:`Free`}),(0,J.jsx)(p,{as:`p`,variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:`Forever`})]}):t&&!(ie&&T!=null)&&(w==null||C)?D?(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:[(0,J.jsx)(H,{className:`h-4 w-4 animate-spin`}),(0,J.jsx)(p,{as:`span`,variant:`body-medium-lighter`,children:`Loading your plan...`})]}):(0,J.jsx)(p,{as:`p`,variant:`body-medium-lighter`,className:`text-[var(--content-tertiary)]`,"data-testid":`modal-pro-price-unavailable`,children:`Current plan pricing unavailable`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(p,{as:`p`,variant:`title-medium`,"data-testid":`modal-pro-price`,children:ie&&T!=null?(0,J.jsxs)(J.Fragment,{children:[V(T),E!=null&&E!==0&&(0,J.jsxs)(`span`,{className:`ml-1 text-[var(--content-tertiary)]`,children:[`(`,ue(E),`)`]})]}):w==null?e.id===`pro`?`From ${V(e.base_price_cents+ne(e.machine_tiers)+ne(e.storage_tiers))}`:null:`Currently ${V(w)}`}),ie&&E!=null&&E!==0&&(0,J.jsx)(`span`,{title:`Your Pro Plan subscription will change from ${V(w)} to ${V(T)}.`,children:(0,J.jsx)(ge,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),e.id===`pro`&&(0,J.jsxs)(p,{as:`p`,variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,"data-testid":`modal-pro-base-fee`,children:[F(e.base_price_cents),` base fee`]})]})}),(0,J.jsx)(Rr,{features:e.included_features,variant:`checklist`}),R&&!l&&(0,J.jsx)(p,{as:`p`,variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,"data-testid":`modal-credits-not-included`,children:`*Credits not included`})]}),(0,J.jsxs)(`div`,{className:`mt-4 flex flex-1 flex-col justify-end gap-4`,children:[!t&&R&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`hr`,{className:`border-t border-[var(--border-base)]`}),l&&(0,J.jsx)(Lr,{creditTiers:u,selectedCreditTier:d,onCreditTierChange:f,disabled:N}),(0,J.jsx)(B,{machineTiers:y,storageTiers:b,selectedMachineTier:h,selectedStorageTier:g,onMachineTierChange:_,onStorageTierChange:v}),(0,J.jsx)(i,{variant:`primary`,className:`w-full`,onClick:I,disabled:N||!h||!g,"data-testid":`modal-upgrade-to-pro-button`,children:`Upgrade to Pro`})]}),ae&&(D?(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:[(0,J.jsx)(H,{className:`h-4 w-4 animate-spin`}),(0,J.jsx)(p,{as:`span`,variant:`body-medium-lighter`,children:`Loading your plan...`})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`hr`,{className:`border-t border-[var(--border-base)]`}),l&&(0,J.jsx)(Lr,{creditTiers:u,selectedCreditTier:d,onCreditTierChange:f,disabled:O}),(0,J.jsx)(B,{machineTiers:y,storageTiers:b,selectedMachineTier:h,selectedStorageTier:g,onMachineTierChange:_,onStorageTierChange:v,currentMachinePriceCents:x,currentStoragePriceCents:S}),M&&(0,J.jsx)(U,{tone:`error`,children:M}),(0,J.jsx)(i,{variant:`primary`,className:`w-full`,onClick:L,disabled:O||!k&&!A&&!j,"data-testid":`modal-change-tier-button`,children:`Update Plan`})]})),!t&&z&&n&&!r&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`hr`,{className:`border-t border-[var(--border-base)]`}),(0,J.jsx)(i,{variant:`outlined`,className:`w-full`,onClick:ee,disabled:P,"data-testid":`modal-downgrade-to-base-button`,children:`Downgrade to Base`})]}),re&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`hr`,{className:`border-t border-[var(--border-base)]`}),(0,J.jsx)(i,{variant:`outlined`,className:`w-full`,onClick:te,disabled:P,"data-testid":`modal-keep-plan-button`,children:`Keep your Plan`})]})]})]})})}function Br({open:e,onClose:t,onTierUpgraded:n}){let r=l(),a=u(Ze()),o=u(bt()),s=d(mt()),c=d(xt()),f=d(yt()),m=d(Tt()),h=k(C(o.data)),[_,v]=(0,K.useState)(`plans`),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(null),[w,E]=(0,K.useState)(null),[O,A]=(0,K.useState)(void 0);(0,K.useEffect)(()=>Ke(()=>{r.invalidateQueries({queryKey:Et()}),r.invalidateQueries({queryKey:ht()}),r.invalidateQueries({queryKey:pt()}),t()}),[r,t]);let P=o.data?.plan_id,F=P===`pro`,I=u({...wt(),enabled:F}),L=I.data?.max_machine_tier??null,ne=I.data?.selected_storage_tier??null,R=I.data?.selected_storage_gib??null,z=o.data?.cancel_at_period_end===!0||!!o.data?.cancel_at,re=o.data?.status===`canceled`,ie=T(o.data),ae=o.data?.status,se=ae!=null&&ee.has(ae),ce=F&&se&&!z&&!re,B=a.data?.plans.find(e=>e.id===`pro`),le=B?.credit_tiers??[],V=le.length>0,ue=o.data?.selected_credit_tier??null,de=e=>le.find(t=>t.tier===e)?.price_cents??0,fe=de(ue),pe=ue!=null&&!le.some(e=>e.tier===ue),me=O===void 0?ue:O,he=de(me),ge=B?.machine_tiers??[],_e=ce&&R!=null?(B?.storage_tiers??[]).map(e=>e.storage_gib<R?{...e,disabled:!0}:e):B?.storage_tiers??[];(0,K.useEffect)(()=>{if(!e){S(null),E(null),A(void 0);return}if(B){if(ce){if(L==null||ne==null)return;S(e=>N(ge,e??L)),E(e=>N(_e,e??ne)),A(e=>te(le,e,ue));return}S(e=>N(B.machine_tiers,e)),E(e=>N(B.storage_tiers,e)),A(e=>te(le,e,null))}},[e,B,ce,L,ne,ue]);let ye=a.data?.plans.find(e=>e.id===`base`),be=new Set(ye?.included_features??[]),xe=(B?.included_features??[]).filter(e=>!be.has(e)),Se=()=>{if(!s.isPending){if(!x||!w){G.error(`Pick a machine and storage tier to continue.`,{id:`pro-upgrade-error`});return}s.mutate({body:{target_plan_id:`pro`,confirm:!0,machine_tier:x,storage_tier:w,credit_tier:me,return_target:j()}},{onSuccess:e=>{if(e.checkout_url){D({kind:`custom`,machineTier:x,storageTier:w,creditTier:me}),Ge(e.checkout_url);return}if(e.status===`no_op`){G.info(`You're already on Pro.`,{id:`pro-upgrade`}),t();return}G.error(e.message??`Failed to start upgrade. Please try again.`,{id:`pro-upgrade-error`})},onError:e=>{G.error(oe(e,`Failed to start upgrade. Please try again.`),{id:`pro-upgrade-error`})}})}},Ce=()=>{h.isPending||(v(`plans`),h.mutate({}))},we=()=>{r.invalidateQueries({queryKey:Et()}),r.invalidateQueries({queryKey:pt()}),r.invalidateQueries({queryKey:ht()})},Te=c.isPending||f.isPending||m.isPending,Ee=x!=null&&x!==L,De=w!=null&&w!==ne,Oe=V&&O!==void 0&&O!==ue,ke=e=>ge.find(t=>t.tier===e)?.price_cents??null,Ae=e=>_e.find(t=>t.tier===e)?.price_cents??null,je=ke(x),Me=Ae(w),Ne=ke(L),Pe=Ae(ne),Fe=Ee&&je!=null&&Ne!=null&&je<Ne,Ie=()=>{if(Te)return;let e=[];Ee&&x&&e.push(new Promise(e=>{c.mutate({body:{machine_tier:x}},{onSuccess:()=>e({dimension:`machine`,ok:!0}),onError:t=>e({dimension:`machine`,ok:!1,error:t})})})),De&&w&&e.push(new Promise(e=>{f.mutate({body:{storage_tier:w}},{onSuccess:()=>e({dimension:`storage`,ok:!0}),onError:t=>e({dimension:`storage`,ok:!1,error:t})})})),Oe&&e.push(new Promise(e=>{m.mutate({body:{credit_tier:me}},{onSuccess:()=>e({dimension:`credit`,ok:!0}),onError:t=>e({dimension:`credit`,ok:!1,error:t})})})),Promise.all(e).then(e=>{we();let r=e.some(e=>e.ok&&e.dimension===`storage`),i=e.some(e=>e.ok&&e.dimension===`machine`)&&!Fe,a=(r||i)&&!!n,o=e.filter(e=>!e.ok);if(o.length>0){let e=o.map(e=>oe(e.error,`Failed to update ${e.dimension} tier.`)).join(` `);G.error(e,{id:`pro-tier-change-error`}),a&&(t(),n());return}a?(t(),n()):G.success(Oe&&!Ee&&!De?`Credit bundle updated.`:`Plan updated.`,{id:`pro-tier-change`})})},Le=()=>{if(!Te){if(Fe){b(!0);return}Ie()}},Re=()=>{b(!1),Ie()},ze=e=>je!=null&&Me!=null?e.base_price_cents+je+Me+he:null,Be=e=>Ne!=null&&Pe!=null?e.base_price_cents+Ne+Pe+fe:null,Ve=c.isError||f.isError||m.isError?oe(c.error??f.error??m.error,`Failed to update plan. Please try again.`):null,He=a.isLoading||o.isLoading,Ue=a.isError||o.isError||!a.data||!o.data;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(W.Root,{open:e,onOpenChange:e=>{e||(v(`plans`),t())},children:(0,J.jsx)(W.Content,{size:_===`plans`?`lg`:`md`,children:_===`downgrade-confirm`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(W.Header,{children:(0,J.jsx)(W.Title,{icon:ve,children:`Downgrade to Base?`})}),(0,J.jsxs)(W.Body,{children:[(0,J.jsx)(p,{as:`p`,variant:`body-medium-default`,className:`text-(--content-secondary)`,children:`Downgrading removes the following Pro features:`}),(0,J.jsx)(`ul`,{className:`mt-4 list-disc space-y-2 pl-5`,children:xe.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsx)(p,{as:`span`,variant:`body-medium-default`,children:e})},e))})]}),(0,J.jsxs)(W.Footer,{children:[(0,J.jsx)(i,{variant:`ghost`,onClick:()=>v(`plans`),disabled:h.isPending,leftIcon:(0,J.jsx)(g,{className:`h-4 w-4`}),children:`Back`}),(0,J.jsx)(i,{variant:`danger`,onClick:Ce,disabled:h.isPending,"data-testid":`confirm-downgrade-button`,children:`Confirm Downgrade`})]})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(W.Header,{children:(0,J.jsx)(W.Title,{className:`sr-only`,children:`Upgrade Plan`})}),(0,J.jsx)(W.Body,{children:He?(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,J.jsx)(H,{className:`h-4 w-4 animate-spin`}),(0,J.jsx)(p,{as:`span`,variant:`body-medium-lighter`,children:`Loading plans...`})]}):Ue?(0,J.jsx)(U,{tone:`error`,children:`Failed to load plans. Please try again later.`}):(0,J.jsxs)(`div`,{className:`space-y-4 sm:space-y-6`,children:[(0,J.jsxs)(`div`,{className:`space-y-2 pb-2 pt-4 text-center`,children:[(0,J.jsx)(p,{as:`p`,variant:`title-medium`,children:`Your Assistant, Your Way`}),(0,J.jsx)(p,{as:`p`,variant:`body-medium-lighter`,className:`text-[var(--content-secondary)]`,children:`Choose the plan that works best for you and your assistant.`})]}),(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:a.data.plans.map(e=>{let t=e.id===P,n=e.id===`pro`&&B?ze(B):null,r=e.id===`pro`&&B?Be(B):null;return(0,J.jsx)(zr,{plan:e,isCurrent:t,onPro:F,cancelAtPeriodEnd:z,isCanceled:re,cancelDate:ie,formatGraceDate:M,proTierChangeMode:ce,creditTiersEnabled:V,creditTiers:le,displayCreditTier:me,onCreditTierChange:A,selectedMachineTier:x,selectedStorageTier:w,onMachineTierChange:S,onStorageTierChange:E,machineTiersForPicker:ge,storageTiersForPicker:_e,currentMachinePrice:Ne,currentStoragePrice:Pe,currentCreditPriceUnknown:pe,proCurrentTotalCents:r,proLiveTotalCents:n,proTotalDelta:n!=null&&r!=null?n-r:null,onboardingLoading:I.isLoading,tierChangePending:Te,machineChanged:Ee,storageChanged:De,creditChanged:Oe,tierChangeError:Ve,upgradePending:s.isPending,portalPending:h.isPending,onUpgrade:Se,onApplyTierChange:Le,onDowngradeClick:()=>v(`downgrade-confirm`),onKeepPlan:()=>h.mutate({})},e.id)})})]})}),(0,J.jsxs)(W.Footer,{className:`relative items-center`,children:[(0,J.jsx)(p,{as:`p`,variant:`body-small-default`,className:`pointer-events-none absolute inset-x-0 text-center text-[var(--content-tertiary)]`,children:(0,J.jsx)(`span`,{className:`pointer-events-auto`,children:`You can change or cancel your plan at any time from billing settings.`})}),(0,J.jsx)(`div`,{className:`ml-auto`,children:(0,J.jsx)(i,{variant:`outlined`,onClick:t,"data-testid":`modal-cancel-button`,children:`Cancel`})})]})]})})}),(0,J.jsx)(Pr,{open:y,onCancel:()=>b(!1),onConfirm:Re,confirming:Te,lostFeatures:[`Reduced CPU and memory for your assistant — it will resize to the smaller compute profile.`]})]})}function Vr({open:e,confirming:t,onCancel:n,onConfirm:r}){return(0,J.jsx)(Ee,{open:e,title:`Disable automatic top-ups?`,message:`Auto top-ups will stop. Any saved payment method stays on file.`,confirmLabel:t?`Disabling…`:`Disable`,cancelLabel:`Keep enabled`,destructive:!0,onConfirm:r,onCancel:n})}var Hr={threshold_usd:`100`,amount_usd:`10`,monthly_cap_usd:``};function Ur(e){if(e===``||e===`-`)return e;let t=parseFloat(e);return Number.isFinite(t)?String(Math.trunc(t)):``}function Wr(e){let t={},n=parseFloat(e.threshold_usd),r=parseFloat(e.amount_usd);if((!Number.isFinite(r)||r<10||r>500)&&(t.amount_usd=`Must be between $10 and $500`),(!Number.isFinite(n)||n<1||n>100)&&(t.threshold_usd=`Must be between $1 and $100`),e.monthly_cap_usd!==``){let n=parseFloat(e.monthly_cap_usd);!Number.isFinite(n)||n<25||n>1e4?t.monthly_cap_usd=`Must be between $25 and $10,000`:Number.isFinite(r)&&n<r&&(t.monthly_cap_usd=`Must be at least the top-up amount`)}return t}function Gr(e,t,n,r){if(n[e])return n[e];if(r)return t[e]}function Kr({initialValues:e=Hr,submitting:t,serverErrors:n,onSave:r,onCancel:a}){let[o,s]=(0,K.useState)(e),[c,l]=(0,K.useState)({threshold_usd:!1,amount_usd:!1,monthly_cap_usd:!1}),u=Wr(o),d=e=>t=>{s(n=>({...n,[e]:t.target.value}))},f=e=>()=>{l(t=>({...t,[e]:!0})),s(t=>({...t,[e]:Ur(t[e])}))},p=e=>Gr(e,u,n,c[e]);return(0,J.jsx)(`div`,{className:`mt-4`,children:(0,J.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,J.jsx)(`div`,{className:`min-w-[10rem] flex-1`,children:(0,J.jsx)(we,{type:`number`,step:`1`,label:`Auto-reload when balance below`,value:o.threshold_usd,onChange:d(`threshold_usd`),onBlur:f(`threshold_usd`),errorText:p(`threshold_usd`),"data-testid":`auto-top-up-threshold-input`,fullWidth:!0})}),(0,J.jsx)(`div`,{className:`min-w-[10rem] flex-1`,children:(0,J.jsx)(we,{type:`number`,step:`1`,label:`Auto-reload amount`,value:o.amount_usd,onChange:d(`amount_usd`),onBlur:f(`amount_usd`),errorText:p(`amount_usd`),"data-testid":`auto-top-up-amount-input`,fullWidth:!0})}),(0,J.jsx)(`div`,{className:`min-w-[10rem] flex-1`,children:(0,J.jsx)(we,{type:`number`,step:`1`,label:`Monthly spending cap`,helperText:`Pauses auto top-ups for the rest of the month once spending reaches this amount. Manual purchases also count toward the total. Leave empty for no limit.`,value:o.monthly_cap_usd,onChange:d(`monthly_cap_usd`),onBlur:f(`monthly_cap_usd`),errorText:p(`monthly_cap_usd`),"data-testid":`auto-top-up-cap-input`,fullWidth:!0})}),(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 pt-[18px]`,children:[(0,J.jsx)(i,{variant:`outlined`,onClick:a,disabled:t,children:`Cancel`}),(0,J.jsx)(i,{variant:`primary`,onClick:()=>{l({threshold_usd:!0,amount_usd:!0,monthly_cap_usd:!0});let e={threshold_usd:Ur(o.threshold_usd),amount_usd:Ur(o.amount_usd),monthly_cap_usd:Ur(o.monthly_cap_usd)};s(e);let t=Wr(e);if(Object.keys(t).length!==0)return;let n=e=>e===``?``:`${parseInt(e,10)}.00`;r({threshold_usd:n(e.threshold_usd),amount_usd:n(e.amount_usd),monthly_cap_usd:e.monthly_cap_usd===``?``:n(e.monthly_cap_usd)})},disabled:t,"data-testid":`auto-top-up-save-button`,children:`Save`})]})]})})}var qr=t(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Jr=t(((e,t)=>{var n=qr();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),X=e(t(((e,t)=>{t.exports=Jr()()}))(),1);function Yr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Yr(Object(n),!0).forEach(function(t){Qr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Zr(e){"@babel/helpers - typeof";return Zr=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Zr(e)}function Qr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $r(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function ei(e,t){if(e==null)return{};var n=$r(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ti(e,t){return ni(e)||ri(e,t)||ii(e,t)||oi()}function ni(e){if(Array.isArray(e))return e}function ri(e,t){var n=e&&(typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`]);if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function ii(e,t){if(e){if(typeof e==`string`)return ai(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ai(e,t)}}function ai(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oi(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Z=function(e,t,n){var r=!!n,i=K.useRef(n);K.useEffect(function(){i.current=n},[n]),K.useEffect(function(){if(!r||!e)return function(){};var n=function(){i.current&&i.current.apply(i,arguments)};return e.on(t,n),function(){e.off(t,n)}},[r,t,e,i])},si=function(e){var t=K.useRef(e);return K.useEffect(function(){t.current=e},[e]),t.current},ci=function(e){return e!==null&&Zr(e)===`object`},li=function(e){return ci(e)&&typeof e.then==`function`},ui=function(e){return ci(e)&&typeof e.elements==`function`&&typeof e.createToken==`function`&&typeof e.createPaymentMethod==`function`&&typeof e.confirmCardPayment==`function`},di=`[object Object]`,fi=function e(t,n){if(!ci(t)||!ci(n))return t===n;var r=Array.isArray(t);if(r!==Array.isArray(n))return!1;var i=Object.prototype.toString.call(t)===di;if(i!==(Object.prototype.toString.call(n)===di))return!1;if(!i&&!r)return t===n;var a=Object.keys(t),o=Object.keys(n);if(a.length!==o.length)return!1;for(var s={},c=0;c<a.length;c+=1)s[a[c]]=!0;for(var l=0;l<o.length;l+=1)s[o[l]]=!0;var u=Object.keys(s);if(u.length!==a.length)return!1;var d=t,f=n;return u.every(function(t){return e(d[t],f[t])})},pi=function(e,t,n){return ci(e)?Object.keys(e).reduce(function(r,i){var a=!ci(t)||!fi(e[i],t[i]);return n.includes(i)?(a&&console.warn(`Unsupported prop change: options.${i} is not a mutable property.`),r):a?Xr(Xr({},r||{}),{},Qr({},i,e[i])):r},null):null},mi="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",hi=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mi;if(e===null||ui(e))return e;throw Error(t)},gi=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mi;if(li(e))return{tag:`async`,stripePromise:Promise.resolve(e).then(function(e){return hi(e,t)})};var n=hi(e,t);return n===null?{tag:`empty`}:{tag:`sync`,stripe:n}},_i=function(e){!e||!e._registerWrapper||!e.registerAppInfo||(e._registerWrapper({name:`react-stripe-js`,version:`6.4.0`}),e.registerAppInfo({name:`react-stripe-js`,version:`6.4.0`,url:`https://stripe.com/docs/stripe-js/react`}))},vi=K.createContext(null);vi.displayName=`ElementsContext`;var yi=function(e,t){if(!e)throw Error(`Could not find Elements context; You need to wrap the part of your app that ${t} in an <Elements> provider.`);return e},bi=function(e){var t=e.stripe,n=e.options,r=e.children,i=K.useMemo(function(){return gi(t)},[t]),a=ti(K.useState(function(){return{stripe:i.tag===`sync`?i.stripe:null,elements:i.tag===`sync`?i.stripe.elements(n):null}}),2),o=a[0],s=a[1];K.useEffect(function(){var e=!0,t=function(e){s(function(t){return t.stripe?t:{stripe:e,elements:e.elements(n)}})};return i.tag===`async`&&!o.stripe?i.stripePromise.then(function(n){n&&e&&t(n)}):i.tag===`sync`&&!o.stripe&&t(i.stripe),function(){e=!1}},[i,o,n]);var c=si(t);K.useEffect(function(){c!==null&&c!==t&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[c,t]);var l=si(n);return K.useEffect(function(){if(o.elements){var e=pi(n,l,[`clientSecret`,`fonts`]);e&&o.elements.update(e)}},[n,l,o.elements]),K.useEffect(function(){_i(o.stripe)},[o.stripe]),K.createElement(vi.Provider,{value:o},r)};bi.propTypes={stripe:X.default.any,options:X.default.object};var xi=function(e){return yi(K.useContext(vi),e)},Si=function(e){var t=e.children;return t(xi(`mounts <ElementsConsumer>`))};Si.propTypes={children:X.default.func.isRequired};var Ci=K.createContext(null);Ci.displayName=`CheckoutContext`;var wi=function(e){var t=K.useContext(Ci),n=K.useContext(vi);if(t){if(n)throw Error(`You cannot wrap the part of your app that ${e} in both a checkout provider and <Elements> provider.`);return t}else return yi(n,e)},Ti=[`mode`],Ei=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Q=function(e,t,n){var r=`${Ei(e)}Element`,i=t?function(e){wi(`mounts <${r}>`);var t=e.id,n=e.className;return K.createElement(`div`,{id:t,className:n})}:function(t){var n=t.id,i=t.className,a=t.options,o=a===void 0?{}:a,s=t.onBlur,c=t.onFocus,l=t.onReady,u=t.onChange,d=t.onEscape,f=t.onClick,p=t.onLoadError,m=t.onLoaderStart,h=t.onNetworksChange,g=t.onConfirm,_=t.onCancel,v=t.onShippingAddressChange,y=t.onShippingRateChange,b=t.onSavedPaymentMethodRemove,x=t.onSavedPaymentMethodUpdate,S=t.onAvailablePaymentMethodsChange,C=wi(`mounts <${r}>`),w=`elements`in C?C.elements:null,T=`checkoutState`in C?C.checkoutState:null,E=T?.type===`success`||T?.type===`loading`?T.sdk:null,D=ti(K.useState(null),2),O=D[0],k=D[1],A=K.useRef(null),j=K.useRef(null);Z(O,`blur`,s),Z(O,`focus`,c),Z(O,`escape`,d),Z(O,`click`,f),Z(O,`loaderror`,p),Z(O,`loaderstart`,m),Z(O,`networkschange`,h),Z(O,`confirm`,g),Z(O,`cancel`,_),Z(O,`shippingaddresschange`,v),Z(O,`shippingratechange`,y),Z(O,`savedpaymentmethodremove`,b),Z(O,`savedpaymentmethodupdate`,x),Z(O,`availablepaymentmethodschange`,S),Z(O,`change`,u);var M;l&&(M=e===`expressCheckout`?l:function(){l(O)}),Z(O,`ready`,M),K.useLayoutEffect(function(){if(A.current===null&&j.current!==null&&(w||E)){var t=null;if(E){var n=E,i=E;switch(e){case`paymentForm`:t=i.createForm(o);break;case`payment`:t=n.createPaymentElement(o);break;case`address`:if(`mode`in o){var a=o.mode,s=ei(o,Ti);if(a===`shipping`)t=n.createShippingAddressElement(s);else if(a===`billing`)t=n.createBillingAddressElement(s);else throw Error(`Invalid options.mode. mode must be 'billing' or 'shipping'.`)}else throw Error(`You must supply options.mode. mode must be 'billing' or 'shipping'.`);break;case`expressCheckout`:t=n.createExpressCheckoutElement(o);break;case`currencySelector`:t=E.createCurrencySelectorElement();break;case`taxId`:t=n.createTaxIdElement(o);break;case`contactDetails`:t=n.createContactDetailsElement();break;default:throw Error(`<${r}> is not supported inside a checkout provider. Use an <Elements> provider instead.`)}}else w&&(t=w.create(e,o));A.current=t,k(t),t&&t.mount(j.current)}},[w,E,o]);var N=si(o);return K.useEffect(function(){if(A.current){var e=pi(o,N,[`paymentRequest`]);e&&`update`in A.current&&A.current.update(e)}},[o,N]),K.useLayoutEffect(function(){return function(){if(A.current&&typeof A.current.destroy==`function`)try{A.current.destroy(),A.current=null}catch{}}},[]),K.createElement(`div`,{id:n,className:i,ref:j})};return i.propTypes={id:X.default.string,className:X.default.string,onChange:X.default.func,onBlur:X.default.func,onFocus:X.default.func,onReady:X.default.func,onEscape:X.default.func,onClick:X.default.func,onLoadError:X.default.func,onLoaderStart:X.default.func,onNetworksChange:X.default.func,onConfirm:X.default.func,onCancel:X.default.func,onShippingAddressChange:X.default.func,onShippingRateChange:X.default.func,onSavedPaymentMethodRemove:X.default.func,onSavedPaymentMethodUpdate:X.default.func,onAvailablePaymentMethodsChange:X.default.func,options:X.default.object},i.displayName=r,i.__elementType=e,i},$=typeof window>`u`,Di=K.createContext(null);Di.displayName=`EmbeddedCheckoutProviderContext`,Q(`auBankAccount`,$),Q(`card`,$),Q(`cardNumber`,$),Q(`cardExpiry`,$),Q(`cardCvc`,$),Q(`iban`,$),Q(`payment`,$),Q(`expressCheckout`,$),Q(`paymentRequestButton`,$),Q(`linkAuthentication`,$),Q(`contactDetails`,$),Q(`address`,$),Q(`shippingAddress`,$),Q(`paymentMethodMessaging`,$),Q(`taxId`,$),Q(`issuingCardNumberDisplay`,$),Q(`issuingCardCvcDisplay`,$),Q(`issuingCardExpiryDisplay`,$),Q(`issuingCardPinDisplay`,$),Q(`issuingCardCopyButton`,$);var Oi=`dahlia`,ki=`https://js.stripe.com`,Ai=`${ki}/${Oi}/stripe.js`,ji=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Mi=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,Ni=`loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used`,Pi=function(e){return ji.test(e)||Mi.test(e)},Fi=function(){for(var e=document.querySelectorAll(`script[src^="${ki}"]`),t=0;t<e.length;t++){var n=e[t];if(Pi(n.src))return n}return null},Ii=function(e){var t=e&&!e.advancedFraudSignals?`?advancedFraudSignals=false`:``,n=document.createElement(`script`);n.src=`${Ai}${t}`;var r=document.head||document.body;if(!r)throw Error(`Expected document.body not to be null. Stripe.js requires a <body> element.`);return r.appendChild(n),n},Li=null,Ri=null,zi=null,Bi=function(e){return function(t){e(Error(`Failed to load Stripe.js`,{cause:t}))}},Vi=function(e,t){return function(){window.Stripe?e(window.Stripe):t(Error(`Stripe.js not available`))}},Hi=function(e){return Li===null?(Li=new Promise(function(t,n){if(typeof window>`u`||typeof document>`u`){t(null);return}if(window.Stripe&&e&&console.warn(Ni),window.Stripe){t(window.Stripe);return}try{var r=Fi();if(r&&e)console.warn(Ni);else if(!r)r=Ii(e);else if(r&&zi!==null&&Ri!==null){var i;r.removeEventListener(`load`,zi),r.removeEventListener(`error`,Ri),(i=r.parentNode)==null||i.removeChild(r),r=Ii(e)}zi=Vi(t,n),Ri=Bi(n),r.addEventListener(`load`,zi),r.addEventListener(`error`,Ri)}catch(e){n(e);return}}),Li.catch(function(e){return Li=null,Promise.reject(e)})):Li},Ui,Wi=!1,Gi=function(){return Ui||(Ui=Hi(null).catch(function(e){return Ui=null,Promise.reject(e)}),Ui)};Promise.resolve().then(function(){return Gi()}).catch(function(e){Wi||console.warn(e)});function Ki(){return typeof document<`u`&&document.documentElement.classList.contains(`dark`)?{theme:`night`}:{theme:`stripe`}}function qi({open:e,onClose:t,onSavedOptimistic:n}){let r=d(et()),{mutate:i,reset:a}=r;return(0,K.useEffect)(()=>{e||a()},[e,i,a]),(0,K.useMemo)(()=>Ki(),[r.data?.client_secret??null]),(0,J.jsx)(W.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,J.jsxs)(W.Content,{size:`sm`,children:[(0,J.jsx)(W.Header,{children:(0,J.jsx)(W.Title,{children:`Save Payment Method`})}),(0,J.jsx)(W.Body,{className:`min-h-[260px]`,children:(0,J.jsx)(Ji,{})})]})})}function Ji(){return(0,K.useEffect)(()=>{console.warn(`[AutoTopUpPaymentMethodModal] VITE_STRIPE_PUBLISHABLE_KEY is not set; the payment-method modal cannot mount Stripe Elements.`)},[]),(0,J.jsx)(U,{tone:`error`,children:`Payment method setup is currently unavailable. Please try again later.`})}var Yi={visa:`Visa`,mastercard:`Mastercard`,amex:`Amex`,discover:`Discover`,diners:`Diners Club`,jcb:`JCB`,unionpay:`UnionPay`};function Xi(e){return Yi[e.toLowerCase()]??e}function Zi({brand:e,last4:t,onUpdateCard:n,onRemove:r,removing:a=!1}){return(0,J.jsxs)(`div`,{"data-testid":`payment-method-row`,className:`flex items-center justify-between gap-2 rounded-lg bg-[var(--surface-base)] pl-3 pr-2 py-1.5`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(pe,{"aria-hidden":!0,className:`h-4 w-4 shrink-0 text-[var(--content-default)]`}),(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(p,{as:`p`,variant:`body-medium-default`,className:`truncate text-[var(--content-default)]`,children:e?Xi(e):`Saved card`}),t!=null&&(0,J.jsxs)(p,{as:`p`,variant:`body-small-default`,className:`truncate text-[var(--content-tertiary)]`,children:[`Ending in `,t]})]})]}),(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,J.jsx)(i,{variant:`outlined`,onClick:n,"data-testid":`payment-method-update`,children:`Update Card`}),(0,J.jsx)(i,{variant:`dangerOutline`,onClick:r,disabled:a,"data-testid":`payment-method-remove`,children:a?`Removing…`:`Remove`})]})]})}function Qi(e){if(!e)return``;let t=parseFloat(e);return Number.isFinite(t)?String(Math.trunc(t)):``}function $i(e){if(!e)return`$0`;let t=parseFloat(e);if(!Number.isFinite(t))return`$0`;let n=Math.abs(t).toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2}),r=n.endsWith(`.00`)?n.slice(0,-3):n;return t<0?`-$${r}`:`$${r}`}var ea={enabled:!1,threshold_usd:null,amount_usd:null,monthly_cap_usd:null,has_payment_method:!1,payment_method_brand:null,payment_method_last4:null,stripe_payment_method_updated_at:null,last_charge_at:null,last_failure_at:null,last_failure_reason:null,disabled_due_to_repeated_failures:!1,paused_until:null,current_month_credits_purchased_usd:`0.00`,current_month_charged_usd:`0.00`,next_trigger_amount_usd:null,stubbed:!1};function ta(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t={};for(let[n,r]of Object.entries(e))Array.isArray(r)&&typeof r[0]==`string`&&(t[n]=r[0]);return t}function na({testId:e,children:t}){return(0,J.jsx)(`div`,{"data-testid":e,className:`flex h-8 min-w-0 flex-1 items-center gap-1.5 rounded-lg bg-[var(--surface-base)] px-2`,children:t})}function ra(){let e=l(),t=u(Ot()),n=d(st()),r=d(rt()),a=d(ot()),[s,c]=o(),f=(0,K.useRef)(null),[m,h]=(0,K.useState)(`view`),[g,_]=(0,K.useState)(!1),[v,y]=(0,K.useState)(!1),[b,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(!1),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(!1);(0,K.useEffect)(()=>{C&&t.data?.has_payment_method&&w(!1)},[C,t.data?.has_payment_method]);let k=()=>{n.reset(),r.reset(),h(`form`)},A=e=>{if(_(!0),!e.has_payment_method||e.disabled_due_to_repeated_failures===!0){w(!0),E(!1);return}w(!1),k()},j=s.get(`configure_top_up`)===`1`;if((0,K.useEffect)(()=>{if(!j||t.data==null)return;let e=new URLSearchParams(s);e.delete(`configure_top_up`),c(e,{replace:!0});let n=t.data;if(n.enabled===!0)return;A(n);let r=typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0;f.current?.scrollIntoView({behavior:r?`auto`:`smooth`,block:`center`})},[j,t.data]),t.isLoading)return(0,J.jsx)(`div`,{"data-testid":`auto-top-up-card`,children:(0,J.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`})});if(t.isError||!t.data)return(0,J.jsx)(`div`,{"data-testid":`auto-top-up-card`,children:(0,J.jsx)(U,{tone:`error`,children:`Failed to load auto top-up configuration.`})});let M=t.data,N=M.enabled===!0,P=M.disabled_due_to_repeated_failures===!0&&!N,F=()=>{h(`view`),_(!1)},I=()=>{r.reset(),y(!1)},L=t=>{n.mutate({body:{enabled:!0,threshold_usd:t.threshold_usd,amount_usd:t.amount_usd,monthly_cap_usd:t.monthly_cap_usd===``?null:t.monthly_cap_usd}},{onSuccess:t=>{ct(e,void 0,e=>({...t,payment_method_brand:e?.payment_method_brand??null,payment_method_last4:e?.payment_method_last4??null})),e.invalidateQueries({queryKey:Qe()}),F()}})},ee=()=>{r.mutate({},{onSuccess:()=>{ct(e,void 0,e=>({...ea,has_payment_method:e?.has_payment_method??!1,payment_method_brand:e?.payment_method_brand??null,payment_method_last4:e?.payment_method_last4??null,stripe_payment_method_updated_at:e?.stripe_payment_method_updated_at??null})),y(!1),h(`view`),_(!1)}})},te=()=>{a.mutate({},{onSuccess:()=>{ct(e,void 0,{...M,enabled:!1,has_payment_method:!1,payment_method_brand:null,payment_method_last4:null}),e.invalidateQueries({queryKey:Qe()}),S(!1),F()},onError:()=>{S(!1)}})},ne=e=>{if(e&&!N){A(M);return}if(!e&&!N&&g){w(!1),F();return}!e&&N&&y(!0)},R=async()=>{let t=Date.now(),n=M.stripe_payment_method_updated_at??null;try{await e.invalidateQueries({queryKey:Qe()})}catch{}for(;Date.now()-t<2e4;){try{let t=await e.fetchQuery(Ot());if(t.has_payment_method&&t.stripe_payment_method_updated_at!==n)break}catch{}await new Promise(e=>setTimeout(e,1500))}w(!1),g&&k()},z=m===`form`,re=ta(n.error),ie=n.isError&&Object.keys(re).length===0;return(0,J.jsxs)(`div`,{ref:f,"data-testid":`auto-top-up-card`,children:[(0,J.jsx)(`div`,{className:`flex items-center justify-between gap-4`,children:(0,J.jsx)(Te,{checked:N||g,onChange:ne,label:`Enable Extra Usage`})}),M.has_payment_method&&(0,J.jsx)(`div`,{className:`mt-3`,children:(0,J.jsx)(Zi,{brand:M.payment_method_brand,last4:M.payment_method_last4,onUpdateCard:()=>O(!0),onRemove:()=>S(!0),removing:a.isPending})}),N&&!z&&(0,J.jsxs)(`div`,{className:`mt-3 flex w-full items-center gap-2`,children:[(0,J.jsxs)(na,{testId:`auto-top-up-summary`,children:[(0,J.jsx)(x,{className:`h-3.5 w-3.5 shrink-0 text-[var(--content-default)]`,"aria-hidden":`true`}),(0,J.jsxs)(p,{variant:`body-medium-default`,className:`truncate text-[var(--content-default)]`,children:[`Add `,$i(M.amount_usd),` when balance falls under`,` `,$i(M.threshold_usd)]})]}),M.monthly_cap_usd!=null&&(0,J.jsx)(na,{testId:`auto-top-up-cap-progress`,children:(0,J.jsxs)(p,{variant:`body-medium-default`,className:`truncate text-[var(--content-default)]`,children:[(0,J.jsxs)(`span`,{children:[$i(M.current_month_credits_purchased_usd),` `]}),(0,J.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[`/ `,$i(M.monthly_cap_usd),` this month`]})]})}),(0,J.jsx)(i,{variant:`outlined`,onClick:k,"data-testid":`auto-top-up-edit-button`,className:`shrink-0`,children:`Adjust`})]}),P&&(0,J.jsx)(U,{tone:`warning`,className:`mt-3`,"data-testid":`auto-top-up-declined-cutoff`,actions:(0,J.jsx)(i,{variant:`outlined`,onClick:()=>O(!0),"data-testid":`auto-top-up-add-pm-button`,children:`Add payment method`}),children:`We paused automatic reloads after several declined payments. Add a new payment method to turn auto-reload back on.`}),(0,J.jsx)(`div`,{className:`grid transition-[grid-template-rows] duration-200 ease-in-out`,style:{gridTemplateRows:C&&!P?`1fr`:`0fr`},children:(0,J.jsx)(`div`,{className:`overflow-hidden`,children:(0,J.jsxs)(`div`,{className:`mt-3 flex flex-col gap-3`,children:[!T&&(0,J.jsxs)(`div`,{className:`flex h-8 items-center justify-between gap-3 rounded-lg bg-[var(--system-mid-weak)] px-2`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(ge,{className:`h-4 w-4 shrink-0 text-[var(--system-mid-strong)]`,"aria-hidden":`true`}),(0,J.jsx)(p,{variant:`body-medium-default`,className:`truncate text-[var(--system-mid-strong)]`,children:`Extra usage requires you to connect a credit card.`})]}),(0,J.jsx)(`button`,{type:`button`,"aria-label":`Dismiss`,onClick:()=>E(!0),className:`flex shrink-0 cursor-pointer items-center justify-center rounded p-0.5 text-[var(--system-mid-strong)] opacity-70 transition-opacity hover:opacity-100`,children:(0,J.jsx)(be,{className:`h-2.5 w-2.5`,strokeWidth:2,"aria-hidden":`true`})})]}),(0,J.jsx)(i,{variant:`primary`,onClick:()=>O(!0),"data-testid":`auto-top-up-add-pm-button`,className:`self-start`,children:`Add a Credit Card`})]})})}),ie&&(0,J.jsx)(U,{tone:`error`,className:`mt-4`,"data-testid":`auto-top-up-update-error`,children:`Failed to save automatic top-ups. Please try again.`}),r.isError&&(0,J.jsx)(U,{tone:`error`,className:`mt-4`,"data-testid":`auto-top-up-disable-error`,children:`Failed to disable automatic top-ups. Please try again.`}),a.isError&&(0,J.jsx)(U,{tone:`error`,className:`mt-4`,"data-testid":`auto-top-up-remove-error`,children:`Failed to remove the payment method. Please try again.`}),z&&(0,J.jsx)(Kr,{initialValues:N?{threshold_usd:Qi(M.threshold_usd),amount_usd:Qi(M.amount_usd),monthly_cap_usd:Qi(M.monthly_cap_usd)}:void 0,submitting:n.isPending,serverErrors:re,onCancel:F,onSave:L}),(N||z)&&(0,J.jsx)(U,{tone:`info`,className:`mt-4`,children:`If you're too close to your monthly limit, the auto-reload will only top up to that limit.`}),(0,J.jsx)(Vr,{open:v,confirming:r.isPending,onCancel:I,onConfirm:ee}),(0,J.jsx)(Ee,{open:b,title:`Remove payment method?`,message:`Removing your card will turn off Extra Usage.`,confirmLabel:a.isPending?`Removing…`:`Remove`,isPending:a.isPending,cancelLabel:`Keep card`,destructive:!0,onConfirm:te,onCancel:()=>S(!1)}),(0,J.jsx)(qi,{open:D,onClose:()=>O(!1),onSavedOptimistic:R})]})}function ia(e){let t=parseFloat(e);return Number.isFinite(t)?`$${t.toFixed(2)}`:`$${e}`}function aa(e){let t=e.trim();if(t===``)return`Enter a daily limit`;let n=parseFloat(t);if(!Number.isFinite(n)||n<1)return`Must be at least $1`;if(!/^\d+(\.\d{1,2})?$/.test(t))return`Use at most two decimal places`}function oa(){let e=l(),t=u(lt()),n=u(gt()),r=d(Ct()),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(!1),[f,p]=(0,K.useState)(!1);if(t.isLoading)return(0,J.jsx)(`div`,{"data-testid":`daily-credit-limit-card`,children:(0,J.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`})});if(t.isError||!t.data)return(0,J.jsx)(`div`,{"data-testid":`daily-credit-limit-card`,children:(0,J.jsx)(U,{tone:`error`,children:`Failed to load daily credit limit settings.`})});let m=t.data,h=m.daily_credit_limit_usd!=null,g=h||f,_=a??m.daily_credit_limit_usd??``,v=aa(_),y=n.data,b=y?.daily_spend_usd??m.current_day_spent_usd,x=y?.daily_limit_reached===!0,S=e=>{o(e.target.value)},C=t=>{r.mutate({body:{daily_credit_limit_usd:t}},{onSuccess:n=>{nt(e,void 0,n),e.invalidateQueries({queryKey:$e()}),e.invalidateQueries({queryKey:St()}),o(null),c(!1),t===null&&p(!1)}})},w=e=>{if(e){p(!0);return}p(!1),o(null),c(!1),h&&C(null)},T=()=>{c(!0),!v&&C(parseFloat(_.trim()).toFixed(2))},E=r.isError,D=s?v:void 0;return(0,J.jsxs)(`div`,{"data-testid":`daily-credit-limit-card`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsx)(Te,{checked:g,onChange:w,disabled:r.isPending,label:`Set a daily credit limit`}),g&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,J.jsx)(`div`,{className:`w-60 max-w-full`,children:(0,J.jsx)(we,{type:`number`,step:`0.01`,min:`1`,label:`Stop spending Vellum credits after`,helperText:`Per UTC day. Resets at midnight UTC.`,placeholder:`0.00`,value:_,onChange:S,onBlur:()=>c(!0),errorText:D,"data-testid":`daily-credit-limit-input`,fullWidth:!0})}),(0,J.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 pt-[18px]`,children:(0,J.jsx)(i,{variant:`primary`,onClick:T,disabled:r.isPending,"data-testid":`daily-credit-limit-save-button`,children:`Save`})})]}),h&&m.daily_credit_limit_usd!=null&&(0,J.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,"data-testid":`daily-credit-limit-progress`,children:[ia(b),` of `,ia(m.daily_credit_limit_usd),` `,`spent today`]}),x&&(0,J.jsx)(U,{tone:`warning`,"data-testid":`daily-credit-limit-reached`,children:`Today's Vellum credit spend has reached this limit. Generation resumes after midnight UTC or when you raise the limit.`})]})]}),(0,J.jsx)(`p`,{className:`mt-3 text-body-small-default text-[var(--content-tertiary)]`,children:`Applies to Vellum credit spend only. Usage billed to your own provider API keys isn't limited. Resets at midnight UTC.`}),E&&(0,J.jsx)(U,{tone:`error`,className:`mt-4`,"data-testid":`daily-credit-limit-update-error`,children:`Failed to save daily credit limit. Please try again.`})]})}function sa(e){let t=parseFloat(e);return Number.isFinite(t)?`$${t.toFixed(2)}`:`$${e}`}function ca(e){if(e.trim()===``)return;let t=parseFloat(e);if(!Number.isFinite(t)||t<1||t>1e3)return`Must be between $1 and $1,000`;if(!/^\d+(\.\d{1,2})?$/.test(e.trim()))return`Use at most two decimal places`}function la(){let e=l(),t=u(dt()),n=d(at()),[r,a]=(0,K.useState)(null),[o,s]=(0,K.useState)(!1);if(t.isLoading)return(0,J.jsx)(`div`,{"data-testid":`low-balance-alert-card`,children:(0,J.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`})});if(t.isError||!t.data)return(0,J.jsx)(`div`,{"data-testid":`low-balance-alert-card`,children:(0,J.jsx)(U,{tone:`error`,children:`Failed to load low-balance alert settings.`})});let c=t.data,f=r??c.threshold_usd??``,p=ca(f),m=e=>{a(e.target.value)},h=t=>{n.mutate({body:{threshold_usd:t}},{onSuccess:t=>{ft(e,void 0,t),e.invalidateQueries({queryKey:ut()}),a(null),s(!1)}})},g=()=>{if(s(!0),p)return;let e=f.trim();h(e===``?null:parseFloat(e).toFixed(2))},_=()=>{a(``),s(!1),h(null)},v=n.isError,y=o?p:void 0;return(0,J.jsxs)(`div`,{"data-testid":`low-balance-alert-card`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,J.jsx)(`div`,{className:`w-60 max-w-full`,children:(0,J.jsx)(we,{type:`number`,step:`0.01`,label:`Alert me when my balance drops below`,helperText:`Default is ${sa(c.default_threshold_usd)} when unset`,placeholder:c.effective_threshold_usd,value:f,onChange:m,onBlur:()=>s(!0),errorText:y,"data-testid":`low-balance-alert-input`,fullWidth:!0})}),(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 pt-[18px]`,children:[c.threshold_usd!=null&&(0,J.jsx)(i,{variant:`outlined`,onClick:_,disabled:n.isPending,"data-testid":`low-balance-alert-reset-button`,children:`Reset to default`}),(0,J.jsx)(i,{variant:`primary`,onClick:g,disabled:n.isPending,"data-testid":`low-balance-alert-save-button`,children:`Save`})]})]}),v&&(0,J.jsx)(U,{tone:`error`,className:`mt-4`,"data-testid":`low-balance-alert-update-error`,children:`Failed to save low-balance alert. Please try again.`})]})}function ua(e){return e.replace(/\.00$/,``)}function da({icon:e,value:t,label:n}){return(0,J.jsxs)(`div`,{className:`flex h-8 min-w-0 flex-1 items-center gap-1.5 rounded-lg bg-[var(--surface-base)] px-2 py-1.5`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center text-[var(--content-default)]`,children:e}),(0,J.jsx)(p,{variant:`body-medium-default`,as:`span`,className:`text-[var(--content-default)]`,children:t}),(0,J.jsx)(p,{variant:`body-small-default`,as:`span`,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:n})]})}function fa(){let{data:e,isLoading:t,isError:n}=u(Dt()),[r,a]=(0,K.useState)(!1),o=(0,K.useCallback)(e=>{navigator.clipboard.writeText(e).then(()=>{a(!0),G.success(`Copied to clipboard!`),setTimeout(()=>a(!1),2e3)})},[]),s=e?.is_eligible_for_credits===!1;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsx)(p,{as:`p`,variant:`body-medium-default`,className:`text-[var(--content-tertiary)]`,children:s?`Invite friends to Vellum. You'll start earning referral credits once you've purchased credits or upgraded to Pro.`:e?`Share Vellum with friends - you'll each earn ${ua(e.referrer_credit_amount)} credits when they sign up, up to ${ua(e.earning_cap)} total.`:`Share Vellum with friends and earn credits for every signup.`}),s&&(0,J.jsx)(p,{as:`p`,variant:`body-medium-default`,className:`text-[var(--content-tertiary)]`,children:`You're not currently earning referral credits. Buy credits or upgrade to Pro to start earning — your invite link still works in the meantime.`}),t?(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,J.jsx)(H,{className:`h-4 w-4 animate-spin`}),`Loading...`]}):n||!e?(0,J.jsx)(U,{tone:`error`,children:`Failed to load referral information.`}):(0,J.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,J.jsx)(da,{icon:(0,J.jsx)(x,{className:`h-3.5 w-3.5`}),value:ua(e.total_earned),label:`Credits Earned`}),(0,J.jsx)(da,{icon:(0,J.jsx)(ye,{className:`h-3.5 w-3.5`}),value:e.referred_count,label:`Friends Referred`}),(0,J.jsx)(i,{variant:`outlined`,className:`shrink-0`,onClick:()=>o(e.referral_url),leftIcon:r?(0,J.jsx)(_,{className:`h-3.5 w-3.5`}):(0,J.jsx)(fe,{className:`h-3.5 w-3.5`}),"data-testid":`referral-copy-button`,children:r?`Copied!`:`Share Link`})]})]})}function pa({open:e,onOpenChange:t}){return(0,J.jsx)(W.Root,{open:e,onOpenChange:t,children:(0,J.jsxs)(W.Content,{"data-testid":`referral-modal`,children:[(0,J.jsx)(W.Header,{children:(0,J.jsx)(W.Title,{children:`Earn Free Credits`})}),(0,J.jsx)(W.Body,{children:(0,J.jsx)(fa,{})})]})})}var ma=2e3;function ha(e){let t=parseFloat(e);if(Number.isNaN(t))return`0`;let n=Math.abs(t).toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2}),r=n.endsWith(`.00`)?n.slice(0,-3):n;return t<0?`-${r}`:r}function ga(){let e=l(),{data:t,isLoading:n,isError:r}=u(gt()),a=t??null,[o,s]=(0,K.useState)(!1),[c,d]=(0,K.useState)(!1),[f,h]=(0,K.useState)(!1),g=(0,K.useRef)(0),_=(0,K.useRef)(null),v=it({onSuccess:()=>{e.invalidateQueries({queryKey:St()})},onError:()=>{g.current<3&&(_.current=setTimeout(()=>{v.reset()},ma))}});(0,K.useEffect)(()=>()=>{_.current&&clearTimeout(_.current)},[]);let y=v.mutate;(0,K.useEffect)(()=>{a&&a.settled_balance===`0.00`&&a.pending_compute===`0.00`&&a.effective_balance===`0.00`&&g.current<3&&!v.isPending&&!v.isError&&!v.isSuccess&&(g.current+=1,y({}))},[a,v.isPending,v.isError,v.isSuccess,y]);let b=(0,J.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between sm:gap-4`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(p,{as:`h2`,variant:`title-medium`,className:`text-[var(--content-emphasised)]`,children:`Credit Balance`}),(0,J.jsx)(p,{as:`p`,variant:`body-medium-default`,className:`mt-2 text-[var(--content-tertiary)]`,children:`Quick overview of your balances and other things`})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(i,{variant:`outlined`,leftIcon:(0,J.jsx)(x,{className:`h-4 w-4`,"aria-hidden":!0}),onClick:()=>d(!0),"data-testid":`earn-credits-button`,children:`Earn Free Credits`}),(0,J.jsx)(i,{variant:`primary`,onClick:()=>s(!0),disabled:n||!a,"data-testid":`add-credits-button`,children:`Add Credits`})]})]});return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(m,{padding:`md`,children:[b,n?(0,J.jsxs)(`div`,{className:`mt-4 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,J.jsx)(H,{className:`h-4 w-4 animate-spin`}),`Loading billing summary...`]}):r?(0,J.jsx)(`div`,{className:`mt-4`,children:(0,J.jsx)(U,{tone:`error`,children:`Failed to load billing summary. Please try again later.`})}):a?(0,J.jsxs)(J.Fragment,{children:[(()=>{if(!a)return null;let e=parseFloat(a.effective_balance)<0;return(0,J.jsx)(`div`,{className:`mt-4`,children:(0,J.jsx)(Se,{icon:(0,J.jsx)(x,{className:`h-4 w-4`,"aria-hidden":!0}),value:(0,J.jsx)(`span`,{"data-testid":`effective-balance`,children:ha(a.effective_balance)}),label:`Balance`,tone:e?`negative`:`default`})})})(),a.is_degraded&&(0,J.jsx)(`div`,{className:`mt-4`,children:(0,J.jsx)(U,{tone:`warning`,children:`Pending charges could not be calculated. The balance shown may be incomplete.`})})]}):(0,J.jsx)(`p`,{className:`mt-4 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No billing information available.`}),(0,J.jsx)(`div`,{className:`mt-6`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsx)(Te,{checked:f,onChange:h,label:`Custom low balance alert`}),f&&(0,J.jsx)(la,{})]})}),(0,J.jsx)(`div`,{className:`mt-6 border-t border-[var(--border-base)] pt-6`,children:(0,J.jsx)(ra,{})}),(0,J.jsx)(`div`,{className:`mt-6 border-t border-[var(--border-base)] pt-6`,children:(0,J.jsx)(oa,{})})]}),(0,J.jsx)(Pt,{open:o,onOpenChange:s}),(0,J.jsx)(pa,{open:c,onOpenChange:d})]})}var _a=1e3,va=15e3,ya=3e3,ba=45e3,xa=`billing-portal-return`;function Sa(e,t){if(!e)return{kind:`info`,message:`Subscription updated.`};let n=e.cancel_at_period_end||!!e.cancel_at,r=t.cancel_at_period_end||!!t.cancel_at;return!n&&r?{kind:`info`,message:`Pro plan canceled. You'll have access until ${t.cancel_at?M(t.cancel_at):`the end of your billing period`}.`}:n&&!r?{kind:`success`,message:`Pro plan reactivated.`}:{kind:`info`,message:`Subscription updated.`}}function Ca(){let[e]=o(),t=c(),n=l(),r=(0,K.useRef)(null);return(0,K.useEffect)(()=>()=>{r.current!==null&&(clearInterval(r.current),r.current=null)},[]),(0,K.useEffect)(()=>{if(e.get(`portal_return`)!==`true`)return;let i={current:!1},a=w(),o=bt(),s=Et(),c=Date.now();async function l(){await n.invalidateQueries({queryKey:s});let e=await n.fetchQuery(o);return{cancel_at_period_end:e.cancel_at_period_end,cancel_at:e.cancel_at}}async function u(){let e=await l();for(;!i.current&&a&&e.cancel_at_period_end===a.cancel_at_period_end&&e.cancel_at===a.cancel_at&&Date.now()-c<va&&(await new Promise(e=>setTimeout(e,_a)),!i.current);)e=await l();return e}return(async()=>{try{let e=await u();if(i.current)return;let{kind:t,message:n}=Sa(a,e);t===`success`?G.success(n,{id:xa}):G.info(n,{id:xa})}catch{if(i.current)return;G.info(`Subscription updated.`,{id:xa})}finally{if(!i.current){le(),t(Be.settings.usageBilling,{replace:!0});let e=Date.now();r.current!==null&&clearInterval(r.current),r.current=setInterval(()=>{if(Date.now()-e>=ba){r.current!==null&&(clearInterval(r.current),r.current=null);return}l().catch(e=>{console.error(`billing poll error:`,e)})},ya)}}})(),()=>{i.current=!0}},[e,t,n]),null}var wa=[7,30,90].map(e=>({value:`${e}`,label:`Last ${e} days`}));function Ta(e,t=Xe()){let{fromDate:n,toDate:r}=Rt(e,t);return{from:n,to:r}}function Ea(e,t){let n=new Date(e),r=new Date(t);return Math.round((r.getTime()-n.getTime())/864e5)+1}function Da({from:e,to:t}){let n=Ea(e,t);return n===7?7:n===90?90:30}function Oa({value:e,onChange:t}){let n=kt(),r=(0,K.useMemo)(()=>`${Da(e)}`,[e]);return(0,J.jsx)(De,{options:wa,value:r,onChange:e=>{let r=Number(e);t(Ta(r,n),r)},"aria-label":`Date range`})}var ka={strokeDasharray:`3 3`,stroke:`var(--border-subtle)`,strokeOpacity:.4},Aa={fontSize:12,fill:`var(--content-tertiary)`},ja={stroke:`var(--border-subtle)`,strokeOpacity:.4},Ma=[`#3b82f6`,`#10b981`,`#f59e0b`,`#ef4444`,`#8b5cf6`,`#06b6d4`,`#ec4899`,`#84cc16`];function Na({item:e}){return(0,J.jsxs)(`div`,{className:`flex items-center gap-2 py-0.5 text-[13px] text-[var(--content-default)]`,children:[(0,J.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full`,style:{backgroundColor:e.color}}),(0,J.jsx)(`span`,{children:e.label}),(0,J.jsx)(`span`,{className:`ml-auto tabular-nums`,children:e.value})]})}function Pa({active:e,payload:t,hoveredKey:n,label:r,labelMap:i,colorMap:a,formatValue:o,showTotal:s,formatLabel:c}){if(!e||!t?.length)return null;let l=t.filter(e=>e.value!=null&&e.dataKey!=null).map(e=>({key:String(e.dataKey),label:i[String(e.dataKey)]??String(e.dataKey),value:o(Number(e.value)),color:a[String(e.dataKey)]??`#6b7280`,numericValue:Number(e.value)})).sort((e,t)=>e.numericValue===t.numericValue?e.label.localeCompare(t.label):t.numericValue-e.numericValue),u=n?l.find(e=>e.key===n):null,d=u?l.filter(e=>e.key!==n):l,f=l.reduce((e,t)=>e+t.numericValue,0);return(0,J.jsxs)(`div`,{className:`rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-overlay)] px-3.5 py-2.5 shadow-[var(--shadow-popover)]`,children:[(0,J.jsx)(`div`,{className:`mb-1.5 text-xs font-medium text-[var(--content-secondary)]`,children:(c??Lt)(String(r))}),u&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Na,{item:u}),d.length>0&&(0,J.jsx)(`div`,{className:`my-1.5 border-t border-[var(--border-subtle)]`})]}),d.map(e=>(0,J.jsx)(Na,{item:e},e.key)),s&&(0,J.jsx)(`div`,{className:`mt-1 flex items-center gap-2 border-t border-[var(--border-subtle)] pt-1.5 text-[13px] font-semibold text-[var(--content-default)]`,children:(0,J.jsxs)(`span`,{children:[`Total: `,o(f)]})})]})}function Fa(e,t){let[n,r]=e,[i,a]=t,o=r-n||1;return e=>i+(e-n)/o*(a-i)}function Ia(e){if(e<=0)return 1;let t=10**Math.floor(Math.log10(e)),n=e/t,r;return r=n<=1?1:n<=2?2:n<=2.5?2.5:n<=5?5:10,r*t}function La(e){if(e>=1)return+!Number.isInteger(e);let t=e/10**Math.floor(Math.log10(e)),n=Math.abs(t-2.5)<.01;return Math.ceil(-Math.log10(e))+ +!!n}function Ra(e,t){let n=Math.max(0,...e),r=t?.tickCount??5;return n===0?t?.integerOnly?r:1:t?.integerOnly?Math.max(1,Math.ceil(n/r))*r:Ia(n/r)*r}function za(e,t){if(e===0)return[0];let n=e/t,r=10**(n>=1?0:Math.ceil(-Math.log10(n))+2),i=[];for(let e=0;e<=t;e++)i.push(Math.round(n*e*r)/r);return i}function Ba(e,t,n,r,i){let a=Math.min(i,n/2,r/2);return[`M${e},${t+a}`,`A${a},${a} 0 0 1 ${e+a},${t}`,`H${e+n-a}`,`A${a},${a} 0 0 1 ${e+n},${t+a}`,`V${t+r}`,`H${e}`,`Z`].join(``)}function Va(e,t){if(e<=0)return[];if(t)return e<=3?Array.from({length:e},(e,t)=>t):[0,Math.floor(e/2),e-1];let n=Math.max(1,Math.ceil(e/Math.min(e,12))),r=[];for(let t=0;t<e;t+=n)r.push(t);return r[r.length-1]!==e-1&&r.push(e-1),r}var Ha=40,Ua={fontSize:11,fill:`var(--content-tertiary)`},Wa={runtime_proxy_api:`#3b82f6`,oauth_proxy:`#f59e0b`};function Ga(e,t){return Wa[e]??Ma[t%Ma.length]??`#6b7280`}function Ka(e,t){let n=new Set,r={};for(let t of e)for(let e of t.groups)n.add(e.group_key),r[e.group_key]=e.group_label;return{data:e.map(e=>{let n={date:e.date};for(let r of e.groups)n[r.group_key]=t===`spend`?parseFloat(r.total_usd):r.event_count;return n}),stackKeys:Array.from(n),labelMap:r}}function qa({stackKeys:e,labelMap:t}){return(0,J.jsx)(`div`,{className:`flex flex-wrap items-center justify-center gap-x-5 gap-y-1 pt-3 text-body-small-default`,children:e.map((e,n)=>(0,J.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,J.jsx)(`span`,{className:`inline-block h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:Ga(e,n)}}),(0,J.jsx)(`span`,{className:`text-[var(--content-quiet)]`,children:t[e]??e})]},e))})}var Ja=350,Ya={top:8,right:4,bottom:32,left:0},Xa=.2,Za=5,Qa=12,$a=200;function eo({buckets:e,metric:t,onBarClick:n}){let r=Ye(),i=(0,K.useRef)(null),[a,o]=(0,K.useState)(0);(0,K.useEffect)(()=>{let e=i.current;if(!e)return;let t=new ResizeObserver(([e])=>{e&&o(e.contentRect.width)});return t.observe(e),()=>t.disconnect()},[]);let{data:s,stackKeys:c,labelMap:l}=(0,K.useMemo)(()=>Ka(e,t),[e,t]),u=(0,K.useMemo)(()=>{let e={};for(let t=0;t<c.length;t++)e[c[t]]=Ga(c[t],t);return e},[c]),d=(0,K.useCallback)(e=>t===`spend`?`$${e.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2})}`:e.toLocaleString(`en-US`),[t]),[f,p]=(0,K.useState)(null),m=r?Ha:56,h=r?Ua:Aa,g=Ya.left+m,_=Math.max(0,a-g-Ya.right),v=Ya.top,y=Ja-Ya.top-Ya.bottom,b=(0,K.useMemo)(()=>s.map(e=>c.reduce((t,n)=>t+(Number(e[n])||0),0)),[s,c]),x=t===`events`,S=(0,K.useMemo)(()=>Ra(b,{integerOnly:x,tickCount:Za}),[b,x]),C=(0,K.useMemo)(()=>za(S,Za),[S]),w=(0,K.useCallback)(e=>{if(t===`spend`){if(e===0)return`$0`;let t=S/Za,n=Math.max(t<1?2:0,La(t));return`$${e.toLocaleString(`en-US`,{minimumFractionDigits:n,maximumFractionDigits:n})}`}return e.toLocaleString(`en-US`)},[t,S]),T=(0,K.useMemo)(()=>Fa([0,S],[v+y,v]),[S,v,y]),E=s.length,D=E>0?_/E:0,O=D*(1-Xa),k=(D-O)/2,A=(0,K.useMemo)(()=>Va(E,r),[E,r]),j=c.length===0,M=j?[]:s.map((e,t)=>{let n=g+t*D+k,r=0;return{di:t,x:n,segments:c.map((t,i)=>{let a=Number(e[t])||0,o=r;r+=a;let s=T(r),l=T(o)-s,u=i===c.length-1;return{key:t,val:a,x:n,y:s,h:l,color:Ga(t,i),isLast:u}})}}),N=(e,t,n)=>{let r=i.current?.getBoundingClientRect();r&&p({x:e.clientX-r.left,y:e.clientY-r.top,datumIndex:t,hoveredKey:n})},P=()=>p(null),F=e=>{n&&n(e)},I=f?c.filter(e=>(Number(s[f.datumIndex]?.[e])||0)>0).map(e=>({dataKey:e,value:Number(s[f.datumIndex]?.[e])||0})):[],L={left:f?Math.max(0,Math.min(f.x+Qa,a-$a)):0,top:f?f.y-Qa:0,visibility:f?`visible`:`hidden`};return(0,J.jsxs)(`div`,{onMouseDown:e=>e.preventDefault(),children:[(0,J.jsx)(`div`,{ref:i,className:`relative w-full`,style:{height:Ja},children:j?(0,J.jsx)(`div`,{className:`flex h-full items-center justify-center text-body-medium-lighter text-[var(--content-faint)]`,children:`No usage data for this period`}):a>0?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`svg`,{width:a,height:Ja,className:`block`,children:[C.map(e=>(0,J.jsx)(`line`,{x1:g,x2:g+_,y1:T(e),y2:T(e),stroke:ka.stroke,strokeOpacity:ka.strokeOpacity,strokeDasharray:ka.strokeDasharray},e)),(0,J.jsx)(`line`,{x1:g,x2:g+_,y1:v+y,y2:v+y,stroke:ja.stroke,strokeOpacity:ja.strokeOpacity}),C.map(e=>(0,J.jsx)(`text`,{x:g-8,y:T(e),textAnchor:`end`,dominantBaseline:`middle`,fontSize:h.fontSize,fill:h.fill,children:w(e)},e)),A.map(e=>{let t=s[e];return t?(0,J.jsx)(`text`,{x:g+e*D+D/2,y:v+y+20,textAnchor:`middle`,fontSize:h.fontSize,fill:h.fill,children:Lt(String(t.date))},e):null}),M.map(({di:e,segments:t})=>t.map(t=>{if(t.h<=0)return null;let r=f?.hoveredKey&&f.hoveredKey!==t.key?.4:1,i={key:`${e}-${t.key}`,fill:t.color,opacity:r,cursor:n?`pointer`:void 0,onMouseMove:n=>N(n,e,t.key),onMouseLeave:P,onClick:()=>F(t.key)};return t.isLast?(0,J.jsx)(`path`,{...i,d:Ba(t.x,t.y,O,t.h,3)}):(0,J.jsx)(`rect`,{...i,x:t.x,y:t.y,width:O,height:t.h})}))]}),(0,J.jsx)(`div`,{className:`pointer-events-none absolute z-[1] max-w-[calc(100vw-32px)] -translate-y-full`,style:L,children:(0,J.jsx)(Pa,{active:!!f,payload:I,hoveredKey:f?.hoveredKey??void 0,label:f?String(s[f.datumIndex]?.date):``,labelMap:l,colorMap:u,formatValue:d})})]}):null}),!j&&(0,J.jsx)(qa,{stackKeys:c,labelMap:l})]})}function to(e=Xe()){return Ta(30,e)}function no(e){if(e)return e.usageSource===`oauth_proxy`?`oauth_provider`:$t(e.llmDimension??`model`)}function ro(e,t=Xe()){return{from:e.dateRange.from,to:e.dateRange.to,tz:t,...e.drilldown?{usage_source:e.drilldown.usageSource,group_by:no(e.drilldown)}:{}}}function io(e,t=Xe()){return{from:e.dateRange.from,to:e.dateRange.to,tz:t,...e.drilldown?{usage_source:e.drilldown.usageSource}:{}}}function ao(e,t,n){return e===`full`&&t!==`gated`&&n}function oo(e){let t=kt(),n=ao(Ve({platformHostedOnly:!0}),Ve(),Ue()),r=u({...vt({query:ro(e,t)}),enabled:n}),i=u({..._t({query:io(e,t)}),enabled:n});return{series:r.data,totals:i.data,isLoading:r.isLoading||i.isLoading,isError:r.isError||i.isError}}var so=[{value:`spend`,label:`Spend ($)`},{value:`events`,label:`Events`}];function co(e){if(e===void 0)return`—`;let t=parseFloat(e);return Number.isNaN(t)?`$0.00`:`$${t.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2})}`}function lo(e){return e===void 0?`—`:e.toLocaleString(`en-US`)}function uo(){let e=kt(),[t,n]=(0,K.useState)(30),[r,i]=(0,K.useState)(()=>to(e)),a=(0,K.useMemo)(()=>t===null?r:Ta(t,e),[t,r,e]),o=(e,t)=>{n(t),i(e)},[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(`spend`),{series:d,totals:f,isLoading:h,isError:_}=oo({dateRange:a,setDateRange:e=>{n(null),i(e)},drilldown:s,setDrilldown:c}),v=s?void 0:e=>{let t={runtime_proxy_api:`runtime_proxy`,oauth_proxy:`oauth_proxy`}[e];t&&c({usageSource:t,...t===`runtime_proxy`?{llmDimension:Jt}:{}})};return(0,J.jsx)(m,{padding:`md`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(p,{as:`h2`,variant:`title-medium`,className:`text-[var(--content-default)]`,children:`Credit Usage`}),(0,J.jsx)(p,{as:`p`,variant:`body-small-default`,className:`mt-2 text-[var(--content-tertiary)]`,children:`Overview of your spending habits.`})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2 [&_[role=combobox]]:h-8 [&_[role=radio]]:h-7`,children:[(0,J.jsx)(Oa,{value:a,onChange:o}),(0,J.jsx)(`div`,{className:`w-44`,children:(0,J.jsx)(xe,{items:so,value:l,onChange:u,ariaLabel:`Chart metric`})})]})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-2`,children:[(0,J.jsx)(Se,{icon:(0,J.jsx)(x,{className:`h-4 w-4`,"aria-hidden":!0}),value:h?(0,J.jsx)(H,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):co(f?.total_usd),label:`Spend`}),(0,J.jsx)(Se,{icon:(0,J.jsx)(Ht,{className:`h-4 w-4`,"aria-hidden":!0}),value:h?(0,J.jsx)(H,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):lo(f?.event_count),label:`Events`})]}),s&&(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,J.jsx)(`div`,{children:(0,J.jsxs)(`button`,{className:`flex items-center gap-1.5 text-body-medium-lighter text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-secondary)]`,onClick:()=>c(null),children:[(0,J.jsx)(g,{className:`h-3.5 w-3.5`}),(0,J.jsx)(`span`,{children:`Back to all usage`}),(0,J.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:`/`}),(0,J.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:s.usageSource===`runtime_proxy`?`LLM Spend`:`OAuth Spend`})]})}),s.usageSource===`runtime_proxy`&&(0,J.jsx)(`div`,{className:`w-56`,children:(0,J.jsx)(xe,{items:Xt,value:s.llmDimension??`model`,onChange:e=>c({usageSource:`runtime_proxy`,llmDimension:e}),ariaLabel:`LLM spend dimension`})})]}),h?(0,J.jsx)(`div`,{className:`flex h-[345px] items-center justify-center rounded-xl bg-[var(--surface-base)]`,children:(0,J.jsx)(H,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`})}):_?(0,J.jsx)(`div`,{className:`flex h-[345px] items-center justify-center rounded-xl bg-[var(--surface-base)] text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Failed to load usage data.`}):d?(0,J.jsx)(`div`,{className:`rounded-xl bg-[var(--surface-base)] p-3`,children:(0,J.jsx)(eo,{buckets:d.buckets,metric:l,onBarClick:v})}):null]})})}function fo(){let{data:e}=u(bt()),t=k((0,K.useMemo)(()=>C(e),[e]));if(!e||e.plan_id!==`pro`||e.status===`canceled`||!e.cancel_at_period_end&&!e.cancel_at)return null;let n=T(e);return n?(0,J.jsx)(U,{tone:`info`,title:`Your Pro plan will end on ${M(n)}.`,actions:(0,J.jsx)(i,{variant:`outlined`,size:`compact`,onClick:()=>t.mutate({}),disabled:t.isPending,leftIcon:t.isPending?(0,J.jsx)(H,{className:`animate-spin`}):void 0,"data-testid":`grace-period-reactivate-button`,children:`Reactivate`}),"data-testid":`grace-period-banner`,children:`You'll keep Pro features until then.`}):null}var po={invoices:[]},mo=4;function ho(e){switch(e){case`paid`:return`positive`;case`open`:return`warning`;case`uncollectible`:return`negative`;default:return`neutral`}}function go(e,t){let n=t.toUpperCase();try{let t=new Intl.NumberFormat(void 0,{style:`currency`,currency:n}),r=t.resolvedOptions().maximumFractionDigits??2;return t.format(e/10**r)}catch{return`${(e/100).toFixed(2)} ${n}`}}function _o(e){return Mt(new Date(e*1e3),{alwaysShowYear:!0})}function vo(e){let t=document.createElement(`a`);t.href=e,t.target=`_blank`,t.rel=`noopener noreferrer`,document.body.appendChild(t),t.click(),t.remove()}function yo(){let[e,t]=(0,K.useState)(!1),[r,o]=(0,K.useState)(!1),[s,c]=(0,K.useState)(!1),l=u({enabled:e,queryKey:tt(),queryFn:async({signal:e})=>{let{data:t,response:n}=await ze({throwOnError:!1,signal:e});if(n?.status===404)return po;if(!n?.ok||!t)throw Error(`Failed to load invoices (${n?.status??`network error`})`);return t}}),d=l.data?.invoices??[],f=r?d:d.slice(0,mo),h=d.length>mo;async function g(){c(!0);try{let{data:e,response:t}=await Re({throwOnError:!1,parseAs:`blob`});if(!t?.ok||!(e instanceof Blob))throw Error(`Failed to download invoices (${t?.status??`network error`})`);let{saveFile:n}=await a(async()=>{let{saveFile:e}=await import(`./native-file-B6_oAU2Q.js`).then(e=>e.t);return{saveFile:e}},__vite__mapDeps([0,1,2,3,4]));await n(e,`invoices.zip`)}catch(e){n(e,{context:`download_all_invoices`}),G.error(`Failed to download invoices.`)}finally{c(!1)}}return(0,J.jsx)(m,{padding:`md`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(p,{as:`h2`,variant:`title-medium`,className:`text-[var(--content-default)]`,children:`Invoices`}),(0,J.jsx)(p,{as:`p`,variant:`body-small-default`,className:`mt-2 text-[var(--content-tertiary)]`,children:`Your billing history.`})]}),(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[e&&d.length>0&&(0,J.jsx)(i,{variant:`outlined`,leftIcon:s?(0,J.jsx)(H,{className:`animate-spin`}):(0,J.jsx)(me,{className:`h-4 w-4`}),onClick:g,disabled:s,"data-testid":`invoices-download-all`,children:`Download all`}),(0,J.jsx)(i,{variant:`outlined`,leftIcon:e?(0,J.jsx)(y,{className:`h-4 w-4`}):(0,J.jsx)(v,{className:`h-4 w-4`}),onClick:()=>t(e=>!e),"data-testid":`invoices-toggle`,children:e?`Hide invoices`:`Show invoices`})]})]}),e?l.isLoading?(0,J.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-[var(--content-tertiary)]`,children:[(0,J.jsx)(H,{className:`h-4 w-4 animate-spin`}),(0,J.jsx)(p,{as:`span`,variant:`body-small-default`,children:`Loading invoices...`})]}):l.isError?(0,J.jsx)(U,{tone:`error`,children:`Failed to load invoices.`}):d.length===0?(0,J.jsx)(p,{as:`p`,variant:`body-small-default`,className:`py-6 text-center text-[var(--content-tertiary)]`,"data-testid":`invoices-empty`,children:`No Invoices Found`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`overflow-x-auto`,children:(0,J.jsxs)(`table`,{className:`w-full`,"data-testid":`invoices-table`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`border-b border-[var(--border-base)] text-left`,children:[(0,J.jsx)(`th`,{className:`pb-2 pr-4 text-body-small-default text-[var(--content-tertiary)]`,children:`Date`}),(0,J.jsx)(`th`,{className:`pb-2 pr-4 text-body-small-default text-[var(--content-tertiary)]`,children:`Amount`}),(0,J.jsx)(`th`,{className:`pb-2 pr-4 text-body-small-default text-[var(--content-tertiary)]`,children:`Status`}),(0,J.jsx)(`th`,{className:`pb-2 text-body-small-default text-[var(--content-tertiary)]`,children:`Action`})]})}),(0,J.jsx)(`tbody`,{children:f.map(e=>(0,J.jsxs)(`tr`,{className:`border-b border-[var(--border-base)] last:border-0`,"data-testid":`invoice-row`,children:[(0,J.jsx)(`td`,{className:`py-3 pr-4`,children:(0,J.jsx)(p,{as:`span`,variant:`body-small-default`,className:`text-[var(--content-secondary)]`,children:_o(e.created)})}),(0,J.jsx)(`td`,{className:`py-3 pr-4`,children:(0,J.jsx)(p,{as:`span`,variant:`body-small-default`,className:`text-[var(--content-secondary)]`,children:go(e.amount_due,e.currency)})}),(0,J.jsx)(`td`,{className:`py-3 pr-4`,children:e.status&&(0,J.jsx)(Ce,{tone:ho(e.status),children:e.status})}),(0,J.jsx)(`td`,{className:`py-3`,children:(0,J.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.hosted_invoice_url&&(0,J.jsx)(i,{asChild:!0,variant:`ghost`,size:`compact`,leftIcon:(0,J.jsx)(he,{className:`h-3.5 w-3.5`}),children:(0,J.jsx)(`a`,{href:e.hosted_invoice_url,target:`_blank`,rel:`noopener noreferrer`,children:`View`})}),e.invoice_pdf&&(0,J.jsx)(i,{variant:`ghost`,size:`compact`,iconOnly:(0,J.jsx)(me,{className:`h-3.5 w-3.5`}),"aria-label":`Download invoice PDF`,onClick:()=>vo(e.invoice_pdf)})]})})]},e.id))})]})}),h&&(0,J.jsx)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`self-start text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-secondary)]`,"data-testid":`invoices-show-more`,children:r?`Show less`:`Show more (${d.length-mo} more)`})]}):null]})})}function bo({title:e,blurb:t,ctaLabel:n,ctaTestId:r,pending:a=!1,disabled:o=!1,onCtaClick:s,className:c}){return(0,J.jsxs)(`div`,{"data-theme":`dark`,className:At(`flex min-w-0 flex-1 flex-col items-center justify-center gap-5 rounded-xl bg-[var(--surface-base)] py-5 pl-3 pr-4`,c),children:[(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,J.jsx)(p,{as:`span`,variant:`body-large-default`,className:`text-[var(--content-default)]`,children:e}),t?(0,J.jsx)(p,{as:`span`,variant:`body-small-default`,className:`text-[var(--content-secondary)]`,children:t}):null]}),(0,J.jsx)(i,{variant:`primary`,className:`h-8 shrink-0`,onClick:s,disabled:o||a,leftIcon:a?(0,J.jsx)(H,{className:`h-4 w-4 animate-spin`}):void 0,"data-testid":r,children:n})]})}function xo({icon:e,label:t,multiline:n=!1}){return(0,J.jsxs)(`div`,{className:At(`flex items-center gap-1.5 rounded-lg bg-[var(--surface-overlay)] px-2 py-1.5`,n?`min-h-8 min-w-0`:`h-8`),children:[(0,J.jsx)(e,{className:`h-3.5 w-3.5 shrink-0 text-[var(--content-default)]`,"aria-hidden":!0}),(0,J.jsx)(p,{as:`span`,variant:`body-medium-default`,className:At(`text-[var(--content-default)]`,n?`whitespace-normal`:`whitespace-nowrap`),children:t})]})}function So({tierKey:e,name:t,nameTestId:n,tag:r,specs:i,className:a}){let o=i!=null&&i.length>0;return(0,J.jsxs)(`div`,{"data-theme":`light`,className:At(`flex min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl bg-[var(--surface-base)] py-3 pl-3 pr-4`,a),children:[o?(0,J.jsx)(`div`,{className:`h-px w-full bg-[var(--border-base)]`}):null,(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,J.jsx)(P,{tier:e,size:48}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,J.jsx)(p,{as:`span`,variant:`body-large-default`,className:`text-[var(--content-default)]`,"data-testid":n,children:t}),r]})]}),o?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`h-px w-full bg-[var(--border-base)]`}),(0,J.jsx)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:i.map(e=>(0,J.jsx)(xo,{icon:e.icon,label:e.label,multiline:e.multiline},e.label))})]}):null]})}var Co={pro:{actionLabel:`Manage`,actionVariant:`outlined`,actionTestId:`plan-card-manage-button`,showsRenewal:!0},base:{actionLabel:`View All Plans`,actionVariant:`primary`,actionTestId:`plan-card-upgrade-button`,showsRenewal:!0}},wo=Co.pro;function To(){return(0,J.jsx)(p,{as:`h2`,variant:`title-medium`,className:`text-[var(--content-emphasised)]`,children:`Plan`})}function Eo({packages:e,proPlan:t,currentKey:n,isProUser:r,canChangePackage:i,relation:a,onManage:o,onTierUpgraded:s}){let c=l(),u=d(mt()),{changePackage:f,isPending:p}=L(),{changeTiers:m,isPending:h,current:g,currentReady:_}=ce({enabled:r}),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(!1);se();let w=(0,K.useMemo)(()=>!r||g.storageTier==null?null:{machineTier:g.machineTier,storageTier:g.storageTier,creditTier:g.creditTier},[r,g.machineTier,g.storageTier,g.creditTier]),T=z(e,n),E=e.length>0,O=T!=null&&a!==`switch`,k=r&&E&&(a===`switch`||T==null&&n!=null&&e.some(e=>e.key===n)),A=v||u.isPending||p,M=async()=>{if(!T)return;let e=await f(T.key);e&&(x(!1),e.status===`ok`?s?.():G.success(`You're already on this plan.`))},N=async()=>{if(T){if(r&&!i){o();return}if(r){x(!0);return}y(!0);try{let e=await u.mutateAsync({body:{target_plan_id:`pro`,package:T.key,confirm:!0,return_target:j()}});e.status===`redirect`&&e.checkout_url?(D({kind:`package`,packageKey:T.key}),Ge(e.checkout_url)):(await c.invalidateQueries({queryKey:Et()}),await c.invalidateQueries({queryKey:ht()}))}catch(e){G.error(oe(e,`Failed to start the upgrade checkout. Please try again.`))}finally{y(!1)}}},P=async e=>{let t=await m(e);t&&(C(!1),t.needsResize?s?.():G.success(t.creditChanged?`Credit bundle updated.`:`Plan updated.`))},F=()=>{if(!i){o();return}if(!(h||!_)){if(w==null){o();return}C(!0)}},ee=i&&(h||!_);return O?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(bo,{className:`lg:flex-[2]`,title:`Upgrade to ${T.name}`,blurb:I(T.key)?.upgradeBlurb,ctaLabel:`Upgrade`,ctaTestId:`recommended-upgrade-button`,pending:A,onCtaClick:()=>void N()}),(0,J.jsx)(ae,{open:b,relation:a,packageName:T.name,pending:A,onConfirm:()=>void M(),onCancel:()=>x(!1)})]}):k&&t?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(bo,{className:`lg:flex-[2]`,title:`Create a custom plan`,ctaLabel:`Customize`,ctaTestId:`recommended-customize-button`,pending:h,disabled:ee,onCtaClick:F}),(0,J.jsx)(re,{open:S,proPlan:t,pending:h,currentStorageGib:g.storageGib,initialSelection:w,onClose:()=>C(!1),onContinue:e=>void P(e)})]}):null}function Do({onManage:e,onTierUpgraded:t}){let n=c(),r=u(bt()),a=u(Ze());if(r.isLoading||a.isLoading)return(0,J.jsxs)(m,{padding:`md`,children:[(0,J.jsx)(To,{}),(0,J.jsxs)(`div`,{className:`mt-4 flex items-center gap-2 text-[var(--content-tertiary)]`,children:[(0,J.jsx)(H,{className:`h-4 w-4 animate-spin`}),(0,J.jsx)(p,{as:`span`,variant:`body-small-default`,children:`Loading plan...`})]})]});let o=r.data,s=a.data?.plans,l=s?.find(e=>e.id===o?.plan_id);if(r.isError||a.isError||!o||!s||!l)return(0,J.jsx)(U,{tone:`error`,children:`Failed to load plan.`});let d=Co[l.id]??wo,f=l.id===`pro`?O(o.package):l.name??l.id,h=d.showsRenewal&&(o.cancel_at_period_end===!0||!!o.cancel_at),g=o.status===`canceled`,_=T(o),v=d.showsRenewal&&!h&&!g&&o.current_period_end,y=d.showsRenewal&&h&&!g&&_,b=s.find(e=>e.id===`pro`),x=b?.packages??[],C=o.package?.key??null,w=C??`free`,E=x.length>0&&(l.id===`base`||S(o.package)||ie(o)),D=ie(o),k=l.id===`base`||S(o.package)?`upgrade`:`switch`,A=l.id!==`base`&&S(o.package)?x.find(e=>e.key===C)??null:null,j=A?R(A):null;return(0,J.jsx)(m,{padding:`md`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsx)(To,{}),v&&(0,J.jsxs)(p,{variant:`body-small-default`,as:`div`,className:`leading-snug text-[var(--content-tertiary)]`,"data-testid":`plan-card-renews`,children:[`Monthly Payment • Your subscription will auto renew on`,` `,M(o.current_period_end),`.`]}),y&&(0,J.jsxs)(p,{variant:`body-small-default`,as:`div`,className:`leading-snug text-[var(--system-mid-strong)]`,"data-testid":`plan-card-cancels`,children:[`Your plan ends on `,M(_),`.`]})]}),(0,J.jsx)(i,{variant:d.actionVariant,onClick:E?()=>n(Be.plans):e,"data-testid":d.actionTestId,className:`shrink-0`,children:d.actionLabel})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 lg:flex-row lg:items-stretch`,children:[(0,J.jsx)(So,{tierKey:w,name:f,nameTestId:`plan-card-name`,className:`lg:flex-[3]`,tag:(0,J.jsx)(Ce,{className:`bg-[var(--feed-digest-weak)] text-[var(--content-default)]`,children:`Current Plan`}),specs:j}),(0,J.jsx)(Eo,{packages:x,proPlan:b,currentKey:C,isProUser:l.id!==`base`,canChangePackage:D,relation:k,onManage:e,onTierUpgraded:t})]})]})})}function Oo(){let[e]=o(),t=c(),n=l();return(0,K.useEffect)(()=>{let r=e.get(`billing_status`);r&&(r===`success`?(G.success(`Payment received! Your credit balance will update shortly.`,{id:`billing-status`}),n.invalidateQueries({queryKey:gt().queryKey})):r===`cancel`&&G.info(`Checkout was cancelled. No credits were added.`,{id:`billing-status`}),t(Be.settings.usageBilling,{replace:!0}))},[e,t,n]),null}function ko({onFinishSetup:e}){let t=We(),{data:n}=u({...bt(),enabled:t}),r=n?.plan_id===`pro`,{data:a}=u({...wt(),enabled:r&&t}),o=r&&a?.domain_setup_available===!0,{domains:s}=E(o,a?.primary_assistant_id),c=s!==void 0&&s.results.length===0;return!o||!c?null:(0,J.jsx)(U,{tone:`info`,title:`Finish setting up your ${O(n?.package)} plan`,actions:(0,J.jsx)(i,{variant:`outlined`,size:`compact`,onClick:e,"data-testid":`finish-pro-setup-button`,children:`Finish setup`}),"data-testid":`finish-pro-setup-notice`,children:`Your assistant's email address hasn't been set up yet.`})}function Ao(){let e=Ve({platformHostedOnly:!0}),t=Ve(),n=Ue(),r=He(),[i,a]=o(),[s,c]=(0,K.useState)(!1),l=(0,K.useCallback)(()=>c(!0),[]),u=(0,K.useCallback)(()=>c(!1),[]),[d,f]=(0,K.useState)(!1),p=(0,K.useCallback)(()=>f(!0),[]),[m,h]=(0,K.useState)(!1);(0,K.useEffect)(()=>{if(t!==`full`)return;let e=i.has(`adjust_plan`),n=i.has(`pro_onboarding`);!e&&!n||(e&&c(!0),n&&h(!0),a(e=>{let t=new URLSearchParams(e);return t.delete(`adjust_plan`),t.delete(`pro_onboarding`),t},{replace:!0}))},[t,i,a]);let g=i.has(`session_id`),_=(0,K.useCallback)(()=>{h(!1),a(e=>{let t=new URLSearchParams(e);return t.delete(`session_id`),t},{replace:!0})},[a]),v=(0,K.useCallback)(()=>{a(e=>{let t=new URLSearchParams(e);return t.set(`pro_onboarding`,``),t},{replace:!0})},[a]);if(t===`disabled`)return(0,J.jsx)(`div`,{className:`space-y-4`,children:(0,J.jsx)(jt,{children:`Log in to the Vellum platform to manage billing and usage.`})});if(r)return(0,J.jsx)(`div`,{className:`space-y-4`,children:(0,J.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,J.jsx)(H,{className:`h-4 w-4 animate-spin`}),`Loading billing…`]})});let y=n;return!n&&e!==`gated`?(0,J.jsx)(`div`,{className:`space-y-4`,children:(0,J.jsx)(U,{tone:`warning`,children:`Billing isn't available for the current assistant state.`})}):(0,J.jsxs)(`div`,{className:`space-y-4`,children:[(0,J.jsxs)(K.Suspense,{fallback:null,children:[(0,J.jsx)(Oo,{}),(0,J.jsx)(Ca,{})]}),y&&(0,J.jsx)(fo,{}),y&&(0,J.jsx)(ko,{onFinishSetup:v}),y&&(0,J.jsx)(Do,{onManage:l,onTierUpgraded:p}),y&&(0,J.jsx)(Br,{open:s,onClose:u,onTierUpgraded:p}),(0,J.jsx)(K.Suspense,{fallback:null,children:(0,J.jsx)(ga,{})}),(0,J.jsx)(K.Suspense,{fallback:null,children:(0,J.jsx)(yo,{})}),y&&(0,J.jsx)(A,{open:g||m,onClose:_}),y&&(0,J.jsx)(A,{mode:`resize`,open:d,onClose:()=>f(!1)})]})}function jo(){let e=Nt(),t=Ve({platformHostedOnly:!0}),n=Ve();return(0,J.jsxs)(`div`,{className:`space-y-4`,children:[t===`full`&&n!==`gated`&&(0,J.jsx)(uo,{}),(0,J.jsx)(_r,{assistantId:e})]})}function Mo(){let e=Ve(),[t,n]=o(),r=Gt(e,t),i=r&&t.get(`tab`)!==`usage`?`billing`:`usage`,a=Le();return(0,K.useEffect)(()=>{if(a&&t.get(`tab`)!==i){let e=new URLSearchParams(t);e.set(`tab`,i),n(e,{replace:!0})}},[a,t,i,n]),(0,J.jsx)(`div`,{className:`space-y-6`,children:(0,J.jsxs)(de.Root,{value:i,onValueChange:e=>{let r=new URLSearchParams(t);r.set(`tab`,e),n(r,{replace:!0})},children:[(0,J.jsxs)(de.List,{children:[r&&(0,J.jsx)(de.Trigger,{value:`billing`,children:`Billing`}),(0,J.jsx)(de.Trigger,{value:`usage`,children:`Usage`})]}),r&&(0,J.jsx)(de.Panel,{value:`billing`,className:`pt-4`,children:(0,J.jsx)(Ao,{})}),(0,J.jsx)(de.Panel,{value:`usage`,className:`pt-4`,children:(0,J.jsx)(jo,{})})]})})}export{Mo as BillingPage};
@@ -1 +1 @@
1
- import{m as e,n as t}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{u as r}from"./routes-bwxCYLJj.js";var i=n();function a(){let[n]=e(),a=n.toString();return(0,i.jsx)(t,{replace:!0,to:`${r.settings.usage}${a?`?${a}`:``}`})}export{a as BillingRedirectPage};
1
+ import{m as e,n as t}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{u as r}from"./routes-vE-2hncW.js";var i=n();function a(){let[n]=e(),a=n.toString();return(0,i.jsx)(t,{replace:!0,to:`${r.settings.usage}${a?`?${a}`:``}`})}export{a as BillingRedirectPage};
@@ -1 +1 @@
1
- import{t as e}from"./button-Dy5001j6.js";import{u as t}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./card-DRIctGVs.js";import{n as i}from"./use-supports-bookmarks-CJC-T2ro.js";import{t as a}from"./loader-circle-BzJ2kz3F.js";import{t as o}from"./rotate-ccw-Da_2DvhY.js";import{t as s}from"./triangle-alert--e3n47gm.js";import{t as c}from"./x-DuBvjmAE.js";import{t as l}from"./conversation-navigation-DUNqTEXk.js";import{n as u,t as d}from"./use-bookmarks-DzswOt-6.js";var f=n();function p(e){if(e==null)return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString(void 0,{month:`short`,day:`numeric`,year:`numeric`,hour:`numeric`,minute:`2-digit`,hour12:!0})}function m(){return(0,f.jsx)(r,{children:(0,f.jsxs)(`div`,{className:`flex min-h-[400px] flex-col items-center justify-center px-6 py-16 text-center`,children:[(0,f.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,f.jsx)(i,{className:`h-6 w-6 text-[var(--content-disabled)] dark:text-[var(--content-default)]`})}),(0,f.jsx)(`h2`,{className:`mt-4 text-title-small text-[var(--content-default)]`,children:`No bookmarks`}),(0,f.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Hover any message and click the bookmark icon to save it here.`})]})})}function h({bookmark:t,isFirst:n,onOpen:r,onRemove:i}){let a=t.conversationTitle&&t.conversationTitle.trim().length>0?t.conversationTitle:`Untitled conversation`,o=t.messageRole!==`user`,s=p(t.createdAt);return(0,f.jsxs)(`div`,{className:`flex items-start gap-3 py-3 ${n?``:`border-t border-[var(--border-base)]`}`,children:[(0,f.jsx)(`span`,{"aria-hidden":!0,className:`mt-1 h-8 w-1 shrink-0 rounded-full`,style:{backgroundColor:o?`var(--content-default)`:`var(--content-tertiary)`}}),(0,f.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,f.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,f.jsx)(`div`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:a}),s?(0,f.jsx)(`span`,{className:`shrink-0 text-body-small-default text-[var(--content-tertiary)]`,children:s}):null]}),t.messagePreview?(0,f.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-small-default text-[var(--content-tertiary)]`,children:t.messagePreview}):null]}),(0,f.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,f.jsx)(e,{variant:`outlined`,onClick:r,children:`Open`}),(0,f.jsx)(`button`,{type:`button`,onClick:i,title:`Remove bookmark`,"aria-label":`Remove bookmark`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-active)] hover:text-[var(--content-default)]`,children:(0,f.jsx)(c,{className:`h-4 w-4`})})]})]})}function g(){let n=t(),{bookmarks:i,isLoading:c,isError:p,refetch:g}=u(),_=d();return c?(0,f.jsx)(`div`,{className:`w-full`,children:(0,f.jsx)(`div`,{className:`flex min-h-[400px] items-center justify-center`,children:(0,f.jsx)(a,{className:`h-6 w-6 animate-spin text-[var(--content-disabled)]`})})}):p?(0,f.jsx)(`div`,{className:`w-full`,children:(0,f.jsx)(r,{children:(0,f.jsxs)(`div`,{className:`flex min-h-[400px] flex-col items-center justify-center px-6 py-16 text-center`,children:[(0,f.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--system-error-lighter)]`,children:(0,f.jsx)(s,{className:`h-6 w-6 text-[var(--system-error-default)]`})}),(0,f.jsx)(`h2`,{className:`mt-4 text-title-small text-[var(--content-default)]`,children:`Failed to load bookmarks`}),(0,f.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Something went wrong. Please try again.`}),(0,f.jsxs)(e,{variant:`outlined`,onClick:g,className:`mt-4`,children:[(0,f.jsx)(o,{className:`h-4 w-4`}),`Retry`]})]})})}):i.length===0?(0,f.jsx)(`div`,{className:`w-full`,children:(0,f.jsx)(m,{})}):(0,f.jsx)(`div`,{className:`w-full`,children:(0,f.jsx)(r,{noPadding:!0,className:`px-4`,children:i.map((e,t)=>(0,f.jsx)(h,{bookmark:e,isFirst:t===0,onOpen:()=>l(n,e.conversationId,{messageId:e.messageId}),onRemove:()=>{_(e.messageId,e.conversationId,!0)}},e.id))})})}export{g as BookmarksPage};
1
+ import{t as e}from"./button-Dy5001j6.js";import{u as t}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./card-DRIctGVs.js";import{n as i}from"./use-supports-bookmarks-C3J7FtDn.js";import{t as a}from"./loader-circle-XREx3i4W.js";import{t as o}from"./rotate-ccw-BjzeX7qz.js";import{t as s}from"./triangle-alert-CQfiAg_t.js";import{t as c}from"./x-JBAsSOmg.js";import{t as l}from"./conversation-navigation-Wm7_pLFs.js";import{n as u,t as d}from"./use-bookmarks-BbJtKyHe.js";var f=n();function p(e){if(e==null)return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString(void 0,{month:`short`,day:`numeric`,year:`numeric`,hour:`numeric`,minute:`2-digit`,hour12:!0})}function m(){return(0,f.jsx)(r,{children:(0,f.jsxs)(`div`,{className:`flex min-h-[400px] flex-col items-center justify-center px-6 py-16 text-center`,children:[(0,f.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,f.jsx)(i,{className:`h-6 w-6 text-[var(--content-disabled)] dark:text-[var(--content-default)]`})}),(0,f.jsx)(`h2`,{className:`mt-4 text-title-small text-[var(--content-default)]`,children:`No bookmarks`}),(0,f.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Hover any message and click the bookmark icon to save it here.`})]})})}function h({bookmark:t,isFirst:n,onOpen:r,onRemove:i}){let a=t.conversationTitle&&t.conversationTitle.trim().length>0?t.conversationTitle:`Untitled conversation`,o=t.messageRole!==`user`,s=p(t.createdAt);return(0,f.jsxs)(`div`,{className:`flex items-start gap-3 py-3 ${n?``:`border-t border-[var(--border-base)]`}`,children:[(0,f.jsx)(`span`,{"aria-hidden":!0,className:`mt-1 h-8 w-1 shrink-0 rounded-full`,style:{backgroundColor:o?`var(--content-default)`:`var(--content-tertiary)`}}),(0,f.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,f.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,f.jsx)(`div`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:a}),s?(0,f.jsx)(`span`,{className:`shrink-0 text-body-small-default text-[var(--content-tertiary)]`,children:s}):null]}),t.messagePreview?(0,f.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-small-default text-[var(--content-tertiary)]`,children:t.messagePreview}):null]}),(0,f.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,f.jsx)(e,{variant:`outlined`,onClick:r,children:`Open`}),(0,f.jsx)(`button`,{type:`button`,onClick:i,title:`Remove bookmark`,"aria-label":`Remove bookmark`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-active)] hover:text-[var(--content-default)]`,children:(0,f.jsx)(c,{className:`h-4 w-4`})})]})]})}function g(){let n=t(),{bookmarks:i,isLoading:c,isError:p,refetch:g}=u(),_=d();return c?(0,f.jsx)(`div`,{className:`w-full`,children:(0,f.jsx)(`div`,{className:`flex min-h-[400px] items-center justify-center`,children:(0,f.jsx)(a,{className:`h-6 w-6 animate-spin text-[var(--content-disabled)]`})})}):p?(0,f.jsx)(`div`,{className:`w-full`,children:(0,f.jsx)(r,{children:(0,f.jsxs)(`div`,{className:`flex min-h-[400px] flex-col items-center justify-center px-6 py-16 text-center`,children:[(0,f.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--system-error-lighter)]`,children:(0,f.jsx)(s,{className:`h-6 w-6 text-[var(--system-error-default)]`})}),(0,f.jsx)(`h2`,{className:`mt-4 text-title-small text-[var(--content-default)]`,children:`Failed to load bookmarks`}),(0,f.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Something went wrong. Please try again.`}),(0,f.jsxs)(e,{variant:`outlined`,onClick:g,className:`mt-4`,children:[(0,f.jsx)(o,{className:`h-4 w-4`}),`Retry`]})]})})}):i.length===0?(0,f.jsx)(`div`,{className:`w-full`,children:(0,f.jsx)(m,{})}):(0,f.jsx)(`div`,{className:`w-full`,children:(0,f.jsx)(r,{noPadding:!0,className:`px-4`,children:i.map((e,t)=>(0,f.jsx)(h,{bookmark:e,isFirst:t===0,onOpen:()=>l(n,e.conversationId,{messageId:e.messageId}),onRemove:()=>{_(e.messageId,e.conversationId,!0)}},e.id))})})}export{g as BookmarksPage};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-DVuEArjY.js","assets/preload-helper-Cv2QeVDK.js","assets/dist-BJSu8g5P.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./capture-error-CqtAGHQu.js";import{t}from"./preload-helper-Cv2QeVDK.js";import{t as n}from"./is-electron-7N7iyz1y.js";import{u as r}from"./native-biometric-BBZbTKi0.js";import{t as i}from"./dist-BJSu8g5P.js";function a(t,n){if(!r())return()=>void 0;let i=null,a=!1;return n().then(e=>{if(a){e.remove();return}i=e}).catch(n=>{e(n,{context:t,level:`warning`})}),()=>{a=!0,i?.remove()}}var o=async(e,r)=>{if(n()){window.open(e,`_blank`);return}if(i.isNativePlatform())try{let{Browser:n}=await t(async()=>{let{Browser:e}=await import(`./esm-DVuEArjY.js`);return{Browser:e}},__vite__mapDeps([0,1,2]));await n.open({url:e,presentationStyle:`popover`})}catch{r(e)}else r(e)},s=e=>o(e,e=>{window.location.href=e}),c=async e=>{if(n())return window.open(e,`_blank`),!0;if(i.isNativePlatform())try{let{Browser:n}=await t(async()=>{let{Browser:e}=await import(`./esm-DVuEArjY.js`);return{Browser:e}},__vite__mapDeps([0,1,2]));return await n.open({url:e,presentationStyle:`popover`}),!0}catch{}return window.open(e,`_blank`)!==null},l=e=>o(e,e=>{window.open(e,`_blank`,`noopener,noreferrer`)}),u=e=>a(`capacitor_browser_finished`,async()=>{let{Browser:n}=await t(async()=>{let{Browser:e}=await import(`./esm-DVuEArjY.js`);return{Browser:e}},__vite__mapDeps([0,1,2]));return n.addListener(`browserFinished`,e)});export{a,c as i,s as n,u as r,l as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-BWFeAIOX.js","assets/preload-helper-Cv2QeVDK.js","assets/dist-BwAT3VYQ.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./capture-error-Bj8_eutd.js";import{t}from"./preload-helper-Cv2QeVDK.js";import{t as n}from"./is-electron-m5eeGBnd.js";import{u as r}from"./native-biometric-CntdlaL-.js";import{t as i}from"./dist-BwAT3VYQ.js";function a(t,n){if(!r())return()=>void 0;let i=null,a=!1;return n().then(e=>{if(a){e.remove();return}i=e}).catch(n=>{e(n,{context:t,level:`warning`})}),()=>{a=!0,i?.remove()}}var o=async(e,r)=>{if(n()){window.open(e,`_blank`);return}if(i.isNativePlatform())try{let{Browser:n}=await t(async()=>{let{Browser:e}=await import(`./esm-BWFeAIOX.js`);return{Browser:e}},__vite__mapDeps([0,1,2]));await n.open({url:e,presentationStyle:`popover`})}catch{r(e)}else r(e)},s=e=>o(e,e=>{window.location.href=e}),c=async e=>{if(n())return window.open(e,`_blank`),!0;if(i.isNativePlatform())try{let{Browser:n}=await t(async()=>{let{Browser:e}=await import(`./esm-BWFeAIOX.js`);return{Browser:e}},__vite__mapDeps([0,1,2]));return await n.open({url:e,presentationStyle:`popover`}),!0}catch{}return window.open(e,`_blank`)!==null},l=e=>o(e,e=>{window.open(e,`_blank`,`noopener,noreferrer`)}),u=e=>a(`capacitor_browser_finished`,async()=>{let{Browser:n}=await t(async()=>{let{Browser:e}=await import(`./esm-BWFeAIOX.js`);return{Browser:e}},__vite__mapDeps([0,1,2]));return n.addListener(`browserFinished`,e)});export{a,c as i,s as n,u as r,l as t};
@@ -1 +1 @@
1
- import{ct as e,f as t,h as n,m as r}from"./local-mode-CTrmCbAp.js";import{n as i}from"./resolved-assistants-store-PdwcxGwN.js";import{N as a,j as o,n as s}from"./auth-store-CK95leo_.js";import{_ as c}from"./native-biometric-BBZbTKi0.js";import{l}from"./remote-gateway-session-DAfJAELv.js";import{u}from"./routes-bwxCYLJj.js";import{a as d,i as f,n as p,r as m,s as h}from"./prefs-B2UAscQt.js";function g(e){return e.tosAccepted&&e.privacyConsent}function _(e){return g(e)&&e.analyticsConsentCurrent&&e.diagnosticsConsentCurrent}var v=`${u.assistant}/onboarding`,y=new Set([u.onboarding.hosting,u.onboarding.apiKey]),b=new Set([u.welcome,u.selectAssistant]);function x(e){return e.startsWith(`${v}/`)||e===v}function S(e){return e?u.welcome:u.onboarding.privacy}function C(e){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`))try{return new URL(e,`http://placeholder.invalid`).pathname}catch{return e}return e}function w(e,t){return t===u.welcome?e.hasAssistants?u.selectAssistant:u.onboarding.hosting:t===u.selectAssistant?`${t}?fromLogin=1`:t}function T(e,t){switch(t.kind){case`route-guard`:return D(e,t.pathname);case`onboarding-intercept`:return L(e,t.intendedDestination);case`hatch-gate`:return R(e);case`post-auth`:return z(t.authIntent,t.returnTo,t.fallback);case`post-retire`:return B(e)}}var E=[O,k,j,M,N,P,F,I];function D(e,t){let n=t.indexOf(`?`),r=n>=0?t.slice(0,n):t;for(let n of E){let i=n(e,r,t);if(i)return i}return{action:`allow`}}function O(e){return e.sessionSettled?null:{action:`wait`}}function k(e){return e.isGatewayAuth?{action:`allow`}:null}function A(e,t){let n=e.remoteGatewayPublicPathPrefix;return!e.isRemoteGateway||!n?t:t===n?u.assistant:t.startsWith(`${n}/`)?t.slice(n.length):t}function j(e,t,n){if(!e.isRemoteGateway||e.isAuthenticated)return null;let r=A(e,n);return{action:`redirect`,to:`${u.remotePair}?returnTo=${encodeURIComponent(r)}`}}function M(e,t,n){return e.isAuthenticated?null:e.isLocalMode&&(x(t)||b.has(t))?t===u.selectAssistant&&!e.hasAssistants?{action:`redirect`,to:u.onboarding.hosting}:{action:`allow`}:e.isLocalMode&&!e.hasAssistants?{action:`redirect`,to:u.welcome}:e.isLocalMode?{action:`redirect`,to:u.selectAssistant}:{action:`redirect`,to:`${u.account.login}?returnTo=${encodeURIComponent(n)}`}}function N(e,t){return b.has(t)?e.isLocalMode?t===u.selectAssistant&&!e.hasAssistants?{action:`redirect`,to:u.onboarding.hosting}:{action:`allow`}:{action:`redirect`,to:u.assistant}:y.has(t)&&!e.isLocalMode?{action:`redirect`,to:u.assistant}:null}function P(e,t){return t===u.reviewTerms?{action:`allow`}:x(t)?t===u.onboarding.hatching&&!g(e)?{action:`redirect`,to:S(e.isLocalMode)}:{action:`allow`}:null}function F(e,t,n){if(e.hasAssistants)return null;if(e.isLocalMode)return e.platformSession===`unknown`?{action:`wait`}:e.platformSession===`present`?{action:`redirect`,to:u.onboarding.hosting}:{action:`redirect`,to:u.welcome};if(!e.assistantsHydrated||!e.consentHydrated)return{action:`wait`};if(!g(e))return{action:`redirect`,to:u.onboarding.privacy};if(!_(e)){let e=encodeURIComponent(n);return{action:`redirect`,to:`${u.reviewTerms}?returnTo=${e}`}}return{action:`redirect`,to:u.onboarding.hatching}}function I(e,t,n){if(e.isPlatformDisabled||e.platformSession!==`present`||_(e))return null;if(!e.consentHydrated&&!e.isLocalMode)return{action:`wait`};let r=encodeURIComponent(n);return{action:`redirect`,to:`${u.reviewTerms}?returnTo=${r}`}}function L(e,t){if(e.isLocalMode&&e.hasAssistants||g(e))return{action:`allow`};let n=C(t);return!n.startsWith(u.assistant)||n.startsWith(`${u.assistant}/onboarding`)||n===u.reviewTerms?{action:`allow`}:{action:`redirect`,to:S(e.isLocalMode)}}function R(e){return e.sessionSettled?!e.isAuthenticated&&!e.isLocalMode?{action:`redirect`,to:u.account.login}:g(e)?!e.isLocalMode&&!_(e)?{action:`redirect`,to:u.reviewTerms}:{action:`allow`}:{action:`redirect`,to:S(e.isLocalMode)}:{action:`wait`}}function z(e,t,n){return e===`signup`?{action:`redirect`,to:u.onboarding.privacy}:{action:`redirect`,to:c(t,n)}}function B(e){return e.hasAssistants?{action:`redirect`,to:e.isLocalMode?u.selectAssistant:u.assistant}:e.isLocalMode?e.platformSession===`present`?{action:`redirect`,to:u.onboarding.hosting}:{action:`redirect`,to:u.welcome}:{action:`redirect`,to:u.onboarding.privacy}}function V(c){let{sessionStatus:u,platformSession:g}=s.getState(),{assistants:_,assistantsHydrated:v}=i.getState(),y=n();return{isLocalMode:t(),isPlatformDisabled:r(),isRemoteGateway:y,remoteGatewayPublicPathPrefix:y?l():``,isGatewayAuth:e(),hasAssistants:_.length>0,sessionSettled:a(u),isAuthenticated:o(u),platformSession:g,tosAccepted:h(),privacyConsent:d(),analyticsConsentCurrent:p(),diagnosticsConsentCurrent:f(),consentHydrated:m(),assistantsHydrated:v,...c}}export{w as n,T as r,V as t};
1
+ import{ct as e,f as t,h as n,m as r}from"./local-mode-Ckii2tmN.js";import{n as i}from"./resolved-assistants-store-C-PdxK8f.js";import{N as a,j as o,n as s}from"./auth-store-D9BqFncz.js";import{_ as c}from"./native-biometric-CntdlaL-.js";import{l}from"./remote-gateway-session-BHjZ9gQ6.js";import{u}from"./routes-vE-2hncW.js";import{a as d,i as f,n as p,r as m,s as h}from"./prefs-BZnS5vR_.js";function g(e){return e.tosAccepted&&e.privacyConsent}function _(e){return g(e)&&e.analyticsConsentCurrent&&e.diagnosticsConsentCurrent}var v=`${u.assistant}/onboarding`,y=new Set([u.onboarding.hosting,u.onboarding.apiKey]),b=new Set([u.welcome,u.selectAssistant]);function x(e){return e.startsWith(`${v}/`)||e===v}function S(e){return e?u.welcome:u.onboarding.privacy}function C(e){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`))try{return new URL(e,`http://placeholder.invalid`).pathname}catch{return e}return e}function w(e,t){return t===u.welcome?e.hasAssistants?u.selectAssistant:u.onboarding.hosting:t===u.selectAssistant?`${t}?fromLogin=1`:t}function T(e,t){switch(t.kind){case`route-guard`:return D(e,t.pathname);case`onboarding-intercept`:return L(e,t.intendedDestination);case`hatch-gate`:return R(e);case`post-auth`:return z(t.authIntent,t.returnTo,t.fallback);case`post-retire`:return B(e)}}var E=[O,k,j,M,N,P,F,I];function D(e,t){let n=t.indexOf(`?`),r=n>=0?t.slice(0,n):t;for(let n of E){let i=n(e,r,t);if(i)return i}return{action:`allow`}}function O(e){return e.sessionSettled?null:{action:`wait`}}function k(e){return e.isGatewayAuth?{action:`allow`}:null}function A(e,t){let n=e.remoteGatewayPublicPathPrefix;return!e.isRemoteGateway||!n?t:t===n?u.assistant:t.startsWith(`${n}/`)?t.slice(n.length):t}function j(e,t,n){if(!e.isRemoteGateway||e.isAuthenticated)return null;let r=A(e,n);return{action:`redirect`,to:`${u.remotePair}?returnTo=${encodeURIComponent(r)}`}}function M(e,t,n){return e.isAuthenticated?null:e.isLocalMode&&(x(t)||b.has(t))?t===u.selectAssistant&&!e.hasAssistants?{action:`redirect`,to:u.onboarding.hosting}:{action:`allow`}:e.isLocalMode&&!e.hasAssistants?{action:`redirect`,to:u.welcome}:e.isLocalMode?{action:`redirect`,to:u.selectAssistant}:{action:`redirect`,to:`${u.account.login}?returnTo=${encodeURIComponent(n)}`}}function N(e,t){return b.has(t)?e.isLocalMode?t===u.selectAssistant&&!e.hasAssistants?{action:`redirect`,to:u.onboarding.hosting}:{action:`allow`}:{action:`redirect`,to:u.assistant}:y.has(t)&&!e.isLocalMode?{action:`redirect`,to:u.assistant}:null}function P(e,t){return t===u.reviewTerms?{action:`allow`}:x(t)?t===u.onboarding.hatching&&!g(e)?{action:`redirect`,to:S(e.isLocalMode)}:{action:`allow`}:null}function F(e,t,n){if(e.hasAssistants)return null;if(e.isLocalMode)return e.platformSession===`unknown`?{action:`wait`}:e.platformSession===`present`?{action:`redirect`,to:u.onboarding.hosting}:{action:`redirect`,to:u.welcome};if(!e.assistantsHydrated||!e.consentHydrated)return{action:`wait`};if(!g(e))return{action:`redirect`,to:u.onboarding.privacy};if(!_(e)){let e=encodeURIComponent(n);return{action:`redirect`,to:`${u.reviewTerms}?returnTo=${e}`}}return{action:`redirect`,to:u.onboarding.hatching}}function I(e,t,n){if(e.isPlatformDisabled||e.platformSession!==`present`||_(e))return null;if(!e.consentHydrated&&!e.isLocalMode)return{action:`wait`};let r=encodeURIComponent(n);return{action:`redirect`,to:`${u.reviewTerms}?returnTo=${r}`}}function L(e,t){if(e.isLocalMode&&e.hasAssistants||g(e))return{action:`allow`};let n=C(t);return!n.startsWith(u.assistant)||n.startsWith(`${u.assistant}/onboarding`)||n===u.reviewTerms?{action:`allow`}:{action:`redirect`,to:S(e.isLocalMode)}}function R(e){return e.sessionSettled?!e.isAuthenticated&&!e.isLocalMode?{action:`redirect`,to:u.account.login}:g(e)?!e.isLocalMode&&!_(e)?{action:`redirect`,to:u.reviewTerms}:{action:`allow`}:{action:`redirect`,to:S(e.isLocalMode)}:{action:`wait`}}function z(e,t,n){return e===`signup`?{action:`redirect`,to:u.onboarding.privacy}:{action:`redirect`,to:c(t,n)}}function B(e){return e.hasAssistants?{action:`redirect`,to:e.isLocalMode?u.selectAssistant:u.assistant}:e.isLocalMode?e.platformSession===`present`?{action:`redirect`,to:u.onboarding.hosting}:{action:`redirect`,to:u.welcome}:{action:`redirect`,to:u.onboarding.privacy}}function V(c){let{sessionStatus:u,platformSession:g}=s.getState(),{assistants:_,assistantsHydrated:v}=i.getState(),y=n();return{isLocalMode:t(),isPlatformDisabled:r(),isRemoteGateway:y,remoteGatewayPublicPathPrefix:y?l():``,isGatewayAuth:e(),hasAssistants:_.length>0,sessionSettled:a(u),isAuthenticated:o(u),platformSession:g,tosAccepted:h(),privacyConsent:d(),analyticsConsentCurrent:p(),diagnosticsConsentCurrent:f(),consentHydrated:m(),assistantsHydrated:v,...c}}export{w as n,T as r,V as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./api-errors-BRGPPSWw.js";var t=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,n=globalThis,r=`10.52.0`;function i(){return a(n),n}function a(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||`10.52.0`,t[r]=t[`10.52.0`]||{}}function o(e,t,i=n){let a=i.__SENTRY__=i.__SENTRY__||{},o=a[r]=a[`10.52.0`]||{};return o[e]||(o[e]=t())}var s=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],c=`Sentry Logger `,l={};function u(e){if(!(`console`in n))return e();let t=n.console,r={},i=Object.keys(l);i.forEach(e=>{let n=l[e];r[e]=t[e],t[e]=n});try{return e()}finally{i.forEach(e=>{t[e]=r[e]})}}function d(){ne().enabled=!0}function f(){ne().enabled=!1}function p(){return ne().enabled}function m(...e){te(`log`,...e)}function h(...e){te(`warn`,...e)}function ee(...e){te(`error`,...e)}function te(e,...r){t&&p()&&u(()=>{n.console[e](`${c}[${e}]:`,...r)})}function ne(){return t?o(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}var g={enable:d,disable:f,isEnabled:p,log:m,warn:h,error:ee},re=50,ie=/\(error: (.*)\)/,ae=/captureMessage|captureException/;function oe(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{let i=[],a=e.split(`
1
+ import{t as e}from"./api-errors-CFiCT7Ap.js";var t=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,n=globalThis,r=`10.52.0`;function i(){return a(n),n}function a(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||`10.52.0`,t[r]=t[`10.52.0`]||{}}function o(e,t,i=n){let a=i.__SENTRY__=i.__SENTRY__||{},o=a[r]=a[`10.52.0`]||{};return o[e]||(o[e]=t())}var s=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],c=`Sentry Logger `,l={};function u(e){if(!(`console`in n))return e();let t=n.console,r={},i=Object.keys(l);i.forEach(e=>{let n=l[e];r[e]=t[e],t[e]=n});try{return e()}finally{i.forEach(e=>{t[e]=r[e]})}}function d(){ne().enabled=!0}function f(){ne().enabled=!1}function p(){return ne().enabled}function m(...e){te(`log`,...e)}function h(...e){te(`warn`,...e)}function ee(...e){te(`error`,...e)}function te(e,...r){t&&p()&&u(()=>{n.console[e](`${c}[${e}]:`,...r)})}function ne(){return t?o(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}var g={enable:d,disable:f,isEnabled:p,log:m,warn:h,error:ee},re=50,ie=/\(error: (.*)\)/,ae=/captureMessage|captureException/;function oe(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{let i=[],a=e.split(`
2
2
  `);for(let e=n;e<a.length;e++){let n=a[e];n.length>1024&&(n=n.slice(0,1024));let o=ie.test(n)?n.replace(ie,`$1`):n;if(!o.includes(`Error: `)){for(let e of t){let t=e(o);if(t){i.push(t);break}}if(i.length>=re+r)break}}return ce(i.slice(r))}}function se(e){return Array.isArray(e)?oe(...e):e}function ce(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(_(t).function||``)&&t.pop(),t.reverse(),ae.test(_(t).function||``)&&(t.pop(),ae.test(_(t).function||``)&&t.pop()),t.slice(0,re).map(e=>({...e,filename:e.filename||_(t).filename,function:e.function||`?`}))}function _(e){return e[e.length-1]||{}}var le=`<anonymous>`;function ue(e){try{return!e||typeof e!=`function`?le:e.name||le}catch{return le}}function de(e){let t=e.exception;if(t){let e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function fe(e){return`__v_isVNode`in e&&e.__v_isVNode?`[VueVNode]`:`[VueViewModel]`}var pe=Object.prototype.toString;function me(e){switch(pe.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object WebAssembly.Exception]`:return!0;default:return x(e,Error)}}function v(e,t){return pe.call(e)===`[object ${t}]`}function he(e){return v(e,`ErrorEvent`)}function ge(e){return v(e,`DOMError`)}function _e(e){return v(e,`DOMException`)}function y(e){return v(e,`String`)}function ve(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function ye(e){return e===null||ve(e)||typeof e!=`object`&&typeof e!=`function`}function be(e){return v(e,`Object`)}function xe(e){return typeof Event<`u`&&x(e,Event)}function Se(e){return typeof Element<`u`&&x(e,Element)}function Ce(e){return v(e,`RegExp`)}function b(e){return!!(e?.then&&typeof e.then==`function`)}function we(e){return be(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function x(e,t){try{return e instanceof t}catch{return!1}}function Te(e){return!!(typeof e==`object`&&e&&(e.__isVue||e._isVue||e.__v_isVNode))}function Ee(e){return typeof Request<`u`&&x(e,Request)}var De=n,Oe=80;function ke(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||Oe;for(;n&&i++<5&&(o=Ae(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=n.parentNode;return r.reverse().join(` > `)}catch{return`<unknown>`}}function Ae(e,t){let n=e,r=[];if(!n?.tagName)return``;if(De.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let i=t?.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(i?.length)i.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let e=n.className;if(e&&y(e)){let t=e.split(/\s+/);for(let e of t)r.push(`.${e}`)}}for(let e of[`aria-label`,`type`,`name`,`title`,`alt`]){let t=n.getAttribute(e);t&&r.push(`[${e}="${t}"]`)}return r.join(``)}function je(){try{return De.document.location.href}catch{return``}}function Me(e,t=5){if(!De.HTMLElement)return null;let n=e;for(let e=0;e<t;e++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}function Ne(e,n,r){if(!(n in e))return;let i=e[n];if(typeof i!=`function`)return;let a=r(i);typeof a==`function`&&Pe(a,i);try{e[n]=a}catch{t&&g.log(`Failed to replace method "${n}" in object`,e)}}function S(e,n,r){try{Object.defineProperty(e,n,{value:r,writable:!0,configurable:!0})}catch{t&&g.log(`Failed to add non-enumerable property "${String(n)}" to object`,e)}}function Pe(e,t){try{e.prototype=t.prototype=t.prototype||{},S(e,`__sentry_original__`,t)}catch{}}function Fe(e){return e.__sentry_original__}function Ie(e){if(me(e))return{message:e.message,name:e.name,stack:e.stack,...Re(e)};if(xe(e)){let t={type:e.type,target:Le(e.target),currentTarget:Le(e.currentTarget),...Re(e)};return typeof CustomEvent<`u`&&x(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Le(e){try{return Se(e)?ke(e):Object.prototype.toString.call(e)}catch{return`<unknown>`}}function Re(e){return typeof e==`object`&&e?Object.fromEntries(Object.entries(e)):{}}function ze(e){let t=Object.keys(Ie(e));return t.sort(),t[0]?t.join(`, `):`[object has no keys]`}var C;function w(e){if(C!==void 0)return C?C(e):e();let t=Symbol.for(`__SENTRY_SAFE_RANDOM_ID_WRAPPER__`),r=n;return t in r&&typeof r[t]==`function`?(C=r[t],C(e)):(C=null,e())}function T(){return w(()=>Math.random())}function Be(){return w(()=>Date.now())}function Ve(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function He(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];try{Te(r)?n.push(fe(r)):n.push(String(r))}catch{n.push(`[value cannot be serialized]`)}}return n.join(t)}function E(e,t,n=!1){return y(e)?Ce(t)?t.test(e):y(t)?n?e===t:e.includes(t):typeof t==`function`?t(e):!1:!1}function Ue(e,t=[],n=!1){return t.some(t=>E(e,t,n))}function We(){let e=n;return e.crypto||e.msCrypto}var Ge;function Ke(){return T()*16}function D(e=We()){try{if(e?.randomUUID)return w(()=>e.randomUUID()).replace(/-/g,``)}catch{}return Ge||=`10000000100040008000100000000000`,Ge.replace(/[018]/g,e=>(e^(Ke()&15)>>e/4).toString(16))}function qe(e){return e.exception?.values?.[0]}function Je(e){let{message:t,event_id:n}=e;if(t)return t;let r=qe(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function Ye(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||=t||``,a.type||=n||`Error`}function Xe(e,t){let n=qe(e);if(!n)return;let r={type:`generic`,handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&`data`in t){let e={...i?.data,...t.data};n.mechanism.data=e}}function Ze(e){if(Qe(e))return!0;try{S(e,`__sentry_captured__`,!0)}catch{}return!1}function Qe(e){try{return e.__sentry_captured__}catch{}}var $e=1e3;function O(){return Be()/$e}function et(){let{performance:e}=n;if(!e?.now||!e.timeOrigin)return O;let t=e.timeOrigin;return()=>(t+w(()=>e.now()))/$e}var tt;function k(){return(tt??=et())()}function nt(e){let t=k(),n={sid:D(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>it(n)};return e&&A(n,e),n}function A(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||k(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:D()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started==`number`&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration==`number`)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors==`number`&&(e.errors=t.errors),t.status&&(e.status=t.status)}function rt(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),A(e,n)}function it(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did==`number`||typeof e.did==`string`?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function j(e,t,n=2){if(!t||typeof t!=`object`||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=j(r[e],t[e],n-1));return r}function M(){return D()}function at(){return D().substring(16)}var ot=`_sentrySpan`;function st(e,t){t?S(e,ot,t):delete e[ot]}function ct(e){return e[ot]}var lt=100,N=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:M(),sampleRand:T()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,st(t,ct(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&A(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t,{tags:r,attributes:i,extra:a,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u,conversationId:d}=(n instanceof e?n.getScopeData():be(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,st(this,void 0),this._attachments=[],this.setPropagationContext({traceId:M(),sampleRand:T()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:lt;if(n<=0)return this;let r={timestamp:O(),...e,message:e.message?Ve(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent(`buffer_overflow`,`log_item`)),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ct(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=j(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){let r=n?.event_id||D();if(!this._client)return t&&g.warn(`No client configured on scope - will not capture exception!`),r;let i=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureMessage(e,n,r){let i=r?.event_id||D();if(!this._client)return t&&g.warn(`No client configured on scope - will not capture message!`),i;let a=r?.syntheticException??Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:a,...r,event_id:i},this),i}captureEvent(e,n){let r=e.event_id||n?.event_id||D();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(t&&g.warn(`No client configured on scope - will not capture event!`),r)}_notifyScopeListeners(){this._notifyingListeners||=(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),!1)}};function ut(){return o(`defaultCurrentScope`,()=>new N)}function dt(){return o(`defaultIsolationScope`,()=>new N)}var ft=e=>e instanceof Promise&&!e[pt],pt=Symbol(`chained PromiseLike`),mt=(e,t,n)=>{let r=e.then(e=>(t(e),e),e=>{throw n(e),e});return ft(r)&&ft(e)?r:ht(e,r)},ht=(e,t)=>{if(!t)return e;let n=!1;for(let r in e){if(r in t)continue;n=!0;let i=e[r];typeof i==`function`?Object.defineProperty(t,r,{value:(...t)=>i.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=i}return n&&Object.assign(t,{[pt]:!0}),t},gt=class{constructor(e,t){let n;n=e||new N;let r;r=t||new N,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t=this._pushScope(),n;try{n=e(t)}catch(e){throw this._popScope(),e}return b(n)?mt(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function P(){let e=a(i());return e.stack=e.stack||new gt(ut(),dt())}function _t(e){return P().withScope(e)}function vt(e,t){let n=P();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function yt(e){return P().withScope(()=>e(P().getIsolationScope()))}function bt(){return{withIsolationScope:yt,withScope:_t,withSetScope:vt,withSetIsolationScope:(e,t)=>yt(t),getCurrentScope:()=>P().getScope(),getIsolationScope:()=>P().getIsolationScope()}}function F(e){let t=a(e);return t.acs?t.acs:bt()}var xt;function St(){return xt?.()}function I(){return F(i()).getCurrentScope()}function L(){return F(i()).getIsolationScope()}function Ct(){return o(`globalScope`,()=>new N)}function wt(...e){let t=F(i());if(e.length===2){let[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}return t.withScope(e[0])}function R(){return I().getClient()}function Tt(e){let t=St();if(t)return{trace_id:t.traceId,span_id:t.spanId};let{traceId:n,parentSpanId:r,propagationSpanId:i}=e.getPropagationContext(),a={trace_id:n,span_id:i||at()};return r&&(a.parent_span_id=r),a}var Et=`sentry.source`,Dt=`sentry.sample_rate`,Ot=`sentry.op`,kt=`sentry.origin`,At=`sentry.measurement_unit`,jt=`sentry.measurement_value`,Mt=`sentry.custom_span_name`,Nt=`sentry.profile_id`,Pt=`sentry.exclusive_time`,Ft=`gen_ai.conversation.id`;function It(e){try{let t=n.WeakRef;if(typeof t==`function`)return new t(e)}catch{}return e}function Lt(e){if(e){if(typeof e==`object`&&`deref`in e&&typeof e.deref==`function`)try{return e.deref()}catch{return}return e}}var Rt=`_sentryScope`,zt=`_sentryIsolationScope`;function Bt(e,t,n){e&&(S(e,zt,It(n)),S(e,Rt,t))}function z(e){let t=e;return{scope:t[Rt],isolationScope:Lt(t[zt])}}function Vt(e){let t=Ht(e);if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith(`sentry-`)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function Ht(e){if(!(!e||!y(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{let n=Ut(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):Ut(e)}function Ut(e){return e.split(`,`).map(e=>{let t=e.indexOf(`=`);return t===-1?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}var Wt=/^o(\d+)\./,Gt=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Kt(e){return e===`http`||e===`https`}function B(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function qt(e){let t=Gt.exec(e);if(!t){u(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i=``,a=``,o=``,s=``]=t.slice(1),c=``,l=s,d=l.split(`/`);if(d.length>1&&(c=d.slice(0,-1).join(`/`),l=d.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return Jt({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function Jt(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function Yt(e){if(!t)return!0;let{port:n,projectId:r,protocol:i}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>e[t]?!1:(g.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:r.match(/^\d+$/)?Kt(i)?n&&isNaN(parseInt(n,10))?(g.error(`Invalid Sentry Dsn: Invalid port ${n}`),!1):!0:(g.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),!1):(g.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function Xt(e){return e.match(Wt)?.[1]}function Zt(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=Xt(n)),r}function Qt(e){let t=typeof e==`string`?qt(e):Jt(e);if(!(!t||!Yt(t)))return t}function $t(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(!(typeof t!=`number`||isNaN(t)||t<0||t>1))return t}var en=!1;function tn(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:a,status:o,origin:s,links:c}=H(e);return{parent_span_id:a,span_id:t,trace_id:n,data:r,op:i,status:o,origin:s,links:c}}function nn(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:H(e).parent_span_id,a=z(e).scope;return{parent_span_id:i,span_id:r?a?.getPropagationContext().propagationSpanId||at():t,trace_id:n}}function rn(e){if(e&&e.length>0)return e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:i})=>({span_id:e,trace_id:t,sampled:n===1,attributes:i,...r}))}function an(e){if(e?.length)return e.map(({context:{spanId:e,traceId:t,traceFlags:n},attributes:r})=>({span_id:e,trace_id:t,sampled:n===1,attributes:r}))}function V(e){return typeof e==`number`?on(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?on(e.getTime()):k()}function on(e){return e>9999999999?e/1e3:e}function H(e){if(ln(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(cn(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{span_id:t,trace_id:n,data:r,description:a,parent_span_id:sn(e),start_timestamp:V(i),timestamp:V(o)||void 0,status:un(s),op:r[Ot],origin:r[kt],links:rn(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function sn(e){return`parentSpanId`in e?e.parentSpanId:`parentSpanContext`in e?e.parentSpanContext?.spanId:void 0}function cn(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function ln(e){return typeof e.getSpanJSON==`function`}function U(e){let{traceFlags:t}=e.spanContext();return t===1}function un(e){if(!(!e||e.code===0))return e.code===1?`ok`:e.message||`internal_error`}function dn(e){return!e||e.code===1||e.code===0||e.message===`cancelled`?`ok`:`error`}var W=`_sentryChildSpans`,fn=`_sentryRootSpan`;function pn(e,t){S(t,fn,e[fn]||e),e[W]?e[W].add(t):S(e,W,new Set([t]))}function mn(e){let t=new Set;function n(e){if(!t.has(e)&&U(e)){t.add(e);let r=e[W]?Array.from(e[W]):[];for(let e of r)n(e)}}return n(e),Array.from(t)}var G=hn;function hn(e){return e[fn]||e}function gn(){en||=(u(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),!0)}function _n(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=e||R()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function vn(e){g.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function yn(e,n){if(!n?.length)return!1;for(let r of n){if(Sn(r)){if(e.description&&E(e.description,r))return t&&vn(e),!0;continue}let n=!!r.attributes&&Object.keys(r.attributes).length>0;if(!r.name&&!r.op&&!n)continue;let i=r.name?e.description&&E(e.description,r.name):!0,a=r.op?e.op&&E(e.op,r.op):!0,o=r.attributes?Object.entries(r.attributes).every(([t,n])=>bn(e.attributes?.[t],n)):!0;if(i&&a&&o)return t&&vn(e),!0}return!1}function bn(e,t){return typeof e==`string`&&(typeof t==`string`||t instanceof RegExp)?E(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}function xn(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function Sn(e){return typeof e==`string`||e instanceof RegExp}var Cn=`production`,wn=`_frozenDsc`;function Tn(e,t){S(e,wn,t)}function En(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||`production`,release:n.release,public_key:r,trace_id:e,org_id:Zt(t)};return t.emit(`createDsc`,i),i}function Dn(e,t){let n=t.getPropagationContext();return n.dsc||En(n.traceId,e)}function K(e){let t=R();if(!t)return{};let n=G(e),r=H(n),i=r.data,a=n.spanContext().traceState,o=a?.get(`sentry.sample_rate`)??i[`sentry.sample_rate`]??i[`sentry.previous_trace_sample_rate`];function s(e){return(typeof o==`number`||typeof o==`string`)&&(e.sample_rate=`${o}`),e}let c=n[wn];if(c)return s(c);let l=a?.get(`sentry.dsc`),u=l&&Vt(l);if(u)return s(u);let d=En(e.spanContext().traceId,t),f=i[`sentry.source`]??i[`sentry.span.source`],p=r.description;return f!==`url`&&p&&(d.transaction=p),_n()&&(d.sampled=String(U(n)),d.sample_rand=a?.get(`sentry.sample_rand`)??z(n).scope?.getPropagationContext().sampleRand.toString()),s(d),t.emit(`createDsc`,d,n),d}var q=class{constructor(e={}){this._traceId=e.traceId||M(),this._spanId=e.spanId||at(),this.dropReason=e.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}};function On(e){return!!e&&typeof e==`function`&&`_streamed`in e&&!!e._streamed}var kn=Symbol.for(`sentry.skipNormalization`),An=Symbol.for(`sentry.overrideNormalizationDepth`);function jn(e){return!!e[kn]}function Mn(e){let t=e[An];return typeof t==`number`?t:void 0}function J(e,t=100,n=1/0){try{return Pn(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Nn(e,t=3,n=100*1024){let r=J(e,t);return Rn(r)>n?Nn(e,t-1,n):r}function Pn(e,t,n=1/0,r=1/0,i=zn()){let[a,o]=i;if(t==null||[`boolean`,`string`].includes(typeof t)||typeof t==`number`&&Number.isFinite(t))return t;let s=Fn(e,t);if(!s.startsWith(`[object `))return s;if(jn(t))return t;let c=Mn(t),l=c===void 0?n:c;if(l===0)return s.replace(`object `,``);if(a(t))return`[Circular ~]`;let u=t;if(u&&typeof u.toJSON==`function`)try{return Pn(``,u.toJSON(),l-1,r,i)}catch{}let d=Array.isArray(t)?[]:{},f=0,p=Ie(t);for(let e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(f>=r){d[e]=`[MaxProperties ~]`;break}let t=p[e];d[e]=Pn(e,t,l-1,r,i),f++}return o(t),d}function Fn(e,t){try{if(e===`domain`&&t&&typeof t==`object`&&t._events)return`[Domain]`;if(e===`domainEmitter`)return`[DomainEmitter]`;if(typeof global<`u`&&t===global)return`[Global]`;if(typeof window<`u`&&t===window)return`[Window]`;if(typeof document<`u`&&t===document)return`[Document]`;if(Te(t))return fe(t);if(we(t))return`[SyntheticEvent]`;if(typeof t==`number`&&!Number.isFinite(t))return`[${t}]`;if(typeof t==`function`)return`[Function: ${ue(t)}]`;if(typeof t==`symbol`)return`[${String(t)}]`;if(typeof t==`bigint`)return`[BigInt: ${String(t)}]`;let n=In(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}function In(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function Ln(e){return~-encodeURI(e).split(/%..|./).length}function Rn(e){return Ln(JSON.stringify(e))}function zn(){let e=new WeakSet;function t(t){return e.has(t)?!0:(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}function Y(e,t=[]){return[e,t]}function Bn(e,t){let[n,r]=e;return[n,[...r,t]]}function Vn(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function Hn(e,t){return Vn(e,(e,n)=>t.includes(n))}function Un(e){let t=a(n);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Wn(e){let[t,n]=e,r=JSON.stringify(t);function i(e){typeof r==`string`?r=typeof e==`string`?r+e:[Un(r),e]:r.push(typeof e==`string`?Un(e):e)}for(let e of n){let[t,n]=e;if(i(`\n${JSON.stringify(t)}\n`),typeof n==`string`||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(J(n))}i(e)}}return typeof r==`string`?r:Gn(r)}function Gn(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Kn(e){return[{type:`span`},e]}function qn(e){let t=typeof e.data==`string`?Un(e.data):e.data;return[{type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var Jn={sessions:`session`,event:`error`,client_report:`internal`,user_report:`default`,profile_chunk:`profile`,replay_event:`replay`,replay_recording:`replay`,check_in:`monitor`,raw_security:`security`,log:`log_item`,trace_metric:`metric`};function Yn(e){return e in Jn}function Xn(e){return Yn(e)?Jn[e]:e}function Zn(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Qn(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:B(r)},...i&&{trace:i}}}function $n(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function er(e,t,n,r){let i=Zn(n);return Y({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:B(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function tr(e,t,n,r){let i=Zn(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;$n(e,n?.sdk);let o=Qn(e,i,r,t);return delete e.sdkProcessingMetadata,Y(o,[[{type:a},e]])}function nr(e,t){function n(e){return!!e.trace_id&&!!e.public_key}let r=K(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!a&&i&&{dsn:B(i)}},{beforeSendSpan:s,ignoreSpans:c}=t?.getOptions()||{},l=c?.length?e.filter(e=>{let t=H(e);return!yn({description:t.description,op:t.op,attributes:t.data},c)}):e,u=e.length-l.length;u&&t?.recordDroppedEvent(`before_send`,`span`,u);let d=s?e=>{let t=H(e);return(On(s)?t:s(t))||(gn(),t)}:H,f=[];for(let e of l){let t=d(e);t&&f.push(Kn(t))}return Y(o,f)}function rr(e){if(!t)return;let{description:n=`< unknown name >`,op:r=`< unknown op >`,parent_span_id:i}=H(e),{spanId:a}=e.spanContext(),o=U(e),s=G(e),c=s===e,l=`[Tracing] Starting ${o?`sampled`:`unsampled`} ${c?`root `:``}span`,u=[`op: ${r}`,`name: ${n}`,`ID: ${a}`];if(i&&u.push(`parent ID: ${i}`),!c){let{op:e,description:t}=H(s);u.push(`root ID: ${s.spanContext().spanId}`),e&&u.push(`root op: ${e}`),t&&u.push(`root description: ${t}`)}g.log(`${l}
3
3
  ${u.join(`
4
4
  `)}`)}function ir(e){if(!t)return;let{description:n=`< unknown name >`,op:r=`< unknown op >`}=H(e),{spanId:i}=e.spanContext(),a=`[Tracing] Finishing "${r}" ${G(e)===e?`root `:``}span "${n}" with ID ${i}`;g.log(a)}function ar(e){if(!e||e.length===0)return;let t={};return e.forEach(e=>{let n=e.attributes||{},r=n[At],i=n[jt];typeof r==`string`&&typeof i==`number`&&(t[e.name]={value:i,unit:r})}),t}function X(e){return e.getOptions().traceLifecycle===`stream`}var or=1e3,sr=class{constructor(e={}){this._traceId=e.traceId||M(),this._spanId=e.spanId||at(),this._startTime=e.startTimestamp||k(),this._links=e.links,this._attributes={},this.setAttributes({[kt]:`manual`,[Ot]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),`sampled`in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:+!!n}}setAttribute(e,t){return t===void 0?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._startTime=V(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(Et,`custom`),this}end(e){this._endTime||(this._endTime=V(e),ir(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Ot],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:un(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[kt],profile_id:this._attributes[Nt],exclusive_time:this._attributes[Pt],measurements:ar(this._events),is_segment:this._isStandaloneSpan&&G(this)===this||void 0,segment_id:this._isStandaloneSpan?G(this).spanContext().spanId:void 0,links:rn(this._links)}}getStreamedSpanJSON(){return{name:this._name??``,span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===G(this),status:dn(this._status),attributes:this._attributes,links:an(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,n,r){t&&g.log(`[Tracing] Adding an event to span:`,e);let i=cr(n)?n:r||k(),a=cr(n)?{}:n||{},o={name:e,time:V(i),attributes:a};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=R();if(e&&(e.emit(`spanEnd`,this),this._isStandaloneSpan||e.emit(`afterSpanEnd`,this)),!(this._isStandaloneSpan||this===G(this)))return;if(this._isStandaloneSpan){this._sampled?dr(nr([this],e)):(t&&g.log(`[Tracing] Discarding standalone span because its trace was not chosen to be sampled.`),e&&e.recordDroppedEvent(`sample_rate`,`span`));return}else if(e&&X(e)){e.emit(`afterSegmentSpanEnd`,this);return}let n=this._convertSpanToTransaction();n&&(z(this).scope||I()).captureEvent(n)}_convertSpanToTransaction(){if(!lr(H(this)))return;this._name||=(t&&g.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),`<unlabeled transaction>`);let{scope:e,isolationScope:n}=z(this),r=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let i=mn(this).filter(e=>e!==this&&!ur(e)).map(e=>H(e)).filter(lr),a=this._attributes[Et];delete this._attributes[Mt],i.forEach(e=>{delete e.data[Mt]});let o={contexts:{trace:tn(this)},spans:i.length>or?i.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,or):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:n,dynamicSamplingContext:K(this)},request:r,...a&&{transaction_info:{source:a}}},s=ar(this._events);return s&&Object.keys(s).length&&(t&&g.log(`[Measurements] Adding measurements to transaction event`,JSON.stringify(s,void 0,2)),o.measurements=s),o}};function cr(e){return e&&typeof e==`number`||e instanceof Date||Array.isArray(e)}function lr(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function ur(e){return e instanceof sr&&e.isStandaloneSpan()}function dr(e){let t=R();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent(`before_send`,`span`);return}t.sendEnvelope(e)}function fr(e,n,r){if(!_n(e))return[!1];let i,a;typeof e.tracesSampler==`function`?(a=e.tracesSampler({...n,inheritOrSampleWith:e=>typeof n.parentSampleRate==`number`?n.parentSampleRate:typeof n.parentSampled==`boolean`?Number(n.parentSampled):e}),i=!0):n.parentSampled===void 0?e.tracesSampleRate!==void 0&&(a=e.tracesSampleRate,i=!0):a=n.parentSampled;let o=$t(a);if(o===void 0)return t&&g.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(a)} of type ${JSON.stringify(typeof a)}.`),[!1];if(!o)return t&&g.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler==`function`?`tracesSampler returned 0 or false`:`a negative sampling decision was inherited or tracesSampleRate is set to 0`}`),[!1,o,i];let s=r<o;return s||t&&g.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(a)})`),[s,o,i]}var pr=`__SENTRY_SUPPRESS_TRACING__`;function mr(e){let t=vr();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=_r(e),{forceTransaction:r,parentSpan:i}=e;return(e.scope?t=>wt(e.scope,t):i===void 0?e=>e():e=>hr(i,e))(()=>{let t=I(),a=xr(t,i),o=R();return e.onlyIfParent&&!a?(o?.recordDroppedEvent(`no_parent_span`,`span`),new q):gr({parentSpan:a,spanArguments:n,forceTransaction:r,scope:t})})}function hr(e,t){let n=vr();return n.withActiveSpan?n.withActiveSpan(e,t):wt(n=>(st(n,e||void 0),t(n)))}function gr({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!_n()){let r=new q;return(n||!e)&&Tn(r,{sampled:`false`,sample_rate:`0`,transaction:t.name,...K(r)}),r}let i=R();if(Sr(i,t))return Cr(r)||i?.recordDroppedEvent(`ignored`,`span`),new q({dropReason:`ignored`,traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});let a=L(),o;if(e&&!n)o=br(e,r,t),pn(e,o);else if(e){let n=K(e),{traceId:i,spanId:a}=e.spanContext(),s=U(e);o=yr({traceId:i,parentSpanId:a,...t},r,s),Tn(o,n)}else{let{traceId:e,dsc:n,parentSpanId:i,sampled:s}={...a.getPropagationContext(),...r.getPropagationContext()};o=yr({traceId:e,parentSpanId:i,...t},r,s),n&&Tn(o,n)}return rr(o),Bt(o,r,a),o}function _r(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let n={...t};return n.startTimestamp=V(e.startTime),delete n.startTime,n}return t}function vr(){return F(i())}function yr(e,n,r){let i=R(),a=i?.getOptions()||{},{name:o=``}=e,s={spanAttributes:{...e.attributes},spanName:o,parentSampled:r};i?.emit(`beforeSampling`,s,{decision:!1});let c=s.parentSampled??r,l=s.spanAttributes,u=n.getPropagationContext(),d=Cr(n),[f,p,m]=d?[!1]:fr(a,{name:o,parentSampled:c,attributes:l,parentSampleRate:$t(u.dsc?.sample_rate)},u.sampleRand),h=new sr({...e,attributes:{[Et]:`custom`,[Dt]:p!==void 0&&m?p:void 0,...l},sampled:f});return!f&&i&&!d&&(t&&g.log(`[Tracing] Discarding root span because its trace was not chosen to be sampled.`),i.recordDroppedEvent(`sample_rate`,X(i)?`span`:`transaction`)),i&&i.emit(`spanStart`,h),h}function br(e,t,n){let{spanId:r,traceId:i}=e.spanContext(),a=Cr(t),o=a?!1:U(e),s=o?new sr({...n,parentSpanId:r,traceId:i,sampled:o}):new q({traceId:i});pn(e,s);let c=R();return c?(X(c)&&s instanceof q&&(e instanceof q&&e.dropReason?(s.dropReason=e.dropReason,c.recordDroppedEvent(e.dropReason,`span`)):a||(s.dropReason=`sample_rate`,c.recordDroppedEvent(`sample_rate`,`span`))),c.emit(`spanStart`,s),n.endTimestamp&&(c.emit(`spanEnd`,s),c.emit(`afterSpanEnd`,s)),s):s}function xr(e,t){if(t)return t;if(t===null)return;let n=ct(e);if(!n)return;let r=R();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?G(n):n}function Sr(e,t){let n=e?.getOptions().ignoreSpans;return!e||!X(e)||!n?.length?!1:yn({description:t.name||``,op:t.attributes?.[`sentry.op`]||t.op,attributes:t.attributes},n)}function Cr(e){return e.getScopeData().sdkProcessingMetadata[pr]===!0}function wr(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;Dr(e,t),r&&Ar(e,r),jr(e,n),Or(e,i),kr(e,a)}function Tr(e,t){let{extra:n,tags:r,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:m,span:h}=t;Z(e,`extra`,n),Z(e,`tags`,r),Z(e,`attributes`,i),Z(e,`user`,a),Z(e,`contexts`,o),e.sdkProcessingMetadata=j(e.sdkProcessingMetadata,c,2),s&&(e.level=s),m&&(e.transactionName=m),h&&(e.span=h),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function Z(e,t,n){e[t]=j(e[t],n,1)}function Er(e,t){let n=Ct().getScopeData();return e&&Tr(n,e.getScopeData()),t&&Tr(n,t.getScopeData()),n}function Dr(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&e.type!==`transaction`&&(e.transaction=s)}function Or(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function kr(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Ar(e,t){e.contexts={trace:nn(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:K(t),...e.sdkProcessingMetadata};let n=H(G(t)).description;n&&!e.transaction&&e.type===`transaction`&&(e.transaction=n)}function jr(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}var Mr=0,Nr=1,Pr=2;function Fr(e){return new Lr(t=>{t(e)})}function Ir(e){return new Lr((t,n)=>{n(e)})}var Lr=class e{constructor(e){this._state=Mr,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(!t)e(n);else try{e(t(n))}catch(e){r(e)}},t=>{if(!n)r(t);else try{e(n(t))}catch(e){r(e)}}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{if(i){n(r);return}e(r)})})}_executeHandlers(){if(this._state===Mr)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||=(this._state===Nr&&e[1](this._value),this._state===Pr&&e[2](this._value),!0)})}_runExecutor(e){let t=(e,t)=>{if(this._state===Mr){if(b(t)){t.then(n,r);return}this._state=e,this._value=t,this._executeHandlers()}},n=e=>{t(Nr,e)},r=e=>{t(Pr,e)};try{e(n,r)}catch(e){r(e)}}};function Rr(e,t,n,r=0){try{let i=zr(t,n,e,r);return b(i)?i:Fr(i)}catch(e){return Ir(e)}}function zr(e,n,r,i){let a=r[i];if(!e||!a)return e;let o=a({...e},n);return t&&o===null&&g.log(`Event processor "${a.id||`?`}" dropped event`),b(o)?o.then(e=>zr(e,n,r,i+1)):zr(o,n,r,i+1)}var Q,Br,Vr,$;function Hr(e){let t=n._sentryDebugIds,r=n._debugIds;if(!t&&!r)return{};let i=t?Object.keys(t):[],a=r?Object.keys(r):[];if($&&i.length===Br&&a.length===Vr)return $;Br=i.length,Vr=a.length,$={},Q||={};let o=(t,n)=>{for(let r of t){let t=n[r],i=Q?.[r];if(i&&$&&t)$[i[0]]=t,Q&&(Q[r]=[i[0],t]);else if(t){let n=e(r);for(let e=n.length-1;e>=0;e--){let i=n[e]?.filename;if(i&&$&&Q){$[i]=t,Q[r]=[i,t];break}}}}};return t&&o(i,t),r&&o(a,r),$}function Ur(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||D(),timestamp:t.timestamp||O()},l=n.integrations||e.integrations.map(e=>e.name);Wr(c,e),qr(c,l),i&&i.emit(`applyFrameMetadata`,t),t.type===void 0&&Gr(c,e.stackParser);let u=Yr(r,n.captureContext);n.mechanism&&Xe(c,n.mechanism);let d=i?i.getEventProcessors():[],f=Er(a,u),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),wr(c,f);let m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?Fr(c):Rr(m,c,n)).then(e=>(e&&Kr(e),typeof o==`number`&&o>0?Jr(e,o,s):e))}function Wr(e,t){let{environment:n,release:r,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||`production`,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let o=e.request;o?.url&&a&&(o.url=Ve(o.url,a)),a&&e.exception?.values?.forEach(e=>{e.value&&=Ve(e.value,a)})}function Gr(e,t){let n=Hr(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}function Kr(e){let t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:`sourcemap`,code_file:e,debug_id:t})})}function qr(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Jr(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:J(e.data,t,n)}}))},...e.user&&{user:J(e.user,t,n)},...e.contexts&&{contexts:J(e.contexts,t,n)},...e.extra&&{extra:J(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=J(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:J(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=J(e.contexts.flags,3,n)),r}function Yr(e,t){if(!t)return e;let n=e?e.clone():new N;return n.update(t),n}function Xr(e){if(e)return Zr(e)||$r(e)?{captureContext:e}:e}function Zr(e){return e instanceof N||typeof e==`function`}var Qr=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`propagationContext`];function $r(e){return Object.keys(e).some(e=>Qr.includes(e))}function ei(e,t){return I().captureException(e,Xr(t))}function ti(e,t){let n=typeof t==`string`?t:void 0,r=typeof t==`string`?void 0:{captureContext:t};return I().captureMessage(e,n,r)}function ni(e,t){return I().captureEvent(e,t)}function ri(e,t){L().setContext(e,t)}function ii(){return L().lastEventId()}function ai(e){let t=L(),{user:r}=Er(t,I()),{userAgent:i}=n.navigator||{},a=nt({user:r,...i&&{userAgent:i},...e}),o=t.getSession();return o?.status===`ok`&&A(o,{status:`exited`}),oi(),t.setSession(a),a}function oi(){let e=L(),t=I().getSession()||e.getSession();t&&rt(t),si(),e.setSession()}function si(){let e=L(),t=R(),n=e.getSession();n&&t&&t.captureSession(n)}function ci(e=!1){if(e){oi();return}si()}var li=3;function ui(t){return t instanceof e?!!(t.status===503||t.status===502||t.status===401||t.status===400&&t.message.includes(`Organization-Id header`)):!1}function di(e,t){return e>=li?!1:ui(t)}function fi(e){if(!(e instanceof TypeError))return!1;let t=e.message;return!!(t===`Failed to fetch`||t.startsWith(`Failed to fetch (`)&&t.endsWith(`)`)||t===`Load failed`||t.startsWith(`Load failed (`)&&t.endsWith(`)`)||t===`NetworkError when attempting to fetch resource`||t===`NetworkError when attempting to fetch resource.`)}function pi(e){if(e instanceof Error)return e;if(typeof e==`object`&&e){let t=e,n=t.detail;if(typeof n==`string`){let t=Error(n);return t.cause=e,t}let r=t.message;if(typeof r==`string`){let t=Error(r);return t.cause=e,t}try{let t=Error(JSON.stringify(e));return t.cause=e,t}catch{let t=Error(`Non-serializable error object`);return t.cause=e,t}}return Error(String(e))}function mi(e,t){if(fi(e)||t.bestEffort&&ui(e))return;console.error(`[${t.context}]`,e);let n=pi(e),r={...t.extra};n!==e&&(r.originalError=e),ei(n,{level:t.level,tags:{context:t.context,...t.tags},...Object.keys(r).length>0?{extra:r}:{}})}export{D as $,yn as A,g as At,I as B,Wn as C,b as Ct,Dn as D,se as Dt,On as E,ue as Et,Qt as F,n as Ft,j as G,L as H,Ft as I,t as It,k as J,A as K,Pt as L,H as M,o as Mt,$t as N,i as Nt,Cn as O,s as Ot,B as P,r as Pt,Je as Q,Nt as R,Vn as S,y as St,Nn as T,de as Tt,Tt as U,Ct as V,wt as W,Ye as X,Xe as Y,Ze as Z,Bn as _,x as _t,ei as a,ze as at,Hn as b,ye as bt,ii as c,Pe as ct,Ur as d,ke as dt,He as et,Ir as f,ge as ft,er as g,xe as gt,tr as h,he as ht,ni as i,S as it,gn as j,l as jt,xn as k,u as kt,ri as l,Me as lt,mr as m,me as mt,fi as n,Be as nt,ti as o,Ne as ot,Fr as p,_e as pt,O as q,di as r,T as rt,ci as s,Fe as st,mi as t,Ue as tt,ai as u,je as ut,qn as v,ve as vt,J as w,oe as wt,Xn as x,Ee as xt,Y as y,be as yt,R as z};