@hienlh/ppm 0.23.36 → 0.23.37

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 (463) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/assets/skills/ppm/SKILL.md +1 -1
  3. package/assets/skills/ppm/references/http-api.md +1 -1
  4. package/dist/web/assets/{accounts-settings-section-CjFxBdAg.js → accounts-settings-section-BqecmsoA.js} +1 -1
  5. package/dist/web/assets/accounts-settings-section-BqecmsoA.js.br +0 -0
  6. package/dist/web/assets/accounts-settings-section-BqecmsoA.js.gz +0 -0
  7. package/dist/web/assets/{agent-session-sheet-DokMdhZO.js → agent-session-sheet-OiEfPbDF.js} +2 -2
  8. package/dist/web/assets/agent-session-sheet-OiEfPbDF.js.br +0 -0
  9. package/dist/web/assets/agent-session-sheet-OiEfPbDF.js.gz +0 -0
  10. package/dist/web/assets/{agent-session-window-content-DisypnQY.js → agent-session-window-content-CVwlys5q.js} +1 -1
  11. package/dist/web/assets/agent-session-window-content-CVwlys5q.js.br +0 -0
  12. package/dist/web/assets/agent-session-window-content-CVwlys5q.js.gz +0 -0
  13. package/dist/web/assets/{ai-resource-editor-zrP-egdg.js → ai-resource-editor-Du_9S9kA.js} +1 -1
  14. package/dist/web/assets/ai-resource-editor-Du_9S9kA.js.br +0 -0
  15. package/dist/web/assets/ai-resource-editor-Du_9S9kA.js.gz +0 -0
  16. package/dist/web/assets/{ai-settings-section-DzlGEZtA.js → ai-settings-section-CSuiATMV.js} +1 -1
  17. package/dist/web/assets/{ai-settings-section-DG2NecJy.js → ai-settings-section-PZglMLRl.js} +1 -1
  18. package/dist/web/assets/ai-settings-section-PZglMLRl.js.br +0 -0
  19. package/dist/web/assets/ai-settings-section-PZglMLRl.js.gz +0 -0
  20. package/dist/web/assets/{android-tab-BquWQtAV.js → android-tab-CXjsyLHP.js} +1 -1
  21. package/dist/web/assets/android-tab-CXjsyLHP.js.br +0 -0
  22. package/dist/web/assets/android-tab-CXjsyLHP.js.gz +0 -0
  23. package/dist/web/assets/{appearance-settings-section-CTwaAuDu.js → appearance-settings-section-BM1-xo4F.js} +1 -1
  24. package/dist/web/assets/appearance-settings-section-BM1-xo4F.js.br +0 -0
  25. package/dist/web/assets/appearance-settings-section-BM1-xo4F.js.gz +0 -0
  26. package/dist/web/assets/{apps-panel-cOFEh4Yj.js → apps-panel-BU4HzsNe.js} +1 -1
  27. package/dist/web/assets/apps-panel-BU4HzsNe.js.br +0 -0
  28. package/dist/web/assets/apps-panel-BU4HzsNe.js.gz +0 -0
  29. package/dist/web/assets/{branch-review-tab-QxDbY-8Z.js → branch-review-tab-BpxQekO5.js} +1 -1
  30. package/dist/web/assets/branch-review-tab-BpxQekO5.js.br +0 -0
  31. package/dist/web/assets/branch-review-tab-BpxQekO5.js.gz +0 -0
  32. package/dist/web/assets/{chat-tab-CTYO3Gd-.js → chat-tab-0gJ05Q2m.js} +1 -1
  33. package/dist/web/assets/chat-tab-0gJ05Q2m.js.br +0 -0
  34. package/dist/web/assets/chat-tab-0gJ05Q2m.js.gz +0 -0
  35. package/dist/web/assets/{chat-tab-DhUwj1wc.js → chat-tab-BxbrkXLz.js} +12 -12
  36. package/dist/web/assets/chat-tab-BxbrkXLz.js.br +0 -0
  37. package/dist/web/assets/chat-tab-BxbrkXLz.js.gz +0 -0
  38. package/dist/web/assets/{code-editor-DoevbJdr.js → code-editor-BRrPWyxx.js} +4 -4
  39. package/dist/web/assets/code-editor-BRrPWyxx.js.br +0 -0
  40. package/dist/web/assets/code-editor-BRrPWyxx.js.gz +0 -0
  41. package/dist/web/assets/codex-plan-label-BMq1Pj0j.js +1 -0
  42. package/dist/web/assets/codex-plan-label-BMq1Pj0j.js.br +0 -0
  43. package/dist/web/assets/codex-plan-label-BMq1Pj0j.js.gz +0 -0
  44. package/dist/web/assets/{conflict-editor-CsuNXN76.js → conflict-editor-D6LMYODJ.js} +1 -1
  45. package/dist/web/assets/conflict-editor-D6LMYODJ.js.br +0 -0
  46. package/dist/web/assets/conflict-editor-D6LMYODJ.js.gz +0 -0
  47. package/dist/web/assets/{connection-form-tab-uBs-3oG5.js → connection-form-tab-TZKBTY_b.js} +1 -1
  48. package/dist/web/assets/connection-form-tab-TZKBTY_b.js.br +0 -0
  49. package/dist/web/assets/{connection-form-tab-uBs-3oG5.js.gz → connection-form-tab-TZKBTY_b.js.gz} +0 -0
  50. package/dist/web/assets/{csv-preview-BW3gv_eU.js → csv-preview-BQwhXKFj.js} +1 -1
  51. package/dist/web/assets/csv-preview-BQwhXKFj.js.br +0 -0
  52. package/dist/web/assets/csv-preview-BQwhXKFj.js.gz +0 -0
  53. package/dist/web/assets/{db-tab-parts-I39hQTWa.js → db-tab-parts-ovTyiRol.js} +1 -1
  54. package/dist/web/assets/db-tab-parts-ovTyiRol.js.br +0 -0
  55. package/dist/web/assets/db-tab-parts-ovTyiRol.js.gz +0 -0
  56. package/dist/web/assets/{design-settings-section-CXL4kng5.js → design-settings-section-C3Z6BH4L.js} +1 -1
  57. package/dist/web/assets/design-settings-section-C3Z6BH4L.js.br +0 -0
  58. package/dist/web/assets/design-settings-section-C3Z6BH4L.js.gz +0 -0
  59. package/dist/web/assets/{design-tab-BTqWpEuL.js → design-tab-C86a4i5X.js} +1 -1
  60. package/dist/web/assets/design-tab-C86a4i5X.js.br +0 -0
  61. package/dist/web/assets/design-tab-C86a4i5X.js.gz +0 -0
  62. package/dist/web/assets/{designs-sidebar-panel-C0OY7GHg.js → designs-sidebar-panel-DE6o3mwd.js} +1 -1
  63. package/dist/web/assets/designs-sidebar-panel-DE6o3mwd.js.br +0 -0
  64. package/dist/web/assets/designs-sidebar-panel-DE6o3mwd.js.gz +0 -0
  65. package/dist/web/assets/{diff-viewer-C5GDAmkh.js → diff-viewer-CvCVdYsj.js} +1 -1
  66. package/dist/web/assets/diff-viewer-CvCVdYsj.js.br +0 -0
  67. package/dist/web/assets/diff-viewer-CvCVdYsj.js.gz +0 -0
  68. package/dist/web/assets/{docx-preview-CYQBaDJU.js → docx-preview-C65V_WXK.js} +1 -1
  69. package/dist/web/assets/docx-preview-C65V_WXK.js.br +0 -0
  70. package/dist/web/assets/docx-preview-C65V_WXK.js.gz +0 -0
  71. package/dist/web/assets/{editor-dialog-D8qhT7Aw.js → editor-dialog-5e66Mkbr.js} +1 -1
  72. package/dist/web/assets/editor-dialog-5e66Mkbr.js.br +0 -0
  73. package/dist/web/assets/editor-dialog-5e66Mkbr.js.gz +0 -0
  74. package/dist/web/assets/{editor-language-service-CRt0uAil.js → editor-language-service-D5E8gpKg.js} +1 -1
  75. package/dist/web/assets/editor-language-service-D5E8gpKg.js.br +0 -0
  76. package/dist/web/assets/editor-language-service-D5E8gpKg.js.gz +0 -0
  77. package/dist/web/assets/{explorer-body-D1nnO914.js → explorer-body-CKo1b-px.js} +1 -1
  78. package/dist/web/assets/explorer-body-CKo1b-px.js.br +0 -0
  79. package/dist/web/assets/explorer-body-CKo1b-px.js.gz +0 -0
  80. package/dist/web/assets/{explorer-window-content-BaX0Fyvl.js → explorer-window-content-Cny9rBPR.js} +1 -1
  81. package/dist/web/assets/explorer-window-content-Cny9rBPR.js.br +0 -0
  82. package/dist/web/assets/explorer-window-content-Cny9rBPR.js.gz +0 -0
  83. package/dist/web/assets/{extension-manager-section-BbiLbHbJ.js → extension-manager-section-Cwm_A0eX.js} +1 -1
  84. package/dist/web/assets/extension-manager-section-Cwm_A0eX.js.br +0 -0
  85. package/dist/web/assets/extension-manager-section-Cwm_A0eX.js.gz +0 -0
  86. package/dist/web/assets/{extension-webview-0KipBIzt.js → extension-webview-DVgUwiLx.js} +1 -1
  87. package/dist/web/assets/extension-webview-DVgUwiLx.js.br +0 -0
  88. package/dist/web/assets/extension-webview-DVgUwiLx.js.gz +0 -0
  89. package/dist/web/assets/{files-settings-section-B_hvaBcA.js → files-settings-section-Bi5Em_JV.js} +1 -1
  90. package/dist/web/assets/files-settings-section-Bi5Em_JV.js.br +0 -0
  91. package/dist/web/assets/files-settings-section-Bi5Em_JV.js.gz +0 -0
  92. package/dist/web/assets/{general-settings-section-C6ZTXQH1.js → general-settings-section-DmxA1IOg.js} +1 -1
  93. package/dist/web/assets/general-settings-section-DmxA1IOg.js.br +0 -0
  94. package/dist/web/assets/general-settings-section-DmxA1IOg.js.gz +0 -0
  95. package/dist/web/assets/{git-log-panel-BQQI-0fE.js → git-log-panel-BM7G_THH.js} +1 -1
  96. package/dist/web/assets/git-log-panel-BM7G_THH.js.br +0 -0
  97. package/dist/web/assets/git-log-panel-BM7G_THH.js.gz +0 -0
  98. package/dist/web/assets/{git-review-tab-D7VE2zu-.js → git-review-tab-DN7GixUN.js} +1 -1
  99. package/dist/web/assets/git-review-tab-DN7GixUN.js.br +0 -0
  100. package/dist/web/assets/git-review-tab-DN7GixUN.js.gz +0 -0
  101. package/dist/web/assets/{glide-data-grid-CTJNrIu5.js → glide-data-grid-Cd-By4_k.js} +1 -1
  102. package/dist/web/assets/glide-data-grid-Cd-By4_k.js.br +0 -0
  103. package/dist/web/assets/glide-data-grid-Cd-By4_k.js.gz +0 -0
  104. package/dist/web/assets/{grid-save-dialog-DNpOGdSQ.js → grid-save-dialog-Bysi6jcf.js} +1 -1
  105. package/dist/web/assets/grid-save-dialog-Bysi6jcf.js.br +0 -0
  106. package/dist/web/assets/grid-save-dialog-Bysi6jcf.js.gz +0 -0
  107. package/dist/web/assets/{group-chat-tab-BJrtoUK_.js → group-chat-tab-Cwnmgveq.js} +1 -1
  108. package/dist/web/assets/group-chat-tab-Cwnmgveq.js.br +0 -0
  109. package/dist/web/assets/group-chat-tab-Cwnmgveq.js.gz +0 -0
  110. package/dist/web/assets/{impexp-tab-8Ge-Cr5T.js → impexp-tab-pRKP_Gem.js} +1 -1
  111. package/dist/web/assets/impexp-tab-pRKP_Gem.js.br +0 -0
  112. package/dist/web/assets/impexp-tab-pRKP_Gem.js.gz +0 -0
  113. package/dist/web/assets/index-BvTu5VV7.css +1 -0
  114. package/dist/web/assets/index-BvTu5VV7.css.br +0 -0
  115. package/dist/web/assets/{index-D3MnZKxU.css.gz → index-BvTu5VV7.css.gz} +0 -0
  116. package/dist/web/assets/{index-BHvvTbga.js → index-Djsgk-RQ.js} +5 -5
  117. package/dist/web/assets/index-Djsgk-RQ.js.br +0 -0
  118. package/dist/web/assets/index-Djsgk-RQ.js.gz +0 -0
  119. package/dist/web/assets/{jira-watcher-section-CnmEBymz.js → jira-watcher-section-D99EOVyT.js} +1 -1
  120. package/dist/web/assets/{keybindings-store-DtSCjHoL.js → keybindings-store-DMfPHNlt.js} +1 -1
  121. package/dist/web/assets/{keyboard-shortcuts-section-BSfZbQyP.js → keyboard-shortcuts-section-U1icIFbF.js} +1 -1
  122. package/dist/web/assets/keyboard-shortcuts-section-U1icIFbF.js.br +0 -0
  123. package/dist/web/assets/keyboard-shortcuts-section-U1icIFbF.js.gz +0 -0
  124. package/dist/web/assets/{language-servers-section-BZR0UGSm.js → language-servers-section-YjP8WoJN.js} +2 -2
  125. package/dist/web/assets/language-servers-section-YjP8WoJN.js.br +0 -0
  126. package/dist/web/assets/language-servers-section-YjP8WoJN.js.gz +0 -0
  127. package/dist/web/assets/{logs-app-Mqr7XksW.js → logs-app-F0bClkEJ.js} +1 -1
  128. package/dist/web/assets/logs-app-F0bClkEJ.js.br +0 -0
  129. package/dist/web/assets/logs-app-F0bClkEJ.js.gz +0 -0
  130. package/dist/web/assets/{logs-tab-CHOFUoGy.js → logs-tab-D1qP9Per.js} +1 -1
  131. package/dist/web/assets/{logs-window-content-BePVs7-A.js → logs-window-content-CFITrRuA.js} +1 -1
  132. package/dist/web/assets/{lsp-client-C0B7zeCJ.js → lsp-client-CueAbn9s.js} +1 -1
  133. package/dist/web/assets/lsp-client-CueAbn9s.js.br +0 -0
  134. package/dist/web/assets/lsp-client-CueAbn9s.js.gz +0 -0
  135. package/dist/web/assets/{markdown-renderer-BIDN9baQ.js → markdown-renderer-B_2Teawh.js} +1 -1
  136. package/dist/web/assets/markdown-renderer-B_2Teawh.js.br +0 -0
  137. package/dist/web/assets/markdown-renderer-B_2Teawh.js.gz +0 -0
  138. package/dist/web/assets/{markdown-renderer-62O03K4n.js → markdown-renderer-CHxQpk27.js} +1 -1
  139. package/dist/web/assets/{mobile-explorer-sheet-BhQPxHBc.js → mobile-explorer-sheet-D3ToEKi8.js} +1 -1
  140. package/dist/web/assets/mobile-explorer-sheet-D3ToEKi8.js.br +0 -0
  141. package/dist/web/assets/mobile-explorer-sheet-D3ToEKi8.js.gz +0 -0
  142. package/dist/web/assets/{new-design-dialog-BazaRq_B.js → new-design-dialog-D6LS4c5f.js} +1 -1
  143. package/dist/web/assets/new-design-dialog-D6LS4c5f.js.br +0 -0
  144. package/dist/web/assets/{new-design-dialog-BazaRq_B.js.gz → new-design-dialog-D6LS4c5f.js.gz} +0 -0
  145. package/dist/web/assets/{notification-store-B_6yqI0W.js → notification-store-CaOtP7gW.js} +1 -1
  146. package/dist/web/assets/{notifications-settings-section-dcLa92xt.js → notifications-settings-section-CtN-Dp9a.js} +1 -1
  147. package/dist/web/assets/notifications-settings-section-CtN-Dp9a.js.br +0 -0
  148. package/dist/web/assets/notifications-settings-section-CtN-Dp9a.js.gz +0 -0
  149. package/dist/web/assets/{onboarding-entry-BRF9VsQN.js → onboarding-entry-Dt8lTftA.js} +1 -1
  150. package/dist/web/assets/onboarding-entry-Dt8lTftA.js.br +0 -0
  151. package/dist/web/assets/onboarding-entry-Dt8lTftA.js.gz +0 -0
  152. package/dist/web/assets/{ppmbot-settings-section-CLX9ltge.js → ppmbot-settings-section-C14V_1AT.js} +1 -1
  153. package/dist/web/assets/ppmbot-settings-section-C14V_1AT.js.br +0 -0
  154. package/dist/web/assets/ppmbot-settings-section-C14V_1AT.js.gz +0 -0
  155. package/dist/web/assets/{problems-panel-DyZfJjNv.js → problems-panel-Cc3oLH10.js} +1 -1
  156. package/dist/web/assets/problems-panel-Cc3oLH10.js.br +0 -0
  157. package/dist/web/assets/problems-panel-Cc3oLH10.js.gz +0 -0
  158. package/dist/web/assets/{process-table-D_cl8fX6.js → process-table-DFSuCzJv.js} +1 -1
  159. package/dist/web/assets/process-table-DFSuCzJv.js.br +0 -0
  160. package/dist/web/assets/process-table-DFSuCzJv.js.gz +0 -0
  161. package/dist/web/assets/{proxy-settings-section-DiYZqeel.js → proxy-settings-section-D_10YLhJ.js} +1 -1
  162. package/dist/web/assets/proxy-settings-section-D_10YLhJ.js.br +0 -0
  163. package/dist/web/assets/proxy-settings-section-D_10YLhJ.js.gz +0 -0
  164. package/dist/web/assets/{query-tab-QeOJEYu6.js → query-tab-BBW66pt8.js} +1 -1
  165. package/dist/web/assets/query-tab-BBW66pt8.js.br +0 -0
  166. package/dist/web/assets/query-tab-BBW66pt8.js.gz +0 -0
  167. package/dist/web/assets/{release-notes-window-content-D0IzDo-Z.js → release-notes-window-content-BhkXneq_.js} +1 -1
  168. package/dist/web/assets/{remote-access-settings-section-CUZWiQ1v.js → remote-access-settings-section-D7HZbkf9.js} +1 -1
  169. package/dist/web/assets/remote-access-settings-section-D7HZbkf9.js.br +0 -0
  170. package/dist/web/assets/remote-access-settings-section-D7HZbkf9.js.gz +0 -0
  171. package/dist/web/assets/{remote-desktop-clipboard-notice-DTUdeg9F.js → remote-desktop-clipboard-notice-D__pMfmv.js} +1 -1
  172. package/dist/web/assets/remote-desktop-clipboard-notice-D__pMfmv.js.br +0 -0
  173. package/dist/web/assets/remote-desktop-clipboard-notice-D__pMfmv.js.gz +0 -0
  174. package/dist/web/assets/{remote-desktop-mobile-sheet-Cn15Oy14.js → remote-desktop-mobile-sheet-D5Vkceoa.js} +2 -2
  175. package/dist/web/assets/remote-desktop-mobile-sheet-D5Vkceoa.js.br +0 -0
  176. package/dist/web/assets/remote-desktop-mobile-sheet-D5Vkceoa.js.gz +0 -0
  177. package/dist/web/assets/{remote-desktop-mobile-view-IgZj2-ut.js → remote-desktop-mobile-view-Bt2dcN1D.js} +1 -1
  178. package/dist/web/assets/remote-desktop-mobile-view-Bt2dcN1D.js.br +0 -0
  179. package/dist/web/assets/remote-desktop-mobile-view-Bt2dcN1D.js.gz +0 -0
  180. package/dist/web/assets/{remote-desktop-readiness-gate-EVamF7Pp.js → remote-desktop-readiness-gate-BpFfyTsH.js} +1 -1
  181. package/dist/web/assets/remote-desktop-readiness-gate-BpFfyTsH.js.br +0 -0
  182. package/dist/web/assets/remote-desktop-readiness-gate-BpFfyTsH.js.gz +0 -0
  183. package/dist/web/assets/{remote-desktop-window-content-CzRea9Ma.js → remote-desktop-window-content-C7-VCR9l.js} +1 -1
  184. package/dist/web/assets/remote-desktop-window-content-C7-VCR9l.js.br +0 -0
  185. package/dist/web/assets/remote-desktop-window-content-C7-VCR9l.js.gz +0 -0
  186. package/dist/web/assets/{rename-object-dialog-ClxOzltJ.js → rename-object-dialog-Ci2Q-EjU.js} +1 -1
  187. package/dist/web/assets/rename-object-dialog-Ci2Q-EjU.js.br +0 -0
  188. package/dist/web/assets/rename-object-dialog-Ci2Q-EjU.js.gz +0 -0
  189. package/dist/web/assets/{review-address-setup-SeS8KBv0.js → review-address-setup-ClD8hIdZ.js} +1 -1
  190. package/dist/web/assets/review-address-setup-ClD8hIdZ.js.br +0 -0
  191. package/dist/web/assets/review-address-setup-ClD8hIdZ.js.gz +0 -0
  192. package/dist/web/assets/{review-code-C9JeMsgd.js → review-code-C6hCzJPK.js} +1 -1
  193. package/dist/web/assets/review-code-C6hCzJPK.js.br +0 -0
  194. package/dist/web/assets/review-code-C6hCzJPK.js.gz +0 -0
  195. package/dist/web/assets/{save-as-dialog-DUGe1msn.js → save-as-dialog-C3x3p2a1.js} +1 -1
  196. package/dist/web/assets/save-as-dialog-C3x3p2a1.js.br +0 -0
  197. package/dist/web/assets/save-as-dialog-C3x3p2a1.js.gz +0 -0
  198. package/dist/web/assets/{schedule-script-editor-OnPofNSL.js → schedule-script-editor-DTouje50.js} +1 -1
  199. package/dist/web/assets/schedule-script-editor-DTouje50.js.br +0 -0
  200. package/dist/web/assets/schedule-script-editor-DTouje50.js.gz +0 -0
  201. package/dist/web/assets/{schedules-settings-section-BVMhJ_lq.js → schedules-settings-section-WLKCVgcB.js} +3 -3
  202. package/dist/web/assets/schedules-settings-section-WLKCVgcB.js.br +0 -0
  203. package/dist/web/assets/schedules-settings-section-WLKCVgcB.js.gz +0 -0
  204. package/dist/web/assets/{session-review-tab-DJNFQBa6.js → session-review-tab-BiJdqULL.js} +1 -1
  205. package/dist/web/assets/session-review-tab-BiJdqULL.js.br +0 -0
  206. package/dist/web/assets/session-review-tab-BiJdqULL.js.gz +0 -0
  207. package/dist/web/assets/{settings-body-B-UepuqB.js → settings-body-Bclb7RrO.js} +1 -1
  208. package/dist/web/assets/settings-body-Bclb7RrO.js.br +0 -0
  209. package/dist/web/assets/settings-body-Bclb7RrO.js.gz +0 -0
  210. package/dist/web/assets/{settings-rows-B6rP-SIH.js → settings-rows-DHLeflwQ.js} +1 -1
  211. package/dist/web/assets/settings-rows-DHLeflwQ.js.br +0 -0
  212. package/dist/web/assets/settings-rows-DHLeflwQ.js.gz +0 -0
  213. package/dist/web/assets/{settings-section-content-DhGKgK-F.js → settings-section-content-DCAeJ74-.js} +1 -1
  214. package/dist/web/assets/{settings-section-content-DELpUBHR.js → settings-section-content-DPgMyITT.js} +2 -2
  215. package/dist/web/assets/settings-section-content-DPgMyITT.js.br +0 -0
  216. package/dist/web/assets/settings-section-content-DPgMyITT.js.gz +0 -0
  217. package/dist/web/assets/{settings-tab-9_XyQXaU.js → settings-tab-BqD_lM3r.js} +1 -1
  218. package/dist/web/assets/{settings-window-content-CH1hxQSr.js → settings-window-content-zyX-qZcM.js} +1 -1
  219. package/dist/web/assets/{slash-command-picker-Dum6VEgK.js → slash-command-picker-DlAIFFRx.js} +1 -1
  220. package/dist/web/assets/slash-command-picker-DlAIFFRx.js.br +0 -0
  221. package/dist/web/assets/slash-command-picker-DlAIFFRx.js.gz +0 -0
  222. package/dist/web/assets/{sql-object-tab-DxPktQgd.js → sql-object-tab-oJBWJhmf.js} +1 -1
  223. package/dist/web/assets/sql-object-tab-oJBWJhmf.js.br +0 -0
  224. package/dist/web/assets/sql-object-tab-oJBWJhmf.js.gz +0 -0
  225. package/dist/web/assets/{sqlite-viewer-BnJNxUx1.js → sqlite-viewer-52ODwLuu.js} +1 -1
  226. package/dist/web/assets/sqlite-viewer-52ODwLuu.js.br +0 -0
  227. package/dist/web/assets/sqlite-viewer-52ODwLuu.js.gz +0 -0
  228. package/dist/web/assets/{storage-settings-section-Crir_VX_.js → storage-settings-section-DLQg2r4O.js} +1 -1
  229. package/dist/web/assets/storage-settings-section-DLQg2r4O.js.br +0 -0
  230. package/dist/web/assets/storage-settings-section-DLQg2r4O.js.gz +0 -0
  231. package/dist/web/assets/{structure-save-dialog-CC9GZmu3.js → structure-save-dialog-Dsk6LIod.js} +1 -1
  232. package/dist/web/assets/structure-save-dialog-Dsk6LIod.js.br +0 -0
  233. package/dist/web/assets/structure-save-dialog-Dsk6LIod.js.gz +0 -0
  234. package/dist/web/assets/{structure-tab-B7kGe-br.js → structure-tab-CB7hPpzs.js} +1 -1
  235. package/dist/web/assets/structure-tab-CB7hPpzs.js.br +0 -0
  236. package/dist/web/assets/structure-tab-CB7hPpzs.js.gz +0 -0
  237. package/dist/web/assets/{system-monitor-body-DZlO_tNA.js → system-monitor-body-riDaJGUH.js} +2 -2
  238. package/dist/web/assets/system-monitor-body-riDaJGUH.js.br +0 -0
  239. package/dist/web/assets/system-monitor-body-riDaJGUH.js.gz +0 -0
  240. package/dist/web/assets/{system-monitor-tab-sEoms0Dd.js → system-monitor-tab-DGOJrSxt.js} +1 -1
  241. package/dist/web/assets/{system-monitor-window-content-DzhthPo2.js → system-monitor-window-content-CVdRWw88.js} +1 -1
  242. package/dist/web/assets/{tab-host-window-content-BjijxHh2.js → tab-host-window-content-BHSn8qO0.js} +1 -1
  243. package/dist/web/assets/tab-host-window-content-BHSn8qO0.js.br +0 -0
  244. package/dist/web/assets/tab-host-window-content-BHSn8qO0.js.gz +0 -0
  245. package/dist/web/assets/{table-tab-BoQ3Ccwk.js → table-tab-C_0OFX08.js} +1 -1
  246. package/dist/web/assets/table-tab-C_0OFX08.js.br +0 -0
  247. package/dist/web/assets/table-tab-C_0OFX08.js.gz +0 -0
  248. package/dist/web/assets/{telegram-bot-token-field-UEjJjF3U.js → telegram-bot-token-field-C7E5TbgV.js} +1 -1
  249. package/dist/web/assets/telegram-bot-token-field-C7E5TbgV.js.br +0 -0
  250. package/dist/web/assets/telegram-bot-token-field-C7E5TbgV.js.gz +0 -0
  251. package/dist/web/assets/{terminal-tab-CRzOW6US.js → terminal-tab-CnBA7BeP.js} +1 -1
  252. package/dist/web/assets/terminal-tab-CnBA7BeP.js.br +0 -0
  253. package/dist/web/assets/terminal-tab-CnBA7BeP.js.gz +0 -0
  254. package/dist/web/assets/{tool-cards-BGBN5UZE.js → tool-cards-JYbIrLD8.js} +10 -10
  255. package/dist/web/assets/tool-cards-JYbIrLD8.js.br +0 -0
  256. package/dist/web/assets/tool-cards-JYbIrLD8.js.gz +0 -0
  257. package/dist/web/assets/{tools-settings-section-DapxgQrZ.js → tools-settings-section-DjLW6AM1.js} +1 -1
  258. package/dist/web/assets/tools-settings-section-DjLW6AM1.js.br +0 -0
  259. package/dist/web/assets/tools-settings-section-DjLW6AM1.js.gz +0 -0
  260. package/dist/web/assets/{use-inline-blame-DduNqmR5.js → use-inline-blame-8fCUHKP0.js} +1 -1
  261. package/dist/web/assets/use-inline-blame-8fCUHKP0.js.br +0 -0
  262. package/dist/web/assets/use-inline-blame-8fCUHKP0.js.gz +0 -0
  263. package/dist/web/assets/{use-lsp-CvPLJ8RW.js → use-lsp-DCuYqz2U.js} +1 -1
  264. package/dist/web/assets/use-lsp-DCuYqz2U.js.br +0 -0
  265. package/dist/web/assets/use-lsp-DCuYqz2U.js.gz +0 -0
  266. package/dist/web/assets/{use-monaco-theme-Mjvg3zoP.js → use-monaco-theme-Do0n80KC.js} +1 -1
  267. package/dist/web/assets/{use-process-kill-Byc4-u0T.js → use-process-kill-C8aSMLzg.js} +1 -1
  268. package/dist/web/assets/use-process-kill-C8aSMLzg.js.br +0 -0
  269. package/dist/web/assets/use-process-kill-C8aSMLzg.js.gz +0 -0
  270. package/dist/web/assets/{use-sql-schema-info-_j_Ba57n.js → use-sql-schema-info-UitR1tk3.js} +1 -1
  271. package/dist/web/assets/use-sql-schema-info-UitR1tk3.js.br +0 -0
  272. package/dist/web/assets/use-sql-schema-info-UitR1tk3.js.gz +0 -0
  273. package/dist/web/assets/{use-websocket-BZRI2q32.js → use-websocket-DnhUE09Z.js} +1 -1
  274. package/dist/web/assets/{web-preview-tab-D-zUCdMS.js → web-preview-tab-BW4ulv7h.js} +1 -1
  275. package/dist/web/assets/web-preview-tab-BW4ulv7h.js.br +0 -0
  276. package/dist/web/assets/web-preview-tab-BW4ulv7h.js.gz +0 -0
  277. package/dist/web/index.html +2 -2
  278. package/dist/web/index.html.br +0 -0
  279. package/dist/web/index.html.gz +0 -0
  280. package/dist/web/sw.js +1 -1
  281. package/dist/web/sw.js.br +0 -0
  282. package/dist/web/sw.js.gz +0 -0
  283. package/docs/architecture/workspace-and-ui.md +9 -2
  284. package/package.json +1 -1
  285. package/src/web/components/chat/chat-footer-tools.tsx +17 -2
  286. package/src/web/components/chat/chat-more-menu.tsx +6 -3
  287. package/src/web/components/chat/linked-sessions-panel.tsx +3 -3
  288. package/src/web/components/chat/switch-account-view.tsx +12 -5
  289. package/src/web/components/chat/usage-meters.tsx +8 -2
  290. package/src/web/components/settings/accounts/account-usage-format.ts +56 -0
  291. package/src/web/lib/chat-account-switch.ts +11 -9
  292. package/src/web/lib/linked-sessions.ts +10 -0
  293. package/dist/web/assets/accounts-settings-section-CjFxBdAg.js.br +0 -0
  294. package/dist/web/assets/accounts-settings-section-CjFxBdAg.js.gz +0 -0
  295. package/dist/web/assets/agent-session-sheet-DokMdhZO.js.br +0 -0
  296. package/dist/web/assets/agent-session-sheet-DokMdhZO.js.gz +0 -0
  297. package/dist/web/assets/agent-session-window-content-DisypnQY.js.br +0 -0
  298. package/dist/web/assets/agent-session-window-content-DisypnQY.js.gz +0 -0
  299. package/dist/web/assets/ai-resource-editor-zrP-egdg.js.br +0 -0
  300. package/dist/web/assets/ai-resource-editor-zrP-egdg.js.gz +0 -0
  301. package/dist/web/assets/ai-settings-section-DG2NecJy.js.br +0 -0
  302. package/dist/web/assets/ai-settings-section-DG2NecJy.js.gz +0 -0
  303. package/dist/web/assets/android-tab-BquWQtAV.js.br +0 -0
  304. package/dist/web/assets/android-tab-BquWQtAV.js.gz +0 -0
  305. package/dist/web/assets/appearance-settings-section-CTwaAuDu.js.br +0 -0
  306. package/dist/web/assets/appearance-settings-section-CTwaAuDu.js.gz +0 -0
  307. package/dist/web/assets/apps-panel-cOFEh4Yj.js.br +0 -0
  308. package/dist/web/assets/apps-panel-cOFEh4Yj.js.gz +0 -0
  309. package/dist/web/assets/branch-review-tab-QxDbY-8Z.js.br +0 -0
  310. package/dist/web/assets/branch-review-tab-QxDbY-8Z.js.gz +0 -0
  311. package/dist/web/assets/chat-tab-CTYO3Gd-.js.br +0 -0
  312. package/dist/web/assets/chat-tab-CTYO3Gd-.js.gz +0 -0
  313. package/dist/web/assets/chat-tab-DhUwj1wc.js.br +0 -0
  314. package/dist/web/assets/chat-tab-DhUwj1wc.js.gz +0 -0
  315. package/dist/web/assets/code-editor-DoevbJdr.js.br +0 -0
  316. package/dist/web/assets/code-editor-DoevbJdr.js.gz +0 -0
  317. package/dist/web/assets/codex-plan-label-DWfmhfSE.js +0 -1
  318. package/dist/web/assets/codex-plan-label-DWfmhfSE.js.br +0 -0
  319. package/dist/web/assets/codex-plan-label-DWfmhfSE.js.gz +0 -0
  320. package/dist/web/assets/conflict-editor-CsuNXN76.js.br +0 -0
  321. package/dist/web/assets/conflict-editor-CsuNXN76.js.gz +0 -0
  322. package/dist/web/assets/connection-form-tab-uBs-3oG5.js.br +0 -0
  323. package/dist/web/assets/csv-preview-BW3gv_eU.js.br +0 -0
  324. package/dist/web/assets/csv-preview-BW3gv_eU.js.gz +0 -0
  325. package/dist/web/assets/db-tab-parts-I39hQTWa.js.br +0 -0
  326. package/dist/web/assets/db-tab-parts-I39hQTWa.js.gz +0 -0
  327. package/dist/web/assets/design-settings-section-CXL4kng5.js.br +0 -0
  328. package/dist/web/assets/design-settings-section-CXL4kng5.js.gz +0 -0
  329. package/dist/web/assets/design-tab-BTqWpEuL.js.br +0 -0
  330. package/dist/web/assets/design-tab-BTqWpEuL.js.gz +0 -0
  331. package/dist/web/assets/designs-sidebar-panel-C0OY7GHg.js.br +0 -0
  332. package/dist/web/assets/designs-sidebar-panel-C0OY7GHg.js.gz +0 -0
  333. package/dist/web/assets/diff-viewer-C5GDAmkh.js.br +0 -0
  334. package/dist/web/assets/diff-viewer-C5GDAmkh.js.gz +0 -0
  335. package/dist/web/assets/docx-preview-CYQBaDJU.js.br +0 -0
  336. package/dist/web/assets/docx-preview-CYQBaDJU.js.gz +0 -0
  337. package/dist/web/assets/editor-dialog-D8qhT7Aw.js.br +0 -0
  338. package/dist/web/assets/editor-dialog-D8qhT7Aw.js.gz +0 -0
  339. package/dist/web/assets/editor-language-service-CRt0uAil.js.br +0 -0
  340. package/dist/web/assets/editor-language-service-CRt0uAil.js.gz +0 -0
  341. package/dist/web/assets/explorer-body-D1nnO914.js.br +0 -0
  342. package/dist/web/assets/explorer-body-D1nnO914.js.gz +0 -0
  343. package/dist/web/assets/explorer-window-content-BaX0Fyvl.js.br +0 -0
  344. package/dist/web/assets/explorer-window-content-BaX0Fyvl.js.gz +0 -0
  345. package/dist/web/assets/extension-manager-section-BbiLbHbJ.js.br +0 -0
  346. package/dist/web/assets/extension-manager-section-BbiLbHbJ.js.gz +0 -0
  347. package/dist/web/assets/extension-webview-0KipBIzt.js.br +0 -0
  348. package/dist/web/assets/extension-webview-0KipBIzt.js.gz +0 -0
  349. package/dist/web/assets/files-settings-section-B_hvaBcA.js.br +0 -0
  350. package/dist/web/assets/files-settings-section-B_hvaBcA.js.gz +0 -0
  351. package/dist/web/assets/general-settings-section-C6ZTXQH1.js.br +0 -0
  352. package/dist/web/assets/general-settings-section-C6ZTXQH1.js.gz +0 -0
  353. package/dist/web/assets/git-log-panel-BQQI-0fE.js.br +0 -0
  354. package/dist/web/assets/git-log-panel-BQQI-0fE.js.gz +0 -0
  355. package/dist/web/assets/git-review-tab-D7VE2zu-.js.br +0 -0
  356. package/dist/web/assets/git-review-tab-D7VE2zu-.js.gz +0 -0
  357. package/dist/web/assets/glide-data-grid-CTJNrIu5.js.br +0 -0
  358. package/dist/web/assets/glide-data-grid-CTJNrIu5.js.gz +0 -0
  359. package/dist/web/assets/grid-save-dialog-DNpOGdSQ.js.br +0 -0
  360. package/dist/web/assets/grid-save-dialog-DNpOGdSQ.js.gz +0 -0
  361. package/dist/web/assets/group-chat-tab-BJrtoUK_.js.br +0 -0
  362. package/dist/web/assets/group-chat-tab-BJrtoUK_.js.gz +0 -0
  363. package/dist/web/assets/impexp-tab-8Ge-Cr5T.js.br +0 -0
  364. package/dist/web/assets/impexp-tab-8Ge-Cr5T.js.gz +0 -0
  365. package/dist/web/assets/index-BHvvTbga.js.br +0 -0
  366. package/dist/web/assets/index-BHvvTbga.js.gz +0 -0
  367. package/dist/web/assets/index-D3MnZKxU.css +0 -1
  368. package/dist/web/assets/index-D3MnZKxU.css.br +0 -0
  369. package/dist/web/assets/keyboard-shortcuts-section-BSfZbQyP.js.br +0 -0
  370. package/dist/web/assets/keyboard-shortcuts-section-BSfZbQyP.js.gz +0 -0
  371. package/dist/web/assets/language-servers-section-BZR0UGSm.js.br +0 -0
  372. package/dist/web/assets/language-servers-section-BZR0UGSm.js.gz +0 -0
  373. package/dist/web/assets/logs-app-Mqr7XksW.js.br +0 -0
  374. package/dist/web/assets/logs-app-Mqr7XksW.js.gz +0 -0
  375. package/dist/web/assets/lsp-client-C0B7zeCJ.js.br +0 -0
  376. package/dist/web/assets/lsp-client-C0B7zeCJ.js.gz +0 -0
  377. package/dist/web/assets/markdown-renderer-BIDN9baQ.js.br +0 -0
  378. package/dist/web/assets/markdown-renderer-BIDN9baQ.js.gz +0 -0
  379. package/dist/web/assets/mobile-explorer-sheet-BhQPxHBc.js.br +0 -0
  380. package/dist/web/assets/mobile-explorer-sheet-BhQPxHBc.js.gz +0 -0
  381. package/dist/web/assets/new-design-dialog-BazaRq_B.js.br +0 -0
  382. package/dist/web/assets/notifications-settings-section-dcLa92xt.js.br +0 -0
  383. package/dist/web/assets/notifications-settings-section-dcLa92xt.js.gz +0 -0
  384. package/dist/web/assets/onboarding-entry-BRF9VsQN.js.br +0 -0
  385. package/dist/web/assets/onboarding-entry-BRF9VsQN.js.gz +0 -0
  386. package/dist/web/assets/ppmbot-settings-section-CLX9ltge.js.br +0 -0
  387. package/dist/web/assets/ppmbot-settings-section-CLX9ltge.js.gz +0 -0
  388. package/dist/web/assets/problems-panel-DyZfJjNv.js.br +0 -0
  389. package/dist/web/assets/problems-panel-DyZfJjNv.js.gz +0 -0
  390. package/dist/web/assets/process-table-D_cl8fX6.js.br +0 -0
  391. package/dist/web/assets/process-table-D_cl8fX6.js.gz +0 -0
  392. package/dist/web/assets/proxy-settings-section-DiYZqeel.js.br +0 -0
  393. package/dist/web/assets/proxy-settings-section-DiYZqeel.js.gz +0 -0
  394. package/dist/web/assets/query-tab-QeOJEYu6.js.br +0 -0
  395. package/dist/web/assets/query-tab-QeOJEYu6.js.gz +0 -0
  396. package/dist/web/assets/remote-access-settings-section-CUZWiQ1v.js.br +0 -0
  397. package/dist/web/assets/remote-access-settings-section-CUZWiQ1v.js.gz +0 -0
  398. package/dist/web/assets/remote-desktop-clipboard-notice-DTUdeg9F.js.br +0 -0
  399. package/dist/web/assets/remote-desktop-clipboard-notice-DTUdeg9F.js.gz +0 -0
  400. package/dist/web/assets/remote-desktop-mobile-sheet-Cn15Oy14.js.br +0 -0
  401. package/dist/web/assets/remote-desktop-mobile-sheet-Cn15Oy14.js.gz +0 -0
  402. package/dist/web/assets/remote-desktop-mobile-view-IgZj2-ut.js.br +0 -0
  403. package/dist/web/assets/remote-desktop-mobile-view-IgZj2-ut.js.gz +0 -0
  404. package/dist/web/assets/remote-desktop-readiness-gate-EVamF7Pp.js.br +0 -0
  405. package/dist/web/assets/remote-desktop-readiness-gate-EVamF7Pp.js.gz +0 -0
  406. package/dist/web/assets/remote-desktop-window-content-CzRea9Ma.js.br +0 -0
  407. package/dist/web/assets/remote-desktop-window-content-CzRea9Ma.js.gz +0 -0
  408. package/dist/web/assets/rename-object-dialog-ClxOzltJ.js.br +0 -0
  409. package/dist/web/assets/rename-object-dialog-ClxOzltJ.js.gz +0 -0
  410. package/dist/web/assets/review-address-setup-SeS8KBv0.js.br +0 -0
  411. package/dist/web/assets/review-address-setup-SeS8KBv0.js.gz +0 -0
  412. package/dist/web/assets/review-code-C9JeMsgd.js.br +0 -0
  413. package/dist/web/assets/review-code-C9JeMsgd.js.gz +0 -0
  414. package/dist/web/assets/save-as-dialog-DUGe1msn.js.br +0 -0
  415. package/dist/web/assets/save-as-dialog-DUGe1msn.js.gz +0 -0
  416. package/dist/web/assets/schedule-script-editor-OnPofNSL.js.br +0 -0
  417. package/dist/web/assets/schedule-script-editor-OnPofNSL.js.gz +0 -0
  418. package/dist/web/assets/schedules-settings-section-BVMhJ_lq.js.br +0 -0
  419. package/dist/web/assets/schedules-settings-section-BVMhJ_lq.js.gz +0 -0
  420. package/dist/web/assets/session-review-tab-DJNFQBa6.js.br +0 -0
  421. package/dist/web/assets/session-review-tab-DJNFQBa6.js.gz +0 -0
  422. package/dist/web/assets/settings-body-B-UepuqB.js.br +0 -0
  423. package/dist/web/assets/settings-body-B-UepuqB.js.gz +0 -0
  424. package/dist/web/assets/settings-rows-B6rP-SIH.js.br +0 -0
  425. package/dist/web/assets/settings-rows-B6rP-SIH.js.gz +0 -0
  426. package/dist/web/assets/settings-section-content-DELpUBHR.js.br +0 -0
  427. package/dist/web/assets/settings-section-content-DELpUBHR.js.gz +0 -0
  428. package/dist/web/assets/slash-command-picker-Dum6VEgK.js.br +0 -0
  429. package/dist/web/assets/slash-command-picker-Dum6VEgK.js.gz +0 -0
  430. package/dist/web/assets/sql-object-tab-DxPktQgd.js.br +0 -0
  431. package/dist/web/assets/sql-object-tab-DxPktQgd.js.gz +0 -0
  432. package/dist/web/assets/sqlite-viewer-BnJNxUx1.js.br +0 -0
  433. package/dist/web/assets/sqlite-viewer-BnJNxUx1.js.gz +0 -0
  434. package/dist/web/assets/storage-settings-section-Crir_VX_.js.br +0 -0
  435. package/dist/web/assets/storage-settings-section-Crir_VX_.js.gz +0 -0
  436. package/dist/web/assets/structure-save-dialog-CC9GZmu3.js.br +0 -0
  437. package/dist/web/assets/structure-save-dialog-CC9GZmu3.js.gz +0 -0
  438. package/dist/web/assets/structure-tab-B7kGe-br.js.br +0 -0
  439. package/dist/web/assets/structure-tab-B7kGe-br.js.gz +0 -0
  440. package/dist/web/assets/system-monitor-body-DZlO_tNA.js.br +0 -0
  441. package/dist/web/assets/system-monitor-body-DZlO_tNA.js.gz +0 -0
  442. package/dist/web/assets/tab-host-window-content-BjijxHh2.js.br +0 -0
  443. package/dist/web/assets/tab-host-window-content-BjijxHh2.js.gz +0 -0
  444. package/dist/web/assets/table-tab-BoQ3Ccwk.js.br +0 -0
  445. package/dist/web/assets/table-tab-BoQ3Ccwk.js.gz +0 -0
  446. package/dist/web/assets/telegram-bot-token-field-UEjJjF3U.js.br +0 -0
  447. package/dist/web/assets/telegram-bot-token-field-UEjJjF3U.js.gz +0 -0
  448. package/dist/web/assets/terminal-tab-CRzOW6US.js.br +0 -0
  449. package/dist/web/assets/terminal-tab-CRzOW6US.js.gz +0 -0
  450. package/dist/web/assets/tool-cards-BGBN5UZE.js.br +0 -0
  451. package/dist/web/assets/tool-cards-BGBN5UZE.js.gz +0 -0
  452. package/dist/web/assets/tools-settings-section-DapxgQrZ.js.br +0 -0
  453. package/dist/web/assets/tools-settings-section-DapxgQrZ.js.gz +0 -0
  454. package/dist/web/assets/use-inline-blame-DduNqmR5.js.br +0 -0
  455. package/dist/web/assets/use-inline-blame-DduNqmR5.js.gz +0 -0
  456. package/dist/web/assets/use-lsp-CvPLJ8RW.js.br +0 -0
  457. package/dist/web/assets/use-lsp-CvPLJ8RW.js.gz +0 -0
  458. package/dist/web/assets/use-process-kill-Byc4-u0T.js.br +0 -0
  459. package/dist/web/assets/use-process-kill-Byc4-u0T.js.gz +0 -0
  460. package/dist/web/assets/use-sql-schema-info-_j_Ba57n.js.br +0 -0
  461. package/dist/web/assets/use-sql-schema-info-_j_Ba57n.js.gz +0 -0
  462. package/dist/web/assets/web-preview-tab-D-zUCdMS.js.br +0 -0
  463. package/dist/web/assets/web-preview-tab-D-zUCdMS.js.gz +0 -0
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{A as r,Cn as i,Gt as a,_r as o,gt as s,ut as c}from"./icons-C1wDt09O.js";import{k as l}from"./api-client-BnYFnEfK.js";import"./settings-store-Cklnwn36.js";import"./window-store-p3fp4QWO.js";import{t as u}from"./panel-store-BFvcKuvO.js";import"./project-store-DnFo1aDW.js";import"./project-framework-store-CitdSvSB.js";import"./session-list-sync-triggers-C62M1ApL.js";import{r as d}from"./clipboard-BWcYY8ng.js";import{Ln as f,Pn as p}from"./index-BHvvTbga.js";var m=e(t(),1),h=n(),g=`flex items-center justify-center shrink-0 rounded min-h-11 min-w-11 md:min-h-7 md:min-w-7 text-muted-foreground hover:text-foreground hover:bg-muted`,_=3e3;function v(){return Promise.race([p.allowFraming(window.location.origin).then(()=>void 0,()=>void 0),new Promise(e=>setTimeout(e,_))])}function y({metadata:e,tabId:t}){let n=f(e?.url,window.location.origin),p=f(e?.currentUrl,window.location.origin),_=p&&n&&new URL(p).origin===new URL(n).origin?p:n,[y,b]=(0,m.useState)(_),[x,S]=(0,m.useState)(_),C=(0,m.useRef)(null),w=`${n}:${String(e?.aiOpenAt??``)}`,T=(0,m.useRef)(w),E=e?.via===`tailscale`||e?.via===`local`,[D,O]=(0,m.useState)(0),[k,A]=(0,m.useState)(!1),[j,M]=(0,m.useState)(!1);if((0,m.useEffect)(()=>{T.current!==w&&(T.current=w,b(n),S(n))},[w,n]),(0,m.useEffect)(()=>{let e=e=>{if(!n||!C.current?.contentWindow||e.source!==C.current.contentWindow||e.origin!==new URL(n).origin||e.data?.ppm!==`web-preview-navigation`)return;let r=f(e.data.url,window.location.origin);if(!(!r||new URL(r).origin!==e.origin)&&(b(r),t)){let e=u.getState(),n=Object.values(e.panels).flatMap(e=>e.tabs).find(e=>e.id===t);n&&n.metadata?.currentUrl!==r&&e.updateTab(t,{metadata:{...n.metadata,currentUrl:r}})}};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[n,t]),(0,m.useEffect)(()=>{let e=!0;return v().then(()=>{e&&M(!0)}),()=>{e=!1}},[]),!y)return(0,h.jsx)(`div`,{role:`alert`,className:`p-4 text-sm text-destructive`,children:`This preview has no address PPM can show.`});let N=()=>{d(y).then(e=>{if(!e){l.error(`Failed to copy URL`);return}A(!0),setTimeout(()=>A(!1),2e3)})};return(0,h.jsxs)(`div`,{className:`flex h-full w-full flex-col-reverse md:flex-col bg-background`,children:[(0,h.jsxs)(`div`,{role:`toolbar`,"aria-label":`Web preview`,className:`flex items-center gap-2 md:gap-1 shrink-0 h-12 md:h-8 px-2 border-t md:border-t-0 md:border-b border-border`,children:[(0,h.jsx)(`span`,{className:`flex items-center justify-center shrink-0 size-7 text-muted-foreground`,title:e?.via===`local`?`Private: only this machine can open this address`:E?`Private: only devices in your tailnet can open this address`:`Public: anyone with this link can open it`,children:E?(0,h.jsx)(i,{className:`size-3.5`}):(0,h.jsx)(a,{className:`size-3.5`})}),(0,h.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-xs text-muted-foreground select-all`,children:y}),(0,h.jsx)(`button`,{type:`button`,onClick:()=>void v().then(()=>{S(y),O(e=>e+1)}),title:`Reload`,"aria-label":`Reload`,className:g,children:(0,h.jsx)(o,{className:`size-4`})}),(0,h.jsx)(`button`,{type:`button`,onClick:N,title:`Copy URL`,"aria-label":`Copy URL`,className:g,children:k?(0,h.jsx)(r,{className:`size-4 text-success`}):(0,h.jsx)(c,{className:`size-4`})}),(0,h.jsx)(`a`,{href:y,target:`_blank`,rel:`noopener noreferrer`,title:`Open in browser`,"aria-label":`Open in browser`,className:g,children:(0,h.jsx)(s,{className:`size-4`})})]}),j?(0,h.jsx)(`iframe`,{ref:C,title:`Preview of ${y}`,src:x??void 0,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-modals allow-downloads`,allow:`clipboard-read; clipboard-write; fullscreen`,referrerPolicy:`no-referrer`,className:`flex-1 min-h-0 w-full border-0 bg-white`},`${D}:${String(e?.aiOpenAt??``)}`):(0,h.jsx)(`div`,{className:`flex-1 min-h-0 w-full bg-white`})]})}export{y as WebPreviewTab};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{A as r,Cn as i,Gt as a,_r as o,gt as s,ut as c}from"./icons-C1wDt09O.js";import{k as l}from"./api-client-BnYFnEfK.js";import"./settings-store-Cklnwn36.js";import"./window-store-p3fp4QWO.js";import{t as u}from"./panel-store-BFvcKuvO.js";import"./project-store-DnFo1aDW.js";import"./project-framework-store-CitdSvSB.js";import"./session-list-sync-triggers-C62M1ApL.js";import{r as d}from"./clipboard-BWcYY8ng.js";import{Ln as f,Pn as p}from"./index-Djsgk-RQ.js";var m=e(t(),1),h=n(),g=`flex items-center justify-center shrink-0 rounded min-h-11 min-w-11 md:min-h-7 md:min-w-7 text-muted-foreground hover:text-foreground hover:bg-muted`,_=3e3;function v(){return Promise.race([p.allowFraming(window.location.origin).then(()=>void 0,()=>void 0),new Promise(e=>setTimeout(e,_))])}function y({metadata:e,tabId:t}){let n=f(e?.url,window.location.origin),p=f(e?.currentUrl,window.location.origin),_=p&&n&&new URL(p).origin===new URL(n).origin?p:n,[y,b]=(0,m.useState)(_),[x,S]=(0,m.useState)(_),C=(0,m.useRef)(null),w=`${n}:${String(e?.aiOpenAt??``)}`,T=(0,m.useRef)(w),E=e?.via===`tailscale`||e?.via===`local`,[D,O]=(0,m.useState)(0),[k,A]=(0,m.useState)(!1),[j,M]=(0,m.useState)(!1);if((0,m.useEffect)(()=>{T.current!==w&&(T.current=w,b(n),S(n))},[w,n]),(0,m.useEffect)(()=>{let e=e=>{if(!n||!C.current?.contentWindow||e.source!==C.current.contentWindow||e.origin!==new URL(n).origin||e.data?.ppm!==`web-preview-navigation`)return;let r=f(e.data.url,window.location.origin);if(!(!r||new URL(r).origin!==e.origin)&&(b(r),t)){let e=u.getState(),n=Object.values(e.panels).flatMap(e=>e.tabs).find(e=>e.id===t);n&&n.metadata?.currentUrl!==r&&e.updateTab(t,{metadata:{...n.metadata,currentUrl:r}})}};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[n,t]),(0,m.useEffect)(()=>{let e=!0;return v().then(()=>{e&&M(!0)}),()=>{e=!1}},[]),!y)return(0,h.jsx)(`div`,{role:`alert`,className:`p-4 text-sm text-destructive`,children:`This preview has no address PPM can show.`});let N=()=>{d(y).then(e=>{if(!e){l.error(`Failed to copy URL`);return}A(!0),setTimeout(()=>A(!1),2e3)})};return(0,h.jsxs)(`div`,{className:`flex h-full w-full flex-col-reverse md:flex-col bg-background`,children:[(0,h.jsxs)(`div`,{role:`toolbar`,"aria-label":`Web preview`,className:`flex items-center gap-2 md:gap-1 shrink-0 h-12 md:h-8 px-2 border-t md:border-t-0 md:border-b border-border`,children:[(0,h.jsx)(`span`,{className:`flex items-center justify-center shrink-0 size-7 text-muted-foreground`,title:e?.via===`local`?`Private: only this machine can open this address`:E?`Private: only devices in your tailnet can open this address`:`Public: anyone with this link can open it`,children:E?(0,h.jsx)(i,{className:`size-3.5`}):(0,h.jsx)(a,{className:`size-3.5`})}),(0,h.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-xs text-muted-foreground select-all`,children:y}),(0,h.jsx)(`button`,{type:`button`,onClick:()=>void v().then(()=>{S(y),O(e=>e+1)}),title:`Reload`,"aria-label":`Reload`,className:g,children:(0,h.jsx)(o,{className:`size-4`})}),(0,h.jsx)(`button`,{type:`button`,onClick:N,title:`Copy URL`,"aria-label":`Copy URL`,className:g,children:k?(0,h.jsx)(r,{className:`size-4 text-success`}):(0,h.jsx)(c,{className:`size-4`})}),(0,h.jsx)(`a`,{href:y,target:`_blank`,rel:`noopener noreferrer`,title:`Open in browser`,"aria-label":`Open in browser`,className:g,children:(0,h.jsx)(s,{className:`size-4`})})]}),j?(0,h.jsx)(`iframe`,{ref:C,title:`Preview of ${y}`,src:x??void 0,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-modals allow-downloads`,allow:`clipboard-read; clipboard-write; fullscreen`,referrerPolicy:`no-referrer`,className:`flex-1 min-h-0 w-full border-0 bg-white`},`${D}:${String(e?.aiOpenAt??``)}`):(0,h.jsx)(`div`,{className:`flex-1 min-h-0 w-full bg-white`})]})}export{y as WebPreviewTab};
@@ -9,7 +9,7 @@
9
9
  <link rel="preconnect" href="https://fonts.googleapis.com" />
10
10
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
11
11
  <link href="https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600;700&family=Geist:wght@400;500;600;700&display=swap" rel="stylesheet" />
12
- <script type="module" crossorigin src="/assets/index-BHvvTbga.js"></script>
12
+ <script type="module" crossorigin src="/assets/index-Djsgk-RQ.js"></script>
13
13
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-C5c2KzVm.js">
14
14
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-Bf_JiD2A.js">
15
15
  <link rel="modulepreload" crossorigin href="/assets/vendor-markdown-C-P1aR4p.js">
@@ -73,7 +73,7 @@
73
73
  <link rel="modulepreload" crossorigin href="/assets/streaming-store-anY5ApLn.js">
74
74
  <link rel="modulepreload" crossorigin href="/assets/apply-theme-BYP_2EP0.js">
75
75
  <link rel="modulepreload" crossorigin href="/assets/resolve-theme-Cjh-nwcQ.js">
76
- <link rel="stylesheet" crossorigin href="/assets/index-D3MnZKxU.css">
76
+ <link rel="stylesheet" crossorigin href="/assets/index-BvTu5VV7.css">
77
77
  <link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
78
78
  <body class="text-text font-sans antialiased" style="background: var(--bg)">
79
79
  <!-- FOUC guard: apply the persisted theme mode before first paint.
Binary file
Binary file
package/dist/web/sw.js CHANGED
@@ -1 +1 @@
1
- try{self[`workbox:core:7.3.0`]&&_()}catch{}var e=(e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n},t=class extends Error{constructor(t,n){let r=e(t,n);super(r),this.name=t,this.details=n}},n={googleAnalytics:`googleAnalytics`,precache:`precache-v2`,prefix:`workbox`,runtime:`runtime`,suffix:typeof registration<`u`?registration.scope:``},r=e=>[n.prefix,e,n.suffix].filter(e=>e&&e.length>0).join(`-`),i=e=>{for(let t of Object.keys(n))e(t)},a={updateDetails:e=>{i(t=>{typeof e[t]==`string`&&(n[t]=e[t])})},getGoogleAnalyticsName:e=>e||r(n.googleAnalytics),getPrecacheName:e=>e||r(n.precache),getPrefix:()=>n.prefix,getRuntimeName:e=>e||r(n.runtime),getSuffix:()=>n.suffix};function o(e,t){let n=t();return e.waitUntil(n),n}try{self[`workbox:precaching:7.3.0`]&&_()}catch{}var s=`__WB_REVISION__`;function c(e){if(!e)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(typeof e==`string`){let t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}let{revision:n,url:r}=e;if(!r)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(!n){let e=new URL(r,location.href);return{cacheKey:e.href,url:e.href}}let i=new URL(r,location.href),a=new URL(r,location.href);return i.searchParams.set(s,n),{cacheKey:i.href,url:a.href}}var l=class{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type===`install`&&t&&t.originalRequest&&t.originalRequest instanceof Request){let e=t.originalRequest.url;n?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return n}}},u=class{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{let n=t?.cacheKey||this._precacheController.getCacheKeyForURL(e.url);return n?new Request(n,{headers:e.headers}):e},this._precacheController=e}},d;function f(){if(d===void 0){let e=new Response(``);if(`body`in e)try{new Response(e.body),d=!0}catch{d=!1}d=!1}return d}async function p(e,n){let r=null;if(e.url&&(r=new URL(e.url).origin),r!==self.location.origin)throw new t(`cross-origin-copy-response`,{origin:r});let i=e.clone(),a={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=n?n(a):a,s=f()?i.body:await i.blob();return new Response(s,o)}var m=e=>new URL(String(e),location.href).href.replace(RegExp(`^${location.origin}`),``);function h(e,t){let n=new URL(e);for(let e of t)n.searchParams.delete(e);return n.href}async function g(e,t,n,r){let i=h(t.url,n);if(t.url===i)return e.match(t,r);let a=Object.assign(Object.assign({},r),{ignoreSearch:!0}),o=await e.keys(t,a);for(let t of o)if(i===h(t.url,n))return e.match(t,r)}var v=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}},y=new Set;async function b(){for(let e of y)await e()}function x(e){return new Promise(t=>setTimeout(t,e))}try{self[`workbox:strategies:7.3.0`]&&_()}catch{}function S(e){return typeof e==`string`?new Request(e):e}var C=class{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new v,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(let e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){let{event:n}=this,r=S(e);if(r.mode===`navigate`&&n instanceof FetchEvent&&n.preloadResponse){let e=await n.preloadResponse;if(e)return e}let i=this.hasCallback(`fetchDidFail`)?r.clone():null;try{for(let e of this.iterateCallbacks(`requestWillFetch`))r=await e({request:r.clone(),event:n})}catch(e){if(e instanceof Error)throw new t(`plugin-error-request-will-fetch`,{thrownErrorMessage:e.message})}let a=r.clone();try{let e;e=await fetch(r,r.mode===`navigate`?void 0:this._strategy.fetchOptions);for(let t of this.iterateCallbacks(`fetchDidSucceed`))e=await t({event:n,request:a,response:e});return e}catch(e){throw i&&await this.runCallbacks(`fetchDidFail`,{error:e,event:n,originalRequest:i.clone(),request:a.clone()}),e}}async fetchAndCachePut(e){let t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){let t=S(e),n,{cacheName:r,matchOptions:i}=this._strategy,a=await this.getCacheKey(t,`read`),o=Object.assign(Object.assign({},i),{cacheName:r});n=await caches.match(a,o);for(let e of this.iterateCallbacks(`cachedResponseWillBeUsed`))n=await e({cacheName:r,matchOptions:i,cachedResponse:n,request:a,event:this.event})||void 0;return n}async cachePut(e,n){let r=S(e);await x(0);let i=await this.getCacheKey(r,`write`);if(!n)throw new t(`cache-put-with-no-response`,{url:m(i.url)});let a=await this._ensureResponseSafeToCache(n);if(!a)return!1;let{cacheName:o,matchOptions:s}=this._strategy,c=await self.caches.open(o),l=this.hasCallback(`cacheDidUpdate`),u=l?await g(c,i.clone(),[`__WB_REVISION__`],s):null;try{await c.put(i,l?a.clone():a)}catch(e){if(e instanceof Error)throw e.name===`QuotaExceededError`&&await b(),e}for(let e of this.iterateCallbacks(`cacheDidUpdate`))await e({cacheName:o,oldResponse:u,newResponse:a.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){let n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let r=e;for(let e of this.iterateCallbacks(`cacheKeyWillBeUsed`))r=S(await e({mode:t,request:r,event:this.event,params:this.params}));this._cacheKeys[n]=r}return this._cacheKeys[n]}hasCallback(e){for(let t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(let n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(let t of this._strategy.plugins)if(typeof t[e]==`function`){let n=this._pluginStateMap.get(t);yield r=>{let i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){for(;this._extendLifetimePromises.length;){let e=this._extendLifetimePromises.splice(0),t=(await Promise.allSettled(e)).find(e=>e.status===`rejected`);if(t)throw t.reason}}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(let e of this.iterateCallbacks(`cacheWillUpdate`))if(t=await e({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}},w=class{constructor(e={}){this.cacheName=a.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){let[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});let t=e.event,n=typeof e.request==`string`?new Request(e.request):e.request,r=`params`in e?e.params:void 0,i=new C(this,{event:t,request:n,params:r}),a=this._getResponse(i,n,t);return[a,this._awaitComplete(a,i,n,t)]}async _getResponse(e,n,r){await e.runCallbacks(`handlerWillStart`,{event:r,request:n});let i;try{if(i=await this._handle(n,e),!i||i.type===`error`)throw new t(`no-response`,{url:n.url})}catch(t){if(t instanceof Error){for(let a of e.iterateCallbacks(`handlerDidError`))if(i=await a({error:t,event:r,request:n}),i)break}if(!i)throw t}for(let t of e.iterateCallbacks(`handlerWillRespond`))i=await t({event:r,request:n,response:i});return i}async _awaitComplete(e,t,n,r){let i,a;try{i=await e}catch{}try{await t.runCallbacks(`handlerDidRespond`,{event:r,request:n,response:i}),await t.doneWaiting()}catch(e){e instanceof Error&&(a=e)}if(await t.runCallbacks(`handlerDidComplete`,{event:r,request:n,response:i,error:a}),t.destroy(),a)throw a}},T=class e extends w{constructor(t={}){t.cacheName=a.getPrecacheName(t.cacheName),super(t),this._fallbackToNetwork=t.fallbackToNetwork!==!1,this.plugins.push(e.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){return await t.cacheMatch(e)||(t.event&&t.event.type===`install`?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,n){let r,i=n.params||{};if(this._fallbackToNetwork){let t=i.integrity,a=e.integrity,o=!a||a===t;r=await n.fetch(new Request(e,{integrity:e.mode===`no-cors`?void 0:a||t})),t&&o&&e.mode!==`no-cors`&&(this._useDefaultCacheabilityPluginIfNeeded(),await n.cachePut(e,r.clone()))}else throw new t(`missing-precache-entry`,{cacheName:this.cacheName,url:e.url});return r}async _handleInstall(e,n){this._useDefaultCacheabilityPluginIfNeeded();let r=await n.fetch(e);if(!await n.cachePut(e,r.clone()))throw new t(`bad-precaching-response`,{url:e.url,status:r.status});return r}_useDefaultCacheabilityPluginIfNeeded(){let t=null,n=0;for(let[r,i]of this.plugins.entries())i!==e.copyRedirectedCacheableResponsesPlugin&&(i===e.defaultPrecacheCacheabilityPlugin&&(t=r),i.cacheWillUpdate&&n++);n===0?this.plugins.push(e.defaultPrecacheCacheabilityPlugin):n>1&&t!==null&&this.plugins.splice(t,1)}};T.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:e}){return!e||e.status>=400?null:e}},T.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:e}){return e.redirected?await p(e):e}};var E=class{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new T({cacheName:a.getPrecacheName(e),plugins:[...t,new u({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||=(self.addEventListener(`install`,this.install),self.addEventListener(`activate`,this.activate),!0)}addToCacheList(e){let n=[];for(let r of e){typeof r==`string`?n.push(r):r&&r.revision===void 0&&n.push(r.url);let{cacheKey:e,url:i}=c(r),a=typeof r!=`string`&&r.revision?`reload`:`default`;if(this._urlsToCacheKeys.has(i)&&this._urlsToCacheKeys.get(i)!==e)throw new t(`add-to-cache-list-conflicting-entries`,{firstEntry:this._urlsToCacheKeys.get(i),secondEntry:e});if(typeof r!=`string`&&r.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==r.integrity)throw new t(`add-to-cache-list-conflicting-integrities`,{url:i});this._cacheKeysToIntegrities.set(e,r.integrity)}if(this._urlsToCacheKeys.set(i,e),this._urlsToCacheModes.set(i,a),n.length>0){let e=`Workbox is precaching URLs without revision info: ${n.join(`, `)}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return o(e,async()=>{let t=new l;this.strategy.plugins.push(t);for(let[t,n]of this._urlsToCacheKeys){let r=this._cacheKeysToIntegrities.get(n),i=this._urlsToCacheModes.get(t),a=new Request(t,{integrity:r,cache:i,credentials:`same-origin`});await Promise.all(this.strategy.handleAll({params:{cacheKey:n},request:a,event:e}))}let{updatedURLs:n,notUpdatedURLs:r}=t;return{updatedURLs:n,notUpdatedURLs:r}})}activate(e){return o(e,async()=>{let e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),n=new Set(this._urlsToCacheKeys.values()),r=[];for(let i of t)n.has(i.url)||(await e.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){let n=this.getCacheKeyForURL(e);if(!n)throw new t(`non-precached-url`,{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:n},t.params),this.strategy.handle(t))}},D,O=()=>(D||=new E,D);try{self[`workbox:routing:7.3.0`]&&_()}catch{}var k=e=>e&&typeof e==`object`?e:{handle:e},A=class{constructor(e,t,n=`GET`){this.handler=k(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=k(e)}},j=class extends A{constructor(e,t,n){super(({url:t})=>{let n=e.exec(t.href);if(n&&!(t.origin!==location.origin&&n.index!==0))return n.slice(1)},t,n)}},M=class{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener(`fetch`,(e=>{let{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener(`message`,(e=>{if(e.data&&e.data.type===`CACHE_URLS`){let{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(t=>{typeof t==`string`&&(t=[t]);let n=new Request(...t);return this.handleRequest({request:n,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:t}){let n=new URL(e.url,location.href);if(!n.protocol.startsWith(`http`))return;let r=n.origin===location.origin,{params:i,route:a}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n}),o=a&&a.handler,s=e.method;if(!o&&this._defaultHandlerMap.has(s)&&(o=this._defaultHandlerMap.get(s)),!o)return;let c;try{c=o.handle({url:n,request:e,event:t,params:i})}catch(e){c=Promise.reject(e)}let l=a&&a.catchHandler;return c instanceof Promise&&(this._catchHandler||l)&&(c=c.catch(async r=>{if(l)try{return await l.handle({url:n,request:e,event:t,params:i})}catch(e){e instanceof Error&&(r=e)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw r})),c}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){let i=this._routes.get(n.method)||[];for(let a of i){let i,o=a.match({url:e,sameOrigin:t,request:n,event:r});if(o)return i=o,(Array.isArray(i)&&i.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o==`boolean`)&&(i=void 0),{route:a,params:i}}return{}}setDefaultHandler(e,t=`GET`){this._defaultHandlerMap.set(t,k(e))}setCatchHandler(e){this._catchHandler=k(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t(`unregister-route-but-not-found-with-method`,{method:e.method});let n=this._routes.get(e.method).indexOf(e);if(n>-1)this._routes.get(e.method).splice(n,1);else throw new t(`unregister-route-route-not-registered`)}},N,P=()=>(N||(N=new M,N.addFetchListener(),N.addCacheListener()),N);function F(e,n,r){let i;if(typeof e==`string`){let t=new URL(e,location.href);i=new A(({url:e})=>e.href===t.href,n,r)}else if(e instanceof RegExp)i=new j(e,n,r);else if(typeof e==`function`)i=new A(e,n,r);else if(e instanceof A)i=e;else throw new t(`unsupported-route-type`,{moduleName:`workbox-routing`,funcName:`registerRoute`,paramName:`capture`});return P().registerRoute(i),i}function I(e,t=[]){for(let n of[...e.searchParams.keys()])t.some(e=>e.test(n))&&e.searchParams.delete(n);return e}function*L(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:n=`index.html`,cleanURLs:r=!0,urlManipulation:i}={}){let a=new URL(e,location.href);a.hash=``,yield a.href;let o=I(a,t);if(yield o.href,n&&o.pathname.endsWith(`/`)){let e=new URL(o.href);e.pathname+=n,yield e.href}if(r){let e=new URL(o.href);e.pathname+=`.html`,yield e.href}if(i){let e=i({url:a});for(let t of e)yield t.href}}var R=class extends A{constructor(e,t){super(({request:n})=>{let r=e.getURLsToCacheKeys();for(let i of L(n.url,t)){let t=r.get(i);if(t)return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}},e.strategy)}};function z(e){F(new R(O(),e))}var B=`-precache-`,V=async(e,t=B)=>{let n=(await self.caches.keys()).filter(n=>n.includes(t)&&n.includes(self.registration.scope)&&n!==e);return await Promise.all(n.map(e=>self.caches.delete(e))),n};function H(){self.addEventListener(`activate`,(e=>{let t=a.getPrecacheName();e.waitUntil(V(t).then(e=>{}))}))}function U(e){O().precache(e)}function W(e,t){U(e),z(t)}var G=class extends w{async _handle(e,n){let r=await n.cacheMatch(e),i;if(!r)try{r=await n.fetchAndCachePut(e)}catch(e){e instanceof Error&&(i=e)}if(!r)throw new t(`no-response`,{url:e.url,error:i});return r}},K=`ppm:open-from-notification`;function q(e){let t=e&&typeof e==`object`?e:{},n=e=>typeof e==`string`?e:``;return{title:n(t.title)||`PPM`,body:n(t.body),url:n(t.url)||`/`,tag:n(t.tag),project:n(t.project),sessionId:n(t.sessionId),providerId:n(t.providerId)}}async function J(e,t,n){let r=new URL(e.url,n);if(r.origin===n){let n=(await t.matchAll({type:`window`,includeUncontrolled:!0})).filter(e=>!Y(e.url)),i=n.find(e=>e.focused)??n.find(e=>e.visibilityState===`visible`)??n[0];if(i){let t={type:K,url:r.href,project:e.project,sessionId:e.sessionId,providerId:e.providerId};i.postMessage(t),await i.focus().catch(()=>void 0);return}}await t.openWindow(r.href)}function Y(e){try{return new URL(e).pathname.startsWith(`/s/`)}catch{return!1}}W([{"revision":"e460584b9c00d5b771eede01609f1f8a","url":"index.html"},{"revision":"26dccd02a2ef7522892015154f5e3680","url":"manifest.webmanifest"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":null,"url":"assets/index-D3MnZKxU.css"},{"revision":null,"url":"assets/index-BHvvTbga.js"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"26dccd02a2ef7522892015154f5e3680","url":"manifest.webmanifest"}]),H();var X=e=>(e.headers.get(`content-type`)??``).startsWith(`text/html`);F(({url:e})=>e.pathname.startsWith(`/assets/`),new G({cacheName:`ppm-assets`,plugins:[{cacheWillUpdate:async({response:e})=>X(e)?null:e,cachedResponseWillBeUsed:async({cachedResponse:e})=>e&&X(e)?null:e}]})),self.skipWaiting(),self.addEventListener(`activate`,()=>{self.clients.claim()}),self.addEventListener(`push`,e=>{let t=null;try{t=e.data?.json()}catch{t={body:e.data?.text()}}let n=q(t),r={body:n.body,icon:`/icon-192.svg`,data:n,...n.tag&&{tag:n.tag,renotify:!0}};e.waitUntil(self.registration.showNotification(n.title,r))}),self.addEventListener(`notificationclick`,e=>{e.notification.close();let t=q(e.notification.data);e.waitUntil(J(t,self.clients,self.location.origin))});
1
+ try{self[`workbox:core:7.3.0`]&&_()}catch{}var e=(e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n},t=class extends Error{constructor(t,n){let r=e(t,n);super(r),this.name=t,this.details=n}},n={googleAnalytics:`googleAnalytics`,precache:`precache-v2`,prefix:`workbox`,runtime:`runtime`,suffix:typeof registration<`u`?registration.scope:``},r=e=>[n.prefix,e,n.suffix].filter(e=>e&&e.length>0).join(`-`),i=e=>{for(let t of Object.keys(n))e(t)},a={updateDetails:e=>{i(t=>{typeof e[t]==`string`&&(n[t]=e[t])})},getGoogleAnalyticsName:e=>e||r(n.googleAnalytics),getPrecacheName:e=>e||r(n.precache),getPrefix:()=>n.prefix,getRuntimeName:e=>e||r(n.runtime),getSuffix:()=>n.suffix};function o(e,t){let n=t();return e.waitUntil(n),n}try{self[`workbox:precaching:7.3.0`]&&_()}catch{}var s=`__WB_REVISION__`;function c(e){if(!e)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(typeof e==`string`){let t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}let{revision:n,url:r}=e;if(!r)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(!n){let e=new URL(r,location.href);return{cacheKey:e.href,url:e.href}}let i=new URL(r,location.href),a=new URL(r,location.href);return i.searchParams.set(s,n),{cacheKey:i.href,url:a.href}}var l=class{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type===`install`&&t&&t.originalRequest&&t.originalRequest instanceof Request){let e=t.originalRequest.url;n?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return n}}},u=class{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{let n=t?.cacheKey||this._precacheController.getCacheKeyForURL(e.url);return n?new Request(n,{headers:e.headers}):e},this._precacheController=e}},d;function f(){if(d===void 0){let e=new Response(``);if(`body`in e)try{new Response(e.body),d=!0}catch{d=!1}d=!1}return d}async function p(e,n){let r=null;if(e.url&&(r=new URL(e.url).origin),r!==self.location.origin)throw new t(`cross-origin-copy-response`,{origin:r});let i=e.clone(),a={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=n?n(a):a,s=f()?i.body:await i.blob();return new Response(s,o)}var m=e=>new URL(String(e),location.href).href.replace(RegExp(`^${location.origin}`),``);function h(e,t){let n=new URL(e);for(let e of t)n.searchParams.delete(e);return n.href}async function g(e,t,n,r){let i=h(t.url,n);if(t.url===i)return e.match(t,r);let a=Object.assign(Object.assign({},r),{ignoreSearch:!0}),o=await e.keys(t,a);for(let t of o)if(i===h(t.url,n))return e.match(t,r)}var v=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}},y=new Set;async function b(){for(let e of y)await e()}function x(e){return new Promise(t=>setTimeout(t,e))}try{self[`workbox:strategies:7.3.0`]&&_()}catch{}function S(e){return typeof e==`string`?new Request(e):e}var C=class{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new v,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(let e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){let{event:n}=this,r=S(e);if(r.mode===`navigate`&&n instanceof FetchEvent&&n.preloadResponse){let e=await n.preloadResponse;if(e)return e}let i=this.hasCallback(`fetchDidFail`)?r.clone():null;try{for(let e of this.iterateCallbacks(`requestWillFetch`))r=await e({request:r.clone(),event:n})}catch(e){if(e instanceof Error)throw new t(`plugin-error-request-will-fetch`,{thrownErrorMessage:e.message})}let a=r.clone();try{let e;e=await fetch(r,r.mode===`navigate`?void 0:this._strategy.fetchOptions);for(let t of this.iterateCallbacks(`fetchDidSucceed`))e=await t({event:n,request:a,response:e});return e}catch(e){throw i&&await this.runCallbacks(`fetchDidFail`,{error:e,event:n,originalRequest:i.clone(),request:a.clone()}),e}}async fetchAndCachePut(e){let t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){let t=S(e),n,{cacheName:r,matchOptions:i}=this._strategy,a=await this.getCacheKey(t,`read`),o=Object.assign(Object.assign({},i),{cacheName:r});n=await caches.match(a,o);for(let e of this.iterateCallbacks(`cachedResponseWillBeUsed`))n=await e({cacheName:r,matchOptions:i,cachedResponse:n,request:a,event:this.event})||void 0;return n}async cachePut(e,n){let r=S(e);await x(0);let i=await this.getCacheKey(r,`write`);if(!n)throw new t(`cache-put-with-no-response`,{url:m(i.url)});let a=await this._ensureResponseSafeToCache(n);if(!a)return!1;let{cacheName:o,matchOptions:s}=this._strategy,c=await self.caches.open(o),l=this.hasCallback(`cacheDidUpdate`),u=l?await g(c,i.clone(),[`__WB_REVISION__`],s):null;try{await c.put(i,l?a.clone():a)}catch(e){if(e instanceof Error)throw e.name===`QuotaExceededError`&&await b(),e}for(let e of this.iterateCallbacks(`cacheDidUpdate`))await e({cacheName:o,oldResponse:u,newResponse:a.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){let n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let r=e;for(let e of this.iterateCallbacks(`cacheKeyWillBeUsed`))r=S(await e({mode:t,request:r,event:this.event,params:this.params}));this._cacheKeys[n]=r}return this._cacheKeys[n]}hasCallback(e){for(let t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(let n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(let t of this._strategy.plugins)if(typeof t[e]==`function`){let n=this._pluginStateMap.get(t);yield r=>{let i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){for(;this._extendLifetimePromises.length;){let e=this._extendLifetimePromises.splice(0),t=(await Promise.allSettled(e)).find(e=>e.status===`rejected`);if(t)throw t.reason}}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(let e of this.iterateCallbacks(`cacheWillUpdate`))if(t=await e({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}},w=class{constructor(e={}){this.cacheName=a.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){let[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});let t=e.event,n=typeof e.request==`string`?new Request(e.request):e.request,r=`params`in e?e.params:void 0,i=new C(this,{event:t,request:n,params:r}),a=this._getResponse(i,n,t);return[a,this._awaitComplete(a,i,n,t)]}async _getResponse(e,n,r){await e.runCallbacks(`handlerWillStart`,{event:r,request:n});let i;try{if(i=await this._handle(n,e),!i||i.type===`error`)throw new t(`no-response`,{url:n.url})}catch(t){if(t instanceof Error){for(let a of e.iterateCallbacks(`handlerDidError`))if(i=await a({error:t,event:r,request:n}),i)break}if(!i)throw t}for(let t of e.iterateCallbacks(`handlerWillRespond`))i=await t({event:r,request:n,response:i});return i}async _awaitComplete(e,t,n,r){let i,a;try{i=await e}catch{}try{await t.runCallbacks(`handlerDidRespond`,{event:r,request:n,response:i}),await t.doneWaiting()}catch(e){e instanceof Error&&(a=e)}if(await t.runCallbacks(`handlerDidComplete`,{event:r,request:n,response:i,error:a}),t.destroy(),a)throw a}},T=class e extends w{constructor(t={}){t.cacheName=a.getPrecacheName(t.cacheName),super(t),this._fallbackToNetwork=t.fallbackToNetwork!==!1,this.plugins.push(e.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){return await t.cacheMatch(e)||(t.event&&t.event.type===`install`?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,n){let r,i=n.params||{};if(this._fallbackToNetwork){let t=i.integrity,a=e.integrity,o=!a||a===t;r=await n.fetch(new Request(e,{integrity:e.mode===`no-cors`?void 0:a||t})),t&&o&&e.mode!==`no-cors`&&(this._useDefaultCacheabilityPluginIfNeeded(),await n.cachePut(e,r.clone()))}else throw new t(`missing-precache-entry`,{cacheName:this.cacheName,url:e.url});return r}async _handleInstall(e,n){this._useDefaultCacheabilityPluginIfNeeded();let r=await n.fetch(e);if(!await n.cachePut(e,r.clone()))throw new t(`bad-precaching-response`,{url:e.url,status:r.status});return r}_useDefaultCacheabilityPluginIfNeeded(){let t=null,n=0;for(let[r,i]of this.plugins.entries())i!==e.copyRedirectedCacheableResponsesPlugin&&(i===e.defaultPrecacheCacheabilityPlugin&&(t=r),i.cacheWillUpdate&&n++);n===0?this.plugins.push(e.defaultPrecacheCacheabilityPlugin):n>1&&t!==null&&this.plugins.splice(t,1)}};T.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:e}){return!e||e.status>=400?null:e}},T.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:e}){return e.redirected?await p(e):e}};var E=class{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new T({cacheName:a.getPrecacheName(e),plugins:[...t,new u({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||=(self.addEventListener(`install`,this.install),self.addEventListener(`activate`,this.activate),!0)}addToCacheList(e){let n=[];for(let r of e){typeof r==`string`?n.push(r):r&&r.revision===void 0&&n.push(r.url);let{cacheKey:e,url:i}=c(r),a=typeof r!=`string`&&r.revision?`reload`:`default`;if(this._urlsToCacheKeys.has(i)&&this._urlsToCacheKeys.get(i)!==e)throw new t(`add-to-cache-list-conflicting-entries`,{firstEntry:this._urlsToCacheKeys.get(i),secondEntry:e});if(typeof r!=`string`&&r.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==r.integrity)throw new t(`add-to-cache-list-conflicting-integrities`,{url:i});this._cacheKeysToIntegrities.set(e,r.integrity)}if(this._urlsToCacheKeys.set(i,e),this._urlsToCacheModes.set(i,a),n.length>0){let e=`Workbox is precaching URLs without revision info: ${n.join(`, `)}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return o(e,async()=>{let t=new l;this.strategy.plugins.push(t);for(let[t,n]of this._urlsToCacheKeys){let r=this._cacheKeysToIntegrities.get(n),i=this._urlsToCacheModes.get(t),a=new Request(t,{integrity:r,cache:i,credentials:`same-origin`});await Promise.all(this.strategy.handleAll({params:{cacheKey:n},request:a,event:e}))}let{updatedURLs:n,notUpdatedURLs:r}=t;return{updatedURLs:n,notUpdatedURLs:r}})}activate(e){return o(e,async()=>{let e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),n=new Set(this._urlsToCacheKeys.values()),r=[];for(let i of t)n.has(i.url)||(await e.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){let n=this.getCacheKeyForURL(e);if(!n)throw new t(`non-precached-url`,{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:n},t.params),this.strategy.handle(t))}},D,O=()=>(D||=new E,D);try{self[`workbox:routing:7.3.0`]&&_()}catch{}var k=e=>e&&typeof e==`object`?e:{handle:e},A=class{constructor(e,t,n=`GET`){this.handler=k(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=k(e)}},j=class extends A{constructor(e,t,n){super(({url:t})=>{let n=e.exec(t.href);if(n&&!(t.origin!==location.origin&&n.index!==0))return n.slice(1)},t,n)}},M=class{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener(`fetch`,(e=>{let{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener(`message`,(e=>{if(e.data&&e.data.type===`CACHE_URLS`){let{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(t=>{typeof t==`string`&&(t=[t]);let n=new Request(...t);return this.handleRequest({request:n,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:t}){let n=new URL(e.url,location.href);if(!n.protocol.startsWith(`http`))return;let r=n.origin===location.origin,{params:i,route:a}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n}),o=a&&a.handler,s=e.method;if(!o&&this._defaultHandlerMap.has(s)&&(o=this._defaultHandlerMap.get(s)),!o)return;let c;try{c=o.handle({url:n,request:e,event:t,params:i})}catch(e){c=Promise.reject(e)}let l=a&&a.catchHandler;return c instanceof Promise&&(this._catchHandler||l)&&(c=c.catch(async r=>{if(l)try{return await l.handle({url:n,request:e,event:t,params:i})}catch(e){e instanceof Error&&(r=e)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw r})),c}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){let i=this._routes.get(n.method)||[];for(let a of i){let i,o=a.match({url:e,sameOrigin:t,request:n,event:r});if(o)return i=o,(Array.isArray(i)&&i.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o==`boolean`)&&(i=void 0),{route:a,params:i}}return{}}setDefaultHandler(e,t=`GET`){this._defaultHandlerMap.set(t,k(e))}setCatchHandler(e){this._catchHandler=k(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t(`unregister-route-but-not-found-with-method`,{method:e.method});let n=this._routes.get(e.method).indexOf(e);if(n>-1)this._routes.get(e.method).splice(n,1);else throw new t(`unregister-route-route-not-registered`)}},N,P=()=>(N||(N=new M,N.addFetchListener(),N.addCacheListener()),N);function F(e,n,r){let i;if(typeof e==`string`){let t=new URL(e,location.href);i=new A(({url:e})=>e.href===t.href,n,r)}else if(e instanceof RegExp)i=new j(e,n,r);else if(typeof e==`function`)i=new A(e,n,r);else if(e instanceof A)i=e;else throw new t(`unsupported-route-type`,{moduleName:`workbox-routing`,funcName:`registerRoute`,paramName:`capture`});return P().registerRoute(i),i}function I(e,t=[]){for(let n of[...e.searchParams.keys()])t.some(e=>e.test(n))&&e.searchParams.delete(n);return e}function*L(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:n=`index.html`,cleanURLs:r=!0,urlManipulation:i}={}){let a=new URL(e,location.href);a.hash=``,yield a.href;let o=I(a,t);if(yield o.href,n&&o.pathname.endsWith(`/`)){let e=new URL(o.href);e.pathname+=n,yield e.href}if(r){let e=new URL(o.href);e.pathname+=`.html`,yield e.href}if(i){let e=i({url:a});for(let t of e)yield t.href}}var R=class extends A{constructor(e,t){super(({request:n})=>{let r=e.getURLsToCacheKeys();for(let i of L(n.url,t)){let t=r.get(i);if(t)return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}},e.strategy)}};function z(e){F(new R(O(),e))}var B=`-precache-`,V=async(e,t=B)=>{let n=(await self.caches.keys()).filter(n=>n.includes(t)&&n.includes(self.registration.scope)&&n!==e);return await Promise.all(n.map(e=>self.caches.delete(e))),n};function H(){self.addEventListener(`activate`,(e=>{let t=a.getPrecacheName();e.waitUntil(V(t).then(e=>{}))}))}function U(e){O().precache(e)}function W(e,t){U(e),z(t)}var G=class extends w{async _handle(e,n){let r=await n.cacheMatch(e),i;if(!r)try{r=await n.fetchAndCachePut(e)}catch(e){e instanceof Error&&(i=e)}if(!r)throw new t(`no-response`,{url:e.url,error:i});return r}},K=`ppm:open-from-notification`;function q(e){let t=e&&typeof e==`object`?e:{},n=e=>typeof e==`string`?e:``;return{title:n(t.title)||`PPM`,body:n(t.body),url:n(t.url)||`/`,tag:n(t.tag),project:n(t.project),sessionId:n(t.sessionId),providerId:n(t.providerId)}}async function J(e,t,n){let r=new URL(e.url,n);if(r.origin===n){let n=(await t.matchAll({type:`window`,includeUncontrolled:!0})).filter(e=>!Y(e.url)),i=n.find(e=>e.focused)??n.find(e=>e.visibilityState===`visible`)??n[0];if(i){let t={type:K,url:r.href,project:e.project,sessionId:e.sessionId,providerId:e.providerId};i.postMessage(t),await i.focus().catch(()=>void 0);return}}await t.openWindow(r.href)}function Y(e){try{return new URL(e).pathname.startsWith(`/s/`)}catch{return!1}}W([{"revision":"1fc0c8ec26b79492ddbbb3f387db80db","url":"index.html"},{"revision":"26dccd02a2ef7522892015154f5e3680","url":"manifest.webmanifest"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":null,"url":"assets/index-Djsgk-RQ.js"},{"revision":null,"url":"assets/index-BvTu5VV7.css"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"26dccd02a2ef7522892015154f5e3680","url":"manifest.webmanifest"}]),H();var X=e=>(e.headers.get(`content-type`)??``).startsWith(`text/html`);F(({url:e})=>e.pathname.startsWith(`/assets/`),new G({cacheName:`ppm-assets`,plugins:[{cacheWillUpdate:async({response:e})=>X(e)?null:e,cachedResponseWillBeUsed:async({cachedResponse:e})=>e&&X(e)?null:e}]})),self.skipWaiting(),self.addEventListener(`activate`,()=>{self.clients.claim()}),self.addEventListener(`push`,e=>{let t=null;try{t=e.data?.json()}catch{t={body:e.data?.text()}}let n=q(t),r={body:n.body,icon:`/icon-192.svg`,data:n,...n.tag&&{tag:n.tag,renotify:!0}};e.waitUntil(self.registration.showNotification(n.title,r))}),self.addEventListener(`notificationclick`,e=>{e.notification.close();let t=q(e.notification.data);e.waitUntil(J(t,self.clients,self.location.origin))});
package/dist/web/sw.js.br CHANGED
Binary file
package/dist/web/sw.js.gz CHANGED
Binary file
@@ -246,7 +246,12 @@ window with no figure for this chat's account is not drawn), a divider that belo
246
246
  part and goes whenever it does, History, and the ··· menu: the serving account and its meters, Switch account (a drill-in listing this provider's
247
247
  accounts as two-line cards, current first then most headroom, the unusable ones folded under "Out
248
248
  of usage" from five accounts on, with search), AI settings, Team activity, Reload messages with
249
- the connection's state, and a folded More (mark unread, debug info, this chat's logs).
249
+ the connection's state, and a folded More (mark unread, debug info, this chat's logs). Every
250
+ usage bar says when it resets, at two levels of detail (`account-usage-format.ts`): the quick
251
+ views — the menu's meters and the rings' tooltip — give the countdown alone ("in 3h 12m"), and
252
+ Switch account's cards add the clock time under each bar ("Resets in 2d 8h · Thu 09:00", "today
253
+ 18:00" later the same day), in red once the bar is full; a full account's refusal then names
254
+ only the window ("5-hour limit reached").
250
255
 
251
256
  The composer is the textarea over one bar: Attach, the mode in one word, the model chip carrying
252
257
  the provider's logo (the provider is picked inside it before a session exists), Queue while a
@@ -295,7 +300,9 @@ one runs, else Sessions; the Agents tab exists only while an agent runs. Agents
295
300
  (`use-running-agents.ts`, disk-derived from the transcript hub's `agent-activity` feed plus the
296
301
  team poll) lists the running agents, then the finished ones launched beside them; a tap opens that
297
302
  agent's own session. Sessions (`linked-sessions-panel.tsx`) groups the linked sessions by how they
298
- are linked (its creator, the sessions it created, the sessions it messaged). `use-linked-sessions.ts` seeds
303
+ are linked (its creator, the sessions it created, the sessions it messaged), each group ordered
304
+ by `byAttention` (`src/web/lib/linked-sessions.ts`): waiting on the person, then running, then an
305
+ unread answer, then idle. `use-linked-sessions.ts` seeds
299
306
  the links from `GET …/sessions/:id/links` when the chat opens (so a link from before a restart, or
300
307
  older than the loaded messages, is there at once), then merges the session list's `spawnedBy`, the
301
308
  chat's own messages and `/ws/global`'s `session:created`, `session:link_changed` and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hienlh/ppm",
3
- "version": "0.23.36",
3
+ "version": "0.23.37",
4
4
  "description": "Personal Project Manager — mobile-first web IDE with AI assistance",
5
5
  "author": "hienlh",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -27,6 +27,7 @@ import { CodexSignInAgainDialog } from "@/components/settings/accounts/codex-sig
27
27
  import { openLogs } from "@/components/logs/open-logs";
28
28
  import { useSwitchAccounts } from "@/hooks/use-switch-accounts";
29
29
  import { percent } from "@/lib/chat-account-switch";
30
+ import { bucketResetsAt, formatResetCountdown } from "@/components/settings/accounts/account-usage-format";
30
31
  import type { SessionInfo, UsageInfo } from "../../../types/chat";
31
32
  import type { TeamMessageItem } from "@/hooks/use-chat";
32
33
  import { SessionDebugDialog } from "./session-debug-dialog";
@@ -125,6 +126,12 @@ export function ChatFooterTools({
125
126
  const listed = switcher.accounts.find((a) => a.id === currentId);
126
127
  const fiveHourPct = usageMatches ? percent(usageInfo.fiveHour) : listed?.fiveHourPct ?? null;
127
128
  const weekPct = usageMatches ? percent(usageInfo.sevenDay) : listed?.weekPct ?? null;
129
+ const fiveHourResetsAt = usageMatches
130
+ ? bucketResetsAt(usageInfo.session) ?? usageInfo.fiveHourResetsAt ?? null
131
+ : listed?.fiveHourResetsAt ?? null;
132
+ const weekResetsAt = usageMatches
133
+ ? bucketResetsAt(usageInfo.weekly) ?? usageInfo.sevenDayResetsAt ?? null
134
+ : listed?.weekResetsAt ?? null;
128
135
  const hasUsage = fiveHourPct != null || weekPct != null;
129
136
  // Reconnecting or offline on a narrow chat: the figures are stale, and their room goes to the
130
137
  // connection chip.
@@ -134,10 +141,16 @@ export function ChatFooterTools({
134
141
  const accountLabel = pickedAccountLabel ?? (usageMatches ? usageInfo.activeAccountLabel : null) ?? listed?.label ?? null;
135
142
  const plan = listed?.plan ?? null;
136
143
  const who = `${accountLabel ?? "Default account"} · ${providerName}${plan ? ` ${plan}` : ""}`;
144
+ // A quick view: the countdown alone, "5h 47% (resets in 3h 12m)".
145
+ const windowTitle = (label: string, pct: number | null, resetsAt: string | null) => {
146
+ if (pct == null) return null;
147
+ const reset = formatResetCountdown(resetsAt);
148
+ return `${label} ${pct}%${reset ? ` (resets ${reset})` : ""}`;
149
+ };
137
150
  const ringTitle = [
138
151
  accountLabel,
139
- fiveHourPct != null ? `5h ${fiveHourPct}%` : null,
140
- weekPct != null ? `Week ${weekPct}%` : null,
152
+ windowTitle("5h", fiveHourPct, fiveHourResetsAt),
153
+ windowTitle("Week", weekPct, weekResetsAt),
141
154
  ].filter(Boolean).join(" · ");
142
155
 
143
156
  return (
@@ -219,6 +232,8 @@ export function ChatFooterTools({
219
232
  who={hasAccounts ? who : undefined}
220
233
  fiveHourPct={fiveHourPct}
221
234
  weekPct={weekPct}
235
+ fiveHourResetsAt={fiveHourResetsAt}
236
+ weekResetsAt={weekResetsAt}
222
237
  sessionCostUsd={usageInfo.totalCostUsd ?? null}
223
238
  accountCount={switcher.loading ? null : Math.max(switcher.accounts.length, 1)}
224
239
  onSwitchAccount={hasAccounts ? () => setMoreView("accounts") : undefined}
@@ -18,6 +18,9 @@ export interface ChatMoreMenuProps {
18
18
  who?: string | null;
19
19
  fiveHourPct?: number | null;
20
20
  weekPct?: number | null;
21
+ /** When each window resets (ISO); the meters show the countdown beside the figure. */
22
+ fiveHourResetsAt?: string | null;
23
+ weekResetsAt?: string | null;
21
24
  /** Shown under the meters when the provider reports spend. */
22
25
  sessionCostUsd?: number | null;
23
26
  /** How many accounts the provider has, once known. */
@@ -38,7 +41,7 @@ export interface ChatMoreMenuProps {
38
41
  }
39
42
 
40
43
  export function ChatMoreMenu({
41
- who, fiveHourPct = null, weekPct = null, sessionCostUsd, accountCount, onSwitchAccount, providerId,
44
+ who, fiveHourPct = null, weekPct = null, fiveHourResetsAt = null, weekResetsAt = null, sessionCostUsd, accountCount, onSwitchAccount, providerId,
42
45
  onOpenAISettings, team, isConnected, onReload, session,
43
46
  }: ChatMoreMenuProps) {
44
47
  const [moreOpen, setMoreOpen] = useState(false);
@@ -49,8 +52,8 @@ export function ChatMoreMenu({
49
52
  <>
50
53
  <div className="px-2 pb-2.5 pt-2 max-md:px-4">
51
54
  <div className="mb-2 truncate text-[11px] text-text-3">{who ?? "Usage"}</div>
52
- <UsageMeter label="5 hours" pct={fiveHourPct} />
53
- <UsageMeter label="Week" pct={weekPct} />
55
+ <UsageMeter label="5 hours" pct={fiveHourPct} resetsAt={fiveHourResetsAt} />
56
+ <UsageMeter label="Week" pct={weekPct} resetsAt={weekResetsAt} />
54
57
  {sessionCostUsd != null && (
55
58
  <div className="mt-1.5 text-[11px] tabular-nums text-text-3">This session ${sessionCostUsd.toFixed(4)}</div>
56
59
  )}
@@ -17,7 +17,7 @@ import { toast } from "sonner";
17
17
  import { ChevronDown, Link, Link2Off, RotateCcw, Square } from "@/lib/icons";
18
18
  import { cn } from "@/lib/utils";
19
19
  import type { LinkedSessionGroups, LinkedSessionView } from "@/hooks/use-linked-sessions";
20
- import { LINKED_STATUS_TEXT, RELATION_TEXT } from "@/lib/linked-sessions";
20
+ import { byAttention, LINKED_STATUS_TEXT, RELATION_TEXT } from "@/lib/linked-sessions";
21
21
  import { openLinkedSession, stopChildSessions } from "@/lib/session-collab-client";
22
22
  import { canUnlink } from "../../../shared/linked-session-unlinks";
23
23
  import type { SessionLinkRelation } from "../../../shared/session-collab";
@@ -109,9 +109,9 @@ export function LinkedSessionsPanel({ projectName, sessionId, groups, onOpened }
109
109
  }
110
110
  };
111
111
 
112
- // A heading with nothing under it goes too.
112
+ // A heading with nothing under it goes too. Inside each, what needs the person or runs comes first.
113
113
  const grouped = GROUP_ORDER
114
- .map((relation) => ({ relation, sessions: visible.filter((l) => (l.relations[0] ?? "messaged") === relation) }))
114
+ .map((relation) => ({ relation, sessions: byAttention(visible.filter((l) => (l.relations[0] ?? "messaged") === relation)) }))
115
115
  .filter((g) => g.sessions.length > 0);
116
116
 
117
117
  return (
@@ -16,6 +16,7 @@ import { CheckCircle2, ChevronDown, ChevronLeft, Loader2, Lock, Plus, Search, Se
16
16
  import { cn } from "@/lib/utils";
17
17
  import { matchesAccountQuery, orderSwitchAccounts, type SwitchAccount } from "@/lib/chat-account-switch";
18
18
  import { UsageTrack } from "./usage-meters";
19
+ import { formatResetLine } from "@/components/settings/accounts/account-usage-format";
19
20
  import { FooterButton, FooterPopoverFooter, FooterPopoverHeader } from "./footer-popover";
20
21
 
21
22
  /** From this many accounts on, the view searches and folds the unusable ones away. */
@@ -217,9 +218,9 @@ function AccountCard({ account: a, active, picking, onPick }: {
217
218
  <span className={cn("-mt-1 whitespace-nowrap text-[11px] text-error", a.signedOut && "underline decoration-error/40 underline-offset-2")}>{a.refusal}</span>
218
219
  )}
219
220
  {!a.signedOut && (
220
- <span className="grid grid-cols-2 gap-2.5">
221
- <Meter label="5h" pct={a.fiveHourPct} dim={blocked} />
222
- <Meter label="Week" pct={a.weekPct} dim={blocked} />
221
+ <span className="grid grid-cols-2 items-start gap-2.5">
222
+ <Meter label="5h" pct={a.fiveHourPct} resetsAt={a.fiveHourResetsAt} dim={blocked} />
223
+ <Meter label="Week" pct={a.weekPct} resetsAt={a.weekResetsAt} dim={blocked} />
223
224
  </span>
224
225
  )}
225
226
  </button>
@@ -229,13 +230,19 @@ function AccountCard({ account: a, active, picking, onPick }: {
229
230
  /**
230
231
  * Label and figure take fixed columns, so every bar on every card is the same length: sized by
231
232
  * their own text, "5h" left a longer bar than "Week", and "100%" a shorter one than "8%".
233
+ * Under the bar, when it resets — countdown and clock, "Resets in 3h 12m · 03:52" — in red once
234
+ * the bar is full, since that line is then the answer to "when can I use it again".
232
235
  */
233
- function Meter({ label, pct, dim }: { label: string; pct: number | null; dim: boolean }) {
236
+ function Meter({ label, pct, resetsAt, dim }: { label: string; pct: number | null; resetsAt: string | null; dim: boolean }) {
237
+ const reset = formatResetLine(resetsAt);
234
238
  return (
235
- <span className="grid grid-cols-[30px_minmax(0,1fr)_32px] items-center gap-1.5 whitespace-nowrap text-[11px] text-text-3">
239
+ <span className="grid grid-cols-[30px_minmax(0,1fr)_32px] items-center gap-x-1.5 gap-y-0.5 whitespace-nowrap text-[11px] text-text-3">
236
240
  <span>{label}</span>
237
241
  <UsageTrack pct={pct} />
238
242
  <span className={cn("text-right tabular-nums", dim ? "text-text-3" : "text-text-2")}>{pct != null ? `${pct}%` : "--%"}</span>
243
+ {reset && (
244
+ <span data-account-reset="" className={cn("col-span-3 truncate text-[10.5px] tabular-nums", (pct ?? 0) >= 100 ? "font-medium text-error" : "text-text-3")}>{reset}</span>
245
+ )}
239
246
  </span>
240
247
  );
241
248
  }
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { cn } from "@/lib/utils";
8
8
  import { usageTone } from "@/lib/chat-account-switch";
9
+ import { formatResetCountdown } from "@/components/settings/accounts/account-usage-format";
9
10
 
10
11
  const RING_LENGTH = 31.4; // 2π · r=5
11
12
 
@@ -62,13 +63,18 @@ export function UsageTrack({ pct, className }: { pct: number | null; className?:
62
63
  );
63
64
  }
64
65
 
65
- /** One labelled meter row: "5 hours ▬▬▬── 47%". */
66
- export function UsageMeter({ label, pct }: { label: string; pct: number | null }) {
66
+ /**
67
+ * One labelled meter row: "5 hours ▬▬▬── 47% in 3h 12m". A quick view, so the reset is the
68
+ * countdown alone; Switch account's cards add the clock time.
69
+ */
70
+ export function UsageMeter({ label, pct, resetsAt }: { label: string; pct: number | null; resetsAt?: string | null }) {
71
+ const reset = formatResetCountdown(resetsAt);
67
72
  return (
68
73
  <div className="mt-1.5 flex items-center gap-2 text-[11px] text-text-2">
69
74
  <span className="w-[52px] shrink-0">{label}</span>
70
75
  <UsageTrack pct={pct} className="flex-1" />
71
76
  <span className="w-9 shrink-0 text-right tabular-nums">{pct != null ? `${pct}%` : "--%"}</span>
77
+ <span data-meter-reset="" className="w-16 shrink-0 text-right text-[10.5px] tabular-nums text-text-3">{reset ?? ""}</span>
72
78
  </div>
73
79
  );
74
80
  }
@@ -67,6 +67,62 @@ export function formatResetAt(resetsAt?: string | null): string | null {
67
67
  return new Date(ms).toLocaleString(undefined, { dateStyle: "medium", timeStyle: "short" });
68
68
  }
69
69
 
70
+ /**
71
+ * When a bucket resets, as an ISO timestamp, whichever of the three shapes the server sent.
72
+ * A countdown is turned into a moment once, here, so it keeps counting down after it arrived.
73
+ */
74
+ export function bucketResetsAt(bucket?: LimitBucket | null, now = Date.now()): string | null {
75
+ if (!bucket) return null;
76
+ if (bucket.resetsAt && Number.isFinite(new Date(bucket.resetsAt).getTime())) return bucket.resetsAt;
77
+ if (bucket.resetsInMinutes != null) return new Date(now + bucket.resetsInMinutes * 60_000).toISOString();
78
+ if (bucket.resetsInHours != null) return new Date(now + bucket.resetsInHours * 3_600_000).toISOString();
79
+ return null;
80
+ }
81
+
82
+ /**
83
+ * The countdown to a reset in two units at most — "in 3h 12m", "in 2d 8h", "in 40m" — the way
84
+ * the quick views (the ··· menu, the usage rings' tooltip) say it. "now" once it has passed.
85
+ */
86
+ export function formatResetCountdown(resetsAt: string | null | undefined, now = Date.now()): string | null {
87
+ if (!resetsAt) return null;
88
+ const at = new Date(resetsAt).getTime();
89
+ if (!Number.isFinite(at)) return null;
90
+ const mins = Math.ceil((at - now) / 60_000);
91
+ if (mins <= 0) return "now";
92
+ const d = Math.floor(mins / 1440), h = Math.floor((mins % 1440) / 60), m = mins % 60;
93
+ if (d > 0) return `in ${d}d${h > 0 ? ` ${h}h` : ""}`;
94
+ if (h > 0) return `in ${h}h${m > 0 ? ` ${m}m` : ""}`;
95
+ return `in ${m}m`;
96
+ }
97
+
98
+ const CLOCK: Intl.DateTimeFormatOptions = { hour: "2-digit", minute: "2-digit", hourCycle: "h23" };
99
+
100
+ /**
101
+ * The clock time of a reset in the viewer's zone, as short as it can be without being
102
+ * ambiguous: "03:52" within 12 hours, "today 18:00" later the same day, "Thu 09:00" within the
103
+ * week, "Nov 18 09:00" beyond it.
104
+ */
105
+ export function formatResetClock(resetsAt: string | null | undefined, now = Date.now()): string | null {
106
+ if (!resetsAt) return null;
107
+ const at = new Date(resetsAt);
108
+ if (!Number.isFinite(at.getTime())) return null;
109
+ const time = at.toLocaleTimeString("en-US", CLOCK);
110
+ const diff = at.getTime() - now;
111
+ if (diff <= 12 * 3_600_000) return time;
112
+ const today = new Date(now);
113
+ if (at.toDateString() === today.toDateString()) return `today ${time}`;
114
+ if (diff < 6.5 * 86_400_000) return `${at.toLocaleDateString("en-US", { weekday: "short" })} ${time}`;
115
+ return `${at.toLocaleDateString("en-US", { month: "short", day: "numeric" })} ${time}`;
116
+ }
117
+
118
+ /** Both, for Switch account's cards: "Resets in 3h 12m · 03:52". */
119
+ export function formatResetLine(resetsAt: string | null | undefined, now = Date.now()): string | null {
120
+ const countdown = formatResetCountdown(resetsAt, now);
121
+ if (!countdown) return null;
122
+ if (countdown === "now") return "Resets now";
123
+ return `Resets ${countdown} · ${formatResetClock(resetsAt, now)}`;
124
+ }
125
+
70
126
  export function formatExpiry(expiresAtMs: number): string {
71
127
  const diff = expiresAtMs - Date.now();
72
128
  if (diff <= 0) return "expired";
@@ -10,7 +10,7 @@
10
10
  */
11
11
  import type { AccountInfo, AccountUsageEntry, OAuthProfileData } from "./api-settings";
12
12
  import type { LimitBucket } from "../../types/chat";
13
- import { formatResetTime } from "@/components/settings/accounts/account-usage-format";
13
+ import { bucketResetsAt } from "@/components/settings/accounts/account-usage-format";
14
14
 
15
15
  export interface SwitchAccount {
16
16
  id: string;
@@ -19,6 +19,9 @@ export interface SwitchAccount {
19
19
  plan: string | null;
20
20
  fiveHourPct: number | null;
21
21
  weekPct: number | null;
22
+ /** When each window resets (ISO), shown under its bar; null when the provider did not say. */
23
+ fiveHourResetsAt: string | null;
24
+ weekResetsAt: string | null;
22
25
  /** Why this account cannot take a turn now. Present means it is not selectable. */
23
26
  refusal: string | null;
24
27
  /** The login was refused: signing in again is the way back, and the row offers it. */
@@ -38,16 +41,11 @@ function atCap(util: number | null | undefined): boolean {
38
41
  /**
39
42
  * Reached, not approaching: the router steers away from 95% to spread load early, but an account
40
43
  * at 96% still answers. At 100% the next turn fails outright, which is where saying no is true.
44
+ * When it comes back is said under the full bar, so the refusal names only the window.
41
45
  */
42
46
  function limitRefusal(session?: LimitBucket, weekly?: LimitBucket): string | null {
43
- if (atCap(session?.utilization)) {
44
- const reset = session?.resetsAt ? formatResetTime(session) : null;
45
- return `5-hour limit reached${reset ? ` · resets ${reset === "now" ? "now" : `in ${reset}`}` : ""}`;
46
- }
47
- if (atCap(weekly?.utilization)) {
48
- const reset = weekly?.resetsAt ? formatResetTime(weekly) : null;
49
- return `Weekly limit reached${reset ? ` · resets ${reset === "now" ? "now" : `in ${reset}`}` : ""}`;
50
- }
47
+ if (atCap(session?.utilization)) return "5-hour limit reached";
48
+ if (atCap(weekly?.utilization)) return "Weekly limit reached";
51
49
  return null;
52
50
  }
53
51
 
@@ -75,6 +73,8 @@ export function claudeSwitchAccount(entry: AccountUsageEntry, info?: AccountInfo
75
73
  plan: claudePlanLabel(info?.profileData),
76
74
  fiveHourPct: percent(entry.usage.session?.utilization),
77
75
  weekPct: percent(entry.usage.weekly?.utilization),
76
+ fiveHourResetsAt: bucketResetsAt(entry.usage.session),
77
+ weekResetsAt: bucketResetsAt(entry.usage.weekly),
78
78
  refusal,
79
79
  signedOut,
80
80
  };
@@ -110,6 +110,8 @@ export function codexSwitchAccount(account: CodexAccountLike, usage: CodexUsageL
110
110
  plan,
111
111
  fiveHourPct: percent(usage.session?.utilization ?? usage.fiveHour),
112
112
  weekPct: percent(usage.weekly?.utilization ?? usage.sevenDay),
113
+ fiveHourResetsAt: bucketResetsAt(usage.session),
114
+ weekResetsAt: bucketResetsAt(usage.weekly),
113
115
  refusal,
114
116
  signedOut,
115
117
  };
@@ -114,6 +114,16 @@ export function linkedSessionStatus(sessionId: string, { streaming, notification
114
114
  return "idle";
115
115
  }
116
116
 
117
+ const ATTENTION_RANK: Record<LinkedSessionStatus, number> = { needs_approval: 0, running: 1, new_message: 2, idle: 3 };
118
+
119
+ /**
120
+ * A list's order for the person reading it: the sessions waiting on them first, then the ones
121
+ * running, then unread answers, then the idle and done. Stable, so equals keep their order.
122
+ */
123
+ export function byAttention<T extends { status: LinkedSessionStatus }>(sessions: readonly T[]): T[] {
124
+ return [...sessions].sort((a, b) => ATTENTION_RANK[a.status] - ATTENTION_RANK[b.status]);
125
+ }
126
+
117
127
  export const LINKED_STATUS_TEXT: Record<LinkedSessionStatus, string> = {
118
128
  running: "Running",
119
129
  idle: "Idle",
@@ -1 +0,0 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import{Rn as r,gt as i,ln as a,xn as o}from"./icons-C1wDt09O.js";import{a as s,n as c,r as l}from"./api-client-BnYFnEfK.js";import{t as u}from"./button-CE-YGfFD.js";import{a as d,i as f,n as p,o as m,r as h,t as g}from"./dialog-DY9KvCIt.js";import{t as _}from"./input-Dln1TrJi.js";import{Ir as v}from"./index-BHvvTbga.js";import{c as y,g as b,i as x,l as S,s as C,t as w,u as T}from"./api-settings-DiEZFMDk.js";function E(e){return e>=90?`text-error`:e>=70?`text-warning`:`text-success`}function D(e){return e>=90?`bg-error`:e>=70?`bg-warning`:`bg-success`}function O(e){if(!e)return null;let t=null;if(e.resetsInMinutes!=null)t=e.resetsInMinutes;else if(e.resetsInHours!=null)t=Math.round(e.resetsInHours*60);else if(e.resetsAt){let n=new Date(e.resetsAt).getTime()-Date.now();t=n>0?Math.ceil(n/6e4):0}if(t==null)return null;if(t<=0)return`now`;let n=Math.floor(t/1440),r=Math.floor(t%1440/60),i=t%60;return n>0?i>0?`${n}d ${r}h ${i}m`:r>0?`${n}d ${r}h`:`${n}d`:r>0?i>0?`${r}h ${i}m`:`${r}h`:`${i}m`}function k(e){if(!e)return null;let t=new Date(e).getTime();return Number.isFinite(t)?new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null}function A(e){let t=e-Date.now();if(t<=0)return`expired`;let n=Math.ceil(t/6e4),r=Math.floor(n/60),i=Math.floor(r/24);return i>0?`${i}d ${r%24}h`:r>0?`${r}h ${n%60}m`:`${n}m`}function j(e){if(!e)return{label:`unknown`,tip:`No account info available`,color:`text-text-subtle`};if(!e.expiresAt)return{label:`key`,tip:`API key (no expiry)`,color:`text-text-subtle`};if(e.reauthRequired)return{label:`sign in again`,tip:`Anthropic rejected this account's refresh token. Sign in again to restore it.`,color:`text-error`};let t=e.expiresAt*1e3<Date.now();return t&&e.hasRefreshToken?{label:`expired`,tip:`Token expired but has refresh token — will auto-renew`,color:`text-warning`}:t?{label:`expired`,tip:`Token expired, no refresh token`,color:`text-error`}:e.hasRefreshToken?{label:`long-lived`,tip:`OAuth token with refresh — long-lived`,color:`text-success`}:{label:`temp`,tip:`Temporary token without refresh — will expire`,color:`text-warning`}}function M(e){if(!e)return null;let t=Math.round((Date.now()-e)/1e3);if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60),i=n%60;return r<24?i>0?`${r}h ${i}m ago`:`${r}h ago`:`${Math.floor(r/24)}d ago`}var N=e(t(),1),P=n();function F({open:e,onOpenChange:t,onSuccess:n,signInAgainFor:r}){let[i,a]=(0,N.useState)(``),[s,l]=(0,N.useState)(``),[y,b]=(0,N.useState)(!1),[S,C]=(0,N.useState)(null),[E,D]=(0,N.useState)(null),[O,k]=(0,N.useState)(``),[A,j]=(0,N.useState)(!1),[M,F]=(0,N.useState)(`idle`);function I(){D(null),k(``),F(`idle`),C(null)}function L(){t(!1),I(),a(``),l(``),C(null)}async function R(){j(!0),C(null);try{let{url:e,state:t}=await T();D(t),F(`waiting`),window.open(e,`_blank`)}catch(e){C(e.message)}j(!1)}async function z(){if(!(!O.trim()||!E)){j(!0),C(null);try{let e=await x(O.trim(),E);L(),r&&e&&e.id!==r.id?n(`Signed in to ${e.email||e.label||e.id.slice(0,8)}, not ${r.label}. ${r.label} is still signed out — click "Sign in again" on it to fix it.`):n(e?.status===`disabled`?`Signed in. This account is still disabled — enable it to use it.`:`Account connected via OAuth!`)}catch(e){e instanceof c&&e.status===410&&I(),C(e.message)}j(!1)}}async function B(){if(i.trim()){b(!0),C(null);try{let e=await w({apiKey:i.trim(),label:s.trim()||void 0});L(),n(e?.status===`disabled`?`Token updated. This account is still disabled — enable it to use it.`:`Account added!`)}catch(e){C(e.message)}b(!1)}}let V=i.trim()?i.trim().startsWith(`sk-ant-oat`)?`OAuth token (Claude Max/Pro)`:i.trim().startsWith(`sk-ant-api`)?`API key`:`Unknown format`:``;return(0,P.jsx)(g,{open:e,onOpenChange:e=>{e||L()},children:(0,P.jsxs)(p,{className:`sm:max-w-md`,children:[(0,P.jsxs)(d,{children:[(0,P.jsx)(m,{className:`text-sm`,children:r?`Sign in again — ${r.label}`:`Add Claude Account`}),(0,P.jsx)(h,{className:`text-xs leading-relaxed`,children:r?`Log in with the same Claude account. PPM matches it by email and renews the existing card instead of adding a new one.`:`Connect via OAuth (recommended) or paste a token manually.`})]}),(0,P.jsxs)(`div`,{className:`space-y-3`,children:[(0,P.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2`,children:[(0,P.jsx)(`p`,{className:`text-[11px] font-medium`,children:`Recommended: Login with Claude`}),M===`idle`?(0,P.jsx)(u,{size:`sm`,className:`w-full h-8 text-xs`,onClick:R,disabled:A,children:A?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(o,{className:`size-3 animate-spin mr-1`}),` Opening...`]}):`Login with Claude`}):(0,P.jsxs)(`div`,{className:`space-y-2`,children:[(0,P.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Authorize in the opened tab, then paste the code:`}),(0,P.jsx)(_,{placeholder:`Paste code here...`,value:O,onChange:e=>k(e.target.value),className:`text-xs h-8 font-mono`,autoFocus:!0}),(0,P.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,P.jsx)(u,{size:`sm`,className:`flex-1 h-7 text-xs`,onClick:z,disabled:!O.trim()||A,children:A?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(o,{className:`size-3 animate-spin mr-1`}),` Connecting...`]}):`Connect`}),(0,P.jsx)(u,{size:`sm`,variant:`ghost`,className:`h-7 text-xs`,onClick:I,children:`Cancel`})]})]})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`div`,{className:`flex-1 border-t`}),(0,P.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`or paste token`}),(0,P.jsx)(`div`,{className:`flex-1 border-t`})]}),(0,P.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,P.jsx)(v,{htmlFor:`add-token`,className:`text-xs`,children:`Token`}),(0,P.jsx)(_,{id:`add-token`,type:`password`,placeholder:`sk-ant-...`,value:i,onChange:e=>a(e.target.value),className:`text-xs h-8 font-mono`}),V&&(0,P.jsxs)(`p`,{className:`text-[10px] text-muted-foreground`,children:[`Detected: `,V]})]}),(0,P.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,P.jsx)(v,{htmlFor:`add-label`,className:`text-xs`,children:`Label (optional)`}),(0,P.jsx)(_,{id:`add-label`,placeholder:`e.g. Personal, Work`,value:s,onChange:e=>l(e.target.value),className:`text-xs h-8`})]})]}),S&&(0,P.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:S}),(0,P.jsxs)(f,{children:[(0,P.jsx)(u,{size:`sm`,variant:`outline`,className:`text-xs h-7`,onClick:L,children:`Cancel`}),(0,P.jsx)(u,{size:`sm`,className:`text-xs h-7`,onClick:B,disabled:!i.trim()||y,children:y?`Adding...`:`Add Token`})]})]})})}function I({open:e,onOpenChange:t,label:n,onLabelChange:s,apiKey:c,onApiKeyChange:l,adding:y,onAddApiKey:b,deviceWaiting:x,onStartDevice:S,device:C,error:w,browser:T,onStartBrowser:E,loginStarting:D,callbackUrl:O,onCallbackUrlChange:k,submittingCallback:A,onSubmitCallback:j,reloginLabel:M}){let N=D||x||!!T||y;return(0,P.jsx)(g,{open:e,onOpenChange:t,children:(0,P.jsxs)(p,{className:`sm:max-w-md max-h-[90dvh] overflow-y-auto`,children:[(0,P.jsxs)(d,{children:[(0,P.jsx)(m,{className:`text-sm`,children:M?`Sign in again — ${M}`:`Add Codex Account`}),(0,P.jsx)(h,{className:`text-xs leading-relaxed`,children:M?`Sign in with ChatGPT to renew this account. It keeps its name, its settings and the chats bound to it.`:`Choose browser login, a device code, or an OpenAI API key.`})]}),(0,P.jsxs)(`div`,{className:`space-y-3`,children:[!M&&(0,P.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,P.jsx)(v,{htmlFor:`codex-label`,className:`text-xs`,children:`Label (optional)`}),(0,P.jsx)(_,{id:`codex-label`,placeholder:`e.g. Personal, Work`,value:n,onChange:e=>s(e.target.value),disabled:N,className:`text-xs`})]}),(0,P.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2`,children:[(0,P.jsx)(`p`,{className:`text-[11px] font-medium`,children:`Browser login`}),(0,P.jsxs)(u,{size:`sm`,className:`w-full cursor-pointer gap-1.5`,onClick:E,disabled:N,children:[(0,P.jsx)(i,{className:`size-4`}),` Sign in with browser`]}),T&&(0,P.jsxs)(`div`,{className:`space-y-2 text-xs`,children:[(0,P.jsxs)(`a`,{href:T.authUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-primary hover:underline`,children:[(0,P.jsx)(i,{className:`size-3`}),` Open ChatGPT sign-in`]}),(0,P.jsx)(`p`,{children:`Sign in, then copy the full localhost callback URL from the address bar and paste it below. On a phone, copy it even if the page fails to load.`}),(0,P.jsx)(v,{htmlFor:`codex-callback-url`,children:`Callback URL`}),(0,P.jsx)(_,{id:`codex-callback-url`,type:`password`,autoComplete:`off`,spellCheck:!1,placeholder:`http://localhost:.../auth/callback?...`,value:O,onChange:e=>k(e.target.value),disabled:A}),(0,P.jsxs)(u,{size:`sm`,onClick:j,disabled:!O.trim()||A,children:[A&&(0,P.jsx)(o,{className:`size-3 animate-spin`}),` Submit callback URL`]}),(0,P.jsxs)(`p`,{role:`status`,className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,P.jsx)(o,{className:`size-3 animate-spin`}),` Waiting for authorization. This may complete automatically on this computer.`]})]})]}),(0,P.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2`,children:[(0,P.jsx)(`p`,{className:`text-[11px] font-medium`,children:`Device code`}),(0,P.jsx)(u,{size:`sm`,className:`w-full cursor-pointer gap-1.5`,onClick:S,disabled:N,children:x?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(o,{className:`size-4 animate-spin`}),` Waiting for authorization...`]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(r,{className:`size-4`}),` Sign in with device code`]})}),C&&(0,P.jsxs)(`div`,{className:`rounded-md border border-primary/40 bg-primary/10 p-2.5 space-y-1.5`,children:[(0,P.jsx)(`p`,{className:`text-[11px]`,children:`Enter this code to authorize:`}),(0,P.jsx)(`div`,{className:`font-mono text-lg tracking-widest`,children:C.userCode}),(0,P.jsxs)(`a`,{href:C.verificationUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-primary hover:underline text-[11px]`,children:[(0,P.jsx)(i,{className:`size-3`}),` `,C.verificationUrl]})]})]}),!M&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`div`,{className:`flex-1 border-t`}),(0,P.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`or paste an API key`}),(0,P.jsx)(`div`,{className:`flex-1 border-t`})]}),(0,P.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,P.jsx)(v,{htmlFor:`codex-api-key`,className:`text-xs`,children:`OpenAI API key`}),(0,P.jsx)(_,{id:`codex-api-key`,type:`password`,placeholder:`sk-...`,value:c,onChange:e=>l(e.target.value),className:`text-xs font-mono`})]})]})]}),D&&(0,P.jsx)(`p`,{role:`status`,className:`text-xs`,children:`Starting login...`}),w&&(0,P.jsx)(`div`,{role:`alert`,className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:w}),(0,P.jsxs)(f,{children:[(0,P.jsx)(u,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Cancel`}),!M&&(0,P.jsxs)(u,{size:`sm`,className:`text-xs cursor-pointer gap-1.5`,onClick:b,disabled:!c.trim()||N,children:[y?(0,P.jsx)(o,{className:`size-3.5 animate-spin`}):(0,P.jsx)(a,{className:`size-3.5`}),`Add key`]})]})]})})}var L=`Codex rejected this account's login (revoked or expired), so no turn can run on it and it is skipped. The usage shown is the last reading. Click to sign in again — the account keeps its settings and chats.`,R=2e3,z=21e4;function B(e){let[t,n]=(0,N.useState)([]),[r,i]=(0,N.useState)(`round-robin`),[a,o]=(0,N.useState)({}),[c,u]=(0,N.useState)(!1),[d,f]=(0,N.useState)(new Set),[p,m]=(0,N.useState)(``),[h,g]=(0,N.useState)(``),[_,v]=(0,N.useState)(!1),[y,b]=(0,N.useState)(null),[x,S]=(0,N.useState)(null),[C,w]=(0,N.useState)(!1),[T,E]=(0,N.useState)(null),[D,O]=(0,N.useState)(!1),[k,A]=(0,N.useState)(``),[j,M]=(0,N.useState)(!1),[P,F]=(0,N.useState)(``),[I,L]=(0,N.useState)(!1),[B,V]=(0,N.useState)(!1),[H,U]=(0,N.useState)(null),W=(0,N.useRef)(null),G=(0,N.useRef)(null),K=(0,N.useRef)(0),q=(0,N.useRef)(!1),J=(0,N.useRef)(!1),Y=(0,N.useRef)(!1),X=(0,N.useRef)(e);X.current=e;let Z=(0,N.useCallback)(async()=>{u(!0);try{let e=await l.get(`/api/codex-accounts`);n(e.accounts),i(e.strategy),l.get(`/api/codex-accounts/usage`).then(o).catch(()=>{})}finally{u(!1)}},[]);(0,N.useEffect)(()=>{Z()},[Z]);let ee=async()=>{if(!(!p.trim()||J.current||q.current||G.current)){J.current=!0,v(!0),b(null);try{await l.post(`/api/codex-accounts/api-key`,{apiKey:p.trim(),label:h.trim()||void 0}),m(``),g(``),e(),await Z()}catch(e){b(e.message)}finally{J.current=!1,v(!1)}}},Q=(0,N.useCallback)(()=>{K.current+=1,q.current=!1,Y.current=!1,W.current?.(),W.current=null;let e=G.current;G.current=null,e&&l.del(`/api/codex-accounts/${e.method}-login/${e.id}`).catch(()=>{})},[]),$=(0,N.useCallback)(()=>{Q(),S(null),w(!1),E(null),O(!1),A(``),M(!1)},[Q]),te=(0,N.useCallback)((e,t)=>{let n=Date.now()+(t===`browser`?61e4:z),r=!1,i;W.current=()=>{r=!0,clearTimeout(i)};let a=async()=>{if(r)return;let o=null;try{o=await l.get(`/api/codex-accounts/${t}-login/${e}/status`)}catch{}if(!r){if(o?.state===`done`){$(),g(``),X.current(),await Z();return}if(o?.state===`error`||Date.now()>n){$(),b(o?.state===`error`?o.error:`${t===`browser`?`Browser`:`Device`} login timed out.`);return}i=setTimeout(a,R)}};a()},[$,Z]);(0,N.useEffect)(()=>Q,[Q]);let ne=async(e,t)=>{if(q.current||G.current||J.current)return;q.current=!0;let n=++K.current;O(!0),b(null);try{let r=await l.post(`/api/codex-accounts/${e}-login`,{label:h.trim()||void 0,...t?{accountId:t}:{}});if(n!==K.current){l.del(`/api/codex-accounts/${e}-login/${r.id}`).catch(()=>{});return}G.current={id:r.id,method:e},e===`device`?(S(r),w(!0)):E(r),te(r.id,e)}catch(e){n===K.current&&b(e.message)}finally{n===K.current&&(q.current=!1,O(!1))}};return{accounts:t,strategy:r,usages:a,loading:c,apiKey:p,setApiKey:m,label:h,setLabel:g,adding:_,err:y,setErr:b,device:x,deviceWaiting:C,backupPassword:P,setBackupPassword:F,exporting:I,importing:B,msg:H,setMsg:U,toggling:d,load:Z,addApiKey:ee,startDevice:e=>ne(`device`,e),startBrowser:e=>ne(`browser`,e),browser:T,loginStarting:D,callbackUrl:k,setCallbackUrl:A,submittingCallback:j,submitCallback:async()=>{let e=G.current;if(e?.method!==`browser`||!k.trim()||Y.current)return;let t=K.current;Y.current=!0,M(!0),b(null);let n=k.trim();A(``);try{await l.post(`/api/codex-accounts/browser-login/${e.id}/callback`,{callbackUrl:n})}catch(e){t===K.current&&b(e.message)}finally{t===K.current&&(Y.current=!1,M(!1))}},cancelLogin:$,remove:async e=>{await l.del(`/api/codex-accounts/${e}`),await Z()},toggle:async(e,t)=>{let n=t===`disabled`?`active`:`disabled`;f(t=>new Set(t).add(e)),b(null);try{await l.patch(`/api/codex-accounts/${e}`,{status:n}),await Z()}catch(e){b(e.message||`Could not change the account`)}finally{f(t=>{let n=new Set(t);return n.delete(e),n})}},toggleDailyGuard:async(e,t)=>{f(t=>new Set(t).add(e)),b(null);try{await l.patch(`/api/codex-accounts/${e}`,{dailyGuardEnabled:!t}),await Z()}catch(e){b(e.message||`Could not change Daily guard`)}finally{f(t=>{let n=new Set(t);return n.delete(e),n})}},changeStrategy:async e=>{i(e);try{await l.put(`/api/codex-accounts/strategy`,{strategy:e})}catch{}},doExport:async()=>{if(!P.trim()){b(`Set a backup password first.`);return}L(!0),b(null),U(null);try{let t={"Content-Type":`application/json`},n=s();n&&(t.Authorization=`Bearer ${n}`);let r=await fetch(`/api/codex-accounts/export`,{method:`POST`,headers:t,body:JSON.stringify({password:P})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error??`Export failed: ${r.status}`)}let i=await r.text(),a=new Blob([i],{type:`application/json`}),o=document.createElement(`a`);o.href=URL.createObjectURL(a),o.download=`ppm-codex-accounts-backup.json`,o.click(),URL.revokeObjectURL(o.href),U(`Backup downloaded.`),e()}catch(e){b(e.message)}finally{L(!1)}},doImport:async t=>{if(!P.trim()){b(`Enter the backup password first.`);return}V(!0),b(null),U(null);try{let n=await t.text(),r=await l.post(`/api/codex-accounts/import`,{data:n,password:P});U(`Imported ${r.imported}${r.skipped?`, skipped ${r.skipped}`:``}.`),e(),await Z()}catch(e){b(e.message)}finally{V(!1)}}}}function V({account:e,onClose:t,onDone:n}){let r=B(()=>{n(),t()});return(0,P.jsx)(I,{open:!0,onOpenChange:e=>{e||(r.cancelLogin(),t())},reloginLabel:e.label,label:r.label,onLabelChange:r.setLabel,apiKey:``,onApiKeyChange:()=>{},adding:!1,onAddApiKey:()=>{},deviceWaiting:r.deviceWaiting,onStartDevice:()=>void r.startDevice(e.id),device:r.device,browser:r.browser,onStartBrowser:()=>void r.startBrowser(e.id),loginStarting:r.loginStarting,callbackUrl:r.callbackUrl,onCallbackUrlChange:r.setCallbackUrl,submittingCallback:r.submittingCallback,onSubmitCallback:()=>void r.submitCallback(),error:r.err})}var H={usages:null,accounts:[],activeAccountId:null},U=1e4;function W(e){let t=e.usage;return[t.session?.utilization,t.weekly?.utilization,t.weeklyOpus?.utilization,t.weeklySonnet?.utilization,...(t.weeklyScoped??[]).map(e=>`${e.label}:${e.utilization}`)].join(`|`)}function G(e=!0){let[t,n]=(0,N.useState)(()=>H.usages??[]),[r,i]=(0,N.useState)(()=>H.accounts),[a,o]=(0,N.useState)(()=>H.activeAccountId),[s,c]=(0,N.useState)(()=>H.usages===null),[l,u]=(0,N.useState)(!1),[d,f]=(0,N.useState)(new Set),[p,m]=(0,N.useState)(null),h=(0,N.useRef)(H.usages??[]),g=(0,N.useRef)(void 0),_=(0,N.useCallback)(async()=>{let e=h.current.length>0;e?u(!0):c(!0);let t=Promise.all([S().then(t=>{if(e){let e=new Map(h.current.map(e=>[e.accountId,W(e)])),n=new Set(t.filter(t=>e.get(t.accountId)!==W(t)).map(e=>e.accountId));n.size>0&&(f(n),clearTimeout(g.current),g.current=setTimeout(()=>f(new Set),1500))}h.current=t,H.usages=t,n(t)}),C().then(e=>{H.accounts=e,i(e)}),y().then(e=>{H.activeAccountId=e?.id??null,o(H.activeAccountId)})].map(e=>e.catch(()=>{}))),r;await Promise.race([t,new Promise(e=>{r=setTimeout(e,U)})]),clearTimeout(r),c(!1),u(!1)},[]),v=(0,N.useCallback)(async(e,t)=>{m(e);let n=null;try{await b(e,{status:t===`disabled`?`active`:`disabled`})}catch(e){n=e.message}return m(null),await _(),n},[_]);return(0,N.useEffect)(()=>(e&&_(),()=>clearTimeout(g.current)),[e,_]),{usages:t,accounts:r,activeAccountId:a,initialLoading:s,refreshing:l,flashIds:d,reload:_,toggle:v,togglingId:p}}function K(e){return e?.trim()?{free:`ChatGPT Free`,go:`ChatGPT Go`,plus:`ChatGPT Plus`,pro:`ChatGPT Pro`,team:`ChatGPT Team`,business:`ChatGPT Business`,self_serve_business_prolite:`ChatGPT Business`,enterprise:`ChatGPT Enterprise`,edu:`ChatGPT Edu`}[e.trim().toLowerCase()]??e:null}export{B as a,D as c,k as d,O as f,L as i,A as l,j as m,G as n,I as o,E as p,V as r,F as s,K as t,M as u};